Commit d4bd94ff32d8ed74297deceae4f9a9b776a4a96e
1 parent
45673c12
feat: update
Showing
4 changed files
with
100 additions
and
32 deletions
src/pages/Order/components/ApplyForInvoicingModal.tsx
@@ -79,14 +79,14 @@ export default ({ | @@ -79,14 +79,14 @@ export default ({ | ||
79 | /** | 79 | /** |
80 | * 如果不是预付款的订单,并且付款公司未选中,那么默认选[任意] | 80 | * 如果不是预付款的订单,并且付款公司未选中,那么默认选[任意] |
81 | */ | 81 | */ |
82 | - let paymentMethod = subOrders[0].paymentMethod; | ||
83 | - let receivingCompany = subOrders[0].receivingCompany; | ||
84 | - if ( | ||
85 | - paymentMethod !== 'PAYMENT_IN_ADVANCE' && | ||
86 | - (receivingCompany === null || receivingCompany === undefined) | ||
87 | - ) { | ||
88 | - form.setFieldValue('receivingCompany', 'ANY'); | ||
89 | - } | 82 | + // let paymentMethod = subOrders[0].paymentMethod; |
83 | + // let receivingCompany = subOrders[0].receivingCompany; | ||
84 | + // if ( | ||
85 | + // paymentMethod !== 'PAYMENT_IN_ADVANCE' && | ||
86 | + // (receivingCompany === null || receivingCompany === undefined) | ||
87 | + // ) { | ||
88 | + // form.setFieldValue('receivingCompany', 'ANY'); | ||
89 | + // } | ||
90 | 90 | ||
91 | return ( | 91 | return ( |
92 | <ModalForm<{ | 92 | <ModalForm<{ |
src/pages/Order/components/DeliverModal.tsx
@@ -12,7 +12,16 @@ import { | @@ -12,7 +12,16 @@ import { | ||
12 | ProFormText, | 12 | ProFormText, |
13 | ProTable, | 13 | ProTable, |
14 | } from '@ant-design/pro-components'; | 14 | } from '@ant-design/pro-components'; |
15 | -import { Button, Input, InputNumber, Modal, Select, message } from 'antd'; | 15 | +import { |
16 | + Button, | ||
17 | + Col, | ||
18 | + Input, | ||
19 | + InputNumber, | ||
20 | + Modal, | ||
21 | + Row, | ||
22 | + Select, | ||
23 | + message, | ||
24 | +} from 'antd'; | ||
16 | import { cloneDeep } from 'lodash'; | 25 | import { cloneDeep } from 'lodash'; |
17 | import { useEffect, useRef, useState } from 'react'; | 26 | import { useEffect, useRef, useState } from 'react'; |
18 | import { CHECK_TYPE, LOGISTICS_STATUS_OPTIONS } from '../constant'; | 27 | import { CHECK_TYPE, LOGISTICS_STATUS_OPTIONS } from '../constant'; |
@@ -56,39 +65,32 @@ const DeliverModal = ({ | @@ -56,39 +65,32 @@ const DeliverModal = ({ | ||
56 | const columns: ProColumns<any>[] = [ | 65 | const columns: ProColumns<any>[] = [ |
57 | { | 66 | { |
58 | title: 'ID', | 67 | title: 'ID', |
59 | - width: 80, | ||
60 | dataIndex: 'id', | 68 | dataIndex: 'id', |
61 | render: (_, record) => <Input value={record.id} disabled />, | 69 | render: (_, record) => <Input value={record.id} disabled />, |
62 | }, | 70 | }, |
63 | { | 71 | { |
64 | title: '商品编号', | 72 | title: '商品编号', |
65 | - width: 80, | ||
66 | dataIndex: 'productCode', | 73 | dataIndex: 'productCode', |
67 | render: (_, record) => <Input value={record.productCode} disabled />, | 74 | render: (_, record) => <Input value={record.productCode} disabled />, |
68 | }, | 75 | }, |
69 | { | 76 | { |
70 | title: '商品名称', | 77 | title: '商品名称', |
71 | dataIndex: 'productName', | 78 | dataIndex: 'productName', |
72 | - align: 'right', | ||
73 | - width: 80, | ||
74 | render: (_, record) => <Input value={record.productName} disabled />, | 79 | render: (_, record) => <Input value={record.productName} disabled />, |
75 | }, | 80 | }, |
76 | { | 81 | { |
77 | title: '商品参数', | 82 | title: '商品参数', |
78 | dataIndex: 'parameters', | 83 | dataIndex: 'parameters', |
79 | - align: 'right', | ||
80 | width: 80, | 84 | width: 80, |
81 | render: (_, record) => <Input value={record.parameters} disabled />, | 85 | render: (_, record) => <Input value={record.parameters} disabled />, |
82 | }, | 86 | }, |
83 | { | 87 | { |
84 | title: '商品数量', | 88 | title: '商品数量', |
85 | - width: 80, | ||
86 | dataIndex: 'status', | 89 | dataIndex: 'status', |
87 | render: (_, record) => <InputNumber value={record.quantity} disabled />, | 90 | render: (_, record) => <InputNumber value={record.quantity} disabled />, |
88 | }, | 91 | }, |
89 | { | 92 | { |
90 | title: '包裹数量', | 93 | title: '包裹数量', |
91 | - width: 80, | ||
92 | dataIndex: 'packageNumber', | 94 | dataIndex: 'packageNumber', |
93 | render: (_, record, index) => ( | 95 | render: (_, record, index) => ( |
94 | <InputNumber | 96 | <InputNumber |
@@ -101,7 +103,6 @@ const DeliverModal = ({ | @@ -101,7 +103,6 @@ const DeliverModal = ({ | ||
101 | }, | 103 | }, |
102 | { | 104 | { |
103 | title: '物流方式', | 105 | title: '物流方式', |
104 | - width: 150, | ||
105 | key: 'logisticsMethod', | 106 | key: 'logisticsMethod', |
106 | render: (_, record, index) => ( | 107 | render: (_, record, index) => ( |
107 | <Select | 108 | <Select |
@@ -110,14 +111,18 @@ const DeliverModal = ({ | @@ -110,14 +111,18 @@ const DeliverModal = ({ | ||
110 | value={record.logisticsMethod} | 111 | value={record.logisticsMethod} |
111 | options={enumToSelect(LOGISTICS_STATUS_OPTIONS)} | 112 | options={enumToSelect(LOGISTICS_STATUS_OPTIONS)} |
112 | onChange={(value) => { | 113 | onChange={(value) => { |
113 | - handleChange('logisticsMethod', index, value); | ||
114 | - }} //修改时更改record数据 | 114 | + handleChange('logisticsMethod', index, value); //修改时更改record数据 |
115 | + if (value === 'OTHER_LOGISTICS') { | ||
116 | + message.info( | ||
117 | + '您选择的是[其他物流方式],请将该物流方式写在备注中', | ||
118 | + ); | ||
119 | + } | ||
120 | + }} | ||
115 | /> | 121 | /> |
116 | ), | 122 | ), |
117 | }, | 123 | }, |
118 | { | 124 | { |
119 | title: '物流单号', | 125 | title: '物流单号', |
120 | - width: 150, | ||
121 | key: 'serialNumber', | 126 | key: 'serialNumber', |
122 | render: (_, record, index) => ( | 127 | render: (_, record, index) => ( |
123 | <Input | 128 | <Input |
@@ -129,6 +134,16 @@ const DeliverModal = ({ | @@ -129,6 +134,16 @@ const DeliverModal = ({ | ||
129 | /> | 134 | /> |
130 | ), | 135 | ), |
131 | }, | 136 | }, |
137 | + { | ||
138 | + title: '物流备注', | ||
139 | + dataIndex: 'packageNumber', | ||
140 | + render: (_, record, index) => ( | ||
141 | + <Input.TextArea | ||
142 | + value={record.logisticsNotes} | ||
143 | + onChange={(value) => handleChange('logisticsNotes', index, value)} | ||
144 | + /> | ||
145 | + ), | ||
146 | + }, | ||
132 | ]; | 147 | ]; |
133 | 148 | ||
134 | return ( | 149 | return ( |
@@ -147,8 +162,23 @@ const DeliverModal = ({ | @@ -147,8 +162,23 @@ const DeliverModal = ({ | ||
147 | item.packageNumber === null || item.packageNumber === undefined | 162 | item.packageNumber === null || item.packageNumber === undefined |
148 | ? 1 | 163 | ? 1 |
149 | : item.packageNumber, | 164 | : item.packageNumber, |
165 | + logisticsNotes: item.logisticsNotes, | ||
150 | }; | 166 | }; |
151 | }); | 167 | }); |
168 | + | ||
169 | + for (let item of list) { | ||
170 | + let method = item.logisticsMethod; | ||
171 | + let notes = item.logisticsNotes; | ||
172 | + if ( | ||
173 | + method === 'OTHER_LOGISTICS' && | ||
174 | + (notes === '' || notes === undefined) | ||
175 | + ) { | ||
176 | + message.error( | ||
177 | + '请检查:物流方式为[其他物流方式]的记录中,物流备注不能为空!请将实际的物流方式填写在备注中!', | ||
178 | + ); | ||
179 | + return; | ||
180 | + } | ||
181 | + } | ||
152 | let body = { id: data[0].mainOrderId, list: list, flag: false }; | 182 | let body = { id: data[0].mainOrderId, list: list, flag: false }; |
153 | if (isSendProduct) { | 183 | if (isSendProduct) { |
154 | body.flag = true; | 184 | body.flag = true; |
@@ -179,23 +209,37 @@ const DeliverModal = ({ | @@ -179,23 +209,37 @@ const DeliverModal = ({ | ||
179 | className="mb-8" | 209 | className="mb-8" |
180 | formRef={form} | 210 | formRef={form} |
181 | > | 211 | > |
182 | - <ProFormSelect | ||
183 | - placeholder="请输入物流方式" | ||
184 | - name="logisticsMethod" | ||
185 | - width="sm" | ||
186 | - label="物流方式" | ||
187 | - options={enumToSelect(LOGISTICS_STATUS_OPTIONS)} | ||
188 | - /> | ||
189 | - <ProFormText name="serialNumber" label="物流单号"></ProFormText> | 212 | + <Row gutter={[0, 6]}> |
213 | + <Col> | ||
214 | + <ProFormSelect | ||
215 | + placeholder="请输入物流方式" | ||
216 | + name="logisticsMethod" | ||
217 | + width="sm" | ||
218 | + label="物流方式" | ||
219 | + options={enumToSelect(LOGISTICS_STATUS_OPTIONS)} | ||
220 | + /> | ||
221 | + <ProFormText name="logisticsNotes" label="物流备注"></ProFormText> | ||
222 | + </Col> | ||
223 | + <Col> | ||
224 | + <ProFormText name="serialNumber" label="物流单号"></ProFormText> | ||
225 | + </Col> | ||
226 | + </Row> | ||
227 | + | ||
190 | <Button | 228 | <Button |
191 | type="primary" | 229 | type="primary" |
192 | onClick={() => { | 230 | onClick={() => { |
193 | const values = form.current.getFieldsValue(); | 231 | const values = form.current.getFieldsValue(); |
232 | + if (values.logisticsMethod === 'OTHER_LOGISTICS') { | ||
233 | + message.info( | ||
234 | + '自动填充成功!您选择的是其他物流方式,请将物流方式写在物流备注中!', | ||
235 | + ); | ||
236 | + } | ||
194 | let newData = cloneDeep(data); | 237 | let newData = cloneDeep(data); |
195 | newData = newData.map((item) => ({ | 238 | newData = newData.map((item) => ({ |
196 | ...item, | 239 | ...item, |
197 | logisticsMethod: values.logisticsMethod, | 240 | logisticsMethod: values.logisticsMethod, |
198 | - serialNumber: values.serialNumber, // 物流单号? | 241 | + serialNumber: values.serialNumber, |
242 | + logisticsNotes: values.logisticsNotes, | ||
199 | })); | 243 | })); |
200 | setData(newData); | 244 | setData(newData); |
201 | }} | 245 | }} |
@@ -212,6 +256,7 @@ const DeliverModal = ({ | @@ -212,6 +256,7 @@ const DeliverModal = ({ | ||
212 | search={false} | 256 | search={false} |
213 | dateFormatter="string" | 257 | dateFormatter="string" |
214 | options={false} | 258 | options={false} |
259 | + scroll={{ x: 1400 }} | ||
215 | /> | 260 | /> |
216 | </Modal> | 261 | </Modal> |
217 | ); | 262 | ); |
src/pages/Order/constant.ts
@@ -135,7 +135,7 @@ export const ORDER_STATUS_OPTIONS = { | @@ -135,7 +135,7 @@ export const ORDER_STATUS_OPTIONS = { | ||
135 | LEADER_AUDITED: '领导已审核', | 135 | LEADER_AUDITED: '领导已审核', |
136 | FINANCE_PROCESS: '财务已审核', | 136 | FINANCE_PROCESS: '财务已审核', |
137 | AUDITED: '已审核', | 137 | AUDITED: '已审核', |
138 | - PROCURE_UN_PROCESS: '采购未审核', | 138 | + PROCURE_UN_PROCESS: '采购待审核', |
139 | PROCURE_PROCESS: '采购已审核', | 139 | PROCURE_PROCESS: '采购已审核', |
140 | PROCURE_PROCESS_FOR_MINE: '采购待打印', | 140 | PROCURE_PROCESS_FOR_MINE: '采购待打印', |
141 | PROCURE_WAIT_SHIP: '采购待发货', | 141 | PROCURE_WAIT_SHIP: '采购待发货', |
src/pages/Order/index.tsx
@@ -22,6 +22,7 @@ import { getUserInfo } from '@/utils/user'; | @@ -22,6 +22,7 @@ import { getUserInfo } from '@/utils/user'; | ||
22 | import { | 22 | import { |
23 | ClockCircleTwoTone, | 23 | ClockCircleTwoTone, |
24 | ContainerTwoTone, | 24 | ContainerTwoTone, |
25 | + CopyOutlined, | ||
25 | CopyTwoTone, | 26 | CopyTwoTone, |
26 | DownOutlined, | 27 | DownOutlined, |
27 | EditTwoTone, | 28 | EditTwoTone, |
@@ -723,7 +724,9 @@ const OrderPage = () => { | @@ -723,7 +724,9 @@ const OrderPage = () => { | ||
723 | LOGISTICS_STATUS_OPTIONS, | 724 | LOGISTICS_STATUS_OPTIONS, |
724 | ) + | 725 | ) + |
725 | ' ' + | 726 | ' ' + |
726 | - optRecord.serialNumber | 727 | + optRecord.serialNumber + |
728 | + ' ' + | ||
729 | + optRecord.logisticsNotes | ||
727 | } | 730 | } |
728 | content={ | 731 | content={ |
729 | <Button type="link" size="small" style={{ padding: 0 }}> | 732 | <Button type="link" size="small" style={{ padding: 0 }}> |
@@ -1335,9 +1338,21 @@ const OrderPage = () => { | @@ -1335,9 +1338,21 @@ const OrderPage = () => { | ||
1335 | <span className="text-[#8C8C8C]">订单号:</span> | 1338 | <span className="text-[#8C8C8C]">订单号:</span> |
1336 | <span className="text-slate-700">{record.id}</span> | 1339 | <span className="text-slate-700">{record.id}</span> |
1337 | </div> | 1340 | </div> |
1338 | - <span>{formatDateTime(record.createTime)}</span> | ||
1339 | </Space> | 1341 | </Space> |
1340 | </Checkbox> | 1342 | </Checkbox> |
1343 | + <Tooltip title="点击复制订单号"> | ||
1344 | + <CopyOutlined | ||
1345 | + className="hover:cursor-pointer" | ||
1346 | + style={{ color: '#8C8C8C' }} | ||
1347 | + onClick={() => { | ||
1348 | + copyToClipboard(record.id); | ||
1349 | + message.info('订单号复制成功!'); | ||
1350 | + }} | ||
1351 | + /> | ||
1352 | + </Tooltip> | ||
1353 | + <Divider type="vertical" /> | ||
1354 | + <span>{formatDateTime(record.createTime)}</span> | ||
1355 | + <Divider type="vertical" /> | ||
1341 | <Space split={<Divider type="vertical" />}> | 1356 | <Space split={<Divider type="vertical" />}> |
1342 | <div> | 1357 | <div> |
1343 | <span className="text-[#8C8C8C]">代表:</span> | 1358 | <span className="text-[#8C8C8C]">代表:</span> |
@@ -2355,6 +2370,14 @@ const OrderPage = () => { | @@ -2355,6 +2370,14 @@ const OrderPage = () => { | ||
2355 | <Checkbox onChange={changeCancelOrderShow}>只看作废</Checkbox>, | 2370 | <Checkbox onChange={changeCancelOrderShow}>只看作废</Checkbox>, |
2356 | ); | 2371 | ); |
2357 | 2372 | ||
2373 | + if (roleCode === 'warehouseKeeper') { | ||
2374 | + toolBtns.push( | ||
2375 | + <Checkbox onChange={changeShowCurrentLeaderNeedAuditOrders}> | ||
2376 | + 待审核 | ||
2377 | + </Checkbox>, | ||
2378 | + ); | ||
2379 | + } | ||
2380 | + | ||
2358 | //采购可以筛选出需要处理的订单 | 2381 | //采购可以筛选出需要处理的订单 |
2359 | if (roleCode === 'procure') { | 2382 | if (roleCode === 'procure') { |
2360 | toolBtns.push( | 2383 | toolBtns.push( |