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

feat: 开发完成

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