From 33836e44d74759010d8e79f3cc702186c4bdf4ea Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期二, 17 十月 2023 11:22:56 +0800 Subject: [PATCH] bug修复(5235 5236) --- src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue | 522 ++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 362 insertions(+), 160 deletions(-) diff --git a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue index 9a8ff45..14316e5 100644 --- a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue +++ b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue @@ -5,13 +5,16 @@ :visible.sync="editConfig.visible" :width="dialogWidth" :before-close="handleClose" + append-to-body + custom-class="iframe-dialog" > <el-form + v-if="refreshFlag" ref="form" :model="editConfig.infomation" :rules="rules" label-position="right" - label-width="308px" + label-width="208px" size="mini" style="height: 60vh; overflow-x: hidden" > @@ -21,27 +24,25 @@ <div class="basic-info-title">鏈轰細鍩烘湰淇℃伅</div> <div class="basic-info-view"> <el-row> - <el-col :span="12"> - <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name"> - <div class="custom-name"> - <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> + <!-- <el-col :span="12">--> + <!-- <el-form-item label="閿�鍞満浼氱紪鍙�" prop="number">--> + <!-- <el-input v-model="editConfig.infomation.number"></el-input>--> + <!-- </el-form-item>--> + <!-- </el-col>--> <el-col :span="12"> <el-form-item label="閿�鍞満浼氱紪鍙�" prop="number"> - <el-input v-model="editConfig.infomation.number"></el-input> + <WordInput + v-if="codenumer && (explain != '' || isIdDisabled) && method == 0" + :codenumer="codenumer" + :sum="sum" + :disabled="editConfig.title !== '鏂板缓' || isIdDisabled" + :inputValue="inputValue" + @codeList="codeList" + /> + <span v-else-if="method == 0" style="color: #f56c6c" + >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span + > + <span v-else>{{ editConfig.title === "鏂板缓" ? "鑷姩鐢熸垚" : editConfig.infomation.number }}</span> </el-form-item> </el-col> <el-col :span="12"> @@ -54,12 +55,66 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鑱旂郴浜哄鍚�" prop="contact_id"> - <el-input v-model="editConfig.infomation.contact_id"></el-input> + <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name" ref="clientName"> + <div class="custom-name"> + <el-autocomplete + v-model="editConfig.infomation.client_name" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'client') + } + " + value-key="name" + @select="handleSelectClient('client', $event)" + ></el-autocomplete> + <div 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" + class="common-select-btn" + @click="clearupClient('client')" + > + <i class="el-icon-remove-outline" title="娓呴櫎"></i> + </div> + </div> + </el-form-item> + </el-col> + + <el-col :span="12"> + <el-form-item label="鑱旂郴浜哄鍚�" prop="contact_name"> + <div class="custom-name"> + <el-autocomplete + v-model="editConfig.infomation.contact_name" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'contact') + } + " + value-key="name" + @select="handleSelectClient('contact', $event)" + placeholder="璇峰厛閫夋嫨瀹㈡埛鍚嶇О" + :disabled="isContact" + ></el-autocomplete> + <div v-if="!isContact" class="common-select-btn" @click="selClientClick('contact')"> + <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> + </div> + <div + v-if=" + editConfig.infomation.contact_name && + editConfig.infomation.contact_name.length > 0 && + !isContact + " + class="common-select-btn" + @click="clearupClient('contact')" + > + <i class="el-icon-remove-outline" title="娓呴櫎"></i> + </div> + </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍟嗘満鏉ユ簮" prop="sales_sources_id"> + <el-form-item label="鏈轰細鏉ユ簮" prop="sales_sources_id"> <div class="common-select"> <el-select v-model="editConfig.infomation.sales_sources_id" @@ -76,12 +131,12 @@ </el-option> </el-select> <!-- @click="editDropdownBox" --> - <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-form-item label="鍟嗘満绫诲瀷" prop="sale_type_id"> + <el-form-item label="鏈轰細绫诲瀷" prop="sale_type_id"> <div class="common-select"> <el-select v-model="editConfig.infomation.sale_type_id" @@ -93,7 +148,7 @@ </el-option> </el-select> <!-- @click="editDropdownBox" --> - <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> @@ -110,7 +165,7 @@ </el-option> </el-select> <!-- @click="editDropdownBox" --> - <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> @@ -120,9 +175,9 @@ v-model="editConfig.infomation.member_id" placeholder="璇烽�夋嫨" size="mini" - style="width: 63%" + style="width: 100%" > - <el-option v-for="item in memberOptions" :key="item.id" :label="item.name" :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> @@ -145,7 +200,7 @@ </el-option> </el-select> <!-- @click="editDropdownBox" --> - <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> @@ -161,10 +216,10 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="鍙兘鎬�(%)" prop="possibilities"> + <el-form-item label="鍙兘鎬�(%)" prop="possibilities_id"> <div class="common-select"> <el-select - v-model="editConfig.infomation.possibilities" + v-model="editConfig.infomation.possibilities_id" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" @@ -173,7 +228,7 @@ </el-option> </el-select> <!-- @click="editDropdownBox" --> - <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> @@ -183,7 +238,7 @@ v-model="editConfig.infomation.currency" placeholder="璇烽�夋嫨" size="mini" - style="width: 63%" + style="width: 100%" > <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -192,18 +247,37 @@ </el-col> <el-col :span="12"> <el-form-item label="棰勭畻缁濆鍊�" prop="budget"> - <el-input v-model="editConfig.infomation.budget"></el-input> + <el-input-number + v-model="editConfig.infomation.budget" + placeholder="璇疯緭鍏�" + :min="0" + :precision="2" + :controls="false" + style="width: 100%" + ></el-input-number> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="棰勮鎴愪氦鏃ユ湡" prop="expected_time"> - <el-date-picker v-model="editConfig.infomation.expected_time" type="date" placeholder="閫夋嫨鏃ユ湡"> + <el-date-picker + v-model="editConfig.infomation.expected_time" + value-format="yyyy-MM-dd" + type="date" + style="width: 100%" + placeholder="閫夋嫨鏃ユ湡" + > </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="棰勮鍚堝悓閲戦" prop="projected_amount"> - <el-input v-model="editConfig.infomation.projected_amount"></el-input> + <el-input-number + v-model="editConfig.infomation.projected_amount" + placeholder="璇疯緭鍏�" + :min="0" + :controls="false" + style="width: 100%; margin-right: 5px" + ></el-input-number> </el-form-item> </el-col> <el-col :span="12"> @@ -219,7 +293,7 @@ </el-option> </el-select> <!-- @click="editDropdownBox" --> - <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> @@ -229,16 +303,17 @@ <div class="basic-info-title">鍟嗘満涓冭绱�(5W2P)</div> <div class="basic-info-view"> <el-row> - <el-col :span="20"> + <el-col> <el-form-item label="瀹㈡埛闇�姹傛垨鐥涚偣锛坵hy锛�" prop="pain_points"> <el-input type="textarea" + style="width: 100%" :autosize="{ minRows: 2 }" v-model="editConfig.infomation.pain_points" ></el-input> </el-form-item> </el-col> - <el-col :span="20"> + <el-col> <el-form-item label="鏄惁宸茬粡绔嬮」锛坧lan锛�" prop="whether_established"> <el-input type="textarea" @@ -247,7 +322,7 @@ ></el-input> </el-form-item> </el-col> - <el-col :span="20"> + <el-col> <el-form-item label="璧勯噾棰勭畻鏄灏戯紙plan锛�" prop="capital_budget"> <el-input type="textarea" @@ -256,7 +331,7 @@ ></el-input> </el-form-item> </el-col> - <el-col :span="20"> + <el-col> <el-form-item label="鍏抽敭鍐崇瓥浜烘槸璋侊紙who锛�" prop="key_maker"> <el-input type="textarea" @@ -265,7 +340,7 @@ ></el-input> </el-form-item> </el-col> - <el-col :span="20"> + <el-col> <el-form-item label="鍏抽敭鍐崇瓥鍥犵礌鏈夊摢浜涳紙what锛�" prop="key_factors"> <el-input type="textarea" @@ -274,7 +349,7 @@ ></el-input> </el-form-item> </el-col> - <el-col :span="20"> + <el-col> <el-form-item label="鍐崇瓥娴佺▼鏄�庢牱鐨勶紙what锛�" prop="process"> <el-input type="textarea" @@ -283,7 +358,7 @@ ></el-input> </el-form-item> </el-col> - <el-col :span="20"> + <el-col> <el-form-item label="绔炰簤瀵规墜鎻愪緵鐨勬柟妗堬紙what锛�" prop="solutions"> <el-input type="textarea" @@ -303,7 +378,7 @@ <el-input type="textarea" :autosize="{ minRows: 2 }" - v-model="editConfig.infomation.advantage" + v-model="editConfig.infomation.advantages" ></el-input> </el-form-item> </el-col> @@ -358,11 +433,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> @@ -374,11 +450,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> @@ -390,15 +467,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 @@ -413,8 +491,8 @@ <div class="common-select-btn"><i class="el-icon-setting"></i></div> </div> </el-form-item> - </el-col> - <el-col :span="20"> + </el-col> --> + <el-col> <el-form-item label="璇︾粏鍦板潃" prop="detail_address"> <el-input type="textarea" @@ -430,7 +508,7 @@ <div class="basic-info-title">澶囨敞淇℃伅</div> <div class="basic-info-view"> <el-row> - <el-col :span="20"> + <el-col> <el-form-item label="澶囨敞" prop="remark"> <el-input type="textarea" @@ -474,12 +552,18 @@ <div slot="footer" class="dialog-footer"> <el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button> - <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button> + <el-button size="small" @click="handleClose">鍙栨秷</el-button> </div> <!-- 閫夋嫨瀹㈡埛 --> <SelectClientDialog v-if="editSelectClientConfig.editVisible" :edit-common-config="editSelectClientConfig" + @selClient="selClient" + /> + <!-- 閫夋嫨鑱旂郴浜� --> + <SelectContactDialog + v-if="editSelectContactConfig.editVisible" + :edit-common-config="editSelectContactConfig" @selClient="selClient" /> </el-dialog> @@ -490,8 +574,14 @@ import { getAllData } from "@/api/client/client" import { getAddSaleChance, getUpdateSaleChance } from "@/api/sales/salesOpportunity" import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" +import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog" +import { getCityList } from "@/api/common/address" +import WordInput from "@/components/wordInput.vue" +import codeMixin from "@/views/client/followupRecords/mixin/codeMixin" +import { getContactList } from "@/api/client/contacts" export default { name: "AddSalesOpportunityDialog", + mixins: [codeMixin], props: { editCommonConfig: { type: Object, @@ -504,7 +594,7 @@ } } }, - components: { SelectClientDialog }, + components: { WordInput, SelectClientDialog, SelectContactDialog }, computed: { searchCommonHeight() { return this.$refs.searchCommonView.offsetHeight @@ -515,16 +605,19 @@ }, data() { return { - dialogWidth: "80%", + refreshFlag: true, + dialogWidth: "50%", editConfig: this.editCommonConfig, rules: { - number: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }], - name: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - member_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - sale_stage_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - currency: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - expected_time: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - projected_amount: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }] + number: [{ required: true, message: "璇疯緭鍏ラ攢鍞満浼氱紪鍙�", trigger: "blur" }], + name: [{ required: true, message: "璇疯緭鍏ユ満浼氬悕绉�", trigger: "blur" }], + + member_id: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }], + sale_stage_id: [{ required: true, message: "璇烽�夋嫨閿�鍞樁娈�", trigger: "change" }], + currency: [{ required: true, message: "璇烽�夋嫨甯佺", trigger: "change" }], + expected_time: [{ required: true, message: "璇烽�夋嫨棰勮鎴愪氦鏃ユ湡", trigger: "change" }], + projected_amount: [{ required: true, message: "璇疯緭鍏ラ璁″悎鍚岄噾棰�", trigger: "blur" }], + client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛", trigger: "change" }] }, businessSourceOptions: [], memberOptions: [], @@ -532,9 +625,9 @@ saleStageOptions: [], // 閿�鍞樁娈� oldCustomerMarketOptions: [], // 鑰佸鎴疯惀閿� possibleOptions: [], // 鍙兘鎬� - currencyOptions: [], // 甯佺 + currencyOptions: [{ id: 1, name: "浜烘皯甯�" }], // 甯佺 currentStateOptions: [], // 褰撳墠鐘舵�� - countryOptions: [], // 鍥藉 + countryOptions: [{ id: 1, name: "涓浗" }], // 鍥藉 provinceOptions: [], // 鐪佷唤 cityOptions: [], // 鍩庡競 regionOptions: [], // 鍖哄煙 @@ -543,29 +636,66 @@ title: "", infomation: {} }, - restaurants: [] + editSelectContactConfig: { + editVisible: false, + title: "", + infomation: {} + }, + restaurants: [], + clientId: this.editCommonConfig.infomation.client_id, + contactId: this.editCommonConfig.infomation.contact_id, + objCode: { name: "", page: 0, pageSize: 0, type: "閿�鍞満浼氱紪鐮�", codeStandID: "" }, + isContact: true, + contactNamelist: [] } }, created() { this.$store.dispatch("geClient") + if (this.editConfig.title !== "鏂板缓" && this.editConfig.infomation.province_id !== 0) { + this.getCityList(this.editConfig.infomation.province_id, "edit") + } this.getCommonData() + this.formInfo() + if (this.editConfig.title === '缂栬緫'){ + this.isContact = false + this.getContactList(this.editConfig.infomation.contact_id) + } + }, + watch: { + "editConfig.visible"(val) { + if (val) { + this.formInfo() + } + }, + "editConfig.infomation.codeStandID"() { + this.formInfo() + } }, methods: { + formInfo() { + this.objCode.codeStandID = "" + if (this.editConfig.infomation.codeStandID) { + this.objCode.codeStandID = this.editConfig.infomation.codeStandID + } + this.getRCodeStandardList() + }, 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) => { - // 缂� 鍙兘鎬� 甯佺 褰撳墠鐘舵�� this.memberOptions = res.data.member this.businessSourceOptions = res.data.sales_source this.businessTypeOptions = res.data.sale_type this.oldCustomerMarketOptions = res.data.regular_customers this.saleStageOptions = res.data.sale_stage - this.countryOptions = res.data.country this.provinceOptions = res.data.province - this.cityOptions = res.data.city this.regionOptions = res.data.region this.possibleOptions = res.data.possibility - this.currencyOptions = res.data.currency + // this.currencyOptions = res.data.currency this.currentStateOptions = res.data.status }) .catch((err) => { @@ -574,6 +704,10 @@ }, handleClose() { this.editConfig.visible = false + console.log(this.editConfig.infomation.client_name) + if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.client_name) { + this.$parent.handleClose() + } }, // 淇濆瓨 saveClick(formName) { @@ -583,37 +717,24 @@ const params = this.saveParams() console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddSaleChance(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "娣诲姞鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + getAddSaleChance(params).then((res) => { + console.log(res) + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("娣诲姞鎴愬姛") + this.$parent.getData() + // } + } + }) } else { - getUpdateSaleChance(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "缂栬緫鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + getUpdateSaleChance(params).then((res) => { + console.log(res) + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("缂栬緫鎴愬姛") + this.$parent.getData() + } + }) } } else { console.log("error submit") @@ -629,9 +750,9 @@ budget: data.budget || 0, capital_budget: data.capital_budget || "", city_id: data.city_id || 0, - client_id: data.client_id || 0, + client_id: this.clientId || 0, competitors: data.competitors || "", - contact_id: data.contact_id || 0, + contact_id: this.contactId || 0, country_id: data.country_id || 0, currency: data.currency || 0, disadvantages: data.disadvantages || "", @@ -643,9 +764,9 @@ number: data.number || "", opportunities: data.opportunities || "", pain_points: data.pain_points || "", - possibilities: data.possibilities || 0, + possibilities: data.possibilities_id || 0, process: data.process || "", - projected_amount: parseInt(data.projected_amount) || 0, + projected_amount: data.projected_amount || 0, province_id: data.province_id || 0, region_id: data.region_id || 0, regular_customers_id: data.regular_customers_id || 0, @@ -658,14 +779,34 @@ whether_established: data.whether_established || "", remark: data.remark || "", - detail_address: data.detail_address || "" + detail_address: data.detail_address || "", + + codeStandID: data.ID, + codeRule: this.codeRule } return params }, + // 鑾峰彇鑱旂郴浜哄垪琛� + getContactList(id) { + getContactList({ + clientId: id, + page: 0, + pageSize: 0, + search_map: {} + }).then((res) => { + if (res.code == 200) { + this.contactNamelist = res.data.list + } + }) + }, // 閫夋嫨鐢ㄦ埛鐩稿叧鏂规硶 - querySearchAsync(queryString, cb) { - console.log(this.clientList) - var restaurants = this.clientList + querySearchAsync(queryString, cb, value) { + var restaurants = [] + if (value === "client") { + restaurants = this.clientList + } else if (value === "contact") { + restaurants = this.contactNamelist + } var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants cb(results) }, @@ -674,79 +815,140 @@ return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 } }, - handleSelectClient(item) { - this.editConfig.infomation.client_id = item.id + handleSelectClient(value, item) { + if (value === "client") { + this.clientId = item.id + this.isContact = false + this.getContactList(item.id) + } else if (value === "contact") { + this.contactId = item.id + } }, - selClientClick() { - this.editSelectClientConfig.editVisible = true + selClientClick(value) { + if (value === "client") { + this.editSelectClientConfig.editVisible = true + } else if (value === "contact") { + this.editSelectContactConfig.editVisible = true + } }, - selClient(row) { - this.editConfig.infomation.client_name = row.name - this.editConfig.infomation.client_id = row.id + 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.refresh() + }, + /** + * 寮哄埗鍒锋柊form缁勪欢 + * 澶栭儴鏇存敼琛ㄥ崟鍊间笉浼氳Е鍙戣〃鍗曟牎楠�,瀵艰嚧鍗充娇鏈夊�煎琚〃鍗曟牎楠岄樆濉炰綇 + */ + refresh() { + this.refreshFlag = false + requestAnimationFrame(() => { + this.refreshFlag = true + }) }, // 娓呴櫎宸查�夋嫨鐢ㄦ埛 - clearupClient() { - this.editConfig.infomation.client_name = "" - this.editConfig.infomation.client_id = 0 + clearupClient(value) { + if (value === "client") { + this.editConfig.infomation.client_name = "" + this.clientId = 0 + this.isContact = true + this.editConfig.infomation.contact_name = "" + this.contactId = 0 + } else if (value === "contact") { + this.editConfig.infomation.contact_name = "" + this.contactId = 0 + } + this.refresh() }, // 娣诲姞闄勪欢 addAnnexClick() {}, // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡 - setFormatClick() {} + setFormatClick() {}, + // 閫夋嫨鐪佷唤 + selProvinceChange(val) { + this.getCityList(val, "sel") + }, + async getCityList(val, value) { + await getCityList({ province_id: val }).then((res) => { + if (res.code === 200) { + this.cityOptions = res.data.list + if (value === "sel") { + this.editConfig.infomation.city_id = "" + } + } + }) + } } } </script> <!-- Add "scoped" attribute to limit CSS to this component only --> <style lang="scss" scoped> -.add-sales-opportunity { - .basic-info { - .basic-info-title { - background-color: #f4f8fe; - padding-left: 10px; - font-size: 15px; - font-weight: bold; - color: #666; - height: 42px; - line-height: 42px; - } - .basic-info-view { - margin-top: 10px; - padding-right: 40px; - .custom-name, - .common-select { +::v-deep { + .iframe-dialog .el-dialog__body { + .basic-info { + .basic-info-title { + background-color: #f4f8fe; + padding-left: 10px; + font-size: 15px; + font-weight: bold; + color: #666; + height: 42px; + line-height: 42px; + } + .basic-info-view { + margin-top: 10px; + padding-right: 40px; + .custom-name, + .common-select { + display: flex; + .common-select-btn { + margin-left: 5px; + font-size: 18px; + cursor: pointer; + } + } + .common-select { + .common-select-sel { + flex: 1; + } + } + .custom-name { + .el-autocomplete { + flex: 1; + } + } + } + .annex-view { display: flex; - .common-select-btn { - margin-left: 5px; - font-size: 18px; - cursor: pointer; - } - } - .common-select { - .common-select-sel { - width: 270px; + color: #6166d3; + .setFormat { + margin-left: 10px; } } } - .annex-view { + .unflod-collapse { display: flex; + height: 30px; + justify-content: center; + align-items: center; color: #6166d3; - .setFormat { - margin-left: 10px; - } } - } - .unflod-collapse { - display: flex; - height: 30px; - justify-content: center; - align-items: center; - color: #6166d3; - } - .dialog-footer { - background-color: #f5f5f5; - height: 55px; - line-height: 55px; + .dialog-footer { + background-color: #f5f5f5; + height: 55px; + line-height: 55px; + } + .el-input__inner { + text-align: left; + } } } </style> -- Gitblit v1.8.0