Commit 43a6ae3e4415d96f94708c5179bfa573a5eaeb37
feat: update
Showing
18 changed files
with
1150 additions
and
314 deletions
src/pages/Instalment/components/comfire/comfire.tsx
1 | import { ModalForm } from '@ant-design/pro-components'; | 1 | import { ModalForm } from '@ant-design/pro-components'; |
2 | -import { Form, message } from 'antd'; | 2 | +import { Form } from 'antd'; |
3 | import { useState } from 'react'; | 3 | import { useState } from 'react'; |
4 | 4 | ||
5 | const waitTime = (time: number = 100) => { | 5 | const waitTime = (time: number = 100) => { |
@@ -41,7 +41,6 @@ export default ({ currtDid, sureDelete }) => { | @@ -41,7 +41,6 @@ export default ({ currtDid, sureDelete }) => { | ||
41 | onFinish={async () => { | 41 | onFinish={async () => { |
42 | await waitTime(100); | 42 | await waitTime(100); |
43 | sureDelete([ids]); | 43 | sureDelete([ids]); |
44 | - message.success('提交成功'); | ||
45 | return true; | 44 | return true; |
46 | }} | 45 | }} |
47 | > | 46 | > |
src/pages/Instalment/components/detail/detail.tsx
@@ -207,6 +207,7 @@ export default ({ toReload }) => { | @@ -207,6 +207,7 @@ export default ({ toReload }) => { | ||
207 | payWay: values.payWay || contextBody.payWay, | 207 | payWay: values.payWay || contextBody.payWay, |
208 | annex: contextBody.annex, | 208 | annex: contextBody.annex, |
209 | remark: values.remark || contextBody.remark, | 209 | remark: values.remark || contextBody.remark, |
210 | + createByName: null, | ||
210 | }; | 211 | }; |
211 | if (values.annex) { | 212 | if (values.annex) { |
212 | formData.append('file', values.annex[0].originFileObj as RcFile); | 213 | formData.append('file', values.annex[0].originFileObj as RcFile); |
@@ -221,6 +222,9 @@ export default ({ toReload }) => { | @@ -221,6 +222,9 @@ export default ({ toReload }) => { | ||
221 | toSendEdit.annex = res.data; | 222 | toSendEdit.annex = res.data; |
222 | } | 223 | } |
223 | } | 224 | } |
225 | + toSendEdit.createByName = JSON.parse( | ||
226 | + localStorage.getItem('userInfo'), | ||
227 | + ).username; | ||
224 | const isSaveOrUpdate = await postOrderErpOrderStagesAdd({ | 228 | const isSaveOrUpdate = await postOrderErpOrderStagesAdd({ |
225 | data: { ...toSendEdit }, | 229 | data: { ...toSendEdit }, |
226 | }); | 230 | }); |
@@ -230,31 +234,32 @@ export default ({ toReload }) => { | @@ -230,31 +234,32 @@ export default ({ toReload }) => { | ||
230 | 234 | ||
231 | otherBody.forEach((item) => { | 235 | otherBody.forEach((item) => { |
232 | let remakeItem = { | 236 | let remakeItem = { |
233 | - ossId: item.ossId, | 237 | + ossId: contextBody.id, |
234 | number: item.id, | 238 | number: item.id, |
235 | dateRange: item.payDate, | 239 | dateRange: item.payDate, |
236 | fileName: item.fileName, | 240 | fileName: item.fileName, |
241 | + fileUrl: item.fileUrl, | ||
237 | }; | 242 | }; |
238 | - if ( | ||
239 | - typeof item.fileUrl === 'object' && | ||
240 | - item.fileUrl instanceof File | ||
241 | - ) { | ||
242 | - const formData = new FormData(); | ||
243 | - formData.append('file', item.fileUrl as RcFile); | ||
244 | - const uploadPromise = async () => { | ||
245 | - const res = await postOrderErpOrderStagesUpload({ | ||
246 | - data: formData, | ||
247 | - headers: { | ||
248 | - 'Content-Type': | ||
249 | - 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | ||
250 | - }, | ||
251 | - }); | ||
252 | - if (res.data) { | ||
253 | - remakeItem.fileUrl = res.data; | ||
254 | - } | ||
255 | - }; | ||
256 | - promises.push(uploadPromise()); | ||
257 | - } | 243 | + // if ( |
244 | + // typeof item.fileUrl === 'object' && | ||
245 | + // item.fileUrl instanceof File | ||
246 | + // ) { | ||
247 | + // const formData = new FormData(); | ||
248 | + // formData.append('file', item.fileUrl as RcFile); | ||
249 | + // const uploadPromise = async () => { | ||
250 | + // const res = await postOrderErpOrderStagesUpload({ | ||
251 | + // data: formData, | ||
252 | + // headers: { | ||
253 | + // 'Content-Type': | ||
254 | + // 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | ||
255 | + // }, | ||
256 | + // }); | ||
257 | + // if (res.data) { | ||
258 | + // remakeItem.fileUrl = res.data; | ||
259 | + // } | ||
260 | + // }; | ||
261 | + // promises.push(uploadPromise()); | ||
262 | + // } | ||
258 | remakeValue.push(remakeItem); | 263 | remakeValue.push(remakeItem); |
259 | }); | 264 | }); |
260 | 265 |
src/pages/Instalment/components/edit/edit.tsx
@@ -33,7 +33,6 @@ export default ({ currentContract, toReload }) => { | @@ -33,7 +33,6 @@ export default ({ currentContract, toReload }) => { | ||
33 | const [total, setTotal] = useState(0); | 33 | const [total, setTotal] = useState(0); |
34 | const [payWayBody, setPayWayBody] = useState([]); | 34 | const [payWayBody, setPayWayBody] = useState([]); |
35 | const [otherBody, setOtherBody] = useState([]); | 35 | const [otherBody, setOtherBody] = useState([]); |
36 | - | ||
37 | type OrderStagesWithListItem = { | 36 | type OrderStagesWithListItem = { |
38 | //文件编号 | 37 | //文件编号 |
39 | id: number; | 38 | id: number; |
@@ -85,6 +84,7 @@ export default ({ currentContract, toReload }) => { | @@ -85,6 +84,7 @@ export default ({ currentContract, toReload }) => { | ||
85 | } | 84 | } |
86 | 85 | ||
87 | function setSave(value) { | 86 | function setSave(value) { |
87 | + console.log(value); | ||
88 | setOtherBody(value); | 88 | setOtherBody(value); |
89 | } | 89 | } |
90 | 90 | ||
@@ -134,18 +134,32 @@ export default ({ currentContract, toReload }) => { | @@ -134,18 +134,32 @@ export default ({ currentContract, toReload }) => { | ||
134 | } | 134 | } |
135 | }; | 135 | }; |
136 | 136 | ||
137 | - async function getBody() { | ||
138 | - const res = await postOrderErpOrderStagesSearch({ | ||
139 | - data: { contract: currentContract }, | ||
140 | - }); | ||
141 | - const context = res.data[0]; | ||
142 | - | ||
143 | - if (context.contract !== null) { | ||
144 | - setContextBody(context); | ||
145 | - setTotal(context.totalPrice); | ||
146 | - form.setFieldValue('totalPrice', context.totalPrice); | 137 | + async function getBody(value) { |
138 | + if (value !== null) { | ||
139 | + const res = await postOrderErpOrderStagesSearch({ | ||
140 | + data: { contract: value }, | ||
141 | + }); | ||
142 | + const context = res.data[0]; | ||
143 | + console.log(context); | ||
144 | + if (context.contract !== null) { | ||
145 | + setContextBody(context); | ||
146 | + setTotal(context.totalPrice); | ||
147 | + form.setFieldValue('totalPrice', context.totalPrice); | ||
148 | + } | ||
149 | + handleInputChange(context.payWay, 0, context.totalPrice); | ||
150 | + } else { | ||
151 | + const res = await postOrderErpOrderStagesSearch({ | ||
152 | + data: { contract: currentContract }, | ||
153 | + }); | ||
154 | + const context = res.data[0]; | ||
155 | + console.log(context); | ||
156 | + if (context.contract !== null) { | ||
157 | + setContextBody(context); | ||
158 | + setTotal(context.totalPrice); | ||
159 | + form.setFieldValue('totalPrice', context.totalPrice); | ||
160 | + } | ||
161 | + handleInputChange(context.payWay, 0, context.totalPrice); | ||
147 | } | 162 | } |
148 | - handleInputChange(context.payWay, 0, context.totalPrice); | ||
149 | } | 163 | } |
150 | 164 | ||
151 | function getEditProductBody(value) { | 165 | function getEditProductBody(value) { |
@@ -157,7 +171,8 @@ export default ({ currentContract, toReload }) => { | @@ -157,7 +171,8 @@ export default ({ currentContract, toReload }) => { | ||
157 | } | 171 | } |
158 | 172 | ||
159 | useEffect(() => { | 173 | useEffect(() => { |
160 | - getBody(); | 174 | + console.log('1'); |
175 | + getBody(null); | ||
161 | }, []); | 176 | }, []); |
162 | 177 | ||
163 | return ( | 178 | return ( |
@@ -177,34 +192,35 @@ export default ({ currentContract, toReload }) => { | @@ -177,34 +192,35 @@ export default ({ currentContract, toReload }) => { | ||
177 | } | 192 | } |
178 | let remakeValue = []; | 193 | let remakeValue = []; |
179 | const promises = []; | 194 | const promises = []; |
180 | - | 195 | + console.log(otherBody); |
181 | otherBody.forEach((item) => { | 196 | otherBody.forEach((item) => { |
182 | let remakeItem = { | 197 | let remakeItem = { |
183 | ossId: contextBody.id, | 198 | ossId: contextBody.id, |
184 | number: item.id, | 199 | number: item.id, |
185 | dateRange: item.payDate, | 200 | dateRange: item.payDate, |
186 | fileName: item.fileName, | 201 | fileName: item.fileName, |
202 | + fileUrl: item.fileUrl, | ||
187 | }; | 203 | }; |
188 | - if ( | ||
189 | - typeof item.fileUrl === 'object' && | ||
190 | - item.fileUrl instanceof File | ||
191 | - ) { | ||
192 | - const formData = new FormData(); | ||
193 | - formData.append('file', item.fileUrl as RcFile); | ||
194 | - const uploadPromise = async () => { | ||
195 | - const res = await postOrderErpOrderStagesUpload({ | ||
196 | - data: formData, | ||
197 | - headers: { | ||
198 | - 'Content-Type': | ||
199 | - 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | ||
200 | - }, | ||
201 | - }); | ||
202 | - if (res.data) { | ||
203 | - remakeItem.fileUrl = res.data; | ||
204 | - } | ||
205 | - }; | ||
206 | - promises.push(uploadPromise()); | ||
207 | - } | 204 | + // if ( |
205 | + // typeof item.fileUrl === 'object' && | ||
206 | + // item.fileUrl instanceof File | ||
207 | + // ) { | ||
208 | + // const formData = new FormData(); | ||
209 | + // formData.append('file', item.fileUrl as RcFile); | ||
210 | + // const uploadPromise = async () => { | ||
211 | + // const res = await postOrderErpOrderStagesUpload({ | ||
212 | + // data: formData, | ||
213 | + // headers: { | ||
214 | + // 'Content-Type': | ||
215 | + // 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | ||
216 | + // }, | ||
217 | + // }); | ||
218 | + // if (res.data) { | ||
219 | + // remakeItem.fileUrl = res.data; | ||
220 | + // } | ||
221 | + // }; | ||
222 | + // promises.push(uploadPromise()); | ||
223 | + // } | ||
208 | remakeValue.push(remakeItem); | 224 | remakeValue.push(remakeItem); |
209 | }); | 225 | }); |
210 | Promise.all(promises).then(async () => { | 226 | Promise.all(promises).then(async () => { |
@@ -243,8 +259,9 @@ export default ({ currentContract, toReload }) => { | @@ -243,8 +259,9 @@ export default ({ currentContract, toReload }) => { | ||
243 | const isSaveOrUpdate = await postOrderErpOrderStagesSaveOrUpdate({ | 259 | const isSaveOrUpdate = await postOrderErpOrderStagesSaveOrUpdate({ |
244 | data: { ...toSendEdit }, | 260 | data: { ...toSendEdit }, |
245 | }); | 261 | }); |
246 | - if (isSaveOrUpdate) { | ||
247 | - getBody(); | 262 | + if (isSaveOrUpdate.message === '成功') { |
263 | + console.log('2'); | ||
264 | + getBody(toSendEdit.contract); | ||
248 | toReload(); | 265 | toReload(); |
249 | } | 266 | } |
250 | await waitTime(2000); | 267 | await waitTime(2000); |
src/pages/Instalment/components/payWayDetail/payWayDetail.tsx
@@ -4,19 +4,18 @@ import { | @@ -4,19 +4,18 @@ import { | ||
4 | EditableProTable, | 4 | EditableProTable, |
5 | ProFormDatePicker, | 5 | ProFormDatePicker, |
6 | ProFormRadio, | 6 | ProFormRadio, |
7 | - ProFormUploadButton, | ||
8 | } from '@ant-design/pro-components'; | 7 | } from '@ant-design/pro-components'; |
9 | -import { message } from 'antd'; | ||
10 | import React, { useEffect, useState } from 'react'; | 8 | import React, { useEffect, useState } from 'react'; |
9 | +import PayWayUpload from '../upload/payWayUpload'; | ||
11 | import './payWayDetail.less'; | 10 | import './payWayDetail.less'; |
12 | 11 | ||
13 | -const waitTime = (time: number = 100) => { | ||
14 | - return new Promise((resolve) => { | ||
15 | - setTimeout(() => { | ||
16 | - resolve(true); | ||
17 | - }, time); | ||
18 | - }); | ||
19 | -}; | 12 | +// const waitTime = (time: number = 100) => { |
13 | +// return new Promise((resolve) => { | ||
14 | +// setTimeout(() => { | ||
15 | +// resolve(true); | ||
16 | +// }, time); | ||
17 | +// }); | ||
18 | +// }; | ||
20 | 19 | ||
21 | type DataSourceType = { | 20 | type DataSourceType = { |
22 | id: number; | 21 | id: number; |
@@ -74,6 +73,7 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -74,6 +73,7 @@ export default ({ payBody, thisId, currtSave }) => { | ||
74 | ]; | 73 | ]; |
75 | 74 | ||
76 | const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]); | 75 | const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]); |
76 | + const [isRetrun, setIsRetrun] = useState(false); | ||
77 | const [position, setPosition] = useState<'top' | 'bottom' | 'hidden'>( | 77 | const [position, setPosition] = useState<'top' | 'bottom' | 'hidden'>( |
78 | 'hidden', | 78 | 'hidden', |
79 | ); | 79 | ); |
@@ -81,9 +81,17 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -81,9 +81,17 @@ export default ({ payBody, thisId, currtSave }) => { | ||
81 | readonly DataSourceType[] | 81 | readonly DataSourceType[] |
82 | >([...defaultData]); | 82 | >([...defaultData]); |
83 | // const [body, setBody] = useState([]) | 83 | // const [body, setBody] = useState([]) |
84 | - const [isAccept, setIsAccept] = useState(null); | 84 | + // const [isAccept, setIsAccept] = useState(null); |
85 | // const [isCurrtSave, setIsCurrtSave] = useState(false); | 85 | // const [isCurrtSave, setIsCurrtSave] = useState(false); |
86 | 86 | ||
87 | + const waitTime = (time: number = 100) => { | ||
88 | + return new Promise((resolve) => { | ||
89 | + setTimeout(() => { | ||
90 | + resolve(true); | ||
91 | + }, time); | ||
92 | + }); | ||
93 | + }; | ||
94 | + | ||
87 | async function getOther(value, arr) { | 95 | async function getOther(value, arr) { |
88 | const res = await postOrderErpOrderStagesPayWaySelect({ | 96 | const res = await postOrderErpOrderStagesPayWaySelect({ |
89 | data: { ossId: value }, | 97 | data: { ossId: value }, |
@@ -106,11 +114,32 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -106,11 +114,32 @@ export default ({ payBody, thisId, currtSave }) => { | ||
106 | }); | 114 | }); |
107 | return currt; | 115 | return currt; |
108 | }); | 116 | }); |
117 | + // console.log(remake); | ||
109 | setPayWayDetailBody(remake); | 118 | setPayWayDetailBody(remake); |
119 | + setIsRetrun(true); | ||
110 | } | 120 | } |
111 | } | 121 | } |
112 | 122 | ||
113 | - function setPayWay(value) { | 123 | + function getUploadFile(value) { |
124 | + let remakeBody = []; | ||
125 | + let remakeBodyItem = {}; | ||
126 | + payWayDetailBody.forEach((item) => { | ||
127 | + if (item.id === value.id) { | ||
128 | + remakeBodyItem = { | ||
129 | + ...item, | ||
130 | + fileUrl: value.url, | ||
131 | + fileName: value.name, | ||
132 | + }; | ||
133 | + } else { | ||
134 | + remakeBodyItem = { ...item }; | ||
135 | + } | ||
136 | + remakeBody.push(remakeBodyItem); | ||
137 | + }); | ||
138 | + setPayWayDetailBody(remakeBody); | ||
139 | + currtSave(remakeBody); | ||
140 | + } | ||
141 | + | ||
142 | + async function setPayWay(value) { | ||
114 | const remakeData = payWayDetailBody.map((obj) => { | 143 | const remakeData = payWayDetailBody.map((obj) => { |
115 | return { | 144 | return { |
116 | ...obj, | 145 | ...obj, |
@@ -127,9 +156,6 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -127,9 +156,6 @@ export default ({ payBody, thisId, currtSave }) => { | ||
127 | getOther(thisId, remakeData); | 156 | getOther(thisId, remakeData); |
128 | } | 157 | } |
129 | } | 158 | } |
130 | - // useEffect(() => { | ||
131 | - // getOther(thisId) | ||
132 | - // }, [thisId]) | ||
133 | 159 | ||
134 | useEffect(() => { | 160 | useEffect(() => { |
135 | setPayWay(payBody); | 161 | setPayWay(payBody); |
@@ -175,6 +201,7 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -175,6 +201,7 @@ export default ({ payBody, thisId, currtSave }) => { | ||
175 | render: (text, record) => { | 201 | render: (text, record) => { |
176 | const handleChange = (value) => { | 202 | const handleChange = (value) => { |
177 | const updatedDataSource = payWayDetailBody.map((item) => { | 203 | const updatedDataSource = payWayDetailBody.map((item) => { |
204 | + console.log(value); | ||
178 | if (item.id === record.id) { | 205 | if (item.id === record.id) { |
179 | return { | 206 | return { |
180 | ...item, | 207 | ...item, |
@@ -207,74 +234,33 @@ export default ({ payBody, thisId, currtSave }) => { | @@ -207,74 +234,33 @@ export default ({ payBody, thisId, currtSave }) => { | ||
207 | title: '付款单回执', | 234 | title: '付款单回执', |
208 | dataIndex: 'fileName', | 235 | dataIndex: 'fileName', |
209 | render: (text, record) => { | 236 | render: (text, record) => { |
210 | - if (isAccept !== record.id) { | ||
211 | - if ( | ||
212 | - typeof record.fileUrl === 'object' && | ||
213 | - record.fileUrl instanceof File | ||
214 | - ) { | ||
215 | - return ( | ||
216 | - <a onClick={() => message.error('请先保存')}>{record.fileName}</a> | ||
217 | - ); | ||
218 | - } else { | ||
219 | - return <a href={record.fileUrl}>{record.fileName}</a>; | ||
220 | - } | 237 | + if (record.fileUrl !== undefined) { |
238 | + return ( | ||
239 | + <PayWayUpload | ||
240 | + natureModel={{ | ||
241 | + id: record.id, | ||
242 | + fileName: record.fileName, | ||
243 | + fileUrl: record.fileUrl, | ||
244 | + }} | ||
245 | + setCurryFile={getUploadFile} | ||
246 | + key={isRetrun} | ||
247 | + ></PayWayUpload> | ||
248 | + ); | ||
221 | } else { | 249 | } else { |
222 | return ( | 250 | return ( |
223 | - <ProFormUploadButton | ||
224 | - name={record.id} | ||
225 | - onChange={(value) => { | ||
226 | - console.log(value); | ||
227 | - // console.log(payWayDetailBody); | ||
228 | - let remakeBody = []; | ||
229 | - let remakeBodyItem = {}; | ||
230 | - payWayDetailBody.forEach((item) => { | ||
231 | - if (item.id === record.id) { | ||
232 | - remakeBodyItem = { | ||
233 | - ...item, | ||
234 | - fileUrl: value.fileList.originFileObj, | ||
235 | - fileName: value.fileList.name, | ||
236 | - }; | ||
237 | - } else { | ||
238 | - remakeBodyItem = { ...item }; | ||
239 | - } | ||
240 | - // if (value.fileList.length == 0) { | ||
241 | - // remakeBodyItem = { ...item, fileUrl: undefined, fileName: undefined } | ||
242 | - // } | ||
243 | - remakeBody.push(remakeBodyItem); | ||
244 | - }); | ||
245 | - setPayWayDetailBody(remakeBody); | ||
246 | - currtSave(remakeBody); | 251 | + <PayWayUpload |
252 | + natureModel={{ | ||
253 | + id: record.id, | ||
254 | + fileName: undefined, | ||
255 | + fileUrl: undefined, | ||
247 | }} | 256 | }} |
248 | - width="md" | ||
249 | - max={1} | ||
250 | - /> | 257 | + setCurryFile={getUploadFile} |
258 | + key={isRetrun} | ||
259 | + ></PayWayUpload> | ||
251 | ); | 260 | ); |
252 | } | 261 | } |
253 | }, | 262 | }, |
254 | }, | 263 | }, |
255 | - { | ||
256 | - title: '操作', | ||
257 | - valueType: 'option', | ||
258 | - width: 200, | ||
259 | - render: (text, record) => [ | ||
260 | - <a | ||
261 | - key="editable" | ||
262 | - onClick={() => { | ||
263 | - if (isAccept !== record.id) { | ||
264 | - setIsAccept(record.id); | ||
265 | - } else { | ||
266 | - setIsAccept(null); | ||
267 | - } | ||
268 | - }} | ||
269 | - > | ||
270 | - {record.fileName !== undefined && | ||
271 | - record.fileName !== '' && | ||
272 | - record.fileName !== null | ||
273 | - ? '重新上传' | ||
274 | - : '上传回执'} | ||
275 | - </a>, | ||
276 | - ], | ||
277 | - }, | ||
278 | ]; | 264 | ]; |
279 | 265 | ||
280 | return ( | 266 | return ( |
src/pages/Instalment/components/upload/payWayUpload.tsx
0 → 100644
1 | +import { postOrderErpOrderStagesUpload } from '@/services/request'; | ||
2 | +import { UploadOutlined } from '@ant-design/icons'; | ||
3 | +import type { UploadProps } from 'antd'; | ||
4 | +import { Button, Upload, message } from 'antd'; | ||
5 | +import { RcFile } from 'antd/es/upload'; | ||
6 | +import React, { useEffect } from 'react'; | ||
7 | + | ||
8 | +const App: React.FC = ({ natureModel, setCurryFile }) => { | ||
9 | + const [fileList, setFileList] = React.useState([{}]); | ||
10 | + useEffect(() => { | ||
11 | + console.log(natureModel); | ||
12 | + if (natureModel.fileUrl !== undefined && natureModel.fileUrl !== null) { | ||
13 | + setFileList([{ name: natureModel.fileName, url: natureModel.fileUrl }]); | ||
14 | + } | ||
15 | + }, []); | ||
16 | + | ||
17 | + const handleUploadChange = (value) => { | ||
18 | + setFileList(value.fileList); | ||
19 | + setCurryFile({ | ||
20 | + id: natureModel.id, | ||
21 | + name: null, | ||
22 | + url: null, | ||
23 | + }); | ||
24 | + if ( | ||
25 | + value.fileList.length !== 0 && | ||
26 | + value.fileList[0].status === 'uploading' | ||
27 | + ) { | ||
28 | + (async () => { | ||
29 | + if (!(value.fileList[0].originFileObj instanceof File)) { | ||
30 | + console.log('is not file'); | ||
31 | + return false; | ||
32 | + } else { | ||
33 | + const formData = new FormData(); | ||
34 | + formData.append('file', value.fileList[0].originFileObj as RcFile); | ||
35 | + const res = await postOrderErpOrderStagesUpload({ | ||
36 | + data: formData, | ||
37 | + headers: { | ||
38 | + 'Content-Type': 'multipart/form-data', | ||
39 | + }, | ||
40 | + }); | ||
41 | + if (res) { | ||
42 | + 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 | + | ||
50 | + setCurryFile({ | ||
51 | + id: natureModel.id, | ||
52 | + name: value.fileList[0].originFileObj.name, | ||
53 | + url: res.data, | ||
54 | + }); | ||
55 | + setFileList([ | ||
56 | + { | ||
57 | + id: value.fileList[0].originFileObj.uid, | ||
58 | + name: value.fileList[0].originFileObj.name, | ||
59 | + url: res.data, | ||
60 | + }, | ||
61 | + ]); | ||
62 | + return ( | ||
63 | + <a href={res.data} target="_blank" rel="noopener noreferrer"> | ||
64 | + {value.fileList[0].originFileObj.name} | ||
65 | + </a> | ||
66 | + ); | ||
67 | + } | ||
68 | + } | ||
69 | + })(); | ||
70 | + } | ||
71 | + }; | ||
72 | + | ||
73 | + const props: UploadProps = { | ||
74 | + onChange(value) { | ||
75 | + handleUploadChange(value); | ||
76 | + }, | ||
77 | + }; | ||
78 | + | ||
79 | + const shouldShowUploadButton = | ||
80 | + fileList.length !== 1 || fileList[0].url === undefined; | ||
81 | + | ||
82 | + return ( | ||
83 | + <Upload | ||
84 | + {...props} | ||
85 | + fileList={fileList.filter( | ||
86 | + (item) => item.url !== undefined && item.url !== null, | ||
87 | + )} | ||
88 | + > | ||
89 | + {shouldShowUploadButton && ( | ||
90 | + <Button icon={<UploadOutlined />}>上传</Button> | ||
91 | + )} | ||
92 | + </Upload> | ||
93 | + ); | ||
94 | +}; | ||
95 | + | ||
96 | +export default App; | ||
97 | + | ||
98 | +{ | ||
99 | + /* {!shouldShowUploadButton && <a href={fileList[0].url}>{fileList[0].name}</a>} */ | ||
100 | +} |
src/pages/Instalment/components/upload/uploadApp.tsx
@@ -21,13 +21,7 @@ const App: React.FC = ({ uploadFile }) => { | @@ -21,13 +21,7 @@ const App: React.FC = ({ uploadFile }) => { | ||
21 | <p className="ant-upload-drag-icon"> | 21 | <p className="ant-upload-drag-icon"> |
22 | <InboxOutlined /> | 22 | <InboxOutlined /> |
23 | </p> | 23 | </p> |
24 | - <p className="ant-upload-text"> | ||
25 | - Click or drag file to this area to upload | ||
26 | - </p> | ||
27 | - <p className="ant-upload-hint"> | ||
28 | - Support for a single or bulk upload. Strictly prohibited from | ||
29 | - uploading company data or other banned files. | ||
30 | - </p> | 24 | + <p className="ant-upload-text">点击或者拖动文件到此处</p> |
31 | </Dragger> | 25 | </Dragger> |
32 | <a | 26 | <a |
33 | href="https://order-erp.oss-cn-qingdao.aliyuncs.com/%E5%88%86%E6%9C%9F%E4%BB%98%E6%AC%BE-%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx?Expires=2035527699&OSSAccessKeyId=LTAIZCPI7OaWud0m&Signature=npHyEhfRd6LugJ0St8OkvRmLYtQ%3D" | 27 | href="https://order-erp.oss-cn-qingdao.aliyuncs.com/%E5%88%86%E6%9C%9F%E4%BB%98%E6%AC%BE-%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx?Expires=2035527699&OSSAccessKeyId=LTAIZCPI7OaWud0m&Signature=npHyEhfRd6LugJ0St8OkvRmLYtQ%3D" |
src/pages/Order/components/OrderDrawer.tsx
@@ -3,6 +3,8 @@ import { | @@ -3,6 +3,8 @@ import { | ||
3 | postCanrdApiUserAddressList, | 3 | postCanrdApiUserAddressList, |
4 | postCanrdApiUserDetail, | 4 | postCanrdApiUserDetail, |
5 | postCanrdApiUserNowMoneyCheck, | 5 | postCanrdApiUserNowMoneyCheck, |
6 | + postDistrictSelectBelongByName, | ||
7 | + postDistrictSelectByLevel, | ||
6 | postKingdeeRepCustomerDetail, | 8 | postKingdeeRepCustomerDetail, |
7 | postKingdeeRepMaterial, | 9 | postKingdeeRepMaterial, |
8 | postKingdeeRepMaterialUnit, | 10 | postKingdeeRepMaterialUnit, |
@@ -71,6 +73,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -71,6 +73,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
71 | // [], | 73 | // [], |
72 | // ); //商品的仓库选项 | 74 | // ); //商品的仓库选项 |
73 | const [productUnitOptionsList, setProductUnitOptionsList] = useState([]); //商品的单位选项 | 75 | const [productUnitOptionsList, setProductUnitOptionsList] = useState([]); //商品的单位选项 |
76 | + //省市区 | ||
77 | + const [province, setProvince] = useState(''); | ||
78 | + const [city, setCity] = useState(''); | ||
79 | + const [district, setDistrict] = useState(''); | ||
74 | // const [productCustomerContactOptions, setProductCustomerContactOptions] = | 80 | // const [productCustomerContactOptions, setProductCustomerContactOptions] = |
75 | // useState([]); //客户的收货人选项 | 81 | // useState([]); //客户的收货人选项 |
76 | const [form] = Form.useForm<{ | 82 | const [form] = Form.useForm<{ |
@@ -246,7 +252,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -246,7 +252,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
246 | newAccountOptions.push(uidDetail); | 252 | newAccountOptions.push(uidDetail); |
247 | } | 253 | } |
248 | 254 | ||
249 | - //查询当前手机号允许使用的预存账号 | 255 | + // 查询当前手机号允许使用的预存账号 |
250 | if (phone) { | 256 | if (phone) { |
251 | let res = await postPrepaidPhoneAvailableList({ data: { phone: phone } }); | 257 | let res = await postPrepaidPhoneAvailableList({ data: { phone: phone } }); |
252 | if (res && res.result === RESPONSE_CODE.SUCCESS) { | 258 | if (res && res.result === RESPONSE_CODE.SUCCESS) { |
@@ -863,6 +869,8 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -863,6 +869,8 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
863 | values.institution = values.institution?.trim(); | 869 | values.institution = values.institution?.trim(); |
864 | values.institutionContactName = values.institutionContactName?.trim(); | 870 | values.institutionContactName = values.institutionContactName?.trim(); |
865 | values.customerName = values.customerNameString.trim(); | 871 | values.customerName = values.customerNameString.trim(); |
872 | + values.customerShippingAddress = | ||
873 | + province + city + district + values.customerShippingAddress; | ||
866 | 874 | ||
867 | if (typeof values.erpCustomerId !== 'string') { | 875 | if (typeof values.erpCustomerId !== 'string') { |
868 | values.erpCustomerId = values.erpCustomerId?.id; | 876 | values.erpCustomerId = values.erpCustomerId?.id; |
@@ -1015,7 +1023,6 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1015,7 +1023,6 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1015 | name="contactAddress" | 1023 | name="contactAddress" |
1016 | hidden | 1024 | hidden |
1017 | ></ProFormText> | 1025 | ></ProFormText> |
1018 | - | ||
1019 | <ProFormSelect | 1026 | <ProFormSelect |
1020 | key="customerName" | 1027 | key="customerName" |
1021 | label="收货人" | 1028 | label="收货人" |
@@ -1176,6 +1183,113 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1176,6 +1183,113 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1176 | placeholder="请输入课题组" | 1183 | placeholder="请输入课题组" |
1177 | rules={[{ required: true, message: '课题组必填' }]} | 1184 | rules={[{ required: true, message: '课题组必填' }]} |
1178 | /> | 1185 | /> |
1186 | + <div | ||
1187 | + style={{ | ||
1188 | + display: 'flex', | ||
1189 | + justifyContent: 'space-between', | ||
1190 | + width: 340, | ||
1191 | + }} | ||
1192 | + > | ||
1193 | + <ProFormSelect | ||
1194 | + name="province" | ||
1195 | + key="province" | ||
1196 | + width={100} | ||
1197 | + label="省" | ||
1198 | + fieldProps={{ | ||
1199 | + labelInValue: true, | ||
1200 | + }} | ||
1201 | + onChange={(value) => { | ||
1202 | + setProvince(value?.value); | ||
1203 | + }} | ||
1204 | + placeholder="请选择" | ||
1205 | + rules={[ | ||
1206 | + { | ||
1207 | + required: true, | ||
1208 | + message: '请选择!', | ||
1209 | + }, | ||
1210 | + ]} | ||
1211 | + request={async () => { | ||
1212 | + let province = []; | ||
1213 | + let res = await postDistrictSelectByLevel({ data: 1 }); | ||
1214 | + if (res) { | ||
1215 | + res.data.forEach((item) => { | ||
1216 | + province.push({ value: item.district, label: item.district }); | ||
1217 | + }); | ||
1218 | + } | ||
1219 | + return province; | ||
1220 | + }} | ||
1221 | + /> | ||
1222 | + <ProFormSelect | ||
1223 | + key={province} | ||
1224 | + name="city" | ||
1225 | + width={100} | ||
1226 | + label="市" | ||
1227 | + disabled={province === ''} | ||
1228 | + fieldProps={{ | ||
1229 | + labelInValue: true, | ||
1230 | + }} | ||
1231 | + placeholder="请选择" | ||
1232 | + onChange={(value) => { | ||
1233 | + setCity(value?.value); | ||
1234 | + }} | ||
1235 | + rules={[ | ||
1236 | + { | ||
1237 | + required: true, | ||
1238 | + message: '请选择!', | ||
1239 | + }, | ||
1240 | + ]} | ||
1241 | + request={async () => { | ||
1242 | + if (province !== '') { | ||
1243 | + let cityOptions = []; | ||
1244 | + let res = await postDistrictSelectBelongByName({ | ||
1245 | + data: province, | ||
1246 | + }); | ||
1247 | + if (res && res.data) { | ||
1248 | + cityOptions = res.data.map((item) => ({ | ||
1249 | + value: item.district, | ||
1250 | + label: item.district, | ||
1251 | + })); | ||
1252 | + } | ||
1253 | + return cityOptions; | ||
1254 | + } | ||
1255 | + return []; | ||
1256 | + }} | ||
1257 | + /> | ||
1258 | + <ProFormSelect | ||
1259 | + key={city ? city.toString() : 'district'} | ||
1260 | + name="district" | ||
1261 | + width={100} | ||
1262 | + label="区" | ||
1263 | + onChange={(value) => { | ||
1264 | + setDistrict(value?.value); | ||
1265 | + }} | ||
1266 | + disabled={city === ''} | ||
1267 | + fieldProps={{ | ||
1268 | + labelInValue: true, | ||
1269 | + }} | ||
1270 | + placeholder="请选择" | ||
1271 | + rules={[ | ||
1272 | + { | ||
1273 | + required: true, | ||
1274 | + message: '请选择!', | ||
1275 | + }, | ||
1276 | + ]} | ||
1277 | + request={async () => { | ||
1278 | + if (city !== '') { | ||
1279 | + let districtOptions = []; | ||
1280 | + let res = await postDistrictSelectBelongByName({ data: city }); | ||
1281 | + if (res && res.data) { | ||
1282 | + districtOptions = res.data.map((item) => ({ | ||
1283 | + value: item.district, | ||
1284 | + label: item.district, | ||
1285 | + })); | ||
1286 | + } | ||
1287 | + return districtOptions; | ||
1288 | + } | ||
1289 | + return []; | ||
1290 | + }} | ||
1291 | + /> | ||
1292 | + </div> | ||
1179 | <ProFormTextArea | 1293 | <ProFormTextArea |
1180 | width="lg" | 1294 | width="lg" |
1181 | key="customerShippingAddress" | 1295 | key="customerShippingAddress" |
src/pages/OrderReport/index.tsx
1 | import { | 1 | import { |
2 | + getOrderErpOrderZoNingSelectAll, | ||
3 | + getOrderErpOrderZoNingSelectUserAll, | ||
4 | + postOrderErpOrderZoNingSelectSaleUserByProvince, | ||
2 | postServiceOrderQueryReportFormsInformation, | 5 | postServiceOrderQueryReportFormsInformation, |
3 | postServiceOrderQuerySalesCode, | 6 | postServiceOrderQuerySalesCode, |
4 | } from '@/services'; | 7 | } from '@/services'; |
@@ -63,7 +66,7 @@ const OrderReportPage = () => { | @@ -63,7 +66,7 @@ const OrderReportPage = () => { | ||
63 | setLoading(true); | 66 | setLoading(true); |
64 | let body = { | 67 | let body = { |
65 | statisticsMethod: '', | 68 | statisticsMethod: '', |
66 | - salesCode: form.getFieldValue('salesCode'), | 69 | + salesCode: [null], |
67 | productBelongBusiness: form.getFieldValue('productBelongBusiness'), | 70 | productBelongBusiness: form.getFieldValue('productBelongBusiness'), |
68 | maxAccount: form.getFieldValue('maxAccount'), | 71 | maxAccount: form.getFieldValue('maxAccount'), |
69 | includeExperimentalEquipment: form.getFieldValue( | 72 | includeExperimentalEquipment: form.getFieldValue( |
@@ -72,6 +75,36 @@ const OrderReportPage = () => { | @@ -72,6 +75,36 @@ const OrderReportPage = () => { | ||
72 | // beginTime:"", | 75 | // beginTime:"", |
73 | // endTime:"" | 76 | // endTime:"" |
74 | }; | 77 | }; |
78 | + // console.log(form.getFieldValue('zoning').value); | ||
79 | + | ||
80 | + let res = await getOrderErpOrderZoNingSelectUserAll(); | ||
81 | + if (res && res.data) { | ||
82 | + let safeUserList = []; | ||
83 | + res.data.forEach((element) => { | ||
84 | + safeUserList.push(element.userName); | ||
85 | + }); | ||
86 | + body = { ...body, salesCode: safeUserList }; | ||
87 | + } | ||
88 | + if (form.getFieldValue('salesCode')) { | ||
89 | + body = { ...body, salesCode: [form.getFieldValue('salesCode')] }; | ||
90 | + } | ||
91 | + if (form.getFieldValue('zoning')) { | ||
92 | + if ( | ||
93 | + form.getFieldValue('zoning').value !== '' || | ||
94 | + form.getFieldValue('zoning').value !== null || | ||
95 | + form.getFieldValue('zoning').value !== undefined | ||
96 | + ) { | ||
97 | + let res = await postOrderErpOrderZoNingSelectSaleUserByProvince({ | ||
98 | + data: form.getFieldValue('zoning').value, | ||
99 | + }); | ||
100 | + if (res && res.data) { | ||
101 | + body = { ...body, salesCode: res.data }; | ||
102 | + } | ||
103 | + } | ||
104 | + } | ||
105 | + | ||
106 | + if (form.getFieldValue('zoning')) { | ||
107 | + } | ||
75 | 108 | ||
76 | // if(form.getFieldValue("dateRange")!==undefined){ | 109 | // if(form.getFieldValue("dateRange")!==undefined){ |
77 | // body.beginTime=formatDate(form.getFieldValue("dateRange")[0]), | 110 | // body.beginTime=formatDate(form.getFieldValue("dateRange")[0]), |
@@ -162,6 +195,30 @@ const OrderReportPage = () => { | @@ -162,6 +195,30 @@ const OrderReportPage = () => { | ||
162 | initialValue={false} | 195 | initialValue={false} |
163 | label="包含实验设备事业部汇总统计" | 196 | label="包含实验设备事业部汇总统计" |
164 | /> | 197 | /> |
198 | + | ||
199 | + <ProFormSelect | ||
200 | + key="zoning" | ||
201 | + name="zoning" | ||
202 | + width="md" | ||
203 | + label="所属地区" | ||
204 | + fieldProps={{ | ||
205 | + labelInValue: true, | ||
206 | + }} | ||
207 | + placeholder="请选择" | ||
208 | + request={async () => { | ||
209 | + let zoningOptions = []; | ||
210 | + let res = await getOrderErpOrderZoNingSelectAll(); | ||
211 | + if (res && res.data) { | ||
212 | + console.log(res.data); | ||
213 | + | ||
214 | + zoningOptions = res.data.map((item) => ({ | ||
215 | + value: item.zoning, | ||
216 | + label: item.zoning, | ||
217 | + })); | ||
218 | + } | ||
219 | + return zoningOptions; | ||
220 | + }} | ||
221 | + /> | ||
165 | </QueryFilter> | 222 | </QueryFilter> |
166 | </ProCard> | 223 | </ProCard> |
167 | 224 |
src/pages/ResearchGroup/components/ImportModal.tsx
@@ -6,7 +6,7 @@ import { Button, Modal, Upload, message } from 'antd'; | @@ -6,7 +6,7 @@ import { Button, Modal, Upload, message } from 'antd'; | ||
6 | import { RcFile, UploadFile, UploadProps } from 'antd/es/upload'; | 6 | import { RcFile, UploadFile, UploadProps } from 'antd/es/upload'; |
7 | import { useState } from 'react'; | 7 | import { useState } from 'react'; |
8 | export default ({ onClose }) => { | 8 | export default ({ onClose }) => { |
9 | - // const [form] = Form.useForm<{ name: string; company: string }>(); | 9 | + // const [form] = Form.useForm<{ name: string; company: string }>(); |
10 | const [messageApi, contextHolder] = message.useMessage(); | 10 | const [messageApi, contextHolder] = message.useMessage(); |
11 | const [fileList, setFileList] = useState<UploadFile[]>([]); | 11 | const [fileList, setFileList] = useState<UploadFile[]>([]); |
12 | const [uploading, setUploading] = useState(false); | 12 | const [uploading, setUploading] = useState(false); |
@@ -41,8 +41,8 @@ export default ({ onClose }) => { | @@ -41,8 +41,8 @@ export default ({ onClose }) => { | ||
41 | //originFileObj二进制文件 | 41 | //originFileObj二进制文件 |
42 | formData.append('file', file.originFileObj as RcFile); | 42 | formData.append('file', file.originFileObj as RcFile); |
43 | }); | 43 | }); |
44 | - // console.log(fileList[0] as RcFile) | ||
45 | - // formData.append('file', fileList[0] as RcFile); | 44 | + console.log(fileList[0] as RcFile); |
45 | + formData.append('file', fileList[0] as RcFile); | ||
46 | setUploading(true); | 46 | setUploading(true); |
47 | // You can use any AJAX library you like | 47 | // You can use any AJAX library you like |
48 | const res = await postResearchGroupsImport({ | 48 | const res = await postResearchGroupsImport({ |
src/pages/ResearchGroup/index.css
0 → 100644
src/pages/ZoNing/components/constant.tsx
1 | import { List } from 'lodash'; | 1 | import { List } from 'lodash'; |
2 | 2 | ||
3 | export type zoningItem = { | 3 | export type zoningItem = { |
4 | - id: number; //id | 4 | + id?: number; //id |
5 | zoning: string; //区域名称 | 5 | zoning: string; //区域名称 |
6 | orderProvinceVoList: List<provinceItem>; //所包含的省份列表 | 6 | orderProvinceVoList: List<provinceItem>; //所包含的省份列表 |
7 | orderUserVoList: List<userItem>; //所包含的销售列表 | 7 | orderUserVoList: List<userItem>; //所包含的销售列表 |
8 | }; | 8 | }; |
9 | 9 | ||
10 | export type zoningShowItem = { | 10 | export type zoningShowItem = { |
11 | - id: number; //id | 11 | + id?: number; //id |
12 | zoning: string; //区域名称 | 12 | zoning: string; //区域名称 |
13 | orderProvinceShowList: string; //所包含的省份列表 | 13 | orderProvinceShowList: string; //所包含的省份列表 |
14 | orderUserShowList: string; //所包含的销售列表 | 14 | orderUserShowList: string; //所包含的销售列表 |
15 | + orderUserNumberShowList: number[]; //销售对应的uId | ||
15 | }; | 16 | }; |
16 | 17 | ||
17 | export type provinceItem = { | 18 | export type provinceItem = { |
18 | - pId: number; | 19 | + pId?: number; |
19 | province: string; | 20 | province: string; |
20 | }; | 21 | }; |
21 | 22 | ||
22 | export type userItem = { | 23 | export type userItem = { |
23 | uId: number; | 24 | uId: number; |
24 | - userName: string; | 25 | + userName?: string; |
26 | +}; | ||
27 | + | ||
28 | +export const provinceEnum = { | ||
29 | + 全选: '全选', | ||
30 | + 北京市: '北京市', | ||
31 | + 天津市: '天津市', | ||
32 | + 河北省: '河北省', | ||
33 | + 山西省: '山西省', | ||
34 | + 内蒙古自治区: '内蒙古自治区', | ||
35 | + 辽宁省: '辽宁省', | ||
36 | + 吉林省: '吉林省', | ||
37 | + 黑龙江省: '黑龙江省', | ||
38 | + 上海市: '上海市', | ||
39 | + 江苏省: '江苏省', | ||
40 | + 浙江省: '浙江省', | ||
41 | + 安徽省: '安徽省', | ||
42 | + 福建省: '福建省', | ||
43 | + 江西省: '江西省', | ||
44 | + 山东省: '山东省', | ||
45 | + 河南省: '河南省', | ||
46 | + 湖北省: '湖北省', | ||
47 | + 湖南省: '湖南省', | ||
48 | + 广东省: '广东省', | ||
49 | + 广西壮族自治区: '广西壮族自治区', | ||
50 | + 海南省: '海南省', | ||
51 | + 重庆市: '重庆市', | ||
52 | + 四川省: '四川省', | ||
53 | + 贵州省: '贵州省', | ||
54 | + 云南省: '云南省', | ||
55 | + 西藏自治区: '西藏自治区', | ||
56 | + 陕西省: '陕西省', | ||
57 | + 甘肃省: '甘肃省', | ||
58 | + 青海省: '青海省', | ||
59 | + 宁夏回族自治区: '宁夏回族自治区', | ||
60 | + 新疆维吾尔自治区: '新疆维吾尔自治区', | ||
61 | + 台湾省: '台湾省', | ||
62 | + 香港特别行政区: '香港特别行政区', | ||
63 | + 澳门特别行政区: '澳门特别行政区', | ||
25 | }; | 64 | }; |
src/pages/ZoNing/components/modal.tsx
1 | -import { getOrderErpOrderZoNingSelectProvinceAll } from '@/services'; | 1 | +import { |
2 | + getOrderErpOrderZoNingSelectUserAll, | ||
3 | + postOrderErpOrderZoNingSaveOrUpdate, | ||
4 | +} from '@/services'; | ||
2 | import { PlusOutlined } from '@ant-design/icons'; | 5 | import { PlusOutlined } from '@ant-design/icons'; |
3 | import { | 6 | import { |
4 | ModalForm, | 7 | ModalForm, |
@@ -7,8 +10,7 @@ import { | @@ -7,8 +10,7 @@ import { | ||
7 | ProFormText, | 10 | ProFormText, |
8 | } from '@ant-design/pro-components'; | 11 | } from '@ant-design/pro-components'; |
9 | import { Button, Form, message } from 'antd'; | 12 | import { Button, Form, message } from 'antd'; |
10 | -import { zoningItem } from './constant'; | ||
11 | - | 13 | +import { provinceEnum, zoningItem } from './constant'; |
12 | const waitTime = (time: number = 100) => { | 14 | const waitTime = (time: number = 100) => { |
13 | return new Promise((resolve) => { | 15 | return new Promise((resolve) => { |
14 | setTimeout(() => { | 16 | setTimeout(() => { |
@@ -17,71 +19,126 @@ const waitTime = (time: number = 100) => { | @@ -17,71 +19,126 @@ const waitTime = (time: number = 100) => { | ||
17 | }); | 19 | }); |
18 | }; | 20 | }; |
19 | 21 | ||
20 | -export default () => { | 22 | +export default ({ toReload, option, needEditBody }) => { |
21 | const [form] = Form.useForm<zoningItem>(); | 23 | const [form] = Form.useForm<zoningItem>(); |
24 | + | ||
22 | return ( | 25 | return ( |
23 | <ModalForm<{ | 26 | <ModalForm<{ |
24 | - name: string; | ||
25 | - company: string; | 27 | + zoning: string; |
28 | + province: string[]; | ||
29 | + user: number[]; | ||
26 | }> | 30 | }> |
27 | - title="新增区域" | 31 | + title={option} |
28 | trigger={ | 32 | trigger={ |
29 | - <Button type="primary"> | ||
30 | - <PlusOutlined /> | ||
31 | - 新增区域 | 33 | + <Button type="primary" key={option.id}> |
34 | + {option !== '编辑' && <PlusOutlined />} | ||
35 | + {option} | ||
32 | </Button> | 36 | </Button> |
33 | } | 37 | } |
34 | form={form} | 38 | form={form} |
35 | autoFocusFirstInput | 39 | autoFocusFirstInput |
40 | + initialValues={{ | ||
41 | + zoning: needEditBody.zoning ? needEditBody.zoning : '', | ||
42 | + province: needEditBody.orderProvinceShowList | ||
43 | + ? needEditBody.orderProvinceShowList.split('、') | ||
44 | + : [], | ||
45 | + user: needEditBody.orderUserNumberShowList | ||
46 | + ? needEditBody.orderUserNumberShowList | ||
47 | + : [], | ||
48 | + }} | ||
36 | modalProps={{ | 49 | modalProps={{ |
37 | destroyOnClose: true, | 50 | destroyOnClose: true, |
38 | - onCancel: () => console.log('run'), | ||
39 | }} | 51 | }} |
40 | - submitTimeout={2000} | 52 | + submitTimeout={500} |
41 | onFinish={async (values) => { | 53 | onFinish={async (values) => { |
42 | - await waitTime(2000); | ||
43 | - console.log(values.name); | ||
44 | - message.success('提交成功'); | ||
45 | - return true; | 54 | + console.log(values); |
55 | + const orderProvinceList = values.province.map((item) => { | ||
56 | + return { province: item }; | ||
57 | + }); | ||
58 | + const orderUserList = values.user.map((item) => { | ||
59 | + return { uId: item }; | ||
60 | + }); | ||
61 | + const fetchData: zoningItem = { | ||
62 | + zoning: values.zoning, | ||
63 | + orderProvinceVoList: orderProvinceList, | ||
64 | + orderUserVoList: orderUserList, | ||
65 | + }; | ||
66 | + let res = await postOrderErpOrderZoNingSaveOrUpdate({ | ||
67 | + data: fetchData, | ||
68 | + }); | ||
69 | + if (res) { | ||
70 | + console.log(res); | ||
71 | + await waitTime(500); | ||
72 | + console.log(values); | ||
73 | + message.success('提交成功'); | ||
74 | + toReload(); | ||
75 | + return true; | ||
76 | + } | ||
77 | + return false; | ||
46 | }} | 78 | }} |
47 | > | 79 | > |
48 | <ProForm.Group> | 80 | <ProForm.Group> |
49 | <ProFormText | 81 | <ProFormText |
50 | - width="md" | 82 | + width="lg" |
51 | name="zoning" | 83 | name="zoning" |
52 | label="区域名称" | 84 | label="区域名称" |
53 | placeholder="请输入" | 85 | placeholder="请输入" |
86 | + rules={[{ required: true, message: '此项为必填项' }]} | ||
54 | /> | 87 | /> |
55 | </ProForm.Group> | 88 | </ProForm.Group> |
56 | <ProForm.Group> | 89 | <ProForm.Group> |
57 | <ProFormSelect | 90 | <ProFormSelect |
91 | + name="user" | ||
92 | + width="lg" | ||
93 | + label="负责销售" | ||
58 | request={async () => { | 94 | request={async () => { |
59 | - const provinceList = | ||
60 | - await getOrderErpOrderZoNingSelectProvinceAll(); | ||
61 | - if (provinceList) { | ||
62 | - return provinceList.data.map((item) => ({ | ||
63 | - value: { pId: item.pId, province: item.province }, | ||
64 | - label: item.province, | ||
65 | - })); | 95 | + const userList = await getOrderErpOrderZoNingSelectUserAll(); |
96 | + if (userList) { | ||
97 | + let userSelList = []; | ||
98 | + userList.data.forEach((item: { uId: any; userName: any }) => | ||
99 | + userSelList.push({ | ||
100 | + value: item.uId, | ||
101 | + label: item.userName, | ||
102 | + }), | ||
103 | + ); | ||
104 | + userSelList.unshift({ | ||
105 | + value: 0, | ||
106 | + label: '全选', | ||
107 | + }); | ||
108 | + return userSelList; | ||
66 | } | 109 | } |
67 | return []; | 110 | return []; |
68 | }} | 111 | }} |
69 | - width="xs" | ||
70 | - name="orderProvinceVoList" | ||
71 | - label="合同约定生效方式" | 112 | + fieldProps={{ |
113 | + mode: 'multiple', | ||
114 | + }} | ||
115 | + placeholder="请选择" | ||
116 | + rules={[ | ||
117 | + { | ||
118 | + required: true, | ||
119 | + message: '请选择!', | ||
120 | + type: 'array', | ||
121 | + }, | ||
122 | + ]} | ||
72 | /> | 123 | /> |
73 | </ProForm.Group> | 124 | </ProForm.Group> |
74 | <ProForm.Group> | 125 | <ProForm.Group> |
75 | <ProFormSelect | 126 | <ProFormSelect |
76 | - width="xs" | ||
77 | - options={[ | 127 | + name="province" |
128 | + width="lg" | ||
129 | + label="管辖地区" | ||
130 | + valueEnum={provinceEnum} | ||
131 | + fieldProps={{ | ||
132 | + mode: 'multiple', | ||
133 | + }} | ||
134 | + placeholder="请选择" | ||
135 | + rules={[ | ||
78 | { | 136 | { |
79 | - value: 'time', | ||
80 | - label: '履行完终止', | 137 | + required: true, |
138 | + message: '请选择!', | ||
139 | + type: 'array', | ||
81 | }, | 140 | }, |
82 | ]} | 141 | ]} |
83 | - name="orderUserVoList" | ||
84 | - label="合同约定失效效方式" | ||
85 | /> | 142 | /> |
86 | </ProForm.Group> | 143 | </ProForm.Group> |
87 | </ModalForm> | 144 | </ModalForm> |
src/pages/ZoNing/components/table.tsx
1 | -import type { ProColumns } from '@ant-design/pro-components'; | ||
2 | import { | 1 | import { |
3 | - EditableProTable, | ||
4 | - ProCard, | ||
5 | - ProFormField, | ||
6 | -} from '@ant-design/pro-components'; | ||
7 | -import React, { useState } from 'react'; | 2 | + deleteOrderErpOrderZoNingDelete, |
3 | + getOrderErpOrderZoNingSelectAll, | ||
4 | +} from '@/services'; | ||
5 | +import type { ProColumns } from '@ant-design/pro-components'; | ||
6 | +import { EditableProTable } from '@ant-design/pro-components'; | ||
7 | +import { Button, Popconfirm, PopconfirmProps, message } from 'antd'; | ||
8 | +import React, { useRef, useState } from 'react'; | ||
9 | +import '../index.less'; | ||
8 | import { zoningItem, zoningShowItem } from './constant'; | 10 | import { zoningItem, zoningShowItem } from './constant'; |
9 | import Modal from './modal'; | 11 | import Modal from './modal'; |
10 | 12 | ||
@@ -16,68 +18,81 @@ const waitTime = (time: number = 100) => { | @@ -16,68 +18,81 @@ const waitTime = (time: number = 100) => { | ||
16 | }); | 18 | }); |
17 | }; | 19 | }; |
18 | 20 | ||
19 | -const defaultData: zoningItem[] = [ | ||
20 | - { | ||
21 | - id: 1, | ||
22 | - zoning: '华南地区', | ||
23 | - orderProvinceVoList: [ | ||
24 | - { | ||
25 | - pId: 1, | ||
26 | - province: '广东省', | ||
27 | - }, | ||
28 | - { | ||
29 | - pId: 2, | ||
30 | - province: '四川省', | ||
31 | - }, | ||
32 | - { | ||
33 | - pId: 3, | ||
34 | - province: '北京市', | ||
35 | - }, | ||
36 | - { | ||
37 | - pId: 4, | ||
38 | - province: '上海市', | ||
39 | - }, | ||
40 | - ], | ||
41 | - orderUserVoList: [ | ||
42 | - { | ||
43 | - uId: 1, | ||
44 | - userName: '李华', | ||
45 | - }, | ||
46 | - ], | ||
47 | - }, | ||
48 | -]; | 21 | +function changeToShow(array: zoningItem[]) { |
22 | + console.log(JSON.parse(localStorage.getItem('userInfo')).username); | ||
23 | + const showArray: zoningShowItem[] = array.map((item) => { | ||
24 | + let orderProvinceShowList = ''; | ||
25 | + let orderUserShowList = ''; | ||
26 | + let orderUserNumberShowList: number[] = []; | ||
27 | + item.orderProvinceVoList.forEach((element, index) => { | ||
28 | + orderProvinceShowList += element.province; | ||
29 | + if (index < item.orderProvinceVoList.length - 1) { | ||
30 | + orderProvinceShowList += '、'; | ||
31 | + } | ||
32 | + }); | ||
49 | 33 | ||
50 | -const defaultShowData: zoningShowItem[] = defaultData.map((item) => { | ||
51 | - let orderProvinceShowList = ''; | ||
52 | - let orderUserShowList = ''; | 34 | + item.orderUserVoList.forEach((event, index) => { |
35 | + orderUserShowList += event.userName; | ||
36 | + orderUserNumberShowList.push(event.uId); | ||
37 | + if (index < item.orderUserVoList.length - 1) { | ||
38 | + orderUserShowList += '、'; | ||
39 | + } | ||
40 | + }); | ||
53 | 41 | ||
54 | - item.orderProvinceVoList.forEach((element, index) => { | ||
55 | - orderProvinceShowList += element.province; | ||
56 | - if (index < item.orderProvinceVoList.length - 1) { | ||
57 | - orderProvinceShowList += '、'; | 42 | + if (orderUserShowList === '') { |
43 | + orderUserShowList = '全选'; | ||
44 | + orderUserNumberShowList.push(0); | ||
58 | } | 45 | } |
59 | - }); | ||
60 | 46 | ||
61 | - item.orderUserVoList.forEach((event, index) => { | ||
62 | - orderUserShowList += event.userName; | ||
63 | - if (index < item.orderUserVoList.length - 1) { | ||
64 | - orderUserShowList += '、'; | ||
65 | - } | 47 | + return { |
48 | + id: item.id, | ||
49 | + zoning: item.zoning, | ||
50 | + orderProvinceShowList, | ||
51 | + orderUserShowList, | ||
52 | + orderUserNumberShowList, | ||
53 | + }; | ||
66 | }); | 54 | }); |
67 | - | ||
68 | - return { | ||
69 | - id: item.id, | ||
70 | - zoning: item.zoning, | ||
71 | - orderProvinceShowList, | ||
72 | - orderUserShowList, | ||
73 | - }; | ||
74 | -}); | 55 | + return showArray; |
56 | +} | ||
75 | 57 | ||
76 | export default () => { | 58 | export default () => { |
77 | const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]); | 59 | const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]); |
78 | const [dataSource, setDataSource] = useState<readonly zoningItem[]>([]); | 60 | const [dataSource, setDataSource] = useState<readonly zoningItem[]>([]); |
79 | const [position] = useState<'top' | 'bottom' | 'hidden'>('hidden'); | 61 | const [position] = useState<'top' | 'bottom' | 'hidden'>('hidden'); |
80 | 62 | ||
63 | + interface ActionType { | ||
64 | + reload: (resetPageIndex?: boolean) => void; | ||
65 | + reloadAndRest: () => void; | ||
66 | + reset: () => void; | ||
67 | + clearSelected?: () => void; | ||
68 | + startEditable: (rowKey: Key) => boolean; | ||
69 | + cancelEditable: (rowKey: Key) => boolean; | ||
70 | + } | ||
71 | + | ||
72 | + const ref = useRef<ActionType>({ | ||
73 | + reload: () => {}, | ||
74 | + reloadAndRest: () => {}, | ||
75 | + reset: () => {}, | ||
76 | + startEditable: () => {}, | ||
77 | + cancelEditable: () => {}, | ||
78 | + }); | ||
79 | + | ||
80 | + function reload() { | ||
81 | + ref.current.reload(); | ||
82 | + } | ||
83 | + | ||
84 | + const confirm: PopconfirmProps['onConfirm'] = async (id) => { | ||
85 | + await deleteOrderErpOrderZoNingDelete({ | ||
86 | + data: id, | ||
87 | + }); | ||
88 | + reload(); | ||
89 | + message.success('删除成功'); | ||
90 | + }; | ||
91 | + | ||
92 | + const cancel: PopconfirmProps['onCancel'] = () => { | ||
93 | + message.error('取消删除'); | ||
94 | + }; | ||
95 | + | ||
81 | const columns: ProColumns<zoningItem>[] = [ | 96 | const columns: ProColumns<zoningItem>[] = [ |
82 | { | 97 | { |
83 | title: '区域名称', | 98 | title: '区域名称', |
@@ -101,74 +116,72 @@ export default () => { | @@ -101,74 +116,72 @@ export default () => { | ||
101 | title: '操作', | 116 | title: '操作', |
102 | valueType: 'option', | 117 | valueType: 'option', |
103 | width: 200, | 118 | width: 200, |
104 | - render: (text, record, _, action) => [ | ||
105 | - <a | ||
106 | - key="editable" | ||
107 | - onClick={() => { | ||
108 | - action?.startEditable?.(record.id); | ||
109 | - }} | ||
110 | - > | ||
111 | - 编辑 | ||
112 | - </a>, | ||
113 | - <a | ||
114 | - key="delete" | ||
115 | - onClick={() => { | ||
116 | - setDataSource(dataSource.filter((item) => item.id !== record.id)); | ||
117 | - }} | ||
118 | - > | ||
119 | - 删除 | ||
120 | - </a>, | 119 | + render: (text, record) => [ |
120 | + <> | ||
121 | + <Modal | ||
122 | + toReload={reload} | ||
123 | + option={'编辑'} | ||
124 | + needEditBody={record} | ||
125 | + key={record.id} | ||
126 | + /> | ||
127 | + <Popconfirm | ||
128 | + title="删除此项" | ||
129 | + description="你确定你要删除此项吗?" | ||
130 | + onConfirm={() => { | ||
131 | + confirm(record.id); | ||
132 | + }} | ||
133 | + onCancel={cancel} | ||
134 | + okText="确定" | ||
135 | + cancelText="取消" | ||
136 | + > | ||
137 | + <Button>删除</Button> | ||
138 | + </Popconfirm> | ||
139 | + </>, | ||
121 | ], | 140 | ], |
122 | }, | 141 | }, |
123 | ]; | 142 | ]; |
124 | 143 | ||
125 | return ( | 144 | return ( |
126 | - <> | ||
127 | - <EditableProTable<zoningItem> | ||
128 | - rowKey="id" | ||
129 | - headerTitle={<Modal></Modal>} | ||
130 | - maxLength={5} | ||
131 | - scroll={{ | ||
132 | - x: 960, | ||
133 | - }} | ||
134 | - recordCreatorProps={ | ||
135 | - position !== 'hidden' | ||
136 | - ? { | ||
137 | - position: position as 'top', | ||
138 | - record: () => ({ id: (Math.random() * 1000000).toFixed(0) }), | ||
139 | - } | ||
140 | - : false | 145 | + <EditableProTable<zoningItem> |
146 | + rowKey="id" | ||
147 | + className="table-index" | ||
148 | + deletePopconfirmMessage | ||
149 | + actionRef={ref} | ||
150 | + headerTitle={ | ||
151 | + <Modal toReload={reload} option={'新增区域'} needEditBody={{}}></Modal> | ||
152 | + } | ||
153 | + maxLength={5} | ||
154 | + scroll={{ | ||
155 | + x: 960, | ||
156 | + }} | ||
157 | + recordCreatorProps={ | ||
158 | + position !== 'hidden' | ||
159 | + ? { | ||
160 | + position: position as 'top', | ||
161 | + record: () => ({ id: (Math.random() * 1000000).toFixed(0) }), | ||
162 | + } | ||
163 | + : false | ||
164 | + } | ||
165 | + loading={false} | ||
166 | + columns={columns} | ||
167 | + request={async () => { | ||
168 | + const res = await getOrderErpOrderZoNingSelectAll(); | ||
169 | + if (res) { | ||
170 | + const initDataSource = changeToShow(res.data); | ||
171 | + return { data: initDataSource || [] }; | ||
141 | } | 172 | } |
142 | - loading={false} | ||
143 | - columns={columns} | ||
144 | - request={async () => ({ | ||
145 | - data: defaultShowData, | ||
146 | - })} | ||
147 | - value={dataSource} | ||
148 | - onChange={setDataSource} | ||
149 | - editable={{ | ||
150 | - type: 'multiple', | ||
151 | - editableKeys, | ||
152 | - onSave: async (rowKey, data, row) => { | ||
153 | - console.log(rowKey, data, row); | ||
154 | - await waitTime(2000); | ||
155 | - }, | ||
156 | - onChange: setEditableRowKeys, | ||
157 | - }} | ||
158 | - /> | ||
159 | - <ProCard title="表格数据" headerBordered collapsible defaultCollapsed> | ||
160 | - <ProFormField | ||
161 | - ignoreFormItem | ||
162 | - fieldProps={{ | ||
163 | - style: { | ||
164 | - width: '100%', | ||
165 | - }, | ||
166 | - }} | ||
167 | - mode="read" | ||
168 | - valueType="jsonCode" | ||
169 | - text={JSON.stringify(dataSource)} | ||
170 | - /> | ||
171 | - </ProCard> | ||
172 | - </> | 173 | + }} |
174 | + value={dataSource} | ||
175 | + onChange={setDataSource} | ||
176 | + editable={{ | ||
177 | + type: 'multiple', | ||
178 | + editableKeys, | ||
179 | + onSave: async (rowKey, data, row) => { | ||
180 | + console.log(rowKey, data, row); | ||
181 | + await waitTime(2000); | ||
182 | + }, | ||
183 | + onChange: setEditableRowKeys, | ||
184 | + }} | ||
185 | + /> | ||
173 | ); | 186 | ); |
174 | }; | 187 | }; |
src/pages/ZoNing/index.css
0 → 100644
1 | +.item { | ||
2 | + background: '#0092ff'; | ||
3 | + padding: '8px 0'; | ||
4 | + display: flex; | ||
5 | + flex-flow: row nowrap; | ||
6 | + align-content: normal; | ||
7 | + align-items: center; | ||
8 | + padding-bottom: 20px; | ||
9 | +} | ||
10 | + | ||
11 | +.table-index td { | ||
12 | + font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial, | ||
13 | + 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', | ||
14 | + 'WenQuanYi Micro Hei', sans-serif; | ||
15 | + font-size: 14px; | ||
16 | +} |
src/pages/ZoNing/index.less
0 → 100644
1 | +.item { | ||
2 | + background: '#0092ff'; | ||
3 | + padding: '8px 0'; | ||
4 | + display: flex; | ||
5 | + flex-flow: row nowrap; | ||
6 | + // flex-direction: row; | ||
7 | + // flex-wrap: nowrap; | ||
8 | + align-content: normal; | ||
9 | + align-items: center; | ||
10 | + padding-bottom: 20px; | ||
11 | +} | ||
12 | + | ||
13 | +.table-index td { | ||
14 | + font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial, | ||
15 | + 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', | ||
16 | + 'WenQuanYi Micro Hei', sans-serif; | ||
17 | + font-size: 14px; | ||
18 | +} |
src/services/definition.ts
@@ -914,6 +914,13 @@ export interface DictionaryVO { | @@ -914,6 +914,13 @@ export interface DictionaryVO { | ||
914 | sort?: number; | 914 | sort?: number; |
915 | } | 915 | } |
916 | 916 | ||
917 | +export interface DistrictDo { | ||
918 | + /** @format int32 */ | ||
919 | + level?: number; | ||
920 | + /** @format int32 */ | ||
921 | + pid?: number; | ||
922 | +} | ||
923 | + | ||
917 | export interface Entry { | 924 | export interface Entry { |
918 | bankAccount?: string; | 925 | bankAccount?: string; |
919 | bankName?: string; | 926 | bankName?: string; |
@@ -1061,6 +1068,10 @@ export interface ItemSaItem { | @@ -1061,6 +1068,10 @@ export interface ItemSaItem { | ||
1061 | 1068 | ||
1062 | export interface MainOrderqueryRequest { | 1069 | export interface MainOrderqueryRequest { |
1063 | afterInvoicingStatusIsNull?: boolean; | 1070 | afterInvoicingStatusIsNull?: boolean; |
1071 | + /** @format date-time */ | ||
1072 | + invoicingTimeGe?: string; | ||
1073 | + /** @format date-time */ | ||
1074 | + invoicingTimeLe?: string; | ||
1064 | orderStatusNotIn?: Array<string>; | 1075 | orderStatusNotIn?: Array<string>; |
1065 | /** @format int32 */ | 1076 | /** @format int32 */ |
1066 | pageNumber?: number; | 1077 | pageNumber?: number; |
@@ -1855,7 +1866,7 @@ export interface QueryReportFormsDto { | @@ -1855,7 +1866,7 @@ export interface QueryReportFormsDto { | ||
1855 | * @description | 1866 | * @description |
1856 | * 销售代表 | 1867 | * 销售代表 |
1857 | */ | 1868 | */ |
1858 | - salesCode?: string; | 1869 | + salesCode?: Array<string>; |
1859 | /** | 1870 | /** |
1860 | * @description | 1871 | * @description |
1861 | * 统计方式 | 1872 | * 统计方式 |
@@ -1867,6 +1878,7 @@ export interface ReissueInvoiceDto { | @@ -1867,6 +1878,7 @@ export interface ReissueInvoiceDto { | ||
1867 | /** @format int64 */ | 1878 | /** @format int64 */ |
1868 | invoiceId?: number; | 1879 | invoiceId?: number; |
1869 | notes?: string; | 1880 | notes?: string; |
1881 | + purchaser?: string; | ||
1870 | } | 1882 | } |
1871 | 1883 | ||
1872 | export interface ResearchGroupAccountAddRequest { | 1884 | export interface ResearchGroupAccountAddRequest { |
src/services/request.ts
@@ -43,6 +43,7 @@ import type { | @@ -43,6 +43,7 @@ import type { | ||
43 | CustomerSaveReq, | 43 | CustomerSaveReq, |
44 | DictionaryQueryVO, | 44 | DictionaryQueryVO, |
45 | DictionaryVO, | 45 | DictionaryVO, |
46 | + DistrictDo, | ||
46 | Dto, | 47 | Dto, |
47 | InventoryMaterialStockReq, | 48 | InventoryMaterialStockReq, |
48 | InvoiceDto, | 49 | InvoiceDto, |
@@ -1765,6 +1766,338 @@ export const postCommonAudit = /* #__PURE__ */ (() => { | @@ -1765,6 +1766,338 @@ export const postCommonAudit = /* #__PURE__ */ (() => { | ||
1765 | return request; | 1766 | return request; |
1766 | })(); | 1767 | })(); |
1767 | 1768 | ||
1769 | +/** @description response type for getDistrictSelectAll */ | ||
1770 | +export interface GetDistrictSelectAllResponse { | ||
1771 | + /** | ||
1772 | + * @description | ||
1773 | + * OK | ||
1774 | + */ | ||
1775 | + 200: ServerResult; | ||
1776 | + /** | ||
1777 | + * @description | ||
1778 | + * Unauthorized | ||
1779 | + */ | ||
1780 | + 401: any; | ||
1781 | + /** | ||
1782 | + * @description | ||
1783 | + * Forbidden | ||
1784 | + */ | ||
1785 | + 403: any; | ||
1786 | + /** | ||
1787 | + * @description | ||
1788 | + * Not Found | ||
1789 | + */ | ||
1790 | + 404: any; | ||
1791 | +} | ||
1792 | + | ||
1793 | +export type GetDistrictSelectAllResponseSuccess = | ||
1794 | + GetDistrictSelectAllResponse[200]; | ||
1795 | +/** | ||
1796 | + * @description | ||
1797 | + * 查询全部 | ||
1798 | + * @tags order-district-controller | ||
1799 | + * @produces * | ||
1800 | + */ | ||
1801 | +export const getDistrictSelectAll = /* #__PURE__ */ (() => { | ||
1802 | + const method = 'get'; | ||
1803 | + const url = '/district/selectAll'; | ||
1804 | + function request(): Promise<GetDistrictSelectAllResponseSuccess> { | ||
1805 | + return requester(request.url, { | ||
1806 | + method: request.method, | ||
1807 | + }) as unknown as Promise<GetDistrictSelectAllResponseSuccess>; | ||
1808 | + } | ||
1809 | + | ||
1810 | + /** http method */ | ||
1811 | + request.method = method; | ||
1812 | + /** request url */ | ||
1813 | + request.url = url; | ||
1814 | + return request; | ||
1815 | +})(); | ||
1816 | + | ||
1817 | +/** @description request parameter type for postDistrictSelectBelong */ | ||
1818 | +export interface PostDistrictSelectBelongOption { | ||
1819 | + /** | ||
1820 | + * @description | ||
1821 | + * pid | ||
1822 | + */ | ||
1823 | + body: { | ||
1824 | + /** | ||
1825 | + @description | ||
1826 | + pid */ | ||
1827 | + pid: number; | ||
1828 | + }; | ||
1829 | +} | ||
1830 | + | ||
1831 | +/** @description response type for postDistrictSelectBelong */ | ||
1832 | +export interface PostDistrictSelectBelongResponse { | ||
1833 | + /** | ||
1834 | + * @description | ||
1835 | + * OK | ||
1836 | + */ | ||
1837 | + 200: ServerResult; | ||
1838 | + /** | ||
1839 | + * @description | ||
1840 | + * Created | ||
1841 | + */ | ||
1842 | + 201: any; | ||
1843 | + /** | ||
1844 | + * @description | ||
1845 | + * Unauthorized | ||
1846 | + */ | ||
1847 | + 401: any; | ||
1848 | + /** | ||
1849 | + * @description | ||
1850 | + * Forbidden | ||
1851 | + */ | ||
1852 | + 403: any; | ||
1853 | + /** | ||
1854 | + * @description | ||
1855 | + * Not Found | ||
1856 | + */ | ||
1857 | + 404: any; | ||
1858 | +} | ||
1859 | + | ||
1860 | +export type PostDistrictSelectBelongResponseSuccess = | ||
1861 | + PostDistrictSelectBelongResponse[200]; | ||
1862 | +/** | ||
1863 | + * @description | ||
1864 | + * 根据父级进行筛选 | ||
1865 | + * @tags order-district-controller | ||
1866 | + * @produces * | ||
1867 | + * @consumes application/json | ||
1868 | + */ | ||
1869 | +export const postDistrictSelectBelong = /* #__PURE__ */ (() => { | ||
1870 | + const method = 'post'; | ||
1871 | + const url = '/district/selectBelong'; | ||
1872 | + function request( | ||
1873 | + option: PostDistrictSelectBelongOption, | ||
1874 | + ): Promise<PostDistrictSelectBelongResponseSuccess> { | ||
1875 | + return requester(request.url, { | ||
1876 | + method: request.method, | ||
1877 | + ...option, | ||
1878 | + }) as unknown as Promise<PostDistrictSelectBelongResponseSuccess>; | ||
1879 | + } | ||
1880 | + | ||
1881 | + /** http method */ | ||
1882 | + request.method = method; | ||
1883 | + /** request url */ | ||
1884 | + request.url = url; | ||
1885 | + return request; | ||
1886 | +})(); | ||
1887 | + | ||
1888 | +/** @description request parameter type for postDistrictSelectBelongAndLevel */ | ||
1889 | +export interface PostDistrictSelectBelongAndLevelOption { | ||
1890 | + /** | ||
1891 | + * @description | ||
1892 | + * districtDo | ||
1893 | + */ | ||
1894 | + body: { | ||
1895 | + /** | ||
1896 | + @description | ||
1897 | + districtDo */ | ||
1898 | + districtDo: DistrictDo; | ||
1899 | + }; | ||
1900 | +} | ||
1901 | + | ||
1902 | +/** @description response type for postDistrictSelectBelongAndLevel */ | ||
1903 | +export interface PostDistrictSelectBelongAndLevelResponse { | ||
1904 | + /** | ||
1905 | + * @description | ||
1906 | + * OK | ||
1907 | + */ | ||
1908 | + 200: ServerResult; | ||
1909 | + /** | ||
1910 | + * @description | ||
1911 | + * Created | ||
1912 | + */ | ||
1913 | + 201: any; | ||
1914 | + /** | ||
1915 | + * @description | ||
1916 | + * Unauthorized | ||
1917 | + */ | ||
1918 | + 401: any; | ||
1919 | + /** | ||
1920 | + * @description | ||
1921 | + * Forbidden | ||
1922 | + */ | ||
1923 | + 403: any; | ||
1924 | + /** | ||
1925 | + * @description | ||
1926 | + * Not Found | ||
1927 | + */ | ||
1928 | + 404: any; | ||
1929 | +} | ||
1930 | + | ||
1931 | +export type PostDistrictSelectBelongAndLevelResponseSuccess = | ||
1932 | + PostDistrictSelectBelongAndLevelResponse[200]; | ||
1933 | +/** | ||
1934 | + * @description | ||
1935 | + * 根据父级和等级进行筛选 | ||
1936 | + * @tags order-district-controller | ||
1937 | + * @produces * | ||
1938 | + * @consumes application/json | ||
1939 | + */ | ||
1940 | +export const postDistrictSelectBelongAndLevel = /* #__PURE__ */ (() => { | ||
1941 | + const method = 'post'; | ||
1942 | + const url = '/district/selectBelongAndLevel'; | ||
1943 | + function request( | ||
1944 | + option: PostDistrictSelectBelongAndLevelOption, | ||
1945 | + ): Promise<PostDistrictSelectBelongAndLevelResponseSuccess> { | ||
1946 | + return requester(request.url, { | ||
1947 | + method: request.method, | ||
1948 | + ...option, | ||
1949 | + }) as unknown as Promise<PostDistrictSelectBelongAndLevelResponseSuccess>; | ||
1950 | + } | ||
1951 | + | ||
1952 | + /** http method */ | ||
1953 | + request.method = method; | ||
1954 | + /** request url */ | ||
1955 | + request.url = url; | ||
1956 | + return request; | ||
1957 | +})(); | ||
1958 | + | ||
1959 | +/** @description request parameter type for postDistrictSelectBelongByName */ | ||
1960 | +export interface PostDistrictSelectBelongByNameOption { | ||
1961 | + /** | ||
1962 | + * @description | ||
1963 | + * district | ||
1964 | + */ | ||
1965 | + body: { | ||
1966 | + /** | ||
1967 | + @description | ||
1968 | + district */ | ||
1969 | + district: string; | ||
1970 | + }; | ||
1971 | +} | ||
1972 | + | ||
1973 | +/** @description response type for postDistrictSelectBelongByName */ | ||
1974 | +export interface PostDistrictSelectBelongByNameResponse { | ||
1975 | + /** | ||
1976 | + * @description | ||
1977 | + * OK | ||
1978 | + */ | ||
1979 | + 200: ServerResult; | ||
1980 | + /** | ||
1981 | + * @description | ||
1982 | + * Created | ||
1983 | + */ | ||
1984 | + 201: any; | ||
1985 | + /** | ||
1986 | + * @description | ||
1987 | + * Unauthorized | ||
1988 | + */ | ||
1989 | + 401: any; | ||
1990 | + /** | ||
1991 | + * @description | ||
1992 | + * Forbidden | ||
1993 | + */ | ||
1994 | + 403: any; | ||
1995 | + /** | ||
1996 | + * @description | ||
1997 | + * Not Found | ||
1998 | + */ | ||
1999 | + 404: any; | ||
2000 | +} | ||
2001 | + | ||
2002 | +export type PostDistrictSelectBelongByNameResponseSuccess = | ||
2003 | + PostDistrictSelectBelongByNameResponse[200]; | ||
2004 | +/** | ||
2005 | + * @description | ||
2006 | + * 根据父级名字进行筛选 | ||
2007 | + * @tags order-district-controller | ||
2008 | + * @produces * | ||
2009 | + * @consumes application/json | ||
2010 | + */ | ||
2011 | +export const postDistrictSelectBelongByName = /* #__PURE__ */ (() => { | ||
2012 | + const method = 'post'; | ||
2013 | + const url = '/district/selectBelongByName'; | ||
2014 | + function request( | ||
2015 | + option: PostDistrictSelectBelongByNameOption, | ||
2016 | + ): Promise<PostDistrictSelectBelongByNameResponseSuccess> { | ||
2017 | + return requester(request.url, { | ||
2018 | + method: request.method, | ||
2019 | + ...option, | ||
2020 | + }) as unknown as Promise<PostDistrictSelectBelongByNameResponseSuccess>; | ||
2021 | + } | ||
2022 | + | ||
2023 | + /** http method */ | ||
2024 | + request.method = method; | ||
2025 | + /** request url */ | ||
2026 | + request.url = url; | ||
2027 | + return request; | ||
2028 | +})(); | ||
2029 | + | ||
2030 | +/** @description request parameter type for postDistrictSelectByLevel */ | ||
2031 | +export interface PostDistrictSelectByLevelOption { | ||
2032 | + /** | ||
2033 | + * @description | ||
2034 | + * level | ||
2035 | + */ | ||
2036 | + body: { | ||
2037 | + /** | ||
2038 | + @description | ||
2039 | + level */ | ||
2040 | + level: number; | ||
2041 | + }; | ||
2042 | +} | ||
2043 | + | ||
2044 | +/** @description response type for postDistrictSelectByLevel */ | ||
2045 | +export interface PostDistrictSelectByLevelResponse { | ||
2046 | + /** | ||
2047 | + * @description | ||
2048 | + * OK | ||
2049 | + */ | ||
2050 | + 200: ServerResult; | ||
2051 | + /** | ||
2052 | + * @description | ||
2053 | + * Created | ||
2054 | + */ | ||
2055 | + 201: any; | ||
2056 | + /** | ||
2057 | + * @description | ||
2058 | + * Unauthorized | ||
2059 | + */ | ||
2060 | + 401: any; | ||
2061 | + /** | ||
2062 | + * @description | ||
2063 | + * Forbidden | ||
2064 | + */ | ||
2065 | + 403: any; | ||
2066 | + /** | ||
2067 | + * @description | ||
2068 | + * Not Found | ||
2069 | + */ | ||
2070 | + 404: any; | ||
2071 | +} | ||
2072 | + | ||
2073 | +export type PostDistrictSelectByLevelResponseSuccess = | ||
2074 | + PostDistrictSelectByLevelResponse[200]; | ||
2075 | +/** | ||
2076 | + * @description | ||
2077 | + * 根据等级查询 | ||
2078 | + * @tags order-district-controller | ||
2079 | + * @produces * | ||
2080 | + * @consumes application/json | ||
2081 | + */ | ||
2082 | +export const postDistrictSelectByLevel = /* #__PURE__ */ (() => { | ||
2083 | + const method = 'post'; | ||
2084 | + const url = '/district/selectByLevel'; | ||
2085 | + function request( | ||
2086 | + option: PostDistrictSelectByLevelOption, | ||
2087 | + ): Promise<PostDistrictSelectByLevelResponseSuccess> { | ||
2088 | + return requester(request.url, { | ||
2089 | + method: request.method, | ||
2090 | + ...option, | ||
2091 | + }) as unknown as Promise<PostDistrictSelectByLevelResponseSuccess>; | ||
2092 | + } | ||
2093 | + | ||
2094 | + /** http method */ | ||
2095 | + request.method = method; | ||
2096 | + /** request url */ | ||
2097 | + request.url = url; | ||
2098 | + return request; | ||
2099 | +})(); | ||
2100 | + | ||
1768 | /** @description response type for getError */ | 2101 | /** @description response type for getError */ |
1769 | export interface GetErrorResponse { | 2102 | export interface GetErrorResponse { |
1770 | /** | 2103 | /** |
@@ -7248,6 +7581,78 @@ export const getOrderErpOrderZoNingSelectProvinceAll = /* #__PURE__ */ (() => { | @@ -7248,6 +7581,78 @@ export const getOrderErpOrderZoNingSelectProvinceAll = /* #__PURE__ */ (() => { | ||
7248 | return request; | 7581 | return request; |
7249 | })(); | 7582 | })(); |
7250 | 7583 | ||
7584 | +/** @description request parameter type for postOrderErpOrderZoNingSelectSaleUserByProvince */ | ||
7585 | +export interface PostOrderErpOrderZoNingSelectSaleUserByProvinceOption { | ||
7586 | + /** | ||
7587 | + * @description | ||
7588 | + * zoning | ||
7589 | + */ | ||
7590 | + body: { | ||
7591 | + /** | ||
7592 | + @description | ||
7593 | + zoning */ | ||
7594 | + zoning: string; | ||
7595 | + }; | ||
7596 | +} | ||
7597 | + | ||
7598 | +/** @description response type for postOrderErpOrderZoNingSelectSaleUserByProvince */ | ||
7599 | +export interface PostOrderErpOrderZoNingSelectSaleUserByProvinceResponse { | ||
7600 | + /** | ||
7601 | + * @description | ||
7602 | + * OK | ||
7603 | + */ | ||
7604 | + 200: ServerResult; | ||
7605 | + /** | ||
7606 | + * @description | ||
7607 | + * Created | ||
7608 | + */ | ||
7609 | + 201: any; | ||
7610 | + /** | ||
7611 | + * @description | ||
7612 | + * Unauthorized | ||
7613 | + */ | ||
7614 | + 401: any; | ||
7615 | + /** | ||
7616 | + * @description | ||
7617 | + * Forbidden | ||
7618 | + */ | ||
7619 | + 403: any; | ||
7620 | + /** | ||
7621 | + * @description | ||
7622 | + * Not Found | ||
7623 | + */ | ||
7624 | + 404: any; | ||
7625 | +} | ||
7626 | + | ||
7627 | +export type PostOrderErpOrderZoNingSelectSaleUserByProvinceResponseSuccess = | ||
7628 | + PostOrderErpOrderZoNingSelectSaleUserByProvinceResponse[200]; | ||
7629 | +/** | ||
7630 | + * @description | ||
7631 | + * 查询出这个大区所包含的销售 | ||
7632 | + * @tags order-zo-ning-controller | ||
7633 | + * @produces * | ||
7634 | + * @consumes application/json | ||
7635 | + */ | ||
7636 | +export const postOrderErpOrderZoNingSelectSaleUserByProvince = | ||
7637 | + /* #__PURE__ */ (() => { | ||
7638 | + const method = 'post'; | ||
7639 | + const url = '/order/erp/orderZoNing/selectSaleUserByProvince'; | ||
7640 | + function request( | ||
7641 | + option: PostOrderErpOrderZoNingSelectSaleUserByProvinceOption, | ||
7642 | + ): Promise<PostOrderErpOrderZoNingSelectSaleUserByProvinceResponseSuccess> { | ||
7643 | + return requester(request.url, { | ||
7644 | + method: request.method, | ||
7645 | + ...option, | ||
7646 | + }) as unknown as Promise<PostOrderErpOrderZoNingSelectSaleUserByProvinceResponseSuccess>; | ||
7647 | + } | ||
7648 | + | ||
7649 | + /** http method */ | ||
7650 | + request.method = method; | ||
7651 | + /** request url */ | ||
7652 | + request.url = url; | ||
7653 | + return request; | ||
7654 | + })(); | ||
7655 | + | ||
7251 | /** @description response type for getOrderErpOrderZoNingSelectUserAll */ | 7656 | /** @description response type for getOrderErpOrderZoNingSelectUserAll */ |
7252 | export interface GetOrderErpOrderZoNingSelectUserAllResponse { | 7657 | export interface GetOrderErpOrderZoNingSelectUserAllResponse { |
7253 | /** | 7658 | /** |
tailwind.config.js
1 | -module.exports = { | ||
2 | - content: [ | ||
3 | - './src/pages/**/*.tsx', | ||
4 | - './src/components/**/*.tsx', | ||
5 | - './src/layouts/**/*.tsx', | ||
6 | - ], | ||
7 | - corePlugins: { | ||
8 | - preflight: false, | ||
9 | - }, | 1 | +export const content = [ |
2 | + './src/pages/**/*.tsx', | ||
3 | + './src/components/**/*.tsx', | ||
4 | + './src/layouts/**/*.tsx', | ||
5 | +]; | ||
6 | +export const corePlugins = { | ||
7 | + preflight: false, | ||
10 | }; | 8 | }; |