Commit d4bd94ff32d8ed74297deceae4f9a9b776a4a96e

Authored by zhongnanhuang
1 parent 45673c12

feat: update

src/pages/Order/components/ApplyForInvoicingModal.tsx
... ... @@ -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 91 return (
92 92 <ModalForm<{
... ...
src/pages/Order/components/DeliverModal.tsx
... ... @@ -12,7 +12,16 @@ import {
12 12 ProFormText,
13 13 ProTable,
14 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 25 import { cloneDeep } from 'lodash';
17 26 import { useEffect, useRef, useState } from 'react';
18 27 import { CHECK_TYPE, LOGISTICS_STATUS_OPTIONS } from '../constant';
... ... @@ -56,39 +65,32 @@ const DeliverModal = ({
56 65 const columns: ProColumns<any>[] = [
57 66 {
58 67 title: 'ID',
59   - width: 80,
60 68 dataIndex: 'id',
61 69 render: (_, record) => <Input value={record.id} disabled />,
62 70 },
63 71 {
64 72 title: '商品编号',
65   - width: 80,
66 73 dataIndex: 'productCode',
67 74 render: (_, record) => <Input value={record.productCode} disabled />,
68 75 },
69 76 {
70 77 title: '商品名称',
71 78 dataIndex: 'productName',
72   - align: 'right',
73   - width: 80,
74 79 render: (_, record) => <Input value={record.productName} disabled />,
75 80 },
76 81 {
77 82 title: '商品参数',
78 83 dataIndex: 'parameters',
79   - align: 'right',
80 84 width: 80,
81 85 render: (_, record) => <Input value={record.parameters} disabled />,
82 86 },
83 87 {
84 88 title: '商品数量',
85   - width: 80,
86 89 dataIndex: 'status',
87 90 render: (_, record) => <InputNumber value={record.quantity} disabled />,
88 91 },
89 92 {
90 93 title: '包裹数量',
91   - width: 80,
92 94 dataIndex: 'packageNumber',
93 95 render: (_, record, index) => (
94 96 <InputNumber
... ... @@ -101,7 +103,6 @@ const DeliverModal = ({
101 103 },
102 104 {
103 105 title: '物流方式',
104   - width: 150,
105 106 key: 'logisticsMethod',
106 107 render: (_, record, index) => (
107 108 <Select
... ... @@ -110,14 +111,18 @@ const DeliverModal = ({
110 111 value={record.logisticsMethod}
111 112 options={enumToSelect(LOGISTICS_STATUS_OPTIONS)}
112 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 125 title: '物流单号',
120   - width: 150,
121 126 key: 'serialNumber',
122 127 render: (_, record, index) => (
123 128 <Input
... ... @@ -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 149 return (
... ... @@ -147,8 +162,23 @@ const DeliverModal = ({
147 162 item.packageNumber === null || item.packageNumber === undefined
148 163 ? 1
149 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 182 let body = { id: data[0].mainOrderId, list: list, flag: false };
153 183 if (isSendProduct) {
154 184 body.flag = true;
... ... @@ -179,23 +209,37 @@ const DeliverModal = ({
179 209 className="mb-8"
180 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 228 <Button
191 229 type="primary"
192 230 onClick={() => {
193 231 const values = form.current.getFieldsValue();
  232 + if (values.logisticsMethod === 'OTHER_LOGISTICS') {
  233 + message.info(
  234 + '自动填充成功!您选择的是其他物流方式,请将物流方式写在物流备注中!',
  235 + );
  236 + }
194 237 let newData = cloneDeep(data);
195 238 newData = newData.map((item) => ({
196 239 ...item,
197 240 logisticsMethod: values.logisticsMethod,
198   - serialNumber: values.serialNumber, // 物流单号?
  241 + serialNumber: values.serialNumber,
  242 + logisticsNotes: values.logisticsNotes,
199 243 }));
200 244 setData(newData);
201 245 }}
... ... @@ -212,6 +256,7 @@ const DeliverModal = ({
212 256 search={false}
213 257 dateFormatter="string"
214 258 options={false}
  259 + scroll={{ x: 1400 }}
215 260 />
216 261 </Modal>
217 262 );
... ...
src/pages/Order/constant.ts
... ... @@ -135,7 +135,7 @@ export const ORDER_STATUS_OPTIONS = {
135 135 LEADER_AUDITED: '领导已审核',
136 136 FINANCE_PROCESS: '财务已审核',
137 137 AUDITED: '已审核',
138   - PROCURE_UN_PROCESS: '采购审核',
  138 + PROCURE_UN_PROCESS: '采购审核',
139 139 PROCURE_PROCESS: '采购已审核',
140 140 PROCURE_PROCESS_FOR_MINE: '采购待打印',
141 141 PROCURE_WAIT_SHIP: '采购待发货',
... ...
src/pages/Order/index.tsx
... ... @@ -22,6 +22,7 @@ import { getUserInfo } from &#39;@/utils/user&#39;;
22 22 import {
23 23 ClockCircleTwoTone,
24 24 ContainerTwoTone,
  25 + CopyOutlined,
25 26 CopyTwoTone,
26 27 DownOutlined,
27 28 EditTwoTone,
... ... @@ -723,7 +724,9 @@ const OrderPage = () =&gt; {
723 724 LOGISTICS_STATUS_OPTIONS,
724 725 ) +
725 726 ' ' +
726   - optRecord.serialNumber
  727 + optRecord.serialNumber +
  728 + ' ' +
  729 + optRecord.logisticsNotes
727 730 }
728 731 content={
729 732 <Button type="link" size="small" style={{ padding: 0 }}>
... ... @@ -1335,9 +1338,21 @@ const OrderPage = () =&gt; {
1335 1338 <span className="text-[#8C8C8C]">订单号:</span>
1336 1339 <span className="text-slate-700">{record.id}</span>
1337 1340 </div>
1338   - <span>{formatDateTime(record.createTime)}</span>
1339 1341 </Space>
1340 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 1356 <Space split={<Divider type="vertical" />}>
1342 1357 <div>
1343 1358 <span className="text-[#8C8C8C]">代表:</span>
... ... @@ -2355,6 +2370,14 @@ const OrderPage = () =&gt; {
2355 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 2382 if (roleCode === 'procure') {
2360 2383 toolBtns.push(
... ...