Commit 9d808430 authored by 邓春圆's avatar 邓春圆

Merge remote-tracking branch 'origin/dev' into dev

parents 637a4d64 09c1fdb9
<template> <template>
<el-select <el-select
v-model="index" v-model="valueSync"
filterable filterable
:clearable="clearable" :clearable="clearable"
remote remote
reserve-keyword reserve-keyword
:placeholder="placeholder ? placeholder : $t('请选择')" :placeholder="placeholder ? placeholder : $t('请选择')"
:loading="loading"> :loading="loading">
<el-option
v-if="prepend"
:label="`${prepend.nickname}`"
:value="prepend.id">
</el-option>
<el-option <el-option
v-for="(item, index) in list" v-for="(item, index) in list"
:key="item.id" :key="item.id"
:label="`${item.nickname}`" :label="`${item.nickname}`"
:value="index"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
...@@ -26,26 +31,23 @@ export default { ...@@ -26,26 +31,23 @@ export default {
manage:{ manage:{
type:Boolean, type:Boolean,
default:false default:false
} },
prepend: Object
}, },
data(){ data(){
return { return {
index: null,
list:[], list:[],
loading: false, loading: false,
size: 20 size: 20,
valueSync: this.value
} }
}, },
watch:{ watch:{
index(val){
this.$emit('input', val !== null && val !== undefined && val != '' ? this.list[val].id : null)
this.$emit('change', val !== null && val !== undefined && val != '' ? this.list[val]: null)
},
value(val){ value(val){
this.resetIndex() this.valueSync = this.value
}, },
list(){ valueSync(val){
this.resetIndex() this.$emit('input', val)
} }
}, },
created(){ created(){
...@@ -60,39 +62,9 @@ export default { ...@@ -60,39 +62,9 @@ export default {
this.list = res.data this.list = res.data
}) })
} }
if(this.value){
// this.init() this.valueSync = this.value
},
methods:{
resetIndex(){
let index = this.list.findIndex(item => item.id == this.value)
if(index < 0) this.index = null
else this.index = index
}
/* init(){
console.log('初始化联系人选择', this.value)
if(!this.value) return
let index = this.list.findIndex(item => item.customerContactsId == this.value)
if(index < 0){
getCustomerContactsSelect({ids: this.value}).then(res => {
if(!res.data || !res.data.length){
return this.$message.error('联系人信息获取失败')
}
this.list.unshift(res.data[0])
this.index = 0
})
}
}, */
/* remoteMethod(keyword){
let params = {
size: this.size
} }
params.searchKey = keyword
this.loading = true
getCustomerContactsSelect(params)
.then(res => this.list = res.data)
.finally(() => this.loading = false)
} */
} }
} }
</script> </script>
...@@ -72,7 +72,8 @@ ...@@ -72,7 +72,8 @@
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" clearable/> <dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" clearable/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户经理')" > <el-form-item :label="$t('客户经理')" >
<user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery"/> <user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理')}"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('订单状态')" prop="status"> <el-form-item :label="$t('订单状态')" prop="status">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" <dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"
......
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