From 4898b385886794bf0663ec2d883ea808b78ae522 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期三, 19 七月 2023 11:37:25 +0800 Subject: [PATCH] 接口联调相关api添加 --- src/views/client/salesLead/AddSalesLeadDialog.vue | 134 ++++++++++++++++++++++++++------------------ 1 files changed, 78 insertions(+), 56 deletions(-) diff --git a/src/views/custom/salesLead/AddSalesLeadDialog.vue b/src/views/client/salesLead/AddSalesLeadDialog.vue similarity index 76% rename from src/views/custom/salesLead/AddSalesLeadDialog.vue rename to src/views/client/salesLead/AddSalesLeadDialog.vue index e0e9680..179850f 100644 --- a/src/views/custom/salesLead/AddSalesLeadDialog.vue +++ b/src/views/client/salesLead/AddSalesLeadDialog.vue @@ -82,7 +82,7 @@ <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.value" :label="item.label" :value="item.value"> + <el-option v-for="item in ownerOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -108,25 +108,67 @@ </el-row> --> <el-row> <el-col :span="12"> - <el-form-item label="鍥藉" prop="country"> - <CommonSelectView :common-value="editConfig.infomation.country" :common-options="countryOptions" /> + <el-form-item label="鍥藉" prop="country_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.country_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <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> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鐪佷唤" prop="province"> - <CommonSelectView :common-value="editConfig.infomation.province" :common-options="provinceOptions" /> - </el-form-item> - </el-col> - </el-row> - <el-row> - <el-col :span="12"> - <el-form-item label="鍩庡競" prop="city"> - <CommonSelectView :common-value="editConfig.infomation.city" :common-options="cityOptions" /> + <el-form-item label="鐪佷唤" prop="province_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.province_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <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> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍖哄煙" prop="region"> - <CommonSelectView :common-value="editConfig.infomation.region" :common-options="regionOptions" /> + <el-form-item label="鍩庡競" prop="city_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.city_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <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> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鍖哄煙" prop="region_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.region_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in regionOptions" :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> </el-form-item> </el-col> </el-row> @@ -178,9 +220,9 @@ </template> <script> -import CommonSelectView from "@/components/makepager/CommonSelectView" import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog" -import { getSalesSourcesList, getAddSalesLeads, getUpdateSalesLeads } from "@/api/custom/salesLead" +import { getAddSalesLeads, getUpdateSalesLeads } from "@/api/client/salesLead" +import { getAllData } from "@/api/client/client" export default { name: "AddSalesLeadDialog", @@ -200,10 +242,10 @@ businessStatus: "", sales_sources_id: "", member_id: "", - country: "", - province: "", - city: "", - region: "", + country_id: "", + province_id: "", + city_id: "", + region_id: "", address: "", desc: "", id: "" @@ -212,7 +254,7 @@ } } }, - components: { CommonSelectView, EditDropdownDialog }, + components: { EditDropdownDialog }, computed: { searchCommonHeight() { return this.$refs.searchCommonView.offsetHeight @@ -228,16 +270,7 @@ businessStatus: [{ required: true, message: "璇疯緭鍏ュ晢鏈虹姸鎬�", trigger: "blur" }], sales_sources_id: [{ required: true, message: "璇烽�夋嫨鍟嗘満鏉ユ簮", trigger: "change" }] }, - businessSourceOptions: [ - { id: "1", name: "鍚庡彴娉ㄥ唽" }, - { id: "2", name: "浠g悊鍟嗗鎴�" }, - { id: "3", name: "鐢佃瘽闄岀敓鎷滆" }, - { id: "4", name: "鐩存帴璁块棶" }, - { id: "5", name: "椤圭洰鍚堜綔" }, - { id: "6", name: "涓汉鑷壘" }, - { id: "7", name: "浜屾閿�鍞�" }, - { id: "8", name: "鍏徃鐢佃瘽" } - ], + businessSourceOptions: [], ownerOptions: [ { value: "1", label: "BOSS" }, { value: "2", label: "Mia" }, @@ -247,25 +280,10 @@ { value: "6", label: "閿�鍞�" }, { value: "7", label: "閿�鍞�荤洃" } ], - countryOptions: [{ value: "1", label: "涓浗" }], // 鍥藉 - provinceOptions: [ - { value: "1", label: "鍖椾含甯�" }, - { value: "2", label: "涓婃捣甯�" }, - { value: "3", label: "鍚夋灄鐪�" }, - { value: "4", label: "闄曡タ鐪�" } - ], // 鐪佷唤 - cityOptions: [ - { value: "1", label: "鍖椾含甯�" }, - { value: "2", label: "涓婃捣甯�" }, - { value: "3", label: "鍚夋灄甯�" }, - { value: "4", label: "瑗垮畨甯�" } - ], // 鍩庡競 - regionOptions: [ - { value: "1", label: "鏈濋槼鍖�" }, - { value: "2", label: "娴锋穩鍖�" }, - { value: "3", label: "閫氬窞鍖�" }, - { value: "4", label: "瑗垮煄鍖�" } - ], // 鍖哄煙 + countryOptions: [], // 鍥藉 + provinceOptions: [], // 鐪佷唤 + cityOptions: [], // 鍩庡競 + regionOptions: [], // 鍖哄煙 unflodCollapseStr: "鏀惰捣", isUnflod: true, editDropdownConfig: { @@ -280,10 +298,14 @@ }, methods: { getCommonData() { - getSalesSourcesList() + getAllData() .then((res) => { console.log(res) - this.businessSourceOptions = res.data.list + this.businessSourceOptions = res.data.sales_source + this.countryOptions = res.data.country + this.provinceOptions = res.data.province + this.cityOptions = res.data.city + this.regionOptions = res.data.region }) .catch((err) => { console.log(err) @@ -298,18 +320,18 @@ if (valid) { console.log(this.editConfig.infomation) let params = { - city_id: 0, + city_id: this.editConfig.infomation.city_id || 0, contact_name: this.editConfig.infomation.contact_name || "", contact_phone: this.editConfig.infomation.contact_phone || "", contact_position: this.editConfig.infomation.contact_position || "", - country_id: 0, + country_id: this.editConfig.infomation.country_id || 0, id: this.editConfig.title === "鏂板缓" ? 0 : this.editConfig.infomation.id, desc: this.editConfig.infomation.desc || "", member_id: parseInt(this.editConfig.infomation.member_id) || 0, name: this.editConfig.infomation.name || "", number: this.editConfig.infomation.number || "", - province_id: 0, - region_id: 0, + province_id: this.editConfig.infomation.province_id || 0, + region_id: this.editConfig.infomation.region_id || 0, sales_sources_id: this.editConfig.infomation.sales_sources_id || 0 } console.log(params) -- Gitblit v1.8.0