Răsfoiți Sursa

营销0418功能优化;

001295 1 an în urmă
părinte
comite
8afcaa108f

+ 1 - 1
src/views/business/spd/bo/basic/botaskList.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div class="btn_grooup" v-if="bo.winningState == 0 && '0-1'.includes(boAuthority.post)">
+    <div class="btn_grooup" v-if="bo.winningState == 0 && '0-1-2'.includes(boAuthority.post)">
       <el-button
           type="primary"
           plain

+ 94 - 87
src/views/business/spd/bo/basic/details.vue

@@ -1,6 +1,6 @@
 <!-- 商机-详情 -->
 <template>
-  <div class="md-content">
+  <div class="md-content" v-loading="loading">
     <!-- 头部信息 -->
     <div slot="header" class="clearfix">
       <span style="width: 200px; height: 60px; font-size: 18px"  v-show="!showCustomer">
@@ -15,7 +15,7 @@
       <div style="float: right; padding: 3px 0; display:flex;justify-content:space-between" type="text">
         <el-button size="mini" plain @click="handleBack">返回</el-button>
         <el-button type="info" plain size="mini" @click="handleWinningState('1', '关闭')"
-          v-if="(showClose && this.form.basic.winningState == 0) && '0'.includes(boAuthority.post)">关闭</el-button>
+          v-if="(showClose && this.form.basic.winningState == 0) && '0-2'.includes(boAuthority.post)">关闭</el-button>
         <el-button type="info" plain size="mini" @click="handleWinningState('2', '丢单')"
           v-if="(showLose && this.form.basic.winningState == 0) && '0'.includes(boAuthority.post)">丢单</el-button>
         <el-button type="info" plain size="mini" @click="handleWinningState('3', '赢单')"
@@ -439,103 +439,110 @@ export default {
       this.allocationPopover = false;
     },
     //重新加载数据
-    reload() {
+    async reload() {
+      this.loading = true;
       //加载基础数据
-      getBasic(this.$route.params.id).then((response) => {
-        this.form.basic = response.data;
-        //加载权限数据
-        getPsnPost(this.form.basic.id).then((response) => {
-          this.boAuthority = response.data;
-        });
-        //加载流程节点数据
-        getBoNodeListByType(this.form.basic.boType).then(response => {
-          this.boStage = response.rows;
-          //赢丢单按钮显示逻辑
-          var auditNode = 999;
-          var curNode = 0;
-          var signContract = 999;
-          for (var i = 0; i < this.boStage.length; i++) {
-            if (this.boStage[i].code == this.form.basic.boStage) {
-              curNode = i;
-            }
-            if (this.boStage[i].name.toString().includes('审核')) {
-              auditNode = i;
-            }
-            if (this.boStage[i].name.toString().includes('合同')) {
-              signContract = i;
-            }
-          }
-          this.showClose = false;
-          this.showLose = false;
-          this.showWin = false;
-          if (curNode != auditNode) {
-            this.showClose = true;
-          }
-          if (curNode > auditNode) {
-            this.showLose = true;
-          }
-          if (curNode >= signContract) {
-            this.showWin = true;
-          }
-          //确定数据加载完成,子组件可以开始展示
-          this.timer = new Date().getTime();
-        });
-      });
-    },
-    //是否显示客户
-    customerButton() {
-      this.showCustomer = !this.showCustomer;
-    },
-  },
-  //创建钩子
-  created() {
-    //加载基础数据
-    getBasic(this.$route.params.id).then((response) => {
-      this.form.basic = response.data;
+      let res = await getBasic(this.$route.params.id);
+      this.form.basic = res.data;
       //设置应丢关单标题
       switch(this.form.basic.winningState){
         case "1" : this.winningStateTitle = "关闭";break;
         case "2" : this.winningStateTitle = "丢单";break;
         case "3" : this.winningStateTitle = "赢单";break;
       }
-      //加载权限数据
-      getPsnPost(this.form.basic.id).then((response) => {
-        this.boAuthority = response.data;
-      });
       //加载流程节点数据
-      getBoNodeListByType(this.form.basic.boType).then(response => {
-        this.boStage = response.rows;
-        console.log('this.boStage', this.boStage);
-        //赢丢单按钮显示逻辑
-        var auditNode = 999;
-        var curNode = 0;
-        var signContract = 999;
-        for (var i = 0; i < this.boStage.length; i++) {
-          if (this.boStage[i].code == this.form.basic.boStage) {
-            curNode = i;
-          }
-          if (this.boStage[i].name.toString().includes('审核')) {
-            auditNode = i;
-          }
-          if (this.boStage[i].name.toString().includes('合同')) {
-            signContract = i;
-          }
+      let bnRes = await getBoNodeListByType(this.form.basic.boType);
+      this.boStage = bnRes.rows;
+      console.log('this.boStage', this.boStage);
+      //赢丢单按钮显示逻辑
+      var auditNode = 999;
+      var curNode = 0;
+      var signContract = 999;
+      for (var i = 0; i < this.boStage.length; i++) {
+        if (this.boStage[i].code == this.form.basic.boStage) {
+          curNode = i;
         }
-        this.showClose = false;
-        this.showLose = false;
-        this.showWin = false;
-        if (curNode != auditNode) {
-          this.showClose = true;
+        if (this.boStage[i].name.toString().includes('审核')) {
+          auditNode = i;
         }
-        if (curNode > auditNode) {
-          this.showLose = true;
+        if (this.boStage[i].name.toString().includes('合同')) {
+          signContract = i;
         }
-        if (curNode >= signContract) {
-          this.showWin = true;
-        }
-        //确定数据加载完成,子组件可以开始展示
-        this.timer = new Date().getTime();
+      }
+      this.showClose = false;
+      this.showLose = false;
+      this.showWin = false;
+      if (curNode != auditNode) {
+        this.showClose = true;
+      }
+      if (curNode > auditNode) {
+        this.showLose = true;
+      }
+      if (curNode >= signContract) {
+        this.showWin = true;
+      }
+      //确定数据加载完成,子组件可以开始展示
+      this.timer = new Date().getTime();
+      this.loading = false;
+      //加载权限数据
+      getPsnPost(this.form.basic.id).then((response) => {
+        this.boAuthority = response.data;
       });
+    },
+    //是否显示客户
+    customerButton() {
+      this.showCustomer = !this.showCustomer;
+    },
+  },
+  //创建钩子
+  async created() {
+    this.loading = true;
+    //加载基础数据
+    let res = await getBasic(this.$route.params.id);
+    this.form.basic = res.data;
+    //设置应丢关单标题
+    switch(this.form.basic.winningState){
+      case "1" : this.winningStateTitle = "关闭";break;
+      case "2" : this.winningStateTitle = "丢单";break;
+      case "3" : this.winningStateTitle = "赢单";break;
+    }
+    //加载流程节点数据
+    let bnRes = await getBoNodeListByType(this.form.basic.boType);
+    this.boStage = bnRes.rows;
+    console.log('this.boStage', this.boStage);
+    //赢丢单按钮显示逻辑
+    var auditNode = 999;
+    var curNode = 0;
+    var signContract = 999;
+    for (var i = 0; i < this.boStage.length; i++) {
+      if (this.boStage[i].code == this.form.basic.boStage) {
+        curNode = i;
+      }
+      if (this.boStage[i].name.toString().includes('审核')) {
+        auditNode = i;
+      }
+      if (this.boStage[i].name.toString().includes('合同')) {
+        signContract = i;
+      }
+    }
+    this.showClose = false;
+    this.showLose = false;
+    this.showWin = false;
+    if (curNode != auditNode) {
+      this.showClose = true;
+    }
+    if (curNode > auditNode) {
+      this.showLose = true;
+    }
+    if (curNode >= signContract) {
+      this.showWin = true;
+    }
+    //确定数据加载完成,子组件可以开始展示
+    this.timer = new Date().getTime();
+    this.loading = false;
+    //加载权限数据
+    getPsnPost(this.form.basic.id).then((response) => {
+      this.boAuthority = response.data;
     });
   },
 };