Commit 6c674530 authored by dcy's avatar dcy

解决页面卡顿

parent 84430fcc
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService"> <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" <el-option v-for="item in serviceUserList"
:key="item.id" :label="item.nickname" :value="item.id" /> :key="item.id" :label="item.nickname" :value="item.id" />
</el-select> </el-select>
...@@ -125,9 +125,9 @@ ...@@ -125,9 +125,9 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('推介人')" prop="promoter"> <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 <el-option
v-for="item in customerSelect" v-for="item in customerSelectFn"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
...@@ -404,7 +404,14 @@ ...@@ -404,7 +404,14 @@
<script> <script>
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload' 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 {getNodeList} from "@/api/ecw/node"
import { getProductTypeList } from '@/api/ecw/productType' import { getProductTypeList } from '@/api/ecw/productType'
import { getProductList } from '@/api/ecw/product' import { getProductList } from '@/api/ecw/product'
...@@ -418,6 +425,7 @@ import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts' ...@@ -418,6 +425,7 @@ import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import { getCountryListAll } from '@/api/ecw/country' import { getCountryListAll } from '@/api/ecw/country'
import Template from "@/views/cms/template"; import Template from "@/views/cms/template";
import {validatorMobile} from "@/api/ecw/validate" import {validatorMobile} from "@/api/ecw/validate"
import {customerDropDownList} from "@/api/ecw/customerCommissionInfo";
export default { export default {
name: "edit", name: "edit",
...@@ -430,6 +438,7 @@ export default { ...@@ -430,6 +438,7 @@ export default {
CustomerLineTable CustomerLineTable
}, },
created() { created() {
this.getCustomerSelect()
this.reset() this.reset()
if(this.customerId !== '0') { if(this.customerId !== '0') {
...@@ -437,6 +446,10 @@ export default { ...@@ -437,6 +446,10 @@ export default {
this.getCustomer(this.customerId).then(() => { this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => { getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.form.customerContacts = r.data this.form.customerContacts = r.data
getCustomerList({ids:this.form.promoter}).then(r => {
console.log(r,'r');
this.recommended = r.data;
})
}) })
}) })
} else { } else {
...@@ -459,9 +472,6 @@ export default { ...@@ -459,9 +472,6 @@ export default {
getWarehouseList().then(r => { getWarehouseList().then(r => {
this.warehouseList = r.data this.warehouseList = r.data
}) })
getCustomerSelect().then(r => {
this.customerSelect = r.data
})
listSimpleUsers().then(r => { listSimpleUsers().then(r => {
this.serviceUserList = r.data this.serviceUserList = r.data
}) })
...@@ -515,6 +525,7 @@ export default { ...@@ -515,6 +525,7 @@ export default {
warehouseList: [], // 仓库列表 warehouseList: [], // 仓库列表
importCityList: [], // 进口地址 importCityList: [], // 进口地址
customerSelect: [], customerSelect: [],
recommended:[],
serviceUserList: [], serviceUserList: [],
countryList: [], countryList: [],
...@@ -525,6 +536,14 @@ export default { ...@@ -525,6 +536,14 @@ export default {
}, },
methods: { 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){ phoneValidator(rule, value, callback){
if (!value) { if (!value) {
return callback(new Error(this.$t('请输入联系方式'))); return callback(new Error(this.$t('请输入联系方式')));
...@@ -727,6 +746,17 @@ export default { ...@@ -727,6 +746,17 @@ export default {
productListFilter(){ productListFilter(){
return this.productList.filter((p) => p.typeId === this.form.productType) 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: { watch: {
zhongLines() { 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