| | |
| | | @search="loadData" |
| | | :placeholder="placeholder" |
| | | v-model="selectedAsyncValue" |
| | | :maintenanceCategory="maintenanceCategory" |
| | | style="width: 100%" |
| | | :filterOption="false" |
| | | @change="handleAsyncChange" |
| | |
| | | name: 'MaintenanceEquipmentSelect', |
| | | props: { |
| | | disabled: Boolean, |
| | | value: [String, Number, String], |
| | | value: [String, Number], |
| | | placeholder: { |
| | | type: String, |
| | | default: '请选择', |
| | |
| | | immediate: true, |
| | | handler(val) { |
| | | if (!val) { |
| | | this.selectedValue = undefined; |
| | | this.selectedAsyncValue = undefined; |
| | | this.initDictData() |
| | | } else { |
| | | this.initSelectValue() |
| | |
| | | methods: { |
| | | initSelectValue() { |
| | | if (!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key != this.value || !this.maintenanceCategory) { |
| | | console.log('ssfs', this.selectedAsyncValue) |
| | | console.log('ASGasgsgas', this.maintenanceCategory) |
| | | console.log('这才请求后台') |
| | | getAction(`/eam/maintenanceStandard/listByUser`, { |
| | | id: this.value, |
| | |
| | | label: res.result[0].text |
| | | } |
| | | this.selectedAsyncValue = { ...obj } |
| | | this.$emit('autocompleteForm', res.result[0]) |
| | | } |
| | | this.options = res.result |
| | | } |
| | |
| | | } else { |
| | | this.selectedAsyncValue = undefined |
| | | this.selectedValue = null |
| | | this.options = null |
| | | this.options = [] |
| | | this.loadData('') |
| | | this.$emit('autocompleteForm', {}) |
| | | } |