Commit 051aac20b902add0b8fd449f731886014c19ec70

Authored by zhongnanhuang
2 parents 1d3923f9 a7490fa1

Merge branch 'znh231124' into 'develop'

feat: update copyOrder,subOrderNotes



See merge request !8
src/app.ts
... ... @@ -102,6 +102,10 @@ export const request: RequestConfig = {
102 102 message.error(data.message);
103 103 }
104 104  
  105 + if (data.result === 401) {
  106 + history.push('/login');
  107 + }
  108 +
105 109 // do something
106 110 return response;
107 111 },
... ...
src/pages/Login/index.tsx
... ... @@ -10,7 +10,7 @@ import {
10 10 ProFormText,
11 11 } from '@ant-design/pro-components';
12 12 import { history, useModel } from '@umijs/max';
13   -import { theme } from 'antd';
  13 +import { Button, theme } from 'antd';
14 14 import { useEffect, useState } from 'react';
15 15  
16 16 export default () => {
... ... @@ -41,9 +41,11 @@ export default () => {
41 41 data: { ...values, imgCaptchaUuid: uuid },
42 42 });
43 43  
44   - setUserLocalInfo(res.data.token, res.data?.user);
45 44 if (res.result === RESPONSE_CODE.SUCCESS) {
  45 + setUserLocalInfo(res.data.token, res.data?.user);
46 46 history.push('/order');
  47 + } else {
  48 + fetchCode();
47 49 }
48 50 }}
49 51 >
... ... @@ -96,6 +98,9 @@ export default () => {
96 98 fetchCode();
97 99 }}
98 100 />
  101 + <Button type="link" size="small" onClick={fetchCode}>
  102 + 点击刷新
  103 + </Button>
99 104 {/* <ProFormCheckbox noStyle name="autoLogin">
100 105 自动登录
101 106 </ProFormCheckbox> */}
... ...
src/pages/Order/components/CheckModal.tsx
... ... @@ -2,15 +2,14 @@ import { RESPONSE_CODE } from &#39;@/constants/enum&#39;;
2 2 import { postServiceOrderCheckOrder } from '@/services';
3 3 import { ModalForm, ProFormTextArea } from '@ant-design/pro-components';
4 4 import { Button, Form, message } from 'antd';
5   -export default ({ setCheckVisible, data, onClose }) => {
  5 +export default ({ setCheckVisible, data, subOrders, onClose }) => {
6 6 const [form] = Form.useForm<{ name: string; company: string }>();
7 7 let subOrderIds: any[] = [];
8   - const subOrderList = data.subOrderInformationLists;
9 8 //是单条子订单审核
10   - if (subOrderList === undefined) {
  9 + if (subOrders === null) {
11 10 subOrderIds = [data.id];
12 11 } else {
13   - subOrderIds = subOrderList.map((subOrder) => subOrder.id);
  12 + subOrderIds = subOrders.map((subOrder) => subOrder.id);
14 13 }
15 14 async function doCheck(body: object) {
16 15 const data = await postServiceOrderCheckOrder({
... ...
src/pages/Order/components/DeliverModal.tsx
... ... @@ -21,11 +21,11 @@ const DeliverModal = ({ data: propsData, onClose }) =&gt; {
21 21 setData(propsData);
22 22 }, [propsData]);
23 23  
24   - // const handleChange = (key: string, index: number) => (e) => {
25   - // const newData = cloneDeep(data);
26   - // newData[index][key] = e.target.value;
27   - // setData(newData);
28   - // };
  24 + const handleChange = (key: string, index: number) => (e) => {
  25 + const newData = cloneDeep(data);
  26 + newData[index][key] = e.target.value;
  27 + setData(newData);
  28 + };
29 29 const columns: ProColumns<any>[] = [
30 30 {
31 31 title: 'ID',
... ... @@ -76,12 +76,11 @@ const DeliverModal = ({ data: propsData, onClose }) =&gt; {
76 76 title: '物流单号',
77 77 width: 150,
78 78 key: 'serialNumber',
79   - render: (_, record) => (
  79 + render: (_, record, index) => (
80 80 <Input
81 81 placeholder="请输入物流单号"
82 82 value={record.serialNumber}
83   - onChange={(event) => (record.serialNumber = event.target.value)}
84   - // onChange={handleChange('productCode', index)}
  83 + onChange={handleChange('serialNumber', index)}
85 84 />
86 85 ),
87 86 },
... ...
src/pages/Order/components/OrderDrawer.tsx
... ... @@ -25,10 +25,25 @@ import {
25 25 PRODUCT_BELONG_DEPARTMENT_OPTIONS,
26 26 } from '../constant';
27 27  
28   -export default ({ onClose, data, isAdd }) => {
  28 +export default ({ onClose, data, subOrders, orderOptType }) => {
29 29 const [invoicingStatus, setInvoicingStatus] = useState('');
30 30  
31   - if (!isAdd) {
  31 + /**
  32 + * 获取当前的操作类型boolean值
  33 + * @param type 操作类型,如果与当前匹配返回true
  34 + */
  35 + function optType(type: string) {
  36 + return orderOptType === type;
  37 + }
  38 +
  39 + useEffect(() => {
  40 + // 在组件挂载或数据变化时,更新组件状态
  41 + if (data) {
  42 + setInvoicingStatus(data.invoicingStatus);
  43 + }
  44 + }, [data]);
  45 + let mainInfoDisbled = optType('edit');
  46 + if (optType('edit') || optType('copy')) {
32 47 //订单修改和新增的子订单列表命名是list
33 48 data.list = data.subOrderInformationLists;
34 49 //主订单事业部默认显示子订单第一条的事业部
... ... @@ -37,7 +52,9 @@ export default ({ onClose, data, isAdd }) =&gt; {
37 52 data.paymentChannel = data.list[0].paymentChannel;
38 53 data.invoicingStatus = data.list[0].invoicingStatus;
39 54 }
40   -
  55 + if (subOrders !== undefined && subOrders.length > 0) {
  56 + data.list = subOrders;
  57 + }
41 58 const [form] = Form.useForm<{
42 59 salesCode: '';
43 60 customerName: '';
... ... @@ -98,14 +115,16 @@ export default ({ onClose, data, isAdd }) =&gt; {
98 115  
99 116 return (
100 117 <DrawerForm<{
  118 + deleteSubOrderLists: any;
101 119 name: string;
102 120 company: string;
103 121 }>
104 122 open
105 123 width="35%"
106   - title={isAdd ? '新建订单' : '修改订单'}
  124 + title={optType('add') || optType('copy') ? '新建订单' : '修改订单'}
107 125 initialValues={() => {
108   - if (!isAdd) {
  126 + //编辑和复制回显数据
  127 + if (optType('edit') || optType('copy')) {
109 128 return data;
110 129 }
111 130 }}
... ... @@ -126,7 +145,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
126 145 submitTimeout={2000}
127 146 onFinish={async (values) => {
128 147 let res = {};
129   - if (isAdd) {
  148 + if (optType('add') || optType('copy')) {
130 149 res = await postServiceOrderAddOrder({ data: values });
131 150 } else {
132 151 //计算已删除的子订单id
... ... @@ -138,7 +157,10 @@ export default ({ onClose, data, isAdd }) =&gt; {
138 157 return item.id;
139 158 });
140 159 console.log('curIds:' + curIds);
141   - const diff = originIds.filter((item) => !curIds.includes(item));
  160 + let diff = originIds.filter((item) => !curIds.includes(item));
  161 + if (mainInfoDisbled) {
  162 + diff = [];
  163 + }
142 164 values.deleteSubOrderLists = diff;
143 165 res = await postServiceOrderUpdateOrder({ data: values });
144 166 }
... ... @@ -177,6 +199,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
177 199 label="收货人"
178 200 placeholder="请输入收货人"
179 201 rules={[{ required: true, message: '收货人必填' }]}
  202 + disabled={mainInfoDisbled}
180 203 />
181 204 <ProFormText
182 205 width="lg"
... ... @@ -184,6 +207,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
184 207 label="联系方式"
185 208 placeholder="请输入联系方式"
186 209 rules={[{ required: true, message: '联系方式必填' }]}
  210 + disabled={mainInfoDisbled}
187 211 />
188 212 <ProFormText
189 213 width="lg"
... ... @@ -191,6 +215,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
191 215 label="单位"
192 216 placeholder="请输入单位"
193 217 rules={[{ required: true, message: '单位必填' }]}
  218 + disabled={mainInfoDisbled}
194 219 />
195 220 <ProFormText
196 221 width="lg"
... ... @@ -198,6 +223,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
198 223 label="单位联系人"
199 224 placeholder="请输入单位联系人"
200 225 rules={[{ required: true, message: '单位联系人必填' }]}
  226 + disabled={mainInfoDisbled}
201 227 />
202 228 <ProFormTextArea
203 229 width="lg"
... ... @@ -205,12 +231,14 @@ export default ({ onClose, data, isAdd }) =&gt; {
205 231 label="收货地址"
206 232 placeholder="请输入收货地址"
207 233 rules={[{ required: true, message: '收货地址必填' }]}
  234 + disabled={mainInfoDisbled}
208 235 />
209   - <ProFormText
  236 + <ProFormDigit
210 237 name="totalPayment"
211 238 width="lg"
212 239 label="支付总额(¥)"
213 240 rules={[{ required: true, message: '支付总额必填' }]}
  241 + disabled={mainInfoDisbled}
214 242 />
215 243 <ProFormSelect
216 244 placeholder="请输入支付渠道"
... ... @@ -219,6 +247,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
219 247 label="支付渠道"
220 248 options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)}
221 249 rules={[{ required: true, message: '支付渠道必填' }]}
  250 + disabled={mainInfoDisbled}
222 251 />
223 252 <ProFormSelect
224 253 placeholder="请输入支付方式"
... ... @@ -227,6 +256,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
227 256 label="支付方式"
228 257 options={enumToSelect(PAYMENT_METHOD_OPTIONS)}
229 258 rules={[{ required: true, message: '支付方式必填' }]}
  259 + disabled={mainInfoDisbled}
230 260 />
231 261 <ProFormSelect
232 262 placeholder="请输入所属事业部"
... ... @@ -235,6 +265,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
235 265 label="所属事业部"
236 266 options={enumToSelect(PRODUCT_BELONG_DEPARTMENT_OPTIONS)}
237 267 rules={[{ required: true, message: '所属事业部必填' }]}
  268 + disabled={mainInfoDisbled}
238 269 />
239 270 <ProFormSelect
240 271 placeholder="选择是否需要开票"
... ... @@ -242,28 +273,38 @@ export default ({ onClose, data, isAdd }) =&gt; {
242 273 width="lg"
243 274 label="是否需要开票"
244 275 options={enumToSelect(INVOCING_STATUS_OPTIONS)}
  276 + disabled={mainInfoDisbled}
245 277 onChange={(_, option) => {
  278 + console.log(option);
246 279 setInvoicingStatus(option.value);
247 280 }}
248 281 rules={[{ required: true, message: '是否需要开票必填' }]}
249 282 />
250   - <ProFormText
251   - width="lg"
252   - name="invoiceIdentificationNumber"
253   - label="开票信息"
254   - hidden={invoicingStatus !== 'INVOICED'}
255   - placeholder="请输入开票信息"
256   - rules={[
257   - {
258   - required: invoicingStatus === 'INVOICED' ? true : false,
259   - message: '开票信息必填',
260   - },
261   - ]}
262   - />
263   - {getUserInfo().roleSmallVO?.code === 'admin' ? (
  283 + {optType('add') || optType('copy') ? (
  284 + <ProFormText
  285 + width="lg"
  286 + name="invoiceIdentificationNumber"
  287 + label="开票信息"
  288 + disabled={mainInfoDisbled}
  289 + hidden={invoicingStatus !== 'INVOICED'}
  290 + placeholder="请输入开票信息"
  291 + rules={[
  292 + {
  293 + required: invoicingStatus === 'INVOICED' ? true : false,
  294 + message: '开票信息必填',
  295 + },
  296 + ]}
  297 + />
  298 + ) : (
  299 + ''
  300 + )}
  301 +
  302 + {getUserInfo().roleSmallVO?.code === 'admin' &&
  303 + (optType('add') || optType('edit')) ? (
264 304 <ProFormDateTimePicker
265 305 width="lg"
266 306 name="invoicingTime"
  307 + disabled={mainInfoDisbled}
267 308 hidden={invoicingStatus === 'INVOICED'}
268 309 label="开票时间"
269 310 placeholder="请输入开票时间"
... ... @@ -275,6 +316,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
275 316 width="lg"
276 317 name="bank"
277 318 label="开户银行"
  319 + disabled={mainInfoDisbled}
278 320 hidden={invoicingStatus !== 'INVOICED'}
279 321 placeholder="请输入开户银行"
280 322 />
... ... @@ -283,12 +325,14 @@ export default ({ onClose, data, isAdd }) =&gt; {
283 325 name="bankAccountNumber"
284 326 hidden={invoicingStatus !== 'INVOICED'}
285 327 label="银行账号"
  328 + disabled={mainInfoDisbled}
286 329 placeholder="请输入银行账号"
287 330 />
288 331 <ProFormText
289 332 width="lg"
290 333 name="notes"
291 334 label="备注"
  335 + disabled={mainInfoDisbled}
292 336 placeholder="请输入备注"
293 337 />
294 338  
... ... @@ -386,6 +430,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
386 430  
387 431 <h2>商品信息</h2>
388 432 <ProFormList
  433 + creatorButtonProps={{ disabled: false }}
389 434 name="list"
390 435 label=""
391 436 initialValue={[
... ... @@ -432,7 +477,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
432 477 >
433 478 {[
434 479 <ProFormSelect
435   - key={listMeta.field.key}
  480 + key="key"
436 481 label="商品名称"
437 482 width="lg"
438 483 showSearch
... ... @@ -443,12 +488,18 @@ export default ({ onClose, data, isAdd }) =&gt; {
443 488 autoFillProductInfo(option, listMeta);
444 489 }}
445 490 request={async (value) => {
  491 + console.log(value);
446 492 const { data } =
447 493 await postServiceOrderQueryProductInformation({
448 494 data: { productName: value.keyWords },
449 495 });
450 496 return data.map((p: any) => {
451   - return { ...p, label: p.productName, value: p.id };
  497 + return {
  498 + ...p,
  499 + label: p.productName,
  500 + value: p.productName,
  501 + key: p.id,
  502 + };
452 503 });
453 504 }}
454 505 />,
... ... @@ -473,7 +524,7 @@ export default ({ onClose, data, isAdd }) =&gt; {
473 524 label="商品参数"
474 525 placeholder="请输入商品参数"
475 526 />
476   - <ProFormText
  527 + <ProFormDigit
477 528 width="lg"
478 529 name="quantity"
479 530 label="商品数量"
... ... @@ -503,12 +554,12 @@ export default ({ onClose, data, isAdd }) =&gt; {
503 554 placeholder="请输入子订单金额"
504 555 rules={[{ required: true, message: '子订单金额必填' }]}
505 556 />
506   - <ProFormText
  557 + {/* <ProFormText
507 558 width="lg"
508 559 name="serialNumber"
509 560 label="物流单号"
510 561 placeholder="请输入物流单号"
511   - />
  562 + /> */}
512 563 <ProFormText
513 564 width="lg"
514 565 name="notes"
... ...
src/pages/Order/components/SubOrderNotesEditModal.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import { postServiceOrderDetails } from '@/services';
  3 +import { ModalForm, ProFormTextArea } from '@ant-design/pro-components';
  4 +import { Form, message } from 'antd';
  5 +export default ({ setNotesEditVisible, data, onClose }) => {
  6 + const [form] = Form.useForm<{ name: string; company: string }>();
  7 + return (
  8 + <ModalForm<{
  9 + name: string;
  10 + company: string;
  11 + }>
  12 + width={500}
  13 + open
  14 + title="修改备注"
  15 + form={form}
  16 + autoFocusFirstInput
  17 + modalProps={{
  18 + okText: '保存',
  19 + cancelText: '取消',
  20 + destroyOnClose: true,
  21 + onCancel: () => {
  22 + setNotesEditVisible(false);
  23 + },
  24 + }}
  25 + submitTimeout={2000}
  26 + onFinish={async (values) => {
  27 + let body = { id: data.id, notes: values.name };
  28 + const res = await postServiceOrderDetails({ data: body });
  29 + if (res.result === RESPONSE_CODE.SUCCESS) {
  30 + message.success(res.message);
  31 + onClose();
  32 + }
  33 + }}
  34 + onOpenChange={setNotesEditVisible}
  35 + >
  36 + <ProFormTextArea
  37 + width="lg"
  38 + name="name"
  39 + initialValue={data.notes}
  40 + placeholder="填写备注内容"
  41 + />
  42 + </ModalForm>
  43 + );
  44 +};
... ...
src/pages/Order/constant.ts
... ... @@ -20,8 +20,8 @@ export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = {
20 20 };
21 21  
22 22 export const INVOCING_STATUS_OPTIONS = {
23   - UN_INVOICE: '否',
24   - INVOICED: '是',
  23 + UN_INVOICE: '不需开票',
  24 + INVOICED: '需要开票',
25 25 };
26 26  
27 27 export const LOGISTICS_STATUS_OPTIONS = {
... ... @@ -154,7 +154,7 @@ export const MAIN_ORDER_COLUMNS = [
154 154 search: {
155 155 transform: (value) => {
156 156 return {
157   - startTime: value[0],
  157 + beginTime: value[0],
158 158 endTime: value[1],
159 159 };
160 160 },
... ... @@ -175,8 +175,8 @@ export const MAIN_ORDER_COLUMNS = [
175 175 search: {
176 176 transform: (value) => {
177 177 return {
178   - startTime: value[0],
179   - endTime: value[1],
  178 + invoicingBeginTime: value[0],
  179 + invoicingEndTime: value[1],
180 180 };
181 181 },
182 182 },
... ...
src/pages/Order/index.tsx
... ... @@ -5,7 +5,7 @@ import {
5 5 postServiceOrderQueryServiceOrder,
6 6 } from '@/services';
7 7 import { orderExport } from '@/services/order';
8   -import { enumToProTableEnumValue, enumValueToLabel } from '@/utils';
  8 +import { enumValueToLabel } from '@/utils';
9 9 import { DownOutlined, EllipsisOutlined } from '@ant-design/icons';
10 10 import {
11 11 PageContainer,
... ... @@ -33,6 +33,7 @@ import ConfirmReceiptModal from &#39;./components/ConfirmReceiptModal&#39;;
33 33 import DeliverModal from './components/DeliverModal';
34 34 import FinancialDrawer from './components/FinancialDrawer';
35 35 import OrderDrawer from './components/OrderDrawer';
  36 +import SubOrderNotesEditModal from './components/SubOrderNotesEditModal';
36 37 import {
37 38 INVOCING_STATUS_OPTIONS,
38 39 LOGISTICS_STATUS_OPTIONS,
... ... @@ -49,11 +50,12 @@ const OrderPage = () =&gt; {
49 50 const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false);
50 51 const [checkVisible, setCheckVisible] = useState<boolean>(false);
51 52 const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false);
  53 + const [notesEditVisible, setNotesEditVisible] = useState<boolean>(false);
52 54 const [financialVisible, setFinancialVisible] = useState<boolean>(false);
53 55 const [confirmReceiptVisible, setConfirmReceiptVisible] =
54 56 useState<boolean>(false);
55 57 const [deliverVisible, setDeliverVisible] = useState<boolean>(false);
56   - const [isOrderAddOpt, setIsOrderAddOpt] = useState<boolean>(false);
  58 + const [orderOptType, setOrderOptType] = useState<string>('');
57 59 const [isFinalcialEdit, setIsFinalcialEdit] = useState<boolean>(false);
58 60 const [expandedRowKeys, setExpandedRowKeys] = useState<Key[]>([]);
59 61 const [orderRow, setOrderRow] = useState<Partial<OrderType>>({});
... ... @@ -66,12 +68,11 @@ const OrderPage = () =&gt; {
66 68 const [selectedItems, setSelectedItems] = useState([]);
67 69 const mainTableRef = useRef();
68 70  
69   - console.log(enumToProTableEnumValue(ORDER_STATUS_OPTIONS));
70 71 const resize = () => {
71 72 // 计算元素底部到视口顶部的距离
72 73 let bottomDistance = document
73 74 .getElementById('mainTable')
74   - .getElementsByClassName('ant-table-thead')[0]
  75 + ?.getElementsByClassName('ant-table-thead')[0]
75 76 .getBoundingClientRect().bottom;
76 77 // 获取屏幕高度
77 78 let screenHeight =
... ... @@ -128,6 +129,30 @@ const OrderPage = () =&gt; {
128 129 <div>订单编号:{record.id}</div>
129 130 </Flex>
130 131 </Checkbox>
  132 + <Space>
  133 + <div>销售代表:{record.salesCode}</div>
  134 +
  135 + {rolePath?.includes('addOrder') ? (
  136 + <Button
  137 + type="primary"
  138 + size="small"
  139 + onClick={() => {
  140 + setOrderOptType('copy');
  141 + setOrderDrawerVisible(true);
  142 + let copy = cloneDeep(record);
  143 + copy.id = undefined;
  144 + copy.subOrderInformationLists?.forEach((item) => {
  145 + item.id = undefined;
  146 + });
  147 + setOrderRow(copy);
  148 + }}
  149 + >
  150 + 复制
  151 + </Button>
  152 + ) : (
  153 + ''
  154 + )}
  155 + </Space>
131 156 </Flex>
132 157 {/* 收货、开票、备注信息 */}
133 158 <Flex justify="space-between" className="px-2 py-4">
... ... @@ -241,9 +266,34 @@ const OrderPage = () =&gt; {
241 266 className="p-0"
242 267 type="link"
243 268 onClick={() => {
  269 + //勾选的子订单:如果有勾选,后面只校验有勾选的
  270 + let selectedSubOrders = selectedRowObj[record.id];
  271 + if (
  272 + selectedSubOrders === undefined ||
  273 + selectedSubOrders.length === 0
  274 + ) {
  275 + selectedSubOrders = record.subOrderInformationLists;
  276 + }
  277 + for (
  278 + let index = 0;
  279 + index < selectedSubOrders.length;
  280 + index++
  281 + ) {
  282 + let orderStatus = selectedSubOrders[index].orderStatus;
  283 + //是审核通过及之后的订单
  284 + if (
  285 + orderStatus !== 'UNAUDITED' &&
  286 + orderStatus !== 'AUDIT_FAILED'
  287 + ) {
  288 + message.error(
  289 + '请选择未审核或者审核失败的订单进行编辑',
  290 + );
  291 + return;
  292 + }
  293 + }
244 294 setOrderDrawerVisible(true);
245 295 setOrderRow(record);
246   - setIsOrderAddOpt(false);
  296 + setOrderOptType('edit');
247 297 }}
248 298 >
249 299 编辑
... ... @@ -257,6 +307,23 @@ const OrderPage = () =&gt; {
257 307 className="p-0"
258 308 type="link"
259 309 onClick={() => {
  310 + console.log('!!!!!!!!!!!');
  311 + let selectedSubOrders = selectedRowObj[record.id];
  312 + setSelectedRows(selectedSubOrders);
  313 + if (selectedSubOrders === undefined) {
  314 + setSelectedRows(record.subOrderInformationLists);
  315 + }
  316 + for (let i = 0; i < selectedRows.length; i++) {
  317 + if (
  318 + selectedRows[i].orderStatus !== 'UNAUDITED' &&
  319 + selectedRows[i].orderStatus !== 'AUDIT_FAILED'
  320 + ) {
  321 + message.error(
  322 + '请选择未审核或者审核失败的子订单进行审核',
  323 + );
  324 + return;
  325 + }
  326 + }
260 327 setOrderRow(record);
261 328 setCheckVisible(true);
262 329 }}
... ... @@ -329,15 +396,21 @@ const OrderPage = () =&gt; {
329 396 if (item.component === 'tag') {
330 397 return {
331 398 ...item,
332   - render: (text: string) => {
  399 + render: (text: string, optRecord) => {
333 400 let label = enumValueToLabel(text, ORDER_STATUS_OPTIONS);
334 401 if (label === undefined) {
335 402 label = enumValueToLabel(text, INVOCING_STATUS_OPTIONS);
336 403 }
337 404 let color = 'gold';
338   - if (label === '开票' || label === '已审核') {
  405 + if (label === '需要开票' || label === '已审核') {
339 406 color = 'green';
340 407 }
  408 + if (
  409 + label === '需要开票' &&
  410 + optRecord.invoicingTime !== undefined
  411 + ) {
  412 + label = '已开票';
  413 + }
341 414 return <Tag color={color}>{label}</Tag>;
342 415 },
343 416 };
... ... @@ -469,6 +542,7 @@ const OrderPage = () =&gt; {
469 542 onClick={() => {
470 543 setOrderRow(optRecord);
471 544 setCheckVisible(true);
  545 + setSelectedRows([optRecord]);
472 546 }}
473 547 >
474 548 审核
... ... @@ -510,8 +584,15 @@ const OrderPage = () =&gt; {
510 584 dataIndex: 'notes',
511 585 key: 'notes',
512 586 align: 'center',
513   - render: () => (
514   - <Button type="dashed" size="small">
  587 + render: (optTxt, optRecord) => (
  588 + <Button
  589 + type="dashed"
  590 + size="small"
  591 + onClick={() => {
  592 + setNotesEditVisible(true);
  593 + setOrderRow(optRecord);
  594 + }}
  595 + >
515 596 详情
516 597 </Button>
517 598 ),
... ... @@ -523,6 +604,8 @@ const OrderPage = () =&gt; {
523 604 ...setSelectedRowObj,
524 605 [record.id]: selectedRows,
525 606 });
  607 + selectedRowObj[record.id] = selectedRows;
  608 + setSelectedRows(selectedRows);
526 609 },
527 610 // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
528 611 // 注释该行则默认不显示下拉选项
... ... @@ -599,14 +682,14 @@ const OrderPage = () =&gt; {
599 682 onClick: () => {},
600 683 };
601 684  
602   - if (rolePath.includes('addOrder')) {
  685 + if (rolePath?.includes('addOrder')) {
603 686 toolBtns.push(
604 687 <Button
605 688 type="primary"
606 689 key="out"
607 690 onClick={() => {
608 691 setOrderDrawerVisible(true);
609   - setIsOrderAddOpt(true);
  692 + setOrderOptType('add');
610 693 }}
611 694 >
612 695 新增
... ... @@ -662,10 +745,10 @@ const OrderPage = () =&gt; {
662 745 history.push('/login');
663 746 },
664 747 },
665   - {
666   - label: '修改密码',
667   - key: '2',
668   - },
  748 + // {
  749 + // label: '修改密码',
  750 + // key: '2',
  751 + // },
669 752 ],
670 753 }}
671 754 >
... ... @@ -734,12 +817,13 @@ const OrderPage = () =&gt; {
734 817 {orderDrawerVisible && (
735 818 <OrderDrawer
736 819 data={orderRow}
  820 + subOrders={selectedRows}
737 821 onClose={() => {
738 822 setOrderDrawerVisible(false);
739 823 setOrderRow({});
740 824 mainTableRef.current?.reload();
741 825 }}
742   - isAdd={isOrderAddOpt}
  826 + orderOptType={orderOptType}
743 827 />
744 828 )}
745 829  
... ... @@ -747,9 +831,23 @@ const OrderPage = () =&gt; {
747 831 <CheckModal
748 832 setCheckVisible={setCheckVisible}
749 833 data={orderRow}
  834 + subOrders={selectedRows}
750 835 onClose={() => {
751 836 setCheckVisible(false);
752 837 setOrderRow({});
  838 + setSelectedRows({});
  839 + mainTableRef.current?.reload();
  840 + }}
  841 + />
  842 + )}
  843 +
  844 + {notesEditVisible && (
  845 + <SubOrderNotesEditModal
  846 + setNotesEditVisible={setNotesEditVisible}
  847 + data={orderRow}
  848 + onClose={() => {
  849 + setNotesEditVisible(false);
  850 + setOrderRow({});
753 851 mainTableRef.current?.reload();
754 852 }}
755 853 />
... ...
src/pages/Order/type.d.ts
... ... @@ -15,43 +15,52 @@ export interface OrderType {
15 15 }
16 16  
17 17 export interface OrderListItemType {
18   - main_order_id: number;
19   - sales_code: string;
20   - customer_name: string;
21   - customer_contact_number: string;
22   - customer_shipping_address: string;
23   - institution_contact_name: string;
  18 + mainPath: any;
  19 + totalPayment: ReactNode;
  20 + notes: ReactNode;
  21 + invoiceIdentificationNumber: ReactNode;
  22 + bankAccountNumber: ReactNode;
  23 + bank: ReactNode;
  24 + id: undefined;
  25 + subOrderInformationLists: any;
  26 + createTime: ReactNode;
  27 + mainOrderId: number;
  28 + salesCode: string;
  29 + customerName: string;
  30 + customerContactNumber: string;
  31 + customerShippingAddress: string;
  32 + institutionContactName: string;
24 33 institution: string;
25   - main_order_create_time: string;
26   - main_order_update_time: string;
27   - main_order_create_by_name: string;
28   - main_order_update_by_name: any;
29   - sub_orders: {
30   - sub_order_id: number;
31   - product_code: number;
32   - product_name: string;
  34 + mainOrderCreateTime: string;
  35 + mainOrderUpdateTime: string;
  36 + mainOrderCreateByName: string;
  37 + mainOrderUpdateByName: any;
  38 + subOrders: {
  39 + subOrderId: number;
  40 + productCode: number;
  41 + productName: string;
33 42 quantity: number;
34   - product_price: number;
  43 + productPrice: number;
35 44 unit: string;
36 45 parameters: any;
37   - total_payment: number;
38   - sub_order_payment: number;
39   - is_cancel: number;
40   - logistics_status: string;
41   - payment_status: string;
42   - payment_method: string;
43   - payment_channel: string;
44   - payment_transaction_id: any;
45   - invoice_information: any;
46   - invoicing_status: string;
47   - product_belong_department: string;
48   - waybill_number: any;
  46 + totalPayment: number;
  47 + subOrderPayment: number;
  48 + isCancel: number;
  49 + logisticsStatus: string;
  50 + paymentStatus: string;
  51 + paymentMethod: string;
  52 + paymentChannel: string;
  53 + paymentTransactionId: any;
  54 + invoiceInformation: any;
  55 + invoicingStatus: string;
  56 + productBelongDepartment: string;
  57 + waybillNumber: any;
49 58 notes: any;
50   - examine_notes: any;
51   - order_status: string;
52   - sub_order_create_time: string;
53   - sub_order_update_time: string;
54   - sub_order_create_by_name: string;
55   - sub_order_update_by_name: any;
  59 + examineNotes: any;
  60 + orderStatus: string;
  61 + subOrderCreateTime: string;
  62 + subOrderUpdateTime: string;
  63 + subOrderCreateByName: string;
  64 + subOrderUpdateByName: any;
56 65 }[];
57 66 }
... ...
src/pages/OrderPrint/OrderPrintModal.tsx
... ... @@ -77,8 +77,8 @@ export default ({ mainOrder, subOrders, onClose }) =&gt; {
77 77 style={{ width: 'auto' }}
78 78 onChange={handleChange}
79 79 options={[
80   - { value: 'Houjie', label: '科路得出货单' },
81   - { value: 'Dalang', label: '大朗出货单' },
  80 + { value: 'Houjie', label: '科路得出货单-厚街' },
  81 + { value: 'Dalang', label: '科路得出货单-大朗' },
82 82 { value: 'Zhuguang', label: '烛光出货单' },
83 83 ]}
84 84 />
... ...
src/services/request.ts
... ... @@ -5008,6 +5008,77 @@ export const postServiceOrderConfirmReceipt = /* #__PURE__ */ (() =&gt; {
5008 5008 return request;
5009 5009 })();
5010 5010  
  5011 +/** @description request parameter type for postServiceOrderDetails */
  5012 +export interface PostServiceOrderDetailsOption {
  5013 + /**
  5014 + * @description
  5015 + * dto
  5016 + */
  5017 + body: {
  5018 + /**
  5019 + @description
  5020 + dto */
  5021 + dto: Dto;
  5022 + };
  5023 +}
  5024 +
  5025 +/** @description response type for postServiceOrderDetails */
  5026 +export interface PostServiceOrderDetailsResponse {
  5027 + /**
  5028 + * @description
  5029 + * OK
  5030 + */
  5031 + 200: ServerResult;
  5032 + /**
  5033 + * @description
  5034 + * Created
  5035 + */
  5036 + 201: any;
  5037 + /**
  5038 + * @description
  5039 + * Unauthorized
  5040 + */
  5041 + 401: any;
  5042 + /**
  5043 + * @description
  5044 + * Forbidden
  5045 + */
  5046 + 403: any;
  5047 + /**
  5048 + * @description
  5049 + * Not Found
  5050 + */
  5051 + 404: any;
  5052 +}
  5053 +
  5054 +export type PostServiceOrderDetailsResponseSuccess =
  5055 + PostServiceOrderDetailsResponse[200];
  5056 +/**
  5057 + * @description
  5058 + * 编辑订单详情(现在所有的角色在订单任何状态都可以进行修改)
  5059 + * @tags 内部订单
  5060 + * @produces *
  5061 + * @consumes application/json
  5062 + */
  5063 +export const postServiceOrderDetails = /* #__PURE__ */ (() => {
  5064 + const method = 'post';
  5065 + const url = '/service/order/details';
  5066 + function request(
  5067 + option: PostServiceOrderDetailsOption,
  5068 + ): Promise<PostServiceOrderDetailsResponseSuccess> {
  5069 + return requester(request.url, {
  5070 + method: request.method,
  5071 + ...option,
  5072 + }) as unknown as Promise<PostServiceOrderDetailsResponseSuccess>;
  5073 + }
  5074 +
  5075 + /** http method */
  5076 + request.method = method;
  5077 + /** request url */
  5078 + request.url = url;
  5079 + return request;
  5080 +})();
  5081 +
5011 5082 /** @description request parameter type for postServiceOrderEditOrder */
5012 5083 export interface PostServiceOrderEditOrderOption {
5013 5084 /**
... ...