Commit db1ae137a197b3d303ef04505ede510e06463dd8
1 parent
6376c35a
feat: 分期账单审核功能
Showing
12 changed files
with
1056 additions
and
695 deletions
.umirc.ts
@@ -113,7 +113,7 @@ export default defineConfig({ | @@ -113,7 +113,7 @@ export default defineConfig({ | ||
113 | path: '/instalment', | 113 | path: '/instalment', |
114 | component: './Instalment', | 114 | component: './Instalment', |
115 | icon: 'BookOutlined', | 115 | icon: 'BookOutlined', |
116 | - access: 'canReadLinda', | 116 | + access: 'canReadProcure', |
117 | }, | 117 | }, |
118 | { | 118 | { |
119 | name: '区域管理', | 119 | name: '区域管理', |
src/access.ts
1 | export default (initialState: API.UserInfo) => { | 1 | export default (initialState: API.UserInfo) => { |
2 | // 在这里按照初始化数据定义项目中的权限,统一管理 | 2 | // 在这里按照初始化数据定义项目中的权限,统一管理 |
3 | // 参考文档 https://umijs.org/docs/max/access | 3 | // 参考文档 https://umijs.org/docs/max/access |
4 | - const { roleSmallVO, username } = initialState; | 4 | + const { roleSmallVO, username, roles } = initialState; |
5 | + | ||
5 | const canReadAdmin = roleSmallVO?.code === 'admin'; | 6 | const canReadAdmin = roleSmallVO?.code === 'admin'; |
6 | - const canReadProcure = roleSmallVO?.code === 'procure'; | 7 | + const canReadProcure = |
8 | + roleSmallVO?.code === 'procure' || roles.includes('PROCURE_MANAGER'); | ||
7 | const canReadFinance = roleSmallVO?.code === 'finance'; | 9 | const canReadFinance = roleSmallVO?.code === 'finance'; |
8 | const canReadWarehouseKeeper = roleSmallVO?.code === 'warehouseKeeper'; | 10 | const canReadWarehouseKeeper = roleSmallVO?.code === 'warehouseKeeper'; |
9 | const canReadSales = | 11 | const canReadSales = |
src/pages/Instalment/components/checkModal/checkModal.tsx
0 → 100644
1 | +import { postOrderErpOrderStagesCheckOrderStages } from '@/services'; | ||
2 | +import { ModalForm, ProFormTextArea } from '@ant-design/pro-components'; | ||
3 | +import { Button, Form, Space, message } from 'antd'; | ||
4 | + | ||
5 | +const waitTime = (time: number = 100) => { | ||
6 | + return new Promise((resolve) => { | ||
7 | + setTimeout(() => { | ||
8 | + resolve(true); | ||
9 | + }, time); | ||
10 | + }); | ||
11 | +}; | ||
12 | + | ||
13 | +export default ({ id, toReload }) => { | ||
14 | + const [form] = Form.useForm<{ mark: string }>(); | ||
15 | + | ||
16 | + return ( | ||
17 | + <Space> | ||
18 | + <ModalForm<{ | ||
19 | + mark: string; | ||
20 | + }> | ||
21 | + title="账单审核" | ||
22 | + width={460} | ||
23 | + form={form} | ||
24 | + trigger={<a>审核</a>} | ||
25 | + modalProps={{ | ||
26 | + okText: '通过', | ||
27 | + cancelText: '驳回', | ||
28 | + destroyOnClose: true, | ||
29 | + }} | ||
30 | + submitter={{ | ||
31 | + render: (props, defaultDoms) => { | ||
32 | + let myDoms = []; | ||
33 | + myDoms.push( | ||
34 | + <Button | ||
35 | + key="驳回" | ||
36 | + onClick={async () => { | ||
37 | + const res = await postOrderErpOrderStagesCheckOrderStages({ | ||
38 | + data: { | ||
39 | + id: id, | ||
40 | + isPass: false, | ||
41 | + mark: form.getFieldValue('mark'), | ||
42 | + }, | ||
43 | + }); | ||
44 | + await waitTime(2000); | ||
45 | + if (res.message === '成功') { | ||
46 | + message.success('操作成功'); | ||
47 | + } | ||
48 | + toReload(); | ||
49 | + return; | ||
50 | + }} | ||
51 | + > | ||
52 | + 驳回 | ||
53 | + </Button>, | ||
54 | + ); | ||
55 | + myDoms.push(defaultDoms[1]); | ||
56 | + return myDoms; | ||
57 | + }, | ||
58 | + }} | ||
59 | + onFinish={async (values) => { | ||
60 | + const res = await postOrderErpOrderStagesCheckOrderStages({ | ||
61 | + data: { | ||
62 | + id: id, | ||
63 | + isPass: true, | ||
64 | + mark: values.mark, | ||
65 | + }, | ||
66 | + }); | ||
67 | + await waitTime(2000); | ||
68 | + if (res.message === '成功') { | ||
69 | + message.success('操作成功'); | ||
70 | + } | ||
71 | + toReload(); | ||
72 | + return true; | ||
73 | + }} | ||
74 | + > | ||
75 | + <ProFormTextArea | ||
76 | + width="lg" | ||
77 | + name="mark" | ||
78 | + label="备注" | ||
79 | + tooltip="请特别注意订单总金额与订单金额。" | ||
80 | + placeholder="请输入名称" | ||
81 | + /> | ||
82 | + </ModalForm> | ||
83 | + </Space> | ||
84 | + ); | ||
85 | +}; |
src/pages/Instalment/components/edit/edit.tsx
@@ -27,7 +27,7 @@ const waitTime = (time: number = 100) => { | @@ -27,7 +27,7 @@ const waitTime = (time: number = 100) => { | ||
27 | }); | 27 | }); |
28 | }; | 28 | }; |
29 | 29 | ||
30 | -export default ({ currentContract, toReload }) => { | 30 | +export default ({ currentContract, toReload, showTarget }) => { |
31 | const [form] = Form.useForm<{ name: string; company: string }>(); | 31 | const [form] = Form.useForm<{ name: string; company: string }>(); |
32 | const [contextBody, setContextBody] = useState({}); | 32 | const [contextBody, setContextBody] = useState({}); |
33 | const [total, setTotal] = useState(0); | 33 | const [total, setTotal] = useState(0); |
@@ -76,10 +76,10 @@ export default ({ currentContract, toReload }) => { | @@ -76,10 +76,10 @@ export default ({ currentContract, toReload }) => { | ||
76 | }); | 76 | }); |
77 | const context = res.data[0]; | 77 | const context = res.data[0]; |
78 | 78 | ||
79 | - if (context.contract !== null) { | 79 | + if (context?.contract !== null) { |
80 | setContextBody(context); | 80 | setContextBody(context); |
81 | - setTotal(context.totalPrice); | ||
82 | - form.setFieldValue('totalPrice', context.totalPrice); | 81 | + setTotal(context?.totalPrice); |
82 | + form.setFieldValue('totalPrice', context?.totalPrice); | ||
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
@@ -95,7 +95,11 @@ export default ({ currentContract, toReload }) => { | @@ -95,7 +95,11 @@ export default ({ currentContract, toReload }) => { | ||
95 | 95 | ||
96 | const handleInputChange = (value: string, no: number, priceNow?: number) => { | 96 | const handleInputChange = (value: string, no: number, priceNow?: number) => { |
97 | let totalPay = 0; | 97 | let totalPay = 0; |
98 | - const payValue: string[] = value.split('/'); | 98 | + let payValue: string[] = []; |
99 | + if (value) { | ||
100 | + payValue = value.split('/'); | ||
101 | + } | ||
102 | + | ||
99 | let body: | 103 | let body: |
100 | | ((prevState: never[]) => never[]) | 104 | | ((prevState: never[]) => never[]) |
101 | | { proportion: string; payPrice: number }[] = []; | 105 | | { proportion: string; payPrice: number }[] = []; |
@@ -141,24 +145,23 @@ export default ({ currentContract, toReload }) => { | @@ -141,24 +145,23 @@ export default ({ currentContract, toReload }) => { | ||
141 | }); | 145 | }); |
142 | const context = res.data[0]; | 146 | const context = res.data[0]; |
143 | console.log(context); | 147 | console.log(context); |
144 | - if (context.contract !== null) { | 148 | + if (context?.contract !== null) { |
145 | setContextBody(context); | 149 | setContextBody(context); |
146 | - setTotal(context.totalPrice); | ||
147 | - form.setFieldValue('totalPrice', context.totalPrice); | 150 | + setTotal(context?.totalPrice); |
151 | + form.setFieldValue('totalPrice', context?.totalPrice); | ||
148 | } | 152 | } |
149 | - handleInputChange(context.payWay, 0, context.totalPrice); | 153 | + handleInputChange(context?.payWay, 0, context?.totalPrice); |
150 | } else { | 154 | } else { |
151 | const res = await postOrderErpOrderStagesSearch({ | 155 | const res = await postOrderErpOrderStagesSearch({ |
152 | data: { contract: currentContract }, | 156 | data: { contract: currentContract }, |
153 | }); | 157 | }); |
154 | const context = res.data[0]; | 158 | const context = res.data[0]; |
155 | - console.log(context); | ||
156 | - if (context.contract !== null) { | 159 | + if (context?.contract !== null) { |
157 | setContextBody(context); | 160 | setContextBody(context); |
158 | - setTotal(context.totalPrice); | ||
159 | - form.setFieldValue('totalPrice', context.totalPrice); | 161 | + setTotal(context?.totalPrice); |
162 | + form.setFieldValue('totalPrice', context?.totalPrice); | ||
160 | } | 163 | } |
161 | - handleInputChange(context.payWay, 0, context.totalPrice); | 164 | + handleInputChange(context?.payWay, 0, context?.totalPrice); |
162 | } | 165 | } |
163 | } | 166 | } |
164 | 167 | ||
@@ -167,18 +170,17 @@ export default ({ currentContract, toReload }) => { | @@ -167,18 +170,17 @@ export default ({ currentContract, toReload }) => { | ||
167 | value.map((obj) => (price += obj.count * obj.unitPrice)); | 170 | value.map((obj) => (price += obj.count * obj.unitPrice)); |
168 | setTotal(price); | 171 | setTotal(price); |
169 | setContextBody({ ...contextBody, orderStagesDeviceVoList: value }); | 172 | setContextBody({ ...contextBody, orderStagesDeviceVoList: value }); |
170 | - handleInputChange(contextBody.payWay, 0, price); | 173 | + handleInputChange(contextBody?.payWay, 0, price); |
171 | } | 174 | } |
172 | 175 | ||
173 | useEffect(() => { | 176 | useEffect(() => { |
174 | - console.log('1'); | ||
175 | getBody(null); | 177 | getBody(null); |
176 | }, []); | 178 | }, []); |
177 | 179 | ||
178 | return ( | 180 | return ( |
179 | <ModalForm<OrderStagesWithListItem> | 181 | <ModalForm<OrderStagesWithListItem> |
180 | - title="新建" | ||
181 | - trigger={<a onClick={refresh}>编辑</a>} | 182 | + title="订单编辑" |
183 | + trigger={<a onClick={refresh}>{showTarget}</a>} | ||
182 | form={form} | 184 | form={form} |
183 | autoFocusFirstInput | 185 | autoFocusFirstInput |
184 | modalProps={{ | 186 | modalProps={{ |
@@ -277,7 +279,7 @@ export default ({ currentContract, toReload }) => { | @@ -277,7 +279,7 @@ export default ({ currentContract, toReload }) => { | ||
277 | rules={[{ required: true, message: '此项为必填项' }]} | 279 | rules={[{ required: true, message: '此项为必填项' }]} |
278 | label="供应商名称" | 280 | label="供应商名称" |
279 | placeholder="请输入" | 281 | placeholder="请输入" |
280 | - initialValue={contextBody.vendor} | 282 | + initialValue={contextBody?.vendor} |
281 | /> | 283 | /> |
282 | 284 | ||
283 | <ProFormText | 285 | <ProFormText |
@@ -286,7 +288,7 @@ export default ({ currentContract, toReload }) => { | @@ -286,7 +288,7 @@ export default ({ currentContract, toReload }) => { | ||
286 | rules={[{ required: true, message: '此项为必填项' }]} | 288 | rules={[{ required: true, message: '此项为必填项' }]} |
287 | label="终端名称" | 289 | label="终端名称" |
288 | placeholder="请输入" | 290 | placeholder="请输入" |
289 | - initialValue={contextBody.terminal} | 291 | + initialValue={contextBody?.terminal} |
290 | /> | 292 | /> |
291 | 293 | ||
292 | <ProFormDatePicker | 294 | <ProFormDatePicker |
@@ -297,7 +299,7 @@ export default ({ currentContract, toReload }) => { | @@ -297,7 +299,7 @@ export default ({ currentContract, toReload }) => { | ||
297 | fieldProps={{ | 299 | fieldProps={{ |
298 | format: (value) => value.format('YYYY-MM-DD'), | 300 | format: (value) => value.format('YYYY-MM-DD'), |
299 | }} | 301 | }} |
300 | - initialValue={contextBody.dateRange} | 302 | + initialValue={contextBody?.dateRange} |
301 | /> | 303 | /> |
302 | 304 | ||
303 | <ProFormText | 305 | <ProFormText |
@@ -306,7 +308,7 @@ export default ({ currentContract, toReload }) => { | @@ -306,7 +308,7 @@ export default ({ currentContract, toReload }) => { | ||
306 | rules={[{ required: true, message: '此项为必填项' }]} | 308 | rules={[{ required: true, message: '此项为必填项' }]} |
307 | label="付款比例" | 309 | label="付款比例" |
308 | placeholder="请输入" | 310 | placeholder="请输入" |
309 | - initialValue={contextBody.payWay} | 311 | + initialValue={contextBody?.payWay} |
310 | onBlur={(e) => { | 312 | onBlur={(e) => { |
311 | handleInputChange(e.target.value, 1); | 313 | handleInputChange(e.target.value, 1); |
312 | }} | 314 | }} |
@@ -318,7 +320,7 @@ export default ({ currentContract, toReload }) => { | @@ -318,7 +320,7 @@ export default ({ currentContract, toReload }) => { | ||
318 | rules={[{ required: true, message: '此项为必填项' }]} | 320 | rules={[{ required: true, message: '此项为必填项' }]} |
319 | label="合同编号" | 321 | label="合同编号" |
320 | placeholder="请输入" | 322 | placeholder="请输入" |
321 | - initialValue={contextBody.contract} | 323 | + initialValue={contextBody?.contract} |
322 | /> | 324 | /> |
323 | 325 | ||
324 | <ProFormUploadButton | 326 | <ProFormUploadButton |
@@ -334,7 +336,7 @@ export default ({ currentContract, toReload }) => { | @@ -334,7 +336,7 @@ export default ({ currentContract, toReload }) => { | ||
334 | label="合同金额" | 336 | label="合同金额" |
335 | placeholder="请输入" | 337 | placeholder="请输入" |
336 | disabled | 338 | disabled |
337 | - initialValue={contextBody.totalPrice} | 339 | + initialValue={contextBody?.totalPrice} |
338 | /> | 340 | /> |
339 | </ProForm.Group> | 341 | </ProForm.Group> |
340 | </ProCard> | 342 | </ProCard> |
@@ -350,7 +352,7 @@ export default ({ currentContract, toReload }) => { | @@ -350,7 +352,7 @@ export default ({ currentContract, toReload }) => { | ||
350 | bordered | 352 | bordered |
351 | > | 353 | > |
352 | <ProductDetail | 354 | <ProductDetail |
353 | - productBody={contextBody.orderStagesDeviceVoList} | 355 | + productBody={contextBody?.orderStagesDeviceVoList} |
354 | EditProductBody={getEditProductBody} | 356 | EditProductBody={getEditProductBody} |
355 | ></ProductDetail> | 357 | ></ProductDetail> |
356 | </ProCard> | 358 | </ProCard> |
@@ -363,7 +365,7 @@ export default ({ currentContract, toReload }) => { | @@ -363,7 +365,7 @@ export default ({ currentContract, toReload }) => { | ||
363 | > | 365 | > |
364 | <PayWayDetail | 366 | <PayWayDetail |
365 | payBody={payWayBody} | 367 | payBody={payWayBody} |
366 | - thisId={contextBody.id} | 368 | + thisId={contextBody?.id} |
367 | currtSave={setSave} | 369 | currtSave={setSave} |
368 | ></PayWayDetail> | 370 | ></PayWayDetail> |
369 | </ProCard> | 371 | </ProCard> |
@@ -372,7 +374,7 @@ export default ({ currentContract, toReload }) => { | @@ -372,7 +374,7 @@ export default ({ currentContract, toReload }) => { | ||
372 | <ProFormTextArea | 374 | <ProFormTextArea |
373 | label="备注" | 375 | label="备注" |
374 | name="remark" | 376 | name="remark" |
375 | - initialValue={contextBody.remark} | 377 | + initialValue={contextBody?.remark} |
376 | /> | 378 | /> |
377 | </ProCard> | 379 | </ProCard> |
378 | </ModalForm> | 380 | </ModalForm> |
src/pages/Instalment/components/productDetail/productDetail.tsx
@@ -28,8 +28,10 @@ export default ({ productBody, EditProductBody }) => { | @@ -28,8 +28,10 @@ export default ({ productBody, EditProductBody }) => { | ||
28 | 'bottom', | 28 | 'bottom', |
29 | ); | 29 | ); |
30 | function getDataSourece() { | 30 | function getDataSourece() { |
31 | - if (productBody.length !== 0) { | ||
32 | - setDataSource(productBody); | 31 | + if (productBody?.length) { |
32 | + if (productBody?.length !== 0) { | ||
33 | + setDataSource(productBody); | ||
34 | + } | ||
33 | } | 35 | } |
34 | } | 36 | } |
35 | function setEditProductBody(value) { | 37 | function setEditProductBody(value) { |
src/pages/Instalment/components/read/read.tsx
@@ -168,7 +168,7 @@ export default ({ currentContract }) => { | @@ -168,7 +168,7 @@ export default ({ currentContract }) => { | ||
168 | 168 | ||
169 | return ( | 169 | return ( |
170 | <ModalForm<OrderStagesWithListItem> | 170 | <ModalForm<OrderStagesWithListItem> |
171 | - title="新建" | 171 | + title="查看" |
172 | trigger={<a onClick={refresh}>查看</a>} | 172 | trigger={<a onClick={refresh}>查看</a>} |
173 | form={form} | 173 | form={form} |
174 | autoFocusFirstInput | 174 | autoFocusFirstInput |
@@ -176,6 +176,14 @@ export default ({ currentContract }) => { | @@ -176,6 +176,14 @@ export default ({ currentContract }) => { | ||
176 | destroyOnClose: true, | 176 | destroyOnClose: true, |
177 | // onCancel: () => console.log('run'), | 177 | // onCancel: () => console.log('run'), |
178 | }} | 178 | }} |
179 | + submitter={{ | ||
180 | + resetButtonProps: {}, | ||
181 | + submitButtonProps: { | ||
182 | + style: { | ||
183 | + display: 'none', | ||
184 | + }, | ||
185 | + }, | ||
186 | + }} | ||
179 | submitTimeout={2000} | 187 | submitTimeout={2000} |
180 | onFinish={async (values) => { | 188 | onFinish={async (values) => { |
181 | // console.log(values); | 189 | // console.log(values); |
src/pages/Instalment/components/read/readPayWay.tsx
@@ -89,18 +89,20 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -89,18 +89,20 @@ export default ({ payBody, thisId, currtSave }) => { | ||
89 | const context = res.data; | 89 | const context = res.data; |
90 | const remake = arr.map((obj) => { | 90 | const remake = arr.map((obj) => { |
91 | let currt = obj; | 91 | let currt = obj; |
92 | - context.forEach((object) => { | ||
93 | - if (object.number === obj.id) { | ||
94 | - currt = { | ||
95 | - ...obj, | ||
96 | - ossId: value, | ||
97 | - payDate: object.dateRange, | ||
98 | - fileName: object.fileName, | ||
99 | - fileUrl: object.fileUrl, | ||
100 | - }; | ||
101 | - return currt; | ||
102 | - } | ||
103 | - }); | 92 | + if (Array.isArray(context)) { |
93 | + context.forEach((object) => { | ||
94 | + if (object.number === obj.id) { | ||
95 | + currt = { | ||
96 | + ...obj, | ||
97 | + ossId: value, | ||
98 | + payDate: object.dateRange, | ||
99 | + fileName: object.fileName, | ||
100 | + fileUrl: object.fileUrl, | ||
101 | + }; | ||
102 | + return currt; | ||
103 | + } | ||
104 | + }); | ||
105 | + } | ||
104 | return currt; | 106 | return currt; |
105 | }); | 107 | }); |
106 | setPayWayDetailBody(remake); | 108 | setPayWayDetailBody(remake); |
src/pages/Instalment/components/title/titletest.tsx
1 | -// import type { ProColumns } from '@ant-design/pro-components'; | ||
2 | -// import { | ||
3 | -// EditableProTable, | ||
4 | -// ProCard, | ||
5 | -// ProFormField, | ||
6 | -// ProFormRadio, | ||
7 | -// useRefFunction, | ||
8 | -// } from '@ant-design/pro-components'; | ||
9 | -// import { | ||
10 | -// deleteOrderErpOrderStagesDelect, | ||
11 | -// getOrderErpOrderStagesListAll, | ||
12 | -// postOrderErpOrderStagesSearch, | ||
13 | -// } from '@/services'; | ||
14 | -// import { orderExport } from '@/services/order'; | ||
15 | -// import { VerticalAlignTopOutlined } from '@ant-design/icons'; | ||
16 | -// import { ProTable } from '@ant-design/pro-components'; | ||
17 | -// import { Button, message } from 'antd'; | ||
18 | -// import { useRef } from 'react'; | ||
19 | -// import Comfire from '../comfire/comfire'; | ||
20 | -// import AddModel from '../detail/detail'; | ||
21 | -// import EditorModel from '../edit/edit'; | ||
22 | -// import ReadModel from '../read/read'; | ||
23 | -// import UploadModel from '../upload/uploadModel'; | ||
24 | -// import './title.less'; | ||
25 | -// import React, { useState } from 'react'; | 1 | +import { |
2 | + deleteOrderErpOrderStagesDelect, | ||
3 | + getOrderErpOrderStagesListAll, | ||
4 | + postOrderErpOrderStagesSearch, | ||
5 | +} from '@/services'; | ||
6 | +import { orderExport } from '@/services/order'; | ||
7 | +import { VerticalAlignTopOutlined } from '@ant-design/icons'; | ||
8 | +import type { ProColumns } from '@ant-design/pro-components'; | ||
9 | +import { EditableProTable } from '@ant-design/pro-components'; | ||
10 | +import { Button, Tag, message } from 'antd'; | ||
11 | +import { useRef } from 'react'; | ||
12 | +import CheckModal from '../checkModal/checkModal'; | ||
13 | +import Comfire from '../comfire/comfire'; | ||
14 | +import AddModel from '../detail/detail'; | ||
15 | +import EditorModel from '../edit/edit'; | ||
16 | +import ReadModel from '../read/read'; | ||
17 | +import UploadModel from '../upload/uploadModel'; | ||
18 | +import './title.less'; | ||
26 | 19 | ||
27 | -// export const waitTimePromise = async (time: number = 100) => { | ||
28 | -// return new Promise((resolve) => { | ||
29 | -// setTimeout(() => { | ||
30 | -// resolve(true); | ||
31 | -// }, time); | ||
32 | -// }); | ||
33 | -// }; | ||
34 | - | ||
35 | -// export const waitTime = async (time: number = 100) => { | ||
36 | -// await waitTimePromise(time); | ||
37 | -// }; | ||
38 | - | ||
39 | -// type OrderStagesItem = { | ||
40 | -// //文件编号 | ||
41 | -// id?: number; | ||
42 | -// //合同编号 | ||
43 | -// contract?: string; | ||
44 | -// //供应商名称 | ||
45 | -// vendor?: string; | ||
46 | -// //签合同日期 | ||
47 | -// dateRange?: Date; | ||
48 | -// //终端名称 | ||
49 | -// terminal?: string; | ||
50 | -// //设备编号 | ||
51 | -// dId?: number; | ||
52 | -// //设备名称 | ||
53 | -// deviceName?: string; | ||
54 | -// //设备型号 | ||
55 | -// deviceModel?: string; | ||
56 | -// //数量 | ||
57 | -// count?: number; | ||
58 | -// //单价 | ||
59 | -// unitPrice?: number; | ||
60 | -// //总价 | ||
61 | -// price?: number; | ||
62 | -// //合同总金额 | ||
63 | -// totalPrice?: number; | ||
64 | -// //付款方式 | ||
65 | -// payWay?: string; | ||
66 | -// //附件 | ||
67 | -// annex?: string; | ||
68 | -// //备注 | ||
69 | -// remark?: string; | ||
70 | -// //可选操作 | ||
71 | -// opt?: string[]; | ||
72 | -// //子类 | ||
73 | -// children?:OrderStagesItem[] | ||
74 | -// }; | 20 | +export const waitTimePromise = async (time: number = 100) => { |
21 | + return new Promise((resolve) => { | ||
22 | + setTimeout(() => { | ||
23 | + resolve(true); | ||
24 | + }, time); | ||
25 | + }); | ||
26 | +}; | ||
75 | 27 | ||
76 | -// type OrderStagesWithListItem = { | ||
77 | -// //文件编号 | ||
78 | -// id: number; | ||
79 | -// //合同编号 | ||
80 | -// contract: string; | ||
81 | -// //供应商名称 | ||
82 | -// vendor: string; | ||
83 | -// //签合同日期 | ||
84 | -// dateRange: Date; | ||
85 | -// //终端名称 | ||
86 | -// terminal: string; | ||
87 | -// orderStagesDeviceVoList: orderStagesDevice[]; | ||
88 | -// //合同总金额 | ||
89 | -// totalPrice: number; | ||
90 | -// //付款方式 | ||
91 | -// payWay: string; | ||
92 | -// //附件 | ||
93 | -// annex: string; | ||
94 | -// //备注 | ||
95 | -// remark: string; | ||
96 | -// //可选操作 | ||
97 | -// paths:string[]; | ||
98 | -// }; | 28 | +export const waitTime = async (time: number = 100) => { |
29 | + await waitTimePromise(time); | ||
30 | +}; | ||
99 | 31 | ||
100 | -// type orderStagesDevice = { | ||
101 | -// //设备id | ||
102 | -// dId: number; | ||
103 | -// //设备名称 | ||
104 | -// deviceName: string; | ||
105 | -// //设备型号 | ||
106 | -// deviceModel: string; | ||
107 | -// //数量 | ||
108 | -// count: number; | ||
109 | -// //单价 | ||
110 | -// unitPrice: number; | ||
111 | -// //总价 | ||
112 | -// price: number; | ||
113 | -// }; | 32 | +type OrderStagesItem = { |
33 | + //文件编号 | ||
34 | + id?: number; | ||
35 | + //合同编号 | ||
36 | + contract?: string; | ||
37 | + //供应商名称 | ||
38 | + vendor?: string; | ||
39 | + //签合同日期 | ||
40 | + dateRange?: Date; | ||
41 | + //终端名称 | ||
42 | + terminal?: string; | ||
43 | + //设备编号 | ||
44 | + dId?: number; | ||
45 | + //设备名称 | ||
46 | + deviceName?: string; | ||
47 | + //设备型号 | ||
48 | + deviceModel?: string; | ||
49 | + //数量 | ||
50 | + count?: number; | ||
51 | + //单价 | ||
52 | + unitPrice?: number; | ||
53 | + //总价 | ||
54 | + price?: number; | ||
55 | + //合同总金额 | ||
56 | + totalPrice?: number; | ||
57 | + //付款方式 | ||
58 | + payWay?: string; | ||
59 | + //附件 | ||
60 | + annex?: string; | ||
61 | + //备注 | ||
62 | + remark?: string; | ||
63 | + //可选操作 | ||
64 | + opt?: string[]; | ||
65 | + //账单状态 | ||
66 | + status?: string; | ||
67 | + //审核备注 | ||
68 | + statusMark?: string; | ||
69 | + //子类 | ||
70 | + children?: OrderStagesItem[]; | ||
71 | +}; | ||
114 | 72 | ||
115 | -// const filterOrderStages = ( | ||
116 | -// data: readonly OrderStagesWithListItem[], | ||
117 | -// id: number | undefined, | ||
118 | -// ): OrderStagesWithListItem[] => { | ||
119 | -// return data.reduce<OrderStagesWithListItem[]>((accumulator, item) => { | ||
120 | -// // If the current item's id does not match the given id | ||
121 | -// if (item.id !== id) { | ||
122 | -// // If the item has a device list, we can also filter it if needed | ||
123 | -// const filteredDevices = item.orderStagesDeviceVoList.filter(device => device.dId !== id); | 73 | +type OrderStagesWithListItem = { |
74 | + //文件编号 | ||
75 | + id: number; | ||
76 | + //合同编号 | ||
77 | + contract: string; | ||
78 | + //供应商名称 | ||
79 | + vendor: string; | ||
80 | + //签合同日期 | ||
81 | + dateRange: Date; | ||
82 | + //终端名称 | ||
83 | + terminal: string; | ||
84 | + orderStagesDeviceVoList: orderStagesDevice[]; | ||
85 | + //合同总金额 | ||
86 | + totalPrice: number; | ||
87 | + //付款方式 | ||
88 | + payWay: string; | ||
89 | + //附件 | ||
90 | + annex: string; | ||
91 | + //备注 | ||
92 | + remark: string; | ||
93 | + //可选操作 | ||
94 | + paths: string[]; | ||
95 | + //账单状态 | ||
96 | + status?: string; | ||
97 | + //审核备注 | ||
98 | + statusMark?: string; | ||
99 | +}; | ||
124 | 100 | ||
125 | -// // Create a new item without the filtered devices | ||
126 | -// const newItem: OrderStagesWithListItem = { | ||
127 | -// ...item, | ||
128 | -// orderStagesDeviceVoList: filteredDevices, | ||
129 | -// }; | 101 | +type orderStagesDevice = { |
102 | + //设备id | ||
103 | + dId: number; | ||
104 | + //设备名称 | ||
105 | + deviceName: string; | ||
106 | + //设备型号 | ||
107 | + deviceModel: string; | ||
108 | + //数量 | ||
109 | + count: number; | ||
110 | + //单价 | ||
111 | + unitPrice: number; | ||
112 | + //总价 | ||
113 | + price: number; | ||
114 | +}; | ||
130 | 115 | ||
131 | -// // Add the new item to the accumulator | ||
132 | -// accumulator.push(newItem); | ||
133 | -// } | ||
134 | -// return accumulator; | ||
135 | -// }, []); | 116 | +// const loopOrderStagesFilter = ( |
117 | +// data: readonly OrderStagesItem[], | ||
118 | +// dId: React.Key | undefined, | ||
119 | +// ): OrderStagesItem[] => { | ||
120 | +// return data | ||
121 | +// .map((item) => { | ||
122 | +// if (item.dId !== dId) { | ||
123 | +// if (item.children) { | ||
124 | +// if (item.children.length !== 0) { | ||
125 | +// const newChildren = loopOrderStagesFilter(item.children, dId); | ||
126 | +// return { | ||
127 | +// ...item, | ||
128 | +// children: newChildren.length > 0 ? newChildren : undefined, | ||
129 | +// }; | ||
130 | +// } | ||
131 | +// } | ||
132 | +// return item; | ||
133 | +// } | ||
134 | +// return null; | ||
135 | +// }) | ||
136 | +// .filter(Boolean) as OrderStagesItem[]; | ||
136 | // }; | 137 | // }; |
137 | 138 | ||
138 | -// export default () => { | ||
139 | -// const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]); | ||
140 | -// const [dataSource, setDataSource] = useState<readonly OrderStagesWithListItem[]>( | ||
141 | -// [] | ||
142 | -// ); | 139 | +export default () => { |
140 | + interface ActionType { | ||
141 | + reload: (resetPageIndex?: boolean) => void; | ||
142 | + reloadAndRest: () => void; | ||
143 | + reset: () => void; | ||
144 | + clearSelected?: () => void; | ||
145 | + startEditable: (rowKey: Key) => boolean; | ||
146 | + cancelEditable: (rowKey: Key) => boolean; | ||
147 | + } | ||
143 | 148 | ||
144 | -// interface ActionType { | ||
145 | -// reload: (resetPageIndex?: boolean) => void; | ||
146 | -// reloadAndRest: () => void; | ||
147 | -// reset: () => void; | ||
148 | -// clearSelected?: () => void; | ||
149 | -// startEditable: (rowKey: Key) => boolean; | ||
150 | -// cancelEditable: (rowKey: Key) => boolean; | ||
151 | -// } | 149 | + const ref = useRef<ActionType>({ |
150 | + reload: () => { | ||
151 | + // implementation for reload | ||
152 | + }, | ||
153 | + reloadAndRest: () => { | ||
154 | + // implementation for reloadAndRest | ||
155 | + }, | ||
156 | + reset: () => { | ||
157 | + // implementation for reset | ||
158 | + }, | ||
159 | + startEditable: () => { | ||
160 | + // implementation for startEditable | ||
161 | + }, | ||
162 | + cancelEditable: () => { | ||
163 | + // implementation for cancelEditable | ||
164 | + }, | ||
165 | + }); | ||
152 | 166 | ||
153 | -// const ref = useRef<ActionType>({ | ||
154 | -// reload: () => { | ||
155 | -// // implementation for reload | ||
156 | -// }, | ||
157 | -// reloadAndRest: () => { | ||
158 | -// // implementation for reloadAndRest | ||
159 | -// }, | ||
160 | -// reset: () => { | ||
161 | -// // implementation for reset | ||
162 | -// }, | ||
163 | -// startEditable: () => { | ||
164 | -// // implementation for startEditable | ||
165 | -// }, | ||
166 | -// cancelEditable: () => { | ||
167 | -// // implementation for cancelEditable | ||
168 | -// }, | ||
169 | -// }); | 167 | + function reload() { |
168 | + ref.current.reload(); | ||
169 | + } | ||
170 | 170 | ||
171 | -// function reload() { | ||
172 | -// ref.current.reload(); | ||
173 | -// } | 171 | + async function toDelete(value) { |
172 | + const res = await deleteOrderErpOrderStagesDelect({ | ||
173 | + data: { | ||
174 | + ids: null, | ||
175 | + deviceIds: value, | ||
176 | + }, | ||
177 | + }); | ||
178 | + if (res) { | ||
179 | + message.success('删除成功'); | ||
180 | + ref.current.reload(); | ||
181 | + } else { | ||
182 | + message.error('删除失败'); | ||
183 | + } | ||
184 | + } | ||
174 | 185 | ||
175 | -// async function toDelete(value) { | ||
176 | -// const res = await deleteOrderErpOrderStagesDelect({ | ||
177 | -// data: { | ||
178 | -// ids: null, | ||
179 | -// deviceIds: value, | ||
180 | -// }, | ||
181 | -// }); | ||
182 | -// if (res) { | ||
183 | -// message.success('删除成功'); | ||
184 | -// ref.current.reload(); | ||
185 | -// } else { | ||
186 | -// message.error('删除失败'); | ||
187 | -// } | ||
188 | -// } | 186 | + const exportLoadingDestory = () => { |
187 | + message.success('导出成功'); | ||
188 | + }; | ||
189 | 189 | ||
190 | -// const exportLoadingDestory = () => { | ||
191 | -// message.success('导出成功'); | ||
192 | -// }; | 190 | + async function toExport() { |
191 | + // await getOrderErpOrderStagesExport() | ||
192 | + orderExport( | ||
193 | + '/api/order/erp/orderStages/export', | ||
194 | + '分期订单.xlsx', | ||
195 | + 'get', | ||
196 | + {}, | ||
197 | + exportLoadingDestory, | ||
198 | + ); | ||
199 | + } | ||
193 | 200 | ||
194 | -// async function toExport() { | ||
195 | -// // await getOrderErpOrderStagesExport() | ||
196 | -// orderExport( | ||
197 | -// '/api/order/erp/orderStages/export', | ||
198 | -// '分期订单.xlsx', | ||
199 | -// 'get', | ||
200 | -// {}, | ||
201 | -// exportLoadingDestory, | ||
202 | -// ); | ||
203 | -// } | 201 | + const columns: ProColumns<OrderStagesItem>[] = [ |
202 | + { | ||
203 | + title: '文件编号', | ||
204 | + dataIndex: 'id', | ||
205 | + width: 100, | ||
206 | + disable: true, | ||
207 | + onFilter: true, | ||
208 | + ellipsis: true, | ||
209 | + // render: (_, record) => { | ||
210 | + // if (record.id) { | ||
211 | + // const text = record?.id.toString(); | ||
212 | + // const paddedText = '0'.repeat(4 - text.length) + text; | ||
213 | + // return paddedText; | ||
214 | + // } | ||
215 | + // }, | ||
216 | + }, | ||
217 | + { | ||
218 | + title: '签合同日期', | ||
219 | + dataIndex: 'dateRange', | ||
220 | + valueType: 'date', | ||
221 | + width: 100, | ||
222 | + disable: true, | ||
223 | + onFilter: true, | ||
224 | + ellipsis: true, | ||
225 | + }, | ||
226 | + { | ||
227 | + title: '合同编号', | ||
228 | + dataIndex: 'contract', | ||
229 | + width: 200, | ||
230 | + disable: true, | ||
231 | + onFilter: true, | ||
232 | + ellipsis: true, | ||
233 | + copyable: true, | ||
234 | + }, | ||
235 | + { | ||
236 | + title: '供应商名称', | ||
237 | + dataIndex: 'vendor', | ||
238 | + width: 200, | ||
239 | + disable: true, | ||
240 | + onFilter: true, | ||
241 | + ellipsis: true, | ||
242 | + }, | ||
243 | + { | ||
244 | + title: '终端名称', | ||
245 | + dataIndex: 'terminal', | ||
246 | + width: 200, | ||
247 | + disable: true, | ||
248 | + onFilter: true, | ||
249 | + ellipsis: true, | ||
250 | + }, | ||
251 | + { | ||
252 | + title: '状态', | ||
253 | + dataIndex: 'status', | ||
254 | + width: 200, | ||
255 | + disable: true, | ||
256 | + onFilter: true, | ||
257 | + ellipsis: true, | ||
258 | + valueType: 'select', | ||
259 | + valueEnum: { | ||
260 | + CHECK: { text: '待审核', status: 'CHECK' }, | ||
261 | + PASS: { text: '审核通过', status: 'PASS' }, | ||
262 | + NOT_PASS: { text: '审核未通过', status: 'NOT_PASS' }, | ||
263 | + }, | ||
264 | + render: (_, record) => { | ||
265 | + if (record.status !== null) { | ||
266 | + if ( | ||
267 | + record.status === 'UPDATE_CHECK' || | ||
268 | + record.status === 'SAVE_CHECK' || | ||
269 | + record.status === 'IMPORT_CHECK' | ||
270 | + ) { | ||
271 | + return <Tag color="blue">待审核</Tag>; | ||
272 | + } | ||
273 | + if (record.status === 'PASS') { | ||
274 | + return <Tag color="green">审核通过</Tag>; | ||
275 | + } | ||
276 | + if (record.status === 'NOT_PASS') { | ||
277 | + return <Tag color="red">审核未通过</Tag>; | ||
278 | + } | ||
279 | + } | ||
280 | + return <Tag color="orange">暂无状态</Tag>; | ||
281 | + }, | ||
282 | + }, | ||
283 | + { | ||
284 | + title: '设备名称', | ||
285 | + dataIndex: 'deviceName', | ||
286 | + width: 200, | ||
287 | + disable: true, | ||
288 | + onFilter: true, | ||
289 | + ellipsis: true, | ||
290 | + }, | ||
291 | + { | ||
292 | + title: '设备型号', | ||
293 | + dataIndex: 'deviceModel', | ||
294 | + hideInSearch: true, | ||
295 | + width: 200, | ||
296 | + disable: true, | ||
297 | + onFilter: true, | ||
298 | + ellipsis: true, | ||
299 | + }, | ||
300 | + { | ||
301 | + title: '数量', | ||
302 | + dataIndex: 'count', | ||
303 | + hideInSearch: true, | ||
304 | + width: 100, | ||
305 | + disable: true, | ||
306 | + onFilter: true, | ||
307 | + ellipsis: true, | ||
308 | + }, | ||
309 | + { | ||
310 | + title: '单价', | ||
311 | + dataIndex: 'unitPrice', | ||
312 | + hideInSearch: true, | ||
313 | + width: 100, | ||
314 | + disable: true, | ||
315 | + onFilter: true, | ||
316 | + ellipsis: true, | ||
317 | + }, | ||
318 | + { | ||
319 | + title: '总价', | ||
320 | + dataIndex: 'price', | ||
321 | + hideInSearch: true, | ||
322 | + width: 100, | ||
323 | + disable: true, | ||
324 | + onFilter: true, | ||
325 | + ellipsis: true, | ||
326 | + }, | ||
327 | + { | ||
328 | + title: '合同总金额', | ||
329 | + dataIndex: 'totalPrice', | ||
330 | + hideInSearch: true, | ||
331 | + width: 100, | ||
332 | + disable: true, | ||
333 | + onFilter: true, | ||
334 | + ellipsis: true, | ||
335 | + }, | ||
336 | + { | ||
337 | + title: '付款方式', | ||
338 | + dataIndex: 'payWay', | ||
339 | + hideInSearch: true, | ||
340 | + width: 100, | ||
341 | + disable: true, | ||
342 | + onFilter: true, | ||
343 | + ellipsis: true, | ||
344 | + }, | ||
345 | + { | ||
346 | + title: '附件', | ||
347 | + dataIndex: 'annex', | ||
348 | + hideInSearch: true, | ||
349 | + width: 100, | ||
350 | + disable: true, | ||
351 | + onFilter: true, | ||
352 | + ellipsis: true, | ||
353 | + render: (_, record) => { | ||
354 | + if (record.id && record.annex !== null) { | ||
355 | + return <a href={record.annex}>附件文件</a>; | ||
356 | + } | ||
357 | + }, | ||
358 | + }, | ||
359 | + { | ||
360 | + disable: true, | ||
361 | + title: '备注', | ||
362 | + dataIndex: 'remark', | ||
363 | + filters: true, | ||
364 | + hideInSearch: true, | ||
365 | + onFilter: false, | ||
366 | + ellipsis: true, | ||
367 | + width: 100, | ||
368 | + hideInTable: false, | ||
369 | + }, | ||
370 | + { | ||
371 | + disable: true, | ||
372 | + title: '审核备注', | ||
373 | + dataIndex: 'statusMark', | ||
374 | + filters: true, | ||
375 | + hideInSearch: true, | ||
376 | + onFilter: false, | ||
377 | + ellipsis: true, | ||
378 | + width: 100, | ||
379 | + hideInTable: false, | ||
380 | + }, | ||
381 | + { | ||
382 | + title: '操作', | ||
383 | + valueType: 'option', | ||
384 | + fixed: 'right', | ||
385 | + width: 160, | ||
386 | + disable: true, | ||
387 | + onFilter: true, | ||
388 | + ellipsis: true, | ||
389 | + render: (_text, record) => { | ||
390 | + if (record?.id) { | ||
391 | + const hasOnlyReaderPermission = record?.opt?.includes('ONLYREAD'); | ||
392 | + // const hasReaderPermission = record?.opt?.includes("READ"); | ||
393 | + const hasDeletePermission = record?.opt?.includes('DELETE'); | ||
394 | + const hasCheckPermission = record?.opt?.includes('CHECK'); | ||
395 | + const hasEditPermission = record?.opt?.includes('EDIT'); | ||
396 | + const hasRePutPermission = record?.opt?.includes('REPUT'); | ||
397 | + return ( | ||
398 | + <> | ||
399 | + {hasCheckPermission && ( | ||
400 | + <> | ||
401 | + <CheckModal id={record.id} toReload={reload}></CheckModal> | ||
402 | + | ||
403 | + </> | ||
404 | + )} | ||
204 | 405 | ||
205 | -// const columns: ProColumns<OrderStagesItem>[] = [ | ||
206 | -// { | ||
207 | -// title: '文件编号', | ||
208 | -// dataIndex: 'id', | ||
209 | -// width: 100, | ||
210 | -// disable: true, | ||
211 | -// onFilter: true, | ||
212 | -// ellipsis: true, | ||
213 | -// // render: (_, record) => { | ||
214 | -// // if (record.id) { | ||
215 | -// // const text = record?.id.toString(); | ||
216 | -// // const paddedText = '0'.repeat(4 - text.length) + text; | ||
217 | -// // return paddedText; | ||
218 | -// // } | ||
219 | -// // }, | ||
220 | -// }, | ||
221 | -// { | ||
222 | -// title: '签合同日期', | ||
223 | -// dataIndex: 'dateRange', | ||
224 | -// valueType: 'date', | ||
225 | -// width: 100, | ||
226 | -// disable: true, | ||
227 | -// onFilter: true, | ||
228 | -// ellipsis: true, | ||
229 | -// }, | ||
230 | -// { | ||
231 | -// title: '合同编号', | ||
232 | -// dataIndex: 'contract', | ||
233 | -// width: 200, | ||
234 | -// disable: true, | ||
235 | -// onFilter: true, | ||
236 | -// ellipsis: true, | ||
237 | -// }, | ||
238 | -// { | ||
239 | -// title: '供应商名称', | ||
240 | -// dataIndex: 'vendor', | ||
241 | -// width: 200, | ||
242 | -// disable: true, | ||
243 | -// onFilter: true, | ||
244 | -// ellipsis: true, | ||
245 | -// }, | ||
246 | -// { | ||
247 | -// title: '终端名称', | ||
248 | -// dataIndex: 'terminal', | ||
249 | -// width: 200, | ||
250 | -// disable: true, | ||
251 | -// onFilter: true, | ||
252 | -// ellipsis: true, | ||
253 | -// }, | ||
254 | -// { | ||
255 | -// title: '设备名称', | ||
256 | -// dataIndex: 'deviceName', | ||
257 | -// width: 200, | ||
258 | -// disable: true, | ||
259 | -// onFilter: true, | ||
260 | -// ellipsis: true, | ||
261 | -// }, | ||
262 | -// { | ||
263 | -// title: '设备型号', | ||
264 | -// dataIndex: 'deviceModel', | ||
265 | -// hideInSearch: true, | ||
266 | -// width: 200, | ||
267 | -// disable: true, | ||
268 | -// onFilter: true, | ||
269 | -// ellipsis: true, | ||
270 | -// }, | ||
271 | -// { | ||
272 | -// title: '数量', | ||
273 | -// dataIndex: 'count', | ||
274 | -// hideInSearch: true, | ||
275 | -// width: 100, | ||
276 | -// disable: true, | ||
277 | -// onFilter: true, | ||
278 | -// ellipsis: true, | ||
279 | -// }, | ||
280 | -// { | ||
281 | -// title: '单价', | ||
282 | -// dataIndex: 'unitPrice', | ||
283 | -// hideInSearch: true, | ||
284 | -// width: 100, | ||
285 | -// disable: true, | ||
286 | -// onFilter: true, | ||
287 | -// ellipsis: true, | ||
288 | -// }, | ||
289 | -// { | ||
290 | -// title: '总价', | ||
291 | -// dataIndex: 'price', | ||
292 | -// hideInSearch: true, | ||
293 | -// width: 100, | ||
294 | -// disable: true, | ||
295 | -// onFilter: true, | ||
296 | -// ellipsis: true, | ||
297 | -// }, | ||
298 | -// { | ||
299 | -// title: '合同总金额', | ||
300 | -// dataIndex: 'totalPrice', | ||
301 | -// hideInSearch: true, | ||
302 | -// width: 100, | ||
303 | -// disable: true, | ||
304 | -// onFilter: true, | ||
305 | -// ellipsis: true, | ||
306 | -// }, | ||
307 | -// { | ||
308 | -// title: '付款方式', | ||
309 | -// dataIndex: 'payWay', | ||
310 | -// hideInSearch: true, | ||
311 | -// width: 100, | ||
312 | -// disable: true, | ||
313 | -// onFilter: true, | ||
314 | -// ellipsis: true, | ||
315 | -// }, | ||
316 | -// { | ||
317 | -// title: '附件', | ||
318 | -// dataIndex: 'annex', | ||
319 | -// hideInSearch: true, | ||
320 | -// width: 100, | ||
321 | -// disable: true, | ||
322 | -// onFilter: true, | ||
323 | -// ellipsis: true, | ||
324 | -// render: (_, record) => { | ||
325 | -// if (record.id && record.annex !== null) { | ||
326 | -// return <a href={record.annex}>附件文件</a>; | ||
327 | -// } | ||
328 | -// }, | ||
329 | -// }, | ||
330 | -// { | ||
331 | -// disable: true, | ||
332 | -// title: '备注', | ||
333 | -// dataIndex: 'remark', | ||
334 | -// filters: true, | ||
335 | -// hideInSearch: true, | ||
336 | -// onFilter: false, | ||
337 | -// ellipsis: true, | ||
338 | -// width: 100, | ||
339 | -// }, | ||
340 | -// { | ||
341 | -// disable: true, | ||
342 | -// title: '备注', | ||
343 | -// dataIndex: 'remark', | ||
344 | -// filters: true, | ||
345 | -// hideInSearch: false, | ||
346 | -// onFilter: false, | ||
347 | -// ellipsis: true, | ||
348 | -// width: 100, | ||
349 | -// hideInTable: true | ||
350 | -// }, | ||
351 | -// { | ||
352 | -// title: '操作', | ||
353 | -// valueType: 'option', | ||
354 | -// key: 'option', | ||
355 | -// fixed: 'right', | ||
356 | -// width: 160, | ||
357 | -// disable: true, | ||
358 | -// onFilter: true, | ||
359 | -// ellipsis: true, | ||
360 | -// render: (_text, record) => { | ||
361 | -// if (record?.id) { | ||
362 | -// return ( | ||
363 | -// <> | ||
364 | -// <a key="check" target="_blank" onClick={() => { | ||
365 | -// console.log(record); | ||
366 | -// }}> | ||
367 | -// 审核 | ||
368 | -// </a> | ||
369 | -// | ||
370 | -// <ReadModel currentContract={record.contract}></ReadModel> | ||
371 | -// | ||
372 | -// <EditorModel | ||
373 | -// currentContract={record.contract} | ||
374 | -// toReload={reload} | ||
375 | -// ></EditorModel> | ||
376 | -// | ||
377 | -// <Comfire currtDid={record.dId} sureDelete={toDelete}></Comfire> | ||
378 | -// </> | ||
379 | -// ); | ||
380 | -// } | ||
381 | -// return null; | ||
382 | -// }, | ||
383 | -// }, | ||
384 | -// ]; | 406 | + {hasOnlyReaderPermission && ( |
407 | + <> | ||
408 | + <ReadModel currentContract={record.contract}></ReadModel> | ||
409 | + | ||
410 | + </> | ||
411 | + )} | ||
412 | + {hasEditPermission && ( | ||
413 | + <> | ||
414 | + <EditorModel | ||
415 | + currentContract={record.contract} | ||
416 | + toReload={reload} | ||
417 | + showTarget={'编辑'} | ||
418 | + ></EditorModel> | ||
419 | + | ||
420 | + </> | ||
421 | + )} | ||
422 | + {hasRePutPermission && ( | ||
423 | + <> | ||
424 | + <EditorModel | ||
425 | + currentContract={record.contract} | ||
426 | + toReload={reload} | ||
427 | + showTarget={'重新上传'} | ||
428 | + ></EditorModel> | ||
429 | + | ||
430 | + </> | ||
431 | + )} | ||
432 | + {hasDeletePermission && ( | ||
433 | + <> | ||
434 | + <Comfire | ||
435 | + currtDid={record.dId} | ||
436 | + sureDelete={toDelete} | ||
437 | + ></Comfire> | ||
438 | + </> | ||
439 | + )} | ||
440 | + </> | ||
441 | + ); | ||
442 | + } | ||
443 | + return null; | ||
444 | + }, | ||
445 | + }, | ||
446 | + ]; | ||
385 | 447 | ||
386 | -// return ( | ||
387 | -// <> | ||
388 | -// <EditableProTable<OrderStagesItem> | ||
389 | -// request={async (params) => { | ||
390 | -// if ( | ||
391 | -// params.id !== null || | ||
392 | -// params.contract !== null || | ||
393 | -// params.vendor !== null || | ||
394 | -// params.terminal !== null || | ||
395 | -// params.deviceName !== null || | ||
396 | -// params.dateRange !== null | ||
397 | -// ) { | ||
398 | -// let PostOrderErpOrderStagesSearchOption = { | ||
399 | -// id: params.id, | ||
400 | -// contract: params.contract, | ||
401 | -// vendor: params.vendor, | ||
402 | -// terminal: params.terminal, | ||
403 | -// deviceName: params.deviceName, | ||
404 | -// dateRange: params.dateRange, | ||
405 | -// }; | ||
406 | -// let res = await postOrderErpOrderStagesSearch({ | ||
407 | -// data: { ...PostOrderErpOrderStagesSearchOption }, | ||
408 | -// }); | ||
409 | -// await waitTime(2000); | ||
410 | -// if (res) { | ||
411 | -// // setTableItem(res.data) | ||
412 | -// const orderStagesWithList: OrderStagesWithListItem[] = res?.data; | ||
413 | -// let orderStagesList: OrderStagesItem[] = []; | ||
414 | -// for (let ind = 0; ind < orderStagesWithList.length; ind++) { | ||
415 | -// for ( | ||
416 | -// let index = 0; | ||
417 | -// index < orderStagesWithList[ind].orderStagesDeviceVoList.length; | ||
418 | -// index++ | ||
419 | -// ) { | ||
420 | -// let item: OrderStagesItem = { | ||
421 | -// id: undefined, | ||
422 | -// contract: undefined, | ||
423 | -// vendor: undefined, | ||
424 | -// dateRange: undefined, | ||
425 | -// terminal: undefined, | ||
426 | -// dId: undefined, | ||
427 | -// deviceName: undefined, | ||
428 | -// deviceModel: undefined, | ||
429 | -// count: undefined, | ||
430 | -// unitPrice: undefined, | ||
431 | -// price: undefined, | ||
432 | -// totalPrice: undefined, | ||
433 | -// payWay: undefined, | ||
434 | -// annex: undefined, | ||
435 | -// remark: undefined, | ||
436 | -// opt:undefined, | ||
437 | -// children:undefined | ||
438 | -// }; | ||
439 | -// if (index === 0) { | ||
440 | -// item.id = orderStagesWithList[ind].id; | ||
441 | -// item.contract = orderStagesWithList[ind].contract; | ||
442 | -// item.vendor = orderStagesWithList[ind].vendor; | ||
443 | -// item.dateRange = orderStagesWithList[ind].dateRange; | ||
444 | -// item.terminal = orderStagesWithList[ind].terminal; | ||
445 | -// item.dId = | ||
446 | -// orderStagesWithList[ind].orderStagesDeviceVoList[index].dId; | ||
447 | -// item.deviceName = | ||
448 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
449 | -// index | ||
450 | -// ].deviceName; | ||
451 | -// item.deviceModel = | ||
452 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
453 | -// index | ||
454 | -// ].deviceModel; | ||
455 | -// item.count = | ||
456 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
457 | -// index | ||
458 | -// ].count; | ||
459 | -// item.unitPrice = | ||
460 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
461 | -// index | ||
462 | -// ].unitPrice; | ||
463 | -// item.price = | ||
464 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
465 | -// index | ||
466 | -// ].price; | ||
467 | -// item.totalPrice = orderStagesWithList[ind].totalPrice; | ||
468 | -// item.payWay = orderStagesWithList[ind].payWay; | ||
469 | -// item.annex = orderStagesWithList[ind].annex; | ||
470 | -// item.remark = orderStagesWithList[ind].remark; | ||
471 | -// item.opt=orderStagesWithList[ind].paths | ||
472 | -// orderStagesList.push(item); | ||
473 | -// } else { | ||
474 | -// item.id = orderStagesWithList[ind].id; | ||
475 | -// item.contract = orderStagesWithList[ind].contract; | ||
476 | -// item.vendor = orderStagesWithList[ind].vendor; | ||
477 | -// item.dateRange = orderStagesWithList[ind].dateRange; | ||
478 | -// item.terminal = orderStagesWithList[ind].terminal; | ||
479 | -// item.dId = | ||
480 | -// orderStagesWithList[ind].orderStagesDeviceVoList[index].dId; | ||
481 | -// item.deviceName = | ||
482 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
483 | -// index | ||
484 | -// ].deviceName; | ||
485 | -// item.deviceModel = | ||
486 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
487 | -// index | ||
488 | -// ].deviceModel; | ||
489 | -// item.count = | ||
490 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
491 | -// index | ||
492 | -// ].count; | ||
493 | -// item.unitPrice = | ||
494 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
495 | -// index | ||
496 | -// ].unitPrice; | ||
497 | -// item.price = | ||
498 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
499 | -// index | ||
500 | -// ].price; | ||
501 | -// item.totalPrice = orderStagesWithList[ind].totalPrice; | ||
502 | -// item.payWay = orderStagesWithList[ind].payWay; | ||
503 | -// item.annex = orderStagesWithList[ind].annex; | ||
504 | -// item.remark = orderStagesWithList[ind].remark; | ||
505 | -// item.opt=orderStagesWithList[ind].paths | ||
506 | -// if (orderStagesList[ind]) { | ||
507 | -// orderStagesList[ind].children.push(item); | ||
508 | -// } | ||
509 | -// } | ||
510 | -// } | ||
511 | -// } | ||
512 | -// return { | ||
513 | -// data: orderStagesList || [], | ||
514 | -// }; | ||
515 | -// } | ||
516 | -// } else { | ||
517 | -// let res = await getOrderErpOrderStagesListAll(); | ||
518 | -// await waitTime(2000); | ||
519 | -// if (res) { | ||
520 | -// const orderStagesWithList: OrderStagesWithListItem[] = res?.data; | ||
521 | -// let orderStagesList: OrderStagesItem[] = []; | ||
522 | -// for (let ind = 0; ind < orderStagesWithList.length; ind++) { | ||
523 | -// for ( | ||
524 | -// let index = 0; | ||
525 | -// index < orderStagesWithList[ind].orderStagesDeviceVoList.length; | ||
526 | -// index++ | ||
527 | -// ) { | ||
528 | -// let item: OrderStagesItem = { | ||
529 | -// id: undefined, | ||
530 | -// contract: undefined, | ||
531 | -// vendor: undefined, | ||
532 | -// dateRange: undefined, | ||
533 | -// terminal: undefined, | ||
534 | -// dId: undefined, | ||
535 | -// deviceName: undefined, | ||
536 | -// deviceModel: undefined, | ||
537 | -// count: undefined, | ||
538 | -// unitPrice: undefined, | ||
539 | -// price: undefined, | ||
540 | -// totalPrice: undefined, | ||
541 | -// payWay: undefined, | ||
542 | -// annex: undefined, | ||
543 | -// remark: undefined, | ||
544 | -// opt:undefined, | ||
545 | -// children:[] | ||
546 | -// }; | ||
547 | -// if (index === 0) { | ||
548 | -// item.id = orderStagesWithList[ind].id; | ||
549 | -// item.contract = orderStagesWithList[ind].contract; | ||
550 | -// item.vendor = orderStagesWithList[ind].vendor; | ||
551 | -// item.dateRange = orderStagesWithList[ind].dateRange; | ||
552 | -// item.terminal = orderStagesWithList[ind].terminal; | ||
553 | -// item.dId = | ||
554 | -// orderStagesWithList[ind].orderStagesDeviceVoList[index].dId; | ||
555 | -// item.deviceName = | ||
556 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
557 | -// index | ||
558 | -// ].deviceName; | ||
559 | -// item.deviceModel = | ||
560 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
561 | -// index | ||
562 | -// ].deviceModel; | ||
563 | -// item.count = | ||
564 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
565 | -// index | ||
566 | -// ].count; | ||
567 | -// item.unitPrice = | ||
568 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
569 | -// index | ||
570 | -// ].unitPrice; | ||
571 | -// item.price = | ||
572 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
573 | -// index | ||
574 | -// ].price; | ||
575 | -// item.totalPrice = orderStagesWithList[ind].totalPrice; | ||
576 | -// item.payWay = orderStagesWithList[ind].payWay; | ||
577 | -// item.annex = orderStagesWithList[ind].annex; | ||
578 | -// item.remark = orderStagesWithList[ind].remark; | ||
579 | -// item.opt=orderStagesWithList[ind].paths | ||
580 | -// orderStagesList.push(item); | ||
581 | -// } else { | ||
582 | -// item.id = orderStagesWithList[ind].id; | ||
583 | -// item.contract = orderStagesWithList[ind].contract; | ||
584 | -// item.vendor = orderStagesWithList[ind].vendor; | ||
585 | -// item.dateRange = orderStagesWithList[ind].dateRange; | ||
586 | -// item.terminal = orderStagesWithList[ind].terminal; | ||
587 | -// item.dId = | ||
588 | -// orderStagesWithList[ind].orderStagesDeviceVoList[index].dId; | ||
589 | -// item.deviceName = | ||
590 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
591 | -// index | ||
592 | -// ].deviceName; | ||
593 | -// item.deviceModel = | ||
594 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
595 | -// index | ||
596 | -// ].deviceModel; | ||
597 | -// item.count = | ||
598 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
599 | -// index | ||
600 | -// ].count; | ||
601 | -// item.unitPrice = | ||
602 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
603 | -// index | ||
604 | -// ].unitPrice; | ||
605 | -// item.price = | ||
606 | -// orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
607 | -// index | ||
608 | -// ].price; | ||
609 | -// item.totalPrice = orderStagesWithList[ind].totalPrice; | ||
610 | -// item.payWay = orderStagesWithList[ind].payWay; | ||
611 | -// item.annex = orderStagesWithList[ind].annex; | ||
612 | -// item.remark = orderStagesWithList[ind].remark; | ||
613 | -// item.opt=orderStagesWithList[ind].paths | ||
614 | -// if (orderStagesList&&ind) { | ||
615 | -// orderStagesList[ind].children.push(item); | ||
616 | -// } | ||
617 | -// } | ||
618 | -// } | ||
619 | -// } | ||
620 | -// return { | ||
621 | -// data: orderStagesList || [], | ||
622 | -// }; | ||
623 | -// } | ||
624 | -// } | ||
625 | -// }} | ||
626 | -// /> | ||
627 | -// </> | ||
628 | -// ); | ||
629 | -// }; | 448 | + return ( |
449 | + <> | ||
450 | + <EditableProTable<OrderStagesItem> | ||
451 | + className="title-index" | ||
452 | + columnEmptyText="" | ||
453 | + columns={columns} | ||
454 | + cardBordered | ||
455 | + actionRef={ref} | ||
456 | + scroll={{ x: 1400, y: 360 }} | ||
457 | + recordCreatorProps={false} | ||
458 | + request={async (params) => { | ||
459 | + if ( | ||
460 | + params.id !== null || | ||
461 | + params.contract !== null || | ||
462 | + params.vendor !== null || | ||
463 | + params.terminal !== null || | ||
464 | + params.deviceName !== null || | ||
465 | + params.dateRange !== null || | ||
466 | + params.status !== null | ||
467 | + ) { | ||
468 | + let PostOrderErpOrderStagesSearchOption = { | ||
469 | + id: params.id, | ||
470 | + contract: params.contract, | ||
471 | + vendor: params.vendor, | ||
472 | + terminal: params.terminal, | ||
473 | + deviceName: params.deviceName, | ||
474 | + dateRange: params.dateRange, | ||
475 | + statusText: params.status, | ||
476 | + }; | ||
477 | + let res = await postOrderErpOrderStagesSearch({ | ||
478 | + data: { ...PostOrderErpOrderStagesSearchOption }, | ||
479 | + }); | ||
480 | + await waitTime(2000); | ||
481 | + if (res) { | ||
482 | + const orderStagesWithList: OrderStagesWithListItem[] = res?.data; | ||
483 | + let orderStagesList: OrderStagesItem[] = []; | ||
484 | + for (let ind = 0; ind < orderStagesWithList.length; ind++) { | ||
485 | + for ( | ||
486 | + let index = 0; | ||
487 | + index < | ||
488 | + orderStagesWithList[ind].orderStagesDeviceVoList.length; | ||
489 | + index++ | ||
490 | + ) { | ||
491 | + let item: OrderStagesItem = { | ||
492 | + id: undefined, | ||
493 | + contract: undefined, | ||
494 | + vendor: undefined, | ||
495 | + dateRange: undefined, | ||
496 | + terminal: undefined, | ||
497 | + dId: undefined, | ||
498 | + deviceName: undefined, | ||
499 | + deviceModel: undefined, | ||
500 | + count: undefined, | ||
501 | + unitPrice: undefined, | ||
502 | + price: undefined, | ||
503 | + totalPrice: undefined, | ||
504 | + payWay: undefined, | ||
505 | + annex: undefined, | ||
506 | + remark: undefined, | ||
507 | + opt: undefined, | ||
508 | + status: undefined, | ||
509 | + statusMark: undefined, | ||
510 | + }; | ||
511 | + if (index === 0) { | ||
512 | + item.id = orderStagesWithList[ind].id; | ||
513 | + item.contract = orderStagesWithList[ind].contract; | ||
514 | + item.vendor = orderStagesWithList[ind].vendor; | ||
515 | + item.dateRange = orderStagesWithList[ind].dateRange; | ||
516 | + item.terminal = orderStagesWithList[ind].terminal; | ||
517 | + item.dId = | ||
518 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
519 | + index | ||
520 | + ].dId; | ||
521 | + item.deviceName = | ||
522 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
523 | + index | ||
524 | + ].deviceName; | ||
525 | + item.deviceModel = | ||
526 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
527 | + index | ||
528 | + ].deviceModel; | ||
529 | + item.count = | ||
530 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
531 | + index | ||
532 | + ].count; | ||
533 | + item.unitPrice = | ||
534 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
535 | + index | ||
536 | + ].unitPrice; | ||
537 | + item.price = | ||
538 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
539 | + index | ||
540 | + ].price; | ||
541 | + item.totalPrice = orderStagesWithList[ind].totalPrice; | ||
542 | + item.payWay = orderStagesWithList[ind].payWay; | ||
543 | + item.annex = orderStagesWithList[ind].annex; | ||
544 | + item.remark = orderStagesWithList[ind].remark; | ||
545 | + item.status = orderStagesWithList[ind].status; | ||
546 | + item.statusMark = orderStagesWithList[ind].statusMark; | ||
547 | + if (orderStagesWithList[ind].paths) { | ||
548 | + item.opt = [...orderStagesWithList[ind].paths]; | ||
549 | + if (orderStagesWithList[ind]?.paths?.includes('READ')) { | ||
550 | + item.opt.push('ONLYREAD'); | ||
551 | + } | ||
552 | + } | ||
553 | + item.children = []; | ||
554 | + if ( | ||
555 | + orderStagesWithList[ind].orderStagesDeviceVoList.length <= | ||
556 | + 1 | ||
557 | + ) { | ||
558 | + delete item.children; | ||
559 | + } | ||
560 | + orderStagesList.push(item); | ||
561 | + } else { | ||
562 | + item.id = orderStagesWithList[ind].id; | ||
563 | + item.contract = orderStagesWithList[ind].contract; | ||
564 | + item.vendor = orderStagesWithList[ind].vendor; | ||
565 | + item.dateRange = orderStagesWithList[ind].dateRange; | ||
566 | + item.terminal = orderStagesWithList[ind].terminal; | ||
567 | + item.dId = | ||
568 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
569 | + index | ||
570 | + ].dId; | ||
571 | + item.deviceName = | ||
572 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
573 | + index | ||
574 | + ].deviceName; | ||
575 | + item.deviceModel = | ||
576 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
577 | + index | ||
578 | + ].deviceModel; | ||
579 | + item.count = | ||
580 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
581 | + index | ||
582 | + ].count; | ||
583 | + item.unitPrice = | ||
584 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
585 | + index | ||
586 | + ].unitPrice; | ||
587 | + item.price = | ||
588 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
589 | + index | ||
590 | + ].price; | ||
591 | + item.totalPrice = orderStagesWithList[ind].totalPrice; | ||
592 | + item.payWay = orderStagesWithList[ind].payWay; | ||
593 | + item.annex = orderStagesWithList[ind].annex; | ||
594 | + item.remark = orderStagesWithList[ind].remark; | ||
595 | + if (orderStagesWithList[ind].paths) { | ||
596 | + if (orderStagesList[ind]?.opt?.includes('READ')) { | ||
597 | + item.opt = ['ONLYREAD']; | ||
598 | + } | ||
599 | + } | ||
600 | + item.status = orderStagesWithList[ind].status; | ||
601 | + item.statusMark = orderStagesWithList[ind].statusMark; | ||
602 | + if ( | ||
603 | + orderStagesWithList[ind].orderStagesDeviceVoList.length > | ||
604 | + 1 | ||
605 | + ) { | ||
606 | + orderStagesList[ind].children?.push(item); | ||
607 | + } | ||
608 | + } | ||
609 | + } | ||
610 | + } | ||
611 | + return { | ||
612 | + data: orderStagesList || [], | ||
613 | + }; | ||
614 | + } | ||
615 | + } else { | ||
616 | + let res = await getOrderErpOrderStagesListAll(); | ||
617 | + await waitTime(2000); | ||
618 | + if (res) { | ||
619 | + const orderStagesWithList: OrderStagesWithListItem[] = res?.data; | ||
620 | + let orderStagesList: OrderStagesItem[] = []; | ||
621 | + for (let ind = 0; ind < orderStagesWithList.length; ind++) { | ||
622 | + for ( | ||
623 | + let index = 0; | ||
624 | + index < | ||
625 | + orderStagesWithList[ind].orderStagesDeviceVoList.length; | ||
626 | + index++ | ||
627 | + ) { | ||
628 | + let item: OrderStagesItem = { | ||
629 | + id: undefined, | ||
630 | + contract: undefined, | ||
631 | + vendor: undefined, | ||
632 | + dateRange: undefined, | ||
633 | + terminal: undefined, | ||
634 | + dId: undefined, | ||
635 | + deviceName: undefined, | ||
636 | + deviceModel: undefined, | ||
637 | + count: undefined, | ||
638 | + unitPrice: undefined, | ||
639 | + price: undefined, | ||
640 | + totalPrice: undefined, | ||
641 | + payWay: undefined, | ||
642 | + annex: undefined, | ||
643 | + remark: undefined, | ||
644 | + opt: undefined, | ||
645 | + children: undefined, | ||
646 | + status: undefined, | ||
647 | + statusMark: undefined, | ||
648 | + }; | ||
649 | + if (index === 0) { | ||
650 | + item.id = orderStagesWithList[ind].id; | ||
651 | + item.contract = orderStagesWithList[ind].contract; | ||
652 | + item.vendor = orderStagesWithList[ind].vendor; | ||
653 | + item.dateRange = orderStagesWithList[ind].dateRange; | ||
654 | + item.terminal = orderStagesWithList[ind].terminal; | ||
655 | + item.dId = | ||
656 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
657 | + index | ||
658 | + ].dId; | ||
659 | + item.deviceName = | ||
660 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
661 | + index | ||
662 | + ].deviceName; | ||
663 | + item.deviceModel = | ||
664 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
665 | + index | ||
666 | + ].deviceModel; | ||
667 | + item.count = | ||
668 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
669 | + index | ||
670 | + ].count; | ||
671 | + item.unitPrice = | ||
672 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
673 | + index | ||
674 | + ].unitPrice; | ||
675 | + item.price = | ||
676 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
677 | + index | ||
678 | + ].price; | ||
679 | + item.totalPrice = orderStagesWithList[ind].totalPrice; | ||
680 | + item.payWay = orderStagesWithList[ind].payWay; | ||
681 | + item.annex = orderStagesWithList[ind].annex; | ||
682 | + item.remark = orderStagesWithList[ind].remark; | ||
683 | + item.opt = orderStagesWithList[ind].paths; | ||
684 | + item.status = orderStagesWithList[ind].status; | ||
685 | + item.statusMark = orderStagesWithList[ind].statusMark; | ||
686 | + if (orderStagesWithList[ind].paths) { | ||
687 | + item.opt = [...orderStagesWithList[ind].paths]; | ||
688 | + if (orderStagesWithList[ind]?.paths?.includes('READ')) { | ||
689 | + item.opt.push('ONLYREAD'); | ||
690 | + } | ||
691 | + } | ||
692 | + if ( | ||
693 | + orderStagesWithList[ind].orderStagesDeviceVoList.length <= | ||
694 | + 1 | ||
695 | + ) { | ||
696 | + delete item.children; | ||
697 | + } | ||
698 | + orderStagesList.push(item); | ||
699 | + } else { | ||
700 | + item.id = orderStagesWithList[ind].id; | ||
701 | + item.contract = orderStagesWithList[ind].contract; | ||
702 | + item.vendor = orderStagesWithList[ind].vendor; | ||
703 | + item.dateRange = orderStagesWithList[ind].dateRange; | ||
704 | + item.terminal = orderStagesWithList[ind].terminal; | ||
705 | + item.dId = | ||
706 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
707 | + index | ||
708 | + ].dId; | ||
709 | + item.deviceName = | ||
710 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
711 | + index | ||
712 | + ].deviceName; | ||
713 | + item.deviceModel = | ||
714 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
715 | + index | ||
716 | + ].deviceModel; | ||
717 | + item.count = | ||
718 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
719 | + index | ||
720 | + ].count; | ||
721 | + item.unitPrice = | ||
722 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
723 | + index | ||
724 | + ].unitPrice; | ||
725 | + item.price = | ||
726 | + orderStagesWithList[ind].orderStagesDeviceVoList[ | ||
727 | + index | ||
728 | + ].price; | ||
729 | + item.totalPrice = orderStagesWithList[ind].totalPrice; | ||
730 | + item.payWay = orderStagesWithList[ind].payWay; | ||
731 | + item.annex = orderStagesWithList[ind].annex; | ||
732 | + item.remark = orderStagesWithList[ind].remark; | ||
733 | + if (orderStagesWithList[ind].paths) { | ||
734 | + if (orderStagesList[ind].opt?.includes('READ')) { | ||
735 | + item.opt = ['ONLYREAD']; | ||
736 | + } | ||
737 | + } | ||
738 | + item.status = orderStagesWithList[ind].status; | ||
739 | + item.statusMark = orderStagesWithList[ind].statusMark; | ||
740 | + if ( | ||
741 | + orderStagesWithList[ind].orderStagesDeviceVoList.length > | ||
742 | + 1 | ||
743 | + ) { | ||
744 | + orderStagesList[ind].children?.push(item); | ||
745 | + } | ||
746 | + } | ||
747 | + } | ||
748 | + } | ||
749 | + return { | ||
750 | + data: orderStagesList || [], | ||
751 | + }; | ||
752 | + } | ||
753 | + } | ||
754 | + }} | ||
755 | + editable={{ | ||
756 | + type: 'multiple', | ||
757 | + }} | ||
758 | + columnsState={{ | ||
759 | + persistenceKey: 'pro-table-singe-demos', | ||
760 | + persistenceType: 'localStorage', | ||
761 | + defaultValue: { | ||
762 | + option: { fixed: 'right', disable: true }, | ||
763 | + }, | ||
764 | + }} | ||
765 | + rowKey="dId" | ||
766 | + search={{ | ||
767 | + labelWidth: 'auto', | ||
768 | + }} | ||
769 | + options={{ | ||
770 | + setting: { | ||
771 | + listsHeight: 800, | ||
772 | + }, | ||
773 | + }} | ||
774 | + form={{ | ||
775 | + syncToUrl: (values, type) => { | ||
776 | + if (type === 'get') { | ||
777 | + return { | ||
778 | + ...values, | ||
779 | + created_at: [values.startTime, values.endTime], | ||
780 | + }; | ||
781 | + } | ||
782 | + return values; | ||
783 | + }, | ||
784 | + }} | ||
785 | + pagination={{ | ||
786 | + pageSize: 10, | ||
787 | + // onChange: (page) => console.log(page), | ||
788 | + }} | ||
789 | + dateFormatter="string" | ||
790 | + headerTitle={[]} | ||
791 | + toolBarRender={() => [ | ||
792 | + <> | ||
793 | + <AddModel toReload={reload}></AddModel> | ||
794 | + <UploadModel toReload={reload}></UploadModel> | ||
795 | + <Button | ||
796 | + type="primary" | ||
797 | + onClick={() => { | ||
798 | + toExport(); | ||
799 | + }} | ||
800 | + > | ||
801 | + <VerticalAlignTopOutlined /> | ||
802 | + 导出 | ||
803 | + </Button> | ||
804 | + </>, | ||
805 | + ]} | ||
806 | + /> | ||
807 | + </> | ||
808 | + ); | ||
809 | +}; |
src/pages/Instalment/index.tsx
1 | -import Title from './components/title/title'; | 1 | +// import Title from './components/title/title'; |
2 | +import Titletest from './components/title/titletest'; | ||
2 | 3 | ||
3 | const instalment_contect: React.FC = () => ( | 4 | const instalment_contect: React.FC = () => ( |
4 | <> | 5 | <> |
5 | - <Title /> | 6 | + {/* <Title /> */} |
7 | + <Titletest /> | ||
6 | </> | 8 | </> |
7 | ); | 9 | ); |
8 | 10 |
src/services/definition.ts
@@ -1381,32 +1381,6 @@ export interface Entry { | @@ -1381,32 +1381,6 @@ export interface Entry { | ||
1381 | unEmpInsuranceC?: string; | 1381 | unEmpInsuranceC?: string; |
1382 | } | 1382 | } |
1383 | 1383 | ||
1384 | -export interface File { | ||
1385 | - absolute?: boolean; | ||
1386 | - absoluteFile?: File; | ||
1387 | - absolutePath?: string; | ||
1388 | - canonicalFile?: File; | ||
1389 | - canonicalPath?: string; | ||
1390 | - directory?: boolean; | ||
1391 | - executable?: boolean; | ||
1392 | - file?: boolean; | ||
1393 | - /** @format int64 */ | ||
1394 | - freeSpace?: number; | ||
1395 | - hidden?: boolean; | ||
1396 | - /** @format int64 */ | ||
1397 | - lastModified?: number; | ||
1398 | - name?: string; | ||
1399 | - parent?: string; | ||
1400 | - parentFile?: File; | ||
1401 | - path?: string; | ||
1402 | - readable?: boolean; | ||
1403 | - /** @format int64 */ | ||
1404 | - totalSpace?: number; | ||
1405 | - /** @format int64 */ | ||
1406 | - usableSpace?: number; | ||
1407 | - writable?: boolean; | ||
1408 | -} | ||
1409 | - | ||
1410 | export interface FilePathDto { | 1384 | export interface FilePathDto { |
1411 | url?: string; | 1385 | url?: string; |
1412 | } | 1386 | } |
@@ -2429,39 +2403,47 @@ export interface OrderStagesDeviceDo { | @@ -2429,39 +2403,47 @@ export interface OrderStagesDeviceDo { | ||
2429 | export interface OrderStagesFromDo { | 2403 | export interface OrderStagesFromDo { |
2430 | annex?: string; | 2404 | annex?: string; |
2431 | contract?: string; | 2405 | contract?: string; |
2432 | - createByName?: string; | 2406 | + createBy?: string; |
2433 | /** @format date-time */ | 2407 | /** @format date-time */ |
2434 | createTime?: string; | 2408 | createTime?: string; |
2435 | /** @format date-time */ | 2409 | /** @format date-time */ |
2436 | dateRange?: string; | 2410 | dateRange?: string; |
2437 | /** @format int32 */ | 2411 | /** @format int32 */ |
2412 | + enableFlag?: number; | ||
2413 | + /** @format int32 */ | ||
2438 | id?: number; | 2414 | id?: number; |
2439 | - logicDelete?: boolean; | 2415 | + modifyBy?: string; |
2416 | + /** @format date-time */ | ||
2417 | + modifyTime?: string; | ||
2440 | orderStagesDeviceDoList?: Array<OrderStagesDeviceDo>; | 2418 | orderStagesDeviceDoList?: Array<OrderStagesDeviceDo>; |
2441 | payWay?: string; | 2419 | payWay?: string; |
2442 | remark?: string; | 2420 | remark?: string; |
2443 | terminal?: string; | 2421 | terminal?: string; |
2444 | /** @format double */ | 2422 | /** @format double */ |
2445 | totalPrice?: number; | 2423 | totalPrice?: number; |
2446 | - updateByName?: string; | ||
2447 | - /** @format date-time */ | ||
2448 | - updateTime?: string; | ||
2449 | vendor?: string; | 2424 | vendor?: string; |
2450 | /** @format int32 */ | 2425 | /** @format int32 */ |
2451 | version?: number; | 2426 | version?: number; |
2452 | } | 2427 | } |
2453 | 2428 | ||
2454 | export interface OrderStagesPayWay { | 2429 | export interface OrderStagesPayWay { |
2430 | + createByName?: string; | ||
2431 | + /** @format date-time */ | ||
2432 | + createTime?: string; | ||
2455 | /** @format date-time */ | 2433 | /** @format date-time */ |
2456 | dateRange?: string; | 2434 | dateRange?: string; |
2457 | fileName?: string; | 2435 | fileName?: string; |
2458 | fileUrl?: string; | 2436 | fileUrl?: string; |
2459 | /** @format int32 */ | 2437 | /** @format int32 */ |
2460 | id?: number; | 2438 | id?: number; |
2439 | + logicDelete?: boolean; | ||
2461 | /** @format int32 */ | 2440 | /** @format int32 */ |
2462 | number?: number; | 2441 | number?: number; |
2463 | /** @format int32 */ | 2442 | /** @format int32 */ |
2464 | ossId?: number; | 2443 | ossId?: number; |
2444 | + updateByName?: string; | ||
2445 | + /** @format date-time */ | ||
2446 | + updateTime?: string; | ||
2465 | } | 2447 | } |
2466 | 2448 | ||
2467 | export interface OrderStagesPayWayDo { | 2449 | export interface OrderStagesPayWayDo { |
@@ -2475,11 +2457,14 @@ export interface OrderStagesPayWayFileDo { | @@ -2475,11 +2457,14 @@ export interface OrderStagesPayWayFileDo { | ||
2475 | 2457 | ||
2476 | export interface OrderStagesSelDo { | 2458 | export interface OrderStagesSelDo { |
2477 | contract?: string; | 2459 | contract?: string; |
2460 | + createName?: string; | ||
2478 | /** @format date-time */ | 2461 | /** @format date-time */ |
2479 | dateRange?: string; | 2462 | dateRange?: string; |
2480 | deviceName?: string; | 2463 | deviceName?: string; |
2481 | /** @format int64 */ | 2464 | /** @format int64 */ |
2482 | id?: number; | 2465 | id?: number; |
2466 | + /** @format int32 */ | ||
2467 | + status?: number; | ||
2483 | terminal?: string; | 2468 | terminal?: string; |
2484 | vendor?: string; | 2469 | vendor?: string; |
2485 | } | 2470 | } |
@@ -3535,7 +3520,7 @@ export interface ResetPwdVO { | @@ -3535,7 +3520,7 @@ export interface ResetPwdVO { | ||
3535 | 3520 | ||
3536 | export interface Resource { | 3521 | export interface Resource { |
3537 | description?: string; | 3522 | description?: string; |
3538 | - file?: File; | 3523 | + file?: TsgFile; |
3539 | filename?: string; | 3524 | filename?: string; |
3540 | inputStream?: InputStream; | 3525 | inputStream?: InputStream; |
3541 | open?: boolean; | 3526 | open?: boolean; |
@@ -4061,6 +4046,32 @@ export interface CompanyInfo { | @@ -4061,6 +4046,32 @@ export interface CompanyInfo { | ||
4061 | taxIdIsNotNull?: boolean; | 4046 | taxIdIsNotNull?: boolean; |
4062 | } | 4047 | } |
4063 | 4048 | ||
4049 | +export interface TsgFile { | ||
4050 | + absolute?: boolean; | ||
4051 | + absoluteFile?: TsgFile; | ||
4052 | + absolutePath?: string; | ||
4053 | + canonicalFile?: TsgFile; | ||
4054 | + canonicalPath?: string; | ||
4055 | + directory?: boolean; | ||
4056 | + executable?: boolean; | ||
4057 | + file?: boolean; | ||
4058 | + /** @format int64 */ | ||
4059 | + freeSpace?: number; | ||
4060 | + hidden?: boolean; | ||
4061 | + /** @format int64 */ | ||
4062 | + lastModified?: number; | ||
4063 | + name?: string; | ||
4064 | + parent?: string; | ||
4065 | + parentFile?: TsgFile; | ||
4066 | + path?: string; | ||
4067 | + readable?: boolean; | ||
4068 | + /** @format int64 */ | ||
4069 | + totalSpace?: number; | ||
4070 | + /** @format int64 */ | ||
4071 | + usableSpace?: number; | ||
4072 | + writable?: boolean; | ||
4073 | +} | ||
4074 | + | ||
4064 | export interface InvoiceDetail { | 4075 | export interface InvoiceDetail { |
4065 | /** @format int64 */ | 4076 | /** @format int64 */ |
4066 | id?: number; | 4077 | id?: number; |
src/services/request.ts
@@ -8077,7 +8077,7 @@ export type PostOrderErpOrderStagesAddResponseSuccess = | @@ -8077,7 +8077,7 @@ export type PostOrderErpOrderStagesAddResponseSuccess = | ||
8077 | PostOrderErpOrderStagesAddResponse[200]; | 8077 | PostOrderErpOrderStagesAddResponse[200]; |
8078 | /** | 8078 | /** |
8079 | * @description | 8079 | * @description |
8080 | - * 添加或者修改分期账单 | 8080 | + * 添加分期账单 |
8081 | * @tags order-stages-controller | 8081 | * @tags order-stages-controller |
8082 | * @produces * | 8082 | * @produces * |
8083 | * @consumes application/json | 8083 | * @consumes application/json |
@@ -8101,6 +8101,74 @@ export const postOrderErpOrderStagesAdd = /* #__PURE__ */ (() => { | @@ -8101,6 +8101,74 @@ export const postOrderErpOrderStagesAdd = /* #__PURE__ */ (() => { | ||
8101 | return request; | 8101 | return request; |
8102 | })(); | 8102 | })(); |
8103 | 8103 | ||
8104 | +/** @description request parameter type for postOrderErpOrderStagesCheckOrderStages */ | ||
8105 | +export interface PostOrderErpOrderStagesCheckOrderStagesOption { | ||
8106 | + /** @format int32 */ | ||
8107 | + query?: { | ||
8108 | + /** | ||
8109 | + @format int32 */ | ||
8110 | + id?: number; | ||
8111 | + isPass?: boolean; | ||
8112 | + }; | ||
8113 | +} | ||
8114 | + | ||
8115 | +/** @description response type for postOrderErpOrderStagesCheckOrderStages */ | ||
8116 | +export interface PostOrderErpOrderStagesCheckOrderStagesResponse { | ||
8117 | + /** | ||
8118 | + * @description | ||
8119 | + * OK | ||
8120 | + */ | ||
8121 | + 200: ServerResult; | ||
8122 | + /** | ||
8123 | + * @description | ||
8124 | + * Created | ||
8125 | + */ | ||
8126 | + 201: any; | ||
8127 | + /** | ||
8128 | + * @description | ||
8129 | + * Unauthorized | ||
8130 | + */ | ||
8131 | + 401: any; | ||
8132 | + /** | ||
8133 | + * @description | ||
8134 | + * Forbidden | ||
8135 | + */ | ||
8136 | + 403: any; | ||
8137 | + /** | ||
8138 | + * @description | ||
8139 | + * Not Found | ||
8140 | + */ | ||
8141 | + 404: any; | ||
8142 | +} | ||
8143 | + | ||
8144 | +export type PostOrderErpOrderStagesCheckOrderStagesResponseSuccess = | ||
8145 | + PostOrderErpOrderStagesCheckOrderStagesResponse[200]; | ||
8146 | +/** | ||
8147 | + * @description | ||
8148 | + * 对分期账单审核 | ||
8149 | + * @tags order-stages-controller | ||
8150 | + * @produces * | ||
8151 | + * @consumes application/json | ||
8152 | + */ | ||
8153 | +export const postOrderErpOrderStagesCheckOrderStages = /* #__PURE__ */ (() => { | ||
8154 | + const method = 'post'; | ||
8155 | + const url = '/order/erp/orderStages/checkOrderStages'; | ||
8156 | + function request( | ||
8157 | + option?: PostOrderErpOrderStagesCheckOrderStagesOption, | ||
8158 | + ): Promise<PostOrderErpOrderStagesCheckOrderStagesResponseSuccess> { | ||
8159 | + return requester(request.url, { | ||
8160 | + method: request.method, | ||
8161 | + ...option, | ||
8162 | + }) as unknown as Promise<PostOrderErpOrderStagesCheckOrderStagesResponseSuccess>; | ||
8163 | + } | ||
8164 | + | ||
8165 | + /** http method */ | ||
8166 | + request.method = method; | ||
8167 | + /** request url */ | ||
8168 | + request.url = url; | ||
8169 | + return request; | ||
8170 | +})(); | ||
8171 | + | ||
8104 | /** @description request parameter type for deleteOrderErpOrderStagesDelect */ | 8172 | /** @description request parameter type for deleteOrderErpOrderStagesDelect */ |
8105 | export interface DeleteOrderErpOrderStagesDelectOption { | 8173 | export interface DeleteOrderErpOrderStagesDelectOption { |
8106 | /** | 8174 | /** |
@@ -8172,7 +8240,7 @@ export interface GetOrderErpOrderStagesExportResponse { | @@ -8172,7 +8240,7 @@ export interface GetOrderErpOrderStagesExportResponse { | ||
8172 | * @description | 8240 | * @description |
8173 | * OK | 8241 | * OK |
8174 | */ | 8242 | */ |
8175 | - 200: any; | 8243 | + 200: ServerResult; |
8176 | /** | 8244 | /** |
8177 | * @description | 8245 | * @description |
8178 | * Unauthorized | 8246 | * Unauthorized |
src/utils/index.ts
@@ -17,7 +17,6 @@ export function enum2ReverseSelect(data: any) { | @@ -17,7 +17,6 @@ export function enum2ReverseSelect(data: any) { | ||
17 | 17 | ||
18 | //将枚举的value值转换为label | 18 | //将枚举的value值转换为label |
19 | function enumValueToLabel(value: any, enumObj: any) { | 19 | function enumValueToLabel(value: any, enumObj: any) { |
20 | - console.log(value, enumObj); | ||
21 | if (enumObj !== undefined) { | 20 | if (enumObj !== undefined) { |
22 | return enumObj[value]; | 21 | return enumObj[value]; |
23 | } | 22 | } |