Commit e07211fe17c903b6fce447a524d5d28ac720dbe6
1 parent
4a58703c
feat: 添加批处理
Showing
11 changed files
with
187 additions
and
81 deletions
src/access.ts
@@ -13,7 +13,7 @@ export default (initialState: API.UserInfo) => { | @@ -13,7 +13,7 @@ export default (initialState: API.UserInfo) => { | ||
13 | roleSmallVO?.code === 'salesRepresentative'; | 13 | roleSmallVO?.code === 'salesRepresentative'; |
14 | return { | 14 | return { |
15 | canReadAdmin: canReadAdmin, | 15 | canReadAdmin: canReadAdmin, |
16 | - canReadProcure: canReadProcure, | 16 | + canReadProcure: canReadProcure || canReadAdmin, |
17 | canReadLinda: username === 'Linda', | 17 | canReadLinda: username === 'Linda', |
18 | canReadAdminAndFinance: canReadFinance || canReadAdmin, | 18 | canReadAdminAndFinance: canReadFinance || canReadAdmin, |
19 | canReadSales: canReadSales, | 19 | canReadSales: canReadSales, |
src/pages/Instalment/components/checkModal/TableCheckModal.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, isShow }) => { | ||
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={ | ||
25 | + <Button type="primary" disabled={isShow}> | ||
26 | + 批量审核 | ||
27 | + </Button> | ||
28 | + } | ||
29 | + modalProps={{ | ||
30 | + okText: '通过', | ||
31 | + cancelText: '驳回', | ||
32 | + destroyOnClose: true, | ||
33 | + }} | ||
34 | + submitter={{ | ||
35 | + render: (props, defaultDoms) => { | ||
36 | + let myDoms = []; | ||
37 | + myDoms.push( | ||
38 | + <Button | ||
39 | + key="驳回" | ||
40 | + onClick={async () => { | ||
41 | + if (id?.length === 0) { | ||
42 | + message.error('没有可审核的订单'); | ||
43 | + toReload(); | ||
44 | + } else { | ||
45 | + const res = await postOrderErpOrderStagesCheckOrderStages({ | ||
46 | + data: { | ||
47 | + ids: id, | ||
48 | + isPass: false, | ||
49 | + mark: form.getFieldValue('mark'), | ||
50 | + }, | ||
51 | + }); | ||
52 | + await waitTime(2000); | ||
53 | + if (res.message === '成功') { | ||
54 | + message.success('操作成功'); | ||
55 | + } | ||
56 | + toReload(); | ||
57 | + } | ||
58 | + return; | ||
59 | + }} | ||
60 | + > | ||
61 | + 驳回 | ||
62 | + </Button>, | ||
63 | + ); | ||
64 | + myDoms.push(defaultDoms[1]); | ||
65 | + return myDoms; | ||
66 | + }, | ||
67 | + }} | ||
68 | + onFinish={async (values) => { | ||
69 | + if (id?.length === 0) { | ||
70 | + message.error('没有可审核的订单'); | ||
71 | + return true; | ||
72 | + } else { | ||
73 | + const res = await postOrderErpOrderStagesCheckOrderStages({ | ||
74 | + data: { | ||
75 | + ids: id, | ||
76 | + isPass: true, | ||
77 | + mark: values.mark, | ||
78 | + }, | ||
79 | + }); | ||
80 | + await waitTime(2000); | ||
81 | + if (res.message === '成功') { | ||
82 | + message.success('操作成功'); | ||
83 | + } | ||
84 | + toReload(); | ||
85 | + return true; | ||
86 | + } | ||
87 | + }} | ||
88 | + > | ||
89 | + <ProFormTextArea | ||
90 | + width="lg" | ||
91 | + name="mark" | ||
92 | + label="备注" | ||
93 | + tooltip="请特别注意订单总金额与订单金额。" | ||
94 | + placeholder="请输入名称" | ||
95 | + /> | ||
96 | + </ModalForm> | ||
97 | + </Space> | ||
98 | + ); | ||
99 | +}; |
src/pages/Instalment/components/checkModal/checkModal.tsx
@@ -36,7 +36,7 @@ export default ({ id, toReload }) => { | @@ -36,7 +36,7 @@ export default ({ id, toReload }) => { | ||
36 | onClick={async () => { | 36 | onClick={async () => { |
37 | const res = await postOrderErpOrderStagesCheckOrderStages({ | 37 | const res = await postOrderErpOrderStagesCheckOrderStages({ |
38 | data: { | 38 | data: { |
39 | - id: id, | 39 | + ids: id, |
40 | isPass: false, | 40 | isPass: false, |
41 | mark: form.getFieldValue('mark'), | 41 | mark: form.getFieldValue('mark'), |
42 | }, | 42 | }, |
@@ -59,7 +59,7 @@ export default ({ id, toReload }) => { | @@ -59,7 +59,7 @@ export default ({ id, toReload }) => { | ||
59 | onFinish={async (values) => { | 59 | onFinish={async (values) => { |
60 | const res = await postOrderErpOrderStagesCheckOrderStages({ | 60 | const res = await postOrderErpOrderStagesCheckOrderStages({ |
61 | data: { | 61 | data: { |
62 | - id: id, | 62 | + ids: id, |
63 | isPass: true, | 63 | isPass: true, |
64 | mark: values.mark, | 64 | mark: values.mark, |
65 | }, | 65 | }, |
src/pages/Instalment/components/detail/detail.tsx
@@ -186,7 +186,6 @@ export default ({ toReload }) => { | @@ -186,7 +186,6 @@ export default ({ toReload }) => { | ||
186 | }} | 186 | }} |
187 | submitTimeout={2000} | 187 | submitTimeout={2000} |
188 | onFinish={async (values) => { | 188 | onFinish={async (values) => { |
189 | - console.log(values); | ||
190 | if (editProductBody.length === 0) { | 189 | if (editProductBody.length === 0) { |
191 | message.error('请填写产品数据'); | 190 | message.error('请填写产品数据'); |
192 | return false; | 191 | return false; |
@@ -268,11 +267,9 @@ export default ({ toReload }) => { | @@ -268,11 +267,9 @@ export default ({ toReload }) => { | ||
268 | let returnOssID = await postOrderErpOrderStagesSearch({ | 267 | let returnOssID = await postOrderErpOrderStagesSearch({ |
269 | data: { contract: values.contract || contextBody.contract }, | 268 | data: { contract: values.contract || contextBody.contract }, |
270 | }); | 269 | }); |
271 | - console.log(returnOssID.data); | ||
272 | - | ||
273 | if (returnOssID) { | 270 | if (returnOssID) { |
274 | makeEnd = remakeValue.map((item) => { | 271 | makeEnd = remakeValue.map((item) => { |
275 | - return { ...item, ossId: returnOssID.data[0].id }; | 272 | + return { ...item, ossId: returnOssID.data.data[0].id }; |
276 | }); | 273 | }); |
277 | } | 274 | } |
278 | }; | 275 | }; |
src/pages/Instalment/components/edit/edit.tsx
@@ -74,7 +74,7 @@ export default ({ currentContract, toReload, showTarget }) => { | @@ -74,7 +74,7 @@ export default ({ currentContract, toReload, showTarget }) => { | ||
74 | const res = await postOrderErpOrderStagesSearch({ | 74 | const res = await postOrderErpOrderStagesSearch({ |
75 | data: { contract: currentContract }, | 75 | data: { contract: currentContract }, |
76 | }); | 76 | }); |
77 | - const context = res.data[0]; | 77 | + const context = res.data.data[0]; |
78 | 78 | ||
79 | if (context?.contract !== null) { | 79 | if (context?.contract !== null) { |
80 | setContextBody(context); | 80 | setContextBody(context); |
@@ -84,7 +84,6 @@ export default ({ currentContract, toReload, showTarget }) => { | @@ -84,7 +84,6 @@ export default ({ currentContract, toReload, showTarget }) => { | ||
84 | } | 84 | } |
85 | 85 | ||
86 | function setSave(value) { | 86 | function setSave(value) { |
87 | - console.log(value); | ||
88 | setOtherBody(value); | 87 | setOtherBody(value); |
89 | } | 88 | } |
90 | 89 | ||
@@ -143,8 +142,7 @@ export default ({ currentContract, toReload, showTarget }) => { | @@ -143,8 +142,7 @@ export default ({ currentContract, toReload, showTarget }) => { | ||
143 | const res = await postOrderErpOrderStagesSearch({ | 142 | const res = await postOrderErpOrderStagesSearch({ |
144 | data: { contract: value }, | 143 | data: { contract: value }, |
145 | }); | 144 | }); |
146 | - const context = res.data[0]; | ||
147 | - console.log(context); | 145 | + const context = res.data.data[0]; |
148 | if (context?.contract !== null) { | 146 | if (context?.contract !== null) { |
149 | setContextBody(context); | 147 | setContextBody(context); |
150 | setTotal(context?.totalPrice); | 148 | setTotal(context?.totalPrice); |
@@ -155,7 +153,7 @@ export default ({ currentContract, toReload, showTarget }) => { | @@ -155,7 +153,7 @@ export default ({ currentContract, toReload, showTarget }) => { | ||
155 | const res = await postOrderErpOrderStagesSearch({ | 153 | const res = await postOrderErpOrderStagesSearch({ |
156 | data: { contract: currentContract }, | 154 | data: { contract: currentContract }, |
157 | }); | 155 | }); |
158 | - const context = res.data[0]; | 156 | + const context = res.data.data[0]; |
159 | if (context?.contract !== null) { | 157 | if (context?.contract !== null) { |
160 | setContextBody(context); | 158 | setContextBody(context); |
161 | setTotal(context?.totalPrice); | 159 | setTotal(context?.totalPrice); |
@@ -194,7 +192,6 @@ export default ({ currentContract, toReload, showTarget }) => { | @@ -194,7 +192,6 @@ export default ({ currentContract, toReload, showTarget }) => { | ||
194 | } | 192 | } |
195 | let remakeValue = []; | 193 | let remakeValue = []; |
196 | const promises = []; | 194 | const promises = []; |
197 | - console.log(otherBody); | ||
198 | otherBody.forEach((item) => { | 195 | otherBody.forEach((item) => { |
199 | let remakeItem = { | 196 | let remakeItem = { |
200 | ossId: contextBody.id, | 197 | ossId: contextBody.id, |
@@ -262,7 +259,6 @@ export default ({ currentContract, toReload, showTarget }) => { | @@ -262,7 +259,6 @@ export default ({ currentContract, toReload, showTarget }) => { | ||
262 | data: { ...toSendEdit }, | 259 | data: { ...toSendEdit }, |
263 | }); | 260 | }); |
264 | if (isSaveOrUpdate.message === '成功') { | 261 | if (isSaveOrUpdate.message === '成功') { |
265 | - console.log('2'); | ||
266 | getBody(toSendEdit.contract); | 262 | getBody(toSendEdit.contract); |
267 | toReload(); | 263 | toReload(); |
268 | } | 264 | } |
src/pages/Instalment/components/payWayDetail/payWayDetail.tsx
@@ -114,7 +114,6 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -114,7 +114,6 @@ export default ({ payBody, thisId, currtSave }) => { | ||
114 | }); | 114 | }); |
115 | return currt; | 115 | return currt; |
116 | }); | 116 | }); |
117 | - // console.log(remake); | ||
118 | setPayWayDetailBody(remake); | 117 | setPayWayDetailBody(remake); |
119 | setIsRetrun(true); | 118 | setIsRetrun(true); |
120 | } | 119 | } |
@@ -147,10 +146,8 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -147,10 +146,8 @@ export default ({ payBody, thisId, currtSave }) => { | ||
147 | payPrice: value[obj.id - 1]?.payPrice, | 146 | payPrice: value[obj.id - 1]?.payPrice, |
148 | }; | 147 | }; |
149 | }); | 148 | }); |
150 | - // console.log(remakeData); | ||
151 | 149 | ||
152 | setPayWayDetailBody(remakeData); | 150 | setPayWayDetailBody(remakeData); |
153 | - // console.log(thisId); | ||
154 | 151 | ||
155 | if (thisId !== null) { | 152 | if (thisId !== null) { |
156 | getOther(thisId, remakeData); | 153 | getOther(thisId, remakeData); |
@@ -162,7 +159,6 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -162,7 +159,6 @@ export default ({ payBody, thisId, currtSave }) => { | ||
162 | }, [payBody]); | 159 | }, [payBody]); |
163 | 160 | ||
164 | // function setCurrtSave(value) { | 161 | // function setCurrtSave(value) { |
165 | - // // console.log(value); | ||
166 | // setIsCurrtSave(payWayDetailBody) | 162 | // setIsCurrtSave(payWayDetailBody) |
167 | // } | 163 | // } |
168 | 164 | ||
@@ -201,7 +197,6 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -201,7 +197,6 @@ export default ({ payBody, thisId, currtSave }) => { | ||
201 | render: (text, record) => { | 197 | render: (text, record) => { |
202 | const handleChange = (value) => { | 198 | const handleChange = (value) => { |
203 | const updatedDataSource = payWayDetailBody.map((item) => { | 199 | const updatedDataSource = payWayDetailBody.map((item) => { |
204 | - console.log(value); | ||
205 | if (item.id === record.id) { | 200 | if (item.id === record.id) { |
206 | return { | 201 | return { |
207 | ...item, | 202 | ...item, |
@@ -210,7 +205,6 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -210,7 +205,6 @@ export default ({ payBody, thisId, currtSave }) => { | ||
210 | } | 205 | } |
211 | return item; | 206 | return item; |
212 | }); | 207 | }); |
213 | - // console.log(updatedDataSource); | ||
214 | 208 | ||
215 | setPayWayDetailBody(updatedDataSource); | 209 | setPayWayDetailBody(updatedDataSource); |
216 | currtSave(updatedDataSource); | 210 | currtSave(updatedDataSource); |
@@ -302,7 +296,6 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -302,7 +296,6 @@ export default ({ payBody, thisId, currtSave }) => { | ||
302 | type: 'multiple', | 296 | type: 'multiple', |
303 | editableKeys, | 297 | editableKeys, |
304 | onSave: async () => { | 298 | onSave: async () => { |
305 | - // console.log(rowKey, data, row); | ||
306 | await waitTime(2000); | 299 | await waitTime(2000); |
307 | }, | 300 | }, |
308 | onChange: setEditableRowKeys, | 301 | onChange: setEditableRowKeys, |
src/pages/Instalment/components/productDetail/productDetail.tsx
@@ -35,9 +35,6 @@ export default ({ productBody, EditProductBody }) => { | @@ -35,9 +35,6 @@ export default ({ productBody, EditProductBody }) => { | ||
35 | } | 35 | } |
36 | } | 36 | } |
37 | function setEditProductBody(value) { | 37 | function setEditProductBody(value) { |
38 | - // console.log(value); | ||
39 | - // console.log(dataSource); | ||
40 | - | ||
41 | const modifiedArray = value.map((obj) => { | 38 | const modifiedArray = value.map((obj) => { |
42 | if (obj.dId && Number(obj.dId) <= 1000) { | 39 | if (obj.dId && Number(obj.dId) <= 1000) { |
43 | return { | 40 | return { |
@@ -53,7 +50,6 @@ export default ({ productBody, EditProductBody }) => { | @@ -53,7 +50,6 @@ export default ({ productBody, EditProductBody }) => { | ||
53 | return { ...obj, price: Number(obj.unitPrice) * Number(obj.count) }; | 50 | return { ...obj, price: Number(obj.unitPrice) * Number(obj.count) }; |
54 | } | 51 | } |
55 | }); | 52 | }); |
56 | - // console.log(modifiedArray); | ||
57 | 53 | ||
58 | EditProductBody(modifiedArray); | 54 | EditProductBody(modifiedArray); |
59 | setDataSource(value); | 55 | setDataSource(value); |
src/pages/Instalment/components/read/read.tsx
@@ -75,18 +75,16 @@ export default ({ currentContract }) => { | @@ -75,18 +75,16 @@ export default ({ currentContract }) => { | ||
75 | const res = await postOrderErpOrderStagesSearch({ | 75 | const res = await postOrderErpOrderStagesSearch({ |
76 | data: { contract: currentContract }, | 76 | data: { contract: currentContract }, |
77 | }); | 77 | }); |
78 | - const context = res.data[0]; | ||
79 | - // console.log(context); | 78 | + const context = res?.data?.data[0]; |
80 | 79 | ||
81 | - if (context.contract !== null) { | 80 | + if (context?.contract !== null) { |
82 | setContextBody(context); | 81 | setContextBody(context); |
83 | - setTotal(context.totalPrice); | ||
84 | - form.setFieldValue('totalPrice', context.totalPrice); | 82 | + setTotal(context?.totalPrice); |
83 | + form.setFieldValue('totalPrice', context?.totalPrice); | ||
85 | } | 84 | } |
86 | } | 85 | } |
87 | 86 | ||
88 | function setSave(value) { | 87 | function setSave(value) { |
89 | - // console.log(value); | ||
90 | setOtherBody(value); | 88 | setOtherBody(value); |
91 | } | 89 | } |
92 | 90 | ||
@@ -140,15 +138,14 @@ export default ({ currentContract }) => { | @@ -140,15 +138,14 @@ export default ({ currentContract }) => { | ||
140 | const res = await postOrderErpOrderStagesSearch({ | 138 | const res = await postOrderErpOrderStagesSearch({ |
141 | data: { contract: currentContract }, | 139 | data: { contract: currentContract }, |
142 | }); | 140 | }); |
143 | - const context = res.data[0]; | ||
144 | - // console.log(context); | 141 | + const context = res.data.data[0]; |
145 | 142 | ||
146 | - if (context.contract !== null) { | 143 | + if (context?.contract !== null) { |
147 | setContextBody(context); | 144 | setContextBody(context); |
148 | - setTotal(context.totalPrice); | ||
149 | - form.setFieldValue('totalPrice', context.totalPrice); | 145 | + setTotal(context?.totalPrice); |
146 | + form.setFieldValue('totalPrice', context?.totalPrice); | ||
150 | } | 147 | } |
151 | - handleInputChange(context.payWay, 0, context.totalPrice); | 148 | + handleInputChange(context?.payWay, 0, context?.totalPrice); |
152 | } | 149 | } |
153 | 150 | ||
154 | useEffect(() => { | 151 | useEffect(() => { |
@@ -156,8 +153,6 @@ export default ({ currentContract }) => { | @@ -156,8 +153,6 @@ export default ({ currentContract }) => { | ||
156 | }, []); | 153 | }, []); |
157 | 154 | ||
158 | function getEditProductBody(value) { | 155 | function getEditProductBody(value) { |
159 | - // console.log(value); | ||
160 | - | ||
161 | setEditProductBody(value); | 156 | setEditProductBody(value); |
162 | let price = 0; | 157 | let price = 0; |
163 | value.map((obj) => (price += obj.count * obj.unitPrice)); | 158 | value.map((obj) => (price += obj.count * obj.unitPrice)); |
@@ -174,7 +169,6 @@ export default ({ currentContract }) => { | @@ -174,7 +169,6 @@ export default ({ currentContract }) => { | ||
174 | autoFocusFirstInput | 169 | autoFocusFirstInput |
175 | modalProps={{ | 170 | modalProps={{ |
176 | destroyOnClose: true, | 171 | destroyOnClose: true, |
177 | - // onCancel: () => console.log('run'), | ||
178 | }} | 172 | }} |
179 | submitter={{ | 173 | submitter={{ |
180 | resetButtonProps: {}, | 174 | resetButtonProps: {}, |
@@ -186,8 +180,6 @@ export default ({ currentContract }) => { | @@ -186,8 +180,6 @@ export default ({ currentContract }) => { | ||
186 | }} | 180 | }} |
187 | submitTimeout={2000} | 181 | submitTimeout={2000} |
188 | onFinish={async (values) => { | 182 | onFinish={async (values) => { |
189 | - // console.log(values); | ||
190 | - // console.log(otherBody); | ||
191 | let remakeValue = []; | 183 | let remakeValue = []; |
192 | // 创建一个用于存储所有异步操作的Promise数组 | 184 | // 创建一个用于存储所有异步操作的Promise数组 |
193 | const promises = []; | 185 | const promises = []; |
@@ -254,8 +246,6 @@ export default ({ currentContract }) => { | @@ -254,8 +246,6 @@ export default ({ currentContract }) => { | ||
254 | }, | 246 | }, |
255 | }); | 247 | }); |
256 | if (res.data) { | 248 | if (res.data) { |
257 | - // console.log(values) | ||
258 | - // console.log(contextBody); | ||
259 | toSendEdit.annex = res.data; | 249 | toSendEdit.annex = res.data; |
260 | } | 250 | } |
261 | } | 251 | } |
@@ -263,7 +253,6 @@ export default ({ currentContract }) => { | @@ -263,7 +253,6 @@ export default ({ currentContract }) => { | ||
263 | data: { ...toSendEdit }, | 253 | data: { ...toSendEdit }, |
264 | }); | 254 | }); |
265 | if (isSaveOrUpdate) { | 255 | if (isSaveOrUpdate) { |
266 | - // console.log(isSaveOrUpdate); | ||
267 | getBody(); | 256 | getBody(); |
268 | } | 257 | } |
269 | await waitTime(2000); | 258 | await waitTime(2000); |
@@ -278,7 +267,7 @@ export default ({ currentContract }) => { | @@ -278,7 +267,7 @@ export default ({ currentContract }) => { | ||
278 | name="vendor" | 267 | name="vendor" |
279 | label="供应商名称" | 268 | label="供应商名称" |
280 | placeholder="请输入" | 269 | placeholder="请输入" |
281 | - initialValue={contextBody.vendor} | 270 | + initialValue={contextBody?.vendor} |
282 | readonly | 271 | readonly |
283 | /> | 272 | /> |
284 | 273 | ||
@@ -287,7 +276,7 @@ export default ({ currentContract }) => { | @@ -287,7 +276,7 @@ export default ({ currentContract }) => { | ||
287 | name="terminal" | 276 | name="terminal" |
288 | label="终端名称" | 277 | label="终端名称" |
289 | placeholder="请输入" | 278 | placeholder="请输入" |
290 | - initialValue={contextBody.terminal} | 279 | + initialValue={contextBody?.terminal} |
291 | readonly | 280 | readonly |
292 | /> | 281 | /> |
293 | 282 | ||
@@ -299,7 +288,7 @@ export default ({ currentContract }) => { | @@ -299,7 +288,7 @@ export default ({ currentContract }) => { | ||
299 | fieldProps={{ | 288 | fieldProps={{ |
300 | format: (value) => value.format('YYYY-MM-DD'), | 289 | format: (value) => value.format('YYYY-MM-DD'), |
301 | }} | 290 | }} |
302 | - initialValue={contextBody.dateRange} | 291 | + initialValue={contextBody?.dateRange} |
303 | readonly | 292 | readonly |
304 | /> | 293 | /> |
305 | 294 | ||
@@ -308,7 +297,7 @@ export default ({ currentContract }) => { | @@ -308,7 +297,7 @@ export default ({ currentContract }) => { | ||
308 | name="payWay" | 297 | name="payWay" |
309 | label="付款比例" | 298 | label="付款比例" |
310 | placeholder="请输入" | 299 | placeholder="请输入" |
311 | - initialValue={contextBody.payWay} | 300 | + initialValue={contextBody?.payWay} |
312 | readonly | 301 | readonly |
313 | onBlur={(e) => { | 302 | onBlur={(e) => { |
314 | handleInputChange(e.target.value, 1); | 303 | handleInputChange(e.target.value, 1); |
@@ -320,7 +309,7 @@ export default ({ currentContract }) => { | @@ -320,7 +309,7 @@ export default ({ currentContract }) => { | ||
320 | name="contract" | 309 | name="contract" |
321 | label="合同编号" | 310 | label="合同编号" |
322 | placeholder="请输入" | 311 | placeholder="请输入" |
323 | - initialValue={contextBody.contract} | 312 | + initialValue={contextBody?.contract} |
324 | readonly | 313 | readonly |
325 | /> | 314 | /> |
326 | 315 | ||
@@ -342,7 +331,7 @@ export default ({ currentContract }) => { | @@ -342,7 +331,7 @@ export default ({ currentContract }) => { | ||
342 | readonly | 331 | readonly |
343 | // rules={[{ required: true, message: '此项为必填项' }]} | 332 | // rules={[{ required: true, message: '此项为必填项' }]} |
344 | // value={contextBody.totalPrice} | 333 | // value={contextBody.totalPrice} |
345 | - initialValue={contextBody.totalPrice} | 334 | + initialValue={contextBody?.totalPrice} |
346 | /> | 335 | /> |
347 | </ProForm.Group> | 336 | </ProForm.Group> |
348 | </ProCard> | 337 | </ProCard> |
@@ -353,7 +342,7 @@ export default ({ currentContract }) => { | @@ -353,7 +342,7 @@ export default ({ currentContract }) => { | ||
353 | bordered | 342 | bordered |
354 | > | 343 | > |
355 | <ProductDetail | 344 | <ProductDetail |
356 | - productBody={contextBody.orderStagesDeviceVoList} | 345 | + productBody={contextBody?.orderStagesDeviceVoList} |
357 | EditProductBody={getEditProductBody} | 346 | EditProductBody={getEditProductBody} |
358 | ></ProductDetail> | 347 | ></ProductDetail> |
359 | </ProCard> | 348 | </ProCard> |
@@ -366,7 +355,7 @@ export default ({ currentContract }) => { | @@ -366,7 +355,7 @@ export default ({ currentContract }) => { | ||
366 | > | 355 | > |
367 | <PayWayDetail | 356 | <PayWayDetail |
368 | payBody={payWayBody} | 357 | payBody={payWayBody} |
369 | - thisId={contextBody.id} | 358 | + thisId={contextBody?.id} |
370 | currtSave={setSave} | 359 | currtSave={setSave} |
371 | ></PayWayDetail> | 360 | ></PayWayDetail> |
372 | </ProCard> | 361 | </ProCard> |
@@ -375,7 +364,7 @@ export default ({ currentContract }) => { | @@ -375,7 +364,7 @@ export default ({ currentContract }) => { | ||
375 | <ProFormTextArea | 364 | <ProFormTextArea |
376 | label="备注" | 365 | label="备注" |
377 | name="remark" | 366 | name="remark" |
378 | - initialValue={contextBody.remark} | 367 | + initialValue={contextBody?.remark} |
379 | readonly | 368 | readonly |
380 | /> | 369 | /> |
381 | </ProCard> | 370 | </ProCard> |
src/pages/Instalment/components/title/title.tsx
@@ -341,7 +341,6 @@ export default () => { | @@ -341,7 +341,6 @@ export default () => { | ||
341 | actionRef={ref} | 341 | actionRef={ref} |
342 | scroll={{ x: 1400, y: 360 }} | 342 | scroll={{ x: 1400, y: 360 }} |
343 | request={async (params) => { | 343 | request={async (params) => { |
344 | - // console.log(params); | ||
345 | if ( | 344 | if ( |
346 | params.id !== null || | 345 | params.id !== null || |
347 | params.contract !== null || | 346 | params.contract !== null || |
@@ -350,9 +349,6 @@ export default () => { | @@ -350,9 +349,6 @@ export default () => { | ||
350 | params.deviceName !== null || | 349 | params.deviceName !== null || |
351 | params.dateRange !== null | 350 | params.dateRange !== null |
352 | ) { | 351 | ) { |
353 | - // console.log(params.id); | ||
354 | - // console.log(params.contract); | ||
355 | - // console.log(params.vendor); | ||
356 | let PostOrderErpOrderStagesSearchOption = { | 352 | let PostOrderErpOrderStagesSearchOption = { |
357 | id: params.id, | 353 | id: params.id, |
358 | contract: params.contract, | 354 | contract: params.contract, |
@@ -580,7 +576,6 @@ export default () => { | @@ -580,7 +576,6 @@ export default () => { | ||
580 | option: { fixed: 'right', disable: true }, | 576 | option: { fixed: 'right', disable: true }, |
581 | }, | 577 | }, |
582 | // onChange(value) { | 578 | // onChange(value) { |
583 | - // console.log('value: ', value); | ||
584 | // }, | 579 | // }, |
585 | }} | 580 | }} |
586 | rowKey="dId" | 581 | rowKey="dId" |
@@ -605,7 +600,6 @@ export default () => { | @@ -605,7 +600,6 @@ export default () => { | ||
605 | }} | 600 | }} |
606 | pagination={{ | 601 | pagination={{ |
607 | pageSize: 10, | 602 | pageSize: 10, |
608 | - // onChange: (page) => console.log(page), | ||
609 | }} | 603 | }} |
610 | dateFormatter="string" | 604 | dateFormatter="string" |
611 | headerTitle={[]} | 605 | headerTitle={[]} |
src/pages/Instalment/components/title/titletest.tsx
@@ -7,8 +7,9 @@ import { orderExport } from '@/services/order'; | @@ -7,8 +7,9 @@ import { orderExport } from '@/services/order'; | ||
7 | import { VerticalAlignTopOutlined } from '@ant-design/icons'; | 7 | import { VerticalAlignTopOutlined } from '@ant-design/icons'; |
8 | import type { ProColumns } from '@ant-design/pro-components'; | 8 | import type { ProColumns } from '@ant-design/pro-components'; |
9 | import { EditableProTable } 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'; | 10 | +import { Button, Space, Table, Tag, message } from 'antd'; |
11 | +import { Key, useRef, useState } from 'react'; | ||
12 | +import TableCheckModal from '../checkModal/TableCheckModal'; | ||
12 | import CheckModal from '../checkModal/checkModal'; | 13 | import CheckModal from '../checkModal/checkModal'; |
13 | import Comfire from '../comfire/comfire'; | 14 | import Comfire from '../comfire/comfire'; |
14 | import AddModel from '../detail/detail'; | 15 | import AddModel from '../detail/detail'; |
@@ -146,6 +147,7 @@ export default () => { | @@ -146,6 +147,7 @@ export default () => { | ||
146 | startEditable: (rowKey: Key) => boolean; | 147 | startEditable: (rowKey: Key) => boolean; |
147 | cancelEditable: (rowKey: Key) => boolean; | 148 | cancelEditable: (rowKey: Key) => boolean; |
148 | } | 149 | } |
150 | + const [specialPath, setSpecialPath] = useState<string[]>([]); | ||
149 | 151 | ||
150 | const ref = useRef<ActionType>({ | 152 | const ref = useRef<ActionType>({ |
151 | reload: () => { | 153 | reload: () => { |
@@ -172,8 +174,8 @@ export default () => { | @@ -172,8 +174,8 @@ export default () => { | ||
172 | async function toDelete(value) { | 174 | async function toDelete(value) { |
173 | const res = await deleteOrderErpOrderStagesDelect({ | 175 | const res = await deleteOrderErpOrderStagesDelect({ |
174 | data: { | 176 | data: { |
175 | - ids: null, | ||
176 | - deviceIds: value, | 177 | + ids: value, |
178 | + deviceIds: null, | ||
177 | }, | 179 | }, |
178 | }); | 180 | }); |
179 | if (res) { | 181 | if (res) { |
@@ -423,7 +425,7 @@ export default () => { | @@ -423,7 +425,7 @@ export default () => { | ||
423 | <> | 425 | <> |
424 | {hasCheckPermission && ( | 426 | {hasCheckPermission && ( |
425 | <> | 427 | <> |
426 | - <CheckModal id={record.id} toReload={reload}></CheckModal> | 428 | + <CheckModal id={[record.id]} toReload={reload}></CheckModal> |
427 | | 429 | |
428 | </> | 430 | </> |
429 | )} | 431 | )} |
@@ -456,10 +458,7 @@ export default () => { | @@ -456,10 +458,7 @@ export default () => { | ||
456 | )} | 458 | )} |
457 | {hasDeletePermission && ( | 459 | {hasDeletePermission && ( |
458 | <> | 460 | <> |
459 | - <Comfire | ||
460 | - currtDid={record.dId} | ||
461 | - sureDelete={toDelete} | ||
462 | - ></Comfire> | 461 | + <Comfire currtDid={record.id} sureDelete={toDelete}></Comfire> |
463 | </> | 462 | </> |
464 | )} | 463 | )} |
465 | </> | 464 | </> |
@@ -476,9 +475,15 @@ export default () => { | @@ -476,9 +475,15 @@ export default () => { | ||
476 | className="title-index" | 475 | className="title-index" |
477 | columnEmptyText="" | 476 | columnEmptyText="" |
478 | columns={columns} | 477 | columns={columns} |
478 | + rowSelection={{ | ||
479 | + // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom | ||
480 | + // 注释该行则默认不显示下拉选项 | ||
481 | + selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT], | ||
482 | + defaultSelectedRowKeys: [], | ||
483 | + }} | ||
479 | cardBordered | 484 | cardBordered |
480 | actionRef={ref} | 485 | actionRef={ref} |
481 | - scroll={{ x: 1400, y: 360 }} | 486 | + scroll={{ x: 1400 }} |
482 | recordCreatorProps={false} | 487 | recordCreatorProps={false} |
483 | request={async (params) => { | 488 | request={async (params) => { |
484 | if (params.id === '') { | 489 | if (params.id === '') { |
@@ -509,7 +514,9 @@ export default () => { | @@ -509,7 +514,9 @@ export default () => { | ||
509 | params.terminal !== null || | 514 | params.terminal !== null || |
510 | params.deviceName !== null || | 515 | params.deviceName !== null || |
511 | params.dateRange !== null || | 516 | params.dateRange !== null || |
512 | - params.status !== null | 517 | + params.status !== null || |
518 | + params.current !== null || | ||
519 | + params.pageSize !== null | ||
513 | ) { | 520 | ) { |
514 | let PostOrderErpOrderStagesSearchOption = { | 521 | let PostOrderErpOrderStagesSearchOption = { |
515 | id: params.id, | 522 | id: params.id, |
@@ -519,13 +526,17 @@ export default () => { | @@ -519,13 +526,17 @@ export default () => { | ||
519 | deviceName: params.deviceName, | 526 | deviceName: params.deviceName, |
520 | dateRange: params.dateRange, | 527 | dateRange: params.dateRange, |
521 | statusText: params.status, | 528 | statusText: params.status, |
529 | + current: params.current, | ||
530 | + pageSize: params.pageSize, | ||
522 | }; | 531 | }; |
523 | let res = await postOrderErpOrderStagesSearch({ | 532 | let res = await postOrderErpOrderStagesSearch({ |
524 | data: { ...PostOrderErpOrderStagesSearchOption }, | 533 | data: { ...PostOrderErpOrderStagesSearchOption }, |
525 | }); | 534 | }); |
526 | await waitTime(2000); | 535 | await waitTime(2000); |
527 | if (res) { | 536 | if (res) { |
528 | - const orderStagesWithList: OrderStagesWithListItem[] = res?.data; | 537 | + const orderStagesWithList: OrderStagesWithListItem[] = |
538 | + res?.data.data; | ||
539 | + setSpecialPath(res.data.specialPath); | ||
529 | let orderStagesList: OrderStagesItem[] = []; | 540 | let orderStagesList: OrderStagesItem[] = []; |
530 | for (let ind = 0; ind < orderStagesWithList.length; ind++) { | 541 | for (let ind = 0; ind < orderStagesWithList.length; ind++) { |
531 | for ( | 542 | for ( |
@@ -661,6 +672,7 @@ export default () => { | @@ -661,6 +672,7 @@ export default () => { | ||
661 | } | 672 | } |
662 | return { | 673 | return { |
663 | data: orderStagesList || [], | 674 | data: orderStagesList || [], |
675 | + total: res?.data?.total || 0, | ||
664 | }; | 676 | }; |
665 | } | 677 | } |
666 | } else { | 678 | } else { |
@@ -839,10 +851,48 @@ export default () => { | @@ -839,10 +851,48 @@ export default () => { | ||
839 | }} | 851 | }} |
840 | pagination={{ | 852 | pagination={{ |
841 | pageSize: 10, | 853 | pageSize: 10, |
842 | - // onChange: (page) => console.log(page), | ||
843 | }} | 854 | }} |
844 | dateFormatter="string" | 855 | dateFormatter="string" |
845 | headerTitle={[]} | 856 | headerTitle={[]} |
857 | + tableAlertOptionRender={({ selectedRows, onCleanSelected }) => { | ||
858 | + return ( | ||
859 | + <Space size={16}> | ||
860 | + <TableCheckModal | ||
861 | + id={selectedRows | ||
862 | + .filter( | ||
863 | + (item) => | ||
864 | + item.status === 'SAVE_CHECK' || | ||
865 | + item.status === 'UPDATE_CHECK' || | ||
866 | + item.status === 'IMPORT_CHECK', | ||
867 | + ) | ||
868 | + .map((item) => item.id)} | ||
869 | + toReload={reload} | ||
870 | + isShow={!specialPath?.includes('BatchModeration')} | ||
871 | + /> | ||
872 | + <Button | ||
873 | + title="确认删除所选中的分期账单吗?" | ||
874 | + type="primary" | ||
875 | + disabled={!specialPath?.includes('BatchDelete')} | ||
876 | + onClick={() => { | ||
877 | + let ids = selectedRows.map((item: any) => { | ||
878 | + return item.id; | ||
879 | + }); | ||
880 | + toDelete(ids); | ||
881 | + onCleanSelected(); | ||
882 | + }} | ||
883 | + > | ||
884 | + 批量删除 | ||
885 | + </Button> | ||
886 | + <Button | ||
887 | + type="primary" | ||
888 | + onClick={onCleanSelected} | ||
889 | + disabled={!specialPath?.includes('UnSelect')} | ||
890 | + > | ||
891 | + 取消选中 | ||
892 | + </Button> | ||
893 | + </Space> | ||
894 | + ); | ||
895 | + }} | ||
846 | toolBarRender={() => [ | 896 | toolBarRender={() => [ |
847 | <> | 897 | <> |
848 | <AddModel toReload={reload}></AddModel> | 898 | <AddModel toReload={reload}></AddModel> |
src/pages/Instalment/components/upload/payWayUpload.tsx
@@ -8,7 +8,6 @@ import React, { useEffect } from 'react'; | @@ -8,7 +8,6 @@ import React, { useEffect } from 'react'; | ||
8 | const App: React.FC = ({ natureModel, setCurryFile }) => { | 8 | const App: React.FC = ({ natureModel, setCurryFile }) => { |
9 | const [fileList, setFileList] = React.useState([{}]); | 9 | const [fileList, setFileList] = React.useState([{}]); |
10 | useEffect(() => { | 10 | useEffect(() => { |
11 | - console.log(natureModel); | ||
12 | if (natureModel.fileUrl !== undefined && natureModel.fileUrl !== null) { | 11 | if (natureModel.fileUrl !== undefined && natureModel.fileUrl !== null) { |
13 | setFileList([{ name: natureModel.fileName, url: natureModel.fileUrl }]); | 12 | setFileList([{ name: natureModel.fileName, url: natureModel.fileUrl }]); |
14 | } | 13 | } |
@@ -27,7 +26,6 @@ const App: React.FC = ({ natureModel, setCurryFile }) => { | @@ -27,7 +26,6 @@ const App: React.FC = ({ natureModel, setCurryFile }) => { | ||
27 | ) { | 26 | ) { |
28 | (async () => { | 27 | (async () => { |
29 | if (!(value.fileList[0].originFileObj instanceof File)) { | 28 | if (!(value.fileList[0].originFileObj instanceof File)) { |
30 | - console.log('is not file'); | ||
31 | return false; | 29 | return false; |
32 | } else { | 30 | } else { |
33 | const formData = new FormData(); | 31 | const formData = new FormData(); |
@@ -40,12 +38,6 @@ const App: React.FC = ({ natureModel, setCurryFile }) => { | @@ -40,12 +38,6 @@ const App: React.FC = ({ natureModel, setCurryFile }) => { | ||
40 | }); | 38 | }); |
41 | if (res) { | 39 | if (res) { |
42 | message.success('提交成功'); | 40 | message.success('提交成功'); |
43 | - console.log({ | ||
44 | - uid: value.fileList[0].originFileObj.uid, | ||
45 | - name: value.fileList[0].originFileObj.name, | ||
46 | - url: res.data, | ||
47 | - }); | ||
48 | - console.log(natureModel.id); | ||
49 | 41 | ||
50 | setCurryFile({ | 42 | setCurryFile({ |
51 | id: natureModel.id, | 43 | id: natureModel.id, |