import {getInvListByUser} from "@/api/system/invWarehouse";


export default {
  name: "invSelect",
  props: {value:""},
  data() {
    return {
      invCode: '',
      invList: [],
    }
  },watch: {
    invCode(newVal) {
      this.$emit('update:value', newVal);
    },
    value(newVal) {
      this.invCode = newVal
    },
  },
  methods: {
    invChange(){
      this.$emit('update:value', this.invCode);
      // this.changeValue(this.invCode)
    },
    getList() {

      let query = {
        advanceType: 1,
      };
      getInvListByUser(query)
        .then((response) => {
          this.invList = response.data || [];
        })
        .catch(() => {
        });
    },
  },
  created() {
    this.invCode=this.value
    this.getList()
  }
}
