|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<el-card class="el-card">
|
|
|
|
<el-form :model="filterQuery" class="query-form" size="mini" :inline="true">
|
|
|
|
<el-form-item class="query-form-item" label="仓库:">
|
|
|
|
<el-select v-model="filterQuery.invCode" placeholder="请选择仓库" clearable="true"
|
|
|
|
@change="invChange"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in invList"
|
|
|
|
:key="item.name"
|
|
|
|
:label="item.name"
|
|
|
|
:value="item.code">
|
|
|
|
<span style="float: left">{{ item.name }}</span>
|
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item class="query-form-item" label="货位:">
|
|
|
|
<el-select v-model="filterQuery.invSpaceCode" placeholder="请选择货位" clearable="true"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in spaceList"
|
|
|
|
:key="item.name"
|
|
|
|
:label="item.name"
|
|
|
|
:value="item.code">
|
|
|
|
<span style="float: left">{{ item.name }}</span>
|
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button-group style="margin-left: 10px;display:flex;">
|
|
|
|
<el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button>
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
|
|
|
|
<el-button type="primary" icon="el-icon-box" @click="invPlace(1)">按物资上架</el-button>
|
|
|
|
<el-button type="primary" icon="el-icon-box" @click="invPlace(2)">按单上架</el-button>
|
|
|
|
</el-button-group>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
|
|
|
|
border>
|
|
|
|
<el-table-column label="序号" type="index"></el-table-column>
|
|
|
|
<el-table-column label="仓库" prop="invName" width="180"></el-table-column>
|
|
|
|
<el-table-column label="货位" prop="invSpaceName" width="180"></el-table-column>
|
|
|
|
<el-table-column label="产品标识" prop="nameCode"></el-table-column>
|
|
|
|
<el-table-column label="产品名称" prop="productName"></el-table-column>
|
|
|
|
<el-table-column label="规格型号" prop="ggxh" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column label="批次号" prop="batchNo" width="120"></el-table-column>
|
|
|
|
<el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column>
|
|
|
|
<el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>
|
|
|
|
<el-table-column label="批准文号" prop="zczbhhzbapzbh" v-if="showSup" show-overflow-tooltip
|
|
|
|
width="120"></el-table-column>
|
|
|
|
<el-table-column label="生产企业" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
|
|
|
|
width="120"></el-table-column>
|
|
|
|
</el-table>
|
|
|
|
<pagination
|
|
|
|
v-show="total>0"
|
|
|
|
:total="total"
|
|
|
|
:limit.sync="filterQuery.limit"
|
|
|
|
:page.sync="filterQuery.page"
|
|
|
|
@pagination="getList"
|
|
|
|
></pagination>
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
title="按物资上架"
|
|
|
|
:visible.sync="productPlaceDialogVisible"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
width="85%"
|
|
|
|
v-if="productPlaceDialogVisible"
|
|
|
|
>
|
|
|
|
<invProductPlaceModify
|
|
|
|
:closePlaceDialog="closePlaceDialog"
|
|
|
|
></invProductPlaceModify>
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
title="按单上架"
|
|
|
|
:visible.sync="orderPlaceDialogVisible"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
width="85%"
|
|
|
|
v-if="orderPlaceDialogVisible"
|
|
|
|
>
|
|
|
|
<invOrderPlaceModify
|
|
|
|
:closePlaceDialog="closePlaceDialog"
|
|
|
|
></invOrderPlaceModify>
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {getInvListByUser} from "@/api/system/invWarehouse";
|
|
|
|
import {getInvSpaceList} from "@/api/inventory/invSpace";
|
|
|
|
import {getPlaceDetailList} from "@/api/inventory/invPlace";
|
|
|
|
import {isBlank} from "@/utils/strUtil";
|
|
|
|
import invProductPlaceModify from "@/views/inventory/InvProductPlaceModify.vue";
|
|
|
|
import invOrderPlaceModify from "@/views/inventory/InvOrderPlaceModify.vue";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "InvProducts",
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
filterQuery: {
|
|
|
|
invCode: this.$store.getters.locInvCode,
|
|
|
|
invSpaceCode: null,
|
|
|
|
page: 1,
|
|
|
|
limit: 20,
|
|
|
|
},
|
|
|
|
list: [],
|
|
|
|
total: 0,
|
|
|
|
invList: [],
|
|
|
|
spaceList: [],
|
|
|
|
loading: false,
|
|
|
|
productPlaceDialogVisible: false,
|
|
|
|
orderPlaceDialogVisible: false
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onReset() {
|
|
|
|
this.$router.push({
|
|
|
|
path: "",
|
|
|
|
});
|
|
|
|
this.filterQuery = {
|
|
|
|
invCode: this.$store.getters.locInvCode,
|
|
|
|
invSpaceCode: null,
|
|
|
|
page: 1,
|
|
|
|
limit: 20,
|
|
|
|
};
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
onSubmit() {
|
|
|
|
this.filterQuery.page = 1;
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
getList() {
|
|
|
|
this.loading = true;
|
|
|
|
getPlaceDetailList(this.filterQuery).then((res) => {
|
|
|
|
this.loading = false;
|
|
|
|
if (res.code === 20000) {
|
|
|
|
this.list = res.data.list || [];
|
|
|
|
this.total = res.data.total || 0;
|
|
|
|
} else {
|
|
|
|
this.$message.error(res.message);
|
|
|
|
this.list = [];
|
|
|
|
this.total = 0;
|
|
|
|
}
|
|
|
|
}).catch((error) => {
|
|
|
|
this.loading = false;
|
|
|
|
this.$message.error(error.message);
|
|
|
|
this.list = [];
|
|
|
|
this.total = 0;
|
|
|
|
})
|
|
|
|
},
|
|
|
|
invChange() {
|
|
|
|
this.spaceList = [];
|
|
|
|
this.getSpaceList();
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
getInvList() {
|
|
|
|
getInvListByUser()
|
|
|
|
.then((response) => {
|
|
|
|
this.invList = response.data || [];
|
|
|
|
this.getSpaceList();
|
|
|
|
this.getList();
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
});
|
|
|
|
},
|
|
|
|
getSpaceList() {
|
|
|
|
let params = {
|
|
|
|
invWarehouseCode: this.filterQuery.invCode,
|
|
|
|
status: 1
|
|
|
|
};
|
|
|
|
getInvSpaceList(params).then((res) => {
|
|
|
|
this.spaceList = res.data.list || [];
|
|
|
|
})
|
|
|
|
},
|
|
|
|
invPlace(type) {
|
|
|
|
if (type === 1) {
|
|
|
|
//按物资上架
|
|
|
|
this.productPlaceDialogVisible = true;
|
|
|
|
} else if (type === 2) {
|
|
|
|
this.orderPlaceDialogVisible = true;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
closePlaceDialog(type) {
|
|
|
|
if (type === 1) {
|
|
|
|
this.productPlaceDialogVisible = false;
|
|
|
|
} else if (type === 2) {
|
|
|
|
this.orderPlaceDialogVisible = false;
|
|
|
|
}
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
invProductPlaceModify,
|
|
|
|
invOrderPlaceModify
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
document.body.ondrop = function (event) {
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopPropagation();
|
|
|
|
};
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.getInvList();
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style type="text/scss" lang="scss">
|
|
|
|
</style>
|
|
|
|
|