Commit ca5f30a8 authored by 张子雨's avatar 张子雨

feat: 开发完成

parent a46207de
......@@ -2,15 +2,15 @@ const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre';
const envAPi = {
api: '//backstms-test4.liangkebang.net',
kdspOpApi: 'https://kdsp-operation-test4.liangkebang.net',
kdspApi: 'https://sc-op-api-test4.liangkebang.net',
goodsApi: 'https://sc-op-api-test4.liangkebang.net',
querysApi: 'https://sc-settlement-api-test4.liangkebang.net',
api: '//backstms-test2.liangkebang.net',
kdspOpApi: 'https://kdsp-operation-test2.liangkebang.net',
kdspApi: 'https://sc-op-api-test2.liangkebang.net',
goodsApi: 'https://sc-op-api-test2.liangkebang.net',
querysApi: 'https://sc-settlement-api-test2.liangkebang.net',
// goodsApi: '//192.168.188.111:7000',
prologueDomain: 'https://mall-test4.liangkebang.net',
prologueDomain: 'https://mall-test2.liangkebang.net',
qiniuHost: 'https://appsync.lkbang.net',
opapiHost: 'https://opapi-test4.liangkebang.net',
opapiHost: 'https://opapi-test2.liangkebang.net',
};
const prodApi = {
......
......@@ -9,6 +9,7 @@ import DetailTable from '../components/detailTable';
import ProofsModal from '../components/proofsModal';
import LogisticsCom from '../../orderManage/pendingDeliveryOrder/components/LogisticsCom';
import AppealDetail from '../../afterSale/components/detail';
import RecordModal from '../components/recordModal';
export default () => {
const table = useRef();
......@@ -22,6 +23,7 @@ export default () => {
const [LogisticsComModalVisible, handleComModalVisible] = useState(false);
const [appealDetailModal, setAppealDetailModal] = useState(false);
const [selectedRow, setSelectedRow] = useState({});
const [recordVisible, setRecordVisible] = useState(false);
const viewDetail = async ({ serviceNo }) => {
const data = await orderDetail({ serviceNo });
setDetailInfo(data || []);
......@@ -85,6 +87,9 @@ export default () => {
setAppealDetailModal(true);
setSelectedRow(detailData);
};
const recordDetail = () => {
setRecordVisible(true);
};
const columns = [
...columnPassAudit,
{
......@@ -110,7 +115,7 @@ export default () => {
{
title: '操作',
hideInSearch: true,
width: 450,
width: 300,
dataIndex: 'action',
fixed: 'right',
render: (_, r) => [
......@@ -122,7 +127,7 @@ export default () => {
key="pop"
disabled={!r.showRefund}
>
<Button key="link1" className="mr10" type="primary" disabled={!r.showRefund}>
<Button key="link1" className="mr10 mt10" type="primary" disabled={!r.showRefund}>
{r.showRefunded ? '已退款' : '允许退款'}
</Button>
</Popconfirm>,
......@@ -130,23 +135,26 @@ export default () => {
key="link2"
onClick={() => reject(r)}
type="primary"
className="mr10"
className="mr10 mt10"
disabled={!r.showRefuse}
>
驳回
</Button>,
<Button key="link3" onClick={() => viewDetail(r)} type="primary" className="mr10">
<Button key="link3" onClick={() => viewDetail(r)} type="primary" className="mr10 mt10">
订单详情
</Button>,
<Button
key="link4"
onClick={() => handleCom(r)}
type="primary"
className="mr10"
className="mr10 mt10"
disabled={!r.showLogistics}
>
查看物流
</Button>,
<Button key="link" className="mr10 mt10" onClick={() => recordDetail(r)} type="primary">
查看记录
</Button>,
],
},
];
......@@ -183,6 +191,12 @@ export default () => {
modalVisible={appealDetailModal}
onCancel={closeModal}
></AppealDetail>
<RecordModal
visible={recordVisible}
onCancel={() => {
setRecordVisible(false);
}}
></RecordModal>
</div>
);
};
import React, { useState, useRef } from 'react';
import { notification, Button } from 'antd';
import { notification, Button, Popconfirm } from 'antd';
import ProTable from '@ant-design/pro-table';
import moment from 'moment';
import _ from 'lodash';
......@@ -10,6 +10,7 @@ import DetailTable from '../components/detailTable';
import ProofsModal from '../components/proofsModal';
import { getDetail } from '../../afterSale/appeal/services';
import AppealDetail from '../../afterSale/components/detail';
import RecordModal from '../components/recordModal';
export default () => {
const table = useRef();
......@@ -23,7 +24,7 @@ export default () => {
const [selectedRow, setSelectedRow] = useState({});
const [timeString, setTimeString] = useState({});
const [time, setTime] = useState({});
const [recordVisible, setRecordVisible] = useState(false);
const viewDetail = async ({ serviceNo }) => {
const data = await orderDetail({ serviceNo });
setDetailInfo(data || []);
......@@ -90,6 +91,14 @@ export default () => {
}, 1000);
}
};
const logistics = info => {
console.log(info);
// eslint-disable-next-line no-unused-expressions
table.current?.reload?.();
};
const recordDetail = () => {
setRecordVisible(true);
};
const columns = [
{
title: '审核倒计时',
......@@ -141,9 +150,23 @@ export default () => {
<Button key="link1" onClick={() => openAudit(r)} className="mr10" type="primary">
审核
</Button>,
<Popconfirm
title="请在48小时内完成物流包裹,确认是否需要进行物流拦截?"
onConfirm={() => logistics(r)}
okText="确认"
cancelText="取消"
key="pop"
>
<Button key="link1" className="mr10" type="primary">
物流拦截
</Button>
</Popconfirm>,
<Button key="link" onClick={() => viewDetail(r)} type="primary">
订单详情
</Button>,
<Button key="link" onClick={() => recordDetail(r)} type="primary">
查看记录
</Button>,
],
},
];
......@@ -173,6 +196,12 @@ export default () => {
modalVisible={appealDetailModal}
onCancel={closeModal}
></AppealDetail>
<RecordModal
visible={recordVisible}
onCancel={() => {
setRecordVisible(false);
}}
></RecordModal>
</div>
);
};
import { Modal, Timeline } from 'antd';
import React, { Component } from 'react';
class RecordModal extends Component {
state = {};
onCancel = () => {
this.props.onCancel();
};
render() {
const { visible, data } = this.props;
return (
<Modal
title="查看记录"
visible={visible}
onCancel={() => this.onCancel()}
footer={null}
width="500px"
>
{data?.length
? data.map((item, index) => (
// eslint-disable-next-line react/no-array-index-key
<Timeline key={`${index}${item.title}`}>
{item.detailList?.map((log, i) => (
// eslint-disable-next-line react/no-array-index-key
<Timeline.Item color={i > 0 ? 'gray' : 'blue'} key={i}>
<p>{log.desc}</p>
<p>{log.logisticsTime}</p>
</Timeline.Item>
))}
</Timeline>
))
: '暂无记录'}
</Modal>
);
}
}
export default RecordModal;
......@@ -54,6 +54,15 @@ export const columnSticData = [
},
width: 100,
},
{
title: '售后类型',
dataIndex: 'dealStatus1',
hideInTable: true,
valueEnum: {
0: '仅退款',
10: '退货退款',
},
},
{
title: '收货人姓名',
dataIndex: 'receiverName',
......
......@@ -55,8 +55,8 @@ class goodsManage extends Component {
this.props.addSpu();
};
setArea = isAll => {
this.props.setArea(isAll);
setArea = (isAll, type) => {
this.props.setArea(isAll, type);
};
render() {
......
......@@ -24,24 +24,12 @@ const TempleatModal = props => {
span: 16,
},
};
const handleOk = async () => {
validateFields(async (error, fieldsValue) => {
if (!error) {
if (isType === 'distribution') {
this.setAfterAddress(fieldsValue);
}
if (isType === 'after') {
this.setTemplate(fieldsValue);
}
}
});
};
const setAfterAddress = async fieldsValue => {
const data = await getAfterAddress({
// isAll: isALL,
skuIds: selectedRowKeys,
skuIds: selectedRowKeys || [],
afterAddressId: fieldsValue.templateId.key,
});
console.log(data);
if (data.businessCode === '0000') {
notification.success({ message: '配置成功!' });
resetFields();
......@@ -60,6 +48,18 @@ const TempleatModal = props => {
props.onCancel();
}
};
const handleOk = async () => {
validateFields(async (error, fieldsValue) => {
if (!error) {
if (isType === 'after') {
setAfterAddress(fieldsValue);
}
if (isType === 'distribution') {
setTemplate(fieldsValue);
}
}
});
};
const title = () => {
if (isType === 'distribution') {
......@@ -70,17 +70,16 @@ const TempleatModal = props => {
}
if (isType === 'after') {
if (isALL) {
return '全部设置不支持配送区域';
return '全部商品售后地址设置';
}
return '批量设置不支持配送区域';
return '勾选商品售后地址设置';
}
return '';
};
useEffect(() => {}, []);
return (
<Modal
title={title}
title={title()}
visible={visible}
width="500px"
onCancel={props.onCancel}
......@@ -93,13 +92,13 @@ const TempleatModal = props => {
rules: [{ required: true, message: '请选择模板!' }],
})(
<Select placeholder="请选择模板" labelInValue allowClear>
{isType === 'after' &&
{isType === 'distribution' &&
templateList.map(item => (
<Option label={item.templateName} value={item.id} key={item.id}>
{item.templateName}
</Option>
))}
{isType === 'distribution' &&
{isType === 'after' &&
templateList.map(item => (
<Option label={item.addressName} value={item.id} key={item.id}>
{item.addressName}
......
......@@ -36,7 +36,7 @@ import {
getBrandList,
addGoods,
editGoods,
getAfterAddress,
queryAllAfterAddress,
} from '../service';
import styles from '../style.less';
import Upload from '../../components/sortablUpload';
......@@ -82,13 +82,10 @@ class goodsManage extends Component {
// 获取售后地址
getAfterAddressData = async () => {
try {
const { data } = await getAfterAddress();
if (data) {
this.setState({ afterAddressList: data });
}
} catch (e) {
console.log(e);
const data = await queryAllAfterAddress();
console.log(data);
if (data) {
this.setState({ afterAddressList: data.data.records });
}
};
......@@ -408,6 +405,7 @@ class goodsManage extends Component {
type: values.productType,
specs,
character: values.character,
afterAddressId: values.afterAddressId,
},
}));
const data = initData.id
......
......@@ -202,14 +202,16 @@ class goodsManage extends Component {
return;
}
const data = type === 'distribution' ? await getTemplateList() : await queryAllAfterAddress();
if (data.code === '0000' && data.data.length) {
const length = type === 'distribution' ? data.data.length : data.data.records.length;
if (data.code === '0000' && length) {
this.setState({
templeatModalVisible: true,
isAll,
templateList: data.data,
templateList: type === 'distribution' ? data.data : data.data.records,
isType: type,
});
} else {
notification.error({ message: '暂无模板数据,请先添加模板' });
notification.error({ message: '暂无数据' });
}
};
......
......@@ -4,7 +4,7 @@ import config from '../../../config/env.config';
import { stringify } from 'qs';
import _ from 'lodash';
const { goodsApi } = config;
const { goodsApi, kdspApi } = config;
const headers = {
'Content-Type': 'application/x-www-form-urlencoded',
};
......@@ -175,9 +175,16 @@ export async function getTemplateList(params) {
}
// 查询供应商售后地址
export async function queryAllAfterAddress() {
return request.get('/supplier/after/queryAllAfterAddress', {
prefix: goodsApi,
const params = {
pageSize: 100,
pageNo: 1,
};
const data = request.post('/api/kdsp/supplier/after-sales-addrs-page', {
prefix: kdspApi,
data: params,
});
console.log(data);
return data;
}
// 商品售后地址设置
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment