正在显示
5 个修改的文件
包含
344 行增加
和
8 行删除
| @@ -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,11 @@ export const zfeldBatchDeclare = params => { return http.post(`${baseServiceURL2 | @@ -30,3 +31,11 @@ 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 | +// 根据guid列表批量删除订单信息 | ||
| 37 | +export const batchDelOrderByBeans = params =>{return http.post(`${baseServiceURL2}/ExportOrder/deleteByBeans`,params); }; | ||
| 38 | +// 导入订单文件到minio | ||
| 39 | +export const importExcelToMinio = params => { return http.postExcelData(`${baseServiceURL2}/import/importExcelToMinio`, params); }; | ||
| 40 | +// 查询导入文件列表 | ||
| 41 | +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' | 
| @@ -242,7 +243,8 @@ let routes = [ | @@ -242,7 +243,8 @@ let routes = [ | ||
| 242 | children: [ | 243 | children: [ | 
| 243 | {path: '/ExortOrder', component: ExortOrder, name: '出口订单'}, | 244 | {path: '/ExortOrder', component: ExortOrder, name: '出口订单'}, | 
| 244 | {path: '/CustomerConfig', component: CustomerConfig, name: '客户配置'}, | 245 | {path: '/CustomerConfig', component: CustomerConfig, name: '客户配置'}, | 
| 245 | - {path: '/ManagerWaybill', component: ManagerWaybill, name: '主单管理'} | 246 | + {path: '/ManagerWaybill', component: ManagerWaybill, name: '主单管理'}, | 
| 247 | + {path: '/import', component: ImportOrder, name: '订单预录入'} | ||
| 246 | ] | 248 | ] | 
| 247 | }, | 249 | }, | 
| 248 | { | 250 | { | 
| @@ -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,9 @@ | @@ -67,6 +70,9 @@ | ||
| 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> | ||
| 70 | </el-form-item> | 76 | </el-form-item> | 
| 71 | </el-form> | 77 | </el-form> | 
| 72 | </div> | 78 | </div> | 
| @@ -163,6 +169,7 @@ | @@ -163,6 +169,7 @@ | ||
| 163 | </el-table-column> | 169 | </el-table-column> | 
| 164 | <el-table-column type="selection" width="55"></el-table-column> | 170 | <el-table-column type="selection" width="55"></el-table-column> | 
| 165 | <el-table-column prop="ext1" label="客户编号" width="180"></el-table-column> | 171 | <el-table-column prop="ext1" label="客户编号" width="180"></el-table-column> | 
| 172 | + <el-table-column prop="ext2" label="主单号" width="180"></el-table-column> | ||
| 166 | <el-table-column prop="orderno" label="订单编号" width="180"></el-table-column> | 173 | <el-table-column prop="orderno" label="订单编号" width="180"></el-table-column> | 
| 167 | <el-table-column prop="ordertype" label="订单类型" width="120"> | 174 | <el-table-column prop="ordertype" label="订单类型" width="120"> | 
| 168 | <template slot-scope="scope"> | 175 | <template slot-scope="scope"> | 
| @@ -210,6 +217,7 @@ | @@ -210,6 +217,7 @@ | ||
| 210 | <template slot-scope="scope"> | 217 | <template slot-scope="scope"> | 
| 211 | <el-button type="text" size="small" @click="sendorder(scope.row)">订单申报</el-button> | 218 | <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> | 219 | <el-button type="text" size="small" @click="sendDeclare(scope.row)">清单申报</el-button> | 
| 220 | + <el-button type="text" size="small" @click="deleteOrderByGuid(scope.row)">删除</el-button> | ||
| 213 | </template> | 221 | </template> | 
| 214 | </el-table-column> | 222 | </el-table-column> | 
| 215 | </el-table> | 223 | </el-table> | 
| @@ -228,8 +236,9 @@ | @@ -228,8 +236,9 @@ | ||
| 228 | </template> | 236 | </template> | 
| 229 | 237 | ||
| 230 | <script> | 238 | <script> | 
| 231 | - import {sendOrder,selectLists,batchOrder,batchOrderImport,importExcel,eldhBatchDeclare,eldhImportDeclare, | ||
| 232 | - eldBatchDeclare,eldImportDeclare,zfeldBatchDeclare,zfeldImportDeclare} from '../../api/consigner/exportOrder' | 239 | + import {sendOrder,selectLists,batchOrder,batchOrderImport,eldhBatchDeclare,eldhImportDeclare, | 
| 240 | + eldBatchDeclare,eldImportDeclare,zfeldBatchDeclare,zfeldImportDeclare,deleteOrderByGuid, | ||
| 241 | + batchDelOrderByBeans} from '../../api/consigner/exportOrder' | ||
| 233 | export default { | 242 | export default { | 
| 234 | data() { | 243 | data() { | 
| 235 | return { | 244 | return { | 
| @@ -272,6 +281,7 @@ | @@ -272,6 +281,7 @@ | ||
| 272 | orderno:'', | 281 | orderno:'', | 
| 273 | ordertype:'', | 282 | ordertype:'', | 
| 274 | ext1:'', | 283 | ext1:'', | 
| 284 | + ext2:'', | ||
| 275 | starttime:'', | 285 | starttime:'', | 
| 276 | endtime:'', | 286 | endtime:'', | 
| 277 | pageNum:1, | 287 | pageNum:1, | 
| @@ -314,6 +324,7 @@ | @@ -314,6 +324,7 @@ | ||
| 314 | this.getList(); | 324 | this.getList(); | 
| 315 | }, | 325 | }, | 
| 316 | methods: { | 326 | methods: { | 
| 327 | + | ||
| 317 | //运单批量导入申报 | 328 | //运单批量导入申报 | 
| 318 | zfbatchOrderImport({ file, onSuccess, onError }){ | 329 | zfbatchOrderImport({ file, onSuccess, onError }){ | 
| 319 | // 生成 FormData 对象 | 330 | // 生成 FormData 对象 | 
| @@ -501,7 +512,7 @@ | @@ -501,7 +512,7 @@ | ||
| 501 | return true; // 允许上传 | 512 | return true; // 允许上传 | 
| 502 | 513 | ||
| 503 | }, | 514 | }, | 
| 504 | - uploadFile({ file, onSuccess, onError }){ | 515 | + /*uploadFile({ file, onSuccess, onError }){ | 
| 505 | // 生成 FormData 对象 | 516 | // 生成 FormData 对象 | 
| 506 | const formData = new FormData(); | 517 | const formData = new FormData(); | 
| 507 | formData.append('file', file); | 518 | formData.append('file', file); | 
| @@ -518,7 +529,7 @@ | @@ -518,7 +529,7 @@ | ||
| 518 | this.$message.error(error.toString()) | 529 | this.$message.error(error.toString()) | 
| 519 | onError(error); // 调用 onError 回调通知上传失败 | 530 | onError(error); // 调用 onError 回调通知上传失败 | 
| 520 | }) | 531 | }) | 
| 521 | - }, | 532 | + },*/ | 
| 522 | //订单申报 | 533 | //订单申报 | 
| 523 | sendorder(row){ | 534 | sendorder(row){ | 
| 524 | sendOrder(row).then((response)=>{ | 535 | sendOrder(row).then((response)=>{ | 
| @@ -532,6 +543,44 @@ | @@ -532,6 +543,44 @@ | ||
| 532 | this.$message.error(error.toString()) | 543 | this.$message.error(error.toString()) | 
| 533 | }) | 544 | }) | 
| 534 | }, | 545 | }, | 
| 546 | + // 订单删除 | ||
| 547 | + deleteOrderByGuid(row){ | ||
| 548 | + const guid = row.guid; | ||
| 549 | + deleteOrderByGuid({guid}).then((response) => { | ||
| 550 | + const res = response.data; | ||
| 551 | + const code = res.code; | ||
| 552 | + const msg = res.msg; | ||
| 553 | + if (code !== '200'){ | ||
| 554 | + return this.$message.error(msg); | ||
| 555 | + } | ||
| 556 | + this.$message.success(`订单删除成功`); | ||
| 557 | + this.getList(); | ||
| 558 | + }).catch(error => { | ||
| 559 | + this.$message.error(error.toString()) | ||
| 560 | + }) | ||
| 561 | + }, | ||
| 562 | + // 订单批量删除 | ||
| 563 | + batchDelOrderByBeans(){ | ||
| 564 | + if (this.selectedRows.length!==0){ | ||
| 565 | + batchDelOrderByBeans(this.selectedRows).then((response) => { | ||
| 566 | + const res = response.data; | ||
| 567 | + const code = res.code; | ||
| 568 | + const msg = res.msg; | ||
| 569 | + const data = res.data; | ||
| 570 | + if (code !== '200'){ | ||
| 571 | + const errMsg = `${msg}${data}`; | ||
| 572 | + this.$message.error(errMsg); | ||
| 573 | + return; | ||
| 574 | + } | ||
| 575 | + this.$message.success("订单批量删除成功"); | ||
| 576 | + this.getList(); | ||
| 577 | + }).catch(error => { | ||
| 578 | + this.$message.error(error.toString()); | ||
| 579 | + }) | ||
| 580 | + }else { | ||
| 581 | + this.$message.error('请勾选需要删除的订单信息!'); | ||
| 582 | + } | ||
| 583 | + }, | ||
| 535 | //订单列表查询 | 584 | //订单列表查询 | 
| 536 | getList(){ | 585 | getList(){ | 
| 537 | if(this.value2 !== null && this.value2 !== ""){ | 586 | 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> | 
- 
请 注册 或 登录 后发表评论