Răsfoiți Sursa

修复编辑出现的id不能为空问题

pm 1 an în urmă
părinte
comite
6fbc461787

+ 7 - 6
src/views/mes/hw/information/index.vue

@@ -90,7 +90,7 @@
             v-for="dict in this.workshopOption"
             :key="dict.workshopId"
             :label="dict.workshopName"
-            :value="dict.workshopCode"
+            :value="dict.workshopName"
           />
         </el-select>
       </el-form-item>
@@ -501,7 +501,7 @@ export default {
       value2: "",
       // 新增状态
       radio: 3,
-      repairId:null,//修改判断
+      EditId:0,//修改判断
     };
   },
   created() {
@@ -547,6 +547,7 @@ export default {
         return item.workshopCode==val?item.workshopId:null;
       })
       this.form.workshopId=workshopId.workshopId
+      this.form.workshopName=workshopId.workshopName
     },
     // 取消按钮
     cancel() {
@@ -592,8 +593,8 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      this.repairId = row.id || this.ids;
-      getHardwareInfo(this.repairId).then((response) => {
+      this.EditId = row.id || this.ids;
+      getHardwareInfo(this.EditId).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "编辑硬件信息";
@@ -601,10 +602,10 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-
       this.$refs["form"].validate((valid) => {
         if (valid) {
-          if (this.repairId != null) {
+
+          if (this.EditId != 0) {
             updateHardware(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;

+ 2 - 2
src/views/mes/hw/type/index.vue

@@ -249,7 +249,7 @@ export default {
       form: {
         parentTypeId:0
       },
-      EditId:null,//编辑传递id
+      EditId:0,//编辑传递id
       // 表单校验
       rules: {
         hardwareTypeCode: [
@@ -332,7 +332,7 @@ export default {
     submitForm() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
-          if (this.EditId != null) {
+          if (this.EditId != 0) {
             updateHardware(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;