Browse Source

出入库记录

master
shenzhouyu 2 weeks ago
parent
commit
f17cb0aa32
  1. 7
      src/api/trans/transRecord.js
  2. 353
      src/views/modules/trans/transSubRecordQuery.vue

7
src/api/trans/transRecord.js

@ -0,0 +1,7 @@
import { createAPI } from "@/utils/httpRequest.js";
// 查询出入库子表记录(header + detail + sub)
export const searchTransSubRecords = data =>
createAPI(`/trans/searchTransSubRecords`, 'POST', data);

353
src/views/modules/trans/transSubRecordQuery.vue

@ -0,0 +1,353 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" class="filter-form">
<el-form-item label="出入库单号">
<el-input
v-model="query.transNo"
style="width: 140px"
clearable
@keyup.enter.native="handleSearch"
/>
</el-form-item>
<el-form-item label="出入库类型">
<el-input
v-model="query.transTypeDb"
style="width: 140px"
clearable
@keyup.enter.native="handleSearch"
/>
</el-form-item>
<el-form-item label="标签号">
<el-input
v-model="query.subNo"
style="width: 140px"
clearable
@keyup.enter.native="handleSearch"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
v-model="query.partNo"
style="width: 160px"
clearable
@keyup.enter.native="handleSearch"
/>
</el-form-item>
<el-form-item label="批次号">
<el-input
v-model="query.batchNo"
style="width: 140px"
clearable
@keyup.enter.native="handleSearch"
/>
</el-form-item>
<el-form-item label="库位">
<el-input
v-model="query.locationId"
style="width: 140px"
clearable
@keyup.enter.native="handleSearch"
/>
</el-form-item>
<el-form-item label="方向">
<el-select
v-model="query.direction"
placeholder="全部"
style="width: 120px"
clearable
>
<el-option label="全部" value="" />
<el-option label="入库(+)" value="+" />
<el-option label="出库(-)" value="-" />
</el-select>
</el-form-item>
<el-form-item label="单据状态">
<el-input
v-model="query.status"
style="width: 140px"
clearable
@keyup.enter.native="handleSearch"
/>
</el-form-item>
<el-form-item :label="'出入库日期'">
<el-date-picker
style="width: 120px"
v-model="dateRange.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item style="margin-top: 23px;">
<label style="margin-left: 0px;font-size: 19px">&#10142</label>
</el-form-item>
<el-form-item :label="' '">
<el-date-picker
style="width: 120px"
v-model="dateRange.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
stripe
:height="tableHeight"
v-loading="loading"
style="width: 100%; margin-top: 10px"
>
<el-table-column
prop="transDate"
label="出入库时间"
width="160"
align="center"
sortable
/>
<el-table-column
prop="subNo"
label="标签号"
width="180"
align="center"
/>
<el-table-column
prop="transNo"
label="出入库单号"
width="160"
align="center"
/>
<el-table-column
prop="transTypeDb"
label="出入库类型"
width="120"
align="center"
/>
<el-table-column
prop="warehouseId"
label="仓库"
width="100"
align="center"
/>
<el-table-column
prop="userName"
label="操作人"
width="120"
align="center"
/>
<el-table-column
prop="status"
label="单据状态"
width="100"
align="center"
/>
<el-table-column
prop="subPartNo"
label="物料编码"
width="150"
align="center"
/>
<el-table-column
prop="subBatchNo"
label="批次号"
width="140"
align="center"
/>
<el-table-column
prop="locationId"
label="库位"
width="120"
align="center"
/>
<el-table-column
prop="subQty"
label="数量"
width="100"
align="right"
/>
<el-table-column
prop="direction"
label="方向"
width="80"
align="center"
/>
<el-table-column
prop="subOrderRef3"
label="WDR"
width="120"
align="center"
/>
<el-table-column
prop="engChgLevel"
label="ECN"
width="80"
align="center"
/>
<el-table-column
prop="headerRemark"
label="单据备注"
min-width="180"
align="left"
show-overflow-tooltip
/>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
style="margin-top: 15px; text-align: right"
/>
</div>
</template>
<script>
import { searchTransSubRecords } from "@/api/trans/transRecord.js";
export default {
name: "TransSubRecordQuery",
data() {
return {
query: {
site: localStorage.getItem('site'),
transNo: "",
transTypeDb: "",
warehouseId: "",
partNo: "",
batchNo: "",
locationId: "",
subNo: "",
direction: "",
status: ""
},
dateRange: {
startDate: "",
endDate: ""
},
dataList: [],
loading: false,
tableHeight: 500,
//
pageIndex: 1,
pageSize: 20,
totalPage: 0
};
},
created() {
this.handleSearch();
},
mounted() {
this.$nextTick(() => {
this.tableHeight = window.innerHeight - 320; //
});
},
methods: {
buildRequest() {
const req = { ...this.query };
req.page = this.pageIndex;
req.limit = this.pageSize;
if(this.dateRange.startDate){
req.startDate = this.dateRange.startDate+" 00:00:00";
}
if(this.dateRange.endDate){
req.endDate = this.dateRange.endDate+" 23:59:59";
}
return req;
},
handleSearch() {
//
this.pageIndex = 1;
this.doSearch();
},
doSearch() {
const req = this.buildRequest();
if (!req.site) {
this.$message.warning("请先输入工厂编码");
return;
}
this.loading = true;
searchTransSubRecords(req)
.then(({ data }) => {
if (data && data.code === 0) {
if (data.page) {
this.dataList = data.page.list || [];
this.pageIndex = data.page.currPage || 1;
this.pageSize = data.page.pageSize || 20;
this.totalPage = data.page.totalCount || 0;
} else {
//
this.dataList = data.rows || [];
this.totalPage = this.dataList.length;
}
} else {
this.dataList = [];
this.totalPage = 0;
if (data && data.msg) {
this.$message.error(data.msg);
}
}
})
.catch(() => {
this.dataList = [];
this.totalPage = 0;
this.$message.error("查询失败");
})
.finally(() => {
this.loading = false;
});
},
handleReset() {
this.query = {
site: localStorage.getItem('site'),
transNo: "",
transTypeDb: "",
warehouseId: "",
partNo: "",
batchNo: "",
locationId: "",
subNo: "",
direction: "",
status: ""
};
this.dateRange = {startDate: "", endDate: ""};
this.dataList = [];
this.pageIndex = 1;
this.pageSize = 20;
this.totalPage = 0;
this.handleSearch();
},
//
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.doSearch();
},
//
currentChangeHandle(val) {
this.pageIndex = val;
this.doSearch();
}
}
};
</script>
<style scoped>
.filter-form {
margin-bottom: 10px;
}
</style>
Loading…
Cancel
Save