提交 9c21e40d 作者: 龚洪江

修复:需求订单争议处理,流程显示问题

上级 0fa78a51
......@@ -701,6 +701,8 @@ export type serviceOrderFormDetailsType = InterFunction<
updateOrderAmount: number;
weChat: number;
orderStatus: string;
duty: number;
decisionContent: string;
}
>;
// 需求订单-进度条
......@@ -876,6 +878,24 @@ export type flowDictionaryAndTimeType = InterFunction<
};
}
>;
// 需求订单-争议处理
export type disputeType = InterFunction<
{
/**
* 客服判定内容
*/
decisionContent?: string;
/**
* 责任问题 1:双方无责 2:发布者责任 3:飞手责任
*/
duty: number;
/**
* id
*/
requirementsInfoId: number;
},
any
>;
// 商城订单-列表(新)
type mallOrderType = {
......
import axios from '../request';
import {
disputeType,
flowDictionaryAndTimeType,
flowDictionaryType,
getMallOrderDetailById,
......@@ -105,6 +106,8 @@ export class OrderManageAPI {
// 需求订单-进度条
static getFlowDictionary: flowDictionaryType = () =>
axios.get('/release/requirements/flowDictionary');
// 需求订单-争议
static disputeOrder: disputeType = (data) => axios.post('/release/requirements/cancelAll', data);
// 商城订单-列表(新)
static getMallOrderList: mallOrderListType = (data) => axios.post('/oms/uav-order/list', data);
......
.detail-rich-text{
image,video{
max-width: 100%;
}
}
import { Button, Descriptions, Steps } from 'antd';
import { Button, Descriptions, Form, message, Modal, Radio, Steps } from 'antd';
import { useNavigate } from 'react-router-dom';
import RichText from '~/components/richText';
import { useSearchParams } from 'react-router-dom';
......@@ -6,6 +6,7 @@ import { OrderManageAPI } from '~/api';
import { useEffect, useState } from 'react';
import { InterDataType } from '~/api/interface';
import { serviceOrderFormDetailsType } from '~/api/interface/orderManageType';
import './index.scss';
// 详情返回类型
type detailType = InterDataType<serviceOrderFormDetailsType>;
......@@ -40,9 +41,24 @@ const flowStatusKey = [
key: 'serviceEvaluateDTO',
},
];
const dutyOptionList = [
{
label: '双方无责',
value: 1,
},
{
label: '发布者责任',
value: 2,
},
{
label: '飞手责任',
value: 3,
},
];
const DemandOrderDetail = () => {
const navigate = useNavigate();
const [controversyForm] = Form.useForm<{ duty: number; decisionContent: string }>();
const [searchParams] = useSearchParams();
// 需求订单详情
......@@ -55,7 +71,9 @@ const DemandOrderDetail = () => {
//获取详情
const getServiceOrderFormDetails = (requirementsInfoId: number) => {
OrderManageAPI.getServiceOrderFormDetails({ requirementsInfoId }).then(({ result }) => {
setDemandDetail(result);
if (result) {
setDemandDetail({ ...result });
}
});
};
// 获取进度条
......@@ -71,10 +89,7 @@ const DemandOrderDetail = () => {
const flowDictionaryFilterResult = ['700'].includes(demandDetail.orderStatus)
? flowDictionarySortResult.filter((v) => v.orderStatus === demandDetail.orderStatus)
: ['550'].includes(demandDetail.orderStatus)
? flowDictionarySortResult.filter(
(v) =>
v.orderStatus !== demandDetail.orderStatus && !['700'].includes(v.orderStatus),
)
? flowDictionarySortResult.filter((v) => !['700', '500'].includes(v.orderStatus))
: flowDictionarySortResult.filter((v) => !['700', '550'].includes(v.orderStatus));
const stepList = flowDictionaryFilterResult
.map((v) => {
......@@ -92,13 +107,33 @@ const DemandOrderDetail = () => {
: '',
};
});
setSteps(stepList);
setSteps(stepList.map((v) => ({ title: v.title, description: v.description })));
setCurrentStep(stepList.findIndex((v) => v.orderStatus === demandDetail.orderStatus));
}
},
);
});
};
// 提交争议
const submitDispute = () => {
Modal.confirm({
title: '提示',
content: '确认提交该判定结果?',
onOk: () => {
controversyForm.validateFields().then((values) => {
OrderManageAPI.disputeOrder({
requirementsInfoId: Number(searchParams.get('id')),
...values,
}).then(({ code }) => {
if (code === '200') {
message.success('判定成功');
getServiceOrderFormDetails(Number(searchParams.get('id')));
}
});
});
},
});
};
// 返回
const backRoute = () => {
......@@ -171,22 +206,47 @@ const DemandOrderDetail = () => {
style={{ marginTop: '10px' }}
column={1}
extra={
<Button danger type='primary'>
确认判定
</Button>
demandDetail?.orderStatus === '700' ? (
''
) : (
<Button danger type='primary' onClick={submitDispute}>
确认判定
</Button>
)
}
>
<Descriptions.Item label='判定结果' labelStyle={{ color: '#000' }}>
<Descriptions.Item labelStyle={{ color: '#000' }}>
<div style={{ color: 'red' }}>
1、发单方责任(扣除30%违约金,20%支付给接单方,信息推送)
<br />
2、发单方责任(扣除30%违约金,20%支付给接单方,信息推送)
2、接单方责任(扣除30%违约金,20%支付给发单方,信息推送)
<br />
3、双方无责(不扣违约金,信息推送)
</div>
</Descriptions.Item>
<Descriptions.Item>
<RichText richTextContent='' />
<Form
form={controversyForm}
initialValues={{ duty: demandDetail?.orderStatus === '700' ? demandDetail?.duty : 1 }}
>
<Form.Item label='争议结果' name='duty'>
{demandDetail?.orderStatus === '700' ? (
<span>{dutyOptionList.find((v) => v.value === demandDetail.duty)?.label}</span>
) : (
<Radio.Group options={dutyOptionList}></Radio.Group>
)}
</Form.Item>
<Form.Item label='争议描述' name='decisionContent'>
{demandDetail?.orderStatus === '700' ? (
<div
dangerouslySetInnerHTML={{ __html: demandDetail.decisionContent || '' }}
className='detail-rich-text'
></div>
) : (
<RichText richTextContent='' />
)}
</Form.Item>
</Form>
</Descriptions.Item>
</Descriptions>
</div>
......
......@@ -40,7 +40,7 @@ const RemarkModal: FC<ModalProps & selfProps> = ({ open, onCancel, onOk, mallOrd
<Modal open={open} onOk={handleOk} onCancel={handleCancel} title='备注'>
<Form labelCol={{ span: 2 }} wrapperCol={{ span: 20 }} form={form}>
<Form.Item label='备注' name='content'>
<Input.TextArea placeholder='请输入备注' maxLength={70} showCount />
<Input.TextArea placeholder='请输入备注' maxLength={70} showCount rows={4} />
</Form.Item>
</Form>
</Modal>
......
......@@ -45,4 +45,12 @@
text-align: center;
line-height: 60px;
}
.mall-order-remark{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
cursor: pointer;
color: #1677ff;
}
}
......@@ -25,36 +25,9 @@ function ProductOrderView() {
// 路由钩子
const navigate = useNavigate();
// 订单状态搜索列表
const tranStatusList: { value: number | undefined; label: string }[] = [
{
label: '全部',
value: undefined,
},
{
label: '沟通意向',
value: undefined,
},
{
label: '签约付款',
value: undefined,
},
{
label: '待发货',
value: undefined,
},
{
label: '待收货',
value: undefined,
},
{
label: '已完成',
value: undefined,
},
{
label: '已关闭',
value: undefined,
},
];
const [tranStatusList, setTranStatusList] = useState<
{ value: number | undefined; label: string }[]
>([]);
// 订单操作按钮列表
const operateBtnList = [
{
......@@ -159,13 +132,8 @@ function ProductOrderView() {
};
// 订单状态筛选
const statusChangeEvent = (i: number) => {
if (i === statusCodeButtonIndex) {
setStatusCodeButtonIndex(0);
} else {
setStatusCodeButtonIndex(i);
}
if (i === 0) return;
query = { ...query, statusCode: Number(tranStatusList[i].value) };
setStatusCodeButtonIndex(i);
query = { ...query, statusCode: tranStatusList[i].value };
getTableList();
};
// 跳转订单详情
......@@ -178,6 +146,7 @@ function ProductOrderView() {
if (result) {
const list = result.map((item) => ({ value: item.code, label: item.status }));
setOrderStatusList(list);
setTranStatusList([{ label: '全部', value: undefined }, ...list]);
}
});
};
......@@ -205,7 +174,7 @@ function ProductOrderView() {
};
// 卖家备注
const showRemarkModalClick = (record: TableType[0]) => {
setCurrentOrderItem(record);
setCurrentOrderItem({ ...record });
setRemarkModalShow(true);
};
const remarkModalOk = () => {
......@@ -377,9 +346,12 @@ function ProductOrderView() {
render: (text, record) => (
<TableItem
tr={
<Button type='link' onClick={() => showRemarkModalClick(record)} className='goods-text'>
<div
onClick={() => showRemarkModalClick(record)}
className='goods-text mall-order-remark'
>
{text || '--'}
</Button>
</div>
}
/>
),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论