From 1b26350d02670ee5c1033a9b4e03540e75ef97f6 Mon Sep 17 00:00:00 2001
From: yuejiayang <146344614+YangLei105@users.noreply.github.com>
Date: Thu, 19 Sep 2024 11:57:19 +0800
Subject: [PATCH] =?UTF-8?q?2024.9.18=20=E4=B8=80=E3=80=81=E7=89=A9?=
=?UTF-8?q?=E6=96=99=E6=88=90=E6=9C=AC=E4=BF=A1=E6=81=AF=E7=BB=B4=E6=8A=A4?=
=?UTF-8?q?=EF=BC=88=E7=AC=AC=E4=BA=8C=E7=89=88=EF=BC=89=20=E4=BA=8C?=
=?UTF-8?q?=E3=80=81=E5=8A=A0=E5=B7=A5=E4=B8=AD=E5=BF=83=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E6=94=B9=E9=80=A0=20=E4=B8=89=E3=80=81=E6=A0=87=E5=87=86?=
=?UTF-8?q?=E5=B7=A5=E5=BA=8F=EF=BC=88=E7=AC=AC=E4=BA=8C=E7=89=88=EF=BC=89?=
=?UTF-8?q?=20=E5=9B=9B=E3=80=81=E5=95=86=E5=93=81=E7=BB=84=20-=20?=
=?UTF-8?q?=E6=A0=87=E5=87=86=E5=B7=A5=E5=BA=8F=EF=BC=88=E7=AC=AC=E4=BA=8C?=
=?UTF-8?q?=E7=89=88=EF=BC=89=20=E4=BA=94=E3=80=81=E5=95=86=E5=93=81?=
=?UTF-8?q?=E7=BB=84=20-=20Process=20Time=20Matrix=EF=BC=88=E7=AC=AC?=
=?UTF-8?q?=E4=B8=80=E7=89=88=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../part/partProductGroupInformation.vue | 87 +++++++++++++------
.../modules/part/standardRoutingOperation.vue | 32 ++++---
2 files changed, 76 insertions(+), 43 deletions(-)
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 = ''
}
},