Commit 75e91b9d authored by dcy's avatar dcy

佣金客户列表添加分页

parent 54dc63e5
......@@ -5,13 +5,15 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('客户名称')" prop="customerId" >
<el-select
:remote-method="customerDropDownFn"
remote
clearable
filterable
v-model="queryParams.customerId"
:placeholder="$t('请输入关键词')">
<el-option
v-for="(item, index) in customeList"
:key="index"
v-for="(item, index) in customerNameFn"
:key="item.id"
:value="item.id"
:label="item.name"
>
......@@ -140,6 +142,7 @@ import {deleteCustomerCommission, getCustomerCommissionPage, exportCustomerCommi
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import {getTradeCityList} from "@/api/ecw/region";
import {customerDropDownList} from "@/api/ecw/customerCommissionInfo";
import {getCustomerList} from "@/api/ecw/customer";
export default {
name: "CustomerCommission",
......@@ -187,6 +190,7 @@ export default {
darkReturnType: [{ required: true, message: this.$t('暗佣类型 1产品2达标不能为空'), trigger: "change" }],
},
customeList:[],
selectCustomeList:[]
};
},
computed:{
......@@ -198,16 +202,24 @@ export default {
exportCityList(){
return this.tradeCityList.filter(item => item.type == 2)
},
customerNameFn(){
if(this.selectCustomeList.length > 0){
let i = this.customeList.findIndex(item => item.id === this.selectCustomeList[0].id)
if(i < 0){
this.customeList.unshift(this.selectCustomeList[0])
}
}
return this.customeList
}
},
created() {
customerDropDownList().then(res => {
console.log(res);
if (res.code === 0) {
this.customeList = res.data
}
})
this.customerDropDownFn()
if(this.$route.query.customerId){
this.queryParams.customerId = Number(this.$route.query.customerId)
getCustomerList({ids:this.queryParams.customerId}).then(r =>{
console.log(r,'rrr');
this.selectCustomeList = r.data
})
}
this.getList();
getTradeCityList().then(res => {
......@@ -215,6 +227,13 @@ export default {
})
},
methods: {
customerDropDownFn(val){
customerDropDownList({pageNo:1,pageSize: 100,searchKey:val}).then(res => {
if (res.code === 0) {
this.customeList = res.data.list
}
})
},
/** 查询列表 */
getList() {
this.loading = true;
......
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