Commit 75e91b9d authored by dcy's avatar dcy

佣金客户列表添加分页

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