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

Merge branch 'master' into afterSale

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