Files
U8-Import/NX.ERP.Webapp/src/views/inventory.vue

254 lines
5.1 KiB
Vue
Raw Normal View History

2021-04-30 16:39:20 +08:00
<template>
<div>
<h4>物料在途在制查询表</h4>
<div>
<Row :gutter="16">
<Col span="8">
<label>物料编号</label>
<Input autosize type="textarea" v-model="filter.inv_codes" />
</Col>
<Col span="4">
<label>规格</label>
<Input v-model="filter.inv_std" />
</Col>
2021-05-03 15:49:34 +08:00
<Col span="8">
<Button
size="large"
type="primary"
icon="ios-search"
@click="handleClick"
>查询</Button
>
<Button size="large" type="success" @click="handelExport"
>导出</Button
>
2021-04-30 16:39:20 +08:00
</Col>
</Row>
</div>
2021-05-03 15:49:34 +08:00
<Table
style="margin-top: 20px"
size="small"
border
:columns="columns"
:data="pagedData"
>
</Table>
2021-04-30 16:39:20 +08:00
<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>
2021-05-03 15:49:34 +08:00
import { getInventoryall } from "@/api/pmc";
import { pageingData, export_col_to_excel, sortByKey } from "@/libs/tools";
2021-04-30 16:39:20 +08:00
export default {
data() {
return {
PageSizeOpts: [10, 15, 20, 30],
pageNo: 1,
2021-05-03 15:49:34 +08:00
strfilter: "",
2021-04-30 16:39:20 +08:00
multiple: false,
pageSize: 15,
datas: [],
filter: {
2021-05-03 15:49:34 +08:00
inv_codes: "",
inv_std: "",
so_code: "",
2021-04-30 16:39:20 +08:00
},
columns: [
{
2021-05-03 15:49:34 +08:00
type: "index",
title: "序号",
width: 60,
align: "center",
2021-04-30 16:39:20 +08:00
},
2021-05-03 15:49:34 +08:00
2021-04-30 16:39:20 +08:00
{
2021-05-03 15:49:34 +08:00
title: "存货编码",
align: "center",
key: "invcode1",
className: "demo-table-info-new",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "存货名称",
align: "center",
key: "cinvname1",
className: "demo-table-info-old",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "规格型号",
width: 200,
align: "center",
key: "cinvstd1",
className: "demo-table-info-old",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "单位",
width: 80,
align: "center",
key: "c_com_unit_name",
className: "demo-table-info-old",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "属性",
align: "center",
key: "std",
className: "demo-table-info-old",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "总需求(未领量)",
align: "center",
key: "wqty",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "现存量",
align: "center",
key: "cqty",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "已领(现场)",
align: "center",
key: "issqty",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "现存无废品",
align: "center",
key: "dqty",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "采购在途",
align: "center",
key: "rqty",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "委外在途",
align: "center",
key: "rqty1",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "请购",
align: "center",
key: "rqty3",
2021-04-30 16:39:20 +08:00
},
{
2021-05-03 15:49:34 +08:00
title: "在制",
align: "center",
key: "momqty",
},
2021-05-26 17:05:28 +08:00
{
title: "净存",
align: "center",
key: "q",
},
{
title: "供应商",
align: "center",
key: "c_ven_abb_name",
},
{
title: "业务员",
align: "center",
key: "c_maker",
},
2021-05-03 15:49:34 +08:00
],
};
2021-04-30 16:39:20 +08:00
},
computed: {
total() {
2021-05-03 15:49:34 +08:00
return this.datas.length;
2021-04-30 16:39:20 +08:00
},
pagedData() {
2021-05-03 15:49:34 +08:00
return pageingData(this.datas, this.pageSize, this.pageNo);
},
2021-04-30 16:39:20 +08:00
},
mounted() {
2021-05-03 15:49:34 +08:00
this.loadData();
2021-04-30 16:39:20 +08:00
},
methods: {
handelExport() {
2021-05-03 15:49:34 +08:00
export_col_to_excel(this.columns, this.datas);
2021-04-30 16:39:20 +08:00
},
handleClick() {
2021-05-03 15:49:34 +08:00
this.loadData();
console.log(2);
2021-04-30 16:39:20 +08:00
},
async loadData() {
let _filert = {
2021-05-03 15:49:34 +08:00
inv_codes:
this.filter.inv_codes !== ""
? this.filter.inv_codes.split(/[,\s\n,]/)
: null,
2021-04-30 16:39:20 +08:00
inv_std: this.filter.inv_std,
2021-05-03 15:49:34 +08:00
so_code: this.filter.so_code,
};
let resp = await getInventoryall(_filert);
this.pageNo = 1;
this.datas = sortByKey(resp.data.data, "invcode1");
2021-04-30 16:39:20 +08:00
},
2021-05-03 15:49:34 +08:00
2021-04-30 16:39:20 +08:00
handlePagechange(page) {
2021-05-03 15:49:34 +08:00
this.pageNo = page;
2021-04-30 16:39:20 +08:00
},
handlePageSize(pageSize) {
2021-05-03 15:49:34 +08:00
this.pageSize = pageSize;
},
},
};
2021-04-30 16:39:20 +08:00
</script>
2021-05-03 15:49:34 +08:00
<!-- 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;
}
2021-04-30 16:39:20 +08:00
</style>