|
@@ -1,19 +1,26 @@
|
|
import { pickUpLogisticsList } from '@/api/pickUp'
|
|
import { pickUpLogisticsList } from '@/api/pickUp'
|
|
const LogisticsCompany = {
|
|
const LogisticsCompany = {
|
|
template: `
|
|
template: `
|
|
- <a-input-group compact :id="id">
|
|
|
|
- <a-input style="width: 70%" allowClear @change="handleChange" :placeholder="placeholder" :value="defaultVal"/>
|
|
|
|
- <a-select
|
|
|
|
- style="width: 30%"
|
|
|
|
- @change="changeSel"
|
|
|
|
- placeholder="选择物流公司"
|
|
|
|
|
|
+ <a-select
|
|
|
|
+ allowClear
|
|
|
|
+ :size="size"
|
|
|
|
+ mode="combobox"
|
|
|
|
+ :value="defaultVal"
|
|
|
|
+ show-search
|
|
|
|
+ :placeholder="placeholder"
|
|
option-filter-prop="children"
|
|
option-filter-prop="children"
|
|
- :filter-option="filterOption">
|
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ :filter-option="filterOption"
|
|
|
|
+ :dropdownMatchSelectWidth="false"
|
|
|
|
+ @change="onChange"
|
|
|
|
+ @blur="onBlur"
|
|
|
|
+ @focus="open=true"
|
|
|
|
+ :open="open"
|
|
|
|
+ >
|
|
<a-select-option v-for="item in list" :key="item.id" :value="item.logisticsCompany">
|
|
<a-select-option v-for="item in list" :key="item.id" :value="item.logisticsCompany">
|
|
- {{ item.logisticsCompany }}
|
|
|
|
|
|
+ {{ item.logisticsCompany }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
- </a-input-group>
|
|
|
|
`,
|
|
`,
|
|
props: {
|
|
props: {
|
|
value: {
|
|
value: {
|
|
@@ -28,11 +35,16 @@ const LogisticsCompany = {
|
|
type: String,
|
|
type: String,
|
|
default: '请输入物流公司'
|
|
default: '请输入物流公司'
|
|
},
|
|
},
|
|
|
|
+ size: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: 'default'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
defaultVal: this.value,
|
|
defaultVal: this.value,
|
|
- list: []
|
|
|
|
|
|
+ list: [],
|
|
|
|
+ open: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -49,16 +61,16 @@ const LogisticsCompany = {
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
)
|
|
)
|
|
},
|
|
},
|
|
- changeSel(value){
|
|
|
|
|
|
+ onChange(value) {
|
|
|
|
+ console.log('onChange', value);
|
|
this.defaultVal = value;
|
|
this.defaultVal = value;
|
|
- this.$emit('change', value);
|
|
|
|
- this.$emit('input', value);
|
|
|
|
|
|
+ this.open = false;
|
|
|
|
+ this.$emit('change', value||'');
|
|
|
|
+ this.$emit('input', value||'');
|
|
},
|
|
},
|
|
- handleChange(e) {
|
|
|
|
- const value = e.target.value
|
|
|
|
- this.defaultVal = value;
|
|
|
|
- this.$emit('change', value);
|
|
|
|
- this.$emit('input', value);
|
|
|
|
|
|
+ onBlur(value){
|
|
|
|
+ this.open = false;
|
|
|
|
+ this.$emit('blur', value);
|
|
},
|
|
},
|
|
getList () {
|
|
getList () {
|
|
pickUpLogisticsList({}).then(res => {
|
|
pickUpLogisticsList({}).then(res => {
|