import {getInvListByUser} from "@/api/system/invWarehouse"; export default { name: "invSelect", props: {value: {required: true}, deptCode: null}, data() { return { val: '', list: [], } }, watch: { deptCode() { this.val = null this.getList() }, val(newVal) { this.$emit('update:value', newVal); }, value(newVal) { this.val = newVal }, }, methods: { invChange() { this.$emit('update:value', this.val); // this.changeValue(this.invCode) }, getList() { let query = { advanceType: 1, deptCode: this.deptCode }; getInvListByUser(query) .then((response) => { this.list = response.data || []; }) .catch(() => { }); }, }, created() { this.val = this.value this.getList() } }