Преглед изворни кода

Merge branch 'test-new' of https://git.agilestar.cn/spfm-group/spfm-market-front into test-new

molilang пре 3 година
родитељ
комит
05680171f1
1 измењених фајлова са 67 додато и 36 уклоњено
  1. 67 36
      src/pages/main/demandDevelop/index.vue

+ 67 - 36
src/pages/main/demandDevelop/index.vue

@@ -262,7 +262,7 @@
                 <template slot-scope="scope">
                   <el-input
                     v-model="scope.row.factoryName"
-                    :disabled="titname !== '审批'"
+                    :disabled="tableSatus === '4'"
                   ></el-input>
                 </template>
               </el-table-column>
@@ -270,7 +270,7 @@
                 <template slot-scope="scope">
                   <el-input
                     v-model="scope.row.workLoad"
-                    :disabled="titname !== '审批'"
+                    :disabled="tableSatus === '4'"
                   ></el-input>
                 </template>
               </el-table-column>
@@ -284,12 +284,14 @@
                   <el-button
                     size="mini"
                     type="primary"
+                    :disabled="tableSatus === '4'"
                     @click="choline(1, scope)"
                     >添加</el-button
                   >
                   <el-button
                     size="mini"
                     type="danger"
+                    :disabled="tableSatus === '4'"
                     @click="choline(2, scope)"
                     >删除</el-button
                   >
@@ -484,6 +486,7 @@ export default {
       file: [], // 附件数组
       titname: "",
       dialogStatus: false,
+      tableSatus: null,
       number: 0,
       // 按钮标识
       type: "",
@@ -646,7 +649,6 @@ export default {
         ) {
           this.infodatas = Array;
         } else {
-          console.log('adaadad')
           this.infodatas.push(...Array);
         }
       });
@@ -711,42 +713,56 @@ export default {
               this.handleConfirmOnline("2");
               break;
             case "保存":
-              this.handleSaveNeedy()
+              this.operateName = "保存";
+              this.handleConfirmOnline("3");
               break;
           }
         }
       });
     },
-    // 保存
-    handleSaveNeedy(){
-      console.log('save');
-    },
     // 确认上线/已办结
     handleConfirmOnline(type) {
-      let reqdata = {
-        operateName: this.operateName,
-        reviewOpinion: this.operateName + "," + this.remark,
-        type,
-        woNo: this.woNo + "",
-      };
-      console.log(reqdata);
-      this.$http({
-        url: "/market/mkOnlineChannel/confirmOnline",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json",
-        },
-        data: reqdata,
-      }).then(({ data: { desc } }) => {
-        console.log(desc);
-        if (desc === "操作成功") {
-          this.$message.success("操作成功");
-          this.dialogStatus = false;
-          this.handleInit();
+      let flag = 1;
+      const factoryName = [];
+      const workLoad = [];
+      this.infodatas.forEach((el) => {
+        // 判断条件
+        if (el.factoryName && el.workLoad) {
+          flag = flag * 1;
+          factoryName.push(el.factoryName);
+          workLoad.push(el.workLoad);
         } else {
-          this.$message.error("操作失败");
+          flag = flag * 0;
         }
       });
+      if (flag) {
+        let reqdata = {
+          operateName: this.operateName,
+          type,
+          support: factoryName,
+          workload: workLoad,
+          woNo: this.woNo + "",
+        };
+        this.$http({
+          url: "/market/mkOnlineChannel/confirmOnline",
+          method: "post",
+          headers: {
+            "Content-Type": "application/json",
+          },
+          data: reqdata,
+        }).then(({ data: { desc } }) => {
+          console.log(desc);
+          if (desc === "操作成功") {
+            this.$message.success("操作成功");
+            this.dialogStatus = false;
+            this.handleInit();
+          } else {
+            this.$message.error("操作失败");
+          }
+        });
+      } else {
+        this.$message.error("请输入必要的信息");
+      }
     },
     // 送电商接口人阅办或送其他人办理
     handleDeliverReadOfficeOrOtherDo(type) {
@@ -1078,10 +1094,10 @@ export default {
       }).then(
         ({
           data: {
-            body: { button,mkOnlineChannel },
+            body: { button, mkOnlineChannel },
           },
         }) => {
-          this.buttonList = button
+          this.buttonList = button;
           this.infolist = {
             ...mkOnlineChannel,
             carryChannelCode: mkOnlineChannel.carryChannelCode.split(","),
@@ -1099,7 +1115,8 @@ export default {
           this.woNo = mkOnlineChannel.woNo;
           // 步骤
           this.step = mkOnlineChannel.step;
-
+          // 最后一步是否办结
+          this.tableSatus = mkOnlineChannel.sts;
           this.dialogStatus = true;
           if (this.titname === "添加") {
             // 审批说明
@@ -1112,13 +1129,27 @@ export default {
               // 数组回显
               this.infodatas = mkOnlineChannel.logList;
             } else {
-              if(this.step === '0'){
-                this.dialogStatus = false
+              if (this.step === "0") {
+                this.dialogStatus = false;
+                return;
               }
+              this.dialogStatus = true;
               if (this.step === "7") {
+                if (mkOnlineChannel.sts === "4") {
+                }
                 this.vision = "信息补填";
                 this.visionsts = "";
-                this.infodatas = [{}];
+                this.infodatas = mkOnlineChannel.workloadAndsupport.length
+                  ? mkOnlineChannel.workloadAndsupport.map((el) => ({
+                      factoryName: el.support,
+                      workLoad: el.workload,
+                    }))
+                  : [
+                      {
+                        factoryName: "",
+                        workLoad: "",
+                      },
+                    ];
               } else {
                 // 数组回显
                 this.infodatas = mkOnlineChannel.logList;
@@ -1685,7 +1716,7 @@ export default {
     //功能栏
     iconCli(v) {
       if (v === 1) {
-        this.handleInit()
+        this.handleInit();
       }
       if (v === 2) {
         this.fullscreen = !this.fullscreen;