From eb90e1587b6aef76fea05aa3f9bd59b2e93edeab Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 10 Apr 2024 14:14:59 +0800 Subject: [PATCH] =?UTF-8?q?2024-4-10=20=E8=AE=BE=E5=A4=87=E6=A8=A1?= =?UTF-8?q?=E5=9D=97-=E8=AE=BE=E5=A4=87=E5=8A=A0=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E3=80=81=E7=BB=84=E7=BA=BF=E9=97=AE=E9=A2=98+=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=B7=A1=E6=A3=80=E7=82=B9=E6=A3=80=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/device/inspectionPlan/index.vue | 2 +- src/views/device/spotCheckPlan/index.vue | 2 +- src/views/wms/equipment/index.vue | 131 ++++++++++++++++++++-- 3 files changed, 124 insertions(+), 11 deletions(-) diff --git a/src/views/device/inspectionPlan/index.vue b/src/views/device/inspectionPlan/index.vue index 8271e281..f4e42354 100644 --- a/src/views/device/inspectionPlan/index.vue +++ b/src/views/device/inspectionPlan/index.vue @@ -904,7 +904,7 @@ export default { for (let i = 0; i < response.data.length; i++) { this.personList.push({ label: response.data[i].nickName + '(' + response.data[i].userName + ')', - key: response.data[i].userName, + key: response.data[i].userId, }) } }); diff --git a/src/views/device/spotCheckPlan/index.vue b/src/views/device/spotCheckPlan/index.vue index 47b5d03b..3af934db 100644 --- a/src/views/device/spotCheckPlan/index.vue +++ b/src/views/device/spotCheckPlan/index.vue @@ -949,7 +949,7 @@ export default { for (let i = 0; i < response.data.length; i++) { this.personList.push({ label: response.data[i].nickName + '(' + response.data[i].userName + ')', - key: response.data[i].userName, + key: response.data[i].userId, }) } }); diff --git a/src/views/wms/equipment/index.vue b/src/views/wms/equipment/index.vue index a95206f5..dd799af6 100644 --- a/src/views/wms/equipment/index.vue +++ b/src/views/wms/equipment/index.vue @@ -59,7 +59,6 @@ /> - + + + + + + + + + + + + + + + + + + - + - + @@ -875,7 +922,7 @@ form.equipmentTypeName }} {{ - form.workCenter + form.workshopName }} {{ form.workshopCode @@ -907,6 +954,9 @@ {{ form.equipmentCategory }} + {{ + form.factoryWorkshop + }} 设备使用状况 @@ -1130,6 +1180,7 @@ export default { "equ_type", "equipment_status", "equipment_category", + "factory_workshop", ], components: { ItemSelectPerson, ItemEquipment, ItemWXRecords, ItemBYRecords }, data() { @@ -1263,6 +1314,7 @@ export default { equipmentLocation: null, hourlyUnitPrice: null, equipmentCategory: null, + factoryWorkshop: null, }, queryEquipmentHeadParams: { pageNum: 1, @@ -1333,6 +1385,8 @@ export default { equipmentCategory: [ { required: true, message: "设备类别不能为空", trigger: "blur" }, ], + sapName: [], + sapCode: [], }, }; }, @@ -1346,7 +1400,26 @@ export default { this.sparePartsList(); this.selectEquipmentTypeDept(); }, + methods: { + //监听设备类型是不是组线 + changeHandler(value) { + console.log("监听设备类型是不是组线",value); + if (value == "1") { + this.rules.sapCode.push({ + required: true, + // message: "当设备类别为组线时,Sap编码不能为空", + }); + this.rules.sapName.push({ + required: true, + // message: "当设备类别为组线时,Sap名称不能为空", + }); + } + else { + this.rules.sapCode.pop(); + this.rules.sapName.pop(); + } + }, // 填写维修记录步骤上一步 stepLast() { this.repairRecordSteps--; @@ -1466,6 +1539,7 @@ export default { unitMeasurement: null, sapCode: null, sapName: null, + factoryWorkshop: null, }; this.resetForm("form"); }, @@ -1617,6 +1691,14 @@ export default { }); this.form.barCodeFileList = newFiles; } + if (this.form.equipmentCategory == "1") { + this.rules.sapCode.push({ + required: true, + }); + this.rules.sapName.push({ + required: true, + }); + } this.form.workCenter = this.form.workshopCode; this.repairRecordSteps = 0; this.queryAuxiliaryEquipmentParams.equipmentCode = null; @@ -1679,12 +1761,39 @@ export default { if (this.form.equipmentId != null) { this.form.rightData = this.rightList; this.form.auxiliaryEquipmentRightData = - this.auxiliaryEquipmentRightList; - updateEquipment(this.form).then((response) => { + this.auxiliaryEquipmentRightList; + //修改提示 + if (this.form.equipmentCode == null) { + this.$message.error( + "【设备基础信息】设备编码为空,请填写设备编码!" + ); + } else if (this.form.equipmentName == null) { + this.$message.error( + "【设备基础信息】设备编名称为空,请填写设备名称!" + ); + } else if (this.form.status == null) { + this.$message.error( + "【设备使用状况】设备状态为空,请选择设备状态!" + ); + } else if (this.form.equipmentTypeCode == null) { + this.$message.error( + "【设备基础信息】设备类型为空,请选择设备类型!" + ); + } else if (this.form.equipmentCategory == null) { + this.$message.error( + "【设备基础信息】设备类别为空,请选择设备类别!" + ); + }else if (this.form.equipmentCategory == "1" && (this.form.sapName == null ||this.form.sapCode == null)) { + this.$message.error( + "【设备基础信息】Sap编码、Sap名称有空值,请填写!" + ); + }else{ + updateEquipment(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); + } } else { if (this.form.equipmentCode == null) { this.$message.error( @@ -1706,6 +1815,10 @@ export default { this.$message.error( "【设备基础信息】设备类别为空,请选择设备类别!" ); + }else if (this.form.equipmentCategory == "1" && (this.form.sapName == null ||this.form.sapCode == null)) { + this.$message.error( + "【设备基础信息】Sap编码、Sap名称有空值,请填写!" + ); } else { this.form.auxiliaryEquipmentRightData = this.auxiliaryEquipmentRightList;