Commit 6c674530 authored by dcy's avatar dcy

解决页面卡顿

parent 84430fcc
......@@ -103,7 +103,7 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')" :disabled="customerId !== '0' && form.customerService">
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')" :disabled="!!(customerId !== '0' && form.customerService)">
<el-option v-for="item in serviceUserList"
:key="item.id" :label="item.nickname" :value="item.id" />
</el-select>
......@@ -125,9 +125,9 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('推介人')" prop="promoter">
<el-select v-model="form.promoter" :placeholder="$t('请输入推介人')" filterable>
<el-select clearable remote :remote-method="remoteMethod" v-model="form.promoter" :placeholder="$t('请输入推介人')" filterable>
<el-option
v-for="item in customerSelect"
v-for="item in customerSelectFn"
:key="item.id"
:label="item.name"
:value="item.id">
......@@ -404,7 +404,14 @@
<script>
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload'
import {createCustomer, getCustomer, updateCustomer, userMemberUserList,} from '@/api/ecw/customer'
import {
createCustomer,
getCustomer,
getCustomerList,
getCustomerPage,
updateCustomer,
userMemberUserList,
} from '@/api/ecw/customer'
import {getNodeList} from "@/api/ecw/node"
import { getProductTypeList } from '@/api/ecw/productType'
import { getProductList } from '@/api/ecw/product'
......@@ -418,6 +425,7 @@ import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import { getCountryListAll } from '@/api/ecw/country'
import Template from "@/views/cms/template";
import {validatorMobile} from "@/api/ecw/validate"
import {customerDropDownList} from "@/api/ecw/customerCommissionInfo";
export default {
name: "edit",
......@@ -430,6 +438,7 @@ export default {
CustomerLineTable
},
created() {
this.getCustomerSelect()
this.reset()
if(this.customerId !== '0') {
......@@ -437,6 +446,10 @@ export default {
this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.form.customerContacts = r.data
getCustomerList({ids:this.form.promoter}).then(r => {
console.log(r,'r');
this.recommended = r.data;
})
})
})
} else {
......@@ -459,9 +472,6 @@ export default {
getWarehouseList().then(r => {
this.warehouseList = r.data
})
getCustomerSelect().then(r => {
this.customerSelect = r.data
})
listSimpleUsers().then(r => {
this.serviceUserList = r.data
})
......@@ -515,6 +525,7 @@ export default {
warehouseList: [], // 仓库列表
importCityList: [], // 进口地址
customerSelect: [],
recommended:[],
serviceUserList: [],
countryList: [],
......@@ -525,6 +536,14 @@ export default {
},
methods: {
remoteMethod(val){
this.getCustomerSelect(val);
},
getCustomerSelect(val = ''){
getCustomerSelect({pageNo:1,pageSize:30,searchKey:val}).then(res => {
this.customerSelect = res.data.list
})
},
phoneValidator(rule, value, callback){
if (!value) {
return callback(new Error(this.$t('请输入联系方式')));
......@@ -727,6 +746,17 @@ export default {
productListFilter(){
return this.productList.filter((p) => p.typeId === this.form.productType)
},
customerSelectFn(){
if(this.recommended.length > 0){
let i = this.customerSelect.find(item => item.id === this.recommended[0].id)
if(!i){
this.customerSelect.push(this.recommended[0])
}
return this.customerSelect
}else {
return this.customerSelect
}
}
},
watch: {
zhongLines() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment