|
@@ -880,25 +880,27 @@
|
|
|
});
|
|
|
if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
|
|
|
console.log('保存参数query ==> ', query);
|
|
|
-
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
if (this.isAdd) {
|
|
|
api.saveList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
+ loading.close();
|
|
|
this.isAdd = false;
|
|
|
this.isChange = false;
|
|
|
this.isSubmit = true;
|
|
|
this.$message.success('保存成功');
|
|
|
this.dataId = res.data;
|
|
|
} else this.$message.error(res.msg);
|
|
|
- })
|
|
|
+ }).catch(() => loading.close());
|
|
|
} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
|
api.updateList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
+ loading.close();
|
|
|
this.$message.success('保存成功');
|
|
|
this.isChange = false;
|
|
|
this.isSubmit = true;
|
|
|
} else this.$message.error(res.msg);
|
|
|
- })
|
|
|
+ }).catch(() => loading.close());
|
|
|
};
|
|
|
|
|
|
})
|
|
@@ -928,11 +930,11 @@
|
|
|
openEdit(e : any) {
|
|
|
e = e.row ? e.row : e;
|
|
|
// console.log('编辑tabType ==>', this.tabType);
|
|
|
- // console.log('编辑 ==>', e);
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
|
api.single({ id: e.id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
let parentData = res.data ? res.data : e;
|
|
|
+ console.log('编辑 ==>', parentData);
|
|
|
this.baseInfo = parentData;
|
|
|
if (parentData.sourceType === '手工输入') {
|
|
|
// 已提交
|
|
@@ -1081,7 +1083,7 @@
|
|
|
(this.$refs.bill as any).showTab = this.tabType;
|
|
|
loading.close();
|
|
|
} else this.$message.error(res.msg)
|
|
|
- })
|
|
|
+ }).catch(() => loading.close());
|
|
|
}).catch(() => this.$message.info('已取消提交'));
|
|
|
}
|
|
|
}
|
|
@@ -1097,15 +1099,13 @@
|
|
|
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);
|
|
|
- loading.close();
|
|
|
- } else this.$message.error(res.msg)
|
|
|
- })
|
|
|
- }
|
|
|
+ api.cancelSubmission({ id: e.id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success('反提交成功');
|
|
|
+ this.clickTab(this.tabType);
|
|
|
+ loading.close();
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
+ }).catch(() => loading.close());
|
|
|
}).catch(() => this.$message.info('已取消反提交'));
|
|
|
}
|
|
|
// 工具栏反提交
|
|
@@ -1117,17 +1117,15 @@
|
|
|
type: 'warning',
|
|
|
center: true
|
|
|
}).then(() => {
|
|
|
- if (this.tabType === 'smt') {
|
|
|
- let loading = this.$loading({ target: '.main-container' });
|
|
|
- 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';
|
|
|
- loading.close();
|
|
|
- } else this.$message.error(res.msg)
|
|
|
- })
|
|
|
- }
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
+ 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';
|
|
|
+ loading.close();
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
+ }).catch(() => loading.close());
|
|
|
}).catch(() => this.$message.info('已取消反提交'));
|
|
|
}
|
|
|
// 获取机构数据
|
|
@@ -1143,21 +1141,27 @@
|
|
|
e.totalPrice = e.realityPrice - e.prePrice;
|
|
|
}
|
|
|
// 派单
|
|
|
- onDispatch(e : any) {
|
|
|
- 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('只能派单一条数据');
|
|
|
- (this.$refs.supplierModal as any).setShow(true);
|
|
|
+ onDispatch() {
|
|
|
+ let query = (this.$refs.bill as any).getTableSelectData(this.tabType); // 获取表格选中数据
|
|
|
+ console.log('派单 ==>', query);
|
|
|
+ if (query.length <= 0) return this.$message.warning('请选择派单数据');
|
|
|
+ if (query.length > 1) return this.$message.warning('只能派单一条数据');
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
+ api.single({ id: query[0].id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ loading.close();
|
|
|
+ this.supplierSelectData = res.data;
|
|
|
+ (this.$refs.supplierModal as any).setShow(true);
|
|
|
+ }
|
|
|
+ }).catch(() => loading.close());
|
|
|
}
|
|
|
// 派单确认
|
|
|
confirmSupplier(e : any) {
|
|
|
if (e.length > 0) {
|
|
|
- console.log(e);
|
|
|
- console.log(this.supplierSelectData);
|
|
|
- let query : any = (this as any).$lodash.cloneDeep(this.supplierSelectData)[0];
|
|
|
+ let query : any = (this as any).$lodash.cloneDeep(this.supplierSelectData);
|
|
|
query.organizationName = e[0].name;
|
|
|
query.organizationId = e[0].id;
|
|
|
+ console.log(query);
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
|
api.updateList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
@@ -1166,7 +1170,7 @@
|
|
|
(this.$refs.bill as any).showTab = 'all';
|
|
|
loading.close();
|
|
|
} else this.$message.error(res.msg);
|
|
|
- })
|
|
|
+ }).catch(() => loading.close());
|
|
|
}
|
|
|
}
|
|
|
// 切换tab栏
|
|
@@ -1198,6 +1202,7 @@
|
|
|
}
|
|
|
// 获取分页数据
|
|
|
getPageList(query : any, type : any) {
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
api.pageList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
(this.$refs.bill as any).setTabTableValue(type, res.data.records);
|
|
@@ -1206,9 +1211,10 @@
|
|
|
pageSize: res.data.size, //每页条数
|
|
|
total: res.data.total //总条数
|
|
|
};
|
|
|
- (this.$refs.bill as any).setTablePage(type, page)
|
|
|
+ (this.$refs.bill as any).setTablePage(type, page);
|
|
|
+ loading.close();
|
|
|
} else this.$message.error(res.msg)
|
|
|
- })
|
|
|
+ }).catch(() => loading.close());
|
|
|
}
|
|
|
// 分页
|
|
|
pagination(e : any) {
|
|
@@ -1222,7 +1228,7 @@
|
|
|
(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
|
|
|
loading.close();
|
|
|
} else this.$message.error(res.msg)
|
|
|
- });
|
|
|
+ }).catch(() => loading.close());
|
|
|
} else {
|
|
|
console.log(e.type);
|
|
|
if (e.type == 'draftsBox') query.submitState = 0; // 草稿箱数据
|
|
@@ -1232,7 +1238,7 @@
|
|
|
(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
|
|
|
loading.close();
|
|
|
} else this.$message.error(res.msg)
|
|
|
- })
|
|
|
+ }).catch(() => loading.close());
|
|
|
}
|
|
|
}
|
|
|
// 回收站数据
|
|
@@ -1367,7 +1373,7 @@
|
|
|
this.$message.success('删除成功!');
|
|
|
loading.close();
|
|
|
} else this.$message.error(res.msg)
|
|
|
- })
|
|
|
+ }).catch(() => loading.close());
|
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
|
}
|
|
|
// 操作删除
|
|
@@ -1385,7 +1391,7 @@
|
|
|
this.$message.success('删除成功!');
|
|
|
loading.close();
|
|
|
} else this.$message.error(res.msg)
|
|
|
- })
|
|
|
+ }).catch(() => loading.close());
|
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
|
}
|
|
|
}
|