作者 唐俊升

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

... ... @@ -33,6 +33,8 @@ export const zfeldImportDeclare = params => { return http.postExcelData(`${baseS
export const billNoStatistics = params => { return axios.get(`${baseServiceURL2}/ExportListDeclaration/billNoStatistics`, { params: params }); };
// 根据guid删除订单信息
export const deleteOrderByGuid = params => {return axios.get(`${baseServiceURL2}/ExportOrder/deleteByGuid`, {params: params}); };
//根据主单号批量删除订单信息
export const batchDelExt2 = params => {return axios.get(`${baseServiceURL2}/ExportOrder/batchDelExt2`, {params: params});}
// 根据guid列表批量删除订单信息
export const batchDelOrderByBeans = params =>{return http.post(`${baseServiceURL2}/ExportOrder/deleteByBeans`,params); };
// 导入订单文件到minio
... ...
... ... @@ -74,6 +74,9 @@
<el-form-item>
<el-button size="medium" @click="batchDelOrderByBeans" type="danger">批量删除</el-button>
</el-form-item>
<el-form-item>
<el-button size="medium" @click="batchDelExt2" type="danger">主单号批量删除</el-button>
</el-form-item>
</el-form>
</div>
<div style="margin-bottom: 20px">
... ... @@ -154,6 +157,7 @@
row-key="id"
stripe
>
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="itemno" label="企业商品货号" />
<el-table-column prop="itemname" label="企业商品名称" />
<el-table-column prop="itemdescribe" label="企业商品描述" />
... ... @@ -212,12 +216,12 @@
<el-table-column
fixed="right"
label="操作"
width="180"
width="200"
show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" size="small" @click="sendorder(scope.row)">订单申报</el-button>
<el-button type="text" size="small" @click="sendDeclare(scope.row)">清单申报</el-button>
<el-button type="text" size="small" @click="deleteOrderByGuid(scope.row)">删除</el-button>
<el-button type="text" size="small" @click="deleteOrderByGuid(scope.row)">订单删除</el-button>
</template>
</el-table-column>
</el-table>
... ... @@ -238,7 +242,7 @@
<script>
import {sendOrder,selectLists,batchOrder,batchOrderImport,eldhBatchDeclare,eldhImportDeclare,
eldBatchDeclare,eldImportDeclare,zfeldBatchDeclare,zfeldImportDeclare,deleteOrderByGuid,
batchDelOrderByBeans} from '../../api/consigner/exportOrder'
batchDelOrderByBeans,batchDelExt2} from '../../api/consigner/exportOrder'
export default {
data() {
return {
... ... @@ -545,41 +549,83 @@
},
// 订单删除
deleteOrderByGuid(row){
const guid = row.guid;
deleteOrderByGuid({guid}).then((response) => {
const res = response.data;
const code = res.code;
const msg = res.msg;
if (code !== '200'){
return this.$message.error(msg);
}
this.$message.success(`订单删除成功`);
this.getList();
}).catch(error => {
this.$message.error(error.toString())
this.$confirm('此操作将永久删除该订单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const guid = row.guid;
deleteOrderByGuid({guid}).then((response) => {
const res = response.data;
const code = res.code;
const msg = res.msg;
if (code !== '200'){
return this.$message.error(msg);
}
this.$message.success(`订单删除成功`);
this.getList();
}).catch(error => {
this.$message.error(error.toString())
})
}).catch(() => {
});
},
// 根据主单号删除数据
batchDelExt2(){
if (this.selectedRows.length !== 1){
this.$message.error("此功能仅支持勾选一条数据");
return;
}
this.$confirm('此操作将永久批量删除所选主单号订单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const ext2 = this.selectedRows[0].ext2;
batchDelExt2({ext2}).then((response) => {
const res = response.data;
const code = res.code;
const msg = res.msg;
if (code !== '200'){
this.$message.error(msg);
return;
}
this.$message.success("批量删除成功");
this.getList();
}).catch(error=>{
this.$message.error(error.toString())
})
}).catch(() => {
})
},
// 订单批量删除
batchDelOrderByBeans(){
if (this.selectedRows.length!==0){
batchDelOrderByBeans(this.selectedRows).then((response) => {
const res = response.data;
const code = res.code;
const msg = res.msg;
const data = res.data;
if (code !== '200'){
const errMsg = `${msg}${data}`;
this.$message.error(errMsg);
return;
}
this.$message.success("订单批量删除成功");
this.getList();
}).catch(error => {
this.$message.error(error.toString());
})
}else {
this.$message.error('请勾选需要删除的订单信息!');
}
if (this.selectedRows.length===0){
this.$message.error('请勾选需要删除的订单信息!');
return;
}
this.$confirm('此操作将永久删除所选订单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
batchDelOrderByBeans(this.selectedRows).then((response) => {
const res = response.data;
const code = res.code;
const msg = res.msg;
const data = res.data;
if (code !== '200'){
const errMsg = `${msg}${data}`;
this.$message.error(errMsg);
return;
}
this.$message.success("订单批量删除成功");
this.getList();
}).catch(error => {
this.$message.error(error.toString());
})
})
},
//订单列表查询
getList(){
... ...