Merge remote-tracking branch 'origin/master'
正在显示
6 个修改的文件
包含
393 行增加
和
9 行删除
@@ -12,3 +12,5 @@ export const delCustomer = params => { return axios.get(`${baseServiceURL2}/cust | @@ -12,3 +12,5 @@ export const delCustomer = params => { return axios.get(`${baseServiceURL2}/cust | ||
12 | export const ediCustomer = params => { return http.post(`${baseServiceURL2}/customer/ediCustomer`, params); }; | 12 | export const ediCustomer = params => { return http.post(`${baseServiceURL2}/customer/ediCustomer`, params); }; |
13 | //客户配置列表 | 13 | //客户配置列表 |
14 | export const selectCustomers = params => { return axios.get(`${baseServiceURL2}/customer/selectCustomers`, { params: params }); }; | 14 | export const selectCustomers = params => { return axios.get(`${baseServiceURL2}/customer/selectCustomers`, { params: params }); }; |
15 | +// 查询客户配置所有列表 | ||
16 | +export const selectAll = params => {return axios.get(`${baseServiceURL2}/customer/selectAll`, {params: params});}; |
@@ -7,11 +7,12 @@ let baseServiceURL2 = 'wlpt-cbed-system' | @@ -7,11 +7,12 @@ let baseServiceURL2 = 'wlpt-cbed-system' | ||
7 | 7 | ||
8 | 8 | ||
9 | //订单列表 | 9 | //订单列表 |
10 | -export const selectLists = params => { return axios.get(`${baseServiceURL2}/ExportOrderDeclaration/selectLists`, { params: params }); }; | 10 | +// export const selectLists = params => { return axios.get(`${baseServiceURL2}/ExportOrderDeclaration/selectLists`, { params: params }); }; |
11 | +export const selectLists = params => { return axios.get(`${baseServiceURL2}/ExportOrder/selectList`, { params: params }); }; | ||
11 | //订单申报 | 12 | //订单申报 |
12 | export const sendOrder = params => { return http.post(`${baseServiceURL2}/ExportOrderDeclaration/sendOrder`, params); }; | 13 | export const sendOrder = params => { return http.post(`${baseServiceURL2}/ExportOrderDeclaration/sendOrder`, params); }; |
13 | //上传EXCEL | 14 | //上传EXCEL |
14 | -export const importExcel = params => { return http.postExcelData(`${baseServiceURL2}/import/importExcel`, params); }; | 15 | +// export const importExcel = params => { return http.postExcelData(`${baseServiceURL2}/import/importExcel`, params); }; |
15 | //订单批量申报 | 16 | //订单批量申报 |
16 | export const batchOrder = params => { return http.post(`${baseServiceURL2}/ExportOrderDeclaration/batchOrder`, params); }; | 17 | export const batchOrder = params => { return http.post(`${baseServiceURL2}/ExportOrderDeclaration/batchOrder`, params); }; |
17 | //订单批量导入申报 | 18 | //订单批量导入申报 |
@@ -30,3 +31,13 @@ export const zfeldBatchDeclare = params => { return http.post(`${baseServiceURL2 | @@ -30,3 +31,13 @@ export const zfeldBatchDeclare = params => { return http.post(`${baseServiceURL2 | ||
30 | export const zfeldImportDeclare = params => { return http.postExcelData(`${baseServiceURL2}/ExportWaybillDeclaration/eldImportDeclare`, params); }; | 31 | export const zfeldImportDeclare = params => { return http.postExcelData(`${baseServiceURL2}/ExportWaybillDeclaration/eldImportDeclare`, params); }; |
31 | //根据提运单统计信息 | 32 | //根据提运单统计信息 |
32 | export const billNoStatistics = params => { return axios.get(`${baseServiceURL2}/ExportListDeclaration/billNoStatistics`, { params: params }); }; | 33 | export const billNoStatistics = params => { return axios.get(`${baseServiceURL2}/ExportListDeclaration/billNoStatistics`, { params: params }); }; |
34 | +// 根据guid删除订单信息 | ||
35 | +export const deleteOrderByGuid = params => {return axios.get(`${baseServiceURL2}/ExportOrder/deleteByGuid`, {params: params}); }; | ||
36 | +//根据主单号批量删除订单信息 | ||
37 | +export const batchDelExt2 = params => {return axios.get(`${baseServiceURL2}/ExportOrder/batchDelExt2`, {params: params});} | ||
38 | +// 根据guid列表批量删除订单信息 | ||
39 | +export const batchDelOrderByBeans = params =>{return http.post(`${baseServiceURL2}/ExportOrder/deleteByBeans`,params); }; | ||
40 | +// 导入订单文件到minio | ||
41 | +export const importExcelToMinio = params => { return http.postExcelData(`${baseServiceURL2}/import/importExcelToMinio`, params); }; | ||
42 | +// 查询导入文件列表 | ||
43 | +export const selectFilePage = params =>{return axios.get(`${baseServiceURL2}/import/selectFilePage`, { params: params }); } |
@@ -206,6 +206,7 @@ import satellite from "./views/deploy/satellite"; | @@ -206,6 +206,7 @@ import satellite from "./views/deploy/satellite"; | ||
206 | import ExortOrder from './views/exportorder/Exportorder.vue' | 206 | import ExortOrder from './views/exportorder/Exportorder.vue' |
207 | import CustomerConfig from './views/exportorder/CustomerConfig.vue' | 207 | import CustomerConfig from './views/exportorder/CustomerConfig.vue' |
208 | import ManagerWaybill from "./views/exportorder/ManagerWaybill.vue"; | 208 | import ManagerWaybill from "./views/exportorder/ManagerWaybill.vue"; |
209 | +import ImportOrder from './views/exportorder/ImportOrder'; | ||
209 | 210 | ||
210 | /*制单管理*/ | 211 | /*制单管理*/ |
211 | import ZhiDan from './views/zhidan/zhidan.vue' | 212 | import ZhiDan from './views/zhidan/zhidan.vue' |
@@ -251,7 +252,8 @@ let routes = [ | @@ -251,7 +252,8 @@ let routes = [ | ||
251 | children: [ | 252 | children: [ |
252 | {path: '/ExortOrder', component: ExortOrder, name: '出口订单'}, | 253 | {path: '/ExortOrder', component: ExortOrder, name: '出口订单'}, |
253 | {path: '/CustomerConfig', component: CustomerConfig, name: '客户配置'}, | 254 | {path: '/CustomerConfig', component: CustomerConfig, name: '客户配置'}, |
254 | - {path: '/ManagerWaybill', component: ManagerWaybill, name: '主单管理'} | 255 | + {path: '/ManagerWaybill', component: ManagerWaybill, name: '主单管理'}, |
256 | + {path: '/import', component: ImportOrder, name: '订单预录入'} | ||
255 | ] | 257 | ] |
256 | }, | 258 | }, |
257 | { | 259 | { |
@@ -6,6 +6,9 @@ | @@ -6,6 +6,9 @@ | ||
6 | <el-input size="medium" v-model="queryInfo.ext1" class="" placeholder="客户编码"></el-input> | 6 | <el-input size="medium" v-model="queryInfo.ext1" class="" placeholder="客户编码"></el-input> |
7 | </el-form-item> | 7 | </el-form-item> |
8 | <el-form-item label=""> | 8 | <el-form-item label=""> |
9 | + <el-input size="medium" v-model="queryInfo.ext2" class="" placeholder="主单号"></el-input> | ||
10 | + </el-form-item> | ||
11 | + <el-form-item label=""> | ||
9 | <el-input size="medium" v-model="queryInfo.orderno" placeholder="订单号"></el-input> | 12 | <el-input size="medium" v-model="queryInfo.orderno" placeholder="订单号"></el-input> |
10 | </el-form-item> | 13 | </el-form-item> |
11 | <el-form-item label=""> | 14 | <el-form-item label=""> |
@@ -58,7 +61,7 @@ | @@ -58,7 +61,7 @@ | ||
58 | <el-form-item> | 61 | <el-form-item> |
59 | <el-button size="medium" @click="getList" style="background: none">查询</el-button> | 62 | <el-button size="medium" @click="getList" style="background: none">查询</el-button> |
60 | </el-form-item> | 63 | </el-form-item> |
61 | - <el-form-item> | 64 | +<!-- <el-form-item> |
62 | <el-upload | 65 | <el-upload |
63 | class="upload-demo" | 66 | class="upload-demo" |
64 | action="" | 67 | action="" |
@@ -67,6 +70,12 @@ | @@ -67,6 +70,12 @@ | ||
67 | :show-file-list="false"> | 70 | :show-file-list="false"> |
68 | <el-button size="medium" type="primary">导入订单</el-button> | 71 | <el-button size="medium" type="primary">导入订单</el-button> |
69 | </el-upload> | 72 | </el-upload> |
73 | + </el-form-item>--> | ||
74 | + <el-form-item> | ||
75 | + <el-button size="medium" @click="batchDelOrderByBeans" type="danger">批量删除</el-button> | ||
76 | + </el-form-item> | ||
77 | + <el-form-item> | ||
78 | + <el-button size="medium" @click="batchDelExt2" type="danger">主单号批量删除</el-button> | ||
70 | </el-form-item> | 79 | </el-form-item> |
71 | </el-form> | 80 | </el-form> |
72 | </div> | 81 | </div> |
@@ -148,6 +157,7 @@ | @@ -148,6 +157,7 @@ | ||
148 | row-key="id" | 157 | row-key="id" |
149 | stripe | 158 | stripe |
150 | > | 159 | > |
160 | + <el-table-column type="index" label="序号" width="50" align="center"/> | ||
151 | <el-table-column prop="itemno" label="企业商品货号" /> | 161 | <el-table-column prop="itemno" label="企业商品货号" /> |
152 | <el-table-column prop="itemname" label="企业商品名称" /> | 162 | <el-table-column prop="itemname" label="企业商品名称" /> |
153 | <el-table-column prop="itemdescribe" label="企业商品描述" /> | 163 | <el-table-column prop="itemdescribe" label="企业商品描述" /> |
@@ -163,6 +173,7 @@ | @@ -163,6 +173,7 @@ | ||
163 | </el-table-column> | 173 | </el-table-column> |
164 | <el-table-column type="selection" width="55"></el-table-column> | 174 | <el-table-column type="selection" width="55"></el-table-column> |
165 | <el-table-column prop="ext1" label="客户编号" width="180"></el-table-column> | 175 | <el-table-column prop="ext1" label="客户编号" width="180"></el-table-column> |
176 | + <el-table-column prop="ext2" label="主单号" width="180"></el-table-column> | ||
166 | <el-table-column prop="orderno" label="订单编号" width="180"></el-table-column> | 177 | <el-table-column prop="orderno" label="订单编号" width="180"></el-table-column> |
167 | <el-table-column prop="ordertype" label="订单类型" width="120"> | 178 | <el-table-column prop="ordertype" label="订单类型" width="120"> |
168 | <template slot-scope="scope"> | 179 | <template slot-scope="scope"> |
@@ -205,11 +216,12 @@ | @@ -205,11 +216,12 @@ | ||
205 | <el-table-column | 216 | <el-table-column |
206 | fixed="right" | 217 | fixed="right" |
207 | label="操作" | 218 | label="操作" |
208 | - width="180" | 219 | + width="200" |
209 | show-overflow-tooltip> | 220 | show-overflow-tooltip> |
210 | <template slot-scope="scope"> | 221 | <template slot-scope="scope"> |
211 | <el-button type="text" size="small" @click="sendorder(scope.row)">订单申报</el-button> | 222 | <el-button type="text" size="small" @click="sendorder(scope.row)">订单申报</el-button> |
212 | <el-button type="text" size="small" @click="sendDeclare(scope.row)">清单申报</el-button> | 223 | <el-button type="text" size="small" @click="sendDeclare(scope.row)">清单申报</el-button> |
224 | + <el-button type="text" size="small" @click="deleteOrderByGuid(scope.row)">订单删除</el-button> | ||
213 | </template> | 225 | </template> |
214 | </el-table-column> | 226 | </el-table-column> |
215 | </el-table> | 227 | </el-table> |
@@ -228,8 +240,9 @@ | @@ -228,8 +240,9 @@ | ||
228 | </template> | 240 | </template> |
229 | 241 | ||
230 | <script> | 242 | <script> |
231 | - import {sendOrder,selectLists,batchOrder,batchOrderImport,importExcel,eldhBatchDeclare,eldhImportDeclare, | ||
232 | - eldBatchDeclare,eldImportDeclare,zfeldBatchDeclare,zfeldImportDeclare} from '../../api/consigner/exportOrder' | 243 | + import {sendOrder,selectLists,batchOrder,batchOrderImport,eldhBatchDeclare,eldhImportDeclare, |
244 | + eldBatchDeclare,eldImportDeclare,zfeldBatchDeclare,zfeldImportDeclare,deleteOrderByGuid, | ||
245 | + batchDelOrderByBeans,batchDelExt2} from '../../api/consigner/exportOrder' | ||
233 | export default { | 246 | export default { |
234 | data() { | 247 | data() { |
235 | return { | 248 | return { |
@@ -272,6 +285,7 @@ | @@ -272,6 +285,7 @@ | ||
272 | orderno:'', | 285 | orderno:'', |
273 | ordertype:'', | 286 | ordertype:'', |
274 | ext1:'', | 287 | ext1:'', |
288 | + ext2:'', | ||
275 | starttime:'', | 289 | starttime:'', |
276 | endtime:'', | 290 | endtime:'', |
277 | pageNum:1, | 291 | pageNum:1, |
@@ -314,6 +328,7 @@ | @@ -314,6 +328,7 @@ | ||
314 | this.getList(); | 328 | this.getList(); |
315 | }, | 329 | }, |
316 | methods: { | 330 | methods: { |
331 | + | ||
317 | //运单批量导入申报 | 332 | //运单批量导入申报 |
318 | zfbatchOrderImport({ file, onSuccess, onError }){ | 333 | zfbatchOrderImport({ file, onSuccess, onError }){ |
319 | // 生成 FormData 对象 | 334 | // 生成 FormData 对象 |
@@ -501,7 +516,7 @@ | @@ -501,7 +516,7 @@ | ||
501 | return true; // 允许上传 | 516 | return true; // 允许上传 |
502 | 517 | ||
503 | }, | 518 | }, |
504 | - uploadFile({ file, onSuccess, onError }){ | 519 | + /*uploadFile({ file, onSuccess, onError }){ |
505 | // 生成 FormData 对象 | 520 | // 生成 FormData 对象 |
506 | const formData = new FormData(); | 521 | const formData = new FormData(); |
507 | formData.append('file', file); | 522 | formData.append('file', file); |
@@ -518,7 +533,7 @@ | @@ -518,7 +533,7 @@ | ||
518 | this.$message.error(error.toString()) | 533 | this.$message.error(error.toString()) |
519 | onError(error); // 调用 onError 回调通知上传失败 | 534 | onError(error); // 调用 onError 回调通知上传失败 |
520 | }) | 535 | }) |
521 | - }, | 536 | + },*/ |
522 | //订单申报 | 537 | //订单申报 |
523 | sendorder(row){ | 538 | sendorder(row){ |
524 | sendOrder(row).then((response)=>{ | 539 | sendOrder(row).then((response)=>{ |
@@ -532,6 +547,86 @@ | @@ -532,6 +547,86 @@ | ||
532 | this.$message.error(error.toString()) | 547 | this.$message.error(error.toString()) |
533 | }) | 548 | }) |
534 | }, | 549 | }, |
550 | + // 订单删除 | ||
551 | + deleteOrderByGuid(row){ | ||
552 | + this.$confirm('此操作将永久删除该订单, 是否继续?', '提示', { | ||
553 | + confirmButtonText: '确定', | ||
554 | + cancelButtonText: '取消', | ||
555 | + type: 'warning' | ||
556 | + }).then(() => { | ||
557 | + const guid = row.guid; | ||
558 | + deleteOrderByGuid({guid}).then((response) => { | ||
559 | + const res = response.data; | ||
560 | + const code = res.code; | ||
561 | + const msg = res.msg; | ||
562 | + if (code !== '200'){ | ||
563 | + return this.$message.error(msg); | ||
564 | + } | ||
565 | + this.$message.success(`订单删除成功`); | ||
566 | + this.getList(); | ||
567 | + }).catch(error => { | ||
568 | + this.$message.error(error.toString()) | ||
569 | + }) | ||
570 | + }).catch(() => { | ||
571 | + }); | ||
572 | + }, | ||
573 | + // 根据主单号删除数据 | ||
574 | + batchDelExt2(){ | ||
575 | + if (this.selectedRows.length !== 1){ | ||
576 | + this.$message.error("此功能仅支持勾选一条数据"); | ||
577 | + return; | ||
578 | + } | ||
579 | + this.$confirm('此操作将永久批量删除所选主单号订单, 是否继续?', '提示', { | ||
580 | + confirmButtonText: '确定', | ||
581 | + cancelButtonText: '取消', | ||
582 | + type: 'warning' | ||
583 | + }).then(() => { | ||
584 | + const ext2 = this.selectedRows[0].ext2; | ||
585 | + batchDelExt2({ext2}).then((response) => { | ||
586 | + const res = response.data; | ||
587 | + const code = res.code; | ||
588 | + const msg = res.msg; | ||
589 | + if (code !== '200'){ | ||
590 | + this.$message.error(msg); | ||
591 | + return; | ||
592 | + } | ||
593 | + this.$message.success("批量删除成功"); | ||
594 | + this.getList(); | ||
595 | + }).catch(error=>{ | ||
596 | + this.$message.error(error.toString()) | ||
597 | + }) | ||
598 | + }).catch(() => { | ||
599 | + | ||
600 | + }) | ||
601 | + }, | ||
602 | + // 订单批量删除 | ||
603 | + batchDelOrderByBeans(){ | ||
604 | + if (this.selectedRows.length===0){ | ||
605 | + this.$message.error('请勾选需要删除的订单信息!'); | ||
606 | + return; | ||
607 | + } | ||
608 | + this.$confirm('此操作将永久删除所选订单, 是否继续?', '提示', { | ||
609 | + confirmButtonText: '确定', | ||
610 | + cancelButtonText: '取消', | ||
611 | + type: 'warning' | ||
612 | + }).then(() => { | ||
613 | + batchDelOrderByBeans(this.selectedRows).then((response) => { | ||
614 | + const res = response.data; | ||
615 | + const code = res.code; | ||
616 | + const msg = res.msg; | ||
617 | + const data = res.data; | ||
618 | + if (code !== '200'){ | ||
619 | + const errMsg = `${msg}${data}`; | ||
620 | + this.$message.error(errMsg); | ||
621 | + return; | ||
622 | + } | ||
623 | + this.$message.success("订单批量删除成功"); | ||
624 | + this.getList(); | ||
625 | + }).catch(error => { | ||
626 | + this.$message.error(error.toString()); | ||
627 | + }) | ||
628 | + }) | ||
629 | + }, | ||
535 | //订单列表查询 | 630 | //订单列表查询 |
536 | getList(){ | 631 | getList(){ |
537 | if(this.value2 !== null && this.value2 !== ""){ | 632 | if(this.value2 !== null && this.value2 !== ""){ |
src/views/exportorder/ImportOrder.vue
0 → 100644
1 | +<template> | ||
2 | + <div> | ||
3 | + <div> | ||
4 | + <el-form :inline="true" :model="queryInfo" class="demo-form-inline"> | ||
5 | + <el-form-item label=""> | ||
6 | + <el-select size="medium" v-model="queryInfo.clientCode" placeholder="客户编码" clearable> | ||
7 | + <el-option | ||
8 | + v-for="item in customerList" | ||
9 | + :key="item.clientCode" | ||
10 | + :label="item.clientName" | ||
11 | + :value="item.clientCode" | ||
12 | + > | ||
13 | + </el-option> | ||
14 | + </el-select> | ||
15 | + </el-form-item> | ||
16 | + <el-form-item label=""> | ||
17 | + <el-select size="medium" v-model="queryInfo.fileStatus" placeholder="文件状态" clearable> | ||
18 | + <el-option | ||
19 | + v-for="item in fileStatus" | ||
20 | + :key="item.value" | ||
21 | + :label="item.label" | ||
22 | + :value="item.value"> | ||
23 | + </el-option> | ||
24 | + </el-select> | ||
25 | + </el-form-item> | ||
26 | + <el-form-item label=""> | ||
27 | + <el-input size="medium" v-model="queryInfo.fileName" placeholder="文件名称"></el-input> | ||
28 | + </el-form-item> | ||
29 | + <el-form-item> | ||
30 | + <div class="block"> | ||
31 | + <el-date-picker | ||
32 | + style="background: none" | ||
33 | + size="medium" | ||
34 | + v-model="value2" | ||
35 | + type="daterange" | ||
36 | + align="right" | ||
37 | + unlink-panels | ||
38 | + range-separator="至" | ||
39 | + start-placeholder="开始日期" | ||
40 | + end-placeholder="结束日期" | ||
41 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
42 | + :picker-options="pickerOptions"> | ||
43 | + </el-date-picker> | ||
44 | + </div> | ||
45 | + </el-form-item> | ||
46 | + <el-form-item> | ||
47 | + <el-button type="primary" @click="getList">查询</el-button> | ||
48 | + </el-form-item> | ||
49 | + </el-form> | ||
50 | + </div> | ||
51 | + <div> | ||
52 | + <el-row :gutter="20"> | ||
53 | + <el-col :span="3"> | ||
54 | + <el-button size="medium" @click="downloadOrderTemplate">模板下载</el-button> | ||
55 | + </el-col> | ||
56 | + <el-col :span="3"> | ||
57 | + <el-upload | ||
58 | + class="upload-demo" | ||
59 | + action="" | ||
60 | + :before-upload="beforeUpload" | ||
61 | + :http-request="orderImport" | ||
62 | + :show-file-list="false"> | ||
63 | + <el-button size="medium" type="primary">导入订单</el-button> | ||
64 | + </el-upload> | ||
65 | + </el-col> | ||
66 | + </el-row> | ||
67 | + </div> | ||
68 | + <el-row :gutter="20" style="height: 20px;"></el-row> | ||
69 | + <div> | ||
70 | + <el-table | ||
71 | + :data="tableData" | ||
72 | + style="width: 100%" | ||
73 | + row-key="uuid" | ||
74 | + border | ||
75 | + stripe | ||
76 | + > | ||
77 | + <el-table-column prop="clientName" label="客户名称" width="180" show-overflow-tooltip></el-table-column> | ||
78 | + <el-table-column prop="clientCode" label="客户编码" width="180" show-overflow-tooltip></el-table-column> | ||
79 | + <el-table-column prop="fileStatus" label="文件状态" width="180" show-overflow-tooltip> | ||
80 | + <template slot-scope="scope"> | ||
81 | + <span v-if="scope.row.fileStatus === 1">入库中</span> | ||
82 | + <span v-else-if="scope.row.fileStatus === 2">入库异常</span> | ||
83 | + <span v-else-if="scope.row.fileStatus === 5">入库成功</span> | ||
84 | + </template> | ||
85 | + </el-table-column> | ||
86 | + <el-table-column prop="fileName" label="文件名称" width="180" show-overflow-tooltip></el-table-column> | ||
87 | + <el-table-column prop="handleRes" label="处理结果" width="180" show-overflow-tooltip></el-table-column> | ||
88 | + <el-table-column prop="createTime" label="创建时间" width="180" show-overflow-tooltip></el-table-column> | ||
89 | + </el-table> | ||
90 | + </div> | ||
91 | + <div class="block"> | ||
92 | + <el-pagination | ||
93 | + @size-change="handleSizeChange" | ||
94 | + @current-change="handleCurrentChange" | ||
95 | + :current-page="queryInfo.pageNum" | ||
96 | + :page-sizes="[20, 30, 40, 100]" | ||
97 | + :page-size="queryInfo.pageSize" | ||
98 | + layout="total, sizes, prev, pager, next, jumper" | ||
99 | + :total="total"> | ||
100 | + </el-pagination> | ||
101 | + </div> | ||
102 | + </div> | ||
103 | +</template> | ||
104 | + | ||
105 | +<script> | ||
106 | + import {selectAll} from '../../api/consigner/customerconfig' | ||
107 | + import {importExcelToMinio, selectFilePage} from '../../api/consigner/exportOrder' | ||
108 | + export default { | ||
109 | + data() { | ||
110 | + return { | ||
111 | + // 查询条件 | ||
112 | + queryInfo: { | ||
113 | + clientCode: '', | ||
114 | + fileStatus: '', | ||
115 | + fileName: '', | ||
116 | + startTime: '', | ||
117 | + endTime: '', | ||
118 | + pageNum: 1, | ||
119 | + pageSize: 20 | ||
120 | + }, | ||
121 | + // 列表数据 | ||
122 | + tableData: [], | ||
123 | + total: 0, | ||
124 | + // 文件状态码 | ||
125 | + fileStatus: [ | ||
126 | + { | ||
127 | + label: '入库中', | ||
128 | + value: '1' | ||
129 | + }, | ||
130 | + { | ||
131 | + label: '入库异常', | ||
132 | + value: '2' | ||
133 | + }, | ||
134 | + { | ||
135 | + label: '入库成功', | ||
136 | + value: '5' | ||
137 | + } | ||
138 | + ], | ||
139 | + pickerOptions: { | ||
140 | + shortcuts: [{ | ||
141 | + text: '最近一周', | ||
142 | + onClick(picker) { | ||
143 | + const end = new Date(); | ||
144 | + const start = new Date(); | ||
145 | + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); | ||
146 | + picker.$emit('pick', [start, end]); | ||
147 | + } | ||
148 | + }, { | ||
149 | + text: '最近一个月', | ||
150 | + onClick(picker) { | ||
151 | + const end = new Date(); | ||
152 | + const start = new Date(); | ||
153 | + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); | ||
154 | + picker.$emit('pick', [start, end]); | ||
155 | + } | ||
156 | + }, { | ||
157 | + text: '最近三个月', | ||
158 | + onClick(picker) { | ||
159 | + const end = new Date(); | ||
160 | + const start = new Date(); | ||
161 | + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); | ||
162 | + picker.$emit('pick', [start, end]); | ||
163 | + } | ||
164 | + }] | ||
165 | + }, | ||
166 | + // 存储从后端获取的客户数据 | ||
167 | + customerList: [], | ||
168 | + value2:[], | ||
169 | + } | ||
170 | + }, | ||
171 | + mounted() { | ||
172 | + this.getCustomerList(); | ||
173 | + this.getList(); | ||
174 | + }, | ||
175 | + methods: { | ||
176 | + // 查询上传文件信息列表 | ||
177 | + getList(){ | ||
178 | + if (this.value2 !== null && this.value2 !== ''){ | ||
179 | + this.queryInfo.startTime = this.value2[0]; | ||
180 | + this.queryInfo.endTime = this.value2[1]; | ||
181 | + } | ||
182 | + selectFilePage(this.queryInfo).then((response) => { | ||
183 | + const res = response.data; | ||
184 | + const code = res.code; | ||
185 | + const data = res.data; | ||
186 | + if (code !== '200'){ | ||
187 | + return this.$message.error("获取文件列表失败"); | ||
188 | + } | ||
189 | + this.tableData = data.list; | ||
190 | + this.total = data.total; | ||
191 | + this.$message.success("获取文件列表成功"); | ||
192 | + this.queryInfo.startTime = ''; | ||
193 | + this.queryInfo.endTime = ''; | ||
194 | + }).catch(error => { | ||
195 | + this.$message.error(error.toString()); | ||
196 | + }) | ||
197 | + }, | ||
198 | + // 获取客户配置列表选项 | ||
199 | + getCustomerList(){ | ||
200 | + selectAll().then((response) =>{ | ||
201 | + const res = response.data; | ||
202 | + const code = res.code; | ||
203 | + if (code !== '200'){ | ||
204 | + return this.$message.error("客户信息获取失败"); | ||
205 | + } | ||
206 | + this.customerList = res.data; | ||
207 | + } | ||
208 | + ).catch(error => { | ||
209 | + this.$message.error(error.toString()) | ||
210 | + }) | ||
211 | + }, | ||
212 | + //导入订单excel | ||
213 | + beforeUpload(file) { | ||
214 | + // 检查文件类型 | ||
215 | + const isExcel = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.type === 'application/vnd.ms-excel'; | ||
216 | + const fileMaxSize = 10 * 1024 * 1024; | ||
217 | + if (!isExcel) { | ||
218 | + this.$message.error('上传文件只能是 Excel 格式!'); | ||
219 | + return false; // 取消文件上传 | ||
220 | + } | ||
221 | + // 检查文件大小 | ||
222 | + const isLtMaxSize = file.size / 1024 / 1024 < fileMaxSize; | ||
223 | + if (!isLtMaxSize) { | ||
224 | + this.$message.error(`上传文件大小不能超过 ${fileMaxSize / (1024 * 1024)} MB!`); | ||
225 | + return false; // 取消文件上传 | ||
226 | + } | ||
227 | + return true; // 允许上传 | ||
228 | + }, | ||
229 | + // 下载订单模板文件 | ||
230 | + downloadOrderTemplate(){ | ||
231 | + const fileUrl = '../../static/出口订单导入模板.xlsx'; | ||
232 | + // 创建隐藏的<a>元素 | ||
233 | + const link = document.createElement('a'); | ||
234 | + link.href = fileUrl; | ||
235 | + link.download = '出口订单导入模板.xlsx'; // 设置下载的文件名 | ||
236 | + // 将<a>元素添加到DOM中 | ||
237 | + document.body.appendChild(link); | ||
238 | + // 触发点击事件 | ||
239 | + link.click(); | ||
240 | + // 移除<a>元素 | ||
241 | + document.body.removeChild(link); | ||
242 | + }, | ||
243 | + // 导入订单文件到minio | ||
244 | + orderImport({file, onSuccess, onError}){ | ||
245 | + const formData = new FormData(); | ||
246 | + formData.append('file', file); | ||
247 | + importExcelToMinio(formData).then((response) => { | ||
248 | + const res = response.data; | ||
249 | + const code = res.code; | ||
250 | + const msg = res.msg; | ||
251 | + if (code !== '200'){ | ||
252 | + return this.$message.error(msg); | ||
253 | + } | ||
254 | + this.$message.success(msg); | ||
255 | + this.getList(); | ||
256 | + onSuccess(res); | ||
257 | + }).catch(error => { | ||
258 | + this.$message.error(error.toString()); | ||
259 | + onError(error); | ||
260 | + }) | ||
261 | + }, | ||
262 | + //分页 | ||
263 | + handleSizeChange(val) { | ||
264 | + this.queryInfo.pageSize=val; | ||
265 | + this.getList(); | ||
266 | + }, | ||
267 | + //分页 | ||
268 | + handleCurrentChange(val) { | ||
269 | + this.queryInfo.pageNum=val; | ||
270 | + this.getList(); | ||
271 | + }, | ||
272 | + } | ||
273 | + } | ||
274 | +</script> |
static/出口订单导入模板.xlsx
0 → 100644
不能预览此文件类型
-
请 注册 或 登录 后发表评论