diff --git a/src/views/modules/part/partProductGroupInformation.vue b/src/views/modules/part/partProductGroupInformation.vue
index 05424c4..ba3f4aa 100644
--- a/src/views/modules/part/partProductGroupInformation.vue
+++ b/src/views/modules/part/partProductGroupInformation.vue
@@ -378,10 +378,10 @@
-
+
-
+
diff --git a/src/views/modules/part/standardRoutingOperation.vue b/src/views/modules/part/standardRoutingOperation.vue
index 60eb18f..23349e3 100644
--- a/src/views/modules/part/standardRoutingOperation.vue
+++ b/src/views/modules/part/standardRoutingOperation.vue
@@ -715,7 +715,10 @@ export default {
/**
* 分类信息新增/编辑
*/
- saveData () {
+ async saveData () {
+ await this.workCenterBlur(216)
+ await this.laborClassBlur(217)
+ await this.setupLaborClassBlur(217)
if (this.modalData.bu === '' || this.modalData.bu == null) {
this.$message.warning('请选择BU!')
return
@@ -825,13 +828,14 @@ export default {
},
// 加工中心输入校验
- workCenterBlur (tagNo) {
+ async workCenterBlur (tagNo) {
if (this.modalData.workCenterNo != null && this.modalData.workCenterNo !== '') {
let tempData = {
tagno: tagNo,
conditionSql: " and work_center_no = '" + this.modalData.workCenterNo + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
}
- verifyData(tempData).then(({data}) => {
+ // 返回 Promise
+ return verifyData(tempData).then(({ data }) => {
if (data && data.code === 0) {
if (data.baseListData.length > 0) {
this.modalData.workCenterDesc = data.baseListData[0].work_center_desc
@@ -842,20 +846,26 @@ export default {
this.$message.warning(data.msg)
this.modalData.workCenterDesc = ''
}
- })
+ }).catch(error => {
+ console.error(error);
+ this.$message.error('校验失败,请重试');
+ this.modalData.workCenterDesc = '';
+ });
} else {
this.modalData.workCenterDesc = ''
+ return Promise.resolve(); // 如果 itemNo 为空,直接返回 resolved Promise
}
},
// 人员等级描述
- setupLaborClassBlur (tagNo) {
+ async setupLaborClassBlur (tagNo) {
if (this.modalData.setupLaborClassNo != null && this.modalData.setupLaborClassNo !== '') {
let tempData = {
tagno: tagNo,
conditionSql: " and class_no = '" + this.modalData.setupLaborClassNo + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
}
- verifyData(tempData).then(({data}) => {
+ // 返回 Promise
+ return verifyData(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.baseListData.length > 0) {
this.modalData.setupLaborClassDesc = data.baseListData[0].class_desc
@@ -864,23 +874,27 @@ export default {
}
} else {
this.$message.warning(data.msg)
- this.modalData.setupLaborClassNo = ''
this.modalData.setupLaborClassDesc = ''
}
- })
+ }).catch(error => {
+ console.error(error);
+ this.$message.error('校验失败,请重试');
+ this.modalData.setupLaborClassDesc = '';
+ });
} else {
this.modalData.setupLaborClassDesc = ''
+ return Promise.resolve(); // 如果 itemNo 为空,直接返回 resolved Promise
}
},
// 人员等级描述
- laborClassBlur (tagNo) {
+ async laborClassBlur (tagNo) {
if (this.modalData.laborClassNo != null && this.modalData.laborClassNo !== '') {
let tempData = {
tagno: tagNo,
conditionSql: " and class_no = '" + this.modalData.laborClassNo + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
}
- verifyData(tempData).then(({data}) => {
+ return verifyData(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.baseListData.length > 0) {
this.modalData.laborClassDesc = data.baseListData[0].class_desc
@@ -891,9 +905,14 @@ export default {
this.$message.warning(data.msg)
this.modalData.laborClassDesc = ''
}
- })
+ }).catch(error => {
+ console.error(error);
+ this.$message.error('校验失败,请重试');
+ this.modalData.laborClassDesc = '';
+ });
}else {
this.modalData.laborClassDesc = ''
+ return Promise.resolve(); // 如果 itemNo 为空,直接返回 resolved Promise
}
},