Kaynağa Gözat

解决报错

qinhb 6 ay önce
ebeveyn
işleme
4dc214fcc8

+ 0 - 1
src/views/plan/order/index.vue

@@ -376,7 +376,6 @@ option.value = {
       type: "select", //类型为下拉选择框
       width: 100,
       overHidden: true,
-      editDisabled: true,
       dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_type,
       props: {
         label: "dictLabel",

+ 69 - 39
src/views/plan/workOrder/index.vue

@@ -576,8 +576,15 @@ const routeInfo = (value) => {
   form.value.processRouteCode = value.processRouteCode;
   form.value.processRouteName = value.processRouteName;
   form.value.processRouteVersion = value.processRouteVersion;
-  option.value.column[11].dicData = value.opGroups;
-  option.value.column[11].disabled = false;
+  option.value.column.forEach(item=>{
+    if(item.prop === 'opGroup'){
+        item.dicData = value.opGroups;
+        item.disabled = false;
+    }
+    if(item.prop === 'opType'){
+      item.disabled = false;
+    }
+  })
   dialog1.visible = false;
 };
 // 传入一个url,后面不带/
@@ -718,43 +725,6 @@ option.value = Object.assign(option.value, {
       },
     },
     {
-      label: "工序分组",
-      prop: "opType",
-      width: "100",
-      type: "select", //类型为下拉选择框
-      dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.op_group,
-      props: {
-        label: "dictLabel",
-        value: "dictValue",
-      },
-      change: ({ value, column }) => {
-        if (value === "2") {
-          //form.value.opGroup = "-"
-          option.value.column[11].display = false;
-          option.value.column[12].display = false;
-        } else {
-          //form.value.opGroup =
-          option.value.column[11].disabled = false;
-          option.value.column[11].display = true;
-          if (value === "1") {
-            option.value.column[12].display = true;
-          } else {
-            option.value.column[12].display = false;
-          }
-        }
-        if (column.boxType === "edit") {
-          option.value.column[11].dicData = form.value.opGroups;
-        }
-      },
-      rules: [
-        {
-          required: true,
-          message: "工序分组不能为空",
-          trigger: "trigger",
-        },
-      ],
-    },
-    {
       label: "工艺路线",
       prop: "processRouteName",
       width: 125,
@@ -780,6 +750,7 @@ option.value = Object.assign(option.value, {
         }
       },
       change: ({ value, column }) => {
+        //form.value.opType = ''
         if (column.boxType) {
           if (value != form.value.processRouteName) {
             dialog1.visible = true;
@@ -788,6 +759,65 @@ option.value = Object.assign(option.value, {
       },
     },
     {
+      label: "工序分组",
+      prop: "opType",
+      width: "100",
+      disabled: true,
+      type: "select", //类型为下拉选择框
+      dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.op_group,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      change: ({ value, column }) => {
+        option.value.column.forEach(item=>{
+          if(value){
+            if (column.boxType === "edit") {
+              if (item.prop === 'opGroup'){
+                item.dicData = form.value.opGroups;
+              }
+              if (item.prop === 'opType'){
+                item.disabled =false
+              }
+
+            }
+            if(item.prop === 'frontWorkOrderCode' || item.prop === 'opGroup'){
+              if(value === '2'){
+                item.display = false;
+              }
+              if(item.prop === 'opGroup'){
+                if(value === '1'){
+                  item.display = true;
+                  item.disabled = false
+                }
+                if(value === '0'){
+                  item.display = true;
+                  item.disabled = false
+                }
+              }
+              if(item.prop === 'frontWorkOrderCode'){
+                if(value === '1'){
+                  item.display = true;
+                  item.disabled = false
+                }
+                if(value === '0'){
+                  item.display = false;
+                  item.disabled = false
+                }
+              }
+            }
+          }
+        })
+      },
+      rules: [
+        {
+          required: true,
+          message: "工序分组不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
       label: "分组标识",
       prop: "opGroup",
       width: "100",