Commit 64c11486 authored by 王苓芝's avatar 王苓芝

Merge branch 'master' into afterSale

parents 353cd1cf 9b7e504d
...@@ -161,9 +161,11 @@ export default () => { ...@@ -161,9 +161,11 @@ export default () => {
}} }}
bordered bordered
actionRef={table} actionRef={table}
scroll={{ x: '100%' }} scroll={{ x: '100%', y: 400 }}
toolBarRender={false}
search={{ search={{
collapsed: false, collapsed: false,
collapseRender: () => null,
}} }}
/> />
<RejectModal visible={visible} onCancel={closeModal} serviceNo={serviceNoInfo} /> <RejectModal visible={visible} onCancel={closeModal} serviceNo={serviceNoInfo} />
......
...@@ -75,6 +75,12 @@ export default () => { ...@@ -75,6 +75,12 @@ export default () => {
return <div>未申诉</div>; return <div>未申诉</div>;
}, },
}, },
{
title: '售后状态',
dataIndex: 'serviceStatus',
hideInSearch: true,
width: 100,
},
{ {
title: '操作', title: '操作',
hideInSearch: true, hideInSearch: true,
...@@ -102,10 +108,12 @@ export default () => { ...@@ -102,10 +108,12 @@ export default () => {
}} }}
bordered bordered
actionRef={table} actionRef={table}
scroll={{ x: '100%' }} scroll={{ x: '100%', y: 400 }}
search={{ search={{
collapsed: false, collapsed: false,
collapseRender: () => null,
}} }}
toolBarRender={false}
/> />
<AuditModal visible={visible} onCancel={closeModal} formData={auditInfo} /> <AuditModal visible={visible} onCancel={closeModal} formData={auditInfo} />
<DetailTable visible={detailVisible} onCancel={closeModal} dataSource={detailInfo} /> <DetailTable visible={detailVisible} onCancel={closeModal} dataSource={detailInfo} />
......
import React from 'react'; import React from 'react';
import { Modal, Form, Input, TreeSelect, notification } from 'antd'; import { Modal, Form, Input, Cascader, notification } from 'antd';
import { shopAudit } from '../services'; import { shopAudit } from '../services';
const FormItem = Form.Item; const FormItem = Form.Item;
...@@ -18,39 +18,39 @@ const AuditModal = props => { ...@@ -18,39 +18,39 @@ const AuditModal = props => {
}; };
const treeData = [ const treeData = [
{ {
title: '同意', label: '同意',
value: '1', value: 1,
}, },
{ {
title: '不同意', label: '不同意',
value: '2', value: 2,
children: [ children: [
{ {
title: '商品与出售商品不符', label: '商品与出售商品不符',
value: '2-1', value: 1,
}, },
{ {
title: '影响二次销售', label: '影响二次销售',
value: '2-2', value: 2,
},
{
label: '其他',
value: 3,
}, },
], ],
}, },
]; ];
const handleOk = () => { const handleOk = () => {
// 掉接口
// 成功后掉取消接口
validateFields(async (error, fieldsValue) => { validateFields(async (error, fieldsValue) => {
if (!error) { if (!error) {
let { auditResult } = fieldsValue; const { auditResult } = fieldsValue;
const refuseCode = auditResult.split('-')?.[1] || '';
auditResult = auditResult.split('-')?.[0];
const data = await shopAudit({ const data = await shopAudit({
...fieldsValue, ...fieldsValue,
refuseCode, refuseCode: auditResult?.[1],
auditResult, auditResult: auditResult?.[0],
serviceNo: formData?.serviceNo, serviceNo: formData?.serviceNo,
}); });
if (data.code === '0000') { if (data.businessCode === '0000') {
notification.success({ message: '审核成功' }); notification.success({ message: '审核成功' });
handleCancel(true); handleCancel(true);
} }
...@@ -62,9 +62,9 @@ const AuditModal = props => { ...@@ -62,9 +62,9 @@ const AuditModal = props => {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
}; };
const isAgree = () => getFieldValue('auditResult') === '1'; const auditResult = getFieldValue('auditResult');
const isRefuse = () => getFieldValue('auditResult') && getFieldValue('auditResult') !== '1'; const isAgree = () => auditResult?.[0] === 1;
const isRefuse = () => auditResult && auditResult[0] !== 1;
return ( return (
<Modal <Modal
title="售后操作确认" title="售后操作确认"
...@@ -75,10 +75,12 @@ const AuditModal = props => { ...@@ -75,10 +75,12 @@ const AuditModal = props => {
<Form {...layout} name="formData"> <Form {...layout} name="formData">
<FormItem label="审核结果"> <FormItem label="审核结果">
{getFieldDecorator('auditResult')( {getFieldDecorator('auditResult')(
<TreeSelect <Cascader
allowClear
showSearch
style={{ width: '315px' }} style={{ width: '315px' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }} dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
treeData={treeData} options={treeData}
placeholder="请选择" placeholder="请选择"
/>, />,
)} )}
...@@ -120,7 +122,7 @@ const AuditModal = props => { ...@@ -120,7 +122,7 @@ const AuditModal = props => {
</FormItem> </FormItem>
</div> </div>
)} )}
{isRefuse() && ( {isRefuse() && auditResult[1] === 3 && (
<FormItem label="拒绝原因"> <FormItem label="拒绝原因">
{getFieldDecorator('refuseDesc', { {getFieldDecorator('refuseDesc', {
initialValue: formData.refuseDesc, initialValue: formData.refuseDesc,
...@@ -139,6 +141,24 @@ const AuditModal = props => { ...@@ -139,6 +141,24 @@ const AuditModal = props => {
)} )}
</FormItem> </FormItem>
)} )}
{isRefuse() && auditResult[1] !== 3 && (
<FormItem label="补充说明">
{getFieldDecorator('refuseDesc', {
initialValue: formData.refuseDesc,
rules: [
{
message: '请填写补充说明!',
},
],
})(
<TextArea
placeholder="请填写补充说明"
allowClear
autoSize={{ minRows: 3, maxRows: 6 }}
/>,
)}
</FormItem>
)}
</Form> </Form>
</Modal> </Modal>
); );
......
...@@ -18,7 +18,7 @@ export default props => { ...@@ -18,7 +18,7 @@ export default props => {
}, },
{ {
title: '商品件数', title: '商品件数',
dataIndex: 'quantity', dataIndex: 'count',
}, },
]; ];
return ( return (
......
import { Tag } from 'antd'; import { Tag, Badge } from 'antd';
import React from 'react'; import React from 'react';
export const appealType = { export const appealType = {
...@@ -9,21 +9,50 @@ export const columnSticData = [ ...@@ -9,21 +9,50 @@ export const columnSticData = [
{ {
title: '订单ID', title: '订单ID',
dataIndex: 'orderNo', dataIndex: 'orderNo',
hideInSearch: true, hideInTable: true,
width: 300, width: 200,
// eslint-disable-next-line no-confusing-arrow
render: (orderNo, r) =>
r.timeout || r.reminderFlag ? (
<Tag color={r.timeout ? 'red' : 'green'}>{orderNo}</Tag>
) : (
orderNo
),
}, },
{ {
title: '售后单ID', title: '售后单ID',
dataIndex: 'serviceNo', dataIndex: 'serviceNo',
width: 300,
render: (serviceNo, r) => (
<div>
{r.timeout ? <Tag color="red">{serviceNo}</Tag> : serviceNo}
{<Badge count={r.reminderFlag ? '' : ''} size="default" />}
</div>
),
},
{
title: '订单ID',
dataIndex: 'orderNo',
hideInSearch: true, hideInSearch: true,
width: 200, width: 300,
},
{
title: '售后状态',
dataIndex: 'dealStatus',
hideInTable: true,
valueEnum: {
0: '待审核',
10: '三方审核中',
11: '三方审核通过',
12: '三方审核拒绝',
13: '客服审核通过',
14: '商户审核中',
15: '商户审核通过',
16: '商户审核拒绝',
20: '审核拒绝',
21: '申诉中',
30: '待填写退货物流信息',
40: '待退货入库',
50: '退货拒收',
60: '待退款',
61: '退货处理中',
70: '售后成功',
99: '用户取消',
},
width: 100,
}, },
{ {
title: '收货人姓名', title: '收货人姓名',
...@@ -41,6 +70,22 @@ export const columnSticData = [ ...@@ -41,6 +70,22 @@ export const columnSticData = [
width: 200, width: 200,
hideInSearch: true, hideInSearch: true,
}, },
{
title: '订单开始时间',
width: 120,
dataIndex: 'startDate',
key: 'startDate',
valueType: 'date',
hideInTable: true,
},
{
title: '订单结束时间',
width: 120,
dataIndex: 'endDate',
key: 'endDate',
valueType: 'date',
hideInTable: true,
},
{ {
title: '售后类型', title: '售后类型',
dataIndex: 'serviceType', dataIndex: 'serviceType',
......
import React, { useState } from 'react'; import React, { useState, useRef } from 'react';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
// import { FormInstance } from 'antd/lib/form';
import { notification } from 'antd'; import { notification } from 'antd';
import Detail from '../components/detail'; import Detail from '../components/detail';
import ImgModal from '../components/imgModal'; import ImgModal from '../components/imgModal';
...@@ -11,8 +10,6 @@ import { query, getDetail } from './services'; ...@@ -11,8 +10,6 @@ import { query, getDetail } from './services';
import AuditModal from '../components/audit'; import AuditModal from '../components/audit';
const Appeal = () => { const Appeal = () => {
// const protable = useRef();
// const ref = useRef(FormInstance);
const [detailModal, changeDetailModal] = useState(false); const [detailModal, changeDetailModal] = useState(false);
const [auditModal, changeAuditModal] = useState(false); const [auditModal, changeAuditModal] = useState(false);
const [imgModal, changeImgModal] = useState(false); const [imgModal, changeImgModal] = useState(false);
...@@ -20,6 +17,7 @@ const Appeal = () => { ...@@ -20,6 +17,7 @@ const Appeal = () => {
const [imgData, getImgData] = useState([]); const [imgData, getImgData] = useState([]);
const [imgTitle, changeImgTitle] = useState(''); const [imgTitle, changeImgTitle] = useState('');
const table = useRef();
const openDetail = async row => { const openDetail = async row => {
const detailData = await getDetail({ appealNo: row.appealNo }); const detailData = await getDetail({ appealNo: row.appealNo });
changeDetailModal(true); changeDetailModal(true);
...@@ -31,6 +29,11 @@ const Appeal = () => { ...@@ -31,6 +29,11 @@ const Appeal = () => {
getRow(detailData); getRow(detailData);
changeAuditModal(true); changeAuditModal(true);
}; };
const reload = () => {
if (table && table.current) {
table.current.reload();
}
};
const openImgModal = imgList => { const openImgModal = imgList => {
if (!imgList.length) { if (!imgList.length) {
notification.error({ notification.error({
...@@ -38,24 +41,25 @@ const Appeal = () => { ...@@ -38,24 +41,25 @@ const Appeal = () => {
}); });
return; return;
} }
// const list = ['https://www.baidu.com/img/flexible/logo/pc/result@2.png'];
getImgData(imgList); getImgData(imgList);
changeImgModal(true); changeImgModal(true);
changeImgTitle('查看图片'); changeImgTitle('查看图片');
}; };
const closeModal = params => { const closeModal = (params, isReload) => {
if (params === 'Detail') { if (params === 'Detail') {
changeDetailModal(false); changeDetailModal(false);
return; return;
} }
if (params === 'Audit') { if (params === 'Audit') {
changeAuditModal(false); changeAuditModal(false);
if (isReload) {
reload();
}
return; return;
} }
changeImgModal(false); changeImgModal(false);
}; };
const res = { const res = {
// handleAudit,
openAudit, openAudit,
openDetail, openDetail,
openImgModal, openImgModal,
...@@ -72,10 +76,11 @@ const Appeal = () => { ...@@ -72,10 +76,11 @@ const Appeal = () => {
request={params => query({ ...params })} request={params => query({ ...params })}
rowKey={r => r.appealNo} rowKey={r => r.appealNo}
expandIconColumnIndex={10} expandIconColumnIndex={10}
actionRef={table}
bordered bordered
className={styles.table} className={styles.table}
toolBarRender={false} toolBarRender={false}
scroll={{ x: '100%' }} scroll={{ x: '100%', y: 400 }}
/> />
<Detail <Detail
data={selectedRow} data={selectedRow}
...@@ -85,7 +90,7 @@ const Appeal = () => { ...@@ -85,7 +90,7 @@ const Appeal = () => {
<AuditModal <AuditModal
data={selectedRow} data={selectedRow}
modalVisible={auditModal} modalVisible={auditModal}
onCancel={() => closeModal('Audit')} onCancel={isReload => closeModal('Audit', isReload)}
></AuditModal> ></AuditModal>
<ImgModal <ImgModal
imgData={imgData} imgData={imgData}
......
...@@ -34,7 +34,7 @@ export async function getDetail(params) { ...@@ -34,7 +34,7 @@ export async function getDetail(params) {
} }
export async function audit(params) { export async function audit(params) {
const { data } = await request.post('/api/kdsp/op/appeal/audit', { const data = await request.post('/api/kdsp/op/appeal/audit', {
data: stringify(params), data: stringify(params),
prefix: config.kdspApi, prefix: config.kdspApi,
// prefix: 'http://yapi.quantgroups.com/mock/351', // prefix: 'http://yapi.quantgroups.com/mock/351',
......
...@@ -3,7 +3,7 @@ import React from 'react'; ...@@ -3,7 +3,7 @@ import React from 'react';
export const refuseReasonEnum = { export const refuseReasonEnum = {
0: { text: '待操作' }, 0: { text: '待操作' },
1: { text: '确认' }, 1: { text: '同意' },
2: { text: '已拒绝' }, 2: { text: '已拒绝' },
}; };
...@@ -12,13 +12,22 @@ export function columns(res) { ...@@ -12,13 +12,22 @@ export function columns(res) {
return [ return [
{ {
title: '售后申诉单ID', title: '售后申诉单ID',
width: 120, width: 300,
dataIndex: 'appealNo', dataIndex: 'appealNo',
key: 'appealNo', key: 'appealNo',
// eslint-disable-next-line no-confusing-arrow
render: (appealNo, row) =>
row.timeout ? (
<Tag color="red" key={appealNo}>
{appealNo}
</Tag>
) : (
appealNo
),
}, },
{ {
title: '售后单ID', title: '售后单ID',
width: 120, width: 300,
dataIndex: 'serviceNo', dataIndex: 'serviceNo',
key: 'serviceNo', key: 'serviceNo',
}, },
...@@ -27,11 +36,6 @@ export function columns(res) { ...@@ -27,11 +36,6 @@ export function columns(res) {
width: 200, width: 200,
dataIndex: 'orderNo', dataIndex: 'orderNo',
key: 'orderNo', key: 'orderNo',
render: (orderNo, row) => (
<Tag color={row.timeout ? 'red' : 'green'} key={orderNo}>
{orderNo}
</Tag>
),
}, },
{ {
title: '申诉单开始时间', title: '申诉单开始时间',
......
...@@ -26,7 +26,7 @@ const AuditModal = props => { ...@@ -26,7 +26,7 @@ const AuditModal = props => {
if (auditData && auditData.code === '0000') { if (auditData && auditData.code === '0000') {
notification.success({ message: '审核成功' }); notification.success({ message: '审核成功' });
resetFields(); resetFields();
onCancel(); onCancel(true);
} }
} }
}); });
......
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