yangfeng
2023-07-23 a63bbe043b87d9becfe483bb1477d471a79edcd8
src/views/client/followupRecords/AddFollowupRecordsDialog.vue
@@ -23,9 +23,18 @@
              <el-col :span="12">
                <el-form-item label="客户名称" prop="client_name">
                  <div class="custom-name">
                    <el-input v-model="editConfig.infomation.client_name"></el-input>
                    <div class="common-select-btn"><i class="el-icon-circle-plus-outline"></i></div>
                    <div class="common-select-btn"><i class="el-icon-edit-outline"></i></div>
                    <el-autocomplete
                      v-model="editConfig.infomation.client_name"
                      :fetch-suggestions="querySearchAsync"
                      value-key="name"
                      @select="handleSelectClient"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
@@ -181,6 +190,12 @@
        <el-button type="primary" size="small" @click="saveClick('form')">保 存</el-button>
        <el-button size="small" @click="editConfig.visible = false">取 消</el-button>
      </div>
      <!-- 选择客户 -->
      <SelectClientDialog
        v-if="editSelectClientConfig.editVisible"
        :edit-common-config="editSelectClientConfig"
        @selClient="selClient"
      />
    </el-dialog>
  </div>
</template>
@@ -188,6 +203,7 @@
<script>
import { getAllData } from "@/api/client/client"
import { getAddFollowRecord, getUpdateFollowRecord } from "@/api/client/followupRecords"
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
export default {
  name: "AddFollowupRecordsDialog",
  props: {
@@ -197,30 +213,18 @@
        return {
          visible: false,
          title: "新建",
          infomation: {
            client_name: "",
            number: "",
            client_status_id: "",
            contact_id: "",
            member_id: "",
            topic: "",
            record: "",
            phoneNumber: "",
            sale_chance_id: "",
            sales_leads_id: "",
            follow_time: "",
            next_follow_time: "",
            purpose: "",
            content: ""
          }
          infomation: {}
        }
      }
    }
  },
  components: {},
  components: { SelectClientDialog },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
    },
    clientList() {
      return this.$store.state.getClientName.clientList
    }
  },
  data() {
@@ -236,10 +240,16 @@
      clientStatusOptions: [], // 客户状态
      memberOptions: [],
      unflodCollapseStr: "收起",
      isUnflod: true
      isUnflod: true,
      editSelectClientConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      }
    }
  },
  created() {
    this.$store.dispatch("geClient")
    this.getCommonData()
  },
  methods: {
@@ -331,6 +341,33 @@
      }
      return params
    },
    // 选择客户相关方法
    querySearchAsync(queryString, cb) {
      var restaurants = this.clientList
      var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
      cb(results)
    },
    createStateFilter(queryString) {
      return (state) => {
        return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
      }
    },
    handleSelectClient(item) {
      this.editConfig.infomation.client_id = item.id
    },
    selClientClick() {
      this.editSelectClientConfig.editVisible = true
    },
    selClient(row) {
      console.log(row)
      this.editConfig.infomation.client_name = row.name
      this.editConfig.infomation.client_id = row.id
    },
    // 清除已选择用户
    clearupClient() {
      this.editConfig.infomation.client_name = ""
      this.editConfig.infomation.client_id = 0
    },
    // 添加附件
    addAnnexClick() {},
    // 设置允许上传文件格式
@@ -365,28 +402,20 @@
    .basic-info-view {
      margin-top: 10px;
      padding-right: 40px;
      .custom-name {
        display: flex;
        .common-select-btn {
          margin-left: 5px;
          font-size: 16px;
        }
      }
      .custom-name,
      .common-select {
        display: flex;
        .common-select-sel {
          width: 270px;
        }
        .common-select-btn {
          margin-left: 5px;
          font-size: 16px;
          font-size: 18px;
          cursor: pointer;
        }
      }
    }
    .address-view {
      margin-top: 10px;
      padding-right: 40px;
      .common-select {
        .common-select-sel {
          width: 270px;
        }
      }
    }
    .annex-view {
      display: flex;