作者 唐俊升

跨境电商-新增根据主单号删除数据按钮

@@ -33,6 +33,8 @@ export const zfeldImportDeclare = params => { return http.postExcelData(`${baseS @@ -33,6 +33,8 @@ export const zfeldImportDeclare = params => { return http.postExcelData(`${baseS
33 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删除订单信息 34 // 根据guid删除订单信息
35 export const deleteOrderByGuid = params => {return axios.get(`${baseServiceURL2}/ExportOrder/deleteByGuid`, {params: params}); }; 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});}
36 // 根据guid列表批量删除订单信息 38 // 根据guid列表批量删除订单信息
37 export const batchDelOrderByBeans = params =>{return http.post(`${baseServiceURL2}/ExportOrder/deleteByBeans`,params); }; 39 export const batchDelOrderByBeans = params =>{return http.post(`${baseServiceURL2}/ExportOrder/deleteByBeans`,params); };
38 // 导入订单文件到minio 40 // 导入订单文件到minio
@@ -74,6 +74,9 @@ @@ -74,6 +74,9 @@
74 <el-form-item> 74 <el-form-item>
75 <el-button size="medium" @click="batchDelOrderByBeans" type="danger">批量删除</el-button> 75 <el-button size="medium" @click="batchDelOrderByBeans" type="danger">批量删除</el-button>
76 </el-form-item> 76 </el-form-item>
  77 + <el-form-item>
  78 + <el-button size="medium" @click="batchDelExt2" type="danger">主单号批量删除</el-button>
  79 + </el-form-item>
77 </el-form> 80 </el-form>
78 </div> 81 </div>
79 <div style="margin-bottom: 20px"> 82 <div style="margin-bottom: 20px">
@@ -154,6 +157,7 @@ @@ -154,6 +157,7 @@
154 row-key="id" 157 row-key="id"
155 stripe 158 stripe
156 > 159 >
  160 + <el-table-column type="index" label="序号" width="50" align="center"/>
157 <el-table-column prop="itemno" label="企业商品货号" /> 161 <el-table-column prop="itemno" label="企业商品货号" />
158 <el-table-column prop="itemname" label="企业商品名称" /> 162 <el-table-column prop="itemname" label="企业商品名称" />
159 <el-table-column prop="itemdescribe" label="企业商品描述" /> 163 <el-table-column prop="itemdescribe" label="企业商品描述" />
@@ -212,12 +216,12 @@ @@ -212,12 +216,12 @@
212 <el-table-column 216 <el-table-column
213 fixed="right" 217 fixed="right"
214 label="操作" 218 label="操作"
215 - width="180" 219 + width="200"
216 show-overflow-tooltip> 220 show-overflow-tooltip>
217 <template slot-scope="scope"> 221 <template slot-scope="scope">
218 <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>
219 <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>
220 - <el-button type="text" size="small" @click="deleteOrderByGuid(scope.row)">删除</el-button> 224 + <el-button type="text" size="small" @click="deleteOrderByGuid(scope.row)">订单删除</el-button>
221 </template> 225 </template>
222 </el-table-column> 226 </el-table-column>
223 </el-table> 227 </el-table>
@@ -238,7 +242,7 @@ @@ -238,7 +242,7 @@
238 <script> 242 <script>
239 import {sendOrder,selectLists,batchOrder,batchOrderImport,eldhBatchDeclare,eldhImportDeclare, 243 import {sendOrder,selectLists,batchOrder,batchOrderImport,eldhBatchDeclare,eldhImportDeclare,
240 eldBatchDeclare,eldImportDeclare,zfeldBatchDeclare,zfeldImportDeclare,deleteOrderByGuid, 244 eldBatchDeclare,eldImportDeclare,zfeldBatchDeclare,zfeldImportDeclare,deleteOrderByGuid,
241 - batchDelOrderByBeans} from '../../api/consigner/exportOrder' 245 + batchDelOrderByBeans,batchDelExt2} from '../../api/consigner/exportOrder'
242 export default { 246 export default {
243 data() { 247 data() {
244 return { 248 return {
@@ -545,6 +549,11 @@ @@ -545,6 +549,11 @@
545 }, 549 },
546 // 订单删除 550 // 订单删除
547 deleteOrderByGuid(row){ 551 deleteOrderByGuid(row){
  552 + this.$confirm('此操作将永久删除该订单, 是否继续?', '提示', {
  553 + confirmButtonText: '确定',
  554 + cancelButtonText: '取消',
  555 + type: 'warning'
  556 + }).then(() => {
548 const guid = row.guid; 557 const guid = row.guid;
549 deleteOrderByGuid({guid}).then((response) => { 558 deleteOrderByGuid({guid}).then((response) => {
550 const res = response.data; 559 const res = response.data;
@@ -558,10 +567,49 @@ @@ -558,10 +567,49 @@
558 }).catch(error => { 567 }).catch(error => {
559 this.$message.error(error.toString()) 568 this.$message.error(error.toString())
560 }) 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 + })
561 }, 601 },
562 // 订单批量删除 602 // 订单批量删除
563 batchDelOrderByBeans(){ 603 batchDelOrderByBeans(){
564 - if (this.selectedRows.length!==0){ 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(() => {
565 batchDelOrderByBeans(this.selectedRows).then((response) => { 613 batchDelOrderByBeans(this.selectedRows).then((response) => {
566 const res = response.data; 614 const res = response.data;
567 const code = res.code; 615 const code = res.code;
@@ -577,9 +625,7 @@ @@ -577,9 +625,7 @@
577 }).catch(error => { 625 }).catch(error => {
578 this.$message.error(error.toString()); 626 this.$message.error(error.toString());
579 }) 627 })
580 - }else {  
581 - this.$message.error('请勾选需要删除的订单信息!');  
582 - } 628 + })
583 }, 629 },
584 //订单列表查询 630 //订单列表查询
585 getList(){ 631 getList(){