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.
udi-spms-vue/src/views/inout/DialogSelectInv.vue

153 lines
4.6 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<el-form :model="userInfo">
<el-row :gutter="20">
<el-col :span="6">
<div class="ao-text">
<span>当前仓库</span>
</div>
</el-col>
<el-col :span="16">
<el-form-item prop="locStorageCode">
<el-select v-model="userInfo.locInvCode" placeholder="当前仓库信息" clearable
@change="locCHange"
>
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<div class="ao-text">
<span>当前分库:</span>
</div>
</el-col>
<el-col :span="16">
<el-form-item prop="locInvCode">
<el-select v-model="userInfo.locSubInvCode" placeholder="当前分库信息" clearable
>
<el-option
v-for="item in subInvList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'>
<el-button type="primary" @click="submitInv">提交</el-button>
<el-button type="primary" @click="closeDG"></el-button>
</div>
</el-form>
</template>
<script>
import {filterAllByUser} from "@/api/system/invWarehouse";
import {filterSubByInv} from "@/api/system/invSubWarehouse";
import {updateInv} from "@/api/auth/authAdmin";
export default {
name: "DialogSelectInv",
props: {
billData: {
type: Object,
required: true,
},
closeInvDialog: {
type: Function,
required: true,
},
closeSubmitDialog:{
type: Function,
required: true,
}
},
data() {
return {
userInfo: {
locInvCode: this.$store.getters.locInvCode,
locSubInvCode: this.$store.getters.locSubInvCode,
},
storageList: [],
subInvList: [],
}
},
methods: {
getStorage() {
this.storageList = [];
filterAllByUser()
.then((response) => {
this.storageList = response.data || [];
this.findSubInvByInv();
})
.catch(() => {
});
},
findSubInvByInv() {
this.subInvList = [];
let query = {
pcode: this.userInfo.locInvCode,
filter:3
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
if (this.subInvList != null && this.subInvList.length == 1) {
this.userInfo.locSubInvCode = this.subInvList[0].code;
}
})
.catch(() => {
});
},
locCHange() {
if (this.$isNotBlank(this.userInfo.locSubInvCode)) {
this.userInfo.locSubInvCode = "";
}
this.findSubInvByInv();
},
submitInv() {
if (this.$isBlank(this.userInfo.locInvCode)) {
this.$message.error("当前仓库不能为空!");
return;
}
if (this.$isBlank(this.userInfo.locSubInvCode)) {
this.$message.error("当前分库不能为空!");
return;
}
this.billData.locStorageCode = this.userInfo.locInvCode;
this.billData.invWarehouseCode = this.userInfo.locSubInvCode;
this.closeSubmitDialog();
},
closeDG() {
this.closeInvDialog();
},
},
created() {
this.getStorage();
},
}
</script>
<style scoped>
</style>