Commit cc61036e047c2da52ca572322d5aa09e3c60b59e
1 parent
3fca9d3d
分期账单
Showing
16 changed files
with
1896 additions
and
125 deletions
src/pages/Instalment/components/comfire/comfire.tsx
0 → 100644
1 | +import { PlusOutlined } from '@ant-design/icons'; | |
2 | +import { | |
3 | + ModalForm, | |
4 | + ProForm, | |
5 | + ProFormDateRangePicker, | |
6 | + ProFormSelect, | |
7 | + ProFormText, | |
8 | +} from '@ant-design/pro-components'; | |
9 | +import { Button, Form, message } from 'antd'; | |
10 | +import { useState } from 'react'; | |
11 | + | |
12 | +const waitTime = (time: number = 100) => { | |
13 | + return new Promise((resolve) => { | |
14 | + setTimeout(() => { | |
15 | + resolve(true); | |
16 | + }, time); | |
17 | + }); | |
18 | +}; | |
19 | + | |
20 | +export default ({currtDid,sureDelete}) => { | |
21 | + const [form] = Form.useForm<{ name: string; company: string }>(); | |
22 | + const [ids,setIds]=useState([]); | |
23 | + | |
24 | + function getIds(){ | |
25 | + // console.log(currtDid); | |
26 | + setIds([]) | |
27 | + setIds(currtDid) | |
28 | + } | |
29 | + return ( | |
30 | + <ModalForm<{ | |
31 | + name: string; | |
32 | + company: string; | |
33 | + }> | |
34 | + trigger={ | |
35 | + <a onClick={()=>{getIds()}}> | |
36 | + 删除 | |
37 | + </a> | |
38 | + } | |
39 | + form={form} | |
40 | + autoFocusFirstInput | |
41 | + width={190} | |
42 | + modalProps={{ | |
43 | + destroyOnClose: true, | |
44 | + // onCancel: () => console.log('run'), | |
45 | + }} | |
46 | + onFinish={async (values) => { | |
47 | + await waitTime(100); | |
48 | + sureDelete([ids]); | |
49 | + // console.log(values.name); | |
50 | + message.success('提交成功'); | |
51 | + return true; | |
52 | + }} | |
53 | + > | |
54 | + <br/> | |
55 | + <h2>确定删除吗</h2> | |
56 | + </ModalForm> | |
57 | + ); | |
58 | +}; | |
0 | 59 | \ No newline at end of file | ... | ... |
src/pages/Instalment/components/detail/detail.tsx
... | ... | @@ -12,7 +12,7 @@ import ProductDetail from '../productDetail/productDetail'; |
12 | 12 | import PayWayDetail from '../payWayDetail/payWayDetail'; |
13 | 13 | import { Button, Form,message } from 'antd'; |
14 | 14 | import { useEffect,useState } from 'react'; |
15 | -import { postOrderErpOrderStagesPayWaySaveOrUpdate, postOrderErpOrderStagesSaveOrUpdate, postOrderErpOrderStagesSearch, postOrderErpOrderStagesUpload } from '@/services'; | |
15 | +import { postOrderErpOrderStagesAdd, postOrderErpOrderStagesPayWaySaveOrUpdate, postOrderErpOrderStagesSaveOrUpdate, postOrderErpOrderStagesSearch, postOrderErpOrderStagesUpload } from '@/services'; | |
16 | 16 | import { RcFile } from 'antd/es/upload'; |
17 | 17 | |
18 | 18 | const waitTime = (time: number = 100) => { |
... | ... | @@ -23,7 +23,7 @@ const waitTime = (time: number = 100) => { |
23 | 23 | }); |
24 | 24 | }; |
25 | 25 | |
26 | -export default ({ toReload }) => { | |
26 | +export default ({ toReload}) => { | |
27 | 27 | const [form] = Form.useForm<{ name: string; company: string }>(); |
28 | 28 | const [contextBody, setContextBody] = useState<OrderStagesWithListItem>({ |
29 | 29 | id:undefined, |
... | ... | @@ -42,7 +42,6 @@ export default ({ toReload }) => { |
42 | 42 | const [otherBody, setOtherBody] = useState([]) |
43 | 43 | const [isDis,setIsDis]=useState(true) |
44 | 44 | |
45 | - | |
46 | 45 | type OrderStagesWithListItem = { |
47 | 46 | //文件编号 |
48 | 47 | id?: number; |
... | ... | @@ -81,7 +80,7 @@ export default ({ toReload }) => { |
81 | 80 | } |
82 | 81 | |
83 | 82 | function getEditProductBody(value) { |
84 | - console.log(value); | |
83 | + // console.log(value); | |
85 | 84 | |
86 | 85 | setEditProductBody(value) |
87 | 86 | let price = 0; |
... | ... | @@ -98,7 +97,7 @@ export default ({ toReload }) => { |
98 | 97 | } |
99 | 98 | [] |
100 | 99 | function setSave(value) { |
101 | - console.log(value); | |
100 | + // console.log(value); | |
102 | 101 | setOtherBody(value) |
103 | 102 | } |
104 | 103 | |
... | ... | @@ -143,6 +142,21 @@ export default ({ toReload }) => { |
143 | 142 | } |
144 | 143 | }; |
145 | 144 | |
145 | + function refresh(){ | |
146 | + setContextBody({ | |
147 | + id:undefined, | |
148 | + contract:undefined, | |
149 | + dateRange:undefined, | |
150 | + terminal:undefined, | |
151 | + orderStagesDeviceVoList:[], | |
152 | + totalPrice:undefined, | |
153 | + payWay:"30/30/30/10", | |
154 | + annex:undefined, | |
155 | + remark:undefined | |
156 | + }) | |
157 | + handleInputChange("30/30/30/10",0,0) | |
158 | + } | |
159 | + | |
146 | 160 | return ( |
147 | 161 | <ModalForm<OrderStagesWithListItem> |
148 | 162 | title="新建" |
... | ... | @@ -151,6 +165,7 @@ export default ({ toReload }) => { |
151 | 165 | key="button" |
152 | 166 | icon={<PlusOutlined />} |
153 | 167 | type="primary" |
168 | + onClick={()=>refresh()} | |
154 | 169 | > |
155 | 170 | 新增 |
156 | 171 | </Button> |
... | ... | @@ -159,15 +174,21 @@ export default ({ toReload }) => { |
159 | 174 | autoFocusFirstInput |
160 | 175 | modalProps={{ |
161 | 176 | destroyOnClose: true, |
162 | - onCancel: () => console.log('run'), | |
163 | - }} | |
164 | - onChange={(value) => { | |
165 | - console.log(value); | |
177 | + // onCancel: () => console.log('run'), | |
166 | 178 | }} |
179 | + // onChange={(e) => { | |
180 | + // console.log(e); | |
181 | + | |
182 | + // console.log(e.target.value); | |
183 | + // }} | |
167 | 184 | submitTimeout={2000} |
168 | 185 | onFinish={async (values) => { |
169 | - console.log(values); | |
170 | - console.log(otherBody); | |
186 | + if (editProductBody.length==0) { | |
187 | + message.error("请填写产品数据") | |
188 | + return false; | |
189 | + } | |
190 | + // console.log(values); | |
191 | + // console.log(otherBody); | |
171 | 192 | let remakeValue = []; |
172 | 193 | let remakeItem = {} |
173 | 194 | |
... | ... | @@ -195,12 +216,12 @@ export default ({ toReload }) => { |
195 | 216 | } |
196 | 217 | }); |
197 | 218 | if (res.data) { |
198 | - console.log(values) | |
199 | - console.log(contextBody); | |
219 | + // console.log(values) | |
220 | + // console.log(contextBody); | |
200 | 221 | toSendEdit.annex = res.data |
201 | 222 | } |
202 | 223 | } |
203 | - const isSaveOrUpdate = await postOrderErpOrderStagesSaveOrUpdate({ | |
224 | + const isSaveOrUpdate = await postOrderErpOrderStagesAdd({ | |
204 | 225 | data: { ...toSendEdit } |
205 | 226 | }) |
206 | 227 | |
... | ... | @@ -241,7 +262,7 @@ export default ({ toReload }) => { |
241 | 262 | return { ...item, ossId: returnOssID.data[0].id }; |
242 | 263 | }); |
243 | 264 | |
244 | - console.log(makeEnd); | |
265 | + // console.log(makeEnd); | |
245 | 266 | } |
246 | 267 | } |
247 | 268 | |
... | ... | @@ -250,12 +271,12 @@ export default ({ toReload }) => { |
250 | 271 | // 使用Promise.all等待所有异步操作完成后再执行保存操作 |
251 | 272 | Promise.all(promises).then( |
252 | 273 | async () => { |
253 | - console.log(makeEnd); | |
274 | + // console.log(makeEnd); | |
254 | 275 | await postOrderErpOrderStagesPayWaySaveOrUpdate({ |
255 | 276 | data: makeEnd |
256 | 277 | }); |
257 | 278 | }); |
258 | - console.log(isSaveOrUpdate); | |
279 | + // console.log(isSaveOrUpdate); | |
259 | 280 | toReload() |
260 | 281 | } |
261 | 282 | await waitTime(2000); |
... | ... | @@ -306,10 +327,10 @@ export default ({ toReload }) => { |
306 | 327 | placeholder="请输入" |
307 | 328 | initialValue={contextBody.payWay} |
308 | 329 | disabled={!isDis} |
309 | - // onBlur={(e) => { | |
310 | - // setContextBody({...contextBody,payWay:e.target.value}) | |
311 | - // handleInputChange(e.target.value, 1); | |
312 | - // }} | |
330 | + onBlur={(e) => { | |
331 | + setContextBody({...contextBody,payWay:e.target.value}) | |
332 | + handleInputChange(e.target.value, 1); | |
333 | + }} | |
313 | 334 | /> |
314 | 335 | |
315 | 336 | <ProFormText |
... | ... | @@ -325,7 +346,7 @@ export default ({ toReload }) => { |
325 | 346 | name="annex" |
326 | 347 | max={1} |
327 | 348 | onChange={(value) => { |
328 | - console.log(value); | |
349 | + // console.log(value); | |
329 | 350 | }} |
330 | 351 | label="合同附件" /> |
331 | 352 | |
... | ... | @@ -350,7 +371,7 @@ export default ({ toReload }) => { |
350 | 371 | </ProForm.Group> |
351 | 372 | </ProCard> |
352 | 373 | <ProCard |
353 | - title="产品明细" | |
374 | + title={<><span style={{ color: 'red' }}>*</span>产品明细</>} | |
354 | 375 | style={{ marginTop: 10 }} |
355 | 376 | headerBordered |
356 | 377 | bordered | ... | ... |
src/pages/Instalment/components/edit/edit.tsx
1 | +import { PlusOutlined } from '@ant-design/icons'; | |
1 | 2 | import { |
2 | 3 | ModalForm, |
3 | 4 | ProCard, |
4 | 5 | ProForm, |
5 | 6 | ProFormDatePicker, |
7 | + ProFormDateRangePicker, | |
8 | + ProFormDependency, | |
9 | + ProFormSelect, | |
6 | 10 | ProFormText, |
7 | 11 | ProFormTextArea, |
8 | 12 | ProFormUploadButton, |
9 | 13 | } from '@ant-design/pro-components'; |
10 | 14 | import ProductDetail from '../productDetail/productDetail'; |
11 | 15 | import PayWayDetail from '../payWayDetail/payWayDetail'; |
12 | -import { Form,message } from 'antd'; | |
13 | -import { useEffect, useState } from 'react'; | |
14 | -import { postOrderErpOrderStagesPayWaySaveOrUpdate, postOrderErpOrderStagesSaveOrUpdate, postOrderErpOrderStagesSearch, postOrderErpOrderStagesUpload } from '@/services'; | |
16 | +import { Button, Form, UploadProps, message } from 'antd'; | |
17 | +import Item from 'antd/es/list/Item'; | |
18 | +import { useEffect, useRef, useState } from 'react'; | |
19 | +import { postOrderErpOrderStagesPayWaySaveOrUpdate, postOrderErpOrderStagesPayWayUploadForPayWay, postOrderErpOrderStagesSaveOrUpdate, postOrderErpOrderStagesSearch, postOrderErpOrderStagesUpload, postServiceOrderFileProcess } from '@/services'; | |
20 | +import { context } from '@/.umi/core/helmetContext'; | |
15 | 21 | import { RcFile } from 'antd/es/upload'; |
16 | 22 | |
17 | 23 | const waitTime = (time: number = 100) => { |
... | ... | @@ -22,7 +28,7 @@ const waitTime = (time: number = 100) => { |
22 | 28 | }); |
23 | 29 | }; |
24 | 30 | |
25 | -export default ({ currentContract,toReload }) => { | |
31 | +export default ({ currentContract, toReload }) => { | |
26 | 32 | const [form] = Form.useForm<{ name: string; company: string }>(); |
27 | 33 | const [contextBody, setContextBody] = useState({}); |
28 | 34 | const [editProductBody, setEditProductBody] = useState([]); |
... | ... | @@ -72,8 +78,8 @@ export default ({ currentContract,toReload }) => { |
72 | 78 | data: { contract: currentContract }, |
73 | 79 | }); |
74 | 80 | const context = res.data[0]; |
75 | - console.log(context); | |
76 | - | |
81 | + // console.log(context); | |
82 | + | |
77 | 83 | if (context.contract != null) { |
78 | 84 | setContextBody(context); |
79 | 85 | setTotal(context.totalPrice) |
... | ... | @@ -82,8 +88,22 @@ export default ({ currentContract,toReload }) => { |
82 | 88 | handleInputChange(context.payWay, 0, context.totalPrice) |
83 | 89 | } |
84 | 90 | |
91 | + async function refresh() { | |
92 | + const res = await postOrderErpOrderStagesSearch({ | |
93 | + data: { contract: currentContract }, | |
94 | + }); | |
95 | + const context = res.data[0]; | |
96 | + // console.log(context); | |
97 | + | |
98 | + if (context.contract != null) { | |
99 | + setContextBody(context); | |
100 | + setTotal(context.totalPrice) | |
101 | + form.setFieldValue('totalPrice', context.totalPrice); | |
102 | + } | |
103 | + } | |
104 | + | |
85 | 105 | function getEditProductBody(value) { |
86 | - console.log(value); | |
106 | + // console.log(value); | |
87 | 107 | |
88 | 108 | setEditProductBody(value) |
89 | 109 | let price = 0; |
... | ... | @@ -94,9 +114,9 @@ export default ({ currentContract,toReload }) => { |
94 | 114 | setContextBody({ ...contextBody, orderStagesDeviceVoList: value }) |
95 | 115 | handleInputChange(contextBody.payWay, 0, price) |
96 | 116 | } |
97 | - [] | |
117 | + | |
98 | 118 | function setSave(value) { |
99 | - console.log(value); | |
119 | + // console.log(value); | |
100 | 120 | setOtherBody(value) |
101 | 121 | } |
102 | 122 | |
... | ... | @@ -146,27 +166,30 @@ export default ({ currentContract,toReload }) => { |
146 | 166 | <ModalForm<OrderStagesWithListItem> |
147 | 167 | title="新建" |
148 | 168 | trigger={ |
149 | - <a> | |
150 | - 编辑 | |
151 | - </a> | |
169 | + <a onClick={refresh}>编辑</a> | |
152 | 170 | } |
153 | 171 | form={form} |
154 | 172 | autoFocusFirstInput |
155 | 173 | modalProps={{ |
156 | 174 | destroyOnClose: true, |
157 | - onCancel: () => console.log('run'), | |
175 | + // onCancel: () => console.log('run'), | |
158 | 176 | }} |
159 | 177 | submitTimeout={2000} |
160 | 178 | onFinish={async (values) => { |
161 | - console.log(values); | |
162 | - console.log(otherBody); | |
179 | + if (contextBody.orderStagesDeviceVoList.length == 0) { | |
180 | + message.error("请填写产品数据") | |
181 | + return false; | |
182 | + } | |
183 | + | |
184 | + // console.log(values); | |
185 | + // console.log(otherBody); | |
163 | 186 | let remakeValue = []; |
164 | 187 | let remakeItem = {} |
165 | 188 | // 创建一个用于存储所有异步操作的Promise数组 |
166 | 189 | const promises = []; |
167 | 190 | |
168 | 191 | otherBody.forEach(item => { |
169 | - let remakeItem = { ossId: item.ossId, number: item.id, dataRange: item.payDate, fileName: item.fileName }; | |
192 | + let remakeItem = { ossId: contextBody.id, number: item.id, dateRange: item.payDate, fileName: item.fileName }; | |
170 | 193 | if (typeof item.fileUrl === 'object' && item.fileUrl instanceof File) { |
171 | 194 | const formData = new FormData(); |
172 | 195 | formData.append('file', item.fileUrl as RcFile); |
... | ... | @@ -188,6 +211,8 @@ export default ({ currentContract,toReload }) => { |
188 | 211 | |
189 | 212 | // 使用Promise.all等待所有异步操作完成后再执行保存操作 |
190 | 213 | Promise.all(promises).then(async () => { |
214 | + // console.log(remakeValue); | |
215 | + | |
191 | 216 | const resp = await postOrderErpOrderStagesPayWaySaveOrUpdate({ |
192 | 217 | data: remakeValue |
193 | 218 | }); |
... | ... | @@ -216,8 +241,8 @@ export default ({ currentContract,toReload }) => { |
216 | 241 | } |
217 | 242 | }); |
218 | 243 | if (res.data) { |
219 | - console.log(values) | |
220 | - console.log(contextBody); | |
244 | + // console.log(values) | |
245 | + // console.log(contextBody); | |
221 | 246 | toSendEdit.annex = res.data |
222 | 247 | } |
223 | 248 | } |
... | ... | @@ -225,7 +250,7 @@ export default ({ currentContract,toReload }) => { |
225 | 250 | data: { ...toSendEdit } |
226 | 251 | }) |
227 | 252 | if (isSaveOrUpdate) { |
228 | - console.log(isSaveOrUpdate); | |
253 | + // console.log(isSaveOrUpdate); | |
229 | 254 | getBody() |
230 | 255 | toReload() |
231 | 256 | } |
... | ... | @@ -294,7 +319,7 @@ export default ({ currentContract,toReload }) => { |
294 | 319 | name="annex" |
295 | 320 | max={1} |
296 | 321 | onChange={(value) => { |
297 | - console.log(value); | |
322 | + // console.log(value); | |
298 | 323 | }} |
299 | 324 | label="合同附件" /> |
300 | 325 | |
... | ... | @@ -304,20 +329,22 @@ export default ({ currentContract,toReload }) => { |
304 | 329 | label="合同金额" |
305 | 330 | placeholder="请输入" |
306 | 331 | disabled |
307 | - // rules={[{ required: true, message: '此项为必填项' }]} | |
308 | - // value={contextBody.totalPrice} | |
309 | - initialValue={contextBody.totalPrice} | |
332 | + // rules={[{ required: true, message: '此项为必填项' }]} | |
333 | + // value={contextBody.totalPrice} | |
334 | + initialValue={contextBody.totalPrice} | |
310 | 335 | /> |
311 | 336 | </ProForm.Group> |
312 | 337 | </ProCard> |
313 | - <ProCard | |
314 | - title="产品明细" | |
315 | - style={{ marginTop: 10 }} | |
316 | - headerBordered | |
317 | - bordered | |
318 | - > | |
319 | - <ProductDetail productBody={contextBody.orderStagesDeviceVoList} EditProductBody={getEditProductBody}></ProductDetail> | |
320 | - </ProCard> | |
338 | + | |
339 | + <ProCard | |
340 | + title={<><span style={{ color: 'red' }}>*</span>产品明细</>} | |
341 | + style={{ marginTop: 10 }} | |
342 | + headerBordered | |
343 | + bordered | |
344 | + > | |
345 | + <ProductDetail productBody={contextBody.orderStagesDeviceVoList} EditProductBody={getEditProductBody}></ProductDetail> | |
346 | + </ProCard> | |
347 | + | |
321 | 348 | |
322 | 349 | <ProCard |
323 | 350 | title="付款信息" | ... | ... |
src/pages/Instalment/components/payWayDetail/payWayDetail.css
0 → 100644
1 | +.payway-detail-index td { | |
2 | + font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', 'WenQuanYi Micro Hei', sans-serif; | |
3 | + font-size: 14px; | |
4 | + margin: 0; | |
5 | +} | |
6 | +.payway-detail-index td .css-dev-only-do-not-override-nllxry { | |
7 | + margin-bottom: 0px !important; | |
8 | +} | |
9 | +.dataChoose { | |
10 | + margin: 0; | |
11 | +} | ... | ... |
src/pages/Instalment/components/payWayDetail/payWayDetail.tsx
1 | 1 | import type { ProColumns } from '@ant-design/pro-components'; |
2 | 2 | import { |
3 | 3 | EditableProTable, |
4 | + ProCard, | |
4 | 5 | ProFormDatePicker, |
6 | + ProFormDateTimePicker, | |
7 | + ProFormField, | |
5 | 8 | ProFormRadio, |
9 | + ProFormTimePicker, | |
6 | 10 | ProFormUploadButton, |
7 | 11 | } from '@ant-design/pro-components'; |
8 | 12 | import React, { useEffect, useState } from 'react'; |
9 | 13 | import './payWayDetail.less' |
10 | -import { postOrderErpOrderStagesPayWaySelect } from '@/services'; | |
14 | +import { getOrderErpOrderStagesPayWaySelectOssId, postOrderErpOrderStagesPayWaySelect } from '@/services'; | |
11 | 15 | import { message } from 'antd'; |
12 | 16 | |
13 | 17 | const waitTime = (time: number = 100) => { |
... | ... | @@ -82,19 +86,18 @@ export default ({ payBody, thisId, currtSave }) => { |
82 | 86 | const [isCurrtSave, setIsCurrtSave] = useState(false); |
83 | 87 | |
84 | 88 | async function getOther(value, arr) { |
85 | - console.log(value); | |
86 | 89 | const res = await postOrderErpOrderStagesPayWaySelect({ |
87 | 90 | data: { ossId: value } |
88 | 91 | }); |
89 | 92 | if (res.data) { |
90 | - const context = res.data; | |
93 | + const context = res.data; | |
91 | 94 | const remake = arr.map(obj => { |
92 | 95 | let currt = obj; |
93 | 96 | context.forEach(object => { |
94 | 97 | if (object.number == obj.id) { |
95 | 98 | currt = { |
96 | 99 | ...obj, |
97 | - ossId: object.ossId, | |
100 | + ossId: value, | |
98 | 101 | payDate: object.dateRange, |
99 | 102 | fileName: object.fileName, |
100 | 103 | fileUrl: object.fileUrl |
... | ... | @@ -102,10 +105,10 @@ export default ({ payBody, thisId, currtSave }) => { |
102 | 105 | return currt; |
103 | 106 | } |
104 | 107 | }); |
105 | - console.log(currt); | |
108 | + // console.log(currt); | |
106 | 109 | return currt; |
107 | 110 | }); |
108 | - console.log(context); | |
111 | + // console.log(context); | |
109 | 112 | setPayWayDetailBody(remake); |
110 | 113 | } |
111 | 114 | } |
... | ... | @@ -114,10 +117,10 @@ export default ({ payBody, thisId, currtSave }) => { |
114 | 117 | const remakeData = payWayDetailBody.map(obj => { |
115 | 118 | return { ...obj, proportion: value[obj.id - 1]?.proportion, payPrice: value[obj.id - 1]?.payPrice } |
116 | 119 | }) |
117 | - console.log(remakeData); | |
120 | + // console.log(remakeData); | |
118 | 121 | |
119 | 122 | setPayWayDetailBody(remakeData) |
120 | - console.log(thisId); | |
123 | + // console.log(thisId); | |
121 | 124 | |
122 | 125 | if (thisId!=null) { |
123 | 126 | getOther(thisId, remakeData) |
... | ... | @@ -132,7 +135,7 @@ export default ({ payBody, thisId, currtSave }) => { |
132 | 135 | }, [payBody]) |
133 | 136 | |
134 | 137 | function setCurrtSave(value) { |
135 | - console.log(value); | |
138 | + // console.log(value); | |
136 | 139 | setIsCurrtSave(payWayDetailBody) |
137 | 140 | } |
138 | 141 | |
... | ... | @@ -180,7 +183,7 @@ export default ({ payBody, thisId, currtSave }) => { |
180 | 183 | } |
181 | 184 | return item; |
182 | 185 | }); |
183 | - console.log(updatedDataSource); | |
186 | + // console.log(updatedDataSource); | |
184 | 187 | |
185 | 188 | setPayWayDetailBody(updatedDataSource); |
186 | 189 | currtSave(updatedDataSource) |
... | ... | @@ -215,8 +218,8 @@ export default ({ payBody, thisId, currtSave }) => { |
215 | 218 | <ProFormUploadButton |
216 | 219 | name={record.id} |
217 | 220 | onChange={(value) => { |
218 | - console.log(value); | |
219 | - console.log(payWayDetailBody); | |
221 | + // console.log(value); | |
222 | + // console.log(payWayDetailBody); | |
220 | 223 | let remakeBody = []; |
221 | 224 | let remakeBodyItem = {}; |
222 | 225 | payWayDetailBody.forEach(item => { |
... | ... | @@ -224,9 +227,10 @@ export default ({ payBody, thisId, currtSave }) => { |
224 | 227 | remakeBodyItem = { ...item, fileUrl: value.file.originFileObj, fileName: value.file.name } |
225 | 228 | } else { |
226 | 229 | remakeBodyItem = { ...item } |
227 | - } if (value.fileList.length == 0) { | |
228 | - remakeBodyItem = { ...item, fileUrl: undefined, fileName: undefined } | |
229 | - } | |
230 | + } | |
231 | + // if (value.fileList.length == 0) { | |
232 | + // remakeBodyItem = { ...item, fileUrl: undefined, fileName: undefined } | |
233 | + // } | |
230 | 234 | remakeBody.push(remakeBodyItem) |
231 | 235 | }) |
232 | 236 | setPayWayDetailBody(remakeBody) |
... | ... | @@ -254,7 +258,7 @@ export default ({ payBody, thisId, currtSave }) => { |
254 | 258 | |
255 | 259 | }} |
256 | 260 | > |
257 | - {(record.fileName !== undefined || record.fileName !== '') ? '重新上传' : '上传回执'} | |
261 | + {(record.fileName !== undefined && record.fileName !== "" && record.fileName !== null) ? '重新上传' : '上传回执'} | |
258 | 262 | </a> |
259 | 263 | ], |
260 | 264 | }, |
... | ... | @@ -264,7 +268,7 @@ export default ({ payBody, thisId, currtSave }) => { |
264 | 268 | <> |
265 | 269 | <EditableProTable<DataSourceType> |
266 | 270 | rowKey="id" |
267 | - className='payWayDetail-index' | |
271 | + className='payway-detail-index' | |
268 | 272 | toolbar={{ style: { display: 'none' } }} |
269 | 273 | ghost={true} |
270 | 274 | scroll={{ |
... | ... | @@ -299,7 +303,7 @@ export default ({ payBody, thisId, currtSave }) => { |
299 | 303 | type: 'multiple', |
300 | 304 | editableKeys, |
301 | 305 | onSave: async (rowKey, data, row) => { |
302 | - console.log(rowKey, data, row); | |
306 | + // console.log(rowKey, data, row); | |
303 | 307 | await waitTime(2000); |
304 | 308 | }, |
305 | 309 | onChange: setEditableRowKeys, | ... | ... |
src/pages/Instalment/components/productDetail/productDetail.tsx
... | ... | @@ -8,6 +8,7 @@ import { |
8 | 8 | import React, { useEffect, useState } from 'react'; |
9 | 9 | import './productDetail.less' |
10 | 10 | import { countBy } from 'lodash'; |
11 | +import { Form } from 'antd'; | |
11 | 12 | |
12 | 13 | const waitTime = (time: number = 100) => { |
13 | 14 | return new Promise((resolve) => { |
... | ... | @@ -40,34 +41,35 @@ const defaultData: DataSourceType[] = [ |
40 | 41 | export default ({ productBody, EditProductBody }) => { |
41 | 42 | const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]); |
42 | 43 | const [dataSource, setDataSource] = useState<readonly DataSourceType[]>([]); |
44 | + const [form] = Form.useForm<{ name: string; company: string }>(); | |
43 | 45 | const [position, setPosition] = useState<'top' | 'bottom' | 'hidden'>( |
44 | 46 | 'bottom', |
45 | 47 | ); |
46 | 48 | function getDataSourece() { |
47 | - if (productBody.length!=0) { | |
49 | + if (productBody.length != 0) { | |
48 | 50 | setDataSource(productBody) |
49 | 51 | } |
50 | 52 | } |
51 | 53 | function setEditProductBody(value) { |
52 | - console.log(value); | |
53 | - console.log(dataSource); | |
54 | - | |
54 | + // console.log(value); | |
55 | + // console.log(dataSource); | |
56 | + | |
55 | 57 | const modifiedArray = value.map(obj => { |
56 | 58 | if (obj.dId && Number(obj.dId) <= 1000) { |
57 | 59 | return { |
58 | 60 | ...obj, |
59 | - count:obj.count, | |
61 | + count: obj.count, | |
60 | 62 | dId: null, |
61 | - deviceModel:obj.deviceModel, | |
62 | - deviceName:obj.deviceName, | |
63 | - price:obj.price, | |
64 | - unitPrice:obj.unitPrice | |
63 | + deviceModel: obj.deviceModel, | |
64 | + deviceName: obj.deviceName, | |
65 | + price: Number(obj.unitPrice)*Number(obj.count), | |
66 | + unitPrice: obj.unitPrice | |
65 | 67 | }; |
66 | 68 | } else { |
67 | - return obj; | |
69 | + return {...obj,price: Number(obj.unitPrice)*Number(obj.count)}; | |
68 | 70 | } |
69 | 71 | }); |
70 | - console.log(modifiedArray); | |
72 | + // console.log(modifiedArray); | |
71 | 73 | |
72 | 74 | EditProductBody(modifiedArray) |
73 | 75 | setDataSource(value) |
... | ... | @@ -84,7 +86,7 @@ export default ({ productBody, EditProductBody }) => { |
84 | 86 | deviceModel: string, |
85 | 87 | deviceName: string, |
86 | 88 | price: number |
87 | - unitPrice: number, | |
89 | + unitPrice: number | |
88 | 90 | } |
89 | 91 | |
90 | 92 | |
... | ... | @@ -92,7 +94,7 @@ export default ({ productBody, EditProductBody }) => { |
92 | 94 | { |
93 | 95 | title: '设备编号', |
94 | 96 | dataIndex: 'dId', |
95 | - hideInTable: true | |
97 | + hideInTable: true, | |
96 | 98 | }, |
97 | 99 | { |
98 | 100 | title: '设备名称', |
... | ... | @@ -138,12 +140,14 @@ export default ({ productBody, EditProductBody }) => { |
138 | 140 | { |
139 | 141 | title: '总价', |
140 | 142 | dataIndex: 'price', |
141 | - formItemProps: (form, { rowIndex }) => { | |
142 | - return { | |
143 | - rules: | |
144 | - [{ required: true, message: '此项为必填项' }] | |
145 | - }; | |
146 | - } | |
143 | + hideInSetting:true, | |
144 | + disable:true, | |
145 | + editable:false, | |
146 | + render: (text, record, _, action) => [ | |
147 | + <span> | |
148 | + {record.count*record.unitPrice} | |
149 | + </span> | |
150 | + ], | |
147 | 151 | }, |
148 | 152 | { |
149 | 153 | title: '操作', |
... | ... | @@ -154,6 +158,9 @@ export default ({ productBody, EditProductBody }) => { |
154 | 158 | key="editable" |
155 | 159 | onClick={() => { |
156 | 160 | if (record.dId) { |
161 | + // EditProductBody(dataSource.filter((item) => item.dId !== record.dId)); | |
162 | + // console.log(record); | |
163 | + | |
157 | 164 | action?.startEditable?.(record.dId); |
158 | 165 | } |
159 | 166 | }} |
... | ... | @@ -163,6 +170,7 @@ export default ({ productBody, EditProductBody }) => { |
163 | 170 | <a |
164 | 171 | key="delete" |
165 | 172 | onClick={() => { |
173 | + EditProductBody(dataSource.filter((item) => item.dId !== record.dId)); | |
166 | 174 | setDataSource(dataSource.filter((item) => item.dId !== record.dId)); |
167 | 175 | }} |
168 | 176 | > |
... | ... | @@ -208,7 +216,8 @@ export default ({ productBody, EditProductBody }) => { |
208 | 216 | type: 'multiple', |
209 | 217 | editableKeys, |
210 | 218 | onSave: async (rowKey, data, row) => { |
211 | - await waitTime(2000); | |
219 | + // console.log(data); | |
220 | + await waitTime(500); | |
212 | 221 | }, |
213 | 222 | onChange: setEditableRowKeys, |
214 | 223 | }} | ... | ... |
src/pages/Instalment/components/read/read.tsx
0 → 100644
1 | +import { PlusOutlined } from '@ant-design/icons'; | |
2 | +import { | |
3 | + ModalForm, | |
4 | + ProCard, | |
5 | + ProForm, | |
6 | + ProFormDatePicker, | |
7 | + ProFormDateRangePicker, | |
8 | + ProFormDependency, | |
9 | + ProFormSelect, | |
10 | + ProFormText, | |
11 | + ProFormTextArea, | |
12 | + ProFormUploadButton, | |
13 | +} from '@ant-design/pro-components'; | |
14 | +import ProductDetail from './readProduct'; | |
15 | +import PayWayDetail from './readPayWay' | |
16 | +import { Button, Form, UploadProps, message } from 'antd'; | |
17 | +import Item from 'antd/es/list/Item'; | |
18 | +import { useEffect, useRef, useState } from 'react'; | |
19 | +import { postOrderErpOrderStagesPayWaySaveOrUpdate, postOrderErpOrderStagesPayWayUploadForPayWay, postOrderErpOrderStagesSaveOrUpdate, postOrderErpOrderStagesSearch, postOrderErpOrderStagesUpload, postServiceOrderFileProcess } from '@/services'; | |
20 | +import { context } from '@/.umi/core/helmetContext'; | |
21 | +import { RcFile } from 'antd/es/upload'; | |
22 | + | |
23 | +const waitTime = (time: number = 100) => { | |
24 | + return new Promise((resolve) => { | |
25 | + setTimeout(() => { | |
26 | + resolve(true); | |
27 | + }, time); | |
28 | + }); | |
29 | +}; | |
30 | + | |
31 | +export default ({ currentContract }) => { | |
32 | + const [form] = Form.useForm<{ name: string; company: string }>(); | |
33 | + const [contextBody, setContextBody] = useState({}); | |
34 | + const [editProductBody, setEditProductBody] = useState([]); | |
35 | + const [total, setTotal] = useState(0); | |
36 | + const [payWayBody, setPayWayBody] = useState([]) | |
37 | + const [otherBody, setOtherBody] = useState([]) | |
38 | + const [isOnlyRead, setisOnlyRead] = useState() | |
39 | + | |
40 | + type OrderStagesWithListItem = { | |
41 | + //文件编号 | |
42 | + id: number; | |
43 | + //合同编号 | |
44 | + contract: string; | |
45 | + //供应商名称 | |
46 | + vendor: string; | |
47 | + //签合同日期 | |
48 | + dateRange: Date; | |
49 | + //终端名称 | |
50 | + terminal: string; | |
51 | + orderStagesDeviceVoList: orderStagesDevice[] | |
52 | + //合同总金额 | |
53 | + totalPrice: number; | |
54 | + //付款方式 | |
55 | + payWay: string; | |
56 | + //附件 | |
57 | + annex: string; | |
58 | + //备注 | |
59 | + remark: string; | |
60 | + }; | |
61 | + | |
62 | + type orderStagesDevice = { | |
63 | + //设备id | |
64 | + dId: number; | |
65 | + //设备名称 | |
66 | + deviceName: string; | |
67 | + //设备型号 | |
68 | + deviceModel: string; | |
69 | + //数量 | |
70 | + count: number; | |
71 | + //单价 | |
72 | + unitPrice: number; | |
73 | + //总价 | |
74 | + price: number; | |
75 | + } | |
76 | + | |
77 | + async function getBody() { | |
78 | + const res = await postOrderErpOrderStagesSearch({ | |
79 | + data: { contract: currentContract }, | |
80 | + }); | |
81 | + const context = res.data[0]; | |
82 | + // console.log(context); | |
83 | + | |
84 | + if (context.contract != null) { | |
85 | + setContextBody(context); | |
86 | + setTotal(context.totalPrice) | |
87 | + form.setFieldValue('totalPrice', context.totalPrice); | |
88 | + } | |
89 | + handleInputChange(context.payWay, 0, context.totalPrice) | |
90 | + } | |
91 | + | |
92 | + async function refresh() { | |
93 | + const res = await postOrderErpOrderStagesSearch({ | |
94 | + data: { contract: currentContract }, | |
95 | + }); | |
96 | + const context = res.data[0]; | |
97 | + // console.log(context); | |
98 | + | |
99 | + if (context.contract != null) { | |
100 | + setContextBody(context); | |
101 | + setTotal(context.totalPrice) | |
102 | + form.setFieldValue('totalPrice', context.totalPrice); | |
103 | + } | |
104 | + } | |
105 | + | |
106 | + function getEditProductBody(value) { | |
107 | + // console.log(value); | |
108 | + | |
109 | + setEditProductBody(value) | |
110 | + let price = 0; | |
111 | + value.map(obj => ( | |
112 | + price += (obj.count * obj.unitPrice) | |
113 | + )); | |
114 | + setTotal(price); | |
115 | + setContextBody({ ...contextBody, orderStagesDeviceVoList: value }) | |
116 | + handleInputChange(contextBody.payWay, 0, price) | |
117 | + } | |
118 | + [] | |
119 | + function setSave(value) { | |
120 | + // console.log(value); | |
121 | + setOtherBody(value) | |
122 | + } | |
123 | + | |
124 | + useEffect(() => { | |
125 | + setContextBody({ ...contextBody, totalPrice: total }) | |
126 | + form.setFieldValue('totalPrice', total); | |
127 | + }, [total]) | |
128 | + | |
129 | + useEffect(() => { | |
130 | + getBody() | |
131 | + }, []) | |
132 | + | |
133 | + const handleInputChange = (value: string, no: number, priceNow?: number) => { | |
134 | + let totalPay = 0; | |
135 | + const payValue: string[] = value.split("/") | |
136 | + let body: ((prevState: never[]) => never[]) | { proportion: string; payPrice: number; }[] = []; | |
137 | + if (no === 1) { | |
138 | + if (payValue.length !== 4) { | |
139 | + message.warning('比例个数总和不为4个!'); | |
140 | + } else { | |
141 | + payValue.forEach((item, index) => { | |
142 | + totalPay += Number(item) | |
143 | + }) | |
144 | + } | |
145 | + if (totalPay != 100) { | |
146 | + message.warning('比例总和不为100!'); | |
147 | + } else { | |
148 | + message.success('输入有效!'); | |
149 | + const price = total | |
150 | + payValue.forEach((item, index) => { | |
151 | + body.push({ proportion: item + "%", payPrice: Number(item) * price / 100 }) | |
152 | + }) | |
153 | + setPayWayBody(body) | |
154 | + } | |
155 | + } else { | |
156 | + payValue.forEach((item, index) => { | |
157 | + totalPay += Number(item) | |
158 | + }) | |
159 | + payValue.forEach((item, index) => { | |
160 | + body.push({ proportion: item + "%", payPrice: Number(item) * priceNow / 100 }) | |
161 | + }) | |
162 | + setPayWayBody(body) | |
163 | + } | |
164 | + }; | |
165 | + | |
166 | + return ( | |
167 | + <ModalForm<OrderStagesWithListItem> | |
168 | + title="新建" | |
169 | + trigger={ | |
170 | + <a onClick={refresh}>查看</a> | |
171 | + } | |
172 | + form={form} | |
173 | + autoFocusFirstInput | |
174 | + modalProps={{ | |
175 | + destroyOnClose: true, | |
176 | + // onCancel: () => console.log('run'), | |
177 | + }} | |
178 | + submitTimeout={2000} | |
179 | + onFinish={async (values) => { | |
180 | + // console.log(values); | |
181 | + // console.log(otherBody); | |
182 | + let remakeValue = []; | |
183 | + let remakeItem = {} | |
184 | + // 创建一个用于存储所有异步操作的Promise数组 | |
185 | + const promises = []; | |
186 | + | |
187 | + otherBody.forEach(item => { | |
188 | + let remakeItem = { ossId: item.ossId, number: item.id, dataRange: item.payDate, fileName: item.fileName }; | |
189 | + if (typeof item.fileUrl === 'object' && item.fileUrl instanceof File) { | |
190 | + const formData = new FormData(); | |
191 | + formData.append('file', item.fileUrl as RcFile); | |
192 | + const uploadPromise = async () => { | |
193 | + const res = await postOrderErpOrderStagesUpload({ | |
194 | + data: formData, | |
195 | + headers: { | |
196 | + 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | |
197 | + } | |
198 | + }); | |
199 | + if (res.data) { | |
200 | + remakeItem.fileUrl = res.data; | |
201 | + } | |
202 | + }; | |
203 | + promises.push(uploadPromise()); | |
204 | + } | |
205 | + remakeValue.push(remakeItem); | |
206 | + }); | |
207 | + | |
208 | + // 使用Promise.all等待所有异步操作完成后再执行保存操作 | |
209 | + Promise.all(promises).then(async () => { | |
210 | + const resp = await postOrderErpOrderStagesPayWaySaveOrUpdate({ | |
211 | + data: remakeValue | |
212 | + }); | |
213 | + }); | |
214 | + const formData = new FormData(); | |
215 | + // let toSendEdit={...values,orderStagesDeviceVoList:contextBody.orderStagesDeviceVoList}; | |
216 | + let toSendEdit = { | |
217 | + id: values.id || contextBody.id, | |
218 | + contract: values.contract || contextBody.contract, | |
219 | + vendor: values.vendor || contextBody.vendor, | |
220 | + dateRange: values.dateRange || contextBody.dateRange, | |
221 | + terminal: values.terminal || contextBody.terminal, | |
222 | + orderStagesDeviceDoList: values.orderStagesDeviceVoList || contextBody.orderStagesDeviceVoList, | |
223 | + totalPrice: values.totalPrice || contextBody.totalPrice, | |
224 | + payWay: values.payWay || contextBody.payWay, | |
225 | + annex: contextBody.annex, | |
226 | + remark: values.remark || contextBody.remark, | |
227 | + }; | |
228 | + if (values.annex) { | |
229 | + formData.append('file', values.annex[0].originFileObj as RcFile); | |
230 | + const res = await postOrderErpOrderStagesUpload({ | |
231 | + data: formData, | |
232 | + headers: { | |
233 | + 'Content-Type': | |
234 | + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | |
235 | + } | |
236 | + }); | |
237 | + if (res.data) { | |
238 | + // console.log(values) | |
239 | + // console.log(contextBody); | |
240 | + toSendEdit.annex = res.data | |
241 | + } | |
242 | + } | |
243 | + const isSaveOrUpdate = await postOrderErpOrderStagesSaveOrUpdate({ | |
244 | + data: { ...toSendEdit } | |
245 | + }) | |
246 | + if (isSaveOrUpdate) { | |
247 | + // console.log(isSaveOrUpdate); | |
248 | + getBody() | |
249 | + } | |
250 | + await waitTime(2000); | |
251 | + message.success('提交成功'); | |
252 | + return true; | |
253 | + }} | |
254 | + > | |
255 | + <ProCard | |
256 | + title="基本信息" | |
257 | + headerBordered | |
258 | + bordered | |
259 | + > | |
260 | + <ProForm.Group> | |
261 | + <ProFormText | |
262 | + width="md" | |
263 | + name="vendor" | |
264 | + label="供应商名称" | |
265 | + placeholder="请输入" | |
266 | + initialValue={contextBody.vendor} | |
267 | + readonly | |
268 | + /> | |
269 | + | |
270 | + <ProFormText | |
271 | + width="md" | |
272 | + name="terminal" | |
273 | + label="终端名称" | |
274 | + placeholder="请输入" | |
275 | + initialValue={contextBody.terminal} | |
276 | + readonly | |
277 | + /> | |
278 | + | |
279 | + <ProFormDatePicker | |
280 | + name="dateRange" | |
281 | + width="md" | |
282 | + label="签合同日期" | |
283 | + placeholder="请选择日期" | |
284 | + fieldProps={{ | |
285 | + format: (value) => value.format('YYYY-MM-DD'), | |
286 | + }} | |
287 | + initialValue={contextBody.dateRange} | |
288 | + readonly | |
289 | + /> | |
290 | + | |
291 | + <ProFormText | |
292 | + width="md" | |
293 | + name="payWay" | |
294 | + label="付款比例" | |
295 | + placeholder="请输入" | |
296 | + initialValue={contextBody.payWay} | |
297 | + readonly | |
298 | + onBlur={(e) => { | |
299 | + handleInputChange(e.target.value, 1); | |
300 | + }} | |
301 | + /> | |
302 | + | |
303 | + <ProFormText | |
304 | + width="md" | |
305 | + name="contract" | |
306 | + label="合同编号" | |
307 | + placeholder="请输入" | |
308 | + initialValue={contextBody.contract} | |
309 | + readonly | |
310 | + /> | |
311 | + | |
312 | + {/* <ProFormText | |
313 | + width="md" | |
314 | + name="annex" | |
315 | + label="合同附件" | |
316 | + placeholder="请输入" | |
317 | + initialValue={contextBody.fileUrl} | |
318 | + readonly | |
319 | + /> */} | |
320 | + | |
321 | + | |
322 | + <ProFormText | |
323 | + width="md" | |
324 | + name="totalPrice" | |
325 | + label="合同金额" | |
326 | + placeholder="请输入" | |
327 | + disabled | |
328 | + readonly | |
329 | + // rules={[{ required: true, message: '此项为必填项' }]} | |
330 | + // value={contextBody.totalPrice} | |
331 | + initialValue={contextBody.totalPrice} | |
332 | + /> | |
333 | + </ProForm.Group> | |
334 | + </ProCard> | |
335 | + <ProCard | |
336 | + title="产品明细" | |
337 | + style={{ marginTop: 10 }} | |
338 | + headerBordered | |
339 | + bordered | |
340 | + > | |
341 | + <ProductDetail productBody={contextBody.orderStagesDeviceVoList} EditProductBody={getEditProductBody}></ProductDetail> | |
342 | + </ProCard> | |
343 | + | |
344 | + <ProCard | |
345 | + title="付款信息" | |
346 | + style={{ marginTop: 10 }} | |
347 | + headerBordered | |
348 | + bordered | |
349 | + > | |
350 | + <PayWayDetail payBody={payWayBody} thisId={contextBody.id} currtSave={setSave}></PayWayDetail> | |
351 | + </ProCard> | |
352 | + | |
353 | + <ProCard | |
354 | + style={{ marginTop: 10 }} | |
355 | + headerBordered | |
356 | + bordered | |
357 | + > | |
358 | + <ProFormTextArea label="备注" name="remark" initialValue={contextBody.remark} readonly /> | |
359 | + </ProCard> | |
360 | + </ModalForm> | |
361 | + ); | |
362 | +}; | |
0 | 363 | \ No newline at end of file | ... | ... |
src/pages/Instalment/components/read/readPayWay.tsx
0 → 100644
1 | +import type { ProColumns } from '@ant-design/pro-components'; | |
2 | +import { | |
3 | + EditableProTable, | |
4 | + ProCard, | |
5 | + ProFormDatePicker, | |
6 | + ProFormDateTimePicker, | |
7 | + ProFormField, | |
8 | + ProFormRadio, | |
9 | + ProFormTimePicker, | |
10 | + ProFormUploadButton, | |
11 | +} from '@ant-design/pro-components'; | |
12 | +import React, { useEffect, useState } from 'react'; | |
13 | +import { postOrderErpOrderStagesPayWaySelect } from '@/services'; | |
14 | +import { message } from 'antd'; | |
15 | + | |
16 | +const waitTime = (time: number = 100) => { | |
17 | + return new Promise((resolve) => { | |
18 | + setTimeout(() => { | |
19 | + resolve(true); | |
20 | + }, time); | |
21 | + }); | |
22 | +}; | |
23 | + | |
24 | +type DataSourceType = { | |
25 | + id: number; | |
26 | + payStep?: string; | |
27 | + proportion?: string; | |
28 | + ossId?: number, | |
29 | + payPrice?: number; | |
30 | + payDate?: Date; | |
31 | + fileName?: string; | |
32 | + fileUrl?: string; | |
33 | +}; | |
34 | + | |
35 | +export default ({ payBody, thisId, currtSave }) => { | |
36 | + const defaultData: DataSourceType[] = [ | |
37 | + { | |
38 | + id: 1, | |
39 | + payStep: '预付款', | |
40 | + proportion: undefined, | |
41 | + payPrice: undefined, | |
42 | + ossId: undefined, | |
43 | + payDate: undefined, | |
44 | + fileName: undefined, | |
45 | + fileUrl: undefined | |
46 | + }, | |
47 | + { | |
48 | + id: 2, | |
49 | + payStep: '发贷款', | |
50 | + proportion: undefined, | |
51 | + payPrice: undefined, | |
52 | + ossId: undefined, | |
53 | + payDate: undefined, | |
54 | + fileName: undefined, | |
55 | + fileUrl: undefined | |
56 | + }, | |
57 | + { | |
58 | + id: 3, | |
59 | + payStep: '验收款', | |
60 | + proportion: undefined, | |
61 | + payPrice: undefined, | |
62 | + ossId: undefined, | |
63 | + payDate: undefined, | |
64 | + fileName: undefined, | |
65 | + fileUrl: undefined | |
66 | + }, | |
67 | + { | |
68 | + id: 4, | |
69 | + payStep: '质保金', | |
70 | + proportion: undefined, | |
71 | + payPrice: undefined, | |
72 | + ossId: undefined, | |
73 | + payDate: undefined, | |
74 | + fileName: undefined, | |
75 | + fileUrl: undefined | |
76 | + } | |
77 | + ]; | |
78 | + | |
79 | + const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]); | |
80 | + const [dataSource, setDataSource] = useState<readonly DataSourceType[]>([]); | |
81 | + const [position, setPosition] = useState<'top' | 'bottom' | 'hidden'>('hidden'); | |
82 | + const [payWayDetailBody, setPayWayDetailBody] = useState<readonly DataSourceType[]>([...defaultData]) | |
83 | + const [body, setBody] = useState([]) | |
84 | + const [isAccept, setIsAccept] = useState(null) | |
85 | + const [isCurrtSave, setIsCurrtSave] = useState(false); | |
86 | + | |
87 | + async function getOther(value, arr) { | |
88 | + const res = await postOrderErpOrderStagesPayWaySelect({ | |
89 | + data: { ossId: value } | |
90 | + }); | |
91 | + if (res.data) { | |
92 | + const context = res.data; | |
93 | + const remake = arr.map(obj => { | |
94 | + let currt = obj; | |
95 | + context.forEach(object => { | |
96 | + if (object.number == obj.id) { | |
97 | + currt = { | |
98 | + ...obj, | |
99 | + ossId: value, | |
100 | + payDate: object.dateRange, | |
101 | + fileName: object.fileName, | |
102 | + fileUrl: object.fileUrl | |
103 | + }; | |
104 | + return currt; | |
105 | + } | |
106 | + }); | |
107 | + // console.log(currt); | |
108 | + return currt; | |
109 | + }); | |
110 | + // console.log(context); | |
111 | + setPayWayDetailBody(remake); | |
112 | + } | |
113 | + } | |
114 | + | |
115 | + function setPayWay(value) { | |
116 | + const remakeData = payWayDetailBody.map(obj => { | |
117 | + return { ...obj, proportion: value[obj.id - 1]?.proportion, payPrice: value[obj.id - 1]?.payPrice } | |
118 | + }) | |
119 | + // console.log(remakeData); | |
120 | + | |
121 | + setPayWayDetailBody(remakeData) | |
122 | + // console.log(thisId); | |
123 | + | |
124 | + if (thisId!=null) { | |
125 | + getOther(thisId, remakeData) | |
126 | + } | |
127 | + } | |
128 | + // useEffect(() => { | |
129 | + // getOther(thisId) | |
130 | + // }, [thisId]) | |
131 | + | |
132 | + useEffect(() => { | |
133 | + setPayWay(payBody) | |
134 | + }, [payBody]) | |
135 | + | |
136 | + function setCurrtSave(value) { | |
137 | + // console.log(value); | |
138 | + setIsCurrtSave(payWayDetailBody) | |
139 | + } | |
140 | + | |
141 | + | |
142 | + const columns: ProColumns<DataSourceType>[] = [ | |
143 | + { | |
144 | + title: '编号', | |
145 | + dataIndex: 'id', | |
146 | + hideInTable: true, | |
147 | + editable: false | |
148 | + }, | |
149 | + { | |
150 | + title: '付款信息', | |
151 | + dataIndex: 'payStep', | |
152 | + editable: false | |
153 | + }, | |
154 | + { | |
155 | + title: '付款比例', | |
156 | + dataIndex: 'proportion', | |
157 | + editable: false | |
158 | + }, | |
159 | + { | |
160 | + title: '付款金额', | |
161 | + dataIndex: 'payPrice', | |
162 | + editable: false | |
163 | + }, | |
164 | + { | |
165 | + title: '对应的订单', | |
166 | + dataIndex: 'ossId', | |
167 | + editable: false, | |
168 | + hideInTable: true, | |
169 | + }, | |
170 | + { | |
171 | + title: '付款时间', | |
172 | + dataIndex: 'payDate', | |
173 | + editable: false, | |
174 | + render: (text, record, _, action) => { | |
175 | + const handleChange = (value) => { | |
176 | + const updatedDataSource = payWayDetailBody.map(item => { | |
177 | + if (item.id === record.id) { | |
178 | + return { | |
179 | + ...item, | |
180 | + payDate: value | |
181 | + }; | |
182 | + } | |
183 | + return item; | |
184 | + }); | |
185 | + // console.log(updatedDataSource); | |
186 | + | |
187 | + setPayWayDetailBody(updatedDataSource); | |
188 | + currtSave(updatedDataSource) | |
189 | + }; | |
190 | + | |
191 | + return ( | |
192 | + <span>{new Intl.DateTimeFormat('zh-CN', { year: 'numeric', month: 'long', day: 'numeric' }).format(record.payDate)}</span> | |
193 | + // <ProFormDatePicker | |
194 | + // className='dataChoose' | |
195 | + // initialValue={record.payDate} | |
196 | + // value={record.payDate} | |
197 | + // placeholder={"请填写时间"} | |
198 | + // fieldProps={{ | |
199 | + // format: (value) => value.format('YYYY-MM-DD'), | |
200 | + // onChange: handleChange, | |
201 | + // }} | |
202 | + // /> | |
203 | + ); | |
204 | + } | |
205 | + }, | |
206 | + { | |
207 | + title: '付款单回执', | |
208 | + dataIndex: 'fileName', | |
209 | + render: (text, record, _, action) => { | |
210 | + if (isAccept !== record.id) { | |
211 | + if (typeof record.fileUrl === 'object' && record.fileUrl instanceof File) { | |
212 | + return (<a onClick={() => message.error("请先保存")}>{record.fileName}</a>) | |
213 | + } else { | |
214 | + return (<a href={record.fileUrl}>{record.fileName}</a>) | |
215 | + } | |
216 | + } else { | |
217 | + return ( | |
218 | + <ProFormUploadButton | |
219 | + name={record.id} | |
220 | + onChange={(value) => { | |
221 | + // console.log(value); | |
222 | + // console.log(payWayDetailBody); | |
223 | + let remakeBody = []; | |
224 | + let remakeBodyItem = {}; | |
225 | + payWayDetailBody.forEach(item => { | |
226 | + if (item.id === record.id) { | |
227 | + remakeBodyItem = { ...item, fileUrl: value.file.originFileObj, fileName: value.file.name } | |
228 | + } else { | |
229 | + remakeBodyItem = { ...item } | |
230 | + } if (value.fileList.length == 0) { | |
231 | + remakeBodyItem = { ...item, fileUrl: undefined, fileName: undefined } | |
232 | + } | |
233 | + remakeBody.push(remakeBodyItem) | |
234 | + }) | |
235 | + setPayWayDetailBody(remakeBody) | |
236 | + currtSave(remakeBody) | |
237 | + }} | |
238 | + width="md" | |
239 | + max={1} /> | |
240 | + ) | |
241 | + } | |
242 | + }, | |
243 | + } | |
244 | + ]; | |
245 | + | |
246 | + return ( | |
247 | + <> | |
248 | + <EditableProTable<DataSourceType> | |
249 | + rowKey="id" | |
250 | + className='payway-detail-index' | |
251 | + toolbar={{ style: { display: 'none' } }} | |
252 | + ghost={true} | |
253 | + scroll={{ | |
254 | + x: 960, | |
255 | + }} | |
256 | + recordCreatorProps={ | |
257 | + position !== 'hidden' | |
258 | + ? { | |
259 | + position: position as 'top', | |
260 | + record: () => ({ id: (Math.random() * 1000000).toFixed(0) }), | |
261 | + } | |
262 | + : false | |
263 | + } | |
264 | + loading={false} | |
265 | + toolBarRender={() => [ | |
266 | + <ProFormRadio.Group | |
267 | + key="render" | |
268 | + fieldProps={{ | |
269 | + value: position, | |
270 | + onChange: (e) => setPosition(e.target.value), | |
271 | + }} | |
272 | + />, | |
273 | + ]} | |
274 | + columns={columns} | |
275 | + request={payWayDetailBody} | |
276 | + value={payWayDetailBody} | |
277 | + onChange={() => { | |
278 | + setPayWayDetailBody; | |
279 | + setCurrtSave(payWayDetailBody) | |
280 | + }} | |
281 | + editable={{ | |
282 | + type: 'multiple', | |
283 | + editableKeys, | |
284 | + onSave: async (rowKey, data, row) => { | |
285 | + // console.log(rowKey, data, row); | |
286 | + await waitTime(2000); | |
287 | + }, | |
288 | + onChange: setEditableRowKeys, | |
289 | + }} | |
290 | + /> | |
291 | + </> | |
292 | + ); | |
293 | +}; | |
0 | 294 | \ No newline at end of file | ... | ... |
src/pages/Instalment/components/read/readProduct.tsx
0 → 100644
1 | +import type { ProColumns } from '@ant-design/pro-components'; | |
2 | +import { | |
3 | + EditableProTable, | |
4 | + ProCard, | |
5 | + ProFormField, | |
6 | + ProFormRadio, | |
7 | +} from '@ant-design/pro-components'; | |
8 | +import React, { useEffect, useState } from 'react'; | |
9 | +import { countBy } from 'lodash'; | |
10 | +import { Form } from 'antd'; | |
11 | + | |
12 | +const waitTime = (time: number = 100) => { | |
13 | + return new Promise((resolve) => { | |
14 | + setTimeout(() => { | |
15 | + resolve(true); | |
16 | + }, time); | |
17 | + }); | |
18 | +}; | |
19 | + | |
20 | +type DataSourceType = { | |
21 | + count?: number; | |
22 | + id: React.Key; | |
23 | + deviceModel?: string; | |
24 | + deviceName?: string; | |
25 | + price?: number; | |
26 | + unitPrice?: number; | |
27 | +}; | |
28 | + | |
29 | +const defaultData: DataSourceType[] = [ | |
30 | + // { | |
31 | + // id:1, | |
32 | + // deviceName: '高低温试验箱', | |
33 | + // deviceModel: 'CAN-TES36-0049ST', | |
34 | + // count: 1, | |
35 | + // unitPrice: 24500, | |
36 | + // price: 24500, | |
37 | + // } | |
38 | +]; | |
39 | + | |
40 | +export default ({ productBody, EditProductBody }) => { | |
41 | + const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]); | |
42 | + const [dataSource, setDataSource] = useState<readonly DataSourceType[]>([]); | |
43 | + const [form] = Form.useForm<{ name: string; company: string }>(); | |
44 | + const [position, setPosition] = useState<'top' | 'bottom' | 'hidden'>( | |
45 | + 'hidden', | |
46 | + ); | |
47 | + function getDataSourece() { | |
48 | + if (productBody.length != 0) { | |
49 | + setDataSource(productBody) | |
50 | + } | |
51 | + } | |
52 | + function setEditProductBody(value) { | |
53 | + // console.log(value); | |
54 | + // console.log(dataSource); | |
55 | + | |
56 | + const modifiedArray = value.map(obj => { | |
57 | + if (obj.dId && Number(obj.dId) <= 1000) { | |
58 | + return { | |
59 | + ...obj, | |
60 | + count: obj.count, | |
61 | + dId: null, | |
62 | + deviceModel: obj.deviceModel, | |
63 | + deviceName: obj.deviceName, | |
64 | + price: obj.price, | |
65 | + unitPrice: obj.unitPrice | |
66 | + }; | |
67 | + } else { | |
68 | + return obj; | |
69 | + } | |
70 | + }); | |
71 | + // console.log(modifiedArray); | |
72 | + | |
73 | + EditProductBody(modifiedArray) | |
74 | + setDataSource(value) | |
75 | + } | |
76 | + | |
77 | + useEffect(() => { | |
78 | + getDataSourece() | |
79 | + }, [productBody]) | |
80 | + | |
81 | + type DataSourceType = { | |
82 | + id: React.Key, | |
83 | + count: number, | |
84 | + dId?: number, | |
85 | + deviceModel: string, | |
86 | + deviceName: string, | |
87 | + price: number | |
88 | + unitPrice: number, | |
89 | + // logicDelete:1 | |
90 | + } | |
91 | + | |
92 | + | |
93 | + const columns: ProColumns<DataSourceType>[] = [ | |
94 | + { | |
95 | + title: '设备编号', | |
96 | + dataIndex: 'dId', | |
97 | + hideInTable: true, | |
98 | + }, | |
99 | + { | |
100 | + title: '设备名称', | |
101 | + dataIndex: 'deviceName', | |
102 | + formItemProps: (form, { rowIndex }) => { | |
103 | + return { | |
104 | + rules: | |
105 | + [{ required: true, message: '此项为必填项' }] | |
106 | + }; | |
107 | + } | |
108 | + }, | |
109 | + { | |
110 | + title: '设备型号', | |
111 | + dataIndex: 'deviceModel', | |
112 | + width: '15%', | |
113 | + formItemProps: (form, { rowIndex }) => { | |
114 | + return { | |
115 | + rules: | |
116 | + [{ required: true, message: '此项为必填项' }] | |
117 | + }; | |
118 | + } | |
119 | + }, | |
120 | + { | |
121 | + title: '数量', | |
122 | + dataIndex: 'count', | |
123 | + onChange: (e) => { | |
124 | + // console.log(e); | |
125 | + const unitPrice = form.getFieldValue(`data[${rowIndex}].unitPrice`); | |
126 | + form.setFieldsValue({ | |
127 | + [`data[${rowIndex}].price`]: e * unitPrice | |
128 | + }); | |
129 | + }, | |
130 | + formItemProps: (form, { rowIndex }) => { | |
131 | + return { | |
132 | + rules: | |
133 | + [{ required: true, message: '此项为必填项' }] | |
134 | + }; | |
135 | + } | |
136 | + }, | |
137 | + { | |
138 | + title: '单价', | |
139 | + dataIndex: 'unitPrice', | |
140 | + formItemProps: (form, { rowIndex }) => { | |
141 | + return { | |
142 | + rules: | |
143 | + [{ required: true, message: '此项为必填项' }] | |
144 | + }; | |
145 | + } | |
146 | + }, | |
147 | + { | |
148 | + title: '总价', | |
149 | + dataIndex: 'price', | |
150 | + formItemProps: (form, { rowIndex }) => { | |
151 | + return { | |
152 | + rules: | |
153 | + [{ required: true, message: '此项为必填项' }] | |
154 | + }; | |
155 | + } | |
156 | + } | |
157 | + ]; | |
158 | + | |
159 | + return ( | |
160 | + <> | |
161 | + <EditableProTable<DataSourceType> | |
162 | + className='product-detail-index' | |
163 | + rowKey="dId" | |
164 | + toolbar={{ style: { display: 'none' } }} | |
165 | + ghost={true} | |
166 | + scroll={{ | |
167 | + x: 960, | |
168 | + }} | |
169 | + recordCreatorProps={ | |
170 | + position !== 'hidden' | |
171 | + ? { | |
172 | + position: position as 'top', | |
173 | + record: () => ({ dId: (Math.random() * 1000).toFixed(0) }), | |
174 | + } | |
175 | + : false | |
176 | + } | |
177 | + loading={false} | |
178 | + toolBarRender={() => [ | |
179 | + <ProFormRadio.Group | |
180 | + key="render" | |
181 | + fieldProps={{ | |
182 | + value: position, | |
183 | + onChange: (e) => setPosition(e.target.value), | |
184 | + }} | |
185 | + />, | |
186 | + ]} | |
187 | + columns={columns} | |
188 | + request={dataSource} | |
189 | + value={dataSource} | |
190 | + onChange={setEditProductBody} | |
191 | + editable={{ | |
192 | + type: 'multiple', | |
193 | + editableKeys, | |
194 | + onSave: async (rowKey, data, row) => { | |
195 | + await waitTime(500); | |
196 | + }, | |
197 | + onChange: setEditableRowKeys, | |
198 | + }} | |
199 | + /> | |
200 | + </> | |
201 | + ); | |
202 | +}; | |
0 | 203 | \ No newline at end of file | ... | ... |
src/pages/Instalment/components/title/title.tsx
... | ... | @@ -9,6 +9,9 @@ import { request } from 'umi'; |
9 | 9 | import AddModel from '../detail/detail'; |
10 | 10 | import EditorModel from '../edit/edit'; |
11 | 11 | import UploadModel from '../upload/uploadModel'; |
12 | +import ReadModel from '../read/read' | |
13 | +import Comfire from '../comfire/comfire'; | |
14 | +import { orderExport } from '@/services/order'; | |
12 | 15 | import './title.less' |
13 | 16 | export const waitTimePromise = async (time: number = 100) => { |
14 | 17 | return new Promise((resolve) => { |
... | ... | @@ -33,6 +36,8 @@ type OrderStagesItem = { |
33 | 36 | dateRange?: Date; |
34 | 37 | //终端名称 |
35 | 38 | terminal?: string; |
39 | + //设备编号 | |
40 | + dId?: number; | |
36 | 41 | //设备名称 |
37 | 42 | deviceName?: string; |
38 | 43 | //设备型号 |
... | ... | @@ -134,10 +139,12 @@ export default () => { |
134 | 139 | } |
135 | 140 | |
136 | 141 | async function toDelete(value) { |
142 | + // console.log(value); | |
143 | + | |
137 | 144 | const res = await deleteOrderErpOrderStagesDelect({ |
138 | 145 | data: { |
139 | - ids: value, | |
140 | - deviceIds: null | |
146 | + ids: null, | |
147 | + deviceIds: value | |
141 | 148 | } |
142 | 149 | }) |
143 | 150 | if (res) { |
... | ... | @@ -148,8 +155,19 @@ export default () => { |
148 | 155 | } |
149 | 156 | } |
150 | 157 | |
158 | + const exportLoadingDestory = () => { | |
159 | + message.success("导出成功"); | |
160 | + }; | |
161 | + | |
151 | 162 | async function toExport() { |
152 | - await getOrderErpOrderStagesExport() | |
163 | + // await getOrderErpOrderStagesExport() | |
164 | + orderExport( | |
165 | + '/api/order/erp/orderStages/export', | |
166 | + '分期订单.xlsx', | |
167 | + 'get', | |
168 | + {}, | |
169 | + exportLoadingDestory, | |
170 | + ); | |
153 | 171 | } |
154 | 172 | |
155 | 173 | |
... | ... | @@ -157,7 +175,7 @@ export default () => { |
157 | 175 | { |
158 | 176 | title: '文件编号', |
159 | 177 | dataIndex: 'id', |
160 | - width: '5%', | |
178 | + width: '7%', | |
161 | 179 | render: (_, record) => { |
162 | 180 | if (record.id) { |
163 | 181 | const text = record.id.toString(); |
... | ... | @@ -173,7 +191,7 @@ export default () => { |
173 | 191 | filters: true, |
174 | 192 | onFilter: true, |
175 | 193 | ellipsis: true, |
176 | - width: '6%' | |
194 | + width: '8%' | |
177 | 195 | }, |
178 | 196 | { |
179 | 197 | disable: true, |
... | ... | @@ -302,18 +320,16 @@ export default () => { |
302 | 320 | if (record?.id) { |
303 | 321 | return ( |
304 | 322 | <> |
305 | - <a href={record.annex} target="_blank" rel="noopener noreferrer" key="view"> | |
306 | - 查看 | |
307 | - </a> | |
323 | + <ReadModel currentContract={record.contract}></ReadModel> | |
308 | 324 | |
309 | 325 | <EditorModel currentContract={record.contract} toReload={reload}></EditorModel> |
310 | 326 | |
311 | - <a key="delect" target="_blank" rel="noopener noreferrer" onClick={() => { toDelete([record.id]) }}> | |
327 | + {/* <a key="delect" target="_blank" rel="noopener noreferrer" onClick={() => { toDelete([record.dId]) }}> | |
312 | 328 | 删除 |
313 | - </a> | |
329 | + </a> */} | |
330 | + <Comfire currtDid={record.dId} sureDelete={ toDelete }></Comfire> | |
314 | 331 | </> |
315 | 332 | ) |
316 | - | |
317 | 333 | } |
318 | 334 | return null; |
319 | 335 | }, |
... | ... | @@ -328,11 +344,11 @@ export default () => { |
328 | 344 | actionRef={ref} |
329 | 345 | cardBordered |
330 | 346 | request={async (params, sort, filter) => { |
331 | - console.log(params); | |
347 | + // console.log(params); | |
332 | 348 | if (params.id != null || params.contract != null || params.vendor != null || params.terminal != null || params.deviceName != null || params.dateRange != null) { |
333 | - console.log(params.id); | |
334 | - console.log(params.contract); | |
335 | - console.log(params.vendor); | |
349 | + // console.log(params.id); | |
350 | + // console.log(params.contract); | |
351 | + // console.log(params.vendor); | |
336 | 352 | let PostOrderErpOrderStagesSearchOption = { |
337 | 353 | id: params.id, |
338 | 354 | contract: params.contract, |
... | ... | @@ -357,6 +373,7 @@ export default () => { |
357 | 373 | vendor: undefined, |
358 | 374 | dateRange: undefined, |
359 | 375 | terminal: undefined, |
376 | + dId: undefined, | |
360 | 377 | deviceName: undefined, |
361 | 378 | deviceModel: undefined, |
362 | 379 | count: undefined, |
... | ... | @@ -374,6 +391,7 @@ export default () => { |
374 | 391 | item.vendor = orderStagesWithList[ind].vendor; |
375 | 392 | item.dateRange = orderStagesWithList[ind].dateRange; |
376 | 393 | item.terminal = orderStagesWithList[ind].terminal; |
394 | + item.dId = orderStagesWithList[ind].orderStagesDeviceVoList[index].dId; | |
377 | 395 | item.deviceName = orderStagesWithList[ind].orderStagesDeviceVoList[index].deviceName; |
378 | 396 | item.deviceModel = orderStagesWithList[ind].orderStagesDeviceVoList[index].deviceModel; |
379 | 397 | item.count = orderStagesWithList[ind].orderStagesDeviceVoList[index].count; |
... | ... | @@ -385,11 +403,21 @@ export default () => { |
385 | 403 | item.remark = orderStagesWithList[ind].remark; |
386 | 404 | orderStagesList.push(item); |
387 | 405 | } else { |
406 | + item.id = orderStagesWithList[ind].id; | |
407 | + item.contract = orderStagesWithList[ind].contract; | |
408 | + item.vendor = orderStagesWithList[ind].vendor; | |
409 | + item.dateRange = orderStagesWithList[ind].dateRange; | |
410 | + item.terminal = orderStagesWithList[ind].terminal; | |
411 | + item.dId = orderStagesWithList[ind].orderStagesDeviceVoList[index].dId; | |
388 | 412 | item.deviceName = orderStagesWithList[ind].orderStagesDeviceVoList[index].deviceName; |
389 | 413 | item.deviceModel = orderStagesWithList[ind].orderStagesDeviceVoList[index].deviceModel; |
390 | 414 | item.count = orderStagesWithList[ind].orderStagesDeviceVoList[index].count; |
391 | 415 | item.unitPrice = orderStagesWithList[ind].orderStagesDeviceVoList[index].unitPrice; |
392 | 416 | item.price = orderStagesWithList[ind].orderStagesDeviceVoList[index].price; |
417 | + item.totalPrice = orderStagesWithList[ind].totalPrice; | |
418 | + item.payWay = orderStagesWithList[ind].payWay; | |
419 | + item.annex = orderStagesWithList[ind].annex; | |
420 | + item.remark = orderStagesWithList[ind].remark; | |
393 | 421 | orderStagesList.push(item); |
394 | 422 | } |
395 | 423 | } |
... | ... | @@ -413,6 +441,7 @@ export default () => { |
413 | 441 | vendor: undefined, |
414 | 442 | dateRange: undefined, |
415 | 443 | terminal: undefined, |
444 | + dId: undefined, | |
416 | 445 | deviceName: undefined, |
417 | 446 | deviceModel: undefined, |
418 | 447 | count: undefined, |
... | ... | @@ -430,6 +459,7 @@ export default () => { |
430 | 459 | item.vendor = orderStagesWithList[ind].vendor; |
431 | 460 | item.dateRange = orderStagesWithList[ind].dateRange; |
432 | 461 | item.terminal = orderStagesWithList[ind].terminal; |
462 | + item.dId = orderStagesWithList[ind].orderStagesDeviceVoList[index].dId; | |
433 | 463 | item.deviceName = orderStagesWithList[ind].orderStagesDeviceVoList[index].deviceName; |
434 | 464 | item.deviceModel = orderStagesWithList[ind].orderStagesDeviceVoList[index].deviceModel; |
435 | 465 | item.count = orderStagesWithList[ind].orderStagesDeviceVoList[index].count; |
... | ... | @@ -441,11 +471,21 @@ export default () => { |
441 | 471 | item.remark = orderStagesWithList[ind].remark; |
442 | 472 | orderStagesList.push(item); |
443 | 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 = orderStagesWithList[ind].orderStagesDeviceVoList[index].dId; | |
444 | 480 | item.deviceName = orderStagesWithList[ind].orderStagesDeviceVoList[index].deviceName; |
445 | 481 | item.deviceModel = orderStagesWithList[ind].orderStagesDeviceVoList[index].deviceModel; |
446 | 482 | item.count = orderStagesWithList[ind].orderStagesDeviceVoList[index].count; |
447 | 483 | item.unitPrice = orderStagesWithList[ind].orderStagesDeviceVoList[index].unitPrice; |
448 | 484 | item.price = orderStagesWithList[ind].orderStagesDeviceVoList[index].price; |
485 | + item.totalPrice = orderStagesWithList[ind].totalPrice; | |
486 | + item.payWay = orderStagesWithList[ind].payWay; | |
487 | + item.annex = orderStagesWithList[ind].annex; | |
488 | + item.remark = orderStagesWithList[ind].remark; | |
449 | 489 | orderStagesList.push(item); |
450 | 490 | } |
451 | 491 | } |
... | ... | @@ -465,11 +505,11 @@ export default () => { |
465 | 505 | defaultValue: { |
466 | 506 | option: { fixed: 'right', disable: true }, |
467 | 507 | }, |
468 | - onChange(value) { | |
469 | - console.log('value: ', value); | |
470 | - }, | |
508 | + // onChange(value) { | |
509 | + // console.log('value: ', value); | |
510 | + // }, | |
471 | 511 | }} |
472 | - rowKey="id" | |
512 | + rowKey="dId" | |
473 | 513 | search={{ |
474 | 514 | labelWidth: 'auto', |
475 | 515 | }} |
... | ... | @@ -479,7 +519,6 @@ export default () => { |
479 | 519 | }, |
480 | 520 | }} |
481 | 521 | form={{ |
482 | - // 由于配置了 transform,提交的参与与定义的不同这里需要转化一下 | |
483 | 522 | syncToUrl: (values, type) => { |
484 | 523 | if (type === 'get') { |
485 | 524 | return { |
... | ... | @@ -492,7 +531,7 @@ export default () => { |
492 | 531 | }} |
493 | 532 | pagination={{ |
494 | 533 | pageSize: 10, |
495 | - onChange: (page) => console.log(page), | |
534 | + // onChange: (page) => console.log(page), | |
496 | 535 | }} |
497 | 536 | dateFormatter="string" |
498 | 537 | headerTitle={[ |
... | ... | @@ -502,10 +541,10 @@ export default () => { |
502 | 541 | <> |
503 | 542 | <AddModel toReload={reload}></AddModel> |
504 | 543 | <UploadModel toReload={reload}></UploadModel> |
505 | - {/* <Button type="primary" onClick={()=>{toExport()}}> | |
544 | + <Button type="primary" onClick={() => { toExport() }}> | |
506 | 545 | <VerticalAlignTopOutlined /> |
507 | 546 | 导出 |
508 | - </Button> */} | |
547 | + </Button> | |
509 | 548 | </> |
510 | 549 | ]} |
511 | 550 | /> | ... | ... |
src/pages/Instalment/components/upload/uploadApp.tsx
... | ... | @@ -10,12 +10,12 @@ const App: React.FC = ({ uploadFile }) => { |
10 | 10 | multiple: true, |
11 | 11 | maxCount: 1, |
12 | 12 | onChange:(info)=> { |
13 | - console.log(info.file.originFileObj); | |
13 | + // console.log(info.file.originFileObj); | |
14 | 14 | uploadFile(info.file.originFileObj) |
15 | 15 | }, |
16 | - onDrop(e) { | |
17 | - console.log('Dropped files', e.dataTransfer.files); | |
18 | - }, | |
16 | + // onDrop(e) { | |
17 | + // console.log('Dropped files', e.dataTransfer.files); | |
18 | + // }, | |
19 | 19 | }; |
20 | 20 | |
21 | 21 | return ( | ... | ... |
src/pages/Instalment/components/upload/uploadModel.tsx
... | ... | @@ -24,7 +24,7 @@ export default ({toReload}) => { |
24 | 24 | const [form] = Form.useForm<{ name: string; company: string }>(); |
25 | 25 | const [uploadFile, setUploadFile] = useState({}) |
26 | 26 | function setUploadFileWay(value) { |
27 | - console.log(value); | |
27 | + // console.log(value); | |
28 | 28 | setUploadFile(value) |
29 | 29 | } |
30 | 30 | return ( |
... | ... | @@ -43,7 +43,7 @@ export default ({toReload}) => { |
43 | 43 | autoFocusFirstInput |
44 | 44 | modalProps={{ |
45 | 45 | destroyOnClose: true, |
46 | - onCancel: () => console.log('run'), | |
46 | + // onCancel: () => console.log('run'), | |
47 | 47 | }} |
48 | 48 | submitTimeout={2000} |
49 | 49 | onFinish={async (values) => { | ... | ... |
src/pages/Order/components/ImportModal.tsx
... | ... | @@ -26,7 +26,7 @@ export default ({ onClose }) => { |
26 | 26 | }; |
27 | 27 | const downloadTemplate = async () => { |
28 | 28 | exportLoading('正在下载模板...'); |
29 | - orderExport('/api/service/order/exportTemplate', {}, exportLoadingDestory); | |
29 | + orderExport('/api/service/order/exportTemplate','订单.xlsx','post',{}, exportLoadingDestory); | |
30 | 30 | }; |
31 | 31 | |
32 | 32 | const handleUpload = async () => { |
... | ... | @@ -59,6 +59,8 @@ export default ({ onClose }) => { |
59 | 59 | exportLoading('正在下载错误信息...'); |
60 | 60 | orderExport( |
61 | 61 | '/api/service/order/errorExcelInformation', |
62 | + '订单.xlsx', | |
63 | + 'post', | |
62 | 64 | formData, |
63 | 65 | exportLoadingDestory, |
64 | 66 | ); | ... | ... |
src/pages/OrderPrint/index.css
0 → 100644
1 | +.font0 { | |
2 | + color: windowtext; | |
3 | + font-size: 12pt; | |
4 | + font-weight: 400; | |
5 | + font-style: normal; | |
6 | + text-decoration: none; | |
7 | + font-family: '宋体'; | |
8 | +} | |
9 | +.font1 { | |
10 | + color: windowtext; | |
11 | + font-size: 16pt; | |
12 | + font-weight: 400; | |
13 | + font-style: normal; | |
14 | + text-decoration: none; | |
15 | + font-family: '宋体'; | |
16 | +} | |
17 | +.font2 { | |
18 | + color: windowtext; | |
19 | + font-size: 10pt; | |
20 | + font-weight: 400; | |
21 | + font-style: normal; | |
22 | + text-decoration: none; | |
23 | + font-family: '宋体'; | |
24 | +} | |
25 | +.font3 { | |
26 | + color: windowtext; | |
27 | + font-size: 14pt; | |
28 | + font-weight: 400; | |
29 | + font-style: normal; | |
30 | + text-decoration: none; | |
31 | + font-family: '宋体'; | |
32 | +} | |
33 | +.font4 { | |
34 | + color: windowtext; | |
35 | + font-size: 8pt; | |
36 | + font-weight: 400; | |
37 | + font-style: normal; | |
38 | + text-decoration: none; | |
39 | + font-family: '宋体'; | |
40 | +} | |
41 | +.font5 { | |
42 | + color: #00f; | |
43 | + font-size: 11pt; | |
44 | + font-weight: 400; | |
45 | + font-style: normal; | |
46 | + text-decoration: underline; | |
47 | + font-family: '宋体'; | |
48 | +} | |
49 | +.font6 { | |
50 | + color: #800080; | |
51 | + font-size: 11pt; | |
52 | + font-weight: 400; | |
53 | + font-style: normal; | |
54 | + text-decoration: underline; | |
55 | + font-family: '宋体'; | |
56 | +} | |
57 | +.font7 { | |
58 | + color: #000; | |
59 | + font-size: 11pt; | |
60 | + font-weight: 400; | |
61 | + font-style: normal; | |
62 | + text-decoration: none; | |
63 | + font-family: '宋体'; | |
64 | +} | |
65 | +.font8 { | |
66 | + color: #f00; | |
67 | + font-size: 11pt; | |
68 | + font-weight: 400; | |
69 | + font-style: normal; | |
70 | + text-decoration: none; | |
71 | + font-family: '宋体'; | |
72 | +} | |
73 | +.font9 { | |
74 | + color: #44546a; | |
75 | + font-size: 18pt; | |
76 | + font-weight: 700; | |
77 | + font-style: normal; | |
78 | + text-decoration: none; | |
79 | + font-family: '宋体'; | |
80 | +} | |
81 | +.font10 { | |
82 | + color: #7f7f7f; | |
83 | + font-size: 11pt; | |
84 | + font-weight: 400; | |
85 | + font-style: italic; | |
86 | + text-decoration: none; | |
87 | + font-family: '宋体'; | |
88 | +} | |
89 | +.font11 { | |
90 | + color: #44546a; | |
91 | + font-size: 15pt; | |
92 | + font-weight: 700; | |
93 | + font-style: normal; | |
94 | + text-decoration: none; | |
95 | + font-family: '宋体'; | |
96 | +} | |
97 | +.font12 { | |
98 | + color: #44546a; | |
99 | + font-size: 13pt; | |
100 | + font-weight: 700; | |
101 | + font-style: normal; | |
102 | + text-decoration: none; | |
103 | + font-family: '宋体'; | |
104 | +} | |
105 | +.font13 { | |
106 | + color: #44546a; | |
107 | + font-size: 11pt; | |
108 | + font-weight: 700; | |
109 | + font-style: normal; | |
110 | + text-decoration: none; | |
111 | + font-family: '宋体'; | |
112 | +} | |
113 | +.font14 { | |
114 | + color: #3f3f76; | |
115 | + font-size: 11pt; | |
116 | + font-weight: 400; | |
117 | + font-style: normal; | |
118 | + text-decoration: none; | |
119 | + font-family: '宋体'; | |
120 | +} | |
121 | +.font15 { | |
122 | + color: #3f3f3f; | |
123 | + font-size: 11pt; | |
124 | + font-weight: 700; | |
125 | + font-style: normal; | |
126 | + text-decoration: none; | |
127 | + font-family: '宋体'; | |
128 | +} | |
129 | +.font16 { | |
130 | + color: #fa7d00; | |
131 | + font-size: 11pt; | |
132 | + font-weight: 700; | |
133 | + font-style: normal; | |
134 | + text-decoration: none; | |
135 | + font-family: '宋体'; | |
136 | +} | |
137 | +.font17 { | |
138 | + color: #fff; | |
139 | + font-size: 11pt; | |
140 | + font-weight: 700; | |
141 | + font-style: normal; | |
142 | + text-decoration: none; | |
143 | + font-family: '宋体'; | |
144 | +} | |
145 | +.font18 { | |
146 | + color: #fa7d00; | |
147 | + font-size: 11pt; | |
148 | + font-weight: 400; | |
149 | + font-style: normal; | |
150 | + text-decoration: none; | |
151 | + font-family: '宋体'; | |
152 | +} | |
153 | +.font19 { | |
154 | + color: #000; | |
155 | + font-size: 11pt; | |
156 | + font-weight: 700; | |
157 | + font-style: normal; | |
158 | + text-decoration: none; | |
159 | + font-family: '宋体'; | |
160 | +} | |
161 | +.font20 { | |
162 | + color: #006100; | |
163 | + font-size: 11pt; | |
164 | + font-weight: 400; | |
165 | + font-style: normal; | |
166 | + text-decoration: none; | |
167 | + font-family: '宋体'; | |
168 | +} | |
169 | +.font21 { | |
170 | + color: #9c0006; | |
171 | + font-size: 11pt; | |
172 | + font-weight: 400; | |
173 | + font-style: normal; | |
174 | + text-decoration: none; | |
175 | + font-family: '宋体'; | |
176 | +} | |
177 | +.font22 { | |
178 | + color: #9c6500; | |
179 | + font-size: 11pt; | |
180 | + font-weight: 400; | |
181 | + font-style: normal; | |
182 | + text-decoration: none; | |
183 | + font-family: '宋体'; | |
184 | +} | |
185 | +.font23 { | |
186 | + color: #fff; | |
187 | + font-size: 11pt; | |
188 | + font-weight: 400; | |
189 | + font-style: normal; | |
190 | + text-decoration: none; | |
191 | + font-family: '宋体'; | |
192 | +} | |
193 | +.font24 { | |
194 | + color: #000; | |
195 | + font-size: 11pt; | |
196 | + font-weight: 400; | |
197 | + font-style: normal; | |
198 | + text-decoration: none; | |
199 | + font-family: '宋体'; | |
200 | +} | |
201 | +.style0 { | |
202 | + text-align: general; | |
203 | + vertical-align: middle; | |
204 | + white-space: nowrap; | |
205 | + color: windowtext; | |
206 | + font-size: 12pt; | |
207 | + font-weight: 400; | |
208 | + font-style: normal; | |
209 | + text-decoration: none; | |
210 | + font-family: '宋体'; | |
211 | + border: none; | |
212 | +} | |
213 | +.style21 { | |
214 | + color: #00f; | |
215 | + font-size: 11pt; | |
216 | + font-weight: 400; | |
217 | + font-style: normal; | |
218 | + text-decoration: underline; | |
219 | + font-family: '宋体'; | |
220 | +} | |
221 | +.style22 { | |
222 | + color: #800080; | |
223 | + font-size: 11pt; | |
224 | + font-weight: 400; | |
225 | + font-style: normal; | |
226 | + text-decoration: underline; | |
227 | + font-family: '宋体'; | |
228 | +} | |
229 | +.style23 { | |
230 | + background: #ffc; | |
231 | + border: 0.5pt solid #b2b2b2; | |
232 | +} | |
233 | +.style24 { | |
234 | + color: #f00; | |
235 | + font-size: 11pt; | |
236 | + font-weight: 400; | |
237 | + font-style: normal; | |
238 | + text-decoration: none; | |
239 | + font-family: '宋体'; | |
240 | +} | |
241 | +.style25 { | |
242 | + color: #44546a; | |
243 | + font-size: 18pt; | |
244 | + font-weight: 700; | |
245 | + font-style: normal; | |
246 | + text-decoration: none; | |
247 | + font-family: '宋体'; | |
248 | +} | |
249 | +.style26 { | |
250 | + color: #7f7f7f; | |
251 | + font-size: 11pt; | |
252 | + font-weight: 400; | |
253 | + font-style: italic; | |
254 | + text-decoration: none; | |
255 | + font-family: '宋体'; | |
256 | +} | |
257 | +.style27 { | |
258 | + color: #44546a; | |
259 | + font-size: 15pt; | |
260 | + font-weight: 700; | |
261 | + font-style: normal; | |
262 | + text-decoration: none; | |
263 | + font-family: '宋体'; | |
264 | + border-bottom: 1pt solid #5b9bd5; | |
265 | +} | |
266 | +.style28 { | |
267 | + color: #44546a; | |
268 | + font-size: 13pt; | |
269 | + font-weight: 700; | |
270 | + font-style: normal; | |
271 | + text-decoration: none; | |
272 | + font-family: '宋体'; | |
273 | + border-bottom: 1pt solid #5b9bd5; | |
274 | +} | |
275 | +.style29 { | |
276 | + color: #44546a; | |
277 | + font-size: 11pt; | |
278 | + font-weight: 700; | |
279 | + font-style: normal; | |
280 | + text-decoration: none; | |
281 | + font-family: '宋体'; | |
282 | + border-bottom: 1pt solid #acccea; | |
283 | +} | |
284 | +.style30 { | |
285 | + color: #44546a; | |
286 | + font-size: 11pt; | |
287 | + font-weight: 700; | |
288 | + font-style: normal; | |
289 | + text-decoration: none; | |
290 | + font-family: '宋体'; | |
291 | +} | |
292 | +.style31 { | |
293 | + background: #fc9; | |
294 | + color: #3f3f76; | |
295 | + font-size: 11pt; | |
296 | + font-weight: 400; | |
297 | + font-style: normal; | |
298 | + text-decoration: none; | |
299 | + font-family: '宋体'; | |
300 | + border: 0.5pt solid #7f7f7f; | |
301 | +} | |
302 | +.style32 { | |
303 | + background: #f2f2f2; | |
304 | + color: #3f3f3f; | |
305 | + font-size: 11pt; | |
306 | + font-weight: 700; | |
307 | + font-style: normal; | |
308 | + text-decoration: none; | |
309 | + font-family: '宋体'; | |
310 | + border: 0.5pt solid #3f3f3f; | |
311 | +} | |
312 | +.style33 { | |
313 | + background: #f2f2f2; | |
314 | + color: #fa7d00; | |
315 | + font-size: 11pt; | |
316 | + font-weight: 700; | |
317 | + font-style: normal; | |
318 | + text-decoration: none; | |
319 | + font-family: '宋体'; | |
320 | + border: 0.5pt solid #7f7f7f; | |
321 | +} | |
322 | +.style34 { | |
323 | + background: #a5a5a5; | |
324 | + color: #fff; | |
325 | + font-size: 11pt; | |
326 | + font-weight: 700; | |
327 | + font-style: normal; | |
328 | + text-decoration: none; | |
329 | + font-family: '宋体'; | |
330 | + border: 2pt double #3f3f3f; | |
331 | +} | |
332 | +.style35 { | |
333 | + color: #fa7d00; | |
334 | + font-size: 11pt; | |
335 | + font-weight: 400; | |
336 | + font-style: normal; | |
337 | + text-decoration: none; | |
338 | + font-family: '宋体'; | |
339 | + border-bottom: 2pt double #ff8001; | |
340 | +} | |
341 | +.style36 { | |
342 | + color: #000; | |
343 | + font-size: 11pt; | |
344 | + font-weight: 700; | |
345 | + font-style: normal; | |
346 | + text-decoration: none; | |
347 | + font-family: '宋体'; | |
348 | + border-top: 0.5pt solid #5b9bd5; | |
349 | + border-bottom: 2pt double #5b9bd5; | |
350 | +} | |
351 | +.style37 { | |
352 | + background: #c6efce; | |
353 | + color: #006100; | |
354 | + font-size: 11pt; | |
355 | + font-weight: 400; | |
356 | + font-style: normal; | |
357 | + text-decoration: none; | |
358 | + font-family: '宋体'; | |
359 | +} | |
360 | +.style38 { | |
361 | + background: #ffc7ce; | |
362 | + color: #9c0006; | |
363 | + font-size: 11pt; | |
364 | + font-weight: 400; | |
365 | + font-style: normal; | |
366 | + text-decoration: none; | |
367 | + font-family: '宋体'; | |
368 | +} | |
369 | +.style39 { | |
370 | + background: #ffeb9c; | |
371 | + color: #9c6500; | |
372 | + font-size: 11pt; | |
373 | + font-weight: 400; | |
374 | + font-style: normal; | |
375 | + text-decoration: none; | |
376 | + font-family: '宋体'; | |
377 | +} | |
378 | +.style40 { | |
379 | + background: #5b9bd5; | |
380 | + color: #fff; | |
381 | + font-size: 11pt; | |
382 | + font-weight: 400; | |
383 | + font-style: normal; | |
384 | + text-decoration: none; | |
385 | + font-family: '宋体'; | |
386 | +} | |
387 | +.style41 { | |
388 | + background: #ddebf7; | |
389 | + color: #000; | |
390 | + font-size: 11pt; | |
391 | + font-weight: 400; | |
392 | + font-style: normal; | |
393 | + text-decoration: none; | |
394 | + font-family: '宋体'; | |
395 | +} | |
396 | +.style42 { | |
397 | + background: #bdd7ee; | |
398 | + color: #000; | |
399 | + font-size: 11pt; | |
400 | + font-weight: 400; | |
401 | + font-style: normal; | |
402 | + text-decoration: none; | |
403 | + font-family: '宋体'; | |
404 | +} | |
405 | +.style43 { | |
406 | + background: #9bc2e6; | |
407 | + color: #fff; | |
408 | + font-size: 11pt; | |
409 | + font-weight: 400; | |
410 | + font-style: normal; | |
411 | + text-decoration: none; | |
412 | + font-family: '宋体'; | |
413 | +} | |
414 | +.style44 { | |
415 | + background: #ed7d31; | |
416 | + color: #fff; | |
417 | + font-size: 11pt; | |
418 | + font-weight: 400; | |
419 | + font-style: normal; | |
420 | + text-decoration: none; | |
421 | + font-family: '宋体'; | |
422 | +} | |
423 | +.style45 { | |
424 | + background: #fce4d6; | |
425 | + color: #000; | |
426 | + font-size: 11pt; | |
427 | + font-weight: 400; | |
428 | + font-style: normal; | |
429 | + text-decoration: none; | |
430 | + font-family: '宋体'; | |
431 | +} | |
432 | +.style46 { | |
433 | + background: #f8cbad; | |
434 | + color: #000; | |
435 | + font-size: 11pt; | |
436 | + font-weight: 400; | |
437 | + font-style: normal; | |
438 | + text-decoration: none; | |
439 | + font-family: '宋体'; | |
440 | +} | |
441 | +.style47 { | |
442 | + background: #f4b084; | |
443 | + color: #fff; | |
444 | + font-size: 11pt; | |
445 | + font-weight: 400; | |
446 | + font-style: normal; | |
447 | + text-decoration: none; | |
448 | + font-family: '宋体'; | |
449 | +} | |
450 | +.style48 { | |
451 | + background: #a5a5a5; | |
452 | + color: #fff; | |
453 | + font-size: 11pt; | |
454 | + font-weight: 400; | |
455 | + font-style: normal; | |
456 | + text-decoration: none; | |
457 | + font-family: '宋体'; | |
458 | +} | |
459 | +.style49 { | |
460 | + background: #ededed; | |
461 | + color: #000; | |
462 | + font-size: 11pt; | |
463 | + font-weight: 400; | |
464 | + font-style: normal; | |
465 | + text-decoration: none; | |
466 | + font-family: '宋体'; | |
467 | +} | |
468 | +.style50 { | |
469 | + background: #dbdbdb; | |
470 | + color: #000; | |
471 | + font-size: 11pt; | |
472 | + font-weight: 400; | |
473 | + font-style: normal; | |
474 | + text-decoration: none; | |
475 | + font-family: '宋体'; | |
476 | +} | |
477 | +.style51 { | |
478 | + background: #c9c9c9; | |
479 | + color: #fff; | |
480 | + font-size: 11pt; | |
481 | + font-weight: 400; | |
482 | + font-style: normal; | |
483 | + text-decoration: none; | |
484 | + font-family: '宋体'; | |
485 | +} | |
486 | +.style52 { | |
487 | + background: #ffc000; | |
488 | + color: #fff; | |
489 | + font-size: 11pt; | |
490 | + font-weight: 400; | |
491 | + font-style: normal; | |
492 | + text-decoration: none; | |
493 | + font-family: '宋体'; | |
494 | +} | |
495 | +.style53 { | |
496 | + background: #fff2cc; | |
497 | + color: #000; | |
498 | + font-size: 11pt; | |
499 | + font-weight: 400; | |
500 | + font-style: normal; | |
501 | + text-decoration: none; | |
502 | + font-family: '宋体'; | |
503 | +} | |
504 | +.style54 { | |
505 | + background: #ffe699; | |
506 | + color: #000; | |
507 | + font-size: 11pt; | |
508 | + font-weight: 400; | |
509 | + font-style: normal; | |
510 | + text-decoration: none; | |
511 | + font-family: '宋体'; | |
512 | +} | |
513 | +.style55 { | |
514 | + background: #ffd966; | |
515 | + color: #fff; | |
516 | + font-size: 11pt; | |
517 | + font-weight: 400; | |
518 | + font-style: normal; | |
519 | + text-decoration: none; | |
520 | + font-family: '宋体'; | |
521 | +} | |
522 | +.style56 { | |
523 | + background: #4472c4; | |
524 | + color: #fff; | |
525 | + font-size: 11pt; | |
526 | + font-weight: 400; | |
527 | + font-style: normal; | |
528 | + text-decoration: none; | |
529 | + font-family: '宋体'; | |
530 | +} | |
531 | +.style57 { | |
532 | + background: #d9e1f2; | |
533 | + color: #000; | |
534 | + font-size: 11pt; | |
535 | + font-weight: 400; | |
536 | + font-style: normal; | |
537 | + text-decoration: none; | |
538 | + font-family: '宋体'; | |
539 | +} | |
540 | +.style58 { | |
541 | + background: #b4c6e7; | |
542 | + color: #000; | |
543 | + font-size: 11pt; | |
544 | + font-weight: 400; | |
545 | + font-style: normal; | |
546 | + text-decoration: none; | |
547 | + font-family: '宋体'; | |
548 | +} | |
549 | +.style59 { | |
550 | + background: #8ea9db; | |
551 | + color: #fff; | |
552 | + font-size: 11pt; | |
553 | + font-weight: 400; | |
554 | + font-style: normal; | |
555 | + text-decoration: none; | |
556 | + font-family: '宋体'; | |
557 | +} | |
558 | +.style60 { | |
559 | + background: #70ad47; | |
560 | + color: #fff; | |
561 | + font-size: 11pt; | |
562 | + font-weight: 400; | |
563 | + font-style: normal; | |
564 | + text-decoration: none; | |
565 | + font-family: '宋体'; | |
566 | +} | |
567 | +.style61 { | |
568 | + background: #e2efda; | |
569 | + color: #000; | |
570 | + font-size: 11pt; | |
571 | + font-weight: 400; | |
572 | + font-style: normal; | |
573 | + text-decoration: none; | |
574 | + font-family: '宋体'; | |
575 | +} | |
576 | +.style62 { | |
577 | + background: #c6e0b4; | |
578 | + color: #000; | |
579 | + font-size: 11pt; | |
580 | + font-weight: 400; | |
581 | + font-style: normal; | |
582 | + text-decoration: none; | |
583 | + font-family: '宋体'; | |
584 | +} | |
585 | +.style63 { | |
586 | + background: #a9d08e; | |
587 | + color: #fff; | |
588 | + font-size: 11pt; | |
589 | + font-weight: 400; | |
590 | + font-style: normal; | |
591 | + text-decoration: none; | |
592 | + font-family: '宋体'; | |
593 | +} | |
594 | +td { | |
595 | + padding-top: 1px; | |
596 | + padding-right: 1px; | |
597 | + padding-left: 1px; | |
598 | + text-align: general; | |
599 | + vertical-align: middle; | |
600 | + white-space: nowrap; | |
601 | + color: windowtext; | |
602 | + font-size: 12pt; | |
603 | + font-weight: 400; | |
604 | + font-style: normal; | |
605 | + text-decoration: none; | |
606 | + font-family: '宋体'; | |
607 | + border: none; | |
608 | +} | |
609 | +.xl65 { | |
610 | + text-align: center; | |
611 | + font-size: 16pt; | |
612 | +} | |
613 | +.xl66 { | |
614 | + text-align: center; | |
615 | + font-size: 10pt; | |
616 | +} | |
617 | +.xl67 { | |
618 | + text-align: center; | |
619 | + font-size: 14pt; | |
620 | +} | |
621 | +.xl68 { | |
622 | + text-align: center; | |
623 | + font-size: 14pt; | |
624 | +} | |
625 | +.xl69 { | |
626 | + text-align: left; | |
627 | + font-size: 8pt; | |
628 | +} | |
629 | +.xl70 { | |
630 | + text-align: left; | |
631 | + font-size: 8pt; | |
632 | +} | |
633 | +.xl71 { | |
634 | + text-align: center; | |
635 | + font-size: 8pt; | |
636 | + border: 0.5pt solid windowtext; | |
637 | +} | |
638 | +.xl72 { | |
639 | + text-align: center; | |
640 | + font-size: 8pt; | |
641 | + border: 0.5pt solid windowtext; | |
642 | + white-space: normal; | |
643 | +} | |
644 | +.xl73 { | |
645 | + white-space: normal; | |
646 | + font-size: 8pt; | |
647 | + border: 0.5pt solid windowtext; | |
648 | +} | |
649 | +.xl74 { | |
650 | + text-align: center; | |
651 | + white-space: normal; | |
652 | + font-size: 8pt; | |
653 | + border: 0.5pt solid windowtext; | |
654 | +} | |
655 | +.xl75 { | |
656 | + text-align: center; | |
657 | + white-space: normal; | |
658 | + font-size: 8pt; | |
659 | + border: 0.5pt solid windowtext; | |
660 | +} | |
661 | +.xl76 { | |
662 | + font-size: 8pt; | |
663 | +} | |
664 | +.xl77 { | |
665 | + font-size: 8pt; | |
666 | +} | |
667 | +.xl78 { | |
668 | + text-align: center; | |
669 | + font-size: 8pt; | |
670 | +} | ... | ... |
src/services/order.ts
... | ... | @@ -2,12 +2,14 @@ import axios from 'axios'; |
2 | 2 | |
3 | 3 | export const orderExport = async ( |
4 | 4 | url: any = '', |
5 | + fileName:any='', | |
6 | + method:any='', | |
5 | 7 | data: any = {}, |
6 | 8 | exportLoadingDestory: any, |
7 | 9 | ) => { |
8 | 10 | axios({ |
9 | 11 | url: url, |
10 | - method: 'post', | |
12 | + method: method, | |
11 | 13 | responseType: 'blob', |
12 | 14 | headers: { Authorization: localStorage.getItem('token') }, |
13 | 15 | data, |
... | ... | @@ -18,7 +20,7 @@ export const orderExport = async ( |
18 | 20 | const downloadUrl = window.URL.createObjectURL(blob); |
19 | 21 | const a = document.createElement('a'); |
20 | 22 | a.href = downloadUrl; |
21 | - a.download = '订单.xlsx'; // 你可以为文件命名 | |
23 | + a.download = fileName; // 你可以为文件命名 | |
22 | 24 | document.body.appendChild(a); |
23 | 25 | a.click(); // 模拟点击操作来下载文件 |
24 | 26 | URL.revokeObjectURL(downloadUrl); // 释放掉 blob 对象所占用的内存 | ... | ... |
src/services/request.ts
... | ... | @@ -64,8 +64,8 @@ import type { |
64 | 64 | OrderBaseInfoQueryVO, |
65 | 65 | OrderUpdateVO, |
66 | 66 | OrderUnlockFieldApplyVO, |
67 | - OrderStagesDelDo, | |
68 | 67 | OrderStagesFromDo, |
68 | + OrderStagesDelDo, | |
69 | 69 | OrderStagesSelDo, |
70 | 70 | OrderStagesPayWay, |
71 | 71 | OrderStagesPayWayDo, |
... | ... | @@ -6058,6 +6058,77 @@ export const postOrderErpOrderQueryById = /* #__PURE__ */ (() => { |
6058 | 6058 | return request; |
6059 | 6059 | })(); |
6060 | 6060 | |
6061 | +/** @description request parameter type for postOrderErpOrderStagesAdd */ | |
6062 | +export interface PostOrderErpOrderStagesAddOption { | |
6063 | + /** | |
6064 | + * @description | |
6065 | + * orderStagesFromDo | |
6066 | + */ | |
6067 | + body: { | |
6068 | + /** | |
6069 | + @description | |
6070 | + orderStagesFromDo */ | |
6071 | + orderStagesFromDo: OrderStagesFromDo; | |
6072 | + }; | |
6073 | +} | |
6074 | + | |
6075 | +/** @description response type for postOrderErpOrderStagesAdd */ | |
6076 | +export interface PostOrderErpOrderStagesAddResponse { | |
6077 | + /** | |
6078 | + * @description | |
6079 | + * OK | |
6080 | + */ | |
6081 | + 200: ServerResult; | |
6082 | + /** | |
6083 | + * @description | |
6084 | + * Created | |
6085 | + */ | |
6086 | + 201: any; | |
6087 | + /** | |
6088 | + * @description | |
6089 | + * Unauthorized | |
6090 | + */ | |
6091 | + 401: any; | |
6092 | + /** | |
6093 | + * @description | |
6094 | + * Forbidden | |
6095 | + */ | |
6096 | + 403: any; | |
6097 | + /** | |
6098 | + * @description | |
6099 | + * Not Found | |
6100 | + */ | |
6101 | + 404: any; | |
6102 | +} | |
6103 | + | |
6104 | +export type PostOrderErpOrderStagesAddResponseSuccess = | |
6105 | + PostOrderErpOrderStagesAddResponse[200]; | |
6106 | +/** | |
6107 | + * @description | |
6108 | + * 添加或者修改分期账单 | |
6109 | + * @tags order-stages-controller | |
6110 | + * @produces * | |
6111 | + * @consumes application/json | |
6112 | + */ | |
6113 | +export const postOrderErpOrderStagesAdd = /* #__PURE__ */ (() => { | |
6114 | + const method = "post"; | |
6115 | + const url = "/order/erp/orderStages/add"; | |
6116 | + function request( | |
6117 | + option: PostOrderErpOrderStagesAddOption | |
6118 | + ): Promise<PostOrderErpOrderStagesAddResponseSuccess> { | |
6119 | + return requester(request.url, { | |
6120 | + method: request.method, | |
6121 | + ...option, | |
6122 | + }) as unknown as Promise<PostOrderErpOrderStagesAddResponseSuccess>; | |
6123 | + } | |
6124 | + | |
6125 | + /** http method */ | |
6126 | + request.method = method; | |
6127 | + /** request url */ | |
6128 | + request.url = url; | |
6129 | + return request; | |
6130 | +})(); | |
6131 | + | |
6061 | 6132 | /** @description request parameter type for deleteOrderErpOrderStagesDelect */ |
6062 | 6133 | export interface DeleteOrderErpOrderStagesDelectOption { |
6063 | 6134 | /** | ... | ... |