You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
869 B
JavaScript
49 lines
869 B
JavaScript
2 years ago
|
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()
|
||
|
}
|
||
|
}
|