|
@@ -7,6 +7,7 @@ const Employee = {
|
|
allowClear
|
|
allowClear
|
|
:value="defaultVal"
|
|
:value="defaultVal"
|
|
:showSearch="true"
|
|
:showSearch="true"
|
|
|
|
+ :disabled="disabledFlag"
|
|
@change="handleChange"
|
|
@change="handleChange"
|
|
option-filter-prop="children"
|
|
option-filter-prop="children"
|
|
:filter-option="filterOption">
|
|
:filter-option="filterOption">
|
|
@@ -31,21 +32,25 @@ const Employee = {
|
|
enableFlag: {
|
|
enableFlag: {
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
|
|
+ },
|
|
|
|
+ disabledFlag: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- data() {
|
|
|
|
|
|
+ data () {
|
|
return {
|
|
return {
|
|
defaultVal: this.value,
|
|
defaultVal: this.value,
|
|
list: []
|
|
list: []
|
|
- };
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
|
|
+ mounted () {
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
- value(newValue, oldValue) {
|
|
|
|
|
|
+ value (newValue, oldValue) {
|
|
this.defaultVal = newValue
|
|
this.defaultVal = newValue
|
|
- },
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
filterOption (input, option) {
|
|
filterOption (input, option) {
|
|
@@ -53,26 +58,26 @@ const Employee = {
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
)
|
|
)
|
|
},
|
|
},
|
|
- handleChange(value) {
|
|
|
|
- this.defaultVal = value;
|
|
|
|
|
|
+ handleChange (value) {
|
|
|
|
+ this.defaultVal = value
|
|
const item = this.list.find(item => item.supplierSn == value)
|
|
const item = this.list.find(item => item.supplierSn == value)
|
|
- this.$emit('input', value);
|
|
|
|
- this.$emit('change', value, item);
|
|
|
|
|
|
+ this.$emit('input', value)
|
|
|
|
+ this.$emit('change', value, item)
|
|
},
|
|
},
|
|
getList () {
|
|
getList () {
|
|
supplierAllList().then(res => {
|
|
supplierAllList().then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- if(this.enableFlag!=''){
|
|
|
|
|
|
+ if (this.enableFlag != '') {
|
|
this.list = res.data.filter(item => item.enableFlag == this.enableFlag)
|
|
this.list = res.data.filter(item => item.enableFlag == this.enableFlag)
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.list = res.data
|
|
this.list = res.data
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.list = []
|
|
this.list = []
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- },
|
|
|
|
- },
|
|
|
|
-};
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
-export default Employee
|
|
|
|
|
|
+export default Employee
|