增加序列号查询

This commit is contained in:
杰 朱
2021-05-10 20:26:19 +08:00
parent 4f23bad34e
commit 4b07264ddc
10 changed files with 401 additions and 0 deletions

View File

@@ -0,0 +1,254 @@
<template>
<div>
<h4>序列号查询</h4>
<div>
<Row :gutter="16">
<Col span="4">
<label>产品入库订单编号</label>
<Input v-model="filter.cprk" />
</Col>
<Col span="4">
<label>销售出库订单编号</label>
<Input v-model="filter.clck" />
</Col>
<Col span="4">
<label>物料编号</label>
<Input autosize type="textarea" v-model="filter.c_inv_codes" />
</Col>
<Col span="4">
<label>序列号</label>
<Input autosize type="textarea" v-model="filter.c_inv_sn" />
</Col>
<Col span="4">
<Button
size="large"
type="primary"
icon="ios-search"
@click="handleClick"
>查询</Button
>
<Button size="large" type="success" @click="handelExport"
>导出</Button
>
</Col>
</Row>
</div>
<Table
style="margin-top: 20px"
size="small"
border
:columns="columns"
:data="pagedData"
>
</Table>
<Page
style="margin-top: 20px"
:current="pageNo"
:page-size="pageSize"
:total="total"
:page-size-opts="PageSizeOpts"
@on-change="handlePagechange"
@on-page-size-change="handlePageSize"
show-elevator
show-sizer
show-total
size="small"
/>
</div>
</template>
<script>
import { InventorySNDetail } from "@/api/Finance";
import {
pageingData,
export_col_to_excel,
dateFormatFull,
dateFormat,
sortByKey,
} from "@/libs/tools";
export default {
data() {
return {
PageSizeOpts: [10, 15, 20, 30],
pageNo: 1,
strfilter: "",
multiple: false,
pageSize: 15,
datas: [],
filter: {
cprk: "",
clck: "",
c_inv_codes: "",
c_inv_sn: "",
dates: [],
},
columns: [
{
title: "存货编码",
align: "center",
key: "cInvCode",
},
{
title: "存货名称",
align: "center",
key: "cInvName",
},
{
title: "入库单号",
align: "center",
key: "Cprk",
className: "demo-table-info-new",
},
{
title: "入库日期",
align: "center",
key: "rkrq",
render: (h, params) => {
return <div> {dateFormat(params.row.rkrq)} </div>;
},
},
{
title: "仓库",
align: "center",
key: "cWhName",
},
{
title: "生产订单号",
align: "center",
key: "cMPoCode",
},
{
title: "生产部门",
align: "center",
key: "cDepName",
},
{
title: "入库序列号",
align: "center",
key: "cInvSN",
},
{
title: "出库库单号",
align: "center",
key: "Clck",
className: "demo-table-info-old",
},
{
title: "出库日期",
align: "center",
key: "ckrq",
render: (h, params) => {
return <div> {dateFormat(params.row.ckrq)} </div>;
},
},
{
title: "客户",
align: "center",
key: "cCusAbbName",
},
{
title: "出库库序列号",
align: "center",
key: "ckcInvSN",
},
],
};
},
computed: {
total() {
return this.datas.length;
},
pagedData() {
return pageingData(this.datas, this.pageSize, this.pageNo);
},
},
mounted() {
this.loadData();
},
methods: {
handelExport() {
export_col_to_excel(this.columns, this.datas);
},
handleClick() {
this.loadData();
},
async loadData() {
let _filert = {
cprk:
this.filter.cprk !== "" ? this.filter.cprk.split(/[,\s\n,]/) : null,
clck:
this.filter.clck !== "" ? this.filter.clck.split(/[,\s\n,]/) : null,
c_inv_codes:
this.filter.c_inv_codes !== ""
? this.filter.c_inv_codes.split(/[,\s\n,]/)
: null,
c_inv_sn:
this.filter.c_inv_sn !== ""
? this.filter.c_inv_sn.split(/[,\s\n,]/)
: null,
};
let resp = await InventorySNDetail(_filert);
this.pageNo = 1;
this.datas = resp.data.data;
this.datas = sortByKey(resp.data.data, "Cprk");
},
handlePagechange(page) {
this.pageNo = page;
},
handlePageSize(pageSize) {
this.pageSize = pageSize;
},
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
.ivu-table .demo-table-info-row td {
background-color: #2db7f5;
color: #fff;
}
.ivu-table .demo-table-error-row td {
background-color: #ff6600;
color: #fff;
}
.ivu-table td.demo-table-info-old {
color: #2db7f5;
}
.ivu-table td.demo-table-info-new {
color: #ff6600;
}
.ivu-table td.demo-table-info-ex {
color: #187;
font-weight: 600;
}
body {
padding: 10px 1;
}
</style>