Commit 1d3923f970d6a8b97335540511b4cce37a062766
Merge branch 'znh231123' into 'develop'
跟新了打印页面和图片上传 See merge request !7
Showing
15 changed files
with
1493 additions
and
548 deletions
.umirc.ts
... | ... | @@ -13,8 +13,8 @@ export default defineConfig({ |
13 | 13 | }, |
14 | 14 | proxy: { |
15 | 15 | '/api/': { |
16 | - // target: 'http://localhost:8085/', | |
17 | - target: 'http://39.108.227.113:8085/', | |
16 | + target: 'http://localhost:8085/', | |
17 | + // target: 'http://39.108.227.113:8085/', | |
18 | 18 | changeOrigin: true, |
19 | 19 | pathRewrite: { '^/api': '' }, |
20 | 20 | }, | ... | ... |
src/pages/Order/components/ConfirmReceiptModal.tsx
1 | +import { RESPONSE_CODE } from '@/constants/enum'; | |
1 | 2 | import { postServiceOrderConfirmReceipt } from '@/services'; |
2 | -import { UploadOutlined } from '@ant-design/icons'; | |
3 | -import { ModalForm } from '@ant-design/pro-components'; | |
4 | -import { Button, Form, Upload } from 'antd'; | |
3 | +import { PlusOutlined } from '@ant-design/icons'; | |
4 | +import { Button, Modal, Upload, message } from 'antd'; | |
5 | 5 | import { RcFile, UploadFile, UploadProps } from 'antd/es/upload'; |
6 | 6 | import { useState } from 'react'; |
7 | 7 | export default ({ data, onClose }) => { |
8 | - const [form] = Form.useForm<{ name: string; company: string }>(); | |
8 | + // const [form] = Form.useForm<{ name: string; company: string }>(); | |
9 | 9 | const [previewOpen, setPreviewOpen] = useState(false); |
10 | 10 | const [previewImage, setPreviewImage] = useState(''); |
11 | 11 | const [previewTitle, setPreviewTitle] = useState(''); |
12 | - console.log(previewOpen); | |
13 | - console.log(previewImage); | |
14 | - console.log(previewTitle); | |
15 | 12 | const getBase64 = (file: RcFile): Promise<string> => |
16 | 13 | new Promise((resolve, reject) => { |
17 | 14 | const reader = new FileReader(); |
... | ... | @@ -19,20 +16,18 @@ export default ({ data, onClose }) => { |
19 | 16 | reader.onload = () => resolve(reader.result as string); |
20 | 17 | reader.onerror = (error) => reject(error); |
21 | 18 | }); |
22 | - // const beforeUpload = (file: RcFile) => { | |
23 | - // const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; | |
24 | - // if (!isJpgOrPng) { | |
25 | - // message.error('You can only upload JPG/PNG file!'); | |
26 | - // } | |
27 | - // const isLt2M = file.size / 1024 / 1024 < 2; | |
28 | - // if (!isLt2M) { | |
29 | - // message.error('Image must smaller than 2MB!'); | |
30 | - // } | |
31 | - // return isJpgOrPng && isLt2M; | |
32 | - // }; | |
33 | 19 | const [fileList, setFileList] = useState<UploadFile[]>([]); |
34 | 20 | const [uploading, setUploading] = useState(false); |
21 | + const handleCancel = () => setPreviewOpen(false); | |
22 | + const handleChange: UploadProps['onChange'] = ({ fileList: newFileList }) => | |
23 | + setFileList(newFileList); | |
35 | 24 | |
25 | + const uploadButton = ( | |
26 | + <div> | |
27 | + <PlusOutlined /> | |
28 | + <div style={{ marginTop: 8 }}>上传凭证</div> | |
29 | + </div> | |
30 | + ); | |
36 | 31 | const handlePreview = async (file: UploadFile) => { |
37 | 32 | if (!file.url && !file.preview) { |
38 | 33 | file.preview = await getBase64(file.originFileObj as RcFile); |
... | ... | @@ -47,15 +42,27 @@ export default ({ data, onClose }) => { |
47 | 42 | |
48 | 43 | const handleUpload = async () => { |
49 | 44 | const formData = new FormData(); |
50 | - // fileList.forEach((file) => { | |
51 | - // formData.append('files[]', file as RcFile); | |
52 | - // }); | |
53 | - formData.append('file', fileList[0] as RcFile); | |
45 | + fileList.forEach((file) => { | |
46 | + //originFileObj二进制文件 | |
47 | + formData.append('files', file.originFileObj as RcFile); | |
48 | + }); | |
49 | + // console.log(fileList[0] as RcFile) | |
50 | + // formData.append('file', fileList[0] as RcFile); | |
54 | 51 | formData.append('id', data.id); |
55 | 52 | setUploading(true); |
56 | 53 | // You can use any AJAX library you like |
57 | - const res = await postServiceOrderConfirmReceipt({ data: formData }); | |
58 | - console.log(res); | |
54 | + const res = await postServiceOrderConfirmReceipt({ | |
55 | + data: formData, | |
56 | + headers: { | |
57 | + 'Content-Type': | |
58 | + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | |
59 | + }, | |
60 | + }); | |
61 | + | |
62 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
63 | + message.success(res.message); | |
64 | + onClose(); | |
65 | + } | |
59 | 66 | |
60 | 67 | setUploading(false); |
61 | 68 | }; |
... | ... | @@ -72,37 +79,47 @@ export default ({ data, onClose }) => { |
72 | 79 | |
73 | 80 | return false; |
74 | 81 | }, |
82 | + listType: 'picture-card', | |
75 | 83 | onPreview: handlePreview, |
76 | 84 | fileList, |
85 | + onChange: handleChange, | |
77 | 86 | }; |
78 | 87 | |
79 | 88 | return ( |
80 | - <ModalForm<{ | |
81 | - name: string; | |
82 | - company: string; | |
83 | - }> | |
84 | - width={500} | |
85 | - open | |
86 | - title="确认收货" | |
87 | - form={form} | |
88 | - autoFocusFirstInput | |
89 | - submitTimeout={2000} | |
90 | - onFinish={async () => { | |
91 | - onClose(); | |
92 | - }} | |
93 | - > | |
94 | - <Upload {...props}> | |
95 | - <Button icon={<UploadOutlined />}>Select File</Button> | |
96 | - </Upload> | |
97 | - <Button | |
98 | - type="primary" | |
99 | - onClick={handleUpload} | |
100 | - disabled={fileList.length === 0} | |
101 | - loading={uploading} | |
102 | - style={{ marginTop: 16 }} | |
89 | + <> | |
90 | + <Modal | |
91 | + width={500} | |
92 | + open | |
93 | + title="确认收货" | |
94 | + footer={[ | |
95 | + <Button key="cancel" onClick={onClose}> | |
96 | + 取消 | |
97 | + </Button>, | |
98 | + <Button | |
99 | + type="primary" | |
100 | + key="ok" | |
101 | + onClick={handleUpload} | |
102 | + disabled={fileList.length === 0} | |
103 | + loading={uploading} | |
104 | + > | |
105 | + {uploading ? '上传中' : '提交'} | |
106 | + </Button>, | |
107 | + ]} | |
108 | + onCancel={async () => { | |
109 | + onClose(); | |
110 | + }} | |
111 | + > | |
112 | + <div className="py-4 font-semibold">请将买家确认收货的凭证照片上传</div> | |
113 | + <Upload {...props}>{fileList.length < 3 ? uploadButton : ''}</Upload> | |
114 | + </Modal> | |
115 | + <Modal | |
116 | + open={previewOpen} | |
117 | + title={previewTitle} | |
118 | + footer={null} | |
119 | + onCancel={handleCancel} | |
103 | 120 | > |
104 | - {uploading ? 'Uploading' : 'Start Upload'} | |
105 | - </Button> | |
106 | - </ModalForm> | |
121 | + <img alt="example" style={{ width: '100%' }} src={previewImage} /> | |
122 | + </Modal> | |
123 | + </> | |
107 | 124 | ); |
108 | 125 | }; | ... | ... |
src/pages/Order/components/FinancialDrawer.tsx
1 | 1 | // import { PlusOutlined } from '@ant-design/icons'; |
2 | +import { RESPONSE_CODE } from '@/constants/enum'; | |
3 | +import { | |
4 | + postServiceOrderEditOrder, | |
5 | + postServiceOrderInvoicing, | |
6 | +} from '@/services'; | |
2 | 7 | import { |
3 | 8 | DrawerForm, |
4 | 9 | ProFormDatePicker, |
... | ... | @@ -14,9 +19,9 @@ import { Form, message } from 'antd'; |
14 | 19 | // }); |
15 | 20 | // }; |
16 | 21 | |
17 | -export default ({ mainOrder, subOrders, onClose }) => { | |
22 | +export default ({ mainOrder, subOrders, isEdit, onClose }) => { | |
23 | + const subIds = subOrders.map((item) => item.id); | |
18 | 24 | console.log(subOrders); |
19 | - | |
20 | 25 | const [form] = Form.useForm<{ name: string; company: string }>(); |
21 | 26 | return ( |
22 | 27 | <DrawerForm<{ |
... | ... | @@ -39,14 +44,23 @@ export default ({ mainOrder, subOrders, onClose }) => { |
39 | 44 | destroyOnClose: true, |
40 | 45 | }} |
41 | 46 | submitTimeout={2000} |
42 | - onFinish={async (values) => { | |
43 | - console.log(form); | |
44 | - console.log(values); | |
45 | - console.log(values.name); | |
46 | - message.success('提交成功'); | |
47 | - // 不返回不会关闭弹框 | |
48 | - onClose(); | |
49 | - return true; | |
47 | + onFinish={async () => { | |
48 | + let res; | |
49 | + let body = { | |
50 | + invoicingTime: form.getFieldValue('invoicingTime'), | |
51 | + subIds: subIds, | |
52 | + collectMoneyTime: undefined, | |
53 | + }; | |
54 | + if (isEdit) { | |
55 | + body.collectMoneyTime = form.getFieldValue('collectMoneyTime'); | |
56 | + res = await postServiceOrderEditOrder({ data: body }); | |
57 | + } else { | |
58 | + res = await postServiceOrderInvoicing({ data: body }); | |
59 | + } | |
60 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
61 | + message.success(res.message); | |
62 | + onClose(); | |
63 | + } | |
50 | 64 | }} |
51 | 65 | onOpenChange={(val) => { |
52 | 66 | return !val && onClose(); |
... | ... | @@ -73,8 +87,20 @@ export default ({ mainOrder, subOrders, onClose }) => { |
73 | 87 | placeholder="请输入开户银行账号" |
74 | 88 | disabled |
75 | 89 | /> |
76 | - <ProFormDatePicker width="lg" name="invoicingTime" label="开票时间" /> | |
77 | - <ProFormDatePicker width="lg" name="collectMoneyTime" label="收款时间" /> | |
90 | + <ProFormDatePicker | |
91 | + width="lg" | |
92 | + name="invoicingTime" | |
93 | + label="开票时间" | |
94 | + disabled={isEdit} | |
95 | + rules={[{ required: !isEdit ? true : false, message: '这是必填项' }]} | |
96 | + initialValue={subOrders[0].invoicingTime} | |
97 | + /> | |
98 | + <ProFormDatePicker | |
99 | + width="lg" | |
100 | + name="collectMoneyTime" | |
101 | + label="收款时间" | |
102 | + initialValue={subOrders[0].collectMoneyTime} | |
103 | + /> | |
78 | 104 | </DrawerForm> |
79 | 105 | ); |
80 | 106 | }; | ... | ... |
src/pages/Order/components/OrderDrawer.tsx
... | ... | @@ -28,9 +28,11 @@ import { |
28 | 28 | export default ({ onClose, data, isAdd }) => { |
29 | 29 | const [invoicingStatus, setInvoicingStatus] = useState(''); |
30 | 30 | |
31 | - //订单修改和新增的子订单列表命名是list | |
32 | - data.list = data.subOrderInformationLists; | |
33 | 31 | if (!isAdd) { |
32 | + //订单修改和新增的子订单列表命名是list | |
33 | + data.list = data.subOrderInformationLists; | |
34 | + //主订单事业部默认显示子订单第一条的事业部 | |
35 | + data.productBelongBusiness = data.list[0].productBelongBusiness; | |
34 | 36 | data.paymentMethod = data.list[0].paymentMethod; |
35 | 37 | data.paymentChannel = data.list[0].paymentChannel; |
36 | 38 | data.invoicingStatus = data.list[0].invoicingStatus; |
... | ... | @@ -52,6 +54,7 @@ export default ({ onClose, data, isAdd }) => { |
52 | 54 | invoicingTime: ''; |
53 | 55 | bank: ''; |
54 | 56 | bankAccountNumber: ''; |
57 | + deleteSubOrderLists: []; | |
55 | 58 | notes: ''; |
56 | 59 | list: [ |
57 | 60 | { |
... | ... | @@ -87,9 +90,9 @@ export default ({ onClose, data, isAdd }) => { |
87 | 90 | function autoFillProductInfo(option: any, currentRowData: any) { |
88 | 91 | let copyList = form.getFieldValue('list'); |
89 | 92 | let currentData = copyList[currentRowData.field.key]; |
90 | - currentData.productCode = option.productCode; | |
91 | - currentData.parameters = option.specifications; | |
92 | - currentData.unit = option.unit; | |
93 | + currentData.productCode = option?.productCode; | |
94 | + currentData.parameters = option?.specifications; | |
95 | + currentData.unit = option?.unit; | |
93 | 96 | form.setFieldValue('list', copyList); |
94 | 97 | } |
95 | 98 | |
... | ... | @@ -122,17 +125,26 @@ export default ({ onClose, data, isAdd }) => { |
122 | 125 | }} |
123 | 126 | submitTimeout={2000} |
124 | 127 | onFinish={async (values) => { |
125 | - let data = {}; | |
128 | + let res = {}; | |
126 | 129 | if (isAdd) { |
127 | - message.info('add'); | |
128 | - data = await postServiceOrderAddOrder({ data: values }); | |
130 | + res = await postServiceOrderAddOrder({ data: values }); | |
129 | 131 | } else { |
130 | - message.info('update'); | |
131 | - data = await postServiceOrderUpdateOrder({ data: values }); | |
132 | + //计算已删除的子订单id | |
133 | + const originIds = data.subOrderInformationLists.map((item) => { | |
134 | + return item.id; | |
135 | + }); | |
136 | + console.log('originIds:' + originIds); | |
137 | + const curIds = form.getFieldValue('list')?.map((item) => { | |
138 | + return item.id; | |
139 | + }); | |
140 | + console.log('curIds:' + curIds); | |
141 | + const diff = originIds.filter((item) => !curIds.includes(item)); | |
142 | + values.deleteSubOrderLists = diff; | |
143 | + res = await postServiceOrderUpdateOrder({ data: values }); | |
132 | 144 | } |
133 | 145 | |
134 | - if (data.result === RESPONSE_CODE.SUCCESS) { | |
135 | - message.success(data.message); | |
146 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
147 | + message.success(res.message); | |
136 | 148 | // 不返回不会关闭弹框 |
137 | 149 | onClose(); |
138 | 150 | return true; |
... | ... | @@ -164,38 +176,49 @@ export default ({ onClose, data, isAdd }) => { |
164 | 176 | width="lg" |
165 | 177 | label="收货人" |
166 | 178 | placeholder="请输入收货人" |
179 | + rules={[{ required: true, message: '收货人必填' }]} | |
167 | 180 | /> |
168 | 181 | <ProFormText |
169 | 182 | width="lg" |
170 | 183 | name="customerContactNumber" |
171 | 184 | label="联系方式" |
172 | 185 | placeholder="请输入联系方式" |
186 | + rules={[{ required: true, message: '联系方式必填' }]} | |
173 | 187 | /> |
174 | 188 | <ProFormText |
175 | 189 | width="lg" |
176 | 190 | name="institution" |
177 | 191 | label="单位" |
178 | 192 | placeholder="请输入单位" |
193 | + rules={[{ required: true, message: '单位必填' }]} | |
179 | 194 | /> |
180 | 195 | <ProFormText |
181 | 196 | width="lg" |
182 | 197 | name="institutionContactName" |
183 | 198 | label="单位联系人" |
184 | 199 | placeholder="请输入单位联系人" |
200 | + rules={[{ required: true, message: '单位联系人必填' }]} | |
185 | 201 | /> |
186 | 202 | <ProFormTextArea |
187 | 203 | width="lg" |
188 | 204 | name="customerShippingAddress" |
189 | 205 | label="收货地址" |
190 | 206 | placeholder="请输入收货地址" |
207 | + rules={[{ required: true, message: '收货地址必填' }]} | |
208 | + /> | |
209 | + <ProFormText | |
210 | + name="totalPayment" | |
211 | + width="lg" | |
212 | + label="支付总额(¥)" | |
213 | + rules={[{ required: true, message: '支付总额必填' }]} | |
191 | 214 | /> |
192 | - <ProFormText name="totalPayment" width="lg" label="支付总额(¥)" /> | |
193 | 215 | <ProFormSelect |
194 | 216 | placeholder="请输入支付渠道" |
195 | 217 | name="paymentChannel" |
196 | 218 | width="lg" |
197 | 219 | label="支付渠道" |
198 | 220 | options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)} |
221 | + rules={[{ required: true, message: '支付渠道必填' }]} | |
199 | 222 | /> |
200 | 223 | <ProFormSelect |
201 | 224 | placeholder="请输入支付方式" |
... | ... | @@ -203,6 +226,7 @@ export default ({ onClose, data, isAdd }) => { |
203 | 226 | width="lg" |
204 | 227 | label="支付方式" |
205 | 228 | options={enumToSelect(PAYMENT_METHOD_OPTIONS)} |
229 | + rules={[{ required: true, message: '支付方式必填' }]} | |
206 | 230 | /> |
207 | 231 | <ProFormSelect |
208 | 232 | placeholder="请输入所属事业部" |
... | ... | @@ -210,6 +234,7 @@ export default ({ onClose, data, isAdd }) => { |
210 | 234 | width="lg" |
211 | 235 | label="所属事业部" |
212 | 236 | options={enumToSelect(PRODUCT_BELONG_DEPARTMENT_OPTIONS)} |
237 | + rules={[{ required: true, message: '所属事业部必填' }]} | |
213 | 238 | /> |
214 | 239 | <ProFormSelect |
215 | 240 | placeholder="选择是否需要开票" |
... | ... | @@ -220,6 +245,7 @@ export default ({ onClose, data, isAdd }) => { |
220 | 245 | onChange={(_, option) => { |
221 | 246 | setInvoicingStatus(option.value); |
222 | 247 | }} |
248 | + rules={[{ required: true, message: '是否需要开票必填' }]} | |
223 | 249 | /> |
224 | 250 | <ProFormText |
225 | 251 | width="lg" |
... | ... | @@ -227,11 +253,18 @@ export default ({ onClose, data, isAdd }) => { |
227 | 253 | label="开票信息" |
228 | 254 | hidden={invoicingStatus !== 'INVOICED'} |
229 | 255 | placeholder="请输入开票信息" |
256 | + rules={[ | |
257 | + { | |
258 | + required: invoicingStatus === 'INVOICED' ? true : false, | |
259 | + message: '开票信息必填', | |
260 | + }, | |
261 | + ]} | |
230 | 262 | /> |
231 | 263 | {getUserInfo().roleSmallVO?.code === 'admin' ? ( |
232 | 264 | <ProFormDateTimePicker |
233 | 265 | width="lg" |
234 | 266 | name="invoicingTime" |
267 | + hidden={invoicingStatus === 'INVOICED'} | |
235 | 268 | label="开票时间" |
236 | 269 | placeholder="请输入开票时间" |
237 | 270 | /> |
... | ... | @@ -405,6 +438,7 @@ export default ({ onClose, data, isAdd }) => { |
405 | 438 | showSearch |
406 | 439 | name="productName" |
407 | 440 | placeholder="请搜索商品" |
441 | + rules={[{ required: true, message: '商品名称必填' }]} | |
408 | 442 | onChange={(_, option) => { |
409 | 443 | autoFillProductInfo(option, listMeta); |
410 | 444 | }} |
... | ... | @@ -444,19 +478,22 @@ export default ({ onClose, data, isAdd }) => { |
444 | 478 | name="quantity" |
445 | 479 | label="商品数量" |
446 | 480 | placeholder="请输入商品数量" |
481 | + rules={[{ required: true, message: '商品数量必填' }]} | |
447 | 482 | /> |
448 | 483 | <ProFormDigit |
449 | 484 | width="lg" |
450 | 485 | name="productPrice" |
451 | 486 | label="商品单价" |
452 | 487 | placeholder="请输入商品单价" |
488 | + rules={[{ required: true, message: '商品单价必填' }]} | |
453 | 489 | /> |
454 | 490 | <ProFormText |
455 | 491 | width="lg" |
456 | 492 | name="unit" |
457 | 493 | disabled |
458 | - label="价格单位" | |
459 | - placeholder="请输入价格单位" | |
494 | + label="商品单位" | |
495 | + placeholder="请输入商品单位" | |
496 | + rules={[{ required: true, message: '商品单位必填' }]} | |
460 | 497 | /> |
461 | 498 | |
462 | 499 | <ProFormDigit |
... | ... | @@ -464,6 +501,7 @@ export default ({ onClose, data, isAdd }) => { |
464 | 501 | name="subOrderPayment" |
465 | 502 | label="子订单金额" |
466 | 503 | placeholder="请输入子订单金额" |
504 | + rules={[{ required: true, message: '子订单金额必填' }]} | |
467 | 505 | /> |
468 | 506 | <ProFormText |
469 | 507 | width="lg" | ... | ... |
src/pages/Order/constant.ts
1 | +import { enumToProTableEnumValue } from '@/utils'; | |
2 | + | |
3 | +export const PAYMENT_CHANNEL_OPTIONS = { | |
4 | + ALIPAY: '支付宝', | |
5 | + WECHAT: '微信', | |
6 | + BANK_TRANSFER: '银行转账', | |
7 | +}; | |
8 | + | |
9 | +export const PAYMENT_METHOD_OPTIONS = { | |
10 | + PAYMENT_IN_ADVANCE: '预付', | |
11 | + CASH_ON_DELIVERY: '货到付款', | |
12 | +}; | |
13 | + | |
14 | +export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { | |
15 | + APPLICATION_PROJECT: '应用项目事业部门', | |
16 | + TEST: '测试事业部门', | |
17 | + CUSTOMIZATION: '定制化事业部门', | |
18 | + EXPERIMENTAL_EQUIPMENT: '实验设备事业部门', | |
19 | + EXPERIMENTAL_CONSUMABLES: '实验耗材事业部门', | |
20 | +}; | |
21 | + | |
22 | +export const INVOCING_STATUS_OPTIONS = { | |
23 | + UN_INVOICE: '否', | |
24 | + INVOICED: '是', | |
25 | +}; | |
26 | + | |
27 | +export const LOGISTICS_STATUS_OPTIONS = { | |
28 | + JINGDONG_LOGISTICS: '京东物流', | |
29 | + DEBANG_LOGISTICS: '德邦物流', | |
30 | +}; | |
31 | + | |
32 | +export const ORDER_STATUS_OPTIONS = { | |
33 | + CONFIRM_RECEIPT: '确认收货', | |
34 | + UNAUDITED: '未审核', | |
35 | + AUDITED: '已审核', | |
36 | + WAIT_SHIP: '待发货', | |
37 | + AUDIT_FAILED: '审核失败', | |
38 | + SHIPPED: '已发货', | |
39 | +}; | |
40 | + | |
1 | 41 | export const MAIN_ORDER_COLUMNS = [ |
2 | 42 | { |
3 | 43 | title: '订单列表', |
... | ... | @@ -62,26 +102,30 @@ export const MAIN_ORDER_COLUMNS = [ |
62 | 102 | { |
63 | 103 | title: '订单状态', |
64 | 104 | dataIndex: 'orderStatus', |
65 | - valueType: 'text', | |
105 | + valueType: 'select', | |
66 | 106 | hideInTable: true, |
107 | + valueEnum: enumToProTableEnumValue(ORDER_STATUS_OPTIONS), | |
67 | 108 | }, |
68 | 109 | { |
69 | 110 | title: '支付方式', |
70 | 111 | dataIndex: 'paymentStatus', |
71 | - valueType: 'text', | |
112 | + valueType: 'select', | |
72 | 113 | hideInTable: true, |
114 | + valueEnum: enumToProTableEnumValue(PAYMENT_METHOD_OPTIONS), | |
73 | 115 | }, |
74 | 116 | { |
75 | 117 | title: '物流方式', |
76 | 118 | dataIndex: 'logisticsMethod', |
77 | - valueType: 'text', | |
119 | + valueType: 'select', | |
78 | 120 | hideInTable: true, |
121 | + valueEnum: enumToProTableEnumValue(LOGISTICS_STATUS_OPTIONS), | |
79 | 122 | }, |
80 | 123 | { |
81 | 124 | title: '支付渠道', |
82 | 125 | dataIndex: 'paymentChannel', |
83 | - valueType: 'text', | |
126 | + valueType: 'select', | |
84 | 127 | hideInTable: true, |
128 | + valueEnum: enumToProTableEnumValue(PAYMENT_CHANNEL_OPTIONS), | |
85 | 129 | }, |
86 | 130 | { |
87 | 131 | title: '银行名称', |
... | ... | @@ -98,8 +142,9 @@ export const MAIN_ORDER_COLUMNS = [ |
98 | 142 | { |
99 | 143 | title: '所属部门', |
100 | 144 | dataIndex: 'productBelongBusiness', |
101 | - valueType: 'text', | |
145 | + valueType: 'select', | |
102 | 146 | hideInTable: true, |
147 | + valueEnum: enumToProTableEnumValue(PRODUCT_BELONG_DEPARTMENT_OPTIONS), | |
103 | 148 | }, |
104 | 149 | { |
105 | 150 | title: '创建日期', |
... | ... | @@ -116,10 +161,11 @@ export const MAIN_ORDER_COLUMNS = [ |
116 | 161 | }, |
117 | 162 | }, |
118 | 163 | { |
119 | - title: '开票状态', | |
164 | + title: '是否需要开票', | |
120 | 165 | dataIndex: 'invoicingStatus', |
121 | - valueType: 'text', | |
166 | + valueType: 'select', | |
122 | 167 | hideInTable: true, |
168 | + valueEnum: enumToProTableEnumValue(INVOCING_STATUS_OPTIONS), | |
123 | 169 | }, |
124 | 170 | { |
125 | 171 | title: '开票日期', |
... | ... | @@ -204,41 +250,3 @@ export const SUB_ORDER_COLUMNS = [ |
204 | 250 | width: 80, |
205 | 251 | }, |
206 | 252 | ]; |
207 | - | |
208 | -export const PAYMENT_CHANNEL_OPTIONS = { | |
209 | - ALIPAY: '支付宝', | |
210 | - WECHAT: '微信', | |
211 | - BANK_TRANSFER: '银行转账', | |
212 | -}; | |
213 | - | |
214 | -export const PAYMENT_METHOD_OPTIONS = { | |
215 | - PAYMENT_IN_ADVANCE: '预付', | |
216 | - CASH_ON_DELIVERY: '货到付款', | |
217 | -}; | |
218 | - | |
219 | -export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { | |
220 | - APPLICATION_PROJECT: '应用项目事业部门', | |
221 | - TEST: '测试事业部门', | |
222 | - CUSTOMIZATION: '定制化事业部门', | |
223 | - EXPERIMENTAL_EQUIPMENT: '实验设备事业部门', | |
224 | - EXPERIMENTAL_CONSUMABLES: '实验耗材事业部门', | |
225 | -}; | |
226 | - | |
227 | -export const INVOCING_STATUS_OPTIONS = { | |
228 | - UN_INVOICE: '否', | |
229 | - INVOICED: '是', | |
230 | -}; | |
231 | - | |
232 | -export const LOGISTICS_STATUS_OPTIONS = { | |
233 | - JINGDONG_LOGISTICS: '京东物流', | |
234 | - DEBANG_LOGISTICS: '德邦物流', | |
235 | -}; | |
236 | - | |
237 | -export const ORDER_STATUS_OPTIONS = { | |
238 | - CONFIRM_RECEIPT: '确认收货', | |
239 | - UNAUDITED: '未审核', | |
240 | - AUDITED: '已审核', | |
241 | - WAIT_SHIP: '待发货', | |
242 | - AUDIT_FAILED: '审核失败', | |
243 | - SHIPPED: '已发货', | |
244 | -}; | ... | ... |
src/pages/Order/index.tsx
... | ... | @@ -2,11 +2,10 @@ import ButtonConfirm from '@/components/ButtomConfirm'; |
2 | 2 | import { RESPONSE_CODE } from '@/constants/enum'; |
3 | 3 | import { |
4 | 4 | postServiceOrderOrderCancel, |
5 | - postServiceOrderPrintOrder, | |
6 | 5 | postServiceOrderQueryServiceOrder, |
7 | 6 | } from '@/services'; |
8 | 7 | import { orderExport } from '@/services/order'; |
9 | -import { enumValueToLabel } from '@/utils'; | |
8 | +import { enumToProTableEnumValue, enumValueToLabel } from '@/utils'; | |
10 | 9 | import { DownOutlined, EllipsisOutlined } from '@ant-design/icons'; |
11 | 10 | import { |
12 | 11 | PageContainer, |
... | ... | @@ -27,7 +26,7 @@ import { |
27 | 26 | message, |
28 | 27 | } from 'antd'; |
29 | 28 | import { cloneDeep } from 'lodash'; |
30 | -import { Key, useRef, useState } from 'react'; | |
29 | +import { Key, useEffect, useRef, useState } from 'react'; | |
31 | 30 | import OrderPrintModal from '../OrderPrint/OrderPrintModal'; |
32 | 31 | import CheckModal from './components/CheckModal'; |
33 | 32 | import ConfirmReceiptModal from './components/ConfirmReceiptModal'; |
... | ... | @@ -55,17 +54,44 @@ const OrderPage = () => { |
55 | 54 | useState<boolean>(false); |
56 | 55 | const [deliverVisible, setDeliverVisible] = useState<boolean>(false); |
57 | 56 | const [isOrderAddOpt, setIsOrderAddOpt] = useState<boolean>(false); |
57 | + const [isFinalcialEdit, setIsFinalcialEdit] = useState<boolean>(false); | |
58 | 58 | const [expandedRowKeys, setExpandedRowKeys] = useState<Key[]>([]); |
59 | 59 | const [orderRow, setOrderRow] = useState<Partial<OrderType>>({}); |
60 | 60 | const [mainOrderAllItemKeys, setMainOrderAllItemKeys] = useState([]); |
61 | 61 | const [rolePath, setRolePath] = useState([]); //当前角色权限(新增跟打印按钮) |
62 | 62 | const userInfo = JSON.parse(localStorage.getItem('userInfo')); |
63 | - | |
63 | + const [tableHeight, setTableHeight] = useState(200); | |
64 | 64 | const [selectedRows, setSelectedRows] = useState({}); |
65 | 65 | const [selectedRowObj, setSelectedRowObj] = useState({}); |
66 | 66 | const [selectedItems, setSelectedItems] = useState([]); |
67 | 67 | const mainTableRef = useRef(); |
68 | 68 | |
69 | + console.log(enumToProTableEnumValue(ORDER_STATUS_OPTIONS)); | |
70 | + const resize = () => { | |
71 | + // 计算元素底部到视口顶部的距离 | |
72 | + let bottomDistance = document | |
73 | + .getElementById('mainTable') | |
74 | + .getElementsByClassName('ant-table-thead')[0] | |
75 | + .getBoundingClientRect().bottom; | |
76 | + // 获取屏幕高度 | |
77 | + let screenHeight = | |
78 | + window.innerHeight || document.documentElement.clientHeight; | |
79 | + | |
80 | + // 计算元素底部到屏幕底部的距离 | |
81 | + let bottomToScreenBottomDistance = screenHeight - bottomDistance; | |
82 | + | |
83 | + // //底部分页元素的高度 | |
84 | + // var pH = screenHeight - document.getElementById("mainTable").getElementsByClassName('ant-table-body')[0].getBoundingClientRect().bottom; | |
85 | + | |
86 | + setTableHeight(bottomToScreenBottomDistance - 88); | |
87 | + }; | |
88 | + | |
89 | + useEffect(() => { | |
90 | + resize(); | |
91 | + // 添加事件监听器,当窗口大小改变时调用resize方法 | |
92 | + window.addEventListener('resize', resize); | |
93 | + }); | |
94 | + | |
69 | 95 | const onCheckboxChange = (itemKey: never) => { |
70 | 96 | const newSelectedItems = selectedItems.includes(itemKey) |
71 | 97 | ? selectedItems.filter((key) => key !== itemKey) |
... | ... | @@ -191,7 +217,7 @@ const OrderPage = () => { |
191 | 217 | ) : ( |
192 | 218 | '' |
193 | 219 | )} |
194 | - {record.mainPath.includes('editOrder') ? ( | |
220 | + {record.mainPath.includes('invoicing') ? ( | |
195 | 221 | <Button |
196 | 222 | type="link" |
197 | 223 | className="p-0" |
... | ... | @@ -201,6 +227,7 @@ const OrderPage = () => { |
201 | 227 | if (selectedSubOrders === undefined) { |
202 | 228 | setSelectedRows(record.subOrderInformationLists); |
203 | 229 | } |
230 | + setOrderRow(record); | |
204 | 231 | setFinancialVisible(true); |
205 | 232 | }} |
206 | 233 | > |
... | ... | @@ -379,15 +406,23 @@ const OrderPage = () => { |
379 | 406 | type="link" |
380 | 407 | onClick={async () => { |
381 | 408 | //调用打印接口 |
382 | - let body = { subIds: [optRecord.id] }; | |
383 | - const data = await postServiceOrderPrintOrder({ | |
384 | - data: body, | |
385 | - }); | |
386 | - if (data.result === RESPONSE_CODE.SUCCESS) { | |
387 | - message.success(data.message); | |
388 | - window.print(); | |
389 | - mainTableRef.current?.reload(); | |
390 | - } | |
409 | + // let body = { subIds: [optRecord.id] }; | |
410 | + // const data = await postServiceOrderPrintOrder({ | |
411 | + // data: body, | |
412 | + // }); | |
413 | + // if (data.result === RESPONSE_CODE.SUCCESS) { | |
414 | + // message.success(data.message); | |
415 | + // setOrderPrintVisible(true); | |
416 | + // setSelectedRows([optRecord]); | |
417 | + // setOrderRow(record); | |
418 | + // mainTableRef.current?.reload(); | |
419 | + // } | |
420 | + | |
421 | + // message.success(data.message); | |
422 | + setOrderPrintVisible(true); | |
423 | + setSelectedRows([optRecord]); | |
424 | + setOrderRow(record); | |
425 | + mainTableRef.current?.reload(); | |
391 | 426 | }} |
392 | 427 | > |
393 | 428 | 打印 |
... | ... | @@ -402,7 +437,8 @@ const OrderPage = () => { |
402 | 437 | onClick={() => { |
403 | 438 | setFinancialVisible(true); |
404 | 439 | setOrderRow(record); |
405 | - setSelectedRows(selectedRowObj[record.id]); | |
440 | + setSelectedRows([optRecord]); | |
441 | + setIsFinalcialEdit(true); | |
406 | 442 | }} |
407 | 443 | > |
408 | 444 | 编辑 |
... | ... | @@ -410,14 +446,15 @@ const OrderPage = () => { |
410 | 446 | ) : ( |
411 | 447 | '' |
412 | 448 | )} |
413 | - {optRecord.subPath.includes('invocing') ? ( | |
449 | + {optRecord.subPath.includes('invoicing') ? ( | |
414 | 450 | <Button |
415 | 451 | className="p-0" |
416 | 452 | type="link" |
417 | 453 | onClick={() => { |
418 | 454 | setFinancialVisible(true); |
455 | + setIsFinalcialEdit(false); | |
419 | 456 | setOrderRow(record); |
420 | - setSelectedRows(selectedRowObj[record.id]); | |
457 | + setSelectedRows([optRecord]); | |
421 | 458 | }} |
422 | 459 | > |
423 | 460 | 开票 |
... | ... | @@ -639,8 +676,11 @@ const OrderPage = () => { |
639 | 676 | ], |
640 | 677 | }} |
641 | 678 | > |
679 | + <div id="resizeDiv"></div> | |
642 | 680 | <ProTable |
643 | - scroll={{ x: true }} | |
681 | + id="mainTable" | |
682 | + // tableStyle={{height:'100px'}} | |
683 | + scroll={{ x: true, y: tableHeight }} | |
644 | 684 | actionRef={mainTableRef} |
645 | 685 | expandIconColumnIndex={-1} |
646 | 686 | columns={mainOrdersColumns} |
... | ... | @@ -656,6 +696,7 @@ const OrderPage = () => { |
656 | 696 | headerTitle="订单列表" |
657 | 697 | search={{ |
658 | 698 | labelWidth: 'auto', |
699 | + onCollapse: resize, | |
659 | 700 | }} |
660 | 701 | request={async ( |
661 | 702 | // 第一个参数 params 查询表单和 params 参数的结合 |
... | ... | @@ -727,6 +768,7 @@ const OrderPage = () => { |
727 | 768 | |
728 | 769 | {financialVisible && ( |
729 | 770 | <FinancialDrawer |
771 | + isEdit={isFinalcialEdit} | |
730 | 772 | mainOrder={orderRow} |
731 | 773 | subOrders={selectedRows} |
732 | 774 | onClose={() => { | ... | ... |
src/pages/OrderPrint/OrderPrintModal.tsx
1 | +import { RESPONSE_CODE } from '@/constants/enum'; | |
1 | 2 | import '@/pages/OrderPrint/index.less'; |
2 | -import { Modal } from 'antd'; | |
3 | +import { postServiceOrderPrintOrder } from '@/services'; | |
4 | +import { ExclamationCircleFilled } from '@ant-design/icons'; | |
5 | +import { Modal, Select, Space, message } from 'antd'; | |
3 | 6 | import printJS from 'print-js'; |
7 | +import { useState } from 'react'; | |
8 | +import DalangPrinter from './components/DalangPrinter'; | |
9 | +import HoujiePrinter from './components/HoujiePrinter'; | |
10 | +import ZhuguangPrinter from './components/ZhuguangPrinter'; | |
4 | 11 | |
5 | 12 | export default ({ mainOrder, subOrders, onClose }) => { |
6 | 13 | console.log(mainOrder); |
7 | 14 | console.log(subOrders); |
8 | 15 | |
9 | - let columns = []; | |
10 | - for (let i = 0; i < subOrders.length; i++) { | |
11 | - let subOrder = subOrders[i]; | |
12 | - columns.push( | |
13 | - <tr height="30" style={{ height: '15.00pt' }}> | |
14 | - <td height="30" style={{ height: '15.00pt' }}></td> | |
15 | - <td className="xl72">{i + 1}</td> | |
16 | - <td className="xl72">{subOrder.id}</td> | |
17 | - <td className="xl72">{subOrder.productName}</td> | |
18 | - <td className="xl72">{subOrder.parameters}</td> | |
19 | - <td className="xl72">{subOrder.unit}</td> | |
20 | - <td className="xl72">{subOrder.quantity}</td> | |
21 | - <td className="xl72">{subOrder.notes}</td> | |
22 | - </tr>, | |
23 | - ); | |
24 | - } | |
25 | - | |
26 | - //补充空白行,使表格不少于六行 | |
27 | - for (let i = subOrders.length; i < 6; i++) { | |
28 | - columns.push( | |
29 | - <tr height="30" style={{ height: '15.00pt' }}> | |
30 | - <td height="30" style={{ height: '15.00pt' }}></td> | |
31 | - <td className="xl72"></td> | |
32 | - <td className="xl72"></td> | |
33 | - <td className="xl72"></td> | |
34 | - <td className="xl72"></td> | |
35 | - <td className="xl72"></td> | |
36 | - <td className="xl72"></td> | |
37 | - <td className="xl72"></td> | |
38 | - </tr>, | |
39 | - ); | |
40 | - } | |
16 | + const [printerType, setPrinterType] = useState('Houjie'); | |
17 | + const { confirm } = Modal; | |
18 | + const handleChange = (value: string) => { | |
19 | + setPrinterType(value); | |
20 | + }; | |
21 | + const showPropsConfirm = () => { | |
22 | + confirm({ | |
23 | + title: '确认打印出货单', | |
24 | + icon: <ExclamationCircleFilled />, | |
25 | + content: '您是否已打印出货单?', | |
26 | + okText: '是的我已打印', | |
27 | + okType: 'primary', | |
28 | + okButtonProps: {}, | |
29 | + cancelText: '取消', | |
30 | + async onOk() { | |
31 | + let body = { | |
32 | + subIds: subOrders.map((item) => { | |
33 | + return item.id; | |
34 | + }), | |
35 | + }; | |
36 | + const res = await postServiceOrderPrintOrder({ data: body }); | |
37 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
38 | + message.success(res.message); | |
39 | + onClose(); | |
40 | + } | |
41 | + }, | |
42 | + onCancel() { | |
43 | + message.info('取消打印出货单'); | |
44 | + }, | |
45 | + }); | |
46 | + }; | |
41 | 47 | |
42 | 48 | return ( |
43 | 49 | <Modal |
... | ... | @@ -54,222 +60,47 @@ export default ({ mainOrder, subOrders, onClose }) => { |
54 | 60 | style: |
55 | 61 | '@page{size:auto; margin: 0;}' + |
56 | 62 | '@media print { @page {size: landscape } }', // landscape 默认横向打印 |
63 | + onPrintDialogClose: () => { | |
64 | + showPropsConfirm(); | |
65 | + }, | |
57 | 66 | }); |
58 | 67 | |
59 | - onClose(); | |
68 | + // onClose(); | |
60 | 69 | }} |
61 | 70 | onCancel={() => onClose()} |
62 | 71 | width={1000} |
63 | 72 | > |
64 | - <div | |
65 | - id="printArea" | |
66 | - className="flex items-center justify-center bg-gray-100" | |
67 | - > | |
68 | - <div className="w-full max-w-4xl p-10 my-10 bg-white border border-gray-300"> | |
69 | - <table | |
70 | - className="p-10" | |
71 | - width="846" | |
72 | - border={0} | |
73 | - cellPadding={0} | |
74 | - cellSpacing={0} | |
75 | - style={{ | |
76 | - width: '423.00pt', | |
77 | - borderCollapse: 'collapse', | |
78 | - tableLayout: 'fixed', | |
79 | - }} | |
80 | - > | |
81 | - <col | |
82 | - width="25.50" | |
83 | - style={{ msoWidthSource: 'userset', msoWidthAlt: 544 }} | |
84 | - /> | |
85 | - <col | |
86 | - width="52.50" | |
87 | - style={{ msoWidthSource: 'userset', msoWidthAlt: 1120 }} | |
88 | - /> | |
89 | - <col | |
90 | - width="115.50" | |
91 | - style={{ msoWidthSource: 'userset', msoWidthAlt: 2464 }} | |
92 | - /> | |
93 | - <col | |
94 | - width="169.50" | |
95 | - style={{ msoWidthSource: 'userset', msoWidthAlt: 3616 }} | |
96 | - /> | |
97 | - <col | |
98 | - width="165" | |
99 | - style={{ msoWidthSource: 'userset', msoWidthAlt: 3520 }} | |
100 | - /> | |
101 | - <col | |
102 | - width="96" | |
103 | - style={{ msoWidthSource: 'userset', msoWidthAlt: 2048 }} | |
104 | - /> | |
105 | - <col | |
106 | - width="114" | |
107 | - style={{ msoWidthSource: 'userset', msoWidthAlt: 2432 }} | |
108 | - /> | |
109 | - <col width="108" style={{ width: '54.00pt' }} /> | |
110 | - <tr height="42" style={{ height: '21.00pt' }}> | |
111 | - <td height="42" style={{ height: '21.00pt' }}></td> | |
112 | - <td | |
113 | - className="xl65" | |
114 | - colSpan="7" | |
115 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
116 | - > | |
117 | - 科 路 得 | |
118 | - </td> | |
119 | - </tr> | |
120 | - <tr height="30" style={{ height: '15.00pt' }}> | |
121 | - <td height="30" style={{ height: '15.00pt' }}></td> | |
122 | - <td | |
123 | - className="xl66" | |
124 | - colSpan="7" | |
125 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
126 | - > | |
127 | - 网址:www.canrd.com | |
128 | - </td> | |
129 | - </tr> | |
130 | - <tr height="35" style={{ height: '17.50pt' }}> | |
131 | - <td height="35" style={{ height: '17.50pt' }}></td> | |
132 | - <td | |
133 | - className="xl67" | |
134 | - colSpan="7" | |
135 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
136 | - > | |
137 | - 销售出货单 | |
138 | - </td> | |
139 | - </tr> | |
140 | - <tr height="30" style={{ height: '15.00pt' }}> | |
141 | - <td height="30" style={{ height: '15.00pt' }}></td> | |
142 | - <td | |
143 | - className="xl69" | |
144 | - colSpan="4" | |
145 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
146 | - > | |
147 | - 单位名称:{mainOrder.institution} | |
148 | - </td> | |
149 | - <td | |
150 | - className="xl69" | |
151 | - colSpan="3" | |
152 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
153 | - > | |
154 | - 单号:{mainOrder.id} | |
155 | - </td> | |
156 | - </tr> | |
157 | - <tr height="30" style={{ height: '15.00pt' }}> | |
158 | - <td height="30" style={{ height: '15.00pt' }}></td> | |
159 | - <td | |
160 | - className="xl69" | |
161 | - colSpan="4" | |
162 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
163 | - > | |
164 | - 联系人:{mainOrder.customerName} | |
165 | - </td> | |
166 | - <td | |
167 | - className="xl69" | |
168 | - colSpan="3" | |
169 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
170 | - > | |
171 | - 开单日期:{mainOrder.createTime} | |
172 | - </td> | |
173 | - </tr> | |
174 | - <tr height="30" style={{ height: '15.00pt' }}> | |
175 | - <td height="30" style={{ height: '15.00pt' }}></td> | |
176 | - <td | |
177 | - className="xl69" | |
178 | - colSpan="4" | |
179 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
180 | - > | |
181 | - 联系电话:{mainOrder.customerContactNumber} | |
182 | - </td> | |
183 | - <td | |
184 | - className="xl70" | |
185 | - colSpan={2} | |
186 | - style={{ msoIgnore: 'colSpan' }} | |
187 | - ></td> | |
188 | - <td className="xl70"></td> | |
189 | - </tr> | |
190 | - <tr height="30" style={{ height: '15.00pt' }}> | |
191 | - <td height="30" style={{ height: '15.00pt' }}></td> | |
192 | - <td | |
193 | - className="xl69" | |
194 | - colSpan="7" | |
195 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
196 | - > | |
197 | - 送货地址:{mainOrder.customerShippingAddress} | |
198 | - </td> | |
199 | - </tr> | |
200 | - <tr height="30" style={{ height: '15.00pt' }}> | |
201 | - <td height="30" style={{ height: '15.00pt' }}></td> | |
202 | - <td className="xl71">序号</td> | |
203 | - <td className="xl71">订单号</td> | |
204 | - <td className="xl71">货品名称</td> | |
205 | - <td className="xl71">规格</td> | |
206 | - <td className="xl71">单位</td> | |
207 | - <td className="xl71">数量</td> | |
208 | - <td className="xl71">备注</td> | |
209 | - </tr> | |
73 | + <Space direction="vertical" className="py-2"> | |
74 | + <span>打印类型</span> | |
75 | + <Select | |
76 | + defaultValue="Houjie" | |
77 | + style={{ width: 'auto' }} | |
78 | + onChange={handleChange} | |
79 | + options={[ | |
80 | + { value: 'Houjie', label: '科路得出货单' }, | |
81 | + { value: 'Dalang', label: '大朗出货单' }, | |
82 | + { value: 'Zhuguang', label: '烛光出货单' }, | |
83 | + ]} | |
84 | + /> | |
85 | + </Space> | |
86 | + | |
87 | + {printerType === 'Houjie' ? ( | |
88 | + <HoujiePrinter mainOrder={mainOrder} subOrders={subOrders} /> | |
89 | + ) : ( | |
90 | + '' | |
91 | + )} | |
210 | 92 | |
211 | - {columns} | |
93 | + {printerType === 'Zhuguang' ? ( | |
94 | + <ZhuguangPrinter mainOrder={mainOrder} subOrders={subOrders} /> | |
95 | + ) : ( | |
96 | + '' | |
97 | + )} | |
212 | 98 | |
213 | - <tr style={{ height: '19.00pt' }}> | |
214 | - <td style={{ height: '19.00pt' }}></td> | |
215 | - <td className="xl73">销货单位</td> | |
216 | - <td | |
217 | - className="xl74" | |
218 | - colSpan="3" | |
219 | - style={{ | |
220 | - borderRight: '0.5pt solid windowtext', | |
221 | - borderBottom: '0.5pt solid windowtext', | |
222 | - }} | |
223 | - > | |
224 | - 发货地址:广东省东莞市厚街镇锦丰路9号科路得产业园 | |
225 | - </td> | |
226 | - <td className="xl73">开户银行及账号</td> | |
227 | - <td | |
228 | - className="xl74" | |
229 | - colSpan={2} | |
230 | - style={{ | |
231 | - borderRight: '0.5pt solid windowtext', | |
232 | - borderBottom: '0.5pt solid windowtext', | |
233 | - }} | |
234 | - > | |
235 | - 招商银行股份有限公司东莞东骏路支行 | |
236 | - <br /> | |
237 | - 账号:769906437110802 | |
238 | - </td> | |
239 | - </tr> | |
240 | - <tr style={{ height: 30 }}> | |
241 | - <td height="30" style={{ height: '15.00pt' }}></td> | |
242 | - <td className="xl76" colSpan={2} style={{ msoIgnore: 'colSpan' }}> | |
243 | - 客户签名: | |
244 | - </td> | |
245 | - <td className="xl76">核准:屠亚辉</td> | |
246 | - <td | |
247 | - className="xl78" | |
248 | - colSpan={2} | |
249 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
250 | - > | |
251 | - 业务员:Peter | |
252 | - </td> | |
253 | - <td | |
254 | - className="xl78" | |
255 | - colSpan={2} | |
256 | - style={{ borderRight: 'none', borderBottom: 'none' }} | |
257 | - > | |
258 | - 开单人:张玉红 | |
259 | - </td> | |
260 | - </tr> | |
261 | - <tr style={{ display: 'none', width: 0 }}> | |
262 | - <td width="26" style={{ width: 13 }}></td> | |
263 | - <td width="53" style={{ width: 26 }}></td> | |
264 | - <td width="116" style={{ width: 58 }}></td> | |
265 | - <td width="170" style={{ width: 85 }}></td> | |
266 | - <td width="165" style={{ width: 83 }}></td> | |
267 | - <td width="96" style={{ width: 48 }}></td> | |
268 | - <td width="114" style={{ width: 57 }}></td> | |
269 | - </tr> | |
270 | - </table> | |
271 | - </div> | |
272 | - </div> | |
99 | + {printerType === 'Dalang' ? ( | |
100 | + <DalangPrinter mainOrder={mainOrder} subOrders={subOrders} /> | |
101 | + ) : ( | |
102 | + '' | |
103 | + )} | |
273 | 104 | </Modal> |
274 | 105 | ); |
275 | 106 | }; | ... | ... |
src/pages/OrderPrint/components/DalangPrinter.tsx
0 → 100644
1 | +import '@/pages/OrderPrint/index.less'; | |
2 | + | |
3 | +export default ({ mainOrder, subOrders }) => { | |
4 | + console.log(subOrders); | |
5 | + let columns = []; | |
6 | + for (let i = 0; i < subOrders.length; i++) { | |
7 | + let subOrder = subOrders[i]; | |
8 | + columns.push( | |
9 | + <tr height="30" style={{ height: '15.00pt' }}> | |
10 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
11 | + <td className="xl72" colSpan={3}> | |
12 | + {subOrder.productName} | |
13 | + </td> | |
14 | + <td className="xl72" colSpan={3}> | |
15 | + {subOrder.parameters} | |
16 | + </td> | |
17 | + <td className="xl72" colSpan={1}> | |
18 | + {subOrder.unit} | |
19 | + </td> | |
20 | + <td className="xl72" colSpan={1}> | |
21 | + {subOrder.quantity} | |
22 | + </td> | |
23 | + <td className="xl72" colSpan={1}> | |
24 | + {subOrder.unit} | |
25 | + </td> | |
26 | + <td className="xl72" colSpan={1}> | |
27 | + {subOrder.subOrderPayment} | |
28 | + </td> | |
29 | + <td className="xl72" colSpan={3} style={{ textAlign: 'left' }}> | |
30 | + {subOrder.notes} | |
31 | + </td> | |
32 | + </tr>, | |
33 | + ); | |
34 | + } | |
35 | + | |
36 | + //补充空白行,使表格不少于六行 | |
37 | + for (let i = subOrders.length; i < 6; i++) { | |
38 | + columns.push( | |
39 | + <tr height="30" style={{ height: '15.00pt' }}> | |
40 | + <td height="30" style={{ height: '15.00pt' }} colSpan={1}></td> | |
41 | + <td className="xl72" colSpan={3}></td> | |
42 | + <td className="xl72" colSpan={3}></td> | |
43 | + <td className="xl72" colSpan={1}></td> | |
44 | + <td className="xl72" colSpan={1}></td> | |
45 | + <td className="xl72" colSpan={1}></td> | |
46 | + <td className="xl72" colSpan={1}></td> | |
47 | + <td className="xl72" colSpan={3}></td> | |
48 | + </tr>, | |
49 | + ); | |
50 | + } | |
51 | + | |
52 | + return ( | |
53 | + <div | |
54 | + id="printArea" | |
55 | + className="flex items-center justify-center bg-gray-100" | |
56 | + > | |
57 | + <div className="w-full max-w-4xl p-10 my-10 bg-white border border-gray-300"> | |
58 | + <table | |
59 | + className="p-10" | |
60 | + width="855" | |
61 | + border={0} | |
62 | + cellPadding={0} | |
63 | + cellSpacing={0} | |
64 | + style={{ | |
65 | + width: '423.00pt', | |
66 | + borderCollapse: 'collapse', | |
67 | + tableLayout: 'fixed', | |
68 | + }} | |
69 | + > | |
70 | + <col width="57" /> | |
71 | + <col width="57" /> | |
72 | + <col width="57" /> | |
73 | + <col width="57" /> | |
74 | + <col width="57" /> | |
75 | + <col width="57" /> | |
76 | + <col width="57" /> | |
77 | + <col width="57" /> | |
78 | + <col width="57" /> | |
79 | + <col width="57" /> | |
80 | + <col width="57" /> | |
81 | + <col width="57" /> | |
82 | + <col width="57" /> | |
83 | + <col width="57" /> | |
84 | + <col width="57" /> | |
85 | + | |
86 | + <tr height="42" style={{ height: '21.00pt' }}> | |
87 | + <td height="42" colSpan={5} style={{ height: '21.00pt' }}></td> | |
88 | + <td | |
89 | + className="xl65" | |
90 | + colSpan={5} | |
91 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
92 | + > | |
93 | + 科 路 得 | |
94 | + </td> | |
95 | + <td height="42" colSpan={5} style={{ height: '21.00pt' }}></td> | |
96 | + </tr> | |
97 | + <tr height="30" style={{ height: '15.00pt' }}> | |
98 | + <td height="30" colSpan={3} style={{ height: '15.00pt' }}></td> | |
99 | + <td | |
100 | + className="xl66" | |
101 | + colSpan={5} | |
102 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
103 | + > | |
104 | + 网址:www.canrd.com | |
105 | + </td> | |
106 | + <td | |
107 | + className="xl66" | |
108 | + colSpan="4" | |
109 | + style={{ | |
110 | + borderRight: 'none', | |
111 | + borderBottom: 'none', | |
112 | + textAlign: 'left', | |
113 | + }} | |
114 | + > | |
115 | + QQ:2902385824 | |
116 | + </td> | |
117 | + </tr> | |
118 | + <tr height="35" style={{ height: '17.50pt' }}> | |
119 | + <td height="35" colSpan={5} style={{ height: '17.50pt' }}></td> | |
120 | + <td | |
121 | + className="xl67" | |
122 | + colSpan={5} | |
123 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
124 | + > | |
125 | + 销售出货单 | |
126 | + </td> | |
127 | + <td height="35" colSpan={5} style={{ height: '17.50pt' }}></td> | |
128 | + </tr> | |
129 | + <tr height="30" style={{ height: '15.00pt' }}> | |
130 | + <td | |
131 | + className="xl69" | |
132 | + colSpan={1} | |
133 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
134 | + ></td> | |
135 | + <td | |
136 | + className="xl69" | |
137 | + colSpan="1" | |
138 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
139 | + > | |
140 | + 单位名称: | |
141 | + </td> | |
142 | + <td | |
143 | + className="xl69" | |
144 | + colSpan="4" | |
145 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
146 | + > | |
147 | + {mainOrder.institution} | |
148 | + </td> | |
149 | + <td | |
150 | + className="xl69" | |
151 | + colSpan={2} | |
152 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
153 | + ></td> | |
154 | + <td | |
155 | + className="xl69" | |
156 | + colSpan={1} | |
157 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
158 | + > | |
159 | + 单号: | |
160 | + </td> | |
161 | + <td | |
162 | + className="xl69" | |
163 | + colSpan={6} | |
164 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
165 | + > | |
166 | + {mainOrder.id} | |
167 | + </td> | |
168 | + </tr> | |
169 | + <tr height="30" style={{ height: '15.00pt' }}> | |
170 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
171 | + <td | |
172 | + className="xl69" | |
173 | + colSpan={1} | |
174 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
175 | + > | |
176 | + 联系人: | |
177 | + </td> | |
178 | + <td | |
179 | + className="xl69" | |
180 | + colSpan={4} | |
181 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
182 | + > | |
183 | + {mainOrder.customerName} | |
184 | + </td> | |
185 | + <td height="30" colSpan={2} style={{ height: '15.00pt' }}></td> | |
186 | + <td | |
187 | + className="xl69" | |
188 | + colSpan={1} | |
189 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
190 | + > | |
191 | + 开单日期: | |
192 | + </td> | |
193 | + <td | |
194 | + className="xl69" | |
195 | + colSpan={6} | |
196 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
197 | + > | |
198 | + {mainOrder.createTime} | |
199 | + </td> | |
200 | + </tr> | |
201 | + <tr height="30" style={{ height: '15.00pt' }}> | |
202 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
203 | + <td | |
204 | + className="xl69" | |
205 | + colSpan={1} | |
206 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
207 | + > | |
208 | + 联系电话: | |
209 | + </td> | |
210 | + <td className="xl70" colSpan={4} style={{ msoIgnore: 'colSpan' }}> | |
211 | + {mainOrder.customerContactNumber} | |
212 | + </td> | |
213 | + <td className="xl70"></td> | |
214 | + </tr> | |
215 | + <tr height="30" style={{ height: '15.00pt' }}> | |
216 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
217 | + <td | |
218 | + className="xl69" | |
219 | + colSpan={1} | |
220 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
221 | + > | |
222 | + 送货地址: | |
223 | + </td> | |
224 | + <td | |
225 | + className="xl69" | |
226 | + colSpan={4} | |
227 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
228 | + > | |
229 | + {mainOrder.customerShippingAddress} | |
230 | + </td> | |
231 | + </tr> | |
232 | + <tr height="30" style={{ height: '15.00pt' }}> | |
233 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
234 | + <td className="xl71" colSpan={3}> | |
235 | + 货品名称 | |
236 | + </td> | |
237 | + <td className="xl71" colSpan={3}> | |
238 | + 规格 | |
239 | + </td> | |
240 | + <td className="xl71" colSpan={1}> | |
241 | + 单位 | |
242 | + </td> | |
243 | + <td className="xl71" colSpan={1}> | |
244 | + 数量 | |
245 | + </td> | |
246 | + <td className="xl71" colSpan={1}> | |
247 | + 单价 | |
248 | + </td> | |
249 | + <td className="xl71" colSpan={1}> | |
250 | + 货款 | |
251 | + </td> | |
252 | + <td className="xl71" colSpan={3}> | |
253 | + 备注 | |
254 | + </td> | |
255 | + </tr> | |
256 | + | |
257 | + {columns} | |
258 | + | |
259 | + <tr style={{ height: '19.00pt' }}> | |
260 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
261 | + <td | |
262 | + className="xl74" | |
263 | + colSpan={3} | |
264 | + style={{ | |
265 | + borderRight: '0.5pt solid windowtext', | |
266 | + borderBottom: '0.5pt solid windowtext', | |
267 | + }} | |
268 | + > | |
269 | + 合计 | |
270 | + </td> | |
271 | + <td | |
272 | + className="xl74" | |
273 | + colSpan={10} | |
274 | + style={{ | |
275 | + textAlign: 'left', | |
276 | + borderRight: '0.5pt solid windowtext', | |
277 | + borderBottom: '0.5pt solid windowtext', | |
278 | + }} | |
279 | + > | |
280 | + 199 | |
281 | + </td> | |
282 | + </tr> | |
283 | + | |
284 | + <tr style={{ height: '19.00pt' }}> | |
285 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
286 | + <td | |
287 | + className="xl74" | |
288 | + colSpan={3} | |
289 | + style={{ | |
290 | + borderRight: '0.5pt solid windowtext', | |
291 | + borderBottom: '0.5pt solid windowtext', | |
292 | + }} | |
293 | + > | |
294 | + 摘要 | |
295 | + </td> | |
296 | + <td | |
297 | + className="xl74" | |
298 | + colSpan={10} | |
299 | + style={{ | |
300 | + textAlign: 'left', | |
301 | + borderRight: '0.5pt solid windowtext', | |
302 | + borderBottom: '0.5pt solid windowtext', | |
303 | + }} | |
304 | + ></td> | |
305 | + </tr> | |
306 | + | |
307 | + <tr style={{ height: '19.00pt' }}> | |
308 | + <td style={{ height: '19.00pt' }}></td> | |
309 | + <td className="xl73">销货单位</td> | |
310 | + <td | |
311 | + className="xl74" | |
312 | + colSpan={2} | |
313 | + style={{ | |
314 | + borderRight: '0.5pt solid windowtext', | |
315 | + borderBottom: '0.5pt solid windowtext', | |
316 | + }} | |
317 | + > | |
318 | + 发货地址 | |
319 | + </td> | |
320 | + <td | |
321 | + className="xl74" | |
322 | + colSpan={4} | |
323 | + style={{ | |
324 | + textAlign: 'left', | |
325 | + borderRight: '0.5pt solid windowtext', | |
326 | + borderBottom: '0.5pt solid windowtext', | |
327 | + }} | |
328 | + > | |
329 | + 广东省东莞市大朗镇松木山祥明路38号 | |
330 | + </td> | |
331 | + <td className="xl73" colSpan={2}> | |
332 | + 开户银行及账号 | |
333 | + </td> | |
334 | + <td | |
335 | + className="xl74" | |
336 | + colSpan={4} | |
337 | + style={{ | |
338 | + textAlign: 'left', | |
339 | + borderRight: '0.5pt solid windowtext', | |
340 | + borderBottom: '0.5pt solid windowtext', | |
341 | + }} | |
342 | + > | |
343 | + 招商银行股份有限公司东美东骏路支行 | |
344 | + <br /> | |
345 | + 769906437110802 | |
346 | + </td> | |
347 | + </tr> | |
348 | + | |
349 | + <tr style={{ height: 30 }}> | |
350 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
351 | + <td className="xl76" colSpan={3} style={{ msoIgnore: 'colSpan' }}> | |
352 | + 客户签名: | |
353 | + </td> | |
354 | + <td className="xl76" colSpan={3}> | |
355 | + 仓管员:Luo YH | |
356 | + </td> | |
357 | + <td | |
358 | + className="xl78" | |
359 | + colSpan={4} | |
360 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
361 | + > | |
362 | + 业务员:Linda | |
363 | + </td> | |
364 | + <td | |
365 | + className="xl78" | |
366 | + colSpan={2} | |
367 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
368 | + > | |
369 | + 开单人:真丽娟 | |
370 | + </td> | |
371 | + </tr> | |
372 | + <tr style={{ display: 'none', width: 0 }}> | |
373 | + <td width="26" style={{ width: 13 }}></td> | |
374 | + <td width="53" style={{ width: 26 }}></td> | |
375 | + <td width="116" style={{ width: 58 }}></td> | |
376 | + <td width="170" style={{ width: 85 }}></td> | |
377 | + <td width="165" style={{ width: 83 }}></td> | |
378 | + <td width="96" style={{ width: 48 }}></td> | |
379 | + <td width="114" style={{ width: 57 }}></td> | |
380 | + </tr> | |
381 | + </table> | |
382 | + </div> | |
383 | + </div> | |
384 | + ); | |
385 | +}; | ... | ... |
src/pages/OrderPrint/components/HoujiePrinter.tsx
0 → 100644
1 | +import '@/pages/OrderPrint/index.less'; | |
2 | + | |
3 | +export default ({ mainOrder, subOrders }) => { | |
4 | + console.log(subOrders); | |
5 | + let columns = []; | |
6 | + for (let i = 0; i < subOrders.length; i++) { | |
7 | + let subOrder = subOrders[i]; | |
8 | + columns.push( | |
9 | + <tr height="30" style={{ height: '15.00pt' }}> | |
10 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
11 | + <td className="xl72">{i + 1}</td> | |
12 | + <td className="xl72">{subOrder.id}</td> | |
13 | + <td className="xl72">{subOrder.productName}</td> | |
14 | + <td className="xl72">{subOrder.parameters}</td> | |
15 | + <td className="xl72">{subOrder.unit}</td> | |
16 | + <td className="xl72">{subOrder.quantity}</td> | |
17 | + <td className="xl72">{subOrder.notes}</td> | |
18 | + </tr>, | |
19 | + ); | |
20 | + } | |
21 | + | |
22 | + //补充空白行,使表格不少于六行 | |
23 | + for (let i = subOrders.length; i < 6; i++) { | |
24 | + columns.push( | |
25 | + <tr height="30" style={{ height: '15.00pt' }}> | |
26 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
27 | + <td className="xl72"></td> | |
28 | + <td className="xl72"></td> | |
29 | + <td className="xl72"></td> | |
30 | + <td className="xl72"></td> | |
31 | + <td className="xl72"></td> | |
32 | + <td className="xl72"></td> | |
33 | + <td className="xl72"></td> | |
34 | + </tr>, | |
35 | + ); | |
36 | + } | |
37 | + | |
38 | + return ( | |
39 | + <div | |
40 | + id="printArea" | |
41 | + className="flex items-center justify-center bg-gray-100" | |
42 | + > | |
43 | + <div className="w-full max-w-4xl p-10 my-10 bg-white border border-gray-300"> | |
44 | + <table | |
45 | + className="p-10" | |
46 | + width="846" | |
47 | + border={0} | |
48 | + cellPadding={0} | |
49 | + cellSpacing={0} | |
50 | + style={{ | |
51 | + width: '423.00pt', | |
52 | + borderCollapse: 'collapse', | |
53 | + tableLayout: 'fixed', | |
54 | + }} | |
55 | + > | |
56 | + <col | |
57 | + width="25.50" | |
58 | + style={{ msoWidthSource: 'userset', msoWidthAlt: 544 }} | |
59 | + /> | |
60 | + <col | |
61 | + width="52.50" | |
62 | + style={{ msoWidthSource: 'userset', msoWidthAlt: 1120 }} | |
63 | + /> | |
64 | + <col | |
65 | + width="151.50" | |
66 | + style={{ msoWidthSource: 'userset', msoWidthAlt: 2464 }} | |
67 | + /> | |
68 | + <col | |
69 | + width="169.50" | |
70 | + style={{ msoWidthSource: 'userset', msoWidthAlt: 3616 }} | |
71 | + /> | |
72 | + <col | |
73 | + width="165" | |
74 | + style={{ msoWidthSource: 'userset', msoWidthAlt: 3520 }} | |
75 | + /> | |
76 | + <col | |
77 | + width="60" | |
78 | + style={{ msoWidthSource: 'userset', msoWidthAlt: 2048 }} | |
79 | + /> | |
80 | + <col | |
81 | + width="114" | |
82 | + style={{ msoWidthSource: 'userset', msoWidthAlt: 2432 }} | |
83 | + /> | |
84 | + <col width="108" style={{ width: '54.00pt' }} /> | |
85 | + <tr height="42" style={{ height: '21.00pt' }}> | |
86 | + <td height="42" style={{ height: '21.00pt' }}></td> | |
87 | + <td | |
88 | + className="xl65" | |
89 | + colSpan="7" | |
90 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
91 | + > | |
92 | + 科 路 得 | |
93 | + </td> | |
94 | + </tr> | |
95 | + <tr height="30" style={{ height: '15.00pt' }}> | |
96 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
97 | + <td | |
98 | + className="xl66" | |
99 | + colSpan="7" | |
100 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
101 | + > | |
102 | + 网址:www.canrd.com | |
103 | + </td> | |
104 | + </tr> | |
105 | + <tr height="35" style={{ height: '17.50pt' }}> | |
106 | + <td height="35" style={{ height: '17.50pt' }}></td> | |
107 | + <td | |
108 | + className="xl67" | |
109 | + colSpan="7" | |
110 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
111 | + > | |
112 | + 销售出货单 | |
113 | + </td> | |
114 | + </tr> | |
115 | + <tr height="30" style={{ height: '15.00pt' }}> | |
116 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
117 | + <td | |
118 | + className="xl69" | |
119 | + colSpan="4" | |
120 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
121 | + > | |
122 | + 单位名称:{mainOrder.institution} | |
123 | + </td> | |
124 | + <td | |
125 | + className="xl69" | |
126 | + colSpan="3" | |
127 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
128 | + > | |
129 | + 单号:{mainOrder.id} | |
130 | + </td> | |
131 | + </tr> | |
132 | + <tr height="30" style={{ height: '15.00pt' }}> | |
133 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
134 | + <td | |
135 | + className="xl69" | |
136 | + colSpan="4" | |
137 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
138 | + > | |
139 | + 联系人:{mainOrder.customerName} | |
140 | + </td> | |
141 | + <td | |
142 | + className="xl69" | |
143 | + colSpan="3" | |
144 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
145 | + > | |
146 | + 开单日期:{mainOrder.createTime} | |
147 | + </td> | |
148 | + </tr> | |
149 | + <tr height="30" style={{ height: '15.00pt' }}> | |
150 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
151 | + <td | |
152 | + className="xl69" | |
153 | + colSpan="4" | |
154 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
155 | + > | |
156 | + 联系电话:{mainOrder.customerContactNumber} | |
157 | + </td> | |
158 | + <td | |
159 | + className="xl70" | |
160 | + colSpan={2} | |
161 | + style={{ msoIgnore: 'colSpan' }} | |
162 | + ></td> | |
163 | + <td className="xl70"></td> | |
164 | + </tr> | |
165 | + <tr height="30" style={{ height: '15.00pt' }}> | |
166 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
167 | + <td | |
168 | + className="xl69" | |
169 | + colSpan="7" | |
170 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
171 | + > | |
172 | + 送货地址:{mainOrder.customerShippingAddress} | |
173 | + </td> | |
174 | + </tr> | |
175 | + <tr height="30" style={{ height: '15.00pt' }}> | |
176 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
177 | + <td className="xl71">序号</td> | |
178 | + <td className="xl71">订单号</td> | |
179 | + <td className="xl71">货品名称</td> | |
180 | + <td className="xl71">规格</td> | |
181 | + <td className="xl71">单位</td> | |
182 | + <td className="xl71">数量</td> | |
183 | + <td className="xl71">备注</td> | |
184 | + </tr> | |
185 | + | |
186 | + {columns} | |
187 | + | |
188 | + <tr style={{ height: '19.00pt' }}> | |
189 | + <td style={{ height: '19.00pt' }}></td> | |
190 | + <td className="xl73">销货单位</td> | |
191 | + <td | |
192 | + className="xl74" | |
193 | + colSpan="3" | |
194 | + style={{ | |
195 | + borderRight: '0.5pt solid windowtext', | |
196 | + borderBottom: '0.5pt solid windowtext', | |
197 | + }} | |
198 | + > | |
199 | + 发货地址:广东省东莞市厚街镇锦丰路9号科路得产业园 | |
200 | + </td> | |
201 | + <td className="xl73">开户银行及账号</td> | |
202 | + <td | |
203 | + className="xl74" | |
204 | + colSpan={2} | |
205 | + style={{ | |
206 | + borderRight: '0.5pt solid windowtext', | |
207 | + borderBottom: '0.5pt solid windowtext', | |
208 | + }} | |
209 | + > | |
210 | + 招商银行股份有限公司东莞东骏路支行 | |
211 | + <br /> | |
212 | + 账号:769906437110802 | |
213 | + </td> | |
214 | + </tr> | |
215 | + <tr style={{ height: 30 }}> | |
216 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
217 | + <td className="xl76" colSpan={2} style={{ msoIgnore: 'colSpan' }}> | |
218 | + 客户签名: | |
219 | + </td> | |
220 | + <td className="xl76">核准:屠亚辉</td> | |
221 | + <td | |
222 | + className="xl78" | |
223 | + colSpan={2} | |
224 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
225 | + > | |
226 | + 业务员:Peter | |
227 | + </td> | |
228 | + <td | |
229 | + className="xl78" | |
230 | + colSpan={2} | |
231 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
232 | + > | |
233 | + 开单人:张玉红 | |
234 | + </td> | |
235 | + </tr> | |
236 | + <tr style={{ display: 'none', width: 0 }}> | |
237 | + <td width="26" style={{ width: 13 }}></td> | |
238 | + <td width="53" style={{ width: 26 }}></td> | |
239 | + <td width="116" style={{ width: 58 }}></td> | |
240 | + <td width="170" style={{ width: 85 }}></td> | |
241 | + <td width="165" style={{ width: 83 }}></td> | |
242 | + <td width="96" style={{ width: 48 }}></td> | |
243 | + <td width="114" style={{ width: 57 }}></td> | |
244 | + </tr> | |
245 | + </table> | |
246 | + </div> | |
247 | + </div> | |
248 | + ); | |
249 | +}; | ... | ... |
src/pages/OrderPrint/components/ZhuguangPrinter.tsx
0 → 100644
1 | +import '@/pages/OrderPrint/index.less'; | |
2 | + | |
3 | +export default ({ mainOrder, subOrders }) => { | |
4 | + console.log(subOrders); | |
5 | + let columns = []; | |
6 | + for (let i = 0; i < subOrders.length; i++) { | |
7 | + let subOrder = subOrders[i]; | |
8 | + columns.push( | |
9 | + <tr height="30" style={{ height: '15.00pt' }}> | |
10 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
11 | + <td className="xl72" colSpan={3}> | |
12 | + {subOrder.productName} | |
13 | + </td> | |
14 | + <td className="xl72" colSpan={3}> | |
15 | + {subOrder.parameters} | |
16 | + </td> | |
17 | + <td className="xl72" colSpan={2}> | |
18 | + {subOrder.quantity} | |
19 | + </td> | |
20 | + <td className="xl72" colSpan={1}> | |
21 | + {subOrder.unit} | |
22 | + </td> | |
23 | + <td className="xl72" colSpan={4} style={{ textAlign: 'left' }}> | |
24 | + {subOrder.notes} | |
25 | + </td> | |
26 | + </tr>, | |
27 | + ); | |
28 | + } | |
29 | + | |
30 | + //补充空白行,使表格不少于六行 | |
31 | + for (let i = subOrders.length; i < 6; i++) { | |
32 | + columns.push( | |
33 | + <tr height="30" style={{ height: '15.00pt' }}> | |
34 | + <td height="30" style={{ height: '15.00pt' }} colSpan={1}></td> | |
35 | + <td className="xl72" colSpan={3}></td> | |
36 | + <td className="xl72" colSpan={3}></td> | |
37 | + <td className="xl72" colSpan={2}></td> | |
38 | + <td className="xl72" colSpan={1}></td> | |
39 | + <td className="xl72" colSpan={4}></td> | |
40 | + </tr>, | |
41 | + ); | |
42 | + } | |
43 | + | |
44 | + return ( | |
45 | + <div | |
46 | + id="printArea" | |
47 | + className="flex items-center justify-center bg-gray-100" | |
48 | + > | |
49 | + <div className="w-full max-w-4xl p-10 my-10 bg-white border border-gray-300"> | |
50 | + <table | |
51 | + className="p-10" | |
52 | + width="855" | |
53 | + border={0} | |
54 | + cellPadding={0} | |
55 | + cellSpacing={0} | |
56 | + style={{ | |
57 | + width: '423.00pt', | |
58 | + borderCollapse: 'collapse', | |
59 | + tableLayout: 'fixed', | |
60 | + }} | |
61 | + > | |
62 | + <col width="57" /> | |
63 | + <col width="57" /> | |
64 | + <col width="57" /> | |
65 | + <col width="57" /> | |
66 | + <col width="57" /> | |
67 | + <col width="57" /> | |
68 | + <col width="57" /> | |
69 | + <col width="57" /> | |
70 | + <col width="57" /> | |
71 | + <col width="57" /> | |
72 | + <col width="57" /> | |
73 | + <col width="57" /> | |
74 | + <col width="57" /> | |
75 | + <col width="57" /> | |
76 | + <col width="57" /> | |
77 | + | |
78 | + <tr height="42" style={{ height: '21.00pt' }}> | |
79 | + <td height="42" colSpan={5} style={{ height: '21.00pt' }}></td> | |
80 | + <td | |
81 | + className="xl65" | |
82 | + colSpan={5} | |
83 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
84 | + > | |
85 | + 广东烛光新能源科技有限公司 | |
86 | + </td> | |
87 | + <td height="42" colSpan={5} style={{ height: '21.00pt' }}></td> | |
88 | + </tr> | |
89 | + <tr height="30" style={{ height: '15.00pt' }}> | |
90 | + <td height="30" colSpan={3} style={{ height: '15.00pt' }}></td> | |
91 | + <td | |
92 | + className="xl66" | |
93 | + colSpan={5} | |
94 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
95 | + > | |
96 | + 网址:www.canrd.com | |
97 | + </td> | |
98 | + <td | |
99 | + className="xl66" | |
100 | + colSpan="4" | |
101 | + style={{ | |
102 | + borderRight: 'none', | |
103 | + borderBottom: 'none', | |
104 | + textAlign: 'left', | |
105 | + }} | |
106 | + > | |
107 | + QQ:2902385824 | |
108 | + </td> | |
109 | + </tr> | |
110 | + <tr height="35" style={{ height: '17.50pt' }}> | |
111 | + <td height="35" colSpan={5} style={{ height: '17.50pt' }}></td> | |
112 | + <td | |
113 | + className="xl67" | |
114 | + colSpan={5} | |
115 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
116 | + > | |
117 | + 销售出货单 | |
118 | + </td> | |
119 | + <td height="35" colSpan={5} style={{ height: '17.50pt' }}></td> | |
120 | + </tr> | |
121 | + <tr height="30" style={{ height: '15.00pt' }}> | |
122 | + <td | |
123 | + className="xl69" | |
124 | + colSpan={1} | |
125 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
126 | + ></td> | |
127 | + <td | |
128 | + className="xl69" | |
129 | + colSpan="1" | |
130 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
131 | + > | |
132 | + 单位名称: | |
133 | + </td> | |
134 | + <td | |
135 | + className="xl69" | |
136 | + colSpan="4" | |
137 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
138 | + > | |
139 | + {mainOrder.institution} | |
140 | + </td> | |
141 | + <td | |
142 | + className="xl69" | |
143 | + colSpan={2} | |
144 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
145 | + ></td> | |
146 | + <td | |
147 | + className="xl69" | |
148 | + colSpan={1} | |
149 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
150 | + > | |
151 | + 单号: | |
152 | + </td> | |
153 | + <td | |
154 | + className="xl69" | |
155 | + colSpan={6} | |
156 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
157 | + > | |
158 | + {mainOrder.id} | |
159 | + </td> | |
160 | + </tr> | |
161 | + <tr height="30" style={{ height: '15.00pt' }}> | |
162 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
163 | + <td | |
164 | + className="xl69" | |
165 | + colSpan={1} | |
166 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
167 | + > | |
168 | + 联系人: | |
169 | + </td> | |
170 | + <td | |
171 | + className="xl69" | |
172 | + colSpan={4} | |
173 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
174 | + > | |
175 | + {mainOrder.customerName} | |
176 | + </td> | |
177 | + <td height="30" colSpan={2} style={{ height: '15.00pt' }}></td> | |
178 | + <td | |
179 | + className="xl69" | |
180 | + colSpan={1} | |
181 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
182 | + > | |
183 | + 开单日期: | |
184 | + </td> | |
185 | + <td | |
186 | + className="xl69" | |
187 | + colSpan={6} | |
188 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
189 | + > | |
190 | + {mainOrder.createTime} | |
191 | + </td> | |
192 | + </tr> | |
193 | + <tr height="30" style={{ height: '15.00pt' }}> | |
194 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
195 | + <td | |
196 | + className="xl69" | |
197 | + colSpan={1} | |
198 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
199 | + > | |
200 | + 联系电话: | |
201 | + </td> | |
202 | + <td className="xl70" colSpan={4} style={{ msoIgnore: 'colSpan' }}> | |
203 | + {mainOrder.customerContactNumber} | |
204 | + </td> | |
205 | + <td className="xl70"></td> | |
206 | + </tr> | |
207 | + <tr height="30" style={{ height: '15.00pt' }}> | |
208 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
209 | + <td | |
210 | + className="xl69" | |
211 | + colSpan={1} | |
212 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
213 | + > | |
214 | + 送货地址: | |
215 | + </td> | |
216 | + <td | |
217 | + className="xl69" | |
218 | + colSpan={4} | |
219 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
220 | + > | |
221 | + {mainOrder.customerShippingAddress} | |
222 | + </td> | |
223 | + </tr> | |
224 | + <tr height="30" style={{ height: '15.00pt' }}> | |
225 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
226 | + <td className="xl71" colSpan={3}> | |
227 | + 货品名称 | |
228 | + </td> | |
229 | + <td className="xl71" colSpan={3}> | |
230 | + 规格 | |
231 | + </td> | |
232 | + <td className="xl71" colSpan={2}> | |
233 | + 单位 | |
234 | + </td> | |
235 | + <td className="xl71" colSpan={1}> | |
236 | + 数量 | |
237 | + </td> | |
238 | + <td className="xl71" colSpan={4}> | |
239 | + 备注 | |
240 | + </td> | |
241 | + </tr> | |
242 | + | |
243 | + {columns} | |
244 | + | |
245 | + <tr style={{ height: '19.00pt' }}> | |
246 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
247 | + <td | |
248 | + className="xl74" | |
249 | + colSpan={3} | |
250 | + style={{ | |
251 | + borderRight: '0.5pt solid windowtext', | |
252 | + borderBottom: '0.5pt solid windowtext', | |
253 | + }} | |
254 | + > | |
255 | + 合计 | |
256 | + </td> | |
257 | + <td | |
258 | + className="xl74" | |
259 | + colSpan={10} | |
260 | + style={{ | |
261 | + textAlign: 'left', | |
262 | + borderRight: '0.5pt solid windowtext', | |
263 | + borderBottom: '0.5pt solid windowtext', | |
264 | + }} | |
265 | + > | |
266 | + 199 | |
267 | + </td> | |
268 | + </tr> | |
269 | + | |
270 | + <tr style={{ height: '19.00pt' }}> | |
271 | + <td height="30" colSpan={1} style={{ height: '15.00pt' }}></td> | |
272 | + <td | |
273 | + className="xl74" | |
274 | + colSpan={3} | |
275 | + style={{ | |
276 | + borderRight: '0.5pt solid windowtext', | |
277 | + borderBottom: '0.5pt solid windowtext', | |
278 | + }} | |
279 | + > | |
280 | + 摘要 | |
281 | + </td> | |
282 | + <td | |
283 | + className="xl74" | |
284 | + colSpan={10} | |
285 | + style={{ | |
286 | + textAlign: 'left', | |
287 | + borderRight: '0.5pt solid windowtext', | |
288 | + borderBottom: '0.5pt solid windowtext', | |
289 | + }} | |
290 | + ></td> | |
291 | + </tr> | |
292 | + | |
293 | + <tr style={{ height: '19.00pt' }}> | |
294 | + <td style={{ height: '19.00pt' }}></td> | |
295 | + <td className="xl73">销货单位</td> | |
296 | + <td | |
297 | + className="xl74" | |
298 | + colSpan={2} | |
299 | + style={{ | |
300 | + borderRight: '0.5pt solid windowtext', | |
301 | + borderBottom: '0.5pt solid windowtext', | |
302 | + }} | |
303 | + > | |
304 | + 发货地址 | |
305 | + </td> | |
306 | + <td | |
307 | + className="xl74" | |
308 | + colSpan={4} | |
309 | + style={{ | |
310 | + textAlign: 'left', | |
311 | + borderRight: '0.5pt solid windowtext', | |
312 | + borderBottom: '0.5pt solid windowtext', | |
313 | + }} | |
314 | + > | |
315 | + 广东省东莞市大朗镇松木山祥明路38号 | |
316 | + </td> | |
317 | + <td className="xl73" colSpan={2}> | |
318 | + 开户银行及账号 | |
319 | + </td> | |
320 | + <td | |
321 | + className="xl74" | |
322 | + colSpan={4} | |
323 | + style={{ | |
324 | + textAlign: 'left', | |
325 | + borderRight: '0.5pt solid windowtext', | |
326 | + borderBottom: '0.5pt solid windowtext', | |
327 | + }} | |
328 | + > | |
329 | + 广发银行股份有限公司东莞松山湖支行 | |
330 | + <br /> | |
331 | + 106016516010004141 | |
332 | + </td> | |
333 | + </tr> | |
334 | + | |
335 | + <tr style={{ height: 30 }}> | |
336 | + <td height="30" style={{ height: '15.00pt' }}></td> | |
337 | + <td className="xl76" colSpan={3} style={{ msoIgnore: 'colSpan' }}> | |
338 | + 客户签名: | |
339 | + </td> | |
340 | + <td className="xl76" colSpan={3}> | |
341 | + 仓管员:Luo YH | |
342 | + </td> | |
343 | + <td | |
344 | + className="xl78" | |
345 | + colSpan={4} | |
346 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
347 | + > | |
348 | + 业务员:Tina | |
349 | + </td> | |
350 | + <td | |
351 | + className="xl78" | |
352 | + colSpan={2} | |
353 | + style={{ borderRight: 'none', borderBottom: 'none' }} | |
354 | + > | |
355 | + 开单人:真丽娟 | |
356 | + </td> | |
357 | + </tr> | |
358 | + <tr style={{ display: 'none', width: 0 }}> | |
359 | + <td width="26" style={{ width: 13 }}></td> | |
360 | + <td width="53" style={{ width: 26 }}></td> | |
361 | + <td width="116" style={{ width: 58 }}></td> | |
362 | + <td width="170" style={{ width: 85 }}></td> | |
363 | + <td width="165" style={{ width: 83 }}></td> | |
364 | + <td width="96" style={{ width: 48 }}></td> | |
365 | + <td width="114" style={{ width: 57 }}></td> | |
366 | + </tr> | |
367 | + </table> | |
368 | + </div> | |
369 | + </div> | |
370 | + ); | |
371 | +}; | ... | ... |
src/pages/OrderPrint/index.less
src/services/definition.ts
... | ... | @@ -365,30 +365,6 @@ export interface DictionaryVO { |
365 | 365 | sort?: number; |
366 | 366 | } |
367 | 367 | |
368 | -export interface InvoicingDto { | |
369 | - /** | |
370 | - * @description | |
371 | - * 收款时间 | |
372 | - * @format date-time | |
373 | - * @example | |
374 | - * 2023-11-12 16:12 | |
375 | - */ | |
376 | - collectMoneyTime?: string; | |
377 | - /** | |
378 | - * @description | |
379 | - * 开票时间 | |
380 | - * @format date-time | |
381 | - * @example | |
382 | - * 2023-11-12 16:12 | |
383 | - */ | |
384 | - invoicingTime?: string; | |
385 | - /** | |
386 | - * @description | |
387 | - * 子订单id集合 | |
388 | - */ | |
389 | - subIds?: Array<number>; | |
390 | -} | |
391 | - | |
392 | 368 | export interface ModelAndView { |
393 | 369 | empty?: boolean; |
394 | 370 | model?: any; |
... | ... | @@ -509,15 +485,6 @@ export interface OrderBaseInfoVO { |
509 | 485 | smallPicUrl?: string; |
510 | 486 | } |
511 | 487 | |
512 | -export interface OrderCancelDto { | |
513 | - /** | |
514 | - * @description | |
515 | - * 订单id | |
516 | - * @format int64 | |
517 | - */ | |
518 | - id?: number; | |
519 | -} | |
520 | - | |
521 | 488 | export interface OrderCompletionReportFieldVO { |
522 | 489 | ideaManualRate?: string; |
523 | 490 | ideaSource?: string; |
... | ... | @@ -782,110 +749,15 @@ export interface View { |
782 | 749 | export interface Dto { |
783 | 750 | /** |
784 | 751 | * @description |
785 | - * 银行名称 | |
786 | - */ | |
787 | - bank?: string; | |
788 | - /** | |
789 | - * @description | |
790 | - * 开始时间 | |
791 | - * @format date-time | |
792 | - * @example | |
793 | - * 2023-11-11 10:10 | |
794 | - */ | |
795 | - beginTime?: string; | |
796 | - /** @format int32 */ | |
797 | - current?: number; | |
798 | - /** | |
799 | - * @description | |
800 | - * 收货人联系手机号 | |
801 | - */ | |
802 | - customerContactNumber?: string; | |
803 | - /** | |
804 | - * @description | |
805 | - * 收货人姓名 | |
806 | - */ | |
807 | - customerName?: string; | |
808 | - /** | |
809 | - * @description | |
810 | - * 收货人地址信息 | |
811 | - */ | |
812 | - customerShippingAddress?: string; | |
813 | - /** | |
814 | - * @description | |
815 | - * 结束时间 | |
752 | + * 收款时间 | |
816 | 753 | * @format date-time |
817 | 754 | * @example |
818 | - * 2023-11-11 10:20 | |
819 | - */ | |
820 | - endTime?: string; | |
821 | - /** | |
822 | - * @description | |
823 | - * 主订单号id | |
824 | - * @format int64 | |
825 | - */ | |
826 | - id?: number; | |
827 | - /** | |
828 | - * @description | |
829 | - * 单位 | |
830 | - */ | |
831 | - institution?: string; | |
832 | - /** | |
833 | - * @description | |
834 | - * 单位联系人 | |
835 | - */ | |
836 | - institutionContactName?: string; | |
837 | - /** | |
838 | - * @description | |
839 | - * 开票状态 | |
840 | - */ | |
841 | - invoicingStatus?: string; | |
842 | - /** | |
843 | - * @description | |
844 | - * 物流方式 | |
845 | - */ | |
846 | - logisticsMethod?: string; | |
847 | - /** | |
848 | - * @description | |
849 | - * 订单状态 | |
850 | - */ | |
851 | - orderStatus?: string; | |
852 | - /** @format int32 */ | |
853 | - pageSize?: number; | |
854 | - /** | |
855 | - * @description | |
856 | - * 商品参数 | |
857 | - */ | |
858 | - parameters?: string; | |
859 | - /** | |
860 | - * @description | |
861 | - * 支付渠道 | |
862 | - */ | |
863 | - paymentChannel?: string; | |
864 | - /** | |
865 | - * @description | |
866 | - * 支付方式 | |
867 | - */ | |
868 | - paymentMethod?: string; | |
869 | - /** | |
870 | - * @description | |
871 | - * 支付流水号 | |
872 | - */ | |
873 | - paymentTransactionId?: string; | |
874 | - /** | |
875 | - * @description | |
876 | - * 商品所属事业部门 | |
877 | - */ | |
878 | - productBelongBusiness?: string; | |
879 | - /** | |
880 | - * @description | |
881 | - * 商品名称 | |
755 | + * 2023-11-12 16:12 | |
882 | 756 | */ |
883 | - productName?: string; | |
757 | + collectMoneyTime?: string; | |
884 | 758 | /** |
885 | 759 | * @description |
886 | - * 销售代号 | |
760 | + * 子订单id集合 | |
887 | 761 | */ |
888 | - salesCode?: string; | |
889 | - /** @format int32 */ | |
890 | - total?: number; | |
762 | + subIds?: Array<number>; | |
891 | 763 | } | ... | ... |
src/services/order.ts
... | ... | @@ -4,9 +4,10 @@ export const orderExport = async (data: any = {}) => { |
4 | 4 | // const res = await defHttp.post<any>({ url: Api.EXPORT, data }); |
5 | 5 | |
6 | 6 | axios({ |
7 | - url: '/service/order/export', | |
7 | + url: '/api/service/order/export', | |
8 | 8 | method: 'post', |
9 | 9 | responseType: 'blob', |
10 | + headers: { Authorization: localStorage.getItem('token') }, | |
10 | 11 | data, |
11 | 12 | }) |
12 | 13 | .then((response) => { | ... | ... |
src/services/request.ts
... | ... | @@ -26,12 +26,9 @@ import type { |
26 | 26 | DictionaryQueryVO, |
27 | 27 | DictionaryVO, |
28 | 28 | Dto, |
29 | - InvoicingDto, | |
30 | - ModelAndView, | |
31 | 29 | OrderAddVO, |
32 | 30 | OrderAuditLogQueryVO, |
33 | 31 | OrderBaseInfoQueryVO, |
34 | - OrderCancelDto, | |
35 | 32 | OrderFieldLockApplyQueryVO, |
36 | 33 | OrderOptLogQueryVO, |
37 | 34 | OrderProfitAnalysisVo, |
... | ... | @@ -220,7 +217,9 @@ export interface GetErrorResponse { |
220 | 217 | * @description |
221 | 218 | * OK |
222 | 219 | */ |
223 | - 200: ModelAndView; | |
220 | + 200: { | |
221 | + [propertyName: string]: any; | |
222 | + }; | |
224 | 223 | /** |
225 | 224 | * @description |
226 | 225 | * Unauthorized |
... | ... | @@ -241,9 +240,9 @@ export interface GetErrorResponse { |
241 | 240 | export type GetErrorResponseSuccess = GetErrorResponse[200]; |
242 | 241 | /** |
243 | 242 | * @description |
244 | - * errorHtml | |
243 | + * error | |
245 | 244 | * @tags basic-error-controller |
246 | - * @produces text/html | |
245 | + * @produces * | |
247 | 246 | */ |
248 | 247 | export const getError = /* #__PURE__ */ (() => { |
249 | 248 | const method = 'get'; |
... | ... | @@ -267,7 +266,9 @@ export interface PutErrorResponse { |
267 | 266 | * @description |
268 | 267 | * OK |
269 | 268 | */ |
270 | - 200: ModelAndView; | |
269 | + 200: { | |
270 | + [propertyName: string]: any; | |
271 | + }; | |
271 | 272 | /** |
272 | 273 | * @description |
273 | 274 | * Created |
... | ... | @@ -293,9 +294,9 @@ export interface PutErrorResponse { |
293 | 294 | export type PutErrorResponseSuccess = PutErrorResponse[200]; |
294 | 295 | /** |
295 | 296 | * @description |
296 | - * errorHtml | |
297 | + * error | |
297 | 298 | * @tags basic-error-controller |
298 | - * @produces text/html | |
299 | + * @produces * | |
299 | 300 | * @consumes application/json |
300 | 301 | */ |
301 | 302 | export const putError = /* #__PURE__ */ (() => { |
... | ... | @@ -320,7 +321,9 @@ export interface PostErrorResponse { |
320 | 321 | * @description |
321 | 322 | * OK |
322 | 323 | */ |
323 | - 200: ModelAndView; | |
324 | + 200: { | |
325 | + [propertyName: string]: any; | |
326 | + }; | |
324 | 327 | /** |
325 | 328 | * @description |
326 | 329 | * Created |
... | ... | @@ -346,9 +349,9 @@ export interface PostErrorResponse { |
346 | 349 | export type PostErrorResponseSuccess = PostErrorResponse[200]; |
347 | 350 | /** |
348 | 351 | * @description |
349 | - * errorHtml | |
352 | + * error | |
350 | 353 | * @tags basic-error-controller |
351 | - * @produces text/html | |
354 | + * @produces * | |
352 | 355 | * @consumes application/json |
353 | 356 | */ |
354 | 357 | export const postError = /* #__PURE__ */ (() => { |
... | ... | @@ -373,7 +376,9 @@ export interface DeleteErrorResponse { |
373 | 376 | * @description |
374 | 377 | * OK |
375 | 378 | */ |
376 | - 200: ModelAndView; | |
379 | + 200: { | |
380 | + [propertyName: string]: any; | |
381 | + }; | |
377 | 382 | /** |
378 | 383 | * @description |
379 | 384 | * No Content |
... | ... | @@ -394,9 +399,9 @@ export interface DeleteErrorResponse { |
394 | 399 | export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; |
395 | 400 | /** |
396 | 401 | * @description |
397 | - * errorHtml | |
402 | + * error | |
398 | 403 | * @tags basic-error-controller |
399 | - * @produces text/html | |
404 | + * @produces * | |
400 | 405 | */ |
401 | 406 | export const deleteError = /* #__PURE__ */ (() => { |
402 | 407 | const method = 'delete'; |
... | ... | @@ -420,7 +425,9 @@ export interface OptionsErrorResponse { |
420 | 425 | * @description |
421 | 426 | * OK |
422 | 427 | */ |
423 | - 200: ModelAndView; | |
428 | + 200: { | |
429 | + [propertyName: string]: any; | |
430 | + }; | |
424 | 431 | /** |
425 | 432 | * @description |
426 | 433 | * No Content |
... | ... | @@ -441,9 +448,9 @@ export interface OptionsErrorResponse { |
441 | 448 | export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; |
442 | 449 | /** |
443 | 450 | * @description |
444 | - * errorHtml | |
451 | + * error | |
445 | 452 | * @tags basic-error-controller |
446 | - * @produces text/html | |
453 | + * @produces * | |
447 | 454 | * @consumes application/json |
448 | 455 | */ |
449 | 456 | export const optionsError = /* #__PURE__ */ (() => { |
... | ... | @@ -468,7 +475,9 @@ export interface HeadErrorResponse { |
468 | 475 | * @description |
469 | 476 | * OK |
470 | 477 | */ |
471 | - 200: ModelAndView; | |
478 | + 200: { | |
479 | + [propertyName: string]: any; | |
480 | + }; | |
472 | 481 | /** |
473 | 482 | * @description |
474 | 483 | * No Content |
... | ... | @@ -489,9 +498,9 @@ export interface HeadErrorResponse { |
489 | 498 | export type HeadErrorResponseSuccess = HeadErrorResponse[200]; |
490 | 499 | /** |
491 | 500 | * @description |
492 | - * errorHtml | |
501 | + * error | |
493 | 502 | * @tags basic-error-controller |
494 | - * @produces text/html | |
503 | + * @produces * | |
495 | 504 | * @consumes application/json |
496 | 505 | */ |
497 | 506 | export const headError = /* #__PURE__ */ (() => { |
... | ... | @@ -516,7 +525,9 @@ export interface PatchErrorResponse { |
516 | 525 | * @description |
517 | 526 | * OK |
518 | 527 | */ |
519 | - 200: ModelAndView; | |
528 | + 200: { | |
529 | + [propertyName: string]: any; | |
530 | + }; | |
520 | 531 | /** |
521 | 532 | * @description |
522 | 533 | * No Content |
... | ... | @@ -537,9 +548,9 @@ export interface PatchErrorResponse { |
537 | 548 | export type PatchErrorResponseSuccess = PatchErrorResponse[200]; |
538 | 549 | /** |
539 | 550 | * @description |
540 | - * errorHtml | |
551 | + * error | |
541 | 552 | * @tags basic-error-controller |
542 | - * @produces text/html | |
553 | + * @produces * | |
543 | 554 | * @consumes application/json |
544 | 555 | */ |
545 | 556 | export const patchError = /* #__PURE__ */ (() => { |
... | ... | @@ -4707,7 +4718,7 @@ export interface PostServiceOrderOrderCancelOption { |
4707 | 4718 | /** |
4708 | 4719 | @description |
4709 | 4720 | dto */ |
4710 | - dto: OrderCancelDto; | |
4721 | + dto: Dto; | |
4711 | 4722 | }; |
4712 | 4723 | } |
4713 | 4724 | |
... | ... | @@ -4914,13 +4925,13 @@ export const postServiceOrderCheckOrder = /* #__PURE__ */ (() => { |
4914 | 4925 | export interface PostServiceOrderConfirmReceiptOption { |
4915 | 4926 | /** |
4916 | 4927 | * @description |
4917 | - * file | |
4928 | + * files | |
4918 | 4929 | */ |
4919 | 4930 | formData: { |
4920 | 4931 | /** |
4921 | 4932 | @description |
4922 | - file */ | |
4923 | - file: File; | |
4933 | + files */ | |
4934 | + files: Array<File>; | |
4924 | 4935 | }; |
4925 | 4936 | } |
4926 | 4937 | |
... | ... | @@ -4976,7 +4987,7 @@ export type PostServiceOrderConfirmReceiptResponseSuccess = |
4976 | 4987 | * 确认收货 |
4977 | 4988 | * @tags 内部订单 |
4978 | 4989 | * @produces * |
4979 | - * @consumes multipart/form-data | |
4990 | + * @consumes application/json | |
4980 | 4991 | */ |
4981 | 4992 | export const postServiceOrderConfirmReceipt = /* #__PURE__ */ (() => { |
4982 | 4993 | const method = 'post'; |
... | ... | @@ -4997,6 +5008,77 @@ export const postServiceOrderConfirmReceipt = /* #__PURE__ */ (() => { |
4997 | 5008 | return request; |
4998 | 5009 | })(); |
4999 | 5010 | |
5011 | +/** @description request parameter type for postServiceOrderEditOrder */ | |
5012 | +export interface PostServiceOrderEditOrderOption { | |
5013 | + /** | |
5014 | + * @description | |
5015 | + * dto | |
5016 | + */ | |
5017 | + body: { | |
5018 | + /** | |
5019 | + @description | |
5020 | + dto */ | |
5021 | + dto: Dto; | |
5022 | + }; | |
5023 | +} | |
5024 | + | |
5025 | +/** @description response type for postServiceOrderEditOrder */ | |
5026 | +export interface PostServiceOrderEditOrderResponse { | |
5027 | + /** | |
5028 | + * @description | |
5029 | + * OK | |
5030 | + */ | |
5031 | + 200: ServerResult; | |
5032 | + /** | |
5033 | + * @description | |
5034 | + * Created | |
5035 | + */ | |
5036 | + 201: any; | |
5037 | + /** | |
5038 | + * @description | |
5039 | + * Unauthorized | |
5040 | + */ | |
5041 | + 401: any; | |
5042 | + /** | |
5043 | + * @description | |
5044 | + * Forbidden | |
5045 | + */ | |
5046 | + 403: any; | |
5047 | + /** | |
5048 | + * @description | |
5049 | + * Not Found | |
5050 | + */ | |
5051 | + 404: any; | |
5052 | +} | |
5053 | + | |
5054 | +export type PostServiceOrderEditOrderResponseSuccess = | |
5055 | + PostServiceOrderEditOrderResponse[200]; | |
5056 | +/** | |
5057 | + * @description | |
5058 | + * 财务编辑订单 | |
5059 | + * @tags 内部订单 | |
5060 | + * @produces * | |
5061 | + * @consumes application/json | |
5062 | + */ | |
5063 | +export const postServiceOrderEditOrder = /* #__PURE__ */ (() => { | |
5064 | + const method = 'post'; | |
5065 | + const url = '/service/order/editOrder'; | |
5066 | + function request( | |
5067 | + option: PostServiceOrderEditOrderOption, | |
5068 | + ): Promise<PostServiceOrderEditOrderResponseSuccess> { | |
5069 | + return requester(request.url, { | |
5070 | + method: request.method, | |
5071 | + ...option, | |
5072 | + }) as unknown as Promise<PostServiceOrderEditOrderResponseSuccess>; | |
5073 | + } | |
5074 | + | |
5075 | + /** http method */ | |
5076 | + request.method = method; | |
5077 | + /** request url */ | |
5078 | + request.url = url; | |
5079 | + return request; | |
5080 | +})(); | |
5081 | + | |
5000 | 5082 | /** @description request parameter type for postServiceOrderExport */ |
5001 | 5083 | export interface PostServiceOrderExportOption { |
5002 | 5084 | /** |
... | ... | @@ -5078,7 +5160,7 @@ export interface PostServiceOrderInvoicingOption { |
5078 | 5160 | /** |
5079 | 5161 | @description |
5080 | 5162 | dto */ |
5081 | - dto: InvoicingDto; | |
5163 | + dto: Dto; | |
5082 | 5164 | }; |
5083 | 5165 | } |
5084 | 5166 | ... | ... |
src/utils/index.ts
... | ... | @@ -26,4 +26,26 @@ function getUserInfo() { |
26 | 26 | return JSON.parse(userInfoString); |
27 | 27 | } |
28 | 28 | |
29 | -export { customMessage, enumToSelect, enumValueToLabel, getUserInfo }; | |
29 | +//将状态枚举值转换为ProTable的enumValue格式 | |
30 | +function enumToProTableEnumValue(enumConstants: any) { | |
31 | + const result = {}; | |
32 | + | |
33 | + for (const key in enumConstants) { | |
34 | + if (enumConstants.hasOwnProperty(key)) { | |
35 | + result[key] = { | |
36 | + text: enumConstants[key], | |
37 | + status: enumValueToLabel(key, enumConstants), | |
38 | + }; | |
39 | + } | |
40 | + } | |
41 | + | |
42 | + return result; | |
43 | +} | |
44 | + | |
45 | +export { | |
46 | + customMessage, | |
47 | + enumToProTableEnumValue, | |
48 | + enumToSelect, | |
49 | + enumValueToLabel, | |
50 | + getUserInfo, | |
51 | +}; | ... | ... |