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.
337 lines
12 KiB
Vue
337 lines
12 KiB
Vue
3 years ago
|
<template>
|
||
|
<div>
|
||
|
<el-card>
|
||
|
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
|
||
|
<el-row>
|
||
|
<div>
|
||
|
<el-form-item class="query-form-item">
|
||
|
<el-input v-model="filterQuery.cpmctymc" placeholder="通用名称"></el-input>
|
||
|
</el-form-item>
|
||
|
<el-form-item class="query-form-item">
|
||
|
<el-input v-model="filterQuery.ggxh" placeholder="规格型号"></el-input>
|
||
|
</el-form-item>
|
||
|
<el-form-item class="query-form-item">
|
||
|
<el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="批准文号"></el-input>
|
||
|
</el-form-item>
|
||
|
<el-form-item class="query-form-item">
|
||
|
<el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产厂家"></el-input>
|
||
|
</el-form-item>
|
||
|
</div>
|
||
|
|
||
|
<div>
|
||
|
<el-form-item class="query-form-item" style="margin-right: 0px;">
|
||
|
<el-select
|
||
|
v-model="filterQuery.invStorageCode"
|
||
|
filterable
|
||
|
remote
|
||
|
clearable="true"
|
||
|
reserve-keyword
|
||
|
placeholder="仓库"
|
||
|
size="mini"
|
||
|
style="width: 92%"
|
||
|
:loading="loading"
|
||
|
>
|
||
|
<el-option
|
||
|
v-for="item in storageOptions"
|
||
|
:key="item.code"
|
||
|
: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" style="margin-left: 0px;">
|
||
|
<el-input v-model="filterQuery.nameCode" placeholder="产品标识DI"></el-input>
|
||
|
</el-form-item>
|
||
|
<el-form-item class="query-form-item">
|
||
|
<el-input v-model="filterQuery.batchNo" placeholder="批次号"></el-input>
|
||
|
</el-form-item>
|
||
|
|
||
|
<el-form-item class="query-form-item">
|
||
|
<el-select
|
||
|
v-model="filterQuery.supId"
|
||
|
filterable
|
||
|
remote
|
||
|
clearable="true"
|
||
|
reserve-keyword
|
||
|
placeholder="请输入供应商名称"
|
||
|
:remote-method="findMethod"
|
||
|
size="mini"
|
||
|
style="width: 100%"
|
||
|
:loading="loading"
|
||
|
>
|
||
|
<el-option
|
||
|
v-for="item in fromOptions"
|
||
|
:key="item.name"
|
||
|
:label="item.name"
|
||
|
:value="item.erpId"
|
||
|
>
|
||
|
<span style="float: left">{{ item.name }}</span>
|
||
|
</el-option>
|
||
|
</el-select>
|
||
|
</el-form-item>
|
||
|
|
||
|
<el-form-item>
|
||
|
<el-button-group>
|
||
|
<el-button
|
||
|
type="primary"
|
||
|
icon="el-icon-refresh"
|
||
|
@click="onReset"
|
||
|
></el-button>
|
||
|
<el-button type="primary" icon="search" @click="onSubmit"
|
||
|
>统计
|
||
|
</el-button
|
||
|
>
|
||
|
</el-button-group>
|
||
|
</el-form-item>
|
||
|
</div>
|
||
|
</el-row>
|
||
|
</el-form>
|
||
|
|
||
|
<el-table v-loading="loading" :data="list" style="width: 100%">
|
||
|
<el-table-column label="序号" type="index"></el-table-column>
|
||
|
<el-table-column label="产品标识" prop="nameCode"></el-table-column>
|
||
|
<el-table-column label="产品名称" prop="cpmctymc">
|
||
|
</el-table-column>
|
||
|
<el-table-column label="规格型号" prop="ggxh"></el-table-column>
|
||
|
<el-table-column label="批次号" prop="batchNo"></el-table-column>
|
||
|
<el-table-column label="生产日期" prop="productionDate"></el-table-column>
|
||
|
<el-table-column label="失效日期" prop="expireDate"></el-table-column>
|
||
|
<el-table-column label="入库数量" prop="inCount"></el-table-column>
|
||
|
<el-table-column label="出库数量" prop="outCount"></el-table-column>
|
||
|
<el-table-column label="结余数量" prop="reCount">
|
||
|
<template slot-scope="scope">
|
||
|
{{ (scope.row.inCount - scope.row.outCount) }}
|
||
|
</template>
|
||
|
</el-table-column>
|
||
|
<el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip></el-table-column>
|
||
|
</el-table>
|
||
|
</el-card>
|
||
|
|
||
|
<el-dialog
|
||
|
title="库存详情"
|
||
|
:visible.sync="codeDetailVisible"
|
||
|
width="85%"
|
||
|
v-if="codeDetailVisible"
|
||
|
>
|
||
|
<codeDetail
|
||
|
:idQuery="idQuery"
|
||
|
v-on:closeDetailDialog="closeDetailDialog"
|
||
|
></codeDetail>
|
||
|
</el-dialog>
|
||
|
<el-pagination
|
||
|
:page-size="filterQuery.limit"
|
||
|
@current-change="handleCurrentChange"
|
||
|
layout="prev, pager, next"
|
||
|
:total="total"
|
||
|
></el-pagination>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import {stockStatistics, getStorageCode} from "../../api/inventory/InvStatistics";
|
||
|
import draggable from "vuedraggable";
|
||
|
import codeDetail from "./InvProductsDetail";
|
||
|
import store from "../../store";
|
||
|
import {getBussinessType} from "../../api/basic/bussinessType";
|
||
|
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
|
||
|
|
||
|
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
filterQuery: {
|
||
|
cpmctymc: null,
|
||
|
nameCode: null,
|
||
|
relIdFk: null,
|
||
|
batchNo: null,
|
||
|
page: 1,
|
||
|
limit: 20,
|
||
|
customerId: null,
|
||
|
invStorageCode: null,
|
||
|
supId: null,
|
||
|
ggxh: null,
|
||
|
zczbhhzbapzbh: null,
|
||
|
ylqxzcrbarmc: null,
|
||
|
},
|
||
|
detailQuery: {
|
||
|
code: null,
|
||
|
productIdFk: null,
|
||
|
page: 1,
|
||
|
limit: 20,
|
||
|
},
|
||
|
list: [],
|
||
|
codeDetailVisible: false,
|
||
|
total: 0,
|
||
|
loading: false,
|
||
|
index: null,
|
||
|
dialogTableVisible: false,
|
||
|
formLoading: false,
|
||
|
dialogVisible: false,
|
||
|
deleteLoading: false,
|
||
|
busTypes: [],
|
||
|
idQuery: null,
|
||
|
showSup: false,
|
||
|
fromOptions: [],
|
||
|
storageOptions: [],
|
||
|
};
|
||
|
},
|
||
|
components: {
|
||
|
draggable,
|
||
|
codeDetail,
|
||
|
},
|
||
|
methods: {
|
||
|
onReset() {
|
||
|
this.$router.push({
|
||
|
path: "",
|
||
|
});
|
||
|
this.filterQuery = {
|
||
|
invStorageCode: null,
|
||
|
nameCode: null,
|
||
|
relIdFk: null,
|
||
|
batchNo: null,
|
||
|
customerId: null,
|
||
|
unitFk: null,
|
||
|
page: 1,
|
||
|
limit: 20,
|
||
|
};
|
||
|
this.getList();
|
||
|
},
|
||
|
onSubmit() {
|
||
|
//判断统计条件是否全部为空
|
||
|
var param = this.filterQuery;
|
||
|
if (param.cpmctymc == null && param.ggxh == null && param.zczbhhzbapzbh == null && param.ylqxzcrbarmc == null
|
||
|
&& param.invStorageCode == null && param.nameCode == null && param.batchNo == null && param.supId == null) {
|
||
|
this.$message({
|
||
|
message: '统计条件不可为空',
|
||
|
type: 'warning'
|
||
|
});
|
||
|
} else {
|
||
|
this.loading = true;
|
||
|
this.getList();
|
||
|
}
|
||
|
},
|
||
|
handleSizeChange(val) {
|
||
|
this.filterQuery.limit = val;
|
||
|
this.getList();
|
||
|
},
|
||
|
handleCurrentChange(val) {
|
||
|
this.filterQuery.page = val;
|
||
|
this.getList();
|
||
|
},
|
||
|
handleUnitClick(row) {
|
||
|
this.curIndex = row.id;
|
||
|
this.dialogTableVisible = true;
|
||
|
},
|
||
|
closeDetailDialog(val) {
|
||
|
this.codeDetailVisible = false;
|
||
|
},
|
||
|
|
||
|
closeDialog() {
|
||
|
this.getList();
|
||
|
},
|
||
|
getList() {
|
||
|
this.loading = true;
|
||
|
this.filterQuery.customerId = store.getters.customerId;
|
||
|
stockStatistics(this.filterQuery)
|
||
|
.then((response) => {
|
||
|
console.log(response)
|
||
|
this.showSup = response.data.showSup;
|
||
|
this.loading = false;
|
||
|
this.list = response.data.list || [];
|
||
|
this.total = response.data.total || 0;
|
||
|
})
|
||
|
.catch(() => {
|
||
|
this.loading = false;
|
||
|
this.list = [];
|
||
|
this.total = 0;
|
||
|
});
|
||
|
},
|
||
|
|
||
|
//供应商名称候选查询
|
||
|
findMethod(query) {
|
||
|
this.fromOptions = [];
|
||
|
let cQuery = {
|
||
|
key: query,
|
||
|
};
|
||
|
getBasicUnitMaintains(cQuery)
|
||
|
.then((response) => {
|
||
|
this.loading = false;
|
||
|
this.fromOptions = response.data.page.list || [];
|
||
|
})
|
||
|
.catch(() => {
|
||
|
this.loading = false;
|
||
|
});
|
||
|
},
|
||
|
|
||
|
//仓库ID候选查询
|
||
|
findStorageCode(query) {
|
||
|
this.storageOptions = [];
|
||
|
let cQuery = {
|
||
|
key: query,
|
||
|
};
|
||
|
getStorageCode(cQuery).then((response) => {
|
||
|
this.storageOptions = response.data.list;
|
||
|
}).catch(() => {
|
||
|
})
|
||
|
},
|
||
|
|
||
|
intentDetail(row) {
|
||
|
|
||
|
this.idQuery = row;
|
||
|
// this.idQuery.supId = null;
|
||
|
this.idQuery.customerId = null;
|
||
|
this.codeDetailVisible = true;
|
||
|
},
|
||
|
getBusType() {
|
||
|
let query = {
|
||
|
enabled: true,
|
||
|
};
|
||
|
getBussinessType(query)
|
||
|
.then((response) => {
|
||
|
this.busTypes = response.data.list || [];
|
||
|
this.filterQuery.billAction = this.busTypes[0].action;
|
||
|
// this.getList();
|
||
|
})
|
||
|
.catch(() => {
|
||
|
});
|
||
|
},
|
||
|
getActionName(action) {
|
||
|
for (let i = 0; i < this.busTypes.length; i++) {
|
||
|
if (this.busTypes[i].action === action) {
|
||
|
return this.busTypes[i].name;
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
filters: {
|
||
|
statusFilterType(status) {
|
||
|
const statusMap = {
|
||
|
false: "success",
|
||
|
true: "danger",
|
||
|
};
|
||
|
return statusMap[status];
|
||
|
},
|
||
|
},
|
||
|
mounted() {
|
||
|
document.body.ondrop = function (event) {
|
||
|
event.preventDefault();
|
||
|
event.stopPropagation();
|
||
|
};
|
||
|
},
|
||
|
created() {
|
||
|
this.getBusType();
|
||
|
let query = this.$route.query;
|
||
|
this.filterQuery = Object.assign(this.filterQuery, query);
|
||
|
this.filterQuery.limit = parseInt(this.filterQuery.limit);
|
||
|
this.loading = true;
|
||
|
this.getList();
|
||
|
this.findStorageCode();
|
||
|
},
|
||
|
};
|
||
|
</script>
|
||
|
|
||
|
<style type="text/scss" lang="scss">
|
||
|
</style>
|