Commit 45e950cdac5cea5412707a1265abfab10833449f
Merge branch 'znh' into 'develop'
Znh See merge request !15
Showing
27 changed files
with
1796 additions
and
125 deletions
.umirc.ts
... | ... | @@ -39,6 +39,13 @@ export default defineConfig({ |
39 | 39 | icon: 'ProfileOutlined', |
40 | 40 | }, |
41 | 41 | { |
42 | + name: '订单报表', | |
43 | + path: '/orderReport', | |
44 | + component: './OrderReport', | |
45 | + icon: 'LineChartOutlined', | |
46 | + access: 'canReadAdmin', | |
47 | + }, | |
48 | + { | |
42 | 49 | name: '打印', |
43 | 50 | path: '/print', |
44 | 51 | component: './OrderPrint', | ... | ... |
package.json
src/access.ts
1 | 1 | export default (initialState: API.UserInfo) => { |
2 | 2 | // 在这里按照初始化数据定义项目中的权限,统一管理 |
3 | 3 | // 参考文档 https://umijs.org/docs/max/access |
4 | - const canSeeAdmin = !!( | |
5 | - initialState && initialState.name !== 'dontHaveAccess' | |
6 | - ); | |
4 | + const { roleSmallVO } = initialState; | |
5 | + | |
6 | + console.log(roleSmallVO?.code === 'admin'); | |
7 | 7 | return { |
8 | - canSeeAdmin, | |
8 | + canReadAdmin: roleSmallVO?.code === 'admin', | |
9 | 9 | }; |
10 | 10 | }; | ... | ... |
src/app.ts
... | ... | @@ -7,12 +7,12 @@ import { message } from 'antd'; |
7 | 7 | import { RESPONSE_CODE } from './constants/enum'; |
8 | 8 | |
9 | 9 | import './style/global.css'; |
10 | +import { getUserInfo } from './utils'; | |
10 | 11 | |
11 | 12 | // 全局初始化数据配置,用于 Layout 用户信息和权限初始化 |
12 | 13 | // 更多信息见文档:https://umijs.org/docs/api/runtime-config#getinitialstate |
13 | -export async function getInitialState(): Promise<{ name: string }> { | |
14 | - // getUserInfo(); | |
15 | - return { name: '' }; | |
14 | +export async function getInitialState() { | |
15 | + return getUserInfo(); | |
16 | 16 | } |
17 | 17 | |
18 | 18 | export const layout = () => { |
... | ... | @@ -24,7 +24,7 @@ export const layout = () => { |
24 | 24 | // rightContentRender: () => <RightContent />, |
25 | 25 | // footerRender: () => <Footer />, |
26 | 26 | }, |
27 | - collapsed: true, | |
27 | + // collapsed: true, | |
28 | 28 | }; |
29 | 29 | }; |
30 | 30 | ... | ... |
src/assets/icons/down.svg
0 → 100644
1 | +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702266081134" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1723" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M866.742857 762.148571l-20.48-170.788571a6.948571 6.948571 0 0 0-11.702857-4.022857l-50.834286 51.2-232.594285-232.594286a14.262857 14.262857 0 0 0-19.382858 0l-87.04 87.04L207.36 256a6.948571 6.948571 0 0 0-9.508571 0L159.085714 294.765714a6.948571 6.948571 0 0 0 0 9.508572l275.748572 276.114285a13.531429 13.531429 0 0 0 19.382857 0l87.405714-87.405714 193.828572 193.828572-50.834286 50.834285a6.948571 6.948571 0 0 0 4.022857 11.702857l170.422857 20.48a6.582857 6.582857 0 0 0 7.68-7.68z" p-id="1724" fill="#1DB302"></path></svg> | |
0 | 2 | \ No newline at end of file | ... | ... |
src/assets/icons/up.svg
0 → 100644
1 | +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702266075667" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1549" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M859.062857 256l-170.788571 20.48a6.948571 6.948571 0 0 0-4.022857 11.702857l50.834285 49.005714-193.462857 193.828572-87.405714-87.405714a13.897143 13.897143 0 0 0-19.382857 0l-275.748572 275.748571a7.314286 7.314286 0 0 0 0 9.874286L197.851429 768a6.948571 6.948571 0 0 0 9.508571 0l237.348571-236.982857 87.04 87.04a14.262857 14.262857 0 0 0 19.382858 0l232.594285-232.594286 50.834286 50.834286a6.948571 6.948571 0 0 0 11.702857-4.022857l20.48-170.788572a6.582857 6.582857 0 0 0-7.68-5.485714z" p-id="1550" fill="#d81e06"></path></svg> | |
0 | 2 | \ No newline at end of file | ... | ... |
src/pages/Login/index.tsx
... | ... | @@ -9,7 +9,7 @@ import { |
9 | 9 | ProConfigProvider, |
10 | 10 | ProFormText, |
11 | 11 | } from '@ant-design/pro-components'; |
12 | -import { history, useModel } from '@umijs/max'; | |
12 | +import { useModel } from '@umijs/max'; | |
13 | 13 | import { Button, theme } from 'antd'; |
14 | 14 | import { useEffect, useState } from 'react'; |
15 | 15 | |
... | ... | @@ -27,6 +27,7 @@ export default () => { |
27 | 27 | useEffect(() => { |
28 | 28 | fetchCode(); |
29 | 29 | }, []); |
30 | + | |
30 | 31 | return ( |
31 | 32 | <ProConfigProvider hashed={false}> |
32 | 33 | <div |
... | ... | @@ -43,7 +44,10 @@ export default () => { |
43 | 44 | |
44 | 45 | if (res.result === RESPONSE_CODE.SUCCESS) { |
45 | 46 | setUserLocalInfo(res.data.token, res.data?.user); |
46 | - history.push('/order'); | |
47 | + /** | |
48 | + * 使用history.push或者history.replace会导致菜单路由无法更新,需要再次刷新页面 | |
49 | + */ | |
50 | + window.location.href = '/order'; | |
47 | 51 | } else { |
48 | 52 | fetchCode(); |
49 | 53 | } | ... | ... |
src/pages/Order/components/CheckModal.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | -import { postServiceOrderCheckOrder } from '@/services'; | |
2 | +import { | |
3 | + postServiceOrderCheckOrder, | |
4 | + postServiceOrderFinanceCheckOrder, | |
5 | +} from '@/services'; | |
3 | 6 | import { ModalForm, ProFormTextArea } from '@ant-design/pro-components'; |
4 | 7 | import { Button, Form, message } from 'antd'; |
5 | -export default ({ setCheckVisible, data, subOrders, onClose }) => { | |
8 | +import { CHECK_TYPE } from '../constant'; | |
9 | +export default ({ | |
10 | + setCheckVisible, | |
11 | + data, | |
12 | + subOrders, | |
13 | + orderCheckType, | |
14 | + onClose, | |
15 | +}) => { | |
6 | 16 | const [form] = Form.useForm<{ name: string; company: string }>(); |
7 | 17 | let subOrderIds: any[] = []; |
8 | 18 | //是单条子订单审核 |
... | ... | @@ -11,6 +21,7 @@ export default ({ setCheckVisible, data, subOrders, onClose }) => { |
11 | 21 | } else { |
12 | 22 | subOrderIds = subOrders.map((subOrder) => subOrder.id); |
13 | 23 | } |
24 | + | |
14 | 25 | async function doCheck(body: object) { |
15 | 26 | const data = await postServiceOrderCheckOrder({ |
16 | 27 | data: body, |
... | ... | @@ -20,6 +31,31 @@ export default ({ setCheckVisible, data, subOrders, onClose }) => { |
20 | 31 | onClose(); |
21 | 32 | } |
22 | 33 | } |
34 | + | |
35 | + /** | |
36 | + * | |
37 | + * @param body 财务审核 | |
38 | + */ | |
39 | + async function doFinancailCheck(body: object) { | |
40 | + const data = await postServiceOrderFinanceCheckOrder({ | |
41 | + data: body, | |
42 | + }); | |
43 | + if (data.result === RESPONSE_CODE.SUCCESS) { | |
44 | + message.success(data.message); | |
45 | + onClose(); | |
46 | + } | |
47 | + } | |
48 | + | |
49 | + /** | |
50 | + * 审核类型 | |
51 | + */ | |
52 | + function checkType(check: string) { | |
53 | + if (orderCheckType === check) { | |
54 | + return true; | |
55 | + } | |
56 | + return false; | |
57 | + } | |
58 | + | |
23 | 59 | return ( |
24 | 60 | <ModalForm<{ |
25 | 61 | name: string; |
... | ... | @@ -40,30 +76,74 @@ export default ({ setCheckVisible, data, subOrders, onClose }) => { |
40 | 76 | }} |
41 | 77 | submitter={{ |
42 | 78 | render: (props, defaultDoms) => { |
43 | - return [ | |
79 | + let myDoms = []; | |
80 | + myDoms.push( | |
44 | 81 | <Button |
45 | 82 | key="驳回" |
46 | 83 | onClick={() => { |
47 | - doCheck({ | |
48 | - flag: false, | |
49 | - ids: subOrderIds, | |
84 | + if (checkType(CHECK_TYPE.NORMAL)) { | |
85 | + doCheck({ | |
86 | + flag: false, | |
87 | + ids: subOrderIds, | |
88 | + externalProcurement: 0, | |
89 | + checkNotes: form.getFieldValue('name'), | |
90 | + }); | |
91 | + return; | |
92 | + } | |
93 | + | |
94 | + //财务审核 | |
95 | + doFinancailCheck({ | |
50 | 96 | checkNotes: form.getFieldValue('name'), |
97 | + ids: subOrderIds, | |
98 | + checkPassOrReject: false, | |
51 | 99 | }); |
52 | 100 | }} |
53 | 101 | > |
54 | 102 | 驳回 |
55 | 103 | </Button>, |
56 | - defaultDoms[1], | |
57 | - ]; | |
104 | + ); | |
105 | + | |
106 | + //如果不是财务审核,那么显示这个外部采购 | |
107 | + if (checkType(CHECK_TYPE.NORMAL)) { | |
108 | + myDoms.push( | |
109 | + <Button | |
110 | + key="外部采购" | |
111 | + onClick={() => { | |
112 | + doCheck({ | |
113 | + flag: false, | |
114 | + ids: subOrderIds, | |
115 | + externalProcurement: 1, | |
116 | + checkNotes: form.getFieldValue('name'), | |
117 | + }); | |
118 | + }} | |
119 | + > | |
120 | + 外部采购 | |
121 | + </Button>, | |
122 | + ); | |
123 | + } | |
124 | + | |
125 | + //确认 | |
126 | + myDoms.push(defaultDoms[1]); | |
127 | + return myDoms; | |
58 | 128 | }, |
59 | 129 | }} |
60 | 130 | submitTimeout={2000} |
61 | 131 | onFinish={async (values) => { |
62 | - //审核通过 | |
63 | - return doCheck({ | |
64 | - flag: true, | |
65 | - ids: subOrderIds, | |
132 | + if (checkType(CHECK_TYPE.NORMAL)) { | |
133 | + //审核通过 | |
134 | + return doCheck({ | |
135 | + flag: true, | |
136 | + ids: subOrderIds, | |
137 | + externalProcurement: 0, | |
138 | + checkNotes: values.name, | |
139 | + }); | |
140 | + } | |
141 | + | |
142 | + //财务审核 | |
143 | + return doFinancailCheck({ | |
66 | 144 | checkNotes: values.name, |
145 | + ids: subOrderIds, | |
146 | + checkPassOrReject: true, | |
67 | 147 | }); |
68 | 148 | }} |
69 | 149 | onOpenChange={setCheckVisible} | ... | ... |
src/pages/Order/components/DeliverModal.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | -import { postServiceOrderSendProduct } from '@/services'; | |
2 | +import { | |
3 | + postServiceOrderSendProduct, | |
4 | + postServiceOrderSupplierSendOrder, | |
5 | +} from '@/services'; | |
3 | 6 | import { enumToSelect } from '@/utils'; |
4 | 7 | import { |
5 | 8 | ProColumns, |
... | ... | @@ -11,17 +14,31 @@ import { |
11 | 14 | import { Button, Input, InputNumber, Modal, Select, message } from 'antd'; |
12 | 15 | import { cloneDeep } from 'lodash'; |
13 | 16 | import { useEffect, useRef, useState } from 'react'; |
14 | -import { LOGISTICS_STATUS_OPTIONS } from '../constant'; | |
17 | +import { CHECK_TYPE, LOGISTICS_STATUS_OPTIONS } from '../constant'; | |
15 | 18 | |
16 | 19 | const DeliverModal = ({ |
17 | 20 | data: propsData, |
18 | 21 | isSendProduct, |
19 | 22 | setVisible, |
23 | + sendType, | |
20 | 24 | onClose, |
21 | 25 | }) => { |
22 | 26 | const [data, setData] = useState(propsData || {}); |
23 | 27 | const form = useRef(); |
24 | 28 | |
29 | + /** | |
30 | + * 是供应商发货还是普通发货 | |
31 | + * @param typeString | |
32 | + * @returns | |
33 | + */ | |
34 | + function optType(typeString: string) { | |
35 | + if (sendType === typeString) { | |
36 | + return true; | |
37 | + } | |
38 | + | |
39 | + return false; | |
40 | + } | |
41 | + | |
25 | 42 | useEffect(() => { |
26 | 43 | setData(propsData); |
27 | 44 | }, [propsData]); |
... | ... | @@ -126,7 +143,9 @@ const DeliverModal = ({ |
126 | 143 | logisticsMethod: item.logisticsMethod, |
127 | 144 | serialNumber: item.serialNumber, |
128 | 145 | packageNumber: |
129 | - item.packageNumber === undefined ? 1 : item.packageNumber, | |
146 | + item.packageNumber === null || item.packageNumber === undefined | |
147 | + ? 1 | |
148 | + : item.packageNumber, | |
130 | 149 | }; |
131 | 150 | }); |
132 | 151 | let body = { id: data[0].mainOrderId, list: list, flag: false }; |
... | ... | @@ -134,7 +153,13 @@ const DeliverModal = ({ |
134 | 153 | body.flag = true; |
135 | 154 | } |
136 | 155 | //发货请求 |
137 | - const res = await postServiceOrderSendProduct({ data: body }); | |
156 | + let res; | |
157 | + if (optType(CHECK_TYPE.SUPPLIER)) { | |
158 | + res = await postServiceOrderSupplierSendOrder({ data: body }); | |
159 | + } else { | |
160 | + res = await postServiceOrderSendProduct({ data: body }); | |
161 | + } | |
162 | + | |
138 | 163 | if (res.result === RESPONSE_CODE.SUCCESS) { |
139 | 164 | message.success(res.message); |
140 | 165 | onClose(); | ... | ... |
src/pages/Order/components/FinancialDrawer.tsx
... | ... | @@ -4,17 +4,35 @@ import { |
4 | 4 | postServiceOrderEditOrder, |
5 | 5 | postServiceOrderInvoicing, |
6 | 6 | } from '@/services'; |
7 | +import { enumToSelect } from '@/utils'; | |
7 | 8 | import { |
8 | 9 | DrawerForm, |
9 | 10 | ProFormDatePicker, |
11 | + ProFormSelect, | |
10 | 12 | ProFormText, |
11 | 13 | ProFormTextArea, |
12 | 14 | } from '@ant-design/pro-components'; |
13 | 15 | import { Form, message } from 'antd'; |
16 | +import { useEffect, useState } from 'react'; | |
17 | +import { INVOCING_STATUS_OPTIONS_OLD } from '../constant'; | |
14 | 18 | |
15 | -export default ({ mainOrder, subOrders, isEdit, onClose }) => { | |
19 | +export default ({ | |
20 | + mainOrder, | |
21 | + subOrders, | |
22 | + isEdit, | |
23 | + isMainOrder, | |
24 | + cancel, | |
25 | + onClose, | |
26 | +}) => { | |
27 | + const [invoicingStatus, setInvoicingStatus] = useState(''); | |
16 | 28 | const subIds = subOrders.map((item) => item.id); |
17 | - console.log(subOrders); | |
29 | + useEffect(() => { | |
30 | + // 在组件挂载或数据变化时,更新组件状态 | |
31 | + if (mainOrder) { | |
32 | + setInvoicingStatus(subOrders[0]?.invoicingStatus); | |
33 | + } | |
34 | + }, [mainOrder]); | |
35 | + | |
18 | 36 | const [form] = Form.useForm<{ name: string; company: string }>(); |
19 | 37 | return ( |
20 | 38 | <DrawerForm<{ |
... | ... | @@ -44,6 +62,8 @@ export default ({ mainOrder, subOrders, isEdit, onClose }) => { |
44 | 62 | subIds: subIds, |
45 | 63 | collectMoneyTime: form.getFieldValue('collectMoneyTime'), |
46 | 64 | invoicingNotes: form.getFieldValue('invoicingNotes'), |
65 | + invoicingStatus: form.getFieldValue('invoicingStatus'), | |
66 | + mainorderOrSubOrderInvoicing: isMainOrder, | |
47 | 67 | }; |
48 | 68 | if (isEdit) { |
49 | 69 | res = await postServiceOrderEditOrder({ data: body }); |
... | ... | @@ -56,9 +76,25 @@ export default ({ mainOrder, subOrders, isEdit, onClose }) => { |
56 | 76 | } |
57 | 77 | }} |
58 | 78 | onOpenChange={(val) => { |
59 | - return !val && onClose(); | |
79 | + return !val && cancel(); | |
60 | 80 | }} |
61 | 81 | > |
82 | + {isMainOrder ? ( | |
83 | + <ProFormSelect | |
84 | + placeholder="选择是否需要开票" | |
85 | + name="invoicingStatus" | |
86 | + width="lg" | |
87 | + label="是否需要开票" | |
88 | + options={enumToSelect(INVOCING_STATUS_OPTIONS_OLD)} | |
89 | + onChange={setInvoicingStatus} | |
90 | + initialValue={subOrders[0]?.invoicingStatus} | |
91 | + // disabled={mainInfoDisbled} | |
92 | + rules={[{ required: true, message: '是否需要开票必填' }]} | |
93 | + /> | |
94 | + ) : ( | |
95 | + '' | |
96 | + )} | |
97 | + | |
62 | 98 | <ProFormText |
63 | 99 | width="lg" |
64 | 100 | name="invoiceIdentificationNumber" |
... | ... | @@ -80,26 +116,35 @@ export default ({ mainOrder, subOrders, isEdit, onClose }) => { |
80 | 116 | placeholder="请输入开户银行账号" |
81 | 117 | disabled |
82 | 118 | /> |
83 | - <ProFormDatePicker | |
84 | - width="lg" | |
85 | - name="invoicingTime" | |
86 | - label="开票时间" | |
87 | - disabled={isEdit} | |
88 | - rules={[{ required: !isEdit ? true : false, message: '这是必填项' }]} | |
89 | - initialValue={subOrders[0].invoicingTime} | |
90 | - /> | |
91 | - <ProFormDatePicker | |
92 | - width="lg" | |
93 | - name="collectMoneyTime" | |
94 | - label="收款时间" | |
95 | - initialValue={subOrders[0].collectMoneyTime} | |
96 | - /> | |
119 | + | |
120 | + {invoicingStatus !== 'UN_INVOICE' | |
121 | + ? [ | |
122 | + <ProFormDatePicker | |
123 | + key="invoicingTime" | |
124 | + width="lg" | |
125 | + name="invoicingTime" | |
126 | + label="开票时间" | |
127 | + disabled={isEdit} | |
128 | + rules={[ | |
129 | + { required: !isEdit ? true : false, message: '这是必填项' }, | |
130 | + ]} | |
131 | + initialValue={subOrders[0]?.invoicingTime} | |
132 | + />, | |
133 | + <ProFormDatePicker | |
134 | + key="collectMoneyTime" | |
135 | + width="lg" | |
136 | + name="collectMoneyTime" | |
137 | + label="收款时间" | |
138 | + initialValue={subOrders[0]?.collectMoneyTime} | |
139 | + />, | |
140 | + ] | |
141 | + : ''} | |
97 | 142 | |
98 | 143 | <ProFormTextArea |
99 | 144 | width="lg" |
100 | 145 | name="invoicingNotes" |
101 | 146 | label="备注" |
102 | - initialValue={subOrders[0].invoicingNotes} | |
147 | + initialValue={subOrders[0]?.invoicingNotes} | |
103 | 148 | /> |
104 | 149 | </DrawerForm> |
105 | 150 | ); | ... | ... |
src/pages/Order/components/HistoryModal.tsx
... | ... | @@ -2,7 +2,11 @@ import { postServiceOrderQueryHistoryOrderRecord } from '@/services'; |
2 | 2 | import { enumValueToLabel, formatDateTime } from '@/utils'; |
3 | 3 | import { Button, Col, Empty, Flex, Modal, Row, Spin } from 'antd'; |
4 | 4 | import { useEffect, useState } from 'react'; |
5 | -import { HISTORY_OPT_TYPE, ORDER_STATUS_OPTIONS } from '../constant'; | |
5 | +import { | |
6 | + FINANCIAL_STATUS_OPTIONS, | |
7 | + HISTORY_OPT_TYPE, | |
8 | + ORDER_STATUS_OPTIONS, | |
9 | +} from '../constant'; | |
6 | 10 | |
7 | 11 | export default ({ subOrders, onClose }) => { |
8 | 12 | let subOrderIds = subOrders?.map((subOrder: any) => { |
... | ... | @@ -50,7 +54,7 @@ export default ({ subOrders, onClose }) => { |
50 | 54 | <Row className="max-h-[500px] overflow-auto" gutter={[0, 14]}> |
51 | 55 | {data.map((item) => { |
52 | 56 | return ( |
53 | - <Col span={24} key="key"> | |
57 | + <Col span={24} key={i}> | |
54 | 58 | <Flex vertical> |
55 | 59 | <div> |
56 | 60 | <span className="py-2 text-[#5E5E5E]"> |
... | ... | @@ -64,7 +68,7 @@ export default ({ subOrders, onClose }) => { |
64 | 68 | <Flex vertical> |
65 | 69 | {item.historySubOrderRecordDto?.map((history) => { |
66 | 70 | return ( |
67 | - <div className="py-1" key="key"> | |
71 | + <div className="py-1" key={history.id}> | |
68 | 72 | <span className="pr-2 text-[#5E5E5E]"> |
69 | 73 | {formatDateTime(history.createTime)} |
70 | 74 | </span> |
... | ... | @@ -88,7 +92,10 @@ export default ({ subOrders, onClose }) => { |
88 | 92 | history.status, |
89 | 93 | ORDER_STATUS_OPTIONS, |
90 | 94 | ) === undefined |
91 | - ? '已开票' | |
95 | + ? enumValueToLabel( | |
96 | + history.status, | |
97 | + FINANCIAL_STATUS_OPTIONS, | |
98 | + ) | |
92 | 99 | : enumValueToLabel( |
93 | 100 | history.status, |
94 | 101 | ORDER_STATUS_OPTIONS, | ... | ... |
src/pages/Order/components/OrderDrawer.tsx
... | ... | @@ -27,6 +27,7 @@ import { cloneDeep } from 'lodash'; |
27 | 27 | import { useEffect, useRef, useState } from 'react'; |
28 | 28 | import { |
29 | 29 | INVOCING_STATUS_OPTIONS, |
30 | + INVOCING_STATUS_OPTIONS_OLD, | |
30 | 31 | PAYMENT_CHANNEL_OPTIONS, |
31 | 32 | PAYMENT_METHOD_OPTIONS, |
32 | 33 | PRODUCT_BELONG_DEPARTMENT_OPTIONS, |
... | ... | @@ -44,6 +45,17 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
44 | 45 | return orderOptType === type; |
45 | 46 | } |
46 | 47 | |
48 | + /** | |
49 | + * | |
50 | + * @returns 获取开票选项 | |
51 | + */ | |
52 | + function getInvoicingSelect() { | |
53 | + if (optType('edit') || optType('copy')) { | |
54 | + return enumToSelect(INVOCING_STATUS_OPTIONS_OLD); | |
55 | + } | |
56 | + return enumToSelect(INVOCING_STATUS_OPTIONS); | |
57 | + } | |
58 | + | |
47 | 59 | const fileList: any = []; |
48 | 60 | |
49 | 61 | useEffect(() => { |
... | ... | @@ -77,6 +89,11 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
77 | 89 | }); |
78 | 90 | } |
79 | 91 | |
92 | + //复制的时候,如果是不需要开票,要把开票信息清空 | |
93 | + if (optType('copy') && data.invoicingStatus === 'UN_INVOICE') { | |
94 | + data.invoiceIdentificationNumber = undefined; | |
95 | + } | |
96 | + | |
80 | 97 | if (subOrders !== undefined && subOrders.length > 0) { |
81 | 98 | data.list = subOrders; |
82 | 99 | } |
... | ... | @@ -259,6 +276,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
259 | 276 | > |
260 | 277 | <h2>订单基本信息</h2> |
261 | 278 | <ProFormText |
279 | + key="id" | |
262 | 280 | name="id" |
263 | 281 | width="lg" |
264 | 282 | disabled |
... | ... | @@ -268,6 +286,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
268 | 286 | /> |
269 | 287 | <ProFormSelect |
270 | 288 | name="salesCode" |
289 | + key="salesCode" | |
271 | 290 | width="lg" |
272 | 291 | showSearch |
273 | 292 | label="销售代表" |
... | ... | @@ -277,7 +296,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
277 | 296 | // disabled={mainInfoDisbled} |
278 | 297 | /> |
279 | 298 | <ProFormSelect |
280 | - key="key" | |
299 | + key="customerName" | |
281 | 300 | label="收货人" |
282 | 301 | width="lg" |
283 | 302 | showSearch |
... | ... | @@ -372,6 +391,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
372 | 391 | /> |
373 | 392 | <ProFormText |
374 | 393 | width="lg" |
394 | + key="customerContactNumber" | |
375 | 395 | name="customerContactNumber" |
376 | 396 | label="联系方式" |
377 | 397 | placeholder="请输入联系方式" |
... | ... | @@ -380,6 +400,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
380 | 400 | /> |
381 | 401 | <ProFormText |
382 | 402 | width="lg" |
403 | + key="institution" | |
383 | 404 | name="institution" |
384 | 405 | label="单位" |
385 | 406 | placeholder="请输入单位" |
... | ... | @@ -388,6 +409,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
388 | 409 | /> |
389 | 410 | <ProFormText |
390 | 411 | width="lg" |
412 | + key="institutionContactName" | |
391 | 413 | name="institutionContactName" |
392 | 414 | label="单位联系人" |
393 | 415 | placeholder="请输入单位联系人" |
... | ... | @@ -396,6 +418,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
396 | 418 | /> |
397 | 419 | <ProFormTextArea |
398 | 420 | width="lg" |
421 | + key="customerShippingAddress" | |
399 | 422 | name="customerShippingAddress" |
400 | 423 | label="收货地址" |
401 | 424 | placeholder="请输入收货地址" |
... | ... | @@ -406,6 +429,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
406 | 429 | <ProFormDigit |
407 | 430 | name="totalPayment" |
408 | 431 | width="lg" |
432 | + key="totalPayment" | |
409 | 433 | label="支付总额(¥)" |
410 | 434 | rules={[{ required: true, message: '支付总额必填' }]} |
411 | 435 | tooltip="点击计算,合计所有子订单金额" |
... | ... | @@ -428,6 +452,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
428 | 452 | placeholder="请输入支付渠道" |
429 | 453 | name="paymentChannel" |
430 | 454 | width="lg" |
455 | + key="paymentChannel" | |
431 | 456 | label="支付渠道" |
432 | 457 | options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)} |
433 | 458 | rules={[{ required: true, message: '支付渠道必填' }]} |
... | ... | @@ -437,6 +462,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
437 | 462 | placeholder="请输入支付方式" |
438 | 463 | name="paymentMethod" |
439 | 464 | width="lg" |
465 | + key="paymentMethod" | |
440 | 466 | label="支付方式" |
441 | 467 | options={enumToSelect(PAYMENT_METHOD_OPTIONS)} |
442 | 468 | rules={[{ required: true, message: '支付方式必填' }]} |
... | ... | @@ -446,8 +472,9 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
446 | 472 | placeholder="选择是否需要开票" |
447 | 473 | name="invoicingStatus" |
448 | 474 | width="lg" |
475 | + key="invoicingStatus" | |
449 | 476 | label="是否需要开票" |
450 | - options={enumToSelect(INVOCING_STATUS_OPTIONS)} | |
477 | + options={getInvoicingSelect()} | |
451 | 478 | // disabled={mainInfoDisbled} |
452 | 479 | onChange={(_, option) => { |
453 | 480 | setInvoicingStatus(option.value); |
... | ... | @@ -463,6 +490,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
463 | 490 | width="lg" |
464 | 491 | name="invoiceIdentificationNumber" |
465 | 492 | label="开票信息" |
493 | + key="invoiceIdentificationNumber" | |
466 | 494 | // disabled={mainInfoDisbled} |
467 | 495 | hidden={invoicingStatus === 'UN_INVOICE'} |
468 | 496 | placeholder="请输入开票信息" |
... | ... | @@ -477,6 +505,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
477 | 505 | {getUserInfo().roleSmallVO?.code === 'admin' ? ( |
478 | 506 | <ProFormDateTimePicker |
479 | 507 | width="lg" |
508 | + key="invoicingTime" | |
480 | 509 | name="invoicingTime" |
481 | 510 | // disabled={mainInfoDisbled} |
482 | 511 | hidden={invoicingStatus === 'UN_INVOICE'} |
... | ... | @@ -489,6 +518,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
489 | 518 | <ProFormText |
490 | 519 | width="lg" |
491 | 520 | name="bank" |
521 | + key="bank" | |
492 | 522 | label="开户银行" |
493 | 523 | // disabled={mainInfoDisbled} |
494 | 524 | hidden={invoicingStatus === 'UN_INVOICE'} |
... | ... | @@ -496,6 +526,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
496 | 526 | /> |
497 | 527 | <ProFormText |
498 | 528 | width="lg" |
529 | + key="bankAccountNumber" | |
499 | 530 | name="bankAccountNumber" |
500 | 531 | hidden={invoicingStatus === 'UN_INVOICE'} |
501 | 532 | label="银行账号" |
... | ... | @@ -506,6 +537,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
506 | 537 | width="lg" |
507 | 538 | name="notes" |
508 | 539 | label="备注" |
540 | + key="notes" | |
509 | 541 | // disabled={mainInfoDisbled} |
510 | 542 | placeholder="请输入备注" |
511 | 543 | rules={[ |
... | ... | @@ -651,7 +683,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
651 | 683 | }} |
652 | 684 | />, |
653 | 685 | <ProFormText |
654 | - key="productCode" | |
686 | + key={'productCode' + listMeta.index} | |
655 | 687 | width="lg" |
656 | 688 | name="productCode" |
657 | 689 | disabled |
... | ... | @@ -666,7 +698,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
666 | 698 | placeholder="未输入商品名称" |
667 | 699 | />, |
668 | 700 | <ProFormText |
669 | - key="parameters" | |
701 | + key={'parameters' + listMeta.index} | |
670 | 702 | width="lg" |
671 | 703 | name="parameters" |
672 | 704 | label="商品参数" |
... | ... | @@ -674,7 +706,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
674 | 706 | rules={[{ required: true, message: '商品参数必填' }]} |
675 | 707 | />, |
676 | 708 | <ProFormDigit |
677 | - key="quantity" | |
709 | + key={'quantity' + listMeta.index} | |
678 | 710 | width="lg" |
679 | 711 | name="quantity" |
680 | 712 | label="商品数量" |
... | ... | @@ -688,7 +720,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
688 | 720 | rules={[{ required: true, message: '商品数量必填' }]} |
689 | 721 | />, |
690 | 722 | <ProFormDigit |
691 | - key="productPrice" | |
723 | + key={'productPrice' + listMeta.index} | |
692 | 724 | width="lg" |
693 | 725 | name="productPrice" |
694 | 726 | label="商品单价" |
... | ... | @@ -702,7 +734,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
702 | 734 | rules={[{ required: true, message: '商品单价必填' }]} |
703 | 735 | />, |
704 | 736 | <ProFormText |
705 | - key="unit" | |
737 | + key={'unit' + listMeta.index} | |
706 | 738 | width="lg" |
707 | 739 | name="unit" |
708 | 740 | label="商品单位" |
... | ... | @@ -712,7 +744,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
712 | 744 | |
713 | 745 | <ProFormDigit |
714 | 746 | width="lg" |
715 | - key="subOrderPayment" | |
747 | + key={'subOrderPayment' + listMeta.index} | |
716 | 748 | name="subOrderPayment" |
717 | 749 | label="子订单金额" |
718 | 750 | placeholder="请输入子订单金额" |
... | ... | @@ -720,7 +752,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
720 | 752 | rules={[{ required: true, message: '子订单金额必填' }]} |
721 | 753 | />, |
722 | 754 | <ProFormSelect |
723 | - key="productBelongBusiness" | |
755 | + key={'productBelongBusiness' + listMeta.index} | |
724 | 756 | placeholder="请输入所属事业部" |
725 | 757 | name="productBelongBusiness" |
726 | 758 | width="lg" |
... | ... | @@ -731,7 +763,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
731 | 763 | // disabled={mainInfoDisbled} |
732 | 764 | />, |
733 | 765 | <ProFormText |
734 | - key="notes" | |
766 | + key={'notes' + listMeta.index} | |
735 | 767 | width="lg" |
736 | 768 | name="notes" |
737 | 769 | label="备注" |
... | ... | @@ -745,7 +777,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
745 | 777 | />, |
746 | 778 | <> |
747 | 779 | <ProFormUploadDragger |
748 | - key="filePaths" | |
780 | + key={'filePaths' + listMeta.index} | |
749 | 781 | label="附件" |
750 | 782 | name="filePaths" |
751 | 783 | action="/api/service/order/fileProcess" | ... | ... |
src/pages/Order/constant.ts
... | ... | @@ -9,10 +9,12 @@ export const PAYMENT_CHANNEL_OPTIONS = { |
9 | 9 | }; |
10 | 10 | |
11 | 11 | export const PAYMENT_METHOD_OPTIONS = { |
12 | - PAYMENT_IN_ADVANCE: '预付', | |
13 | - CASH_ON_DELIVERY: '货到付款', | |
14 | 12 | UNPAID: '未付款', |
13 | + TAOBAO_ORDER_HAS_BEEN_PAID: '淘宝订单已付款', | |
14 | + PAYMENT_IN_ADVANCE: '预付款', | |
15 | + WITHHOLDING_ADVANCE_DEPOSIT: '扣预存', | |
15 | 16 | PLATFORM_SETTLEMENT: '平台结算', |
17 | + CASH_ON_DELIVERY: '货到付款', | |
16 | 18 | }; |
17 | 19 | |
18 | 20 | export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { |
... | ... | @@ -23,13 +25,19 @@ export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { |
23 | 25 | EXPERIMENTAL_CONSUMABLES: '实验耗材事业部门', |
24 | 26 | }; |
25 | 27 | |
26 | -export const INVOCING_STATUS_OPTIONS = { | |
28 | +export const INVOCING_STATUS_OPTIONS_OLD = { | |
27 | 29 | UN_INVOICE: '不需开票', |
28 | 30 | SPECIALLY_INVOICED: '专票', |
29 | 31 | COMMON_INVOICED: '普票', |
30 | 32 | INVOICED: '需要开票', |
31 | 33 | }; |
32 | 34 | |
35 | +export const INVOCING_STATUS_OPTIONS = { | |
36 | + UN_INVOICE: '不需开票', | |
37 | + SPECIALLY_INVOICED: '专票', | |
38 | + COMMON_INVOICED: '普票', | |
39 | +}; | |
40 | + | |
33 | 41 | export const INVOCING_STATUS = { |
34 | 42 | UN_INVOICE: '不需开票', |
35 | 43 | SPECIALLY_INVOICED: '专票', |
... | ... | @@ -38,11 +46,23 @@ export const INVOCING_STATUS = { |
38 | 46 | }; |
39 | 47 | |
40 | 48 | /** |
49 | + * 普通审核 | |
50 | + * 财务审核 | |
51 | + * 采购审核 | |
52 | + */ | |
53 | +export const CHECK_TYPE = { | |
54 | + NORMAL: 'NORMAL', | |
55 | + FINALCIAL: 'FINALCIAL', | |
56 | + PROCURE: 'PROCURE', | |
57 | + SUPPLIER: 'SUPPLIER', | |
58 | +}; | |
59 | + | |
60 | +/** | |
41 | 61 | * 是否需要开票 |
42 | 62 | * @param subOrder |
43 | 63 | */ |
44 | 64 | export const getNeedInvoicing = (subOrder: any) => { |
45 | - if (subOrder.invoicingTime !== undefined) { | |
65 | + if (subOrder.invoicingTime !== null && subOrder.invoicingTime !== undefined) { | |
46 | 66 | return '已开票'; |
47 | 67 | } |
48 | 68 | if (subOrder.invoicingStatus === 'UN_INVOICE') { |
... | ... | @@ -73,15 +93,26 @@ export const LOGISTICS_STATUS_OPTIONS = { |
73 | 93 | JINGDONG_LOGISTICS: '京东', |
74 | 94 | SF_EXPRESS: '顺丰', |
75 | 95 | DEBANG_LOGISTICS: '德邦物流', |
96 | + OTHER_LOGISTICS: '其他物流方式', | |
76 | 97 | }; |
77 | 98 | |
78 | 99 | export const ORDER_STATUS_OPTIONS = { |
79 | 100 | UNAUDITED: '未审核', |
80 | - AUDIT_FAILED: '审核失败', | |
101 | + FINANCE_PROCESS: '财务已审核', | |
81 | 102 | AUDITED: '已审核', |
103 | + PROCURE_UN_PROCESS: '采购未审核', | |
104 | + PROCURE_PROCESS: '采购已审核', | |
105 | + SUPPLIER_WAIT_SHIP: '供应商-待发货', | |
106 | + SUPPLIER_SHIPPED: '供应商-已发货', | |
82 | 107 | WAIT_SHIP: '待发货', |
83 | 108 | SHIPPED: '已发货', |
84 | 109 | CONFIRM_RECEIPT: '确认收货', |
110 | + AUDIT_FAILED: '审核失败', | |
111 | +}; | |
112 | + | |
113 | +export const FINANCIAL_STATUS_OPTIONS = { | |
114 | + INVOICING: '已开票', | |
115 | + UN_INVOICING: '取消开票', | |
85 | 116 | }; |
86 | 117 | |
87 | 118 | export const TAGS_COLOR = new Map<string, string>([ |
... | ... | @@ -95,7 +126,12 @@ export const TAGS_COLOR = new Map<string, string>([ |
95 | 126 | ['WAIT_SHIP', 'processing'], |
96 | 127 | ['SHIPPED', 'processing'], |
97 | 128 | ['AUDIT_FAILED', 'error'], |
98 | - ['CONFIRM_RECEIPT', 'success'], | |
129 | + ['CONFIRM_RECEIPT', 'processing'], | |
130 | + ['FINANCE_PROCESS', 'processing'], | |
131 | + ['PROCURE_UN_PROCESS', 'processing'], | |
132 | + ['PROCURE_PROCESS', 'processing'], | |
133 | + ['SUPPLIER_WAIT_SHIP', 'processing'], | |
134 | + ['SUPPLIER_SHIPPED', 'processing'], | |
99 | 135 | ]); |
100 | 136 | |
101 | 137 | export const SALES_CODE_OPTIONS = [ |
... | ... | @@ -108,6 +144,7 @@ export const SALES_CODE_OPTIONS = [ |
108 | 144 | { label: 'HQ-6_smile', value: 'HQ-6_smile' }, |
109 | 145 | { label: 'HQ-7_Yvonne', value: 'HQ-7_Yvonne' }, |
110 | 146 | { label: 'HQ-8_Daniel', value: 'HQ-8_Daniel' }, |
147 | + { label: 'HQ-9_Wendy', value: 'HQ-9_Wendy' }, | |
111 | 148 | { label: 'W_strong', value: 'W_strong' }, |
112 | 149 | { label: 'W-1_Alice', value: 'W-1_Alice' }, |
113 | 150 | { label: 'W-2_Demi', value: 'W-2_Demi' }, |
... | ... | @@ -133,12 +170,14 @@ export const SALES_CODE_OPTIONS = [ |
133 | 170 | { label: 'GW-4_Lynn', value: 'GW-4_Lynn' }, |
134 | 171 | { label: 'GW-6_smile', value: 'GW-6_smile' }, |
135 | 172 | { label: 'GW-7_Yvonne', value: 'GW-7_Yvonne' }, |
173 | + { label: 'GW-9_Wendy', value: 'GW-9_Wendy' }, | |
136 | 174 | { label: 'W-9_Jack', value: 'W-9_Jack' }, |
137 | 175 | { label: 'W-8_Andy', value: 'W-8_Andy' }, |
138 | 176 | { label: 'CQ_Peter', value: 'CQ_Peter' }, |
139 | 177 | { label: 'MA_A_Mao', value: 'MA_A_Mao' }, |
140 | 178 | { label: 'CQ-2', value: 'CQ-2' }, |
141 | 179 | { label: 'JJ', value: 'JJ' }, |
180 | + { label: 'CQ-3', value: 'CQ-3' }, | |
142 | 181 | ]; |
143 | 182 | |
144 | 183 | export const HISTORY_OPT_TYPE = new Map<string, string>([ |
... | ... | @@ -152,6 +191,11 @@ export const HISTORY_OPT_TYPE = new Map<string, string>([ |
152 | 191 | ['INVOICING', '财务开票'], |
153 | 192 | ['EDIT_ORDER', '财务编辑'], |
154 | 193 | ['MODIFY_SEN_INFORMATION', '发货信息编辑'], |
194 | + ['UN_INVOICING', '财务取消开票'], | |
195 | + ['FINANCE_CHECK_ORDER', '财务审核'], | |
196 | + ['PROCURE_CHECK_ORDER', '采购审核'], | |
197 | + ['SUPPLIER_PRINT', '供应商打印'], | |
198 | + ['EXTERNAL_PROCUREMENT', '仓库操作外部采购子订单'], | |
155 | 199 | ]); |
156 | 200 | |
157 | 201 | export const MAIN_ORDER_COLUMNS = [ |
... | ... | @@ -265,7 +309,7 @@ export const MAIN_ORDER_COLUMNS = [ |
265 | 309 | { |
266 | 310 | title: '创建日期', |
267 | 311 | dataIndex: 'createTime', |
268 | - valueType: 'dateRange', | |
312 | + valueType: 'dateTimeRange', | |
269 | 313 | hideInTable: true, |
270 | 314 | search: { |
271 | 315 | transform: (value) => { | ... | ... |
src/pages/Order/index.less
src/pages/Order/index.tsx
... | ... | @@ -6,6 +6,7 @@ import { |
6 | 6 | } from '@/services'; |
7 | 7 | import { orderExport } from '@/services/order'; |
8 | 8 | import { enumValueToLabel, formatDateTime } from '@/utils'; |
9 | +import { getUserInfo } from '@/utils/user'; | |
9 | 10 | import { |
10 | 11 | ClockCircleTwoTone, |
11 | 12 | ContainerTwoTone, |
... | ... | @@ -46,8 +47,10 @@ import HistoryModal from './components/HistoryModal'; |
46 | 47 | import ImportModal from './components/ImportModal'; |
47 | 48 | import OrderDrawer from './components/OrderDrawer'; |
48 | 49 | import OrderNotesEditModal from './components/OrderNotesEditModal'; |
50 | +import ProcureCheckModal from './components/ProcureCheckModal'; | |
49 | 51 | import SubOrderComfirmReceiptImagesModal from './components/SubOrderComfirmReceiptImagesModal'; |
50 | 52 | import { |
53 | + CHECK_TYPE, | |
51 | 54 | LOGISTICS_STATUS_OPTIONS, |
52 | 55 | MAIN_ORDER_COLUMNS, |
53 | 56 | ORDER_STATUS_OPTIONS, |
... | ... | @@ -79,6 +82,8 @@ const OrderPage = () => { |
79 | 82 | const [isSendProduct, setIsSendProduct] = useState<boolean>(false); |
80 | 83 | const [isMainOrder, setIsMainOrder] = useState<boolean>(false); |
81 | 84 | const [importModalVisible, setImportModalVisible] = useState<boolean>(false); |
85 | + const [procureCheckModalVisible, setProcureCheckModalVisible] = | |
86 | + useState<boolean>(false); | |
82 | 87 | const [confirmReceiptVisible, setConfirmReceiptVisible] = |
83 | 88 | useState<boolean>(false); |
84 | 89 | const [deliverVisible, setDeliverVisible] = useState<boolean>(false); |
... | ... | @@ -90,7 +95,7 @@ const OrderPage = () => { |
90 | 95 | const [orderRow, setOrderRow] = useState<Partial<OrderType>>({}); |
91 | 96 | const [mainOrderAllItemKeys, setMainOrderAllItemKeys] = useState([]); |
92 | 97 | const [rolePath, setRolePath] = useState([]); //当前角色权限(新增跟打印按钮) |
93 | - const userInfo = JSON.parse(localStorage.getItem('userInfo')); | |
98 | + const userInfo = getUserInfo(); | |
94 | 99 | // const [tableHeight, setTableHeight] = useState(200); |
95 | 100 | const [selectedRows, setSelectedRows] = useState({}); |
96 | 101 | const [selectedRowObj, setSelectedRowObj] = useState({}); |
... | ... | @@ -98,6 +103,7 @@ const OrderPage = () => { |
98 | 103 | const [selectedRowKeys, setSelectedRowKeys] = useState([]); |
99 | 104 | const [pageSize, setPageSize] = useState(10); |
100 | 105 | const [currentPage, setCurrentPage] = useState(1); |
106 | + const [orderCheckType, setOrderCheckType] = useState(''); | |
101 | 107 | const mainTableRef = useRef(); |
102 | 108 | const [messageApi, contextHolder] = message.useMessage(); |
103 | 109 | |
... | ... | @@ -158,11 +164,31 @@ const OrderPage = () => { |
158 | 164 | // window.addEventListener('resize', resize); |
159 | 165 | // }); |
160 | 166 | |
161 | - const onCheckboxChange = (itemKey: never) => { | |
162 | - const newSelectedItems = selectedItems.includes(itemKey) | |
163 | - ? selectedItems.filter((key) => key !== itemKey) | |
164 | - : [...selectedItems, itemKey]; | |
165 | - | |
167 | + const onCheckboxChange = (record: never) => { | |
168 | + let newSelectedItems = []; | |
169 | + if (selectedItems.includes(record.id)) { | |
170 | + newSelectedItems = selectedItems.filter((key) => key !== record.id); | |
171 | + setSelectedRowKeys([]); | |
172 | + setSelectedRowObj({ | |
173 | + ...setSelectedRowObj, | |
174 | + [record.id]: [], | |
175 | + }); | |
176 | + selectedRowObj[record.id] = []; | |
177 | + setSelectedRows([]); | |
178 | + } else { | |
179 | + newSelectedItems = [...selectedItems, record.id]; | |
180 | + //子订单全部自动选中 | |
181 | + let subIds = record.subOrderInformationLists?.map((item) => { | |
182 | + return item.id; | |
183 | + }); | |
184 | + setSelectedRowKeys(subIds); | |
185 | + setSelectedRowObj({ | |
186 | + ...setSelectedRowObj, | |
187 | + [record.id]: record.subOrderInformationLists, | |
188 | + }); | |
189 | + selectedRowObj[record.id] = record.subOrderInformationLists; | |
190 | + setSelectedRows(record.subOrderInformationLists); | |
191 | + } | |
166 | 192 | setSelectedItems(newSelectedItems); |
167 | 193 | }; |
168 | 194 | const handleTableExpand = (mainOrderIds: any) => { |
... | ... | @@ -306,6 +332,7 @@ const OrderPage = () => { |
306 | 332 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
307 | 333 | <Tag |
308 | 334 | color={ |
335 | + optRecord.invoicingTime === null || | |
309 | 336 | optRecord.invoicingTime === undefined |
310 | 337 | ? TAGS_COLOR.get(optRecord.invoicingStatus) |
311 | 338 | : 'success' |
... | ... | @@ -360,6 +387,7 @@ const OrderPage = () => { |
360 | 387 | setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 |
361 | 388 | setDeliverVisible(true); |
362 | 389 | setIsSendProduct(true); |
390 | + setOrderCheckType(CHECK_TYPE.NORMAL); | |
363 | 391 | }} |
364 | 392 | > |
365 | 393 | 发货 |
... | ... | @@ -368,7 +396,26 @@ const OrderPage = () => { |
368 | 396 | '' |
369 | 397 | )} |
370 | 398 | |
371 | - {optRecord.subPath.includes('queryAnnex') ? ( | |
399 | + {optRecord.subPath.includes('supplierSendOrder') ? ( | |
400 | + <Button | |
401 | + className="p-0" | |
402 | + type="link" | |
403 | + onClick={() => { | |
404 | + optRecord.mainOrderId = record.id; | |
405 | + setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
406 | + setDeliverVisible(true); | |
407 | + setIsSendProduct(true); | |
408 | + setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
409 | + }} | |
410 | + > | |
411 | + 供应商发货 | |
412 | + </Button> | |
413 | + ) : ( | |
414 | + '' | |
415 | + )} | |
416 | + | |
417 | + {optRecord.subPath.includes('queryAnnex') && | |
418 | + optRecord.listAnnex?.length > 0 ? ( | |
372 | 419 | <Button |
373 | 420 | className="p-0" |
374 | 421 | type="link" |
... | ... | @@ -409,6 +456,24 @@ const OrderPage = () => { |
409 | 456 | setOrderPrintVisible(true); |
410 | 457 | setSelectedRows([optRecord]); |
411 | 458 | setOrderRow(record); |
459 | + setOrderCheckType(CHECK_TYPE.NORMAL); | |
460 | + }} | |
461 | + > | |
462 | + 打印 | |
463 | + </Button> | |
464 | + ) : ( | |
465 | + '' | |
466 | + )} | |
467 | + | |
468 | + {optRecord.subPath.includes('supplierPrint') ? ( | |
469 | + <Button | |
470 | + className="p-0" | |
471 | + type="link" | |
472 | + onClick={async () => { | |
473 | + setOrderPrintVisible(true); | |
474 | + setSelectedRows([optRecord]); | |
475 | + setOrderRow(record); | |
476 | + setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
412 | 477 | }} |
413 | 478 | > |
414 | 479 | 打印 |
... | ... | @@ -416,6 +481,7 @@ const OrderPage = () => { |
416 | 481 | ) : ( |
417 | 482 | '' |
418 | 483 | )} |
484 | + | |
419 | 485 | {optRecord.subPath.includes('editOrder') ? ( |
420 | 486 | <Button |
421 | 487 | className="p-0" |
... | ... | @@ -441,6 +507,7 @@ const OrderPage = () => { |
441 | 507 | setIsFinalcialEdit(false); |
442 | 508 | setOrderRow(record); |
443 | 509 | setSelectedRows([optRecord]); |
510 | + setIsMainOrder(false); | |
444 | 511 | }} |
445 | 512 | > |
446 | 513 | 开票 |
... | ... | @@ -456,6 +523,7 @@ const OrderPage = () => { |
456 | 523 | setOrderRow(optRecord); |
457 | 524 | setCheckVisible(true); |
458 | 525 | setSelectedRows([optRecord]); |
526 | + setOrderCheckType(CHECK_TYPE.NORMAL); | |
459 | 527 | }} |
460 | 528 | > |
461 | 529 | 审核 |
... | ... | @@ -464,6 +532,40 @@ const OrderPage = () => { |
464 | 532 | '' |
465 | 533 | )} |
466 | 534 | |
535 | + {optRecord.subPath.includes('financeCheckOrder') ? ( | |
536 | + <Button | |
537 | + className="p-0" | |
538 | + type="link" | |
539 | + onClick={() => { | |
540 | + setOrderRow(optRecord); | |
541 | + setCheckVisible(true); | |
542 | + setSelectedRows([optRecord]); | |
543 | + setOrderCheckType(CHECK_TYPE.FINALCIAL); | |
544 | + }} | |
545 | + > | |
546 | + 财务审核 | |
547 | + </Button> | |
548 | + ) : ( | |
549 | + '' | |
550 | + )} | |
551 | + | |
552 | + {optRecord.subPath.includes('procureCheckOrder') ? ( | |
553 | + <Button | |
554 | + className="p-0" | |
555 | + type="link" | |
556 | + onClick={() => { | |
557 | + setOrderRow(optRecord); | |
558 | + setSelectedRows([optRecord]); | |
559 | + setOrderCheckType(CHECK_TYPE.PROCURE); | |
560 | + setProcureCheckModalVisible(true); | |
561 | + }} | |
562 | + > | |
563 | + 采购审核 | |
564 | + </Button> | |
565 | + ) : ( | |
566 | + '' | |
567 | + )} | |
568 | + | |
467 | 569 | {optRecord.subPath.includes('rePrintOrder') ? ( |
468 | 570 | <Button |
469 | 571 | className="p-0" |
... | ... | @@ -591,7 +693,7 @@ const OrderPage = () => { |
591 | 693 | <Flex> |
592 | 694 | <Flex> |
593 | 695 | <Checkbox |
594 | - onChange={() => onCheckboxChange(record.id)} | |
696 | + onChange={() => onCheckboxChange(record)} | |
595 | 697 | checked={selectedItems.includes(record.id)} |
596 | 698 | > |
597 | 699 | <Space split={<Divider type="vertical" />}> |
... | ... | @@ -607,21 +709,32 @@ const OrderPage = () => { |
607 | 709 | <span className="text-[#8C8C8C]">代表:</span> |
608 | 710 | <span className="text-slate-700">{record.salesCode}</span> |
609 | 711 | </div> |
610 | - <span> | |
712 | + <div | |
713 | + title={record.institution} | |
714 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]" | |
715 | + > | |
611 | 716 | <span className="text-[#8C8C8C]">单位:</span> |
612 | 717 | <span className="text-slate-700">{record.institution}</span> |
613 | - </span> | |
718 | + </div> | |
614 | 719 | <span> |
615 | 720 | <span className="text-[#8C8C8C]">联系人:</span> |
616 | 721 | <span className="text-slate-700"> |
617 | 722 | {record.institutionContactName + ' '} |
618 | - <ContainerTwoTone | |
619 | - className="hover:curcor-pointer" | |
620 | - onClick={() => { | |
621 | - setDeliverInfoDrawerVisible(true); | |
622 | - setOrderRow(record); | |
623 | - }} | |
624 | - /> | |
723 | + </span> | |
724 | + </span> | |
725 | + <span> | |
726 | + <span className="text-[#8C8C8C]">收货人:</span> | |
727 | + <span className="text-slate-700"> | |
728 | + {record.customerName + ' '} | |
729 | + <Tooltip className="order-tooltip" title="详情"> | |
730 | + <ContainerTwoTone | |
731 | + className="hover:curcor-pointer" | |
732 | + onClick={() => { | |
733 | + setDeliverInfoDrawerVisible(true); | |
734 | + setOrderRow(record); | |
735 | + }} | |
736 | + /> | |
737 | + </Tooltip> | |
625 | 738 | </span> |
626 | 739 | </span> |
627 | 740 | </Space> |
... | ... | @@ -636,14 +749,16 @@ const OrderPage = () => { |
636 | 749 | </span> |
637 | 750 | </div> |
638 | 751 | </div> |
639 | - <EditTwoTone | |
640 | - className="hover:curcor-pointer" | |
641 | - onClick={() => { | |
642 | - setNotesEditVisible(true); | |
643 | - setOrderRow(record); | |
644 | - setIsMainOrder(true); | |
645 | - }} | |
646 | - /> | |
752 | + <Tooltip title="编辑"> | |
753 | + <EditTwoTone | |
754 | + className="hover:curcor-pointer" | |
755 | + onClick={() => { | |
756 | + setNotesEditVisible(true); | |
757 | + setOrderRow(record); | |
758 | + setIsMainOrder(true); | |
759 | + }} | |
760 | + /> | |
761 | + </Tooltip> | |
647 | 762 | </Flex> |
648 | 763 | </Flex> |
649 | 764 | <Flex wrap="wrap" gap="middle" vertical> |
... | ... | @@ -656,34 +771,38 @@ const OrderPage = () => { |
656 | 771 | </span> |
657 | 772 | </div> |
658 | 773 | {rolePath?.includes('addOrder') ? ( |
659 | - <CopyTwoTone | |
660 | - className="hover:cursor-pointer" | |
661 | - onClick={() => { | |
662 | - setOrderOptType('copy'); | |
663 | - setOrderDrawerVisible(true); | |
664 | - let copy = cloneDeep(record); | |
665 | - copy.id = undefined; | |
666 | - copy.subOrderInformationLists?.forEach((item) => { | |
667 | - item.id = undefined; | |
668 | - }); | |
669 | - setOrderRow(copy); | |
670 | - }} | |
671 | - /> | |
774 | + <Tooltip title="复制"> | |
775 | + <CopyTwoTone | |
776 | + className="hover:cursor-pointer" | |
777 | + onClick={() => { | |
778 | + setOrderOptType('copy'); | |
779 | + setOrderDrawerVisible(true); | |
780 | + let copy = cloneDeep(record); | |
781 | + copy.id = undefined; | |
782 | + copy.subOrderInformationLists?.forEach((item) => { | |
783 | + item.id = undefined; | |
784 | + }); | |
785 | + setOrderRow(copy); | |
786 | + }} | |
787 | + /> | |
788 | + </Tooltip> | |
672 | 789 | ) : ( |
673 | 790 | '' |
674 | 791 | )} |
675 | 792 | |
676 | - <ClockCircleTwoTone | |
677 | - className="hover:cursor-pointer" | |
678 | - onClick={() => { | |
679 | - setHistoryModalVisible(true); | |
680 | - if (selectedRowObj[record.id]?.length) { | |
681 | - setSelectedRows(selectedRowObj[record.id]); | |
682 | - } else { | |
683 | - setSelectedRows(record.subOrderInformationLists); | |
684 | - } | |
685 | - }} | |
686 | - /> | |
793 | + <Tooltip title="历史"> | |
794 | + <ClockCircleTwoTone | |
795 | + className="hover:cursor-pointer" | |
796 | + onClick={() => { | |
797 | + setHistoryModalVisible(true); | |
798 | + if (selectedRowObj[record.id]?.length) { | |
799 | + setSelectedRows(selectedRowObj[record.id]); | |
800 | + } else { | |
801 | + setSelectedRows(record.subOrderInformationLists); | |
802 | + } | |
803 | + }} | |
804 | + /> | |
805 | + </Tooltip> | |
687 | 806 | </Flex> |
688 | 807 | </Flex> |
689 | 808 | <Flex justify="flex-end"> |
... | ... | @@ -700,6 +819,7 @@ const OrderPage = () => { |
700 | 819 | setSelectedRows(selectedRowObj[record.id]); |
701 | 820 | setDeliverVisible(true); |
702 | 821 | setIsSendProduct(true); |
822 | + setOrderCheckType(CHECK_TYPE.NORMAL); | |
703 | 823 | }} |
704 | 824 | > |
705 | 825 | 发货 |
... | ... | @@ -707,6 +827,27 @@ const OrderPage = () => { |
707 | 827 | ) : ( |
708 | 828 | '' |
709 | 829 | )} |
830 | + | |
831 | + {/* 供应商发货 */} | |
832 | + {record.mainPath.includes('supplierSendOrder') ? ( | |
833 | + <Button | |
834 | + className="p-0" | |
835 | + type="link" | |
836 | + onClick={() => { | |
837 | + if (!selectedRowObj[record.id]?.length) { | |
838 | + return message.error('请选择选择子订单'); | |
839 | + } | |
840 | + setSelectedRows(selectedRowObj[record.id]); | |
841 | + setDeliverVisible(true); | |
842 | + setIsSendProduct(true); | |
843 | + setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
844 | + }} | |
845 | + > | |
846 | + 供应商发货 | |
847 | + </Button> | |
848 | + ) : ( | |
849 | + '' | |
850 | + )} | |
710 | 851 | {record.mainPath.includes('printOrder') ? ( |
711 | 852 | <Button |
712 | 853 | className="p-0" |
... | ... | @@ -718,6 +859,27 @@ const OrderPage = () => { |
718 | 859 | setSelectedRows(selectedRowObj[record.id]); |
719 | 860 | setOrderRow(record); |
720 | 861 | setOrderPrintVisible(true); |
862 | + setOrderCheckType(CHECK_TYPE.NORMAL); | |
863 | + }} | |
864 | + > | |
865 | + 打印 | |
866 | + </Button> | |
867 | + ) : ( | |
868 | + '' | |
869 | + )} | |
870 | + | |
871 | + {record.mainPath.includes('supplierPrint') ? ( | |
872 | + <Button | |
873 | + className="p-0" | |
874 | + type="link" | |
875 | + onClick={() => { | |
876 | + if (!selectedRowObj[record.id]?.length) { | |
877 | + return message.error('请选择选择子订单'); | |
878 | + } | |
879 | + setSelectedRows(selectedRowObj[record.id]); | |
880 | + setOrderRow(record); | |
881 | + setOrderPrintVisible(true); | |
882 | + setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
721 | 883 | }} |
722 | 884 | > |
723 | 885 | 打印 |
... | ... | @@ -725,6 +887,7 @@ const OrderPage = () => { |
725 | 887 | ) : ( |
726 | 888 | '' |
727 | 889 | )} |
890 | + | |
728 | 891 | {record.mainPath.includes('rePrintOrder') ? ( |
729 | 892 | <Button |
730 | 893 | className="p-0" |
... | ... | @@ -782,10 +945,14 @@ const OrderPage = () => { |
782 | 945 | let selectedSubOrders = selectedRowObj[record.id]; |
783 | 946 | setSelectedRows(selectedSubOrders); |
784 | 947 | if (selectedSubOrders === undefined) { |
948 | + setIsMainOrder(true); | |
785 | 949 | setSelectedRows(record.subOrderInformationLists); |
950 | + } else { | |
951 | + setIsMainOrder(false); | |
786 | 952 | } |
787 | 953 | setOrderRow(record); |
788 | 954 | setFinancialVisible(true); |
955 | + setIsFinalcialEdit(false); | |
789 | 956 | }} |
790 | 957 | > |
791 | 958 | 开票 |
... | ... | @@ -845,6 +1012,38 @@ const OrderPage = () => { |
845 | 1012 | setSelectedRows(selectedSubOrders); |
846 | 1013 | if (selectedSubOrders === undefined) { |
847 | 1014 | setSelectedRows(record.subOrderInformationLists); |
1015 | + } | |
1016 | + console.log(selectedRows); | |
1017 | + for (let i = 0; i < selectedRows.length; i++) { | |
1018 | + if ( | |
1019 | + selectedRows[i].orderStatus !== 'UNAUDITED' && | |
1020 | + selectedRows[i].orderStatus !== 'FINANCE_PROCESS' | |
1021 | + ) { | |
1022 | + message.error('请选择未审核的子订单进行审核'); | |
1023 | + return; | |
1024 | + } | |
1025 | + } | |
1026 | + setOrderRow(record); | |
1027 | + setCheckVisible(true); | |
1028 | + setOrderCheckType(CHECK_TYPE.NORMAL); | |
1029 | + }} | |
1030 | + > | |
1031 | + 审核 | |
1032 | + </Button> | |
1033 | + ) : ( | |
1034 | + '' | |
1035 | + )} | |
1036 | + | |
1037 | + {/* 财务审核:主订单暂无 */} | |
1038 | + {record.mainPath.includes('financeCheckOrder') ? ( | |
1039 | + <Button | |
1040 | + className="p-0" | |
1041 | + type="link" | |
1042 | + onClick={() => { | |
1043 | + let selectedSubOrders = selectedRowObj[record.id]; | |
1044 | + setSelectedRows(selectedSubOrders); | |
1045 | + if (selectedSubOrders === undefined) { | |
1046 | + setSelectedRows(record.subOrderInformationLists); | |
848 | 1047 | console.log( |
849 | 1048 | 'subOrderInformationLists:' + |
850 | 1049 | record.subOrderInformationLists, |
... | ... | @@ -853,19 +1052,52 @@ const OrderPage = () => { |
853 | 1052 | for (let i = 0; i < selectedRows.length; i++) { |
854 | 1053 | if ( |
855 | 1054 | selectedRows[i].orderStatus !== 'UNAUDITED' && |
856 | - selectedRows[i].orderStatus !== 'AUDIT_FAILED' | |
1055 | + selectedRows[i].orderStatus !== 'FINANCE_PROCESS' | |
857 | 1056 | ) { |
858 | - message.error( | |
859 | - '请选择未审核或者审核失败的子订单进行审核', | |
860 | - ); | |
1057 | + message.error('请选择未审核的子订单进行审核'); | |
861 | 1058 | return; |
862 | 1059 | } |
863 | 1060 | } |
864 | 1061 | setOrderRow(record); |
865 | 1062 | setCheckVisible(true); |
1063 | + setOrderCheckType(CHECK_TYPE.FINALCIAL); | |
866 | 1064 | }} |
867 | 1065 | > |
868 | - 审核 | |
1066 | + 财务审核 | |
1067 | + </Button> | |
1068 | + ) : ( | |
1069 | + '' | |
1070 | + )} | |
1071 | + | |
1072 | + {/* 采购审核 */} | |
1073 | + {record.mainPath.includes('procureCheckOrder') ? ( | |
1074 | + <Button | |
1075 | + className="p-0" | |
1076 | + type="link" | |
1077 | + onClick={() => { | |
1078 | + let selectedSubOrders = selectedRowObj[record.id]; | |
1079 | + setSelectedRows(selectedSubOrders); | |
1080 | + if (selectedSubOrders === undefined) { | |
1081 | + setSelectedRows(record.subOrderInformationLists); | |
1082 | + console.log( | |
1083 | + 'subOrderInformationLists:' + | |
1084 | + record.subOrderInformationLists, | |
1085 | + ); | |
1086 | + } | |
1087 | + for (let i = 0; i < selectedRows.length; i++) { | |
1088 | + if ( | |
1089 | + selectedRows[i].orderStatus !== 'PROCURE_UN_PROCESS' | |
1090 | + ) { | |
1091 | + message.error('请选择未审核的子订单进行审核'); | |
1092 | + return; | |
1093 | + } | |
1094 | + } | |
1095 | + setOrderRow(record); | |
1096 | + setProcureCheckModalVisible(true); | |
1097 | + setOrderCheckType(CHECK_TYPE.PROCURE); | |
1098 | + }} | |
1099 | + > | |
1100 | + 采购审核 | |
869 | 1101 | </Button> |
870 | 1102 | ) : ( |
871 | 1103 | '' |
... | ... | @@ -1153,6 +1385,7 @@ const OrderPage = () => { |
1153 | 1385 | setCheckVisible={setCheckVisible} |
1154 | 1386 | data={orderRow} |
1155 | 1387 | subOrders={selectedRows} |
1388 | + orderCheckType={orderCheckType} | |
1156 | 1389 | onClose={() => { |
1157 | 1390 | setCheckVisible(false); |
1158 | 1391 | setOrderRow({}); |
... | ... | @@ -1182,6 +1415,7 @@ const OrderPage = () => { |
1182 | 1415 | setVisible={(b: boolean) => { |
1183 | 1416 | setDeliverVisible(b); |
1184 | 1417 | }} |
1418 | + sendType={orderCheckType} | |
1185 | 1419 | onClose={() => { |
1186 | 1420 | setDeliverVisible(false); |
1187 | 1421 | setOrderRow({}); |
... | ... | @@ -1196,10 +1430,19 @@ const OrderPage = () => { |
1196 | 1430 | isEdit={isFinalcialEdit} |
1197 | 1431 | mainOrder={orderRow} |
1198 | 1432 | subOrders={selectedRows} |
1433 | + isMainOrder={isMainOrder} | |
1434 | + cancel={() => { | |
1435 | + setFinancialVisible(false); | |
1436 | + setOrderRow({}); | |
1437 | + setIsMainOrder(false); | |
1438 | + setIsFinalcialEdit(false); | |
1439 | + }} | |
1199 | 1440 | onClose={() => { |
1200 | 1441 | setFinancialVisible(false); |
1201 | 1442 | setOrderRow({}); |
1202 | 1443 | refreshTable(); |
1444 | + setIsMainOrder(false); | |
1445 | + setIsFinalcialEdit(false); | |
1203 | 1446 | }} |
1204 | 1447 | /> |
1205 | 1448 | )} |
... | ... | @@ -1212,6 +1455,7 @@ const OrderPage = () => { |
1212 | 1455 | setVisible={(b: boolean) => { |
1213 | 1456 | setOrderPrintVisible(b); |
1214 | 1457 | }} |
1458 | + printOptType={orderCheckType} | |
1215 | 1459 | onClose={() => { |
1216 | 1460 | setOrderPrintVisible(false); |
1217 | 1461 | setOrderRow({}); |
... | ... | @@ -1281,6 +1525,30 @@ const OrderPage = () => { |
1281 | 1525 | /> |
1282 | 1526 | )} |
1283 | 1527 | |
1528 | + {deliverInfoDrawerVisible && ( | |
1529 | + <DeliverInfoDrawer | |
1530 | + data={orderRow} | |
1531 | + onClose={() => { | |
1532 | + setDeliverInfoDrawerVisible(false); | |
1533 | + setOrderRow({}); | |
1534 | + }} | |
1535 | + /> | |
1536 | + )} | |
1537 | + | |
1538 | + {procureCheckModalVisible && ( | |
1539 | + <ProcureCheckModal | |
1540 | + setCheckVisible={setProcureCheckModalVisible} | |
1541 | + data={orderRow} | |
1542 | + subOrders={selectedRows} | |
1543 | + onClose={() => { | |
1544 | + setProcureCheckModalVisible(false); | |
1545 | + setOrderRow({}); | |
1546 | + setSelectedRows({}); | |
1547 | + refreshTable(); | |
1548 | + }} | |
1549 | + /> | |
1550 | + )} | |
1551 | + | |
1284 | 1552 | {contextHolder} |
1285 | 1553 | </PageContainer> |
1286 | 1554 | ); | ... | ... |
src/pages/OrderPrint/OrderPrintModal.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | 2 | import '@/pages/OrderPrint/index.less'; |
3 | -import { postServiceOrderPrintOrder } from '@/services'; | |
3 | +import { | |
4 | + postServiceOrderPrintOrder, | |
5 | + postServiceOrderSupplierPrint, | |
6 | +} from '@/services'; | |
4 | 7 | import { ExclamationCircleFilled } from '@ant-design/icons'; |
5 | 8 | import { Modal, Select, Space, message } from 'antd'; |
6 | 9 | import printJS from 'print-js'; |
7 | 10 | import { useState } from 'react'; |
11 | +import { CHECK_TYPE } from '../Order/constant'; | |
8 | 12 | import { printerCSS } from './PrinterCSS'; |
9 | 13 | import DalangPrinter from './components/DalangPrinter'; |
10 | 14 | import HoujiePrinter from './components/HoujiePrinter'; |
11 | 15 | import ZhuguangPrinter from './components/ZhuguangPrinter'; |
12 | 16 | |
13 | -export default ({ mainOrder, subOrders, isRePrint, setVisible, onClose }) => { | |
17 | +export default ({ | |
18 | + mainOrder, | |
19 | + subOrders, | |
20 | + isRePrint, | |
21 | + setVisible, | |
22 | + printOptType, | |
23 | + onClose, | |
24 | +}) => { | |
14 | 25 | const [printerType, setPrinterType] = useState('Houjie'); |
15 | 26 | const { confirm } = Modal; |
16 | 27 | const handleChange = (value: string) => { |
17 | 28 | setPrinterType(value); |
18 | 29 | }; |
30 | + /** | |
31 | + * 是供应商打印还是普通打印 | |
32 | + * @param typeString | |
33 | + * @returns | |
34 | + */ | |
35 | + function optType(typeString: string) { | |
36 | + if (printOptType === typeString) { | |
37 | + return true; | |
38 | + } | |
39 | + | |
40 | + return false; | |
41 | + } | |
19 | 42 | const showPropsConfirm = () => { |
20 | 43 | if (isRePrint) { |
21 | 44 | return; |
... | ... | @@ -34,7 +57,19 @@ export default ({ mainOrder, subOrders, isRePrint, setVisible, onClose }) => { |
34 | 57 | return item.id; |
35 | 58 | }), |
36 | 59 | }; |
37 | - const res = await postServiceOrderPrintOrder({ data: body }); | |
60 | + let res; | |
61 | + if (optType(CHECK_TYPE.SUPPLIER)) { | |
62 | + res = await postServiceOrderSupplierPrint({ | |
63 | + data: { | |
64 | + ids: subOrders.map((item) => { | |
65 | + return item.id; | |
66 | + }), | |
67 | + }, | |
68 | + }); | |
69 | + } else { | |
70 | + res = await postServiceOrderPrintOrder({ data: body }); | |
71 | + } | |
72 | + | |
38 | 73 | if (res.result === RESPONSE_CODE.SUCCESS) { |
39 | 74 | message.success(res.message); |
40 | 75 | onClose(); | ... | ... |
src/pages/OrderPrint/PrinterCSS.tsx
src/pages/OrderPrint/components/HoujiePrinter.tsx
... | ... | @@ -12,7 +12,7 @@ export default ({ mainOrder, subOrders }) => { |
12 | 12 | <tr height="30" style={{ height: '15.00pt' }}> |
13 | 13 | <td height="30" style={{ height: '15.00pt' }}></td> |
14 | 14 | <td className="xl72">{i + 1}</td> |
15 | - <td className="xl72">{subOrder.id}</td> | |
15 | + <td className="xl72">{mainOrder.id}</td> | |
16 | 16 | <td className="xl72">{subOrder.productName}</td> |
17 | 17 | <td className="xl72">{subOrder.parameters}</td> |
18 | 18 | <td className="xl72">{subOrder.unit}</td> | ... | ... |
src/pages/OrderReport/components/OrderDualAxes.tsx
0 → 100644
1 | +import { DualAxes } from '@ant-design/charts'; | |
2 | + | |
3 | +const OrderDualAxes = ({ data, statisticMethod }) => { | |
4 | + let yFiledString = ''; | |
5 | + if (statisticMethod === 'MONTH_STATISTICS') { | |
6 | + yFiledString = 'curTime'; | |
7 | + } else { | |
8 | + yFiledString = 'curMonth'; | |
9 | + } | |
10 | + const config = { | |
11 | + data: [ | |
12 | + data.targetAndTotalPaymentDtoList === undefined | |
13 | + ? [] | |
14 | + : data.targetAndTotalPaymentDtoList, | |
15 | + data.orderNumberDtoList === undefined ? [] : data.orderNumberDtoList, | |
16 | + ], | |
17 | + xField: yFiledString, | |
18 | + yField: ['curDayTotalPayment', 'curDayTotalOrderNumber'], | |
19 | + geometryOptions: [ | |
20 | + { | |
21 | + geometry: 'line', | |
22 | + seriesField: 'type', | |
23 | + lineStyle: { | |
24 | + lineWidth: 3, | |
25 | + lineDash: [5, 5], | |
26 | + }, | |
27 | + smooth: true, | |
28 | + }, | |
29 | + { | |
30 | + geometry: 'line', | |
31 | + seriesField: 'name', | |
32 | + point: {}, | |
33 | + }, | |
34 | + ], | |
35 | + }; | |
36 | + return <DualAxes {...config} />; | |
37 | +}; | |
38 | + | |
39 | +export default OrderDualAxes; | ... | ... |
src/pages/OrderReport/components/OrderStatisticCard.tsx
0 → 100644
1 | +import { RESPONSE_CODE } from '@/constants/enum'; | |
2 | +import { postServiceOrderUpdateReportFormsTarget } from '@/services'; | |
3 | +import Icon, { EditTwoTone } from '@ant-design/icons'; | |
4 | +import { ModalForm, ProCard, ProFormDigit } from '@ant-design/pro-components'; | |
5 | +import { Flex, Form, message } from 'antd'; | |
6 | +import { useState } from 'react'; | |
7 | + | |
8 | +export default ({ data, statisticsMethod, reFreshData }) => { | |
9 | + const [edit, setEdit] = useState(false); | |
10 | + const [form] = Form.useForm<{ | |
11 | + statisticsMethod: string; | |
12 | + target: number; | |
13 | + daysOfMonth: number; | |
14 | + }>(); | |
15 | + const [targetValue, setTargetValue] = useState(0); | |
16 | + | |
17 | + const UpBig = () => ( | |
18 | + <svg width="44" height="auto" fill="#d81e06" viewBox="0 0 1024 1024"> | |
19 | + <path | |
20 | + d="M255.857413 855.291523h-58.175337c-16.996324 0-30.798708-13.802384-30.798707-30.798708V166.084884c0-16.996324 13.802384-30.798708 30.798707-30.798708h58.175337c16.996324 0 30.798708 13.802384 30.798708 30.798708v658.293862c0 16.996324-13.916453 30.912777-30.798708 30.912777z m-54.867327-34.220787h51.331179V169.506962h-51.331179v651.563774zM442.816977 855.291523h-58.175337c-16.996324 0-30.798708-13.802384-30.798708-30.798708V348.367606c0-16.996324 13.802384-30.798708 30.798708-30.798708h58.175337c16.996324 0 30.798708 13.802384 30.798708 30.798708v476.01114c0 16.996324-13.802384 30.912777-30.798708 30.912777z m-54.753259-34.220787h51.33118V351.789685h-51.33118v469.281051zM629.890609 855.291523h-58.175337c-16.996324 0-30.798708-13.802384-30.798707-30.798708V525.517211c0-16.996324 13.802384-30.798708 30.798707-30.798708h58.175337c16.996324 0 30.798708 13.802384 30.798708 30.798708v298.975604c0 16.882255-13.802384 30.798708-30.798708 30.798708z m-54.753258-34.220787h51.33118V528.939289h-51.33118v292.131447zM816.964242 855.291523h-58.175337c-16.996324 0-30.798708-13.802384-30.798708-30.798708V702.552746c0-16.996324 13.802384-30.798708 30.798708-30.798708h58.175337c16.996324 0 30.798708 13.802384 30.798708 30.798708v121.940069c0 16.882255-13.802384 30.798708-30.798708 30.798708z m-54.753258-34.220787h51.331179V705.974825h-51.331179v115.095911zM830.652557 589.167873c-6.38788 0-12.547622-3.650217-15.513424-9.809958l-71.977721-152.168431-162.206527-45.855854c-6.844157-1.939178-11.863206-7.98485-12.433553-15.057146l-10.950651-133.803275-143.271026-77.567116c-8.327058-4.448702-11.406929-14.829007-6.844158-23.156065 4.448702-8.327058 14.829007-11.406929 23.156066-6.844157l151.484015 82.015818c5.133118 2.737663 8.441127 7.870781 8.897404 13.688314l10.722513 131.179682 158.328172 44.715161c4.79091 1.368831 8.669266 4.676841 10.836583 9.125543l75.28573 159.126657c3.992425 8.555197 0.342208 18.707363-8.09892 22.813857-2.509524 1.026624-5.019049 1.59697-7.414503 1.59697z" | |
21 | + fill="#d81e06" | |
22 | + ></path> | |
23 | + <path d="M456.163083 261.903086c-6.844157 0-13.232037-4.106494-15.855631-10.722513l-42.433775-106.426646c-1.825109-4.676841-1.59697-10.038097 0.798485-14.4868 2.395455-4.448702 6.616019-7.642642 11.635068-8.669266l130.153057-26.692213c9.239612-1.939178 18.251086 4.106494 20.190264 13.346106 1.939178 9.239612-4.106494 18.251086-13.346106 20.190264l-110.076863 22.58572 34.905202 87.377074c3.536148 8.783335-0.798485 18.707363-9.58182 22.243511-2.053247 0.798485-4.220564 1.254762-6.387881 1.254763z" /> | |
24 | + </svg> | |
25 | + ); | |
26 | + | |
27 | + const DownBig = () => ( | |
28 | + <svg width="44" height="auto" fill="#1DB302" viewBox="0 0 1024 1024"> | |
29 | + <path | |
30 | + d="M727.990197 852.667929V194.374067c0-16.996324 13.802384-30.798708 30.798708-30.798708h58.175337c16.996324 0 30.798708 13.802384 30.798708 30.798708v658.293862c0 16.996324-13.802384 30.798708-30.798708 30.798708h-58.175337c-16.996324 0-30.798708-13.802384-30.798708-30.798708z m85.551966-654.871783h-51.331179v651.449705h51.331179V197.796146zM540.916565 852.667929V376.65679c0-16.996324 13.802384-30.798708 30.798707-30.798708h58.175337c16.996324 0 30.798708 13.802384 30.798708 30.798708v476.011139c0 16.996324-13.802384 30.798708-30.798708 30.798708h-58.175337c-16.996324 0-30.798708-13.802384-30.798707-30.798708z m85.551966-472.589061h-51.33118v469.166983h51.33118V380.078868zM353.842932 852.667929v-298.861535c0-16.996324 13.802384-30.798708 30.798708-30.798708h58.175337c16.996324 0 30.798708 13.802384 30.798708 30.798708v298.975604c0 16.996324-13.802384 30.798708-30.798708 30.798708h-58.175337c-16.996324-0.114069-30.798708-13.916453-30.798708-30.912777z m85.551966-295.439456h-51.33118v292.131447h51.33118V557.228473zM166.769299 852.667929V730.72786c0-16.996324 13.802384-30.798708 30.798708-30.798708h58.175337c16.996324 0 30.798708 13.802384 30.798708 30.798708v121.940069c0 16.996324-13.802384 30.798708-30.798708 30.798708h-58.175337c-16.882255 0-30.798708-13.802384-30.798708-30.798708z m85.666036-118.51799h-51.33118v115.095912h51.33118V734.149939zM660.347109 189.012811c-0.684416 6.38788-4.904979 12.091345-11.406929 14.37273l-158.898518 55.437674-62.738108 156.503063c-2.623594 6.616019-9.125543 10.950652-16.311909 10.722513l-134.145483-3.308009-92.282054 134.259552c-5.361257 7.756712-15.9697 9.809959-23.840481 4.448702-7.756712-5.361257-9.809959-15.9697-4.448702-23.840481l97.529241-141.902194c3.308009-4.79091 8.783335-7.528573 14.4868-7.414504l131.521889 3.308009 61.255208-152.738777c1.825109-4.562772 5.589395-8.212989 10.266236-9.809958L637.647321 171.103932c8.897404-3.079871 18.707363 1.59697 21.787234 10.494375 0.912554 2.509524 1.140693 5.019049 0.912554 7.414504z" | |
31 | + fill="#1DB302" | |
32 | + ></path> | |
33 | + <path | |
34 | + d="M295.211318 526.771973c-0.684416 6.730088-5.475326 12.77576-12.433553 14.714938l-110.305001 30.912777c-4.904979 1.368831-10.152167 0.456277-14.258661-2.395455-4.220564-2.851732-6.844157-7.414504-7.414504-12.433552l-12.661691-132.206305c-0.912554-9.353682 6.045672-17.794809 15.399354-18.707364 9.353682-0.912554 17.794809 6.045672 18.707363 15.399354l10.722513 111.901972 90.571015-25.437451c9.125543-2.509524 18.593294 2.737663 21.102818 11.863206 0.684416 2.053247 0.798485 4.220564 0.570347 6.38788z" | |
35 | + fill="#1DB302" | |
36 | + /> | |
37 | + </svg> | |
38 | + ); | |
39 | + | |
40 | + const UpSmall = () => ( | |
41 | + <svg width="14" height="auto" fill="#d81e06" viewBox="0 0 1024 1024"> | |
42 | + <path d="M511.976976 945.959599c-239.47514 0-433.597349-194.300264-433.597349-433.964716 0-239.677754 194.122209-433.955506 433.597349-433.955506s433.642374 194.277752 433.642374 433.955506C945.61935 751.659335 751.453139 945.959599 511.976976 945.959599zM666.05312 408.869155l-131.822304-132.292002c-2.899026-4.303003-7.091512-7.870248-12.509918-9.766434-2.876514-1.137916-5.952572-1.64957-9.119705-1.582031-0.222057 0-0.401136-0.112564-0.623193-0.112564-0.289596 0-0.535189 0.13303-0.847298 0.156566-3.03308-0.044002-6.021134 0.423649-8.830109 1.515516-5.507434 1.918699-9.787924 5.528923-12.664438 9.945513L357.945857 408.869155c-9.275247 9.29776-8.562003 25.061792 1.560542 35.184337 10.168594 10.146081 25.463951 10.413164 34.739199 1.11438 0.73678-0.735757 1.471514-1.248434 2.073218-2.073218l89.747024-89.456405 0.245593 399.136489c-0.155543 0.936325 0 1.783623 0 2.76395 0 12.352329 10.992355 22.342868 25.352411 22.342868 14.314007 0 25.976628-9.990538 25.976628-22.342868l0.289596-401.923976 89.771583 89.478917c0.599657 0.825808 1.335415 1.337461 2.049682 2.073218 9.29776 9.29776 24.595164 9.030677 34.740222-1.11438C674.615123 433.930947 675.351903 418.166915 666.05312 408.869155z" />{' '} | |
43 | + </svg> | |
44 | + ); | |
45 | + | |
46 | + const DownSmall = () => ( | |
47 | + <svg width="14" height="auto" fill="#1DB302" viewBox="0 0 1024 1024"> | |
48 | + <path d="M945.61935 512.005117c0 239.677754-194.166211 433.955506-433.642374 433.955506S78.379627 751.682871 78.379627 512.005117c0-239.664452 194.122209-433.964716 433.597349-433.964716S945.61935 272.340665 945.61935 512.005117zM664.492578 579.947532c-10.145058-10.146081-25.442462-10.413164-34.740222-1.115404-0.714268 0.735757-1.450025 1.248434-2.049682 2.073218l-89.771583 89.478917-0.289596-401.923976c0-12.352329-11.661597-22.342868-25.976628-22.342868-14.360056 0-25.352411 9.990538-25.352411 22.342868 0 0.980327-0.155543 1.827625 0 2.76395l-0.245593 399.136489-89.747024-89.456405c-0.602727-0.825808-1.337461-1.338485-2.073218-2.073218-9.275247-9.29776-24.571628-9.030677-34.739199 1.115404-10.123568 10.122545-10.836813 25.886577-1.560542 35.184337l131.689275 132.135436c2.876514 4.415566 7.157004 8.027837 12.664438 9.945513 2.808976 1.091868 5.79703 1.559519 8.830109 1.515516 0.312108 0.022513 0.557702 0.155543 0.847298 0.155543 0.223081 0 0.402159-0.11154 0.623193-0.11154 3.167133 0.067538 6.244214-0.445138 9.119705-1.583055 5.418406-1.895163 9.610892-5.462408 12.509918-9.765411l131.822304-132.292002C675.351903 605.833085 674.615123 590.069053 664.492578 579.947532z" />{' '} | |
49 | + </svg> | |
50 | + ); | |
51 | + | |
52 | + const CardTitle = ({ title }) => { | |
53 | + return <span className="text-sm text-stone-600">{title}</span>; | |
54 | + }; | |
55 | + | |
56 | + const CardContent = ({ | |
57 | + unit = '', | |
58 | + content = 0, | |
59 | + sameMonthPercentageChange = -1000, | |
60 | + editable = false, | |
61 | + }) => { | |
62 | + //如果是可编辑的说明是指标,设置指标值,可用在弹窗中的回显 | |
63 | + if (editable) { | |
64 | + setTargetValue(content); | |
65 | + } | |
66 | + | |
67 | + let trendIcon; | |
68 | + let trendPercentage; | |
69 | + if (sameMonthPercentageChange > 0) { | |
70 | + trendIcon = <Icon component={UpBig} />; | |
71 | + trendPercentage = ( | |
72 | + <div style={{ minWidth: '130px' }}> | |
73 | + <span className="text-xs text-stone-500"> | |
74 | + 同比上 | |
75 | + {statisticsMethod === 'MONTH_STATISTICS' ? '个月' : '年'} | |
76 | + </span> | |
77 | + <Icon component={UpSmall} /> | |
78 | + <span className="text-[#d81e06]">+{sameMonthPercentageChange}%</span> | |
79 | + </div> | |
80 | + ); | |
81 | + } | |
82 | + | |
83 | + if (sameMonthPercentageChange < 0) { | |
84 | + trendIcon = <Icon component={DownBig} />; | |
85 | + trendPercentage = ( | |
86 | + <div style={{ minWidth: '130px' }}> | |
87 | + <span className="text-xs text-stone-500"> | |
88 | + 同比上 | |
89 | + {statisticsMethod === 'MONTH_STATISTICS' ? '个月' : '年'} | |
90 | + </span> | |
91 | + <Icon component={DownSmall} /> | |
92 | + <span className="text-[#1DB302]">{sameMonthPercentageChange}%</span> | |
93 | + </div> | |
94 | + ); | |
95 | + } | |
96 | + | |
97 | + if (sameMonthPercentageChange === -1000) { | |
98 | + trendIcon = ''; | |
99 | + trendPercentage = ''; | |
100 | + } | |
101 | + | |
102 | + return ( | |
103 | + <Flex vertical> | |
104 | + <Flex> | |
105 | + <Flex align="center"> | |
106 | + <span className="text-base pr-1">{unit}</span> | |
107 | + <div style={{ width: 'max-content', display: 'flex' }}> | |
108 | + <span className="text-2xl"> | |
109 | + {content} | |
110 | + {editable ? ( | |
111 | + <span className="text-xs pl-1"> | |
112 | + {statisticsMethod === 'YEAR_STATISTICS' ? '每年' : '每月'} | |
113 | + </span> | |
114 | + ) : ( | |
115 | + '' | |
116 | + )} | |
117 | + </span> | |
118 | + {editable ? ( | |
119 | + <EditTwoTone | |
120 | + style={{ fontSize: '20px' }} | |
121 | + onClick={() => { | |
122 | + setEdit(true); | |
123 | + }} | |
124 | + /> | |
125 | + ) : ( | |
126 | + '' | |
127 | + )} | |
128 | + | |
129 | + {/* {editable ? ( | |
130 | + edit ? ( | |
131 | + <InputNumber | |
132 | + placeholder="请输入指标(¥)" | |
133 | + width={200} | |
134 | + value={targetValue} | |
135 | + max={100000000} | |
136 | + onChange={(value) => { | |
137 | + setTargetValue(value); | |
138 | + }} | |
139 | + /> | |
140 | + ) : ( | |
141 | + <span className="text-2xl"> | |
142 | + {content} | |
143 | + {editable ? <span className="text-xs px-1">每月</span> : ''} | |
144 | + </span> | |
145 | + ) | |
146 | + ) : ( | |
147 | + '' | |
148 | + )} | |
149 | + | |
150 | + {!editable ? ( | |
151 | + <span className="text-2xl"> | |
152 | + {content} | |
153 | + {editable ? <span className="text-xs pl-1">每月</span> : ''} | |
154 | + </span> | |
155 | + ) : ( | |
156 | + '' | |
157 | + )} */} | |
158 | + | |
159 | + {/* {editable ? ( | |
160 | + edit ? ( | |
161 | + [ | |
162 | + <CheckCircleTwoTone | |
163 | + key="confirm" | |
164 | + style={{ fontSize: '20px', paddingLeft: '5px' }} | |
165 | + onClick={async () => { | |
166 | + let body = { | |
167 | + statisticsMethod: statisticsMethod, | |
168 | + target: targetValue, | |
169 | + }; | |
170 | + let res = await postServiceOrderUpdateReportFormsTarget( | |
171 | + { data: body }, | |
172 | + ); | |
173 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
174 | + message.success(res.message); | |
175 | + setEdit(false); | |
176 | + reFreshData(); | |
177 | + } | |
178 | + }} | |
179 | + />, | |
180 | + <CloseCircleTwoTone | |
181 | + key="cancel" | |
182 | + style={{ fontSize: '20px', paddingLeft: '5px' }} | |
183 | + onClick={async () => { | |
184 | + setEdit(false); | |
185 | + }} | |
186 | + />, | |
187 | + ] | |
188 | + ) : ( | |
189 | + <EditTwoTone | |
190 | + style={{ fontSize: '20px' }} | |
191 | + onClick={() => { | |
192 | + setEdit(true); | |
193 | + }} | |
194 | + /> | |
195 | + ) | |
196 | + ) : ( | |
197 | + '' | |
198 | + )} */} | |
199 | + </div> | |
200 | + </Flex> | |
201 | + {trendIcon} | |
202 | + </Flex> | |
203 | + | |
204 | + {trendPercentage} | |
205 | + </Flex> | |
206 | + ); | |
207 | + }; | |
208 | + | |
209 | + return ( | |
210 | + <> | |
211 | + <ProCard title="" ghost gutter={8}> | |
212 | + <ProCard | |
213 | + className="order-statictis-card" | |
214 | + bordered | |
215 | + title={<CardTitle title={'总收入'} />} | |
216 | + > | |
217 | + <CardContent | |
218 | + unit="¥" | |
219 | + content={data.totalPayment} | |
220 | + sameMonthPercentageChange={data.totalPaymentTrend} | |
221 | + /> | |
222 | + </ProCard> | |
223 | + <ProCard | |
224 | + className="order-statictis-card" | |
225 | + title={<CardTitle title={'指标'} />} | |
226 | + bordered | |
227 | + > | |
228 | + <CardContent unit="¥" content={data.target} editable={true} /> | |
229 | + </ProCard> | |
230 | + <ProCard | |
231 | + className="order-statictis-card" | |
232 | + title={<CardTitle title={'总订单量'} />} | |
233 | + bordered | |
234 | + > | |
235 | + <CardContent | |
236 | + unit="单" | |
237 | + content={data.totalOrderNumber} | |
238 | + sameMonthPercentageChange={data.totalOrderNumberTrend} | |
239 | + /> | |
240 | + </ProCard> | |
241 | + <ProCard | |
242 | + className="order-statictis-card" | |
243 | + title={<CardTitle title={'总子订单量'} />} | |
244 | + bordered | |
245 | + > | |
246 | + <CardContent unit="单" content={data.subTotalOrderNumber} /> | |
247 | + </ProCard> | |
248 | + <ProCard | |
249 | + className="order-statictis-card" | |
250 | + title={<CardTitle title={'未审核子订单'} />} | |
251 | + bordered | |
252 | + > | |
253 | + <CardContent unit="单" content={data.unCheckOrderNumber} /> | |
254 | + </ProCard> | |
255 | + <ProCard | |
256 | + className="order-statictis-card" | |
257 | + title={<CardTitle title={'待发货子订单'} />} | |
258 | + bordered | |
259 | + > | |
260 | + <CardContent unit="单" content={data.unSendOrderNumber} /> | |
261 | + </ProCard> | |
262 | + </ProCard> | |
263 | + | |
264 | + <ModalForm<{ | |
265 | + statisticsMethod: string; | |
266 | + target: number; | |
267 | + daysOfMonth: number; | |
268 | + }> | |
269 | + title="编辑指标" | |
270 | + width={500} | |
271 | + form={form} | |
272 | + open={edit} | |
273 | + autoFocusFirstInput | |
274 | + modalProps={{ | |
275 | + destroyOnClose: true, | |
276 | + onCancel: () => setEdit(false), | |
277 | + }} | |
278 | + onFinish={async (values) => { | |
279 | + values.statisticsMethod = statisticsMethod; | |
280 | + let res = await postServiceOrderUpdateReportFormsTarget({ | |
281 | + data: values, | |
282 | + }); | |
283 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
284 | + message.success(res.message); | |
285 | + setEdit(false); | |
286 | + reFreshData(); | |
287 | + } | |
288 | + }} | |
289 | + > | |
290 | + <ProFormDigit | |
291 | + width="md" | |
292 | + name="target" | |
293 | + label="指标(¥)" | |
294 | + min={0} | |
295 | + initialValue={targetValue} | |
296 | + placeholder="请输入指标" | |
297 | + rules={[{ required: true, message: '指标必填' }]} | |
298 | + /> | |
299 | + | |
300 | + {statisticsMethod === 'MONTH_STATISTICS' ? ( | |
301 | + <ProFormDigit | |
302 | + width="md" | |
303 | + name="weekday" | |
304 | + label={ | |
305 | + statisticsMethod === 'YEAR_STATISTICS' | |
306 | + ? '每月工作日天数' | |
307 | + : '本月工作日天数' | |
308 | + } | |
309 | + min={0} | |
310 | + placeholder="工作日天数" | |
311 | + rules={[{ required: true, message: '工作日天数必填' }]} | |
312 | + /> | |
313 | + ) : ( | |
314 | + '' | |
315 | + )} | |
316 | + </ModalForm> | |
317 | + </> | |
318 | + ); | |
319 | +}; | ... | ... |
src/pages/OrderReport/index.less
0 → 100644
1 | +.order-statictis-card .ant-pro-card-body { | |
2 | + padding-top: 0; | |
3 | +} | |
4 | + | |
5 | +.order-statictis-card { | |
6 | + height: 100%; | |
7 | +} | |
8 | + | |
9 | +//将报表卡片的extra左边内容调到适中位置 | |
10 | +#order-dual-axes-card .ant-pro-card-extra { | |
11 | + width: 60%; | |
12 | + max-height: 24px; | |
13 | +} | |
14 | + | |
15 | +//报表卡片中tabs作为单选项,去掉多余的margin | |
16 | +#order-dual-axes-card .ant-tabs-nav { | |
17 | + margin: 0; | |
18 | +} | ... | ... |
src/pages/OrderReport/index.tsx
0 → 100644
1 | +import { postServiceOrderQueryReportFormsInformation } from '@/services'; | |
2 | +import { enumToSelect } from '@/utils'; | |
3 | +import { getUserInfo } from '@/utils/user'; | |
4 | +import { EllipsisOutlined } from '@ant-design/icons'; | |
5 | +import { | |
6 | + PageContainer, | |
7 | + ProCard, | |
8 | + ProFormSelect, | |
9 | + QueryFilter, | |
10 | +} from '@ant-design/pro-components'; | |
11 | +import { history } from '@umijs/max'; | |
12 | +import { | |
13 | + Avatar, | |
14 | + Button, | |
15 | + Dropdown, | |
16 | + Flex, | |
17 | + Form, | |
18 | + Space, | |
19 | + Spin, | |
20 | + Tabs, | |
21 | + TabsProps, | |
22 | + Tag, | |
23 | +} from 'antd'; | |
24 | +import { useEffect, useState } from 'react'; | |
25 | +import { | |
26 | + PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
27 | + SALES_CODE_OPTIONS, | |
28 | +} from '../Order/constant'; | |
29 | +import OrderDualAxes from './components/OrderDualAxes'; | |
30 | +import OrderStatisticCard from './components/OrderStatisticCard'; | |
31 | +import './index.less'; | |
32 | +const userInfo = getUserInfo(); | |
33 | + | |
34 | +const OrderReportPage = () => { | |
35 | + const [form] = Form.useForm<{ | |
36 | + salesCode: ''; | |
37 | + productBelongBusiness: ''; | |
38 | + dateRange: ''; | |
39 | + }>(); | |
40 | + const [statisticData, setStatisticData] = useState([]); | |
41 | + const [loading, setLoading] = useState(false); | |
42 | + const [statisticsMethod, setStatisticsMethod] = useState('MONTH_STATISTICS'); | |
43 | + const onChange = (key: string) => { | |
44 | + setStatisticsMethod(key); | |
45 | + }; | |
46 | + | |
47 | + /** | |
48 | + * 加载页面数据 | |
49 | + */ | |
50 | + const loadData = async () => { | |
51 | + setLoading(true); | |
52 | + let body = { | |
53 | + statisticsMethod: '', | |
54 | + salesCode: form.getFieldValue('salesCode'), | |
55 | + productBelongBusiness: form.getFieldValue('productBelongBusiness'), | |
56 | + // beginTime:"", | |
57 | + // endTime:"" | |
58 | + }; | |
59 | + | |
60 | + // if(form.getFieldValue("dateRange")!==undefined){ | |
61 | + // body.beginTime=formatDate(form.getFieldValue("dateRange")[0]), | |
62 | + // body.endTime=formatDate(form.getFieldValue("dateRange")[1]) | |
63 | + // } | |
64 | + body.statisticsMethod = statisticsMethod; | |
65 | + const { data } = await postServiceOrderQueryReportFormsInformation({ | |
66 | + data: body, | |
67 | + }); | |
68 | + if (data !== undefined) { | |
69 | + setStatisticData(data); | |
70 | + } | |
71 | + | |
72 | + setLoading(false); | |
73 | + }; | |
74 | + | |
75 | + useEffect(() => { | |
76 | + loadData(); | |
77 | + }, [statisticsMethod]); | |
78 | + | |
79 | + useEffect(() => { | |
80 | + loadData(); | |
81 | + }, []); | |
82 | + | |
83 | + const items: TabsProps['items'] = [ | |
84 | + { | |
85 | + key: 'MONTH_STATISTICS', | |
86 | + label: '本月统计', | |
87 | + children: '', | |
88 | + }, | |
89 | + { | |
90 | + key: 'YEAR_STATISTICS', | |
91 | + label: '本年统计', | |
92 | + children: '', | |
93 | + }, | |
94 | + ]; | |
95 | + return ( | |
96 | + <PageContainer | |
97 | + header={{ | |
98 | + title: '订单汇总', | |
99 | + extra: [ | |
100 | + <Avatar key="0" style={{ verticalAlign: 'middle' }} size="large"> | |
101 | + {userInfo?.username} | |
102 | + </Avatar>, | |
103 | + <Tag key="nickName">{userInfo?.nickName}</Tag>, | |
104 | + <Dropdown | |
105 | + key="dropdown" | |
106 | + trigger={['click']} | |
107 | + menu={{ | |
108 | + items: [ | |
109 | + { | |
110 | + label: '退出登录', | |
111 | + key: '1', | |
112 | + onClick: () => { | |
113 | + localStorage.removeItem('token'); | |
114 | + history.push('/login'); | |
115 | + }, | |
116 | + }, | |
117 | + // { | |
118 | + // label: '修改密码', | |
119 | + // key: '2', | |
120 | + // }, | |
121 | + ], | |
122 | + }} | |
123 | + > | |
124 | + <Button key="4" style={{ padding: '0 8px' }}> | |
125 | + <EllipsisOutlined /> | |
126 | + </Button> | |
127 | + </Dropdown>, | |
128 | + ], | |
129 | + }} | |
130 | + > | |
131 | + <Space direction="vertical" size="middle" className="flex"> | |
132 | + <Spin spinning={loading}> | |
133 | + <OrderStatisticCard | |
134 | + data={statisticData} | |
135 | + statisticsMethod={statisticsMethod} | |
136 | + reFreshData={loadData} | |
137 | + /> | |
138 | + </Spin> | |
139 | + | |
140 | + <ProCard tooltip="这是提示" bordered> | |
141 | + <QueryFilter | |
142 | + split | |
143 | + className="!p-0 order-statistic-search" | |
144 | + labelWidth="auto" | |
145 | + form={form} | |
146 | + onFinish={async () => { | |
147 | + loadData(); | |
148 | + return true; | |
149 | + }} | |
150 | + > | |
151 | + <ProFormSelect | |
152 | + name="salesCode" | |
153 | + key="salesCode" | |
154 | + showSearch | |
155 | + label="销售代表" | |
156 | + placeholder="请输入销售代表" | |
157 | + options={SALES_CODE_OPTIONS} | |
158 | + /> | |
159 | + <ProFormSelect | |
160 | + key="productBelongBusiness" | |
161 | + placeholder="请输入所属事业部" | |
162 | + name="productBelongBusiness" | |
163 | + label="所属事业部" | |
164 | + options={enumToSelect(PRODUCT_BELONG_DEPARTMENT_OPTIONS)} | |
165 | + /> | |
166 | + {/* <ProFormDateRangePicker | |
167 | + key="dateRange" | |
168 | + name="dateRange" | |
169 | + label="时间" | |
170 | + /> */} | |
171 | + </QueryFilter> | |
172 | + </ProCard> | |
173 | + | |
174 | + <ProCard | |
175 | + id="order-dual-axes-card" | |
176 | + title="统计图表" | |
177 | + extra={ | |
178 | + <Flex> | |
179 | + <Tabs defaultActiveKey="1" items={items} onChange={onChange} /> | |
180 | + </Flex> | |
181 | + } | |
182 | + bordered | |
183 | + > | |
184 | + <Spin spinning={loading}> | |
185 | + <OrderDualAxes | |
186 | + data={statisticData} | |
187 | + statisticMethod={statisticsMethod} | |
188 | + /> | |
189 | + </Spin> | |
190 | + </ProCard> | |
191 | + </Space> | |
192 | + </PageContainer> | |
193 | + ); | |
194 | +}; | |
195 | + | |
196 | +export default OrderReportPage; | ... | ... |
src/services/definition.ts
... | ... | @@ -691,6 +691,19 @@ export interface OrderUpdateVO { |
691 | 691 | trackStageInfo?: OrderTrackStageVO; |
692 | 692 | } |
693 | 693 | |
694 | +export interface ProcureCheckOrderDto { | |
695 | + /** | |
696 | + * @description | |
697 | + * 子订单集合 | |
698 | + */ | |
699 | + ids?: Array<number>; | |
700 | + /** | |
701 | + * @description | |
702 | + * 采购人姓名 | |
703 | + */ | |
704 | + supplier?: string; | |
705 | +} | |
706 | + | |
694 | 707 | export interface ProductInformationDto { |
695 | 708 | /** |
696 | 709 | * @description |
... | ... | @@ -730,6 +743,24 @@ export interface QueryMainOrderDto { |
730 | 743 | customerName?: string; |
731 | 744 | } |
732 | 745 | |
746 | +export interface QueryReportFormsDto { | |
747 | + /** | |
748 | + * @description | |
749 | + * 所属部门 | |
750 | + */ | |
751 | + productBelongBusiness?: string; | |
752 | + /** | |
753 | + * @description | |
754 | + * 销售代表 | |
755 | + */ | |
756 | + salesCode?: string; | |
757 | + /** | |
758 | + * @description | |
759 | + * 统计方式 | |
760 | + */ | |
761 | + statisticsMethod?: string; | |
762 | +} | |
763 | + | |
733 | 764 | export interface ResetPwdVO { |
734 | 765 | /** @format int64 */ |
735 | 766 | userId?: number; | ... | ... |
src/services/demo/typings.d.ts
src/services/request.ts
... | ... | @@ -35,10 +35,12 @@ import type { |
35 | 35 | OrderProfitAnalysisVo, |
36 | 36 | OrderUnlockFieldApplyVO, |
37 | 37 | OrderUpdateVO, |
38 | + ProcureCheckOrderDto, | |
38 | 39 | ProductInformationDto, |
39 | 40 | QueryAnnexDto, |
40 | 41 | QueryHistoryRecordDto, |
41 | 42 | QueryMainOrderDto, |
43 | + QueryReportFormsDto, | |
42 | 44 | ResetPwdVO, |
43 | 45 | ServerResult, |
44 | 46 | SysLogQueryVO, |
... | ... | @@ -5336,6 +5338,77 @@ export const postServiceOrderFileProcess = /* #__PURE__ */ (() => { |
5336 | 5338 | return request; |
5337 | 5339 | })(); |
5338 | 5340 | |
5341 | +/** @description request parameter type for postServiceOrderFinanceCheckOrder */ | |
5342 | +export interface PostServiceOrderFinanceCheckOrderOption { | |
5343 | + /** | |
5344 | + * @description | |
5345 | + * dto | |
5346 | + */ | |
5347 | + body: { | |
5348 | + /** | |
5349 | + @description | |
5350 | + dto */ | |
5351 | + dto: Dto; | |
5352 | + }; | |
5353 | +} | |
5354 | + | |
5355 | +/** @description response type for postServiceOrderFinanceCheckOrder */ | |
5356 | +export interface PostServiceOrderFinanceCheckOrderResponse { | |
5357 | + /** | |
5358 | + * @description | |
5359 | + * OK | |
5360 | + */ | |
5361 | + 200: ServerResult; | |
5362 | + /** | |
5363 | + * @description | |
5364 | + * Created | |
5365 | + */ | |
5366 | + 201: any; | |
5367 | + /** | |
5368 | + * @description | |
5369 | + * Unauthorized | |
5370 | + */ | |
5371 | + 401: any; | |
5372 | + /** | |
5373 | + * @description | |
5374 | + * Forbidden | |
5375 | + */ | |
5376 | + 403: any; | |
5377 | + /** | |
5378 | + * @description | |
5379 | + * Not Found | |
5380 | + */ | |
5381 | + 404: any; | |
5382 | +} | |
5383 | + | |
5384 | +export type PostServiceOrderFinanceCheckOrderResponseSuccess = | |
5385 | + PostServiceOrderFinanceCheckOrderResponse[200]; | |
5386 | +/** | |
5387 | + * @description | |
5388 | + * 财务审核订单 | |
5389 | + * @tags 内部订单 | |
5390 | + * @produces * | |
5391 | + * @consumes application/json | |
5392 | + */ | |
5393 | +export const postServiceOrderFinanceCheckOrder = /* #__PURE__ */ (() => { | |
5394 | + const method = 'post'; | |
5395 | + const url = '/service/order/financeCheckOrder'; | |
5396 | + function request( | |
5397 | + option: PostServiceOrderFinanceCheckOrderOption, | |
5398 | + ): Promise<PostServiceOrderFinanceCheckOrderResponseSuccess> { | |
5399 | + return requester(request.url, { | |
5400 | + method: request.method, | |
5401 | + ...option, | |
5402 | + }) as unknown as Promise<PostServiceOrderFinanceCheckOrderResponseSuccess>; | |
5403 | + } | |
5404 | + | |
5405 | + /** http method */ | |
5406 | + request.method = method; | |
5407 | + /** request url */ | |
5408 | + request.url = url; | |
5409 | + return request; | |
5410 | +})(); | |
5411 | + | |
5339 | 5412 | /** @description request parameter type for postServiceOrderImportExcel */ |
5340 | 5413 | export interface PostServiceOrderImportExcelOption { |
5341 | 5414 | /** |
... | ... | @@ -5620,6 +5693,77 @@ export const postServiceOrderPrintOrder = /* #__PURE__ */ (() => { |
5620 | 5693 | return request; |
5621 | 5694 | })(); |
5622 | 5695 | |
5696 | +/** @description request parameter type for postServiceOrderProcureCheckOrder */ | |
5697 | +export interface PostServiceOrderProcureCheckOrderOption { | |
5698 | + /** | |
5699 | + * @description | |
5700 | + * dto | |
5701 | + */ | |
5702 | + body: { | |
5703 | + /** | |
5704 | + @description | |
5705 | + dto */ | |
5706 | + dto: ProcureCheckOrderDto; | |
5707 | + }; | |
5708 | +} | |
5709 | + | |
5710 | +/** @description response type for postServiceOrderProcureCheckOrder */ | |
5711 | +export interface PostServiceOrderProcureCheckOrderResponse { | |
5712 | + /** | |
5713 | + * @description | |
5714 | + * OK | |
5715 | + */ | |
5716 | + 200: ServerResult; | |
5717 | + /** | |
5718 | + * @description | |
5719 | + * Created | |
5720 | + */ | |
5721 | + 201: any; | |
5722 | + /** | |
5723 | + * @description | |
5724 | + * Unauthorized | |
5725 | + */ | |
5726 | + 401: any; | |
5727 | + /** | |
5728 | + * @description | |
5729 | + * Forbidden | |
5730 | + */ | |
5731 | + 403: any; | |
5732 | + /** | |
5733 | + * @description | |
5734 | + * Not Found | |
5735 | + */ | |
5736 | + 404: any; | |
5737 | +} | |
5738 | + | |
5739 | +export type PostServiceOrderProcureCheckOrderResponseSuccess = | |
5740 | + PostServiceOrderProcureCheckOrderResponse[200]; | |
5741 | +/** | |
5742 | + * @description | |
5743 | + * 采购审核订单 | |
5744 | + * @tags 内部订单 | |
5745 | + * @produces * | |
5746 | + * @consumes application/json | |
5747 | + */ | |
5748 | +export const postServiceOrderProcureCheckOrder = /* #__PURE__ */ (() => { | |
5749 | + const method = 'post'; | |
5750 | + const url = '/service/order/procureCheckOrder'; | |
5751 | + function request( | |
5752 | + option: PostServiceOrderProcureCheckOrderOption, | |
5753 | + ): Promise<PostServiceOrderProcureCheckOrderResponseSuccess> { | |
5754 | + return requester(request.url, { | |
5755 | + method: request.method, | |
5756 | + ...option, | |
5757 | + }) as unknown as Promise<PostServiceOrderProcureCheckOrderResponseSuccess>; | |
5758 | + } | |
5759 | + | |
5760 | + /** http method */ | |
5761 | + request.method = method; | |
5762 | + /** request url */ | |
5763 | + request.url = url; | |
5764 | + return request; | |
5765 | +})(); | |
5766 | + | |
5623 | 5767 | /** @description response type for getServiceOrderProvideInvoicingStatus */ |
5624 | 5768 | export interface GetServiceOrderProvideInvoicingStatusResponse { |
5625 | 5769 | /** |
... | ... | @@ -6219,6 +6363,78 @@ export const postServiceOrderQueryProductInformation = /* #__PURE__ */ (() => { |
6219 | 6363 | return request; |
6220 | 6364 | })(); |
6221 | 6365 | |
6366 | +/** @description request parameter type for postServiceOrderQueryReportFormsInformation */ | |
6367 | +export interface PostServiceOrderQueryReportFormsInformationOption { | |
6368 | + /** | |
6369 | + * @description | |
6370 | + * dto | |
6371 | + */ | |
6372 | + body: { | |
6373 | + /** | |
6374 | + @description | |
6375 | + dto */ | |
6376 | + dto: QueryReportFormsDto; | |
6377 | + }; | |
6378 | +} | |
6379 | + | |
6380 | +/** @description response type for postServiceOrderQueryReportFormsInformation */ | |
6381 | +export interface PostServiceOrderQueryReportFormsInformationResponse { | |
6382 | + /** | |
6383 | + * @description | |
6384 | + * OK | |
6385 | + */ | |
6386 | + 200: ServerResult; | |
6387 | + /** | |
6388 | + * @description | |
6389 | + * Created | |
6390 | + */ | |
6391 | + 201: any; | |
6392 | + /** | |
6393 | + * @description | |
6394 | + * Unauthorized | |
6395 | + */ | |
6396 | + 401: any; | |
6397 | + /** | |
6398 | + * @description | |
6399 | + * Forbidden | |
6400 | + */ | |
6401 | + 403: any; | |
6402 | + /** | |
6403 | + * @description | |
6404 | + * Not Found | |
6405 | + */ | |
6406 | + 404: any; | |
6407 | +} | |
6408 | + | |
6409 | +export type PostServiceOrderQueryReportFormsInformationResponseSuccess = | |
6410 | + PostServiceOrderQueryReportFormsInformationResponse[200]; | |
6411 | +/** | |
6412 | + * @description | |
6413 | + * 查询报表 | |
6414 | + * @tags 内部订单 | |
6415 | + * @produces * | |
6416 | + * @consumes application/json | |
6417 | + */ | |
6418 | +export const postServiceOrderQueryReportFormsInformation = | |
6419 | + /* #__PURE__ */ (() => { | |
6420 | + const method = 'post'; | |
6421 | + const url = '/service/order/queryReportFormsInformation'; | |
6422 | + function request( | |
6423 | + option: PostServiceOrderQueryReportFormsInformationOption, | |
6424 | + ): Promise<PostServiceOrderQueryReportFormsInformationResponseSuccess> { | |
6425 | + return requester(request.url, { | |
6426 | + method: request.method, | |
6427 | + ...option, | |
6428 | + }) as unknown as Promise<PostServiceOrderQueryReportFormsInformationResponseSuccess>; | |
6429 | + } | |
6430 | + | |
6431 | + /** http method */ | |
6432 | + request.method = method; | |
6433 | + /** request url */ | |
6434 | + request.url = url; | |
6435 | + return request; | |
6436 | + })(); | |
6437 | + | |
6222 | 6438 | /** @description request parameter type for postServiceOrderQueryServiceOrder */ |
6223 | 6439 | export interface PostServiceOrderQueryServiceOrderOption { |
6224 | 6440 | /** |
... | ... | @@ -6290,6 +6506,60 @@ export const postServiceOrderQueryServiceOrder = /* #__PURE__ */ (() => { |
6290 | 6506 | return request; |
6291 | 6507 | })(); |
6292 | 6508 | |
6509 | +/** @description response type for postServiceOrderQuerySupplier */ | |
6510 | +export interface PostServiceOrderQuerySupplierResponse { | |
6511 | + /** | |
6512 | + * @description | |
6513 | + * OK | |
6514 | + */ | |
6515 | + 200: ServerResult; | |
6516 | + /** | |
6517 | + * @description | |
6518 | + * Created | |
6519 | + */ | |
6520 | + 201: any; | |
6521 | + /** | |
6522 | + * @description | |
6523 | + * Unauthorized | |
6524 | + */ | |
6525 | + 401: any; | |
6526 | + /** | |
6527 | + * @description | |
6528 | + * Forbidden | |
6529 | + */ | |
6530 | + 403: any; | |
6531 | + /** | |
6532 | + * @description | |
6533 | + * Not Found | |
6534 | + */ | |
6535 | + 404: any; | |
6536 | +} | |
6537 | + | |
6538 | +export type PostServiceOrderQuerySupplierResponseSuccess = | |
6539 | + PostServiceOrderQuerySupplierResponse[200]; | |
6540 | +/** | |
6541 | + * @description | |
6542 | + * 提供供应商名单 | |
6543 | + * @tags 内部订单 | |
6544 | + * @produces * | |
6545 | + * @consumes application/json | |
6546 | + */ | |
6547 | +export const postServiceOrderQuerySupplier = /* #__PURE__ */ (() => { | |
6548 | + const method = 'post'; | |
6549 | + const url = '/service/order/querySupplier'; | |
6550 | + function request(): Promise<PostServiceOrderQuerySupplierResponseSuccess> { | |
6551 | + return requester(request.url, { | |
6552 | + method: request.method, | |
6553 | + }) as unknown as Promise<PostServiceOrderQuerySupplierResponseSuccess>; | |
6554 | + } | |
6555 | + | |
6556 | + /** http method */ | |
6557 | + request.method = method; | |
6558 | + /** request url */ | |
6559 | + request.url = url; | |
6560 | + return request; | |
6561 | +})(); | |
6562 | + | |
6293 | 6563 | /** @description request parameter type for postServiceOrderSendProduct */ |
6294 | 6564 | export interface PostServiceOrderSendProductOption { |
6295 | 6565 | /** |
... | ... | @@ -6361,6 +6631,148 @@ export const postServiceOrderSendProduct = /* #__PURE__ */ (() => { |
6361 | 6631 | return request; |
6362 | 6632 | })(); |
6363 | 6633 | |
6634 | +/** @description request parameter type for postServiceOrderSupplierPrint */ | |
6635 | +export interface PostServiceOrderSupplierPrintOption { | |
6636 | + /** | |
6637 | + * @description | |
6638 | + * dto | |
6639 | + */ | |
6640 | + body: { | |
6641 | + /** | |
6642 | + @description | |
6643 | + dto */ | |
6644 | + dto: Dto; | |
6645 | + }; | |
6646 | +} | |
6647 | + | |
6648 | +/** @description response type for postServiceOrderSupplierPrint */ | |
6649 | +export interface PostServiceOrderSupplierPrintResponse { | |
6650 | + /** | |
6651 | + * @description | |
6652 | + * OK | |
6653 | + */ | |
6654 | + 200: ServerResult; | |
6655 | + /** | |
6656 | + * @description | |
6657 | + * Created | |
6658 | + */ | |
6659 | + 201: any; | |
6660 | + /** | |
6661 | + * @description | |
6662 | + * Unauthorized | |
6663 | + */ | |
6664 | + 401: any; | |
6665 | + /** | |
6666 | + * @description | |
6667 | + * Forbidden | |
6668 | + */ | |
6669 | + 403: any; | |
6670 | + /** | |
6671 | + * @description | |
6672 | + * Not Found | |
6673 | + */ | |
6674 | + 404: any; | |
6675 | +} | |
6676 | + | |
6677 | +export type PostServiceOrderSupplierPrintResponseSuccess = | |
6678 | + PostServiceOrderSupplierPrintResponse[200]; | |
6679 | +/** | |
6680 | + * @description | |
6681 | + * 供应商打印 | |
6682 | + * @tags 内部订单 | |
6683 | + * @produces * | |
6684 | + * @consumes application/json | |
6685 | + */ | |
6686 | +export const postServiceOrderSupplierPrint = /* #__PURE__ */ (() => { | |
6687 | + const method = 'post'; | |
6688 | + const url = '/service/order/supplierPrint'; | |
6689 | + function request( | |
6690 | + option: PostServiceOrderSupplierPrintOption, | |
6691 | + ): Promise<PostServiceOrderSupplierPrintResponseSuccess> { | |
6692 | + return requester(request.url, { | |
6693 | + method: request.method, | |
6694 | + ...option, | |
6695 | + }) as unknown as Promise<PostServiceOrderSupplierPrintResponseSuccess>; | |
6696 | + } | |
6697 | + | |
6698 | + /** http method */ | |
6699 | + request.method = method; | |
6700 | + /** request url */ | |
6701 | + request.url = url; | |
6702 | + return request; | |
6703 | +})(); | |
6704 | + | |
6705 | +/** @description request parameter type for postServiceOrderSupplierSendOrder */ | |
6706 | +export interface PostServiceOrderSupplierSendOrderOption { | |
6707 | + /** | |
6708 | + * @description | |
6709 | + * dto | |
6710 | + */ | |
6711 | + body: { | |
6712 | + /** | |
6713 | + @description | |
6714 | + dto */ | |
6715 | + dto: Dto; | |
6716 | + }; | |
6717 | +} | |
6718 | + | |
6719 | +/** @description response type for postServiceOrderSupplierSendOrder */ | |
6720 | +export interface PostServiceOrderSupplierSendOrderResponse { | |
6721 | + /** | |
6722 | + * @description | |
6723 | + * OK | |
6724 | + */ | |
6725 | + 200: ServerResult; | |
6726 | + /** | |
6727 | + * @description | |
6728 | + * Created | |
6729 | + */ | |
6730 | + 201: any; | |
6731 | + /** | |
6732 | + * @description | |
6733 | + * Unauthorized | |
6734 | + */ | |
6735 | + 401: any; | |
6736 | + /** | |
6737 | + * @description | |
6738 | + * Forbidden | |
6739 | + */ | |
6740 | + 403: any; | |
6741 | + /** | |
6742 | + * @description | |
6743 | + * Not Found | |
6744 | + */ | |
6745 | + 404: any; | |
6746 | +} | |
6747 | + | |
6748 | +export type PostServiceOrderSupplierSendOrderResponseSuccess = | |
6749 | + PostServiceOrderSupplierSendOrderResponse[200]; | |
6750 | +/** | |
6751 | + * @description | |
6752 | + * 供应商发货 | |
6753 | + * @tags 内部订单 | |
6754 | + * @produces * | |
6755 | + * @consumes application/json | |
6756 | + */ | |
6757 | +export const postServiceOrderSupplierSendOrder = /* #__PURE__ */ (() => { | |
6758 | + const method = 'post'; | |
6759 | + const url = '/service/order/supplierSendOrder'; | |
6760 | + function request( | |
6761 | + option: PostServiceOrderSupplierSendOrderOption, | |
6762 | + ): Promise<PostServiceOrderSupplierSendOrderResponseSuccess> { | |
6763 | + return requester(request.url, { | |
6764 | + method: request.method, | |
6765 | + ...option, | |
6766 | + }) as unknown as Promise<PostServiceOrderSupplierSendOrderResponseSuccess>; | |
6767 | + } | |
6768 | + | |
6769 | + /** http method */ | |
6770 | + request.method = method; | |
6771 | + /** request url */ | |
6772 | + request.url = url; | |
6773 | + return request; | |
6774 | +})(); | |
6775 | + | |
6364 | 6776 | /** @description request parameter type for postServiceOrderUpdateAnnex */ |
6365 | 6777 | export interface PostServiceOrderUpdateAnnexOption { |
6366 | 6778 | /** |
... | ... | @@ -6503,6 +6915,77 @@ export const postServiceOrderUpdateOrder = /* #__PURE__ */ (() => { |
6503 | 6915 | return request; |
6504 | 6916 | })(); |
6505 | 6917 | |
6918 | +/** @description request parameter type for postServiceOrderUpdateReportFormsTarget */ | |
6919 | +export interface PostServiceOrderUpdateReportFormsTargetOption { | |
6920 | + /** | |
6921 | + * @description | |
6922 | + * dto | |
6923 | + */ | |
6924 | + body: { | |
6925 | + /** | |
6926 | + @description | |
6927 | + dto */ | |
6928 | + dto: Dto; | |
6929 | + }; | |
6930 | +} | |
6931 | + | |
6932 | +/** @description response type for postServiceOrderUpdateReportFormsTarget */ | |
6933 | +export interface PostServiceOrderUpdateReportFormsTargetResponse { | |
6934 | + /** | |
6935 | + * @description | |
6936 | + * OK | |
6937 | + */ | |
6938 | + 200: ServerResult; | |
6939 | + /** | |
6940 | + * @description | |
6941 | + * Created | |
6942 | + */ | |
6943 | + 201: any; | |
6944 | + /** | |
6945 | + * @description | |
6946 | + * Unauthorized | |
6947 | + */ | |
6948 | + 401: any; | |
6949 | + /** | |
6950 | + * @description | |
6951 | + * Forbidden | |
6952 | + */ | |
6953 | + 403: any; | |
6954 | + /** | |
6955 | + * @description | |
6956 | + * Not Found | |
6957 | + */ | |
6958 | + 404: any; | |
6959 | +} | |
6960 | + | |
6961 | +export type PostServiceOrderUpdateReportFormsTargetResponseSuccess = | |
6962 | + PostServiceOrderUpdateReportFormsTargetResponse[200]; | |
6963 | +/** | |
6964 | + * @description | |
6965 | + * 修改指标 | |
6966 | + * @tags 内部订单 | |
6967 | + * @produces * | |
6968 | + * @consumes application/json | |
6969 | + */ | |
6970 | +export const postServiceOrderUpdateReportFormsTarget = /* #__PURE__ */ (() => { | |
6971 | + const method = 'post'; | |
6972 | + const url = '/service/order/updateReportFormsTarget'; | |
6973 | + function request( | |
6974 | + option: PostServiceOrderUpdateReportFormsTargetOption, | |
6975 | + ): Promise<PostServiceOrderUpdateReportFormsTargetResponseSuccess> { | |
6976 | + return requester(request.url, { | |
6977 | + method: request.method, | |
6978 | + ...option, | |
6979 | + }) as unknown as Promise<PostServiceOrderUpdateReportFormsTargetResponseSuccess>; | |
6980 | + } | |
6981 | + | |
6982 | + /** http method */ | |
6983 | + request.method = method; | |
6984 | + /** request url */ | |
6985 | + request.url = url; | |
6986 | + return request; | |
6987 | +})(); | |
6988 | + | |
6506 | 6989 | /** @description request parameter type for postServiceOrderViewImages */ |
6507 | 6990 | export interface PostServiceOrderViewImagesOption { |
6508 | 6991 | /** | ... | ... |
src/utils/index.ts
... | ... | @@ -55,11 +55,23 @@ function formatDateTime(inputDateTime: string) { |
55 | 55 | return formattedDateTime; |
56 | 56 | } |
57 | 57 | |
58 | +function formatdate(inputDateTime: string) { | |
59 | + const parsedDateTime = new Date(inputDateTime); | |
60 | + | |
61 | + const year = parsedDateTime.getFullYear(); | |
62 | + const month = String(parsedDateTime.getMonth() + 1).padStart(2, '0'); | |
63 | + const day = String(parsedDateTime.getDate()).padStart(2, '0'); | |
64 | + | |
65 | + const formattedDate = `${year}-${month}-${day}`; | |
66 | + return formattedDate; | |
67 | +} | |
68 | + | |
58 | 69 | function formatSalesCode(salesCode: any) { |
70 | + console.log('in'); | |
59 | 71 | let newSalesCode = salesCode; |
60 | 72 | if (newSalesCode.indexOf('_')) { |
61 | 73 | newSalesCode = newSalesCode.split('_'); |
62 | - if (salesCode?.length === 2) { | |
74 | + if (newSalesCode?.length === 2) { | |
63 | 75 | newSalesCode = newSalesCode[1] + '(' + newSalesCode[0] + ')'; |
64 | 76 | } |
65 | 77 | } |
... | ... | @@ -143,6 +155,7 @@ export { |
143 | 155 | enumValueToLabel, |
144 | 156 | formatDateTime, |
145 | 157 | formatSalesCode, |
158 | + formatdate, | |
146 | 159 | getAliYunOSSFileNameFromUrl, |
147 | 160 | getUserInfo, |
148 | 161 | }; | ... | ... |
src/utils/user.ts
0 → 100644
1 | +/** | |
2 | + * | |
3 | + * @returns 获取本地用户信息 | |
4 | + */ | |
5 | +export const getUserInfo = () => { | |
6 | + let localUserInfo = localStorage.getItem('userInfo'); | |
7 | + | |
8 | + if (localUserInfo === null || localUserInfo === undefined) { | |
9 | + localUserInfo = '{}'; | |
10 | + } | |
11 | + const userInfo = JSON.parse(localUserInfo); | |
12 | + | |
13 | + return userInfo; | |
14 | +}; | ... | ... |