From 28e0aa1d40bff8985ac3e662d3a7726594d919c3 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期一, 14 八月 2023 19:45:26 +0800
Subject: [PATCH] 销售机会联调及bug修复

---
 src/views/sales/salesOpportunity/DetailOpportunity.vue |  129 ++++++++++++++++++++++++------------------
 1 files changed, 74 insertions(+), 55 deletions(-)

diff --git a/src/views/sales/salesOpportunity/DetailOpportunity.vue b/src/views/sales/salesOpportunity/DetailOpportunity.vue
index cd2476c..5d2257f 100644
--- a/src/views/sales/salesOpportunity/DetailOpportunity.vue
+++ b/src/views/sales/salesOpportunity/DetailOpportunity.vue
@@ -38,13 +38,16 @@
             </div>
             <div v-show="isSchduleExpand" class="basic-info-content">
               <div class="step-view">
-                <el-steps :active="active" align-center>
-                  <el-step :active-color="'#fff'" :title="item.title" :key="index" v-for="(item, index) in stepsList">
+                <el-steps :active="sale_active" align-center>
+                  <el-step :active-color="'#fff'" :title="item.name" :key="item.id" v-for="(item, index) in stepsList">
                     <template slot="title">
                       <div class="step-title-view">
-                        <div class="step-label">{{ item.title }}</div>
-                        <div v-show="index === active" class="step-btn" @click="advanceClick(item)">鎺ㄨ繘</div>
-                        <div class="step-desc">{{ item.desc }}</div>
+                        <div class="step-label">{{ item.name }}</div>
+                        <div v-show="sale_active === index" class="step-btn" @click="advanceClick(item)">
+                          <!--  && sale_stage_id !== stepsList.length -->
+                          鎺ㄨ繘
+                        </div>
+                        <!-- <div class="step-desc">{{ item.desc }}</div> -->
                       </div>
                     </template>
                   </el-step>
@@ -170,11 +173,11 @@
                 <li v-for="(item, i) in addressInfoList" :key="i">
                   <div class="left">
                     <div class="content-title">{{ item.leftStr + "锛�" }}</div>
-                    <div class="content-data">{{ item.leftValue }}</div>
+                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                   </div>
                   <div class="right">
                     <div class="content-title">{{ item.rightStr }}</div>
-                    <div class="content-data">{{ item.rightValue }}</div>
+                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                   </div>
                 </li>
               </ul>
@@ -217,7 +220,7 @@
             </div>
           </div>
           <!-- 閿�鍞満浼氶樁娈垫帹杩涘巻鍙� -->
-          <div class="basic-info">
+          <!-- <div class="basic-info">
             <div class="basic-info-label" @click="expandClick('history')">
               <i v-if="isHistoryExpand" class="el-icon-arrow-down"></i>
               <i v-else class="el-icon-arrow-up"></i>
@@ -234,7 +237,7 @@
                 </li>
               </ul>
             </div>
-          </div>
+          </div> -->
         </div>
         <div v-if="activeName === 'second'" class="second">
           <FollowupRecords :isDetail="true" />
@@ -264,6 +267,7 @@
 import SalesDetails from "@/views/sales/salesDetails"
 import ServiceContract from "@/views/service/serviceContract"
 import DetailAdvanceDialog from "@/views/sales/salesOpportunity/DetailAdvanceDialog"
+import { getSaleStageList } from "@/api/sales/salesOpportunity"
 export default {
   name: "DetailClientManage",
   props: {
@@ -284,14 +288,7 @@
       detailConfig: this.opportunityDetail,
       activeName: "first",
       isSchduleExpand: true, // 杩涘害杩借釜
-      stepsList: [
-        { title: "鍒濇湡娌熼��", desc: "鍋滅暀: 1鏈�8澶�20灏忔椂" },
-        { title: "闇�姹傚垎鏋�", desc: "" },
-        { title: "鏂规鎶ヤ环", desc: "" },
-        { title: "鍟嗗姟璋堝垽", desc: "" },
-        { title: "鎴愬姛缁撴", desc: "" },
-        { title: "澶辫触缁撴", desc: "" }
-      ],
+      stepsList: [],
       isBasicExpand: true, // 鍩烘湰淇℃伅灞曞紑
       basicInfoList: [],
       isForecastExpand: true, // 閿�鍞娴�
@@ -308,47 +305,60 @@
       isAnnexExpand: true, // 闄勪欢淇℃伅
       isHistoryExpand: true, // 鎺ㄨ繘鍘嗗彶
       historyList: [],
-      active: 2,
+      sale_active: 0,
       advanceConfig: {
         visible: false,
-        active: ""
+        active: "",
+        allOptions: [],
+        options: []
       }
     }
   },
   created() {
-    this.setData()
+    this.getSaleStageList()
+    this.setData(this.detailConfig.infomation)
   },
   mounted() {},
   methods: {
-    setData() {
+    async getSaleStageList() {
+      await getSaleStageList().then((res) => {
+        this.stepsList = res.data.list
+        res.data.list.map((item, index) => {
+          if (item.id === this.detailConfig.infomation.sale_stage_id) {
+            this.sale_active = index
+          }
+        })
+      })
+    },
+    setData(item) {
       this.basicInfoList = [
         {
           leftStr: "瀹㈡埛鍚嶇О",
-          leftValue: "",
+          leftValue: item.client_name,
           rightStr: "閿�鍞満浼氱紪鍙�",
-          rightValue: ""
+          rightValue: item.id
         },
         {
           leftStr: "鏈轰細鍚嶇О",
-          leftValue: "",
+          leftValue: item.name,
           rightStr: "鑱旂郴浜哄鍚�",
-          rightValue: ""
+          rightValue: item.contact_name
         },
         {
           leftStr: "鍟嗘満鏉ユ簮",
-          leftValue: "",
+          leftValue: item.SalesSources.name,
           rightStr: "鍟嗘満绫诲瀷",
-          rightValue: ""
+          rightValue: "" // item.SaleType.name
         },
         {
           leftStr: "閿�鍞樁娈�",
-          leftValue: "",
+          leftValue: item.sale_stage_name,
           rightStr: "閿�鍞礋璐d汉",
-          rightValue: ""
+          rightValue: item.member.username
         },
         {
           leftStr: "鑰佸鎴疯惀閿�",
-          leftValue: "",
+          leftValue: item.regular_customers_id,
           rightStr: "绛惧埌",
           rightValue: ""
         },
@@ -368,21 +378,21 @@
       this.forecastList = [
         {
           leftStr: "鍙兘鎬�(%)",
-          leftValue: "",
+          leftValue: item.possibility.name,
           rightStr: "甯佺",
-          rightValue: ""
+          rightValue: "浜烘皯甯�"
         },
         {
           leftStr: "棰勭畻缁濆鍊�",
-          leftValue: "",
+          leftValue: item.capital_budget,
           rightStr: "棰勮鎴愪氦鏃ユ湡",
-          rightValue: ""
+          rightValue: item.expected_time
         },
         {
           leftStr: "棰勮鍚堝悓閲戦",
-          leftValue: "",
+          leftValue: item.projected_amount,
           rightStr: "褰撳墠鐘舵��",
-          rightValue: ""
+          rightValue: item.status_id
         }
       ]
       this.dynamicInfoList = [
@@ -408,58 +418,58 @@
       this.businessInfoList = [
         {
           leftStr: "瀹㈡埛闇�姹傛垨鐥涚偣锛坵hy锛�",
-          leftValue: ""
+          leftValue: item.pain_points
         },
         {
           leftStr: "鏄惁宸茬粡绔嬮」锛坧lan锛�",
-          leftValue: ""
+          leftValue: item.whether_established
         },
         {
           leftStr: "璧勯噾棰勭畻鏄灏戯紙plan锛�",
-          leftValue: ""
+          leftValue: item.capital_budget
         },
         {
           leftStr: "鍏抽敭鍐崇瓥浜烘槸璋侊紙who锛�",
-          leftValue: ""
+          leftValue: item.key_maker
         },
         {
           leftStr: "鍏抽敭鍐崇瓥鍥犵礌鏈夊摢浜涳紙what锛�",
-          leftValue: ""
+          leftValue: item.key_factors
         },
         {
           leftStr: "鍐崇瓥娴佺▼鏄�庢牱鐨勶紙what锛�",
-          leftValue: ""
+          leftValue: item.process
         },
         {
           leftStr: "绔炰簤瀵规墜鎻愪緵鐨勬柟妗堬紙what锛�",
-          leftValue: ""
+          leftValue: item.solutions
         }
       ]
       this.swotInfoList = [
         {
           leftStr: "浼樺娍(S)",
-          leftValue: "",
+          leftValue: item.advantages,
           rightStr: "鍔e娍(W)",
-          rightValue: ""
+          rightValue: item.disadvantages
         },
         {
           leftStr: "鏈轰細(O)",
-          leftValue: "",
+          leftValue: item.opportunities,
           rightStr: "濞佽儊(T)",
-          rightValue: ""
+          rightValue: item.threats
         }
       ]
       this.addressInfoList = [
         {
           leftStr: "鍥藉",
-          leftValue: "",
+          leftValue: "涓浗",
           rightStr: "鐪佷唤",
-          rightValue: ""
+          rightValue: item.Province.name
         },
         {
           leftStr: "鍩庡競",
-          leftValue: "",
-          rightStr: "鍖哄煙",
+          leftValue: item.City.name,
+          rightStr: "",
           rightValue: ""
         },
         {
@@ -484,6 +494,7 @@
     },
     handleClose() {
       this.detailConfig.visible = false
+      this.$parent.getData()
     },
     // tab鍒囨崲
     tabsClick(tab, event) {
@@ -516,9 +527,17 @@
     },
     // 鎺ㄨ繘
     advanceClick(item) {
-      console.log(item)
-      this.advanceConfig.visible = true
-      this.advanceConfig.active = item.title
+      let options = []
+      for (let i = 0; i < this.stepsList.length; i++) {
+        options.push(this.stepsList[i])
+      }
+      this.advanceConfig = {
+        visible: true,
+        active: item.id,
+        allOptions: this.stepsList,
+        options: options,
+        id: this.detailConfig.infomation.id
+      }
     }
   }
 }
@@ -629,7 +648,7 @@
             }
             .step-view {
               padding: 30px 60px 5px;
-              height: 100px;
+              height: 80px;
               .step-title-view {
                 margin-top: 10px;
                 font-size: 12px;

--
Gitblit v1.8.0