|
@@ -820,8 +820,8 @@
|
|
(this.$refs.bill as any).setBillFormValue(parentData[0]); // 设置单据表单数据
|
|
(this.$refs.bill as any).setBillFormValue(parentData[0]); // 设置单据表单数据
|
|
(this.$refs.bill as any).setBillTableValue(parentData[0].suborderList, 0);// 设置第1张单据表格数据
|
|
(this.$refs.bill as any).setBillTableValue(parentData[0].suborderList, 0);// 设置第1张单据表格数据
|
|
}, 0)
|
|
}, 0)
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ } else loading.close();
|
|
|
|
+ }).catch(() => loading.close());
|
|
}
|
|
}
|
|
// 获取机构数据
|
|
// 获取机构数据
|
|
getSupplierModal(e : any) {
|
|
getSupplierModal(e : any) {
|
|
@@ -862,12 +862,15 @@
|
|
});
|
|
});
|
|
if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
|
|
if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
|
|
console.log('出库参数query ==> ', query);
|
|
console.log('出库参数query ==> ', query);
|
|
|
|
+
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
if (this.isAdd) {
|
|
if (this.isAdd) {
|
|
query.suborderList.map((v : any) => {
|
|
query.suborderList.map((v : any) => {
|
|
delete v.id;
|
|
delete v.id;
|
|
});
|
|
});
|
|
delete query.id;
|
|
delete query.id;
|
|
api.outbound(query, 'supplyOutOrder').then((res : any) => {
|
|
api.outbound(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.isAdd = false;
|
|
this.isAdd = false;
|
|
this.isChange = false;
|
|
this.isChange = false;
|
|
@@ -875,18 +878,19 @@
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
this.dataId = res.data;
|
|
this.dataId = res.data;
|
|
} else this.$message.error(res.msg);
|
|
} else this.$message.error(res.msg);
|
|
- })
|
|
|
|
|
|
+ }).catch(() => loading.close());
|
|
} else {
|
|
} else {
|
|
query.submitState = 0;
|
|
query.submitState = 0;
|
|
api.updateList(query, 'supplyOutOrder').then((res : any) => {
|
|
api.updateList(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
this.isChange = false;
|
|
this.isChange = false;
|
|
this.isSubmit = true;
|
|
this.isSubmit = true;
|
|
} else this.$message.error(res.msg);
|
|
} else this.$message.error(res.msg);
|
|
- })
|
|
|
|
|
|
+ }).catch(() => loading.close());
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
}
|
|
}
|
|
// 切换tab栏
|
|
// 切换tab栏
|
|
@@ -916,15 +920,15 @@
|
|
console.log('编辑this.tabType ==>', this.tabType);
|
|
console.log('编辑this.tabType ==>', this.tabType);
|
|
console.log('编辑 ==>', e);
|
|
console.log('编辑 ==>', e);
|
|
e = e.row ? e.row : e;
|
|
e = e.row ? e.row : e;
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
api.single({ id: e.id }, 'supplyOutOrder').then((res : any) => {
|
|
api.single({ id: e.id }, 'supplyOutOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
let parentData = res.data ? res.data : e;
|
|
let parentData = res.data ? res.data : e;
|
|
this.baseInfo = parentData;
|
|
this.baseInfo = parentData;
|
|
if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
- let loading = this.$loading({ target: '.main-container' });
|
|
|
|
if (parentData.submitState === 1) {
|
|
if (parentData.submitState === 1) {
|
|
- loading.close();
|
|
|
|
- return this.setReadonly(parentData)
|
|
|
|
|
|
+ this.setReadonly(parentData)
|
|
|
|
+ return loading.close();
|
|
}
|
|
}
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
if (billConfig.tableConfig[0].table.columns.at(-1).title != '操作') {
|
|
if (billConfig.tableConfig[0].table.columns.at(-1).title != '操作') {
|
|
@@ -974,13 +978,13 @@
|
|
this.dataId = '';
|
|
this.dataId = '';
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
loading.close();
|
|
loading.close();
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ } else loading.close();
|
|
|
|
+ }).catch(() => loading.close());
|
|
} else {
|
|
} else {
|
|
this.setReadonly(parentData);
|
|
this.setReadonly(parentData);
|
|
};
|
|
};
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ }).catch(() => loading.close());
|
|
}
|
|
}
|
|
// 设置只读
|
|
// 设置只读
|
|
setReadonly(e : any) {
|
|
setReadonly(e : any) {
|
|
@@ -1004,6 +1008,7 @@
|
|
console.log('array', array);
|
|
console.log('array', array);
|
|
// 查库存
|
|
// 查库存
|
|
api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
|
|
api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
let newData : any = []
|
|
let newData : any = []
|
|
res.data.map((v : any, i : any) => {
|
|
res.data.map((v : any, i : any) => {
|
|
@@ -1016,9 +1021,8 @@
|
|
(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
this.isAdd = false;
|
|
this.isAdd = false;
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
- loading.close();
|
|
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ }).catch(() => loading.close());
|
|
}
|
|
}
|
|
// 工具栏提交
|
|
// 工具栏提交
|
|
onSmt(e : any) {
|
|
onSmt(e : any) {
|
|
@@ -1032,12 +1036,14 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
api.submitTo({ id: selectData[0].id }, 'supplyOutOrder').then((res : any) => {
|
|
api.submitTo({ id: selectData[0].id }, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('提交成功');
|
|
this.$message.success('提交成功');
|
|
this.clickTab('draftsBox');
|
|
this.clickTab('draftsBox');
|
|
} else this.$message.error(res.msg)
|
|
} else this.$message.error(res.msg)
|
|
- })
|
|
|
|
|
|
+ }).catch(() => loading.close());
|
|
}).catch(() => this.$message.info('已取消提交'));
|
|
}).catch(() => this.$message.info('已取消提交'));
|
|
} else {
|
|
} else {
|
|
if (this.isAdd) return this.$message.warning('新增数据必须先保存才能提交');
|
|
if (this.isAdd) return this.$message.warning('新增数据必须先保存才能提交');
|
|
@@ -1050,14 +1056,15 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
api.submitTo({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
|
|
api.submitTo({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('提交成功');
|
|
this.$message.success('提交成功');
|
|
- this.clickTab(this.tabType);
|
|
|
|
this.isSubmit = false;
|
|
this.isSubmit = false;
|
|
- (this.$refs.bill as any).showTab = this.tabType;
|
|
|
|
|
|
+ this.clickTab(this.tabType);
|
|
} else this.$message.error(res.msg)
|
|
} else this.$message.error(res.msg)
|
|
- })
|
|
|
|
|
|
+ }).catch(() => loading.close());
|
|
}).catch(() => this.$message.info('已取消提交'));
|
|
}).catch(() => this.$message.info('已取消提交'));
|
|
} else {
|
|
} else {
|
|
// 表单旧数据
|
|
// 表单旧数据
|
|
@@ -1086,14 +1093,15 @@
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
let id = this.dataId ? this.dataId : this.baseInfo.id;
|
|
let id = this.dataId ? this.dataId : this.baseInfo.id;
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
api.submitTo({ id: id }, 'supplyOutOrder').then((res : any) => {
|
|
api.submitTo({ id: id }, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('提交成功');
|
|
this.$message.success('提交成功');
|
|
- this.clickTab(this.tabType);
|
|
|
|
this.dataId = '';
|
|
this.dataId = '';
|
|
- (this.$refs.bill as any).showTab = this.tabType;
|
|
|
|
|
|
+ this.clickTab(this.tabType);
|
|
} else this.$message.error(res.msg)
|
|
} else this.$message.error(res.msg)
|
|
- })
|
|
|
|
|
|
+ }).catch(() => loading.close());
|
|
}).catch(() => this.$message.info('已取消提交'));
|
|
}).catch(() => this.$message.info('已取消提交'));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1108,12 +1116,14 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
api.cancelSubmission({ id: e.id }, 'supplyOutOrder').then((res : any) => {
|
|
api.cancelSubmission({ id: e.id }, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('反提交成功');
|
|
this.$message.success('反提交成功');
|
|
this.clickTab(this.tabType);
|
|
this.clickTab(this.tabType);
|
|
} else this.$message.error(res.msg)
|
|
} else this.$message.error(res.msg)
|
|
- })
|
|
|
|
|
|
+ }).catch(() => loading.close());
|
|
}).catch(() => this.$message.info('已取消反提交'));
|
|
}).catch(() => this.$message.info('已取消反提交'));
|
|
}
|
|
}
|
|
// 工具栏反提交
|
|
// 工具栏反提交
|
|
@@ -1125,12 +1135,14 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
api.cancelSubmission({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
|
|
api.cancelSubmission({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('反提交成功');
|
|
this.$message.success('反提交成功');
|
|
this.clickTab(this.tabType);
|
|
this.clickTab(this.tabType);
|
|
} else this.$message.error(res.msg)
|
|
} else this.$message.error(res.msg)
|
|
- })
|
|
|
|
|
|
+ }).catch(() => loading.close());
|
|
}).catch(() => this.$message.info('已取消反提交'));
|
|
}).catch(() => this.$message.info('已取消反提交'));
|
|
}
|
|
}
|
|
// 初始化
|
|
// 初始化
|
|
@@ -1149,6 +1161,7 @@
|
|
getCitationList(query : any) {
|
|
getCitationList(query : any) {
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
|
|
api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
(this.$refs.bill as any).setSourceTableData(0, res.data.records);
|
|
(this.$refs.bill as any).setSourceTableData(0, res.data.records);
|
|
let page = {
|
|
let page = {
|
|
@@ -1156,14 +1169,18 @@
|
|
pageSize: res.data.size, //每页条数
|
|
pageSize: res.data.size, //每页条数
|
|
total: res.data.total //总条数
|
|
total: res.data.total //总条数
|
|
};
|
|
};
|
|
- loading.close();
|
|
|
|
(this.$refs.bill as any).setSourcePage(0, page);
|
|
(this.$refs.bill as any).setSourcePage(0, page);
|
|
- } else this.failHandle(res)
|
|
|
|
- })
|
|
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ }).catch(() => loading.close());
|
|
}
|
|
}
|
|
// 获取分页数据
|
|
// 获取分页数据
|
|
getPageList(query : any, type : any) {
|
|
getPageList(query : any, type : any) {
|
|
|
|
+ let data = (this.$refs.bill as any).getTablePage(this.tabType);
|
|
|
|
+ query.pageNo = data.pageNo;
|
|
|
|
+ query.pageSize = data.pageSize;
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
api.pageList(query, 'supplyOutOrder').then((res : any) => {
|
|
api.pageList(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
(this.$refs.bill as any).setTabTableValue(type, res.data.records);
|
|
(this.$refs.bill as any).setTabTableValue(type, res.data.records);
|
|
let page = {
|
|
let page = {
|
|
@@ -1172,22 +1189,8 @@
|
|
total: res.data.total //总条数
|
|
total: res.data.total //总条数
|
|
};
|
|
};
|
|
(this.$refs.bill as any).setTablePage(type, page);
|
|
(this.$refs.bill as any).setTablePage(type, page);
|
|
- } else this.failHandle(res)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- // 回收站数据
|
|
|
|
- getSelectDeleteList(query : any) {
|
|
|
|
- api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- (this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
|
|
|
|
- let page = {
|
|
|
|
- pageNo: res.data.current, //当前页
|
|
|
|
- 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)
|
|
|
|
+ }).catch(() => loading.close());
|
|
}
|
|
}
|
|
// 分页
|
|
// 分页
|
|
pagination(e : any) {
|
|
pagination(e : any) {
|
|
@@ -1198,37 +1201,49 @@
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
if (e.type === 'recycleBin') {
|
|
if (e.type === 'recycleBin') {
|
|
api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
|
|
api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
|
|
(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
|
|
- loading.close()
|
|
|
|
- } else this.failHandle(res)
|
|
|
|
- });
|
|
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ }).catch(() => loading.close());
|
|
} else {
|
|
} else {
|
|
api.pageList(query, 'supplyOutOrder').then((res : any) => {
|
|
api.pageList(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
|
|
(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
|
|
- loading.close()
|
|
|
|
- } else this.failHandle(res)
|
|
|
|
- })
|
|
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ }).catch(() => loading.close());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 回收站数据
|
|
|
|
+ getSelectDeleteList(query : any) {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
|
+ api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ (this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
|
|
|
|
+ let page = {
|
|
|
|
+ pageNo: res.data.current, //当前页
|
|
|
|
+ pageSize: res.data.size, //每页条数
|
|
|
|
+ total: res.data.total //总条数
|
|
|
|
+ };
|
|
|
|
+ (this.$refs.bill as any).setTablePage('recycleBin', page)
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ }).catch(() => loading.close());
|
|
|
|
+ }
|
|
// 搜索
|
|
// 搜索
|
|
search(parames : any) {
|
|
search(parames : any) {
|
|
- let loading = this.$loading({ target: '.main-container' });
|
|
|
|
console.log('搜索 ==> ', parames);
|
|
console.log('搜索 ==> ', parames);
|
|
let query = parames.value;
|
|
let query = parames.value;
|
|
if (parames.type === 'source_0') {
|
|
if (parames.type === 'source_0') {
|
|
this.getCitationList(query);
|
|
this.getCitationList(query);
|
|
- loading.close();
|
|
|
|
} else {
|
|
} else {
|
|
if (parames.type === 'recycleBin') {
|
|
if (parames.type === 'recycleBin') {
|
|
this.getSelectDeleteList(query); // 回收站分页数据
|
|
this.getSelectDeleteList(query); // 回收站分页数据
|
|
- loading.close();
|
|
|
|
} else {
|
|
} else {
|
|
if (parames.type === 'draftsBox') query.submitState = 0;// 草稿箱数据
|
|
if (parames.type === 'draftsBox') query.submitState = 0;// 草稿箱数据
|
|
if (parames.type === 'smt') query.submitState = 1; // 已提交数据
|
|
if (parames.type === 'smt') query.submitState = 1; // 已提交数据
|
|
this.getPageList(query, parames.type) // 获取分页数据
|
|
this.getPageList(query, parames.type) // 获取分页数据
|
|
- loading.close();
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1335,12 +1350,14 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
api.deleteList({ ids: ids }, 'supplyOutOrder').then((res : any) => {
|
|
api.deleteList({ ids: ids }, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
|
+ this.$message.success('删除成功');
|
|
this.clickTab(this.tabType);
|
|
this.clickTab(this.tabType);
|
|
- this.$message.success('删除成功!');
|
|
|
|
- } else this.failHandle(res)
|
|
|
|
- })
|
|
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ }).catch(() => loading.close());
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
}
|
|
}
|
|
// 操作删除
|
|
// 操作删除
|
|
@@ -1351,18 +1368,15 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
api.deleteList({ ids: item.id }, 'supplyOutOrder').then((res : any) => {
|
|
api.deleteList({ ids: item.id }, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
|
+ this.$message.success('删除成功');
|
|
this.clickTab(this.tabType);
|
|
this.clickTab(this.tabType);
|
|
- this.$message.success('删除成功!');
|
|
|
|
- } else this.failHandle(res)
|
|
|
|
- })
|
|
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ }).catch(() => loading.close());
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
}
|
|
}
|
|
- // 运行错误
|
|
|
|
- failHandle(err : any) {
|
|
|
|
- let msg = err.msg ? err.msg : '运行错误!';
|
|
|
|
- this.$message.error(msg)
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|