songshankun
2023-10-12 87dfb09836f2942ab9ae5f87d712c05226ad9c62
src/views/sales/salesOpportunity/DetailOpportunity.vue
@@ -9,7 +9,7 @@
    >
      <template slot="title">
        <div class="header">
          <span class="header-label">机会名称</span>
          <span class="header-label">销售机会</span>
          <span class="header-title">{{ detailConfig.infomation.name }}</span>
        </div>
      </template>
@@ -22,7 +22,7 @@
                <div>跟进记录<el-badge type="primary" :value="2"> </el-badge></div>
              </template> -->
            </el-tab-pane>
            <el-tab-pane label="收款预测" name="collectionForecast"></el-tab-pane>
            <!-- <el-tab-pane label="收款预测" name="collectionForecast"></el-tab-pane> -->
            <el-tab-pane label="报价单" name="quotation"></el-tab-pane>
            <el-tab-pane label="销售明细单" name="detail"></el-tab-pane>
            <el-tab-pane label="服务合同" name="serviceContract"></el-tab-pane>
@@ -240,23 +240,23 @@
          </div> -->
        </div>
        <div v-if="activeName === 'second'" class="second">
          <FollowupRecords :isDetail="true" />
          <FollowupRecords :isDetail="true" :add-config="addConfig" />
        </div>
        <div v-if="activeName === 'collectionForecast'" class="second">
          <!-- <SalesOpportunity :isDetail="true" /> -->
        </div>
        <div v-if="activeName === 'quotation'" class="second">
          <Quotation :isDetail="true" />
          <Quotation :isDetail="true" :add-config="addConfig" />
        </div>
        <div v-if="activeName === 'detail'" class="second">
          <SalesDetails :isDetail="true" />
          <SalesDetails :isDetail="true" :add-config="addConfig" />
        </div>
        <div v-if="activeName === 'serviceContract'" class="second">
          <ServiceContract :isDetail="true" />
          <ServiceContract :isDetail="true" :add-config="addConfig" />
        </div>
      </div>
      <!-- 推进 -->
      <DetailAdvanceDialog v-if="advanceConfig.visible" :advance-config="advanceConfig" />
      <DetailAdvanceDialog v-if="advanceConfig.visible" :advance-config="advanceConfig" @pushed="updatePushData" />
    </el-drawer>
  </div>
</template>
@@ -268,6 +268,7 @@
import ServiceContract from "@/views/service/serviceContract"
import DetailAdvanceDialog from "@/views/sales/salesOpportunity/DetailAdvanceDialog"
import { getSaleStageList } from "@/api/sales/salesOpportunity"
import {getAllData} from "@/api/client/client";
export default {
  name: "DetailClientManage",
  props: {
@@ -285,6 +286,7 @@
  computed: {},
  data() {
    return {
      statusList: [],
      detailConfig: this.opportunityDetail,
      activeName: "first",
      isSchduleExpand: true, // 进度追踪
@@ -311,15 +313,43 @@
        active: "",
        allOptions: [],
        options: []
      }
      },
      addConfig: {}
    }
  },
  created() {
    this.getSaleStageList()
    this.setData(this.detailConfig.infomation)
    this.addConfig = {
      id_name: "sale_chance_id",
      keywordType: "销售机会",
      keyword: this.detailConfig.infomation.name,
      id: this.detailConfig.infomation.id,
      common_name: this.detailConfig.infomation.name,
      client_name: this.detailConfig.infomation.client.name,
      contact_name: this.detailConfig.infomation.contact_name,
      client_id: this.detailConfig.infomation.client_id,
      contact_id: this.detailConfig.infomation.contact_id,
      sale_chance_name: this.detailConfig.infomation.name,
      sale_chance_id: this.detailConfig.infomation.id
    }
    this.getSaleStageList().then(()=>{
      return  this.getAllData()
    }).then((statusList)=>{
      this.statusList =statusList
      this.setData(this.detailConfig.infomation)
    })
    console.log('this.detailConfig.infomation',this.detailConfig.infomation)
  },
  mounted() {},
  methods: {
    /**
     * 更新推进记录
     */
    updatePushData(e){
      this.sale_active = e.step - 1
    },
    async getSaleStageList() {
      await getSaleStageList().then((res) => {
        this.stepsList = res.data.list
@@ -348,7 +378,7 @@
          leftStr: "商机来源",
          leftValue: item.sales_sources.name,
          rightStr: "商机类型",
          rightValue: "" // item.SaleType.name
          rightValue: item.sale_type.name
        },
        {
          leftStr: "销售阶段",
@@ -358,20 +388,20 @@
        },
        {
          leftStr: "老客户营销",
          leftValue: item.regular_customers_id,
          rightStr: "签到",
          leftValue: item.regular_customers.name,
          rightStr: "审批状态",
          rightValue: ""
        },
        {
          leftStr: "审批状态",
          leftValue: "",
          rightStr: "竞争对手",
          leftStr: "竞争对手",
          leftValue: item.competitors,
          rightStr: "创建人",
          rightValue: ""
        },
        {
          leftStr: "创建人",
          leftStr: "创建时间",
          leftValue: "",
          rightStr: "创建时间",
          rightStr: "",
          rightValue: ""
        }
      ]
@@ -392,7 +422,7 @@
          leftStr: "预计合同金额",
          leftValue: item.projected_amount,
          rightStr: "当前状态",
          rightValue: item.status_id
          rightValue: this.statusList.find(ele=>ele.id === item.status_id)?.name ?? ''
        }
      ]
      this.dynamicInfoList = [
@@ -538,6 +568,16 @@
        options: options,
        id: this.detailConfig.infomation.id
      }
    },
    getAllData(){
     return getAllData()
          .then((res) => {
            return res.data.status
          })
          .catch((err) => {
            console.log(err)
          })
    }
  }
}