songshankun
2023-10-16 216ef4cf6dc78537e556b1552cca0aac4914e216
src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -52,12 +52,17 @@
                      "
                      value-key="name"
                      @select="handleSelectClient('client', $event)"
                      :disabled="isNameChanceEdit"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('client')">
                    <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('client')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div
                      v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0"
                      v-if="
                        editConfig.infomation.client_name &&
                        editConfig.infomation.client_name.length > 0 &&
                        !isNameChanceEdit
                      "
                      class="common-select-btn"
                      @click="clearupClient('client')"
                    >
@@ -80,12 +85,17 @@
                      "
                      value-key="name"
                      @select="handleSelectClient('chance', $event)"
                      :disabled="isNameChanceEdit"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('chance')">
                    <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('chance')">
                      <i class="el-icon-circle-plus-outline"></i>
                    </div>
                    <div
                      v-if="editConfig.infomation.sale_chance_name && editConfig.infomation.sale_chance_name.length > 0"
                      v-if="
                        editConfig.infomation.sale_chance_name &&
                        editConfig.infomation.sale_chance_name.length > 0 &&
                        !isNameChanceEdit
                      "
                      class="common-select-btn"
                      @click="clearupClient('chance')"
                    >
@@ -375,6 +385,9 @@
import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan"
import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
import { getSaleChanceList} from "@/api/sales/salesOpportunity"
import {mapActions} from "vuex"
export default {
  name: "AddSalesDetailsDialog",
  mixins: [codeMixin],
@@ -441,7 +454,8 @@
        title: "新建",
        infomation: {}
      },
      amountTotal: 0
      amountTotal: 0,
      isNameChanceEdit: false
    }
  },
  created() {
@@ -450,6 +464,12 @@
    this.setTableForm()
    this.getCommonData()
    this.formInfo()
    if (this.editConfig.title === "新建" && this.editConfig.infomation.client_name.length > 0) {
      this.isNameChanceEdit = true
    }
    // else {
    // }
  },
  watch: {
    "editClientManageConfig.visible"(val) {
@@ -462,6 +482,7 @@
    }
  },
  methods: {
    ...mapActions(["getChanceFilter"]),
    formInfo() {
      this.objCode.type = "销售明细编码"
      this.objCode.codeStandID = ""
@@ -592,10 +613,16 @@
        return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
      }
    },
    handleSelectClient(value, item) {
    async handleSelectClient(value, item) {
      if (value === "client") {
        this.clientId = item.id
        this.editConfig.infomation.client_name = item.name
        // 需要修改
        await getSaleChanceList({
          client_id:this.clientId
        }).then((res)=>{
          this.getChanceFilter(res.data.list)
        })
      } else if (value === "chance") {
        this.saleChanceId = item.id
        this.editConfig.infomation.client_name = item.name