Explorar el Código

1.提交工序管理修改;

zhaoxing hace 2 años
padre
commit
eed2e250de

+ 33 - 19
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/technologyMgr/index.vue

@@ -493,13 +493,14 @@ export default {
         (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == name
       );
       let n = no ? no[no.length - 1] : -2;
-      if (n == 0 || n == 1) {
+      obj["no"] = `OP${obj.xh}${n}`;
+      if (n == 0 || n == 1 || n == 3) {
         obj["type"] = `设备序`;
       }
-      if (n == 2 || n == 4) {
+      if (n == 2) {
         obj["type"] = `工序下料`;
       }
-      if (n == 6 || n == 8) {
+      if (n == 6) {
         obj["type"] = `工序上料`;
       }
       if (n == 5) {
@@ -518,6 +519,12 @@ export default {
         let xh = Math.ceil((i + 1) / 4);
 
         data[i].index = i + 1;
+        if (i == 0) {
+          data[i].no = `OP${i}5`;
+          data[i].type = `上料`;
+          data[i].name = `上料`;
+          data[i].content = `上料`;
+        }
       }
       data.sort((a, b) => a.xh - b.xh);
       this.firstLevelIndexArr = [];
@@ -656,45 +663,49 @@ export default {
               if (key == "name") {
                 obj[key] = `OP${xh}0上料`;
               }
-              obj.no = keys.find(
-                (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == "OP20上料"
-              );
+              // obj.no = keys.find(
+              //   (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == "OP20上料"
+              // );
+              obj.no = `OP${xh}6`;
             }
             if (i == 1) {
               if (key == "type") {
                 obj[key] = `设备序`;
               }
               obj.isinput = true;
-              obj.no = keys.find(
-                (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == "设备序"
-              );
+              // obj.no = keys.find(
+              //   (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == "设备序"
+              // );
+              obj.no = `OP${xh}0`;
             }
             if (i == 2) {
               if (key == "name") {
                 obj[key] = `清洗${xh}`;
               }
               obj.isadd = true;
-              obj.no = keys.find(
-                (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == "清洗"
-              );
+              // obj.no = keys.find(
+              //   (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == "清洗"
+              // );
+              obj.no = `OP${xh}1`;
             }
             if (i == 3) {
               if (key == "name") {
                 obj[key] = `OP${xh}0下料`;
               }
-              obj.no = keys.find(
-                (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == "OP10下料"
-              );
+              // obj.no = keys.find(
+              //   (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == "OP10下料"
+              // );
+              obj.no = `OP${xh}2`;
             }
             if (key == "sort") obj[key] = (item.sort || 101) - i - 1;
             let n = obj.no ? obj.no[obj.no.length - 1] : -2;
-            if (n == 0 || n == 1) {
+            if (n == 0 || n == 1 || n == 3) {
               obj["type"] = `设备序`;
             }
-            if (n == 2 || n == 4) {
+            if (n == 2) {
               obj["type"] = `工序下料`;
             }
-            if (n == 6 || n == 8) {
+            if (n == 6) {
               obj["type"] = `工序上料`;
             }
             if (n == 5) {
@@ -706,7 +717,7 @@ export default {
             if (n == 8) {
               obj["type"] = `热处理上料`;
             }
-            obj["no"] = `OP${xh}${i}`;
+            // obj["no"] = `OP${xh}${i}`;
             obj.content = obj.name;
           }
           this.tableData.data.push(obj);
@@ -728,6 +739,7 @@ export default {
         obj[key] = "";
         obj["type"] = `设备序`;
         obj["name"] = `打标`;
+        obj["no"] = `OP${xh}3`;
       }
       this.tableData.data.splice(index, 0, obj);
 
@@ -817,6 +829,8 @@ export default {
             let leng = res.data.length - 1;
             for (let index in res.data) {
               let item = res.data[index];
+              if (item.fieldName == "工序编码") item.readonly = "1";
+              if (item.fieldName == "类型") item.readonly = "1";
               // 需要加载数据的字段
               let str = "radio,checkbox,select,cascader";
               if (str.indexOf(item.formControlsType) > -1) {