Commit a970c1c3070fd070c82e65fae229cc4295fb6f8a
1 parent
f819f9b1
feat: 售后
Showing
6 changed files
with
18 additions
and
8 deletions
src/pages/Order/FeedBack/CheckModal.tsx
@@ -66,7 +66,7 @@ export default ({ | @@ -66,7 +66,7 @@ export default ({ | ||
66 | const [messageApi, contextHolder] = message.useMessage(); | 66 | const [messageApi, contextHolder] = message.useMessage(); |
67 | const [form] = Form.useForm<{ name: string; company: string }>(); | 67 | const [form] = Form.useForm<{ name: string; company: string }>(); |
68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); | 68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); |
69 | - const [mainOrderId] = useState(data.id); | 69 | + const [mainOrderId] = useState(data?.id || null); |
70 | 70 | ||
71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); | 71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); |
72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); | 72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); |
@@ -90,7 +90,13 @@ export default ({ | @@ -90,7 +90,13 @@ export default ({ | ||
90 | let index = 1; | 90 | let index = 1; |
91 | let annexLinks = annex?.map((f) => { | 91 | let annexLinks = annex?.map((f) => { |
92 | return ( | 92 | return ( |
93 | - <Button className="p-0 pr-1" type="link" key="key" href={f}> | 93 | + <Button |
94 | + className="p-0 pr-1" | ||
95 | + type="link" | ||
96 | + key="key" | ||
97 | + href={f} | ||
98 | + onClick={console.log(data)} | ||
99 | + > | ||
94 | {'附件' + index++} | 100 | {'附件' + index++} |
95 | </Button> | 101 | </Button> |
96 | ); | 102 | ); |
src/pages/Order/FeedBack/OrderList.tsx
@@ -427,6 +427,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -427,6 +427,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
427 | * 返回当前操作的主订单数据 | 427 | * 返回当前操作的主订单数据 |
428 | */ | 428 | */ |
429 | function buildMainOrder() { | 429 | function buildMainOrder() { |
430 | + console.log(currentOptMainId); | ||
430 | if (currentOptMainId === undefined || currentOptMainId === null) { | 431 | if (currentOptMainId === undefined || currentOptMainId === null) { |
431 | message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员'); | 432 | message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员'); |
432 | return; | 433 | return; |
@@ -1895,6 +1896,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1895,6 +1896,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1895 | className="p-0" | 1896 | className="p-0" |
1896 | type="link" | 1897 | type="link" |
1897 | onClick={() => { | 1898 | onClick={() => { |
1899 | + setCurrentMainId(record.id); | ||
1900 | + console.log(currentOptMainId); | ||
1898 | createOptObject(optRecord.id, record.id); | 1901 | createOptObject(optRecord.id, record.id); |
1899 | setCheckVisible(true); | 1902 | setCheckVisible(true); |
1900 | setOrderCheckType(CHECK_TYPE.AFTER_SALES); | 1903 | setOrderCheckType(CHECK_TYPE.AFTER_SALES); |
@@ -3633,6 +3636,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3633,6 +3636,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3633 | className="p-0" | 3636 | className="p-0" |
3634 | type="link" | 3637 | type="link" |
3635 | onClick={() => { | 3638 | onClick={() => { |
3639 | + setCurrentMainId(record.id); | ||
3640 | + console.log(currentOptMainId); | ||
3636 | let selectedSubOrders = subOrderSelectedMap.get( | 3641 | let selectedSubOrders = subOrderSelectedMap.get( |
3637 | record.id, | 3642 | record.id, |
3638 | ); | 3643 | ); |
@@ -3649,7 +3654,6 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3649,7 +3654,6 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3649 | return; | 3654 | return; |
3650 | } | 3655 | } |
3651 | } | 3656 | } |
3652 | - | ||
3653 | createOptObject(null, record.id); | 3657 | createOptObject(null, record.id); |
3654 | setCheckVisible(true); | 3658 | setCheckVisible(true); |
3655 | setOrderCheckType(CHECK_TYPE.AFTER_SALES); | 3659 | setOrderCheckType(CHECK_TYPE.AFTER_SALES); |
@@ -4807,7 +4811,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -4807,7 +4811,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
4807 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} | 4811 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} |
4808 | onClose={(isSuccess: boolean) => { | 4812 | onClose={(isSuccess: boolean) => { |
4809 | setOrderDrawerVisible(false); | 4813 | setOrderDrawerVisible(false); |
4810 | - clearOptObject(); | 4814 | + // clearOptObject(); |
4811 | if (isSuccess) { | 4815 | if (isSuccess) { |
4812 | refreshTable(); | 4816 | refreshTable(); |
4813 | } | 4817 | } |
src/pages/Order/Order/components/CheckModal.tsx
@@ -66,7 +66,7 @@ export default ({ | @@ -66,7 +66,7 @@ export default ({ | ||
66 | const [messageApi, contextHolder] = message.useMessage(); | 66 | const [messageApi, contextHolder] = message.useMessage(); |
67 | const [form] = Form.useForm<{ name: string; company: string }>(); | 67 | const [form] = Form.useForm<{ name: string; company: string }>(); |
68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); | 68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); |
69 | - const [mainOrderId] = useState(data.id); | 69 | + const [mainOrderId] = useState(data?.id || null); |
70 | 70 | ||
71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); | 71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); |
72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); | 72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); |
src/pages/Order/Order/index copy.tsx
@@ -5062,7 +5062,7 @@ const OrderPage = () => { | @@ -5062,7 +5062,7 @@ const OrderPage = () => { | ||
5062 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} | 5062 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} |
5063 | onClose={(isSuccess: boolean) => { | 5063 | onClose={(isSuccess: boolean) => { |
5064 | setOrderDrawerVisible(false); | 5064 | setOrderDrawerVisible(false); |
5065 | - clearOptObject(); | 5065 | + // clearOptObject(); |
5066 | if (isSuccess) { | 5066 | if (isSuccess) { |
5067 | refreshTable(); | 5067 | refreshTable(); |
5068 | } | 5068 | } |
src/pages/Order/OrderList/CheckModal.tsx
@@ -66,7 +66,7 @@ export default ({ | @@ -66,7 +66,7 @@ export default ({ | ||
66 | const [messageApi, contextHolder] = message.useMessage(); | 66 | const [messageApi, contextHolder] = message.useMessage(); |
67 | const [form] = Form.useForm<{ name: string; company: string }>(); | 67 | const [form] = Form.useForm<{ name: string; company: string }>(); |
68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); | 68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); |
69 | - const [mainOrderId] = useState(data.id); | 69 | + const [mainOrderId] = useState(data?.id || null); |
70 | 70 | ||
71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); | 71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); |
72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); | 72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); |
src/pages/Order/OrderList/OrderList.tsx
@@ -4790,7 +4790,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -4790,7 +4790,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
4790 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} | 4790 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} |
4791 | onClose={(isSuccess: boolean) => { | 4791 | onClose={(isSuccess: boolean) => { |
4792 | setOrderDrawerVisible(false); | 4792 | setOrderDrawerVisible(false); |
4793 | - clearOptObject(); | 4793 | + // clearOptObject(); |
4794 | if (isSuccess) { | 4794 | if (isSuccess) { |
4795 | refreshTable(); | 4795 | refreshTable(); |
4796 | } | 4796 | } |