|
@@ -1,8 +1,9 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<by-bill ref="bill" :propConfig="config" @search="search" @onSmt="onSmt" @onAdd="onAdd" @onDelete="onDelete"
|
|
|
- @onDispatch="onDispatch" @onRefresh="onRefresh" @detail="openEdit" @onSave="onSave" @clickTab="clickTab"
|
|
|
- @onChangeRow="onChangeRow" @pagination="pagination" @getSupplierModal="getSupplierModal">
|
|
|
+ @onDispatch="onDispatch" @onRefresh="resert" @detail="openEdit" @onSave="onSave" @clickTab="clickTab"
|
|
|
+ @onChangeRow="onChangeRow" @pagination="pagination" @onReturnSmt="onReturnSmt2"
|
|
|
+ @getSupplierModal="getSupplierModal" @resert="resert">
|
|
|
</by-bill>
|
|
|
<!-- 选择物料 -->
|
|
|
<productModal ref="product" :mulit="true" @confirm="confirmProduct" />
|
|
@@ -22,8 +23,10 @@
|
|
|
// 左边
|
|
|
tabType : any = 'all';
|
|
|
isAdd : any = false
|
|
|
- pageSize : any = 15
|
|
|
supplierSelectData : any = {}
|
|
|
+ baseInfo : any = {}
|
|
|
+ isSubmit : any = false
|
|
|
+ isChange : any = false
|
|
|
// 右边
|
|
|
supplierInfo : any = {} // 机构信息
|
|
|
tableData : any = []
|
|
@@ -361,7 +364,7 @@
|
|
|
}, {
|
|
|
name: '反提交',
|
|
|
event: {
|
|
|
- click: (item : any) => (this as any).returnSmt(item)
|
|
|
+ click: (item : any) => (this as any).onReturnSmt(item)
|
|
|
}
|
|
|
}]
|
|
|
}
|
|
@@ -840,49 +843,9 @@
|
|
|
this.getDataList()
|
|
|
}, 500)
|
|
|
}
|
|
|
- // 工具栏提交
|
|
|
- onSmt(e : any) {
|
|
|
- console.log('提交 ==>', e);
|
|
|
- let selectData = (this.$refs.bill as any).getTableSelectData(this.tabType); // 获取表格选中数据
|
|
|
- if (selectData.length <= 0) return this.$message.warning('请选择提交数据');
|
|
|
- if (selectData.length > 1) return this.$message.warning('只能提交一条数据');
|
|
|
- this.$confirm('确定提交吗!', '注意', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- center: true
|
|
|
- }).then(() => {
|
|
|
- api.submitTo({ id: selectData[0].id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success('提交成功');
|
|
|
- this.clickTab(this.tabType);
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
- }).catch(() => this.$message.info('已取消提交'));
|
|
|
- }
|
|
|
- // 操作反提交
|
|
|
- returnSmt(e : any) {
|
|
|
- console.log('反提交 ==>', e);
|
|
|
- this.$confirm('确定反提交吗!', '注意', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- center: true
|
|
|
- }).then(() => {
|
|
|
- // let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
|
|
|
- if (this.tabType === 'smt') {
|
|
|
- api.cancelSubmission({ id: e.id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success('反提交成功');
|
|
|
- this.clickTab(this.tabType);
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
- }
|
|
|
- }).catch(() => this.$message.info('已取消反提交'));
|
|
|
- }
|
|
|
// 保存
|
|
|
- onSave(e : any) {
|
|
|
- console.log('保存 ==>', this.tabType);
|
|
|
+ onSave() {
|
|
|
+ console.log('保存tabType ==>', this.tabType);
|
|
|
(this as any).$refs.bill.$refs.billForm.validate().then(() => {
|
|
|
let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
|
|
|
// 供应商数据
|
|
@@ -902,32 +865,27 @@
|
|
|
// 表格删除
|
|
|
query.suborderList.map((v : any, i : any) => {
|
|
|
if (v.isDeleted === 1 && !v.id) {
|
|
|
- v.splice(i, 1)
|
|
|
+ query.suborderList.splice(i, 1)
|
|
|
}
|
|
|
});
|
|
|
if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
|
|
|
console.log('保存参数query ==> ', query);
|
|
|
|
|
|
if (this.isAdd) {
|
|
|
- query.submitState = 0
|
|
|
- console.log('保存进草稿箱 ==>', query);
|
|
|
- api.msave(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ api.saveList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
- this.$message.success(res.msg);
|
|
|
+ this.$message.success('保存成功');
|
|
|
this.getDataList();
|
|
|
(this.$refs.bill as any).showTab = 'all';
|
|
|
(this.$refs.bill as any).setBillFormValue({});
|
|
|
} else this.$message.error(res.msg);
|
|
|
})
|
|
|
} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
|
- if (this.tabType === 'draftsBox') query.submitState = 0;
|
|
|
- console.log('保存 ==>', query);
|
|
|
api.updateList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
- this.$message.success(res.msg);
|
|
|
- this.getDataList();
|
|
|
- (this.$refs.bill as any).showTab = 'all';
|
|
|
- (this.$refs.bill as any).setBillFormValue({});
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ this.isChange = false;
|
|
|
+ this.isSubmit = true;
|
|
|
} else this.$message.error(res.msg);
|
|
|
})
|
|
|
};
|
|
@@ -936,7 +894,7 @@
|
|
|
}
|
|
|
// 打开新增
|
|
|
onAdd(e : any) {
|
|
|
- console.log('新增 ==>', e);
|
|
|
+ console.log('新增tabType ==>', this.tabType);
|
|
|
if (e === 'billTable_0') {
|
|
|
(this.$refs.product as any).setShow(true); // 打开sku弹窗
|
|
|
let obj = (this.$refs.bill as any).getBillFormValue();
|
|
@@ -962,9 +920,10 @@
|
|
|
// 打开编辑
|
|
|
openEdit(e : any) {
|
|
|
e = e.row ? e.row : e;
|
|
|
- console.log('编辑this.tabType ==>', this.tabType);
|
|
|
+ this.baseInfo = e;
|
|
|
+ console.log('编辑tabType ==>', this.tabType);
|
|
|
console.log('编辑 ==>', e);
|
|
|
- if (e.sourceType == '手工输入' || this.tabType === 'draftsBox') {
|
|
|
+ if (this.tabType != 'smt' && e.sourceType == '手工输入' || this.tabType === 'draftsBox') {
|
|
|
if (this.tabType === 'all' && e.submitState === 1) return this.setReadonly(e);
|
|
|
let data = e.suborderList
|
|
|
data.map((v : any, i : any) => {
|
|
@@ -1008,24 +967,141 @@
|
|
|
let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
readonly.form.attr.readonly = true; // 设置只读
|
|
|
readonly.tool.tools = {};
|
|
|
+ if (this.tabType === 'smt') readonly.tool.tools = { returnSmt: true };
|
|
|
readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
|
|
|
readonly.tableConfig[0].tool.tools = {};
|
|
|
- console.log(readonly.tableConfig[0].table.columns.slice(0, -1));
|
|
|
let data = e.suborderList;
|
|
|
(this.$refs.bill as any).setBillConfig(readonly);
|
|
|
(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
|
|
|
(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
|
|
|
this.isAdd = false;
|
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
|
-
|
|
|
+ }
|
|
|
+ // 工具栏提交
|
|
|
+ onSmt(e : any) {
|
|
|
+ if (e === 'draftsBox') {
|
|
|
+ let selectData = (this.$refs.bill as any).getTableSelectData('draftsBox'); // 获取表格选中数据
|
|
|
+ if (selectData.length <= 0) return this.$message.warning('请选择提交数据');
|
|
|
+ if (selectData.length > 1) return this.$message.warning('只能提交一条数据');
|
|
|
+ this.$confirm('确定提交吗!', '注意', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ api.submitTo({ id: selectData[0].id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success('提交成功');
|
|
|
+ this.clickTab('draftsBox');
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
+ })
|
|
|
+ }).catch(() => this.$message.info('已取消提交'));
|
|
|
+ } else {
|
|
|
+ console.log('isChange ==> ', this.isChange);
|
|
|
+ console.log('isSubmit ==> ', this.isSubmit);
|
|
|
+ if (this.isSubmit) {
|
|
|
+ this.$confirm('确定提交吗!', '注意', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ api.submitTo({ id: this.baseInfo.id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success('提交成功');
|
|
|
+ this.clickTab(this.tabType);
|
|
|
+ this.isSubmit = false;
|
|
|
+ (this.$refs.bill as any).showTab = this.tabType;
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
+ })
|
|
|
+ }).catch(() => this.$message.info('已取消提交'));
|
|
|
+ } else {
|
|
|
+ // 表单旧数据
|
|
|
+ let oldbillForm : any = (this as any).$lodash.cloneDeep(this.baseInfo);
|
|
|
+ if (oldbillForm.suborderList) delete oldbillForm.suborderList;
|
|
|
+ oldbillForm = JSON.stringify(oldbillForm);
|
|
|
+ // 表单新数据
|
|
|
+ let newBillForm : any = (this as any).$refs.bill.getBillFormValue();
|
|
|
+ if (newBillForm.suborderList) delete newBillForm.suborderList;
|
|
|
+ newBillForm = JSON.stringify(newBillForm);
|
|
|
+ // 表格旧数据
|
|
|
+ this.baseInfo.suborderList.map((v : any) => {
|
|
|
+ if (v._X_ROW_KEY) delete v._X_ROW_KEY;
|
|
|
+ });
|
|
|
+ let oldData : any = JSON.stringify(this.baseInfo.suborderList);
|
|
|
+ // 表格新数据
|
|
|
+ let newData : any = JSON.stringify((this as any).$refs.bill.getBillTableData(0));
|
|
|
+ // 数据有变进保存
|
|
|
+ if (this.isChange || oldbillForm != newBillForm || oldData != newData) {
|
|
|
+ return this.$message.warning('数据变更必须先保存再提交');
|
|
|
+ } else {
|
|
|
+ this.$confirm('确定提交吗!', '注意', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ // console.log(this.baseInfo.id);
|
|
|
+ api.submitTo({ id: this.baseInfo.id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success('提交成功');
|
|
|
+ this.clickTab(this.tabType);
|
|
|
+ (this.$refs.bill as any).showTab = this.tabType;
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
+ })
|
|
|
+ }).catch(() => this.$message.info('已取消提交'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 操作反提交
|
|
|
+ onReturnSmt(e : any) {
|
|
|
+ console.log('反提交 ==>', e);
|
|
|
+ this.$confirm('确定反提交吗!', '注意', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ if (this.tabType === 'smt') {
|
|
|
+ api.cancelSubmission({ id: e.id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success('反提交成功');
|
|
|
+ this.clickTab(this.tabType);
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(() => this.$message.info('已取消反提交'));
|
|
|
+ }
|
|
|
+ // 工具栏反提交
|
|
|
+ onReturnSmt2() {
|
|
|
+ console.log('工具栏反提交 ==>', this.baseInfo);
|
|
|
+ this.$confirm('确定反提交吗!', '注意', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ if (this.tabType === 'smt') {
|
|
|
+ api.cancelSubmission({ id: this.baseInfo.id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success('反提交成功');
|
|
|
+ this.clickTab(this.tabType);
|
|
|
+ (this.$refs.bill as any).showTab = 'smt';
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(() => this.$message.info('已取消反提交'));
|
|
|
}
|
|
|
// 获取机构数据
|
|
|
getSupplierModal(e : any) {
|
|
|
- console.log('获取机构数据 ==> ', e);
|
|
|
+ // console.log('获取机构数据 ==> ', e);
|
|
|
this.supplierInfo = e;
|
|
|
}
|
|
|
// 监听表格数据变化
|
|
|
onChangeRow(e : any) {
|
|
|
+ this.isChange = true;
|
|
|
+ this.isSubmit = false;
|
|
|
e.realityPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
|
|
|
e.totalPrice = e.realityPrice - e.prePrice;
|
|
|
}
|
|
@@ -1035,17 +1111,13 @@
|
|
|
goodsData = goodsData.map((item : any) => {
|
|
|
item.materialName = item.skuTitle
|
|
|
item.prePrice = 0
|
|
|
- // item.materialId = item.materialId
|
|
|
item.unitPrice = item.price
|
|
|
item.materialSku = item.id
|
|
|
const { id, ...newData } = item
|
|
|
- // const { skuTitle, price, id, materialId, ...newData } = item
|
|
|
return newData
|
|
|
})
|
|
|
this.tableData = this.tableData.concat(goodsData);
|
|
|
newArr = this.tableData.reduce((prev : any, current : any) => {
|
|
|
- // console.log('prev ==> ', prev);
|
|
|
- // console.log('current ==> ', current);
|
|
|
obj[current.materialSku] ? contents.push(current.materialName) : (obj[current.materialSku] = true && prev.push(current))
|
|
|
return prev
|
|
|
}, []);
|
|
@@ -1066,7 +1138,7 @@
|
|
|
console.log('派单 ==>', e);
|
|
|
this.supplierSelectData = (this.$refs.bill as any).getTableSelectData(this.tabType); // 获取表格选中数据
|
|
|
if (this.supplierSelectData.length <= 0) return this.$message.warning('请选择派单数据');
|
|
|
- if (this.supplierSelectData.length >1) return this.$message.warning('只能派单一条数据');
|
|
|
+ if (this.supplierSelectData.length > 1) return this.$message.warning('只能派单一条数据');
|
|
|
(this.$refs.supplierModal as any).setShow(true);
|
|
|
}
|
|
|
// 派单确认
|
|
@@ -1088,13 +1160,12 @@
|
|
|
}
|
|
|
// 切换tab栏
|
|
|
clickTab(e : any) {
|
|
|
- console.log('切换tab ==> ', e);
|
|
|
this.tabType = e;
|
|
|
// submitState: 提交状态
|
|
|
- if (e === 'all') this.getPageList({ pageSize: this.pageSize, pageNo: 1 }, 'all'); // 草稿箱数据
|
|
|
+ if (e === 'all') this.getPageList({}, 'all'); // 综合数据
|
|
|
if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
|
if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
|
- if (e === 'recycleBin') this.getSelectDeleteList({ pageNo: 1, pageSize: this.pageSize }); // 回收站数据
|
|
|
+ if (e === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
|
|
|
}
|
|
|
// 初始化
|
|
|
getDataList() {
|
|
@@ -1106,22 +1177,35 @@
|
|
|
return
|
|
|
}
|
|
|
clearInterval(this.timer)
|
|
|
- this.getPageList({ pageSize: this.pageSize, pageNo: 1 }, 'all'); // 综合数据
|
|
|
+ this.getPageList({}, 'all'); // 综合数据
|
|
|
+ }
|
|
|
+ // 获取分页数据
|
|
|
+ getPageList(query : any, type : any) {
|
|
|
+ api.pageList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ (this.$refs.bill as any).setTabTableValue(type, res.data.records);
|
|
|
+ let page = {
|
|
|
+ pageNo: res.data.current, //当前页
|
|
|
+ pageSize: res.data.size, //每页条数
|
|
|
+ total: res.data.total //总条数
|
|
|
+ };
|
|
|
+ (this.$refs.bill as any).setTablePage(type, page)
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
+ })
|
|
|
}
|
|
|
// 分页
|
|
|
pagination(e : any) {
|
|
|
- console.log('分页 ==> ', e);
|
|
|
- let query : any = {
|
|
|
- pageNo: e.page.pageNum,
|
|
|
- pageSize: this.pageSize,
|
|
|
- };
|
|
|
+ let query : any = (this as any).$refs.bill.getSearchValue(e.type);
|
|
|
+ query.pageNo = e.page.pageNum;
|
|
|
+ query.pageSize = e.page.pageSize;
|
|
|
+ console.log('分页 ==> ', query);
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
|
if (e.type === 'recycleBin') {
|
|
|
api.selectDeleteList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
|
|
|
loading.close()
|
|
|
- } else this.failHandle(res)
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
});
|
|
|
} else {
|
|
|
console.log(this.tabType);
|
|
@@ -1131,24 +1215,9 @@
|
|
|
if (res.code === 200) {
|
|
|
(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
|
|
|
loading.close()
|
|
|
- } else this.failHandle(res)
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
- // 获取分页数据
|
|
|
- getPageList(query : any, type : any) {
|
|
|
- api.pageList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- (this.$refs.bill as any).setTabTableValue(type, res.data.records);
|
|
|
- let page = {
|
|
|
- pageNo: res.data.current, //当前页
|
|
|
- pageSize: this.pageSize, //每页条数
|
|
|
- total: res.data.total //总条数
|
|
|
- };
|
|
|
- (this.$refs.bill as any).setTablePage(type, page)
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
}
|
|
|
// 回收站数据
|
|
|
getSelectDeleteList(query : any) {
|
|
@@ -1157,17 +1226,17 @@
|
|
|
(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
|
|
|
let page = {
|
|
|
pageNo: res.data.current, //当前页
|
|
|
- pageSize: this.pageSize, //每页条数
|
|
|
+ pageSize: res.data.size, //每页条数
|
|
|
total: res.data.total //总条数
|
|
|
};
|
|
|
(this.$refs.bill as any).setTablePage('recycleBin', page)
|
|
|
- } else this.failHandle(res)
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
});
|
|
|
}
|
|
|
// 搜索
|
|
|
search(parames : any) {
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
|
- let query = parames.value
|
|
|
+ let query = parames.value;
|
|
|
if (parames.type === 'draftsBox') query.submitState = 0 // 草稿箱数据
|
|
|
if (parames.type === 'smt') query.submitState = 1 // 已提交数据
|
|
|
console.log('搜索 ==> ', query);
|
|
@@ -1179,14 +1248,14 @@
|
|
|
loading.close()
|
|
|
}
|
|
|
}
|
|
|
- // 刷新
|
|
|
- onRefresh(e : any) {
|
|
|
- console.log('刷新 ==>', e);
|
|
|
- (this as any).$refs.bill.$refs[e].resert();
|
|
|
- if (e === 'all') this.getPageList({}, 'all'); // 综合查询
|
|
|
- if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
|
- if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
|
- if (e === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
|
|
|
+ // 刷新/重置
|
|
|
+ resert(e : any) {
|
|
|
+ let data:any = e.type ? e.type : e;
|
|
|
+ (this as any).$refs.bill.$refs[data].clearSearch();
|
|
|
+ if (data === 'all') this.getPageList({}, 'all'); // 综合数据
|
|
|
+ if (data === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
|
+ if (data === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
|
+ if (data === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
|
|
|
}
|
|
|
// 单据表格删除
|
|
|
changeTable(item : any) {
|
|
@@ -1208,24 +1277,23 @@
|
|
|
onDelete(e : any) {
|
|
|
console.log('工具栏删除 ==> ', e);
|
|
|
let selectData = (this.$refs.bill as any).getTableSelectData(e)
|
|
|
- let ids = '';
|
|
|
+ let ids : any = [];
|
|
|
if (selectData.length > 0) {
|
|
|
selectData.map((v : any) => {
|
|
|
- ids += v.id + ','
|
|
|
+ ids.push(v.id)
|
|
|
})
|
|
|
} else return this.$message({ type: 'warning', message: '请选择删除数据' })
|
|
|
- ids = ids.slice(0, ids.length - 1);
|
|
|
this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
center: true
|
|
|
}).then(() => {
|
|
|
- api.deleteList({ ids: ids }, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ api.deleteList(ids, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
this.clickTab(this.tabType);
|
|
|
this.$message.success('删除成功!');
|
|
|
- } else this.failHandle(res)
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
})
|
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
|
}
|
|
@@ -1241,14 +1309,9 @@
|
|
|
if (res.code === 200) {
|
|
|
this.clickTab(this.tabType);
|
|
|
this.$message.success('删除成功!');
|
|
|
- } else this.failHandle(res)
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
})
|
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
|
}
|
|
|
- // 运行错误
|
|
|
- failHandle(err : any) {
|
|
|
- let msg = err.msg ? err.msg : '运行错误!';
|
|
|
- this.$message.error(msg)
|
|
|
- }
|
|
|
}
|
|
|
</script>
|