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

331 lines
7.2 KiB
Vue
Raw Normal View History

2021-05-18 20:27:36 +08:00
<template>
<div>
2021-05-22 16:38:37 +08:00
<h4>采购订单表</h4>
2021-05-18 20:27:36 +08:00
<div>
<Row :gutter="16">
<Col span="4">
<label>采购订单编号</label>
<Input autosize type="textarea" v-model="filter.po_codes" />
</Col>
<Col span="3">
<label>采购订单期间</label>
<div>
<DatePicker v-model="filter.dates" type="daterange"></DatePicker>
</div>
</Col>
<Col span="3">
<label>物料编号</label>
<Input autosize type="textarea" v-model="filter.inv_codes" />
</Col>
<Col span="3">
<label>规格</label>
<Input v-model="filter.inv_std" />
</Col>
<Col span="4">
<label>请购单号</label>
<Input autosize type="textarea" v-model="filter.app_codes" />
</Col>
<Col span="3">
<label>请购订单期间</label>
<div>
<DatePicker v-model="filter.dates2" type="daterange"></DatePicker>
</div>
</Col>
2021-05-21 09:32:30 +08:00
<Col span="3">
<label>状态</label>
<div>
<Checkbox v-model="filter.by_finish">包含关闭</Checkbox>
</div>
</Col>
2021-05-18 20:27:36 +08:00
<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
2021-05-18 20:46:32 +08:00
:loading="loading"
2021-05-18 20:27:36 +08:00
: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 { getInventorypo } from "@/api/pmc";
import {
pageingData,
export_col_to_excel,
dateFormatFull,
dateFormat,
sortByKey,
2021-05-18 20:46:32 +08:00
getMonth,
2021-05-18 20:27:36 +08:00
} from "@/libs/tools";
export default {
data() {
return {
PageSizeOpts: [10, 15, 20, 30],
pageNo: 1,
2021-05-18 20:46:32 +08:00
loading: false,
2021-05-18 20:27:36 +08:00
strfilter: "",
multiple: false,
pageSize: 15,
datas: [],
filter: {
inv_codes: "",
inv_std: "",
po_codes: "",
app_codes: "",
2021-05-18 20:46:32 +08:00
dates: [getMonth("s", -1), getMonth("e", 0)],
2021-05-18 20:27:36 +08:00
dates2: [],
2021-05-21 09:32:30 +08:00
by_finish: false
2021-05-18 20:27:36 +08:00
},
columns: [
{
title: "采购订单号",
align: "center",
key: "cpoid",
2021-05-22 16:38:37 +08:00
width: 110,
2021-05-18 20:27:36 +08:00
},
{
title: "订单日期",
align: "center",
key: "dpodate",
},
{
title: "供应商",
align: "center",
key: "cvenabbname",
},
{
title: "存货编码",
align: "center",
key: "cinvcode",
},
{
title: "存货名称",
align: "center",
key: "cinvname",
className: "demo-table-info-new",
},
2021-05-18 20:46:32 +08:00
2021-05-18 20:27:36 +08:00
{
title: "规格型号",
align: "center",
key: "cinvstd",
},
{
title: "单位",
align: "center",
key: "cinvm_unit",
},
{
title: "累计到货",
align: "center",
key: "ireceivedqty",
2021-05-22 16:38:37 +08:00
width: 100,
2021-05-18 20:27:36 +08:00
},
{
title: "订单数量",
align: "center",
key: "iquantity",
2021-05-22 16:38:37 +08:00
width: 100,
2021-05-18 20:27:36 +08:00
},
{
title: "合计在途",
align: "center",
key: "rqty",
2021-05-22 16:38:37 +08:00
width: 100,
2021-05-18 20:27:36 +08:00
},
{
title: "预计到货日期",
align: "center",
key: "darrivedate",
},
{
title: "请购单号",
align: "center",
key: "cupsocode",
},
{
title: "请购日期",
align: "center",
key: "ddate",
},
{
title: "需求日期",
align: "center",
key: "drequirdate",
},
2021-05-21 09:32:30 +08:00
{
title: "行关闭人",
align: "center",
key: "cbcloser",
2021-05-22 16:38:37 +08:00
width: 100,
2021-05-21 09:32:30 +08:00
},
{
title: "订单关闭人",
align: "center",
key: "ccloser",
2021-05-22 16:38:37 +08:00
width: 100,
2021-05-21 09:32:30 +08:00
},
2021-05-18 20:27:36 +08:00
],
};
},
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() {
2021-05-18 20:46:32 +08:00
try {
let _beginDate = null;
let _endDate = null;
let _beginDate2 = null;
let _endDate2 = null;
if (
this.filter.dates.length == 2 &&
this.filter.dates[0] !== "" &&
this.filter.dates[0] !== ""
) {
_beginDate = this.filter.dates[0];
_endDate = this.filter.dates[1];
}
if (
this.filter.dates2.length == 2 &&
this.filter.dates2[0] !== "" &&
this.filter.dates2[0] !== ""
) {
_beginDate2 = this.filter.dates2[0];
_endDate2 = this.filter.dates2[1];
}
let _filert = {
inv_codes:
this.filter.inv_codes !== ""
? this.filter.inv_codes.split(/[,\s\n,]/)
: null,
inv_std: this.filter.inv_std,
po_codes:
this.filter.po_codes !== ""
? this.filter.po_codes.split(/[,\s\n,]/)
: null,
app_codes:
this.filter.app_codes !== ""
? this.filter.app_codes.split(/[,\s\n,]/)
: null,
begin_date: _beginDate,
end_date: _endDate,
begin_date2: _beginDate2,
end_date2: _endDate2,
2021-05-21 09:32:30 +08:00
by_finish: this.filter.by_finish
2021-05-18 20:46:32 +08:00
};
this.loading = true;
let resp = await getInventorypo(_filert);
this.pageNo = 1;
this.datas = resp.data.data;
this.datas = sortByKey(resp.data.data, "cpoid");
} catch (error) {
} finally {
this.loading = false;
2021-05-18 20:27:36 +08:00
}
},
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>