From 33836e44d74759010d8e79f3cc702186c4bdf4ea Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 17 十月 2023 11:22:56 +0800
Subject: [PATCH] bug修复(5235 5236)

---
 src/views/sales/salesOpportunity/DetailAdvanceDialog.vue |   59 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 47 insertions(+), 12 deletions(-)

diff --git a/src/views/sales/salesOpportunity/DetailAdvanceDialog.vue b/src/views/sales/salesOpportunity/DetailAdvanceDialog.vue
index c4aa32d..97134af 100644
--- a/src/views/sales/salesOpportunity/DetailAdvanceDialog.vue
+++ b/src/views/sales/salesOpportunity/DetailAdvanceDialog.vue
@@ -13,23 +13,25 @@
           <div class="one">
             <el-radio :label="1">
               <span>鎺ㄨ繘鍒颁笅涓�闃舵</span>
-              <el-select v-model="value" size="mini" disabled>
-                <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"> </el-option>
+              <el-select v-model="value1" size="mini" disabled>
+                <el-option v-for="(item, index) in options" :key="index" :label="item.name" :value="item.id">
+                </el-option>
               </el-select>
             </el-radio>
           </div>
           <div class="two">
             <el-radio :label="2">
               <span>鎺ㄨ繘鍒版寚瀹氶樁娈�</span>
-              <el-select v-model="value" size="mini">
-                <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"> </el-option>
+              <el-select v-model="value" size="mini" @change="designatedStageClick">
+                <el-option v-for="(item, index) in options" :key="index" :label="item.name" :value="item.id">
+                </el-option>
               </el-select>
             </el-radio>
           </div>
         </el-radio-group>
       </div>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" size="small" @click="saveClick('form')">鎺ㄨ繘</el-button>
+        <el-button type="primary" size="small" @click="saveClick()">鎺ㄨ繘</el-button>
         <el-button size="small" @click="commonConfig.visible = false">鍙栨秷</el-button>
       </div>
     </el-dialog>
@@ -37,6 +39,7 @@
 </template>
 
 <script>
+import { pushSaleChance } from "@/api/sales/salesOpportunity"
 export default {
   name: "DetailAdvanceDialog",
   props: {
@@ -45,7 +48,10 @@
       default: () => {
         return {
           visible: false,
-          active: "闇�姹傚垎鏋�"
+          active: "闇�姹傚垎鏋�",
+          allOptions: [],
+          options: [],
+          id: 0
         }
       }
     }
@@ -54,12 +60,13 @@
   computed: {},
   data() {
     return {
-      allOptions: ["鍒濇湡娌熼��", "闇�姹傚垎鏋�", "鏂规鎶ヤ环", "鍟嗗姟璋堝垽", "鎴愬姛缁撴", "澶辫触缁撴"],
+      allOptions: this.advanceConfig.allOptions,
       dialogWidth: "25%",
       radio: 1,
       commonConfig: this.advanceConfig,
+      value1: "",
       value: "",
-      options: ["鍒濇湡娌熼��", "闇�姹傚垎鏋�", "鏂规鎶ヤ环", "鍟嗗姟璋堝垽", "鎴愬姛缁撴", "澶辫触缁撴"]
+      options: this.advanceConfig.options
     }
   },
   watch: {},
@@ -68,17 +75,45 @@
   },
   methods: {
     setData() {
-      console.log(this.commonConfig.active)
       this.allOptions.map((item, index) => {
-        if (item === this.commonConfig.active) {
-          console.log(index)
-          this.value = this.allOptions[index + 1]
+        if (item.id === this.commonConfig.active) {
+          if (index + 1 === this.allOptions.length) {
+            this.value = this.allOptions[0].id
+            this.value1 = this.allOptions[0].id
+          } else {
+            this.value = this.allOptions[index + 1].id
+            this.value1 = this.allOptions[index + 1].id
+          }
+
           this.options.splice(index, 1)
         }
       })
     },
     handleClose() {
       this.commonConfig.visible = false
+    },
+    designatedStageClick() {
+      this.radio = 2
+    },
+    async saveClick() {
+      let stepId = 0
+      if (this.radio === 2) {
+        stepId = this.value
+      } else {
+        stepId = this.value1
+      }
+      await pushSaleChance({
+        id: this.commonConfig.id,
+        step: stepId
+      }).then((res) => {
+        if (res.code === 200) {
+          this.handleClose()
+          this.$emit('pushed',{
+            id: this.commonConfig.id,
+            step: stepId
+          })
+        }
+      })
     }
   }
 }

--
Gitblit v1.8.0