diff --git a/src/views/modules/part/partProductGroupInformation.vue b/src/views/modules/part/partProductGroupInformation.vue
index ef5658e..05424c4 100644
--- a/src/views/modules/part/partProductGroupInformation.vue
+++ b/src/views/modules/part/partProductGroupInformation.vue
@@ -417,10 +417,10 @@
+
+
+
-
-
-
@@ -860,10 +860,10 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601006,
- serialNumber: '601006Table2LaborCycleTime',
+ serialNumber: '601006Table2MachCycleTime',
tableId: "601006Table2",
tableName: "标准工序表",
- columnProp: 'laborCycleTime',
+ columnProp: 'machCycleTime',
headerAlign: "center",
align: "right",
columnLabel: '机器处理时间',
@@ -879,10 +879,10 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601006,
- serialNumber: '601006Table2MachCycleTime',
+ serialNumber: '601006Table2LaborCycleTime',
tableId: "601006Table2",
tableName: "标准工序表",
- columnProp: 'machCycleTime',
+ columnProp: 'laborCycleTime',
headerAlign: "center",
align: "right",
columnLabel: '人工处理时间',
@@ -898,10 +898,10 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601006,
- serialNumber: '601006Table2LaborRunFactor',
+ serialNumber: '601006Table2MachRunFactor',
tableId: "601006Table2",
tableName: "标准工序表",
- columnProp: 'laborRunFactor',
+ columnProp: 'machRunFactor',
headerAlign: "center",
align: "right",
columnLabel: '机器单位产出',
@@ -917,10 +917,10 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601006,
- serialNumber: '601006Table2MachRunFactor',
+ serialNumber: '601006Table2LaborRunFactor',
tableId: "601006Table2",
tableName: "标准工序表",
- columnProp: 'machRunFactor',
+ columnProp: 'laborRunFactor',
headerAlign: "center",
align: "right",
columnLabel: '人工单位产出',
@@ -1630,7 +1630,9 @@ export default {
this.ptmSaveFlag = true
},
- saveProductGroupPtm () {
+ async saveProductGroupPtm () {
+ // 确保 modelBlur 完成
+ await this.modelBlur(219);
if (this.ptmModalData.conditionDesc === '' || this.ptmModalData.conditionDesc == null) {
this.$message.warning('请填写条件描述!')
return
@@ -1639,6 +1641,12 @@ export default {
this.$message.warning('请选择属性模板!')
return
}
+ if (this.ptmModalData.itemDesc === '' || this.ptmModalData.itemDesc == null) {
+ this.$alert('该属性模板不存在!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return
+ }
let tempData = {
site: this.productGroupCurrentRow.site,
buNo: this.productGroupCurrentRow.buNo,
@@ -1776,30 +1784,57 @@ export default {
this.ptmConditionProcessUpdateFlag = false
},
+ // 机器单位产出改变
+ changeMachRunFactor (row) {
+ row.laborRunFactor = row.machRunFactor
+ },
+
+ // 机器处理时间改变
+ changeMachCycleTime (row) {
+ // 人工处理时间赋值
+ row.laborCycleTime = row.machCycleTime
+ // 计算机器单位产出
+ row.machRunFactor = 1/row.machCycleTime
+ // 人工单位产出赋值
+ row.laborRunFactor = row.machRunFactor
+ },
+
+ // 人工处理时间改变
+ changeLaborCycleTime (row) {
+ // 计算人工单位产出
+ row.laborRunFactor = 1/row.laborCycleTime
+ },
+
// 属性输入校验
- modelBlur (tagNo) {
+ async modelBlur(tagNo) {
if (this.ptmModalData.itemNo != null && this.ptmModalData.itemNo !== '') {
let tempData = {
tagno: tagNo,
- conditionSql: " and code_no = '" + this.ptmModalData.itemNo + "'" + " and site = '" + this.productGroupConditionCurrentRow.bu.split('_')[0] + "'" + " and bu_no = '" + this.productGroupConditionCurrentRow.bu.split('_')[1] + "'"
- }
- verifyData(tempData).then(({data}) => {
+ conditionSql: " and code_no = '" + this.ptmModalData.itemNo + "'" +
+ " and site = '" + this.productGroupConditionCurrentRow.bu.split('_')[0] + "'" +
+ " and bu_no = '" + this.productGroupConditionCurrentRow.bu.split('_')[1] + "'"
+ };
+
+ // 返回 Promise
+ return verifyData(tempData).then(({ data }) => {
if (data && data.code === 0) {
if (data.baseListData.length > 0) {
- this.ptmModalData.itemDesc = data.baseListData[0].code_desc
+ this.ptmModalData.itemDesc = data.baseListData[0].code_desc;
} else {
- this.$alert('该属性模板不存在!', '错误', {
- confirmButtonText: '确定'
- })
- this.ptmModalData.itemNo = ''
- this.ptmModalData.itemDesc = ''
+ this.ptmModalData.itemDesc = '';
}
} else {
- this.$message.warning(data.msg)
- this.ptmModalData.itemNo = ''
- this.ptmModalData.itemDesc = ''
+ this.$message.warning(data.msg);
+ this.ptmModalData.itemDesc = '';
}
- })
+ }).catch(error => {
+ console.error(error);
+ this.$message.error('校验失败,请重试');
+ this.ptmModalData.itemDesc = '';
+ });
+ } else {
+ this.ptmModalData.itemDesc = '';
+ return Promise.resolve(); // 如果 itemNo 为空,直接返回 resolved Promise
}
},
diff --git a/src/views/modules/part/standardRoutingOperation.vue b/src/views/modules/part/standardRoutingOperation.vue
index a3f56ee..60eb18f 100644
--- a/src/views/modules/part/standardRoutingOperation.vue
+++ b/src/views/modules/part/standardRoutingOperation.vue
@@ -733,7 +733,9 @@ export default {
return
}
if (this.modalData.workCenterDesc === '' || this.modalData.workCenterDesc == null) {
- this.$message.warning('请填写加工中心名称!')
+ this.$alert('该加工中心不存在,请重新输入加工中心编码!', '提示', {
+ confirmButtonText: '确定'
+ })
return
}
if (this.modalData.laborClassNo === '' || this.modalData.laborClassNo == null) {
@@ -741,7 +743,9 @@ export default {
return
}
if (this.modalData.laborClassDesc === '' || this.modalData.laborClassDesc == null) {
- this.$message.warning('请填写人员等级!')
+ this.$alert('当前BU下人员等级编码不存在,请重新输入人员等级编码!', '提示', {
+ confirmButtonText: '确定'
+ })
return
}
if (this.modalData.setupLaborClassNo === '' || this.modalData.setupLaborClassNo == null) {
@@ -749,7 +753,9 @@ export default {
return
}
if (this.modalData.setupLaborClassDesc === '' || this.modalData.setupLaborClassDesc == null) {
- this.$message.warning('请填写调机时人员等级!')
+ this.$alert('当前BU下调机时人员等级编码不存在,请重新输入调机时人员等级编码!', '提示', {
+ confirmButtonText: '确定'
+ })
return
}
if (this.modalData.flag === '1') {
@@ -830,18 +836,15 @@ export default {
if (data.baseListData.length > 0) {
this.modalData.workCenterDesc = data.baseListData[0].work_center_desc
} else {
- this.$alert('该加工中心不存在,请重新输入加工中心编码!', '提示', {
- confirmButtonText: '确定'
- })
- this.modalData.workCenterNo = ''
this.modalData.workCenterDesc = ''
}
} else {
this.$message.warning(data.msg)
- this.modalData.workCenterNo = ''
this.modalData.workCenterDesc = ''
}
})
+ } else {
+ this.modalData.workCenterDesc = ''
}
},
@@ -857,10 +860,6 @@ export default {
if (data.baseListData.length > 0) {
this.modalData.setupLaborClassDesc = data.baseListData[0].class_desc
} else {
- this.$alert('该调机时人员等级不存在,请重新输入调机时人员等级编码!', '提示', {
- confirmButtonText: '确定'
- })
- this.modalData.setupLaborClassNo = ''
this.modalData.setupLaborClassDesc = ''
}
} else {
@@ -869,6 +868,8 @@ export default {
this.modalData.setupLaborClassDesc = ''
}
})
+ } else {
+ this.modalData.setupLaborClassDesc = ''
}
},
@@ -884,18 +885,15 @@ export default {
if (data.baseListData.length > 0) {
this.modalData.laborClassDesc = data.baseListData[0].class_desc
} else {
- this.$alert('该人员等级不存在,请重新输入人员等级编码!', '提示', {
- confirmButtonText: '确定'
- })
- this.modalData.laborClassNo = ''
this.modalData.laborClassDesc = ''
}
} else {
this.$message.warning(data.msg)
- this.modalData.laborClassNo = ''
this.modalData.laborClassDesc = ''
}
})
+ }else {
+ this.modalData.laborClassDesc = ''
}
},