zuozhengqing
2023-10-17 4e8e3e78c35ca2ff4a31f865561f0d5c4d89dad9
src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -93,6 +93,7 @@
                      "
                      value-key="name"
                      @select="handleSelectClient('contact', $event)"
                      placeholder="请先选择客户名称"
                      :disabled="isContact"
                    ></el-autocomplete>
                    <div v-if="!isContact" class="common-select-btn" @click="selClientClick('contact')">
@@ -655,6 +656,10 @@
    }
    this.getCommonData()
    this.formInfo()
    if (this.editConfig.title === "编辑") {
      this.isContact = false
      this.getContactList(this.editConfig.infomation.contact_id)
    }
  },
  watch: {
    "editConfig.visible"(val) {
@@ -707,6 +712,7 @@
    // 保存
    saveClick(formName) {
      this.$refs[formName].validate((valid) => {
        this.validateFormNumber()
        if (valid) {
          console.log(this.editConfig.infomation)
          const params = this.saveParams()
@@ -772,7 +778,6 @@
        status_id: data.status_id || 0,
        threats: data.threats || "",
        whether_established: data.whether_established || "",
        remark: data.remark || "",
        detail_address: data.detail_address || "",
@@ -784,10 +789,11 @@
    // 获取联系人列表
    getContactList(id) {
      getContactList({
        clientId: id,
        page: 0,
        pageSize: 0,
        search_map: {}
        search_map: {
          client_id: id
        }
      }).then((res) => {
        if (res.code == 200) {
          this.contactNamelist = res.data.list
@@ -813,28 +819,36 @@
    handleSelectClient(value, item) {
      if (value === "client") {
        this.clientId = item.id
        this.editConfig.infomation.client_name = item.name
        this.editConfig.infomation.contact_name = ""
        this.contactId = 0
        this.isContact = false
        this.getContactList(item.id)
      } else if (value === "contact") {
        this.editConfig.infomation.contact_name = item.name
        this.contactId = item.id
      }
      this.refresh()
    },
    selClientClick(value) {
      if (value === "client") {
        this.editSelectClientConfig.editVisible = true
      } else if (value === "contact") {
        this.editSelectContactConfig.editVisible = true
        this.editSelectContactConfig.clientId = this.clientId
      }
    },
    selClient(row, value) {
      if (value === "contact") {
        this.editConfig.infomation.contact_name = row.name
        this.contactId = row.id
        this.isContact = false
        this.getContactList(row.id)
      } else if (value === "client") {
        this.editConfig.infomation.client_name = row.name
        this.clientId = row.id
        this.editConfig.infomation.contact_name = ""
        this.contactId = 0
        this.isContact = false
        this.getContactList(row.id)
      }
      this.refresh()
    },
@@ -872,9 +886,8 @@
    },
    async getCityList(val, value) {
      await getCityList({ province_id: val }).then((res) => {
        console.log(res)
        if (res.data.code === 200) {
          this.cityOptions = res.data.data.list
        if (res.code === 200) {
          this.cityOptions = res.data.list
          if (value === "sel") {
            this.editConfig.infomation.city_id = ""
          }