Commit cc60a740 authored by 武广's avatar 武广

Merge branch 'feature/RefundTip' of git.quantgroup.cn:ui/merchant-manage-ui into feature/ue-upgrade

parents 76c9c61f 67c8baa4
......@@ -11,6 +11,7 @@ import ProofsModal from '../components/proofsModal';
import { getDetail } from '../../afterSale/appeal/services';
import AppealDetail from '../../afterSale/components/detail';
import AfterLog from '../components/AfterLog';
import styles from '../styles.less';
const { Countdown } = Statistic;
......@@ -25,8 +26,6 @@ export default () => {
const [auditInfo, setAuditInfo] = useState({});
const [appealDetailModal, setAppealDetailModal] = useState(false);
const [selectedRow, setSelectedRow] = useState({});
const [timeString, setTimeString] = useState({});
const [time, setTime] = useState({});
const [afterVisible, setAfterVisible] = useState(false);
const [afterList, setAfterList] = useState([]);
const viewDetail = async ({ serviceNo }) => {
......@@ -73,7 +72,15 @@ export default () => {
};
const openLogistics = r => {
confirm({
content: '请在48小时内完成物流包裹拦截,确认是否需要进行物流拦截?',
title: '温馨提示',
okText: '确认拦截',
cancelText: '取消拦截',
content: (
<div>
请48小时内自行联系物流公司进行物流拦截,系统监测拦截成功后
<span className={styles.redTipBold}>自动同意</span>退款
</div>
),
async onOk() {
const data = await logisticsIntercept({ serviceNo: r.serviceNo });
if (data.businessCode === '0000') {
......@@ -88,39 +95,6 @@ export default () => {
},
});
};
// const renderContent = (record, index, action) => {
// if (!time[record.serviceNo]) {
// const serviceTime = moment(record.approvalEndTime).valueOf();
// const nowTime = moment(record.nowTime).valueOf();
// let timeNumber = (serviceTime - nowTime) / 1000;
// time[record.serviceNo] = setInterval(() => {
// if (timeNumber > 0) {
// timeNumber -= 1;
// // eslint-disable-next-line radix
// const hours = parseInt(timeNumber / 3600)
// .toString()
// .padStart(2, '0');
// // eslint-disable-next-line radix
// const minutes = parseInt((timeNumber / 60) % 60)
// .toString()
// .padStart(2, '0');
// // eslint-disable-next-line radix
// const seconds = parseInt(timeNumber % 60)
// .toString()
// .padStart(2, '0');
// const str = `${hours}时${minutes}分${seconds}秒`;
// timeString[record.serviceNo] = str;
// const strings = _.cloneDeep(timeString);
// setTimeString(strings);
// } else {
// clearInterval(time[record.serviceNo]);
// timeString[record.serviceNo] = '0时0分0秒';
// const strings = _.cloneDeep(timeString);
// setTimeString(strings);
// }
// }, 1000);
// }
// };
const columns = [
{
title: '审核倒计时',
......@@ -128,12 +102,6 @@ export default () => {
key: 'serviceTime',
hideInSearch: true,
width: 150,
// render: (val, record, index, action) => [
// <span style={{ color: 'red' }}>
// {renderContent(record, index, action)}
// {timeString[record.serviceNo]}
// </span>,
// ],
render: (val, record) => {
const serviceTime = moment(record.approvalEndTime).valueOf();
return (
......
......@@ -3,9 +3,11 @@ import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Cascader, notification, InputNumber } from 'antd';
import { shopAudit } from '../services';
import styles from '../styles.less';
const FormItem = Form.Item;
const { TextArea } = Input;
const { confirm } = Modal;
const AuditModal = props => {
const {
visible,
......@@ -13,6 +15,7 @@ const AuditModal = props => {
form: { getFieldDecorator, getFieldValue, validateFields, resetFields },
formData = {},
} = props;
const handleCancel = isSuccess => {
resetFields();
onCancel(isSuccess);
......@@ -57,9 +60,7 @@ const AuditModal = props => {
],
},
];
const handleOk = () => {
validateFields(async (error, fieldsValue) => {
if (!error) {
const submitCheckResult = async fieldsValue => {
const { auditResult } = fieldsValue;
const data = await shopAudit({
...fieldsValue,
......@@ -71,6 +72,32 @@ const AuditModal = props => {
notification.success({ message: '审核成功' });
handleCancel(true);
}
};
const handleOk = () => {
validateFields((error, fieldsValue) => {
if (!error) {
const { auditResult } = fieldsValue;
// 如果为仅退款 并且 审核同意 弹出二次确认提示
if (+formData.serviceType === 1 && auditResult?.[0] === 1) {
confirm({
title: '温馨提示',
content: (
<div>
当前类型为【<span className={styles.redTipBold}>仅退款</span>
】,请核查该订单物流状态,如有在途物流,务必自行拦截后点击确认;
</div>
),
okText: '确认退款',
onOk() {
submitCheckResult(fieldsValue);
},
onCancel() {
handleCancel(true);
},
});
} else {
submitCheckResult(fieldsValue);
}
}
});
};
......@@ -89,9 +116,23 @@ const AuditModal = props => {
onOk={() => handleOk()}
onCancel={() => handleCancel()}
>
{+formData.serviceType === 1 && (
<div className={styles.redTip}>
温馨提示:当前售后类型为用户未收到产品,申请
<span className={styles.redTipBold}>仅退款</span>
,请务必检查此单物流状态后审核。
</div>
)}
<Form {...layout} name="formData">
<FormItem label="审核结果">
{getFieldDecorator('auditResult')(
{getFieldDecorator('auditResult', {
rules: [
{
required: true,
message: '请选择审核结果!',
},
],
})(
<Cascader
allowClear
showSearch
......
......@@ -6,6 +6,18 @@ export const appealType = {
0: '未申诉',
};
export const columnSticData = [
{
title: '售后类型',
dataIndex: 'serviceType',
hideInSearch: true,
width: 120,
render: serviceType => {
if (+serviceType === 1) {
return <span style={{ color: '#ff1616' }}>仅退款</span>;
}
return <span>退货退款</span>;
},
},
{
title: '订单ID',
dataIndex: 'orderNo',
......@@ -97,16 +109,6 @@ export const columnSticData = [
valueType: 'date',
hideInTable: true,
},
{
title: '售后类型',
dataIndex: 'serviceType',
hideInSearch: true,
width: 120,
valueEnum: {
1: '仅退款',
2: '退货退款',
},
},
{
title: '售后原因',
dataIndex: 'serviceReason',
......
......@@ -21,3 +21,12 @@
display: inherit;
margin: 20px auto;
}
.redTip {
color: #ff4d4f;
font-size: 14px;
}
.redTipBold {
color: #ff1616;
font-weight: bold;
}
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