Browse Source

Merge branch 'bianww' into 'master'

Bianww

See merge request spfm/spfm-market-front!162
徐兴安 3 years ago
parent
commit
cef989ec5b

+ 408 - 203
src/pages/main/demandDevelop/index.vue

@@ -9,12 +9,14 @@
           @click="dialogCheck(3)"
           >添加</el-button
         >
-        <el-button
-          style="float: right; margin-top: 10px; margin-right: 20px"
-          type="primary"
-          @click="getStanding"
-          >台账</el-button
-        >
+          <el-button
+              v-if="standingAuth"
+              style="float: right; margin-top: 10px; margin-right: 20px"
+              type="primary"
+              @click="getStanding"
+          >台账
+          </el-button
+          >
       </div>
       <div class="tabbox">
         <el-table
@@ -43,7 +45,7 @@
               }}
             </template>
           </el-table-column>
-          <el-table-column label="操作" width="120px" align="center">
+          <el-table-column label="操作" width="150px" align="center">
             <template slot-scope="scope">
               <el-button
                 size="mini"
@@ -53,11 +55,19 @@
               >
               <el-button
                 size="mini"
-                type="danger"
+                type="warning"
                 v-if="scope.row.sts !== '4'"
                 @click="dialogCheck(2, scope.row)"
                 >处理</el-button
               >
+
+             <el-button
+                 size="mini"
+                 type="danger"
+                 v-if="scope.row.step === '0'"
+                 @click="dialogCheck(4, scope.row)"
+             >注销</el-button
+             >
               <!-- <el-button size="mini" type="danger" @click="delLine(scope.row)">删除</el-button> -->
             </template>
           </el-table-column>
@@ -250,64 +260,79 @@
               >导入</el-button
             ></el-upload
           >
-          <div
-            style="margin: 20px 0; padding: 0 20px"
-            v-if="vision == '信息补填'"
-          >
-            <el-table
-              class="com-table"
-              ref="multipleTable"
-              :data="infodatas"
-              tooltip-effect="dark"
-              size="small"
-              border
-              style="width: 100%"
+            <div
+                style="margin: 20px 0; padding: 0 20px"
+                v-if="vision == '信息补填'"
             >
-              <el-table-column prop="infoName" label="需求承接支撑方">
-                <template slot-scope="scope">
-                  <el-input
-                    v-model="scope.row.factoryName"
-                    :disabled="tableSatus === '4'"
-                  ></el-input>
-                </template>
-              </el-table-column>
-              <el-table-column prop="infoName" label="涉及发生工作量">
-                <template slot-scope="scope">
-                  <el-input
-                    v-model="scope.row.workLoad"
-                    :disabled="tableSatus === '4'"
-                  ></el-input>
-                </template>
-              </el-table-column>
-              <el-table-column
-                label="操作"
-                width="120px"
-                align="center"
-                v-if="titname == '审批'"
-              >
-                <template slot-scope="scope">
-                  <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
-                  >
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-          <el-form-item class="info-line online" v-if="visionsts == '2'">
+                <el-table
+                    class="com-table"
+                    ref="multipleTable"
+                    :data="infodatas"
+                    tooltip-effect="dark"
+                    size="small"
+                    border
+                    style="width: 100%"
+                >
+                    <el-table-column prop="factoryName" label="需求承接支撑方">
+                        <template slot-scope="scope">
+                            <el-form :ref="'supportFactoryName'+scope.$index" :model="scope.row" :rules="supportRules">
+                                <el-form-item prop="factoryName">
+                                    <el-select v-model="scope.row.factoryName" filterable placeholder="请选择厂商" :disabled="tableSatus === '4'" style="width: 100%">
+                                        <el-option
+                                            v-for="item in supportList"
+                                            :key="item"
+                                            :label="item"
+                                            :value="item"
+                                            :disabled="getDisabledFlag(item)"
+                                        >
+                                        </el-option>
+                                    </el-select>
+                                </el-form-item>
+                            </el-form>
+                        </template>
+
+                    </el-table-column>
+                    <el-table-column prop="workLoad" label="涉及发生工作量">
+                        <template slot-scope="scope">
+                            <el-form :ref="'supportWorkLoad'+scope.$index" :model="scope.row" :rules="supportRules">
+                                <el-form-item prop="workLoad">
+                                    <el-input
+                                        v-model="scope.row.workLoad"
+                                        :disabled="tableSatus === '4'"
+                                    ></el-input>
+                                </el-form-item>
+                            </el-form>
+                        </template>
+                    </el-table-column>
+                    <el-table-column
+                        label="操作"
+                        width="120px"
+                        align="center"
+                        v-if="titname == '审批'"
+                    >
+                        <template slot-scope="scope">
+                            <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
+                            >
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </div>
+          <el-form-item class="info-line online" prop="remark" v-if="visionsts == '2'">
             <span>审批说明</span>
             <el-input
-              v-model="remark"
+              v-model="infolist.remark"
               placeholder=""
               type="textarea"
               :rows="3"
@@ -315,30 +340,41 @@
             >
             </el-input>
           </el-form-item>
-
-          <div
-            style="margin: 20px 0px; padding: 0 20px"
-            v-if="titname !== '添加'"
-          >
-            <el-table
-              class="com-table"
-              :data="rovaList"
-              tooltip-effect="dark"
-              size="small"
-              border
-              style="width: 100%"
+          <el-form-item class="info-line online" prop="opinion" v-if="visionsts === '2'">
+              <span>审批意见</span>
+              <el-select v-model="infolist.opinion" placeholder="请选择审批意见" :disabled="titname === '查看'">
+                  <el-option label="同意" value="1"></el-option>
+                  <el-option label="不同意" value="2"></el-option>
+              </el-select>
+          </el-form-item>
+            <div
+                style="margin: 20px 0px; padding: 0 20px"
+                v-if="titname !== '添加'"
             >
-              <el-table-column prop="logNo" label="编号"> </el-table-column>
-              <el-table-column prop="stepName" label="环节"> </el-table-column>
-              <el-table-column prop="processName" label="处理人">
-              </el-table-column>
-              <el-table-column prop="processWorkNo" label="处理人工号">
-              </el-table-column>
-              <el-table-column prop="updateTimeStr" label="处理时间">
-              </el-table-column>
-              <el-table-column prop="remark" label="备注"> </el-table-column>
-            </el-table>
-          </div>
+                <el-table
+                    class="com-table"
+                    :data="rovaList"
+                    tooltip-effect="dark"
+                    size="small"
+                    border
+                    style="width: 100%"
+                >
+                    <el-table-column prop="logNo" label="编号"> </el-table-column>
+                    <el-table-column prop="stepName" label="环节"> </el-table-column>
+                    <el-table-column prop="processName" label="处理人">
+                    </el-table-column>
+                    <el-table-column prop="processWorkNo" label="处理人工号">
+                    </el-table-column>
+                    <el-table-column prop="updateTimeStr" label="处理时间">
+                    </el-table-column>
+                    <el-table-column prop="remark" label="备注"> </el-table-column>
+                    <el-table-column prop="opinion" label="审批意见">
+                        <template slot-scope="scope">
+                            {{ scope.row.opinion === "1" ? '同意' : (scope.row.opinion === "2" ? '不同意' : '') }}
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </div>
         </el-form>
 
         <div slot="footer" class="info-footer">
@@ -346,8 +382,8 @@
             <el-button type="primary" @click="handleApprove('送部门人员审核')"
               >送部门人员审核</el-button
             >
-            <el-button type="primary" @click="handleApprove('送领导审核')"
-              >送领导审核</el-button
+            <el-button type="primary" @click="handleApprove('送科室领导审核')"
+              >送科室领导审核</el-button
             >
             <el-button @click="handleApprove('取消')">取消</el-button>
           </div>
@@ -464,15 +500,54 @@ export default {
     deptTreeOnly,
   },
   data() {
+      const validatorWorkLoad = (rule, value, callback) => {
+          if (/^[0-9]+(\.[0-9]{1,1})?$/.test(value)){
+              callback()
+          }  else {
+              callback(new Error('只能输入一位小数数字'))
+          }
+      }
     return {
-      rules: {
-        demandName: [
+        standingAuth: false,
+        rules: {
+            demandName: [
           {
             required: true,
             trigger: "blur",
             message: "不能为空",
           },
         ],
+        remark: [
+            {
+                required: true,
+                trigger: "blur",
+                message: "不能为空",
+            },
+            {
+                trigger: "change",
+                validator:this.copyValue
+            },
+        ],
+      },
+      supportRules: {
+          factoryName: [
+          {
+            required: true,
+            trigger: "change",
+            message: "不能为空",
+          },
+        ],
+          workLoad: [
+            {
+                required: true,
+                trigger: "blur",
+                message: "不能为空",
+            },
+            {
+                trigger: "change",
+                validator:validatorWorkLoad
+            }
+        ],
       },
       // 操作名称
       operateName: "",
@@ -521,7 +596,7 @@ export default {
         },
       ],
       // 用来控制多选里的单选
-      only: false,
+      only: true,
       // 信息回显
       infolist: {},
       // 用户信息
@@ -565,7 +640,7 @@ export default {
           name: "否",
         },
       ],
-      infodatas: [],
+      infodatas: [{factoryName:'',workLoad:''}],
       busiTime: [],
       urgDegreeopt: [
         {
@@ -597,6 +672,7 @@ export default {
         fileList: [],
       },
       tempSave: false,
+      supportList:[]
     };
   },
   watch: {
@@ -614,6 +690,19 @@ export default {
     // },
   },
   methods: {
+    copyValue(rule, value, callback) {
+        this.remark = value
+        callback()
+    },
+    // 判断需求支撑方是否可选
+    getDisabledFlag(support){
+        for(let n=0;n<this.infodatas.length;n++){
+            if (this.infodatas[n].factoryName === support){
+                return true;
+            }
+        }
+        return false;
+    },
     // 新的处理方法
     handlePreview(file) {
       console.log(file, "Preview");
@@ -667,7 +756,7 @@ export default {
             case "送部门人员审核":
               this.operateName = "送部门人员审核";
               this.checkexa = true;
-              this.type = "0";
+              this.type = "1";
               console.log("送部门人员审核");
               break;
             // case "送领导审核":
@@ -677,13 +766,21 @@ export default {
             //   console.log("送领导审核");
             //   break;
             //领导审批支持整个OA组织架构
-            case "送领导审核":
-              this.operateName = "送领导审核";
-              this.type = "1";
+            case "送科室领导审核":
+              this.operateName = "送科室领导审核";
+              this.type = "2";
               // this.checkLaeder = true;
               this.checkexa = true;
               console.log("送领导审核");
               break;
+            case "送部门领导审核":
+            case "送公司领导审核":
+              this.operateName = type;
+              this.type = "3";
+              // this.checkLaeder = true;
+              this.checkexa = true;
+              console.log(type);
+              break;
             case "送起草人编号发送":
               this.operateName = "送起草人编号";
               this.handleSendNo();
@@ -692,39 +789,45 @@ export default {
               this.operateName = "确认编号";
               this.handleComfirmNo();
               break;
+            case "提交电商接口人审批":
+            case "提交省公司电商接口人审批":
+              this.operateName = type;
+              this.deliverReadOffice();
+              break;
             case "打回":
               this.operateName = "打回";
               this.handleBackRecord();
               break;
-            case "确认需求":
+            case "转交渠道经理待办":
               this.checkexa = true;
               this.type = "0";
-              this.operateName = "确认需求";
+              this.operateName = "转交渠道经理待办";
               break;
             case "送项目经理会签":
               this.checkexa = true;
               this.type = "0";
+              this.only = false;
               this.operateName = "送项目经理会签";
               break;
-            case "送电商接口人阅办":
-              this.operateName = "送电商接口人阅办";
+            case "送电商接口人":
+              this.operateName = type;
               this.handleDeliverReadOfficeOrOtherDo("1");
               break;
             case "送其他人办理":
               this.checkexa = true;
-              this.only = true;
               this.operateName = "送其他人办理";
               break;
             case "确认上线":
               this.operateName = "确认上线";
               this.handleConfirmOnline("1");
               break;
-            case "已办结":
+/*            case "已办结":
               this.operateName = "已办结";
               this.handleConfirmOnline("2");
-              break;
+              break;*/
             case "保存":
               this.operateName = "保存";
+              console.log(this.infodatas)
               this.handleConfirmOnline("3");
               break;
           }
@@ -732,22 +835,32 @@ export default {
       });
     },
     // 确认上线/已办结
-    handleConfirmOnline(type) {
+    async handleConfirmOnline(type) {
+      // 校验需求支撑方和工作量 是否合规
+        for (let i = 0; i < this.infodatas.length; i++) {
+            let supportFlag = await this.$refs['supportFactoryName' + i].validate();
+            if (supportFlag){
+                let workLoadFlag = await this.$refs['supportWorkLoad' + i].validate();
+                if (!workLoadFlag){
+                    return ;
+                }
+            }else {
+                return ;
+            }
+        }
       let flag = 1;
       const factoryName = [];
       const workLoad = [];
-      if (type !== "1") {
-        this.infodatas.forEach((el) => {
+      this.infodatas.forEach((el) => {
           // 判断条件
           if (el.factoryName && el.workLoad) {
-            flag = flag * 1;
-            factoryName.push(el.factoryName);
-            workLoad.push(el.workLoad);
+              flag = flag * 1;
+              factoryName.push(el.factoryName);
+              workLoad.push(el.workLoad);
           } else {
-            flag = flag * 0;
+              flag = flag * 0;
           }
-        });
-      }
+      });
       if (flag) {
         let reqdata = {
           operateName: this.operateName,
@@ -756,6 +869,7 @@ export default {
           support: factoryName,
           workload: workLoad,
           woNo: this.woNo + "",
+          opinion: this.infolist.opinion,
         };
         this.$http({
           url: "/market/mkOnlineChannel/confirmOnline",
@@ -764,14 +878,14 @@ export default {
             "Content-Type": "application/json",
           },
           data: reqdata,
-        }).then(({ data: { desc } }) => {
-          console.log(desc);
-          if (desc === "操作成功") {
-            this.$message.success("操作成功");
-            this.dialogStatus = false;
-            this.handleInit();
-            this.closedia();
-          } else {
+        }).then(({ data }) => {
+            console.log(data)
+            if (data && data.result === 0) {
+                this.$message.success(data.desc);
+                this.dialogStatus = false;
+                this.handleInit();
+                this.closedia();
+            } else {
             this.$message.error("操作失败");
           }
         });
@@ -794,6 +908,7 @@ export default {
         type,
         reviewOpinion: this.remark,
         woId: this.woNo + "",
+        opinion: this.infolist.opinion,
       };
       if (type === "2") {
         reqdata = {
@@ -810,15 +925,15 @@ export default {
           "Content-Type": "application/json",
         },
         data: reqdata,
-      }).then(({ data: { desc } }) => {
-        console.log(desc);
-        if (desc === "操作成功") {
-          this.$message.success("操作成功");
-          this.checkexa = false;
-          this.dialogStatus = false;
-          this.handleInit();
-          this.closedia();
-        } else {
+      }).then(({ data }) => {
+          console.log(data)
+          if (data && data.result === 0) {
+              this.$message.success(data.desc);
+              this.checkexa = false;
+              this.dialogStatus = false;
+              this.handleInit();
+              this.closedia();
+          } else {
           this.$message.error("操作失败");
         }
       });
@@ -838,6 +953,7 @@ export default {
         receiveName: receiveName.join(","),
         reviewOpinion: this.remark,
         woNo: this.woNo + "",
+        opinion: this.infolist.opinion,
       };
       console.log(reqdata);
 
@@ -848,20 +964,20 @@ export default {
           "Content-Type": "application/json",
         },
         data: reqdata,
-      }).then(({ data: { desc } }) => {
-        console.log(desc);
-        if (desc === "操作成功") {
-          this.$message.success("操作成功");
-          this.checkexa = false;
-          this.dialogStatus = false;
-          this.handleInit();
-          this.closedia();
-        } else {
-          this.$message.error("操作失败");
-        }
+      }).then(({ data }) => {
+          console.log(data)
+          if (data && data.result === 0) {
+              this.$message.success(data.desc);
+              this.checkexa = false;
+              this.dialogStatus = false;
+              this.handleInit();
+              this.closedia();
+          } else {
+              this.$message.error("操作失败");
+            }
       });
     },
-    // 确认需求
+    // 转交渠道经理待办
     handleNeedyComfirm() {
       let receiveId = [];
       let receiveName = [];
@@ -876,6 +992,7 @@ export default {
         receiveName: receiveName.join(","),
         reviewOpinion: this.remark,
         woNo: this.woNo + "",
+        opinion: this.infolist.opinion,
       };
       console.log(reqdata);
 
@@ -886,17 +1003,17 @@ export default {
           "Content-Type": "application/json",
         },
         data: reqdata,
-      }).then(({ data: { desc } }) => {
-        console.log(desc);
-        if (desc === "操作成功") {
-          this.$message.success("操作成功");
-          this.checkexa = false;
-          this.dialogStatus = false;
-          this.handleInit();
-          this.closedia();
-        } else {
-          this.$message.error("操作失败");
-        }
+      }).then(({ data }) => {
+          console.log(data)
+          if (data && data.result === 0) {
+              this.$message.success(data.desc);
+              this.checkexa = false;
+              this.dialogStatus = false;
+              this.handleInit();
+              this.closedia();
+          } else {
+              this.$message.error("操作失败");
+            }
       });
     },
     // 打回方法
@@ -909,20 +1026,19 @@ export default {
         },
         params: {
           woNo: this.woNo,
-          remark: [this.operateName, this.remark]
-            .filter((el) => el !== "")
-            .join(","),
+          remark: this.remark,
+          opinion: this.infolist.opinion,
         },
-      }).then(({ data: { desc } }) => {
-        console.log(desc);
-        if (desc === "操作成功") {
-          this.$message.success("操作成功");
-          this.dialogStatus = false;
-          this.handleInit();
-          this.closedia();
-        } else {
-          this.$message.error("操作失败");
-        }
+      }).then(({ data }) => {
+          console.log(data)
+          if (data && data.result === 0) {
+              this.$message.success(data.desc);
+              this.dialogStatus = false;
+              this.handleInit();
+              this.closedia();
+          } else {
+            this.$message.error("操作失败");
+          }
       });
     },
     // 表单提交
@@ -975,9 +1091,7 @@ export default {
         // 需求描述
         demandDesc: this.infolist.demandDesc,
         // 审批说明
-        remark: [this.operateName, this.remark]
-          .filter((el) => el !== "")
-          .join(","),
+        remark: this.remark,
         // 审核人员
         loginNameList: this.treeList.length
           ? this.treeList.map((el) => {
@@ -990,7 +1104,10 @@ export default {
             })
           : [this.leader],
         type: this.type,
-        // fileList: this.file,
+        opinion: this.infolist.opinion ? this.infolist.opinion : '',
+          // fileList: this.file,
+        // 添加操作步骤
+        operateName: this.operateName
       };
       // 处理其他参数
       for (let key in params) {
@@ -1004,7 +1121,7 @@ export default {
           }
         });
       }
-      if (this.operateName === "确认需求") {
+      if (this.operateName === "转交渠道经理待办") {
         this.handleNeedyComfirm();
         return;
       }
@@ -1026,7 +1143,7 @@ export default {
           },
           data: formData,
         }).then(({ data }) => {
-          if (data && data.desc === "操作成功") {
+          if (data && data.result === 0) {
             this.$message({
               type: "success",
               message: data.desc,
@@ -1047,19 +1164,18 @@ export default {
         },
         params: {
           woNo: this.woNo,
-          remark: [this.operateName, this.remark]
-            .filter((el) => el !== "")
-            .join(","),
+          remark: this.remark,
+          opinion: this.infolist.opinion
         },
-      }).then(({ data: { desc } }) => {
-        console.log(desc);
-        if (desc === "操作成功") {
-          this.$message.success("操作成功");
-          this.handleInit();
-          this.closedia();
-        } else {
-          this.$message.error("操作失败");
-        }
+      }).then(({ data }) => {
+          console.log(data)
+          if (data && data.result === 0) {
+              this.$message.success(data.desc);
+              this.handleInit();
+              this.closedia();
+          } else {
+              this.$message.error("操作失败");
+            }
       });
     },
     // 确认编号
@@ -1072,19 +1188,43 @@ export default {
         },
         data: {
           woNo: this.woNo + "",
-          remark: [this.operateName, this.remark]
-            .filter((el) => el !== "")
-            .join(","),
+          remark: this.remark,
+          opinion: this.infolist.opinion,
         },
-      }).then(({ data: { desc } }) => {
-        console.log(desc);
-        if (desc === "操作成功") {
-          this.$message.success("操作成功");
-          this.handleInit();
-          this.closedia();
-        } else {
-          this.$message.error("操作失败");
-        }
+      }).then(({ data }) => {
+          console.log(data)
+          if (data && data.result === 0) {
+              this.$message.success(data.desc);
+              this.handleInit();
+              this.closedia();
+          } else {
+            this.$message.error("操作失败");
+          }
+      });
+    },
+    // 确认编号后送电商接口人
+    deliverReadOffice() {
+      this.$http({
+        url: "/market/mkOnlineChannel/deliverReadOffice",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: {
+          woNo: this.woNo + "",
+          remark: this.remark,
+          opinion: this.infolist.opinion,
+          operateName: this.operateName
+        },
+      }).then(({ data }) => {
+          console.log(data)
+          if (data && data.result === 0) {
+              this.$message.success(data.desc);
+              this.handleInit();
+              this.closedia();
+            } else {
+              this.$message.error("操作失败");
+            }
       });
     },
     // 初始化列表接口
@@ -1107,9 +1247,40 @@ export default {
         }) => {
           this.total = count;
           this.tableData = data;
+          console.log("===================================")
+          console.log(this.tableData)
         }
       );
     },
+      // 注销
+      delDetails(id){
+          this.$confirm('确认注销吗?', '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
+          }).then(() => {
+              this.$http({
+                  url: "/market/mkOnlineChannel/delDetailsByWoNo",
+                  method: "post",
+                  headers: {
+                      "Content-Type": "application/json",
+                  },
+                  data: id,
+              }).then(({ data }) => {
+                  if (data && data.result === 0) {
+                      this.$message.success(data.desc);
+                      this.handleInit();
+                  } else {
+                      this.$message.error("操作失败");
+                  }
+              });
+          }).catch(() => {
+              this.$message({
+                  type: 'info',
+                  message: '取消注销'
+              });
+          });
+      },
     // 查看详情接口封装
     queryDetails(id) {
       this.$http({
@@ -1135,6 +1306,7 @@ export default {
             carryChannelCode: mkOnlineChannel.carryChannelCode
               ? mkOnlineChannel.carryChannelCode.split(",")
               : [],
+            opinion: ''
           };
           this.busiTime = [
             mkOnlineChannel.busiStartTime,
@@ -1167,8 +1339,9 @@ export default {
               this.buttonList = [];
               this.disableStatus = true;
               this.visionsts = "";
-              if (this.step === "7") {
+              if (this.step === "9") {
                 this.vision = "信息补填";
+                this.getSupportList()
                 // 查看也不能操作数据
                 this.tableSatus = "4";
                 this.visionsts = "";
@@ -1194,14 +1367,12 @@ export default {
               }
               this.disableStatus = true;
               this.dialogStatus = true;
-              if (this.step === "7") {
+              if (this.step === "9") {
                 // 这个是判断最后一步是否可以导入数据
                 if (this.buttonList[0] === "确认上线") {
-                  this.vision = "";
-                  this.visionsts = "2";
-                } else {
                   this.vision = "信息补填";
                   this.visionsts = "";
+                  this.getSupportList()
                 }
                 this.infodatas = mkOnlineChannel.workloadAndsupport.length
                   ? mkOnlineChannel.workloadAndsupport.map((el) => ({
@@ -1223,6 +1394,25 @@ export default {
         }
       );
     },
+    // 获取所有需求承接支撑方
+    getSupportList(){
+        this.$http({
+            url: "/market/cChannelContract/queryList",
+            method: "post",
+            headers: {
+                "Content-Type": "application/json",
+
+            },
+            data: {},
+        }).then((res) => {
+            let supportName = []
+            for (let i = 0; i < res.data.length; i++) {
+                let datum = res.data[i];
+                supportName.push(datum.factoryName)
+            }
+            this.supportList = [...new Set(supportName)];
+        });
+    },
 
     // 老方法
     temp() {
@@ -1270,7 +1460,7 @@ export default {
     },
     choline(v, n) {
       if (v == 1) {
-        this.infodatas.push({});
+        this.infodatas.push({factoryName:'',workLoad:''});
       } else {
         this.infodatas.splice(n.$index, 1);
       }
@@ -1298,7 +1488,7 @@ export default {
       // 审核人
       this.checkexa = false;
       // 审核人单选是否开启
-      this.only = false;
+      this.only = true;
     },
     //获取列表
     getList(v, n) {
@@ -1358,6 +1548,10 @@ export default {
         //   // this.tempSave = true;
         // });
         // return;
+      } else if (type === 4) {
+          this.titname = "注销";
+          this.visionsts = "2";
+          this.delDetails(data.woNo);
       }
       // this.$http({
       //   url: "/bpm/api/taskInit",
@@ -1831,6 +2025,17 @@ export default {
         this.carryChannelopt = res.data;
       });
     },
+      ywStandingAuth(){
+          this.$http({
+              url: "/market/mkOnlineChannel/ywStandingAuth",
+              method: "post",
+              headers: {
+                  "Content-Type": "application/json",
+              },
+          }).then((res) => {
+             this.standingAuth =  res.data.body;
+          });
+      }
   },
   mounted() {
     // 调用初始化接口
@@ -1840,7 +2045,7 @@ export default {
     this.getTermianl();
     this.getsaleChnl();
   },
-  created() {},
+  created() { this.ywStandingAuth()},
 };
 </script>
 <style scoped lang="scss">

+ 141 - 127
src/pages/main/demandDevelop/ywStanding.vue

@@ -4,37 +4,20 @@
       <toolList @iconCli="iconCli" :tooltit="tooltit"></toolList>
       <div class="search">
         <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
-        <el-button
-          class="btn-check"
-          size="medium"
-          type="primary"
-          @click="outlist"
-          >导出
-        </el-button>
-      </div>
-      <div class="tabbox">
+        <div>
+            <el-button class="btn-check"  size="medium" type="primary"  @click="outlist">导出
+            </el-button>
+            <myUpload style="display:inline-block;" :fileInfo="fileInfo" @onSuccess="onSuccess"
+                      :fileList="fileInfo.fileList"></myUpload>
+        </div>
+        </div>
+        <div class="tabbox">
         <el-table
-          height="calc(100% - 40px)"
-          class="com-table"
-          ref="multipleTable"
-          :data="tableData"
-          tooltip-effect="dark"
-          size="small"
-          border
-          style="width: 100%"
+            height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData"
+            tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading" :key= Math.random()
         >
-          <el-table-column prop="demandName" label="需求名称">
-          </el-table-column>
-          <el-table-column prop="groupName" label="提出部门/地市">
+          <el-table-column width="150" v-for="item in tableHead"  :prop=item.prop :label=item.label>
           </el-table-column>
-          <el-table-column prop="busiStartTime" label="时间段">
-            <template slot-scope="scope">
-              {{ scope.row.busiStartTime + "~" + scope.row.busiEndTime }}
-            </template>
-          </el-table-column>
-          <el-table-column prop="status" label="状态"> </el-table-column>
-          <el-table-column prop="support" label="支撑方"> </el-table-column>
-          <el-table-column prop="workload" label="工作量"> </el-table-column>
         </el-table>
         <el-pagination
           class="pageBox"
@@ -51,38 +34,53 @@
 <script>
 import mySearch from "../../../components/search.vue";
 import toolList from "../../../components/toolList.vue";
+import myUpload from '../../../components/upload';
+
 
 export default {
   components: {
-    mySearch,
-    toolList,
+      mySearch,
+      toolList,
+      myUpload
   },
   data() {
     return {
-      searchList: [
-        {
-          type: "input",
-          tit: "需求名称",
-          value: "",
-          width: "23%",
-        },
-        {
-          type: "input",
-          tit: "部门或地市",
-          value: "",
-          width: "23%",
+        // tableHead: [{prop: 'demandNo', label: '需求编号'},{prop: 'groupName', label: '提出部门'}],
+        fileInfo: {
+            type: 'btn',
+            typename: '导入',
+            btntype: 'primary',
+            limit: 1,
+            url: '/market/mkOnlineChannel/importLedgerList',
+            fileList: [],
+            typexz:"xlsx"
         },
+        loading:false,
+        tableHead:[],
+        searchList: [
+            // {
+            //   type: "input",
+        //   tit: "需求名称",
+        //   value: "",
+        //   width: "23%",
+        // },
+        // {
+        //   type: "input",
+        //   tit: "部门或地市",
+        //   value: "",
+        //   width: "23%",
+        // },
         {
           type: "date",
           tit: "开始时间",
           value: "",
-          width: "23%",
+          width: "46%",
         },
         {
           type: "date",
           tit: "结束时间",
           value: "",
-          width: "23%",
+          width: "46%",
         },
       ],
       tooltit: "线上业务需求台账",
@@ -107,20 +105,36 @@ export default {
     };
   },
   methods: {
+      headerStyleFun({rowIndex}){
+          if (rowIndex === 0){
+              return "font-size:14px;font-weight:bold;color:black;"
+          }
+      },
+      onSuccess(file){
+          this.searchInfo([this.searchList[0].value], 1);
+      },
     //搜索数据
     searchInfo(v) {
       this.params = {};
-      v[0] ? (this.params.demandName = v[0]) : "";
-      v[1] ? (this.params.deptOrCity = v[1]) : "";
-      v[2]
-        ? (this.params.startTime = this.$formatDate(v[2], "YYYY-MM-DD"))
+      // v[0] ? (this.params.demandName = v[0]) : "";
+      // v[1] ? (this.params.deptOrCity = v[1]) : "";
+      v[0]
+        ? (this.params.startTime = this.$formatDate(v[0], "YYYY-MM-DD"))
         : "";
-      v[3] ? (this.params.endTime = this.$formatDate(v[3], "YYYY-MM-DD")) : "";
-      this.handleInit();
+      v[1] ? (this.params.endTime = this.$formatDate(v[1], "YYYY-MM-DD")) : "";
+        if ((new Date(this.params.startTime)).getTime() > (new Date(this.params.endTime)).getTime()){
+            this.$message.error(
+                "开始时间不能大于结束时间"
+            );
+            return
+        }
+        this.getTableHeadlist();
+        this.handleInit();
     },
     // 初始化列表
     handleInit() {
-      this.$http({
+        this.loading=true;
+        this.$http({
         url: "/market/mkOnlineChannel/ledgerList",
         method: "post",
         headers: {
@@ -137,59 +151,41 @@ export default {
             body: { data, count },
           },
         }) => {
-          this.total = count;
-          this.tableData = data;
-          this.total = count;
+            this.loading = false;
+            this.total = count;
+            this.tableData = data;
+            this.total = count;
         }
       );
     },
+      //获取表头数据
+      getTableHeadlist() {
+          this.$http({
+              url: "/market/mkOnlineChannel/getTableHeadlist",
+              method: "post",
+              headers: {
+                  "Content-Type": "application/json",
+              },
+              data: {
+                  ...this.params,
+                  page: this.page,
+                  pageSize: this.pageSize,
+              },
+          }).then(({ data: { body } }) => {
+              this.tableHead = body;
+          });
+      },
     outlist() {
-      // let data = {
-      //   colStr:
-      //     "demandName,deptName,busiStartTime,busiEndTime,factoryName,workLoad",
-      //   fileName: "台账.xlsx",
-      //   tital: [
-      //     [
-      //       {
-      //         colNum: "0",
-      //         colSpan: "0",
-      //         rowSpan: "1",
-      //         val: "需求名称",
-      //       },
-      //       {
-      //         colNum: "1",
-      //         colSpan: "0",
-      //         rowSpan: "1",
-      //         val: "提出部门",
-      //       },
-      //       {
-      //         colNum: "2",
-      //         colSpan: "0",
-      //         rowSpan: "1",
-      //         val: "开始时间",
-      //       },
-      //       {
-      //         colNum: "3",
-      //         colSpan: "0",
-      //         rowSpan: "1",
-      //         val: "结束时间",
-      //       },
-      //       {
-      //         colNum: "4",
-      //         colSpan: "0",
-      //         rowSpan: "1",
-      //         val: "支撑方",
-      //       },
-      //       {
-      //         colNum: "5",
-      //         colSpan: "0",
-      //         rowSpan: "1",
-      //         val: "工作量",
-      //       },
-      //     ],
-      //   ],
-      // };
-      // // data.tital = JSON.stringify(data.tital)
+        var date = new Date()
+        var year = date.getFullYear()
+        var month = date.getMonth() + 1 < 10 ?
+            '0' + (date.getMonth() + 1) : date.getMonth()+ 1
+        var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
+        let hh = new Date().getHours();
+        let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
+        let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
+        var nowDate=year+month+day+hh+mf+ss
+
       this.$http({
         url: "/market/mkOnlineChannel/exportLedger",
         method: "post",
@@ -197,7 +193,11 @@ export default {
           "Content-Type": "application/json",
         },
         responseType: "blob",
-        data: this.params,
+          data: {
+              ...this.params,
+              page: this.page,
+              pageSize: this.pageSize,
+          }
       }).then((response) => {
         if (window.navigator && window.navigator.msSaveOrOpenBlob) {
           let blob = new Blob([response.data], {
@@ -205,7 +205,7 @@ export default {
           });
           window.navigator.msSaveOrOpenBlob(
             blob,
-            new Date().getTime() + ".xlsx"
+            "线上业务需求台账-"+nowDate + ".xlsx"
           );
         } else {
           /* 火狐谷歌的文件下载方式 */
@@ -213,7 +213,7 @@ export default {
           var downloadElement = document.createElement("a");
           var href = window.URL.createObjectURL(blob);
           downloadElement.href = href;
-          downloadElement.download = new Date().getTime() + ".xlsx";
+          downloadElement.download = "线上业务需求台账-"+nowDate + ".xlsx";
           document.body.appendChild(downloadElement);
           downloadElement.click();
           document.body.removeChild(downloadElement);
@@ -221,41 +221,54 @@ export default {
         }
       });
     },
+      inlist(){
+          this.$http({
+              url: "/market/mkOnlineChannel/importLedger",
+              method: "post",
+              headers: {
+                  "Content-Type": "application/json",
+              },
+              data: this.params,
+          }).then((res) => {
+              res.data;
+          });
+      },
     // 分页
     currchange(v) {
-      this.page = v;
-      this.handleInit();
+        this.page = v;
+        this.getTableHeadlist();
+        this.handleInit();
     },
 
     //获取列表
-    getList(v, n) {
-      v.sts = 1;
-      this.pageSize = n;
-      let _this = this;
-      this.$http({
-        url: "/market/cChannelDemand/queryPage",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json",
-          page: '{"pageNo":"' + n + '","pageSize":"10"}',
-        },
-        data: v,
-      }).then((res) => {
-        this.tableData = res.data.data;
-        this.total = res.data.totalRecord;
-      });
-    },
+    // getList(v, n) {
+    //   v.sts = 1;
+    //   this.pageSize = n;
+    //   let _this = this;
+    //   this.$http({
+    //     url: "/market/cChannelDemand/queryPage",
+    //     method: "post",
+    //     headers: {
+    //       "Content-Type": "application/json",
+    //       page: '{"pageNo":"' + n + '","pageSize":"10"}',
+    //     },
+    //     data: v,
+    //   }).then((res) => {
+    //     this.tableData = res.data.data;
+    //     this.total = res.data.totalRecord;
+    //   });
+    // },
 
     //功能栏
     iconCli(v) {
       if (v === 1) {
-        this.handleInit();
+          this.getTableHeadlist();
+          this.handleInit();
       }
       if (v === 2) {
         this.fullscreen = !this.fullscreen;
       }
     },
-    // =======================
 
     getUser() {
       this.userInfo = JSON.parse(window.sessionStorage.userInfo);
@@ -268,9 +281,10 @@ export default {
     },
   },
   mounted() {
-    // this.getList({}, 1);
-    this.handleInit();
-    this.getUser();
+      // this.getList({}, 1);
+      this.getTableHeadlist();
+      this.handleInit();
+      this.getUser();
   },
   created() {},
 };

+ 3 - 3
src/pages/main/performance/components/deptTreeOnly.vue

@@ -118,7 +118,7 @@ export default {
         }
       }
     },
-    handleCheckChange() {
+    handleCheckChange(node) {
       console.log(this.only, "only");
       const nodeList = this.$refs.tree.store.getCheckedNodes();
       if (this.only) {
@@ -128,10 +128,10 @@ export default {
           this.$refs.tree.setCheckedKeys([]);
           this.$emit("treeCheck", nodeList);
         } else {
-          let obj = { ...nodeList[0] };
+          let obj = nodeList.filter(item => item.o !== node.data.o)
           this.$refs.tree.setCheckedKeys([]);
           this.$nextTick(() => {
-            this.$refs.tree.setChecked(obj, true);
+            this.$refs.tree.setChecked(obj[0], true);
           });
           this.$message.error("这里只能选择一个审批人");
         }