From 96fdf32bd5612b6c16dcbcc8352a9f54adcc8e7e Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 18 八月 2023 16:26:59 +0800 Subject: [PATCH] 產品相關及bug修復 --- src/views/client/salesLead/AddSalesLeadDialog.vue | 75 ++++++++++++++++++++----------------- 1 files changed, 41 insertions(+), 34 deletions(-) diff --git a/src/views/client/salesLead/AddSalesLeadDialog.vue b/src/views/client/salesLead/AddSalesLeadDialog.vue index 69e2c71..83da223 100644 --- a/src/views/client/salesLead/AddSalesLeadDialog.vue +++ b/src/views/client/salesLead/AddSalesLeadDialog.vue @@ -78,16 +78,16 @@ > </el-option> </el-select> - <div class="common-select-btn" @click="editDropdownBox"> + <!-- <div class="common-select-btn" @click="editDropdownBox"> <i class="el-icon-setting"></i> - </div> + </div> --> </div> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="璐熻矗浜�" prop="member_id"> <el-select v-model="editConfig.infomation.member_id" placeholder="璇烽�夋嫨" size="mini"> - <el-option v-for="item in ownerOptions" :key="item.id" :label="item.username" :value="item.id"> + <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -120,11 +120,12 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + disabled > <el-option v-for="item in countryOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> </el-select> - <div class="common-select-btn"><i class="el-icon-setting"></i></div> + <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> --> </div> </el-form-item> </el-col> @@ -136,11 +137,12 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + @change="selProvinceChange" > <el-option v-for="item in provinceOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> </el-select> - <div class="common-select-btn"><i class="el-icon-setting"></i></div> + <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> --> </div> </el-form-item> </el-col> @@ -152,15 +154,16 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + :disabled="cityOptions.length <= 0 ? true : false" > <el-option v-for="item in cityOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> </el-select> - <div class="common-select-btn"><i class="el-icon-setting"></i></div> + <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> --> </div> </el-form-item> </el-col> - <el-col :span="12"> + <!-- <el-col :span="12"> <el-form-item label="鍖哄煙" prop="region_id"> <div class="common-select"> <el-select @@ -175,7 +178,7 @@ <div class="common-select-btn"><i class="el-icon-setting"></i></div> </div> </el-form-item> - </el-col> + </el-col> --> </el-row> <!-- <el-row> <el-col :span="24"> @@ -228,6 +231,7 @@ import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog" import { getAddSalesLeads, getUpdateSalesLeads } from "@/api/client/salesLead" import { getAllData } from "@/api/client/client" +import { getCityList } from "@/api/common/address" export default { name: "AddSalesLeadDialog", @@ -244,11 +248,7 @@ } }, components: { EditDropdownDialog }, - computed: { - searchCommonHeight() { - return this.$refs.searchCommonView.offsetHeight - } - }, + computed: {}, data() { return { dialogWidth: "80%", @@ -269,8 +269,8 @@ ] }, businessSourceOptions: [], - ownerOptions: [], - countryOptions: [], // 鍥藉 + memberOptions: [], + countryOptions: [{ id: 1, name: "涓浗" }], // 鍥藉 provinceOptions: [], // 鐪佷唤 cityOptions: [], // 鍩庡競 regionOptions: [], // 鍖哄煙 @@ -284,22 +284,27 @@ } }, created() { + if (this.editConfig.title !== "鏂板缓" && this.editConfig.infomation.province_id !== 0) { + this.getCityList(this.editConfig.infomation.province_id, "edit") + } this.getCommonData() }, - mounted() { - this.setData() - }, + mounted() {}, methods: { getCommonData() { + this.editConfig.infomation.country_id = 1 + this.editConfig.infomation.province_id = + this.editConfig.infomation.province_id === 0 ? "" : this.editConfig.infomation.province_id + this.editConfig.infomation.city_id = + this.editConfig.infomation.city_id === 0 ? "" : this.editConfig.infomation.city_id getAllData() .then((res) => { console.log(res) this.businessSourceOptions = res.data.sales_source - this.countryOptions = res.data.country + // this.countryOptions = res.data.country this.provinceOptions = res.data.province - this.cityOptions = res.data.city this.regionOptions = res.data.region - this.ownerOptions = res.data.member + this.memberOptions = res.data.member }) .catch((err) => { console.log(err) @@ -383,23 +388,25 @@ this.editDropdownConfig.editVisible = true this.editDropdownConfig.title = "鍟嗘満鏉ユ簮" }, - // 鏁版嵁澶勭悊 - setData() { - this.editConfig.infomation.city_id = - this.editConfig.infomation.city_id === 0 ? "" : this.editConfig.infomation.city_id - this.editConfig.infomation.member_id = - this.editConfig.infomation.member_id === 0 ? "" : this.editConfig.infomation.member_id - this.editConfig.infomation.province_id = - this.editConfig.infomation.province_id === 0 ? "" : this.editConfig.infomation.province_id - this.editConfig.infomation.region_id = - this.editConfig.infomation.region_id === 0 ? "" : this.editConfig.infomation.region_id - this.editConfig.infomation.country_id = - this.editConfig.infomation.country_id === 0 ? "" : this.editConfig.infomation.country_id - }, // 鎵嬫満鍙疯緭鍏� confirmPhone(value) { const inputValue = value.replace(/[^\d*]/g, "") this.editConfig.infomation.contact_phone = inputValue + }, + // 閫夋嫨鐪佷唤 + selProvinceChange(val) { + this.getCityList(val, "sel") + }, + 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 (value === "sel") { + this.editConfig.infomation.city_id = "" + } + } + }) } } } -- Gitblit v1.8.0