Files
U8-Import/NX.ERP.Webapp/src/bill/inventory-error.vue
2021-06-10 14:25:20 +08:00

283 lines
5.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<h4>异常单据查询</h4>
<div>
<Row :gutter="16">
<Col span="4">
<label>生产订单号</label>
<Input autosize type="textarea" v-model="filter.mo_codes" />
</Col>
<Col span="3">
<label>异常类型:</label>
<div>
<Select v-model="filter.by_finish" multiple>
<Option
v-for="item in stateList"
:value="item.value"
:key="item.value"
>{{ item.label }}</Option
>
</Select>
</div>
</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>
<div>
<Row :gutter="16">
<Col span="4">
<label></label>
</Col>
<Col span="12">
<label>超领:已领大于应领; 缺领:已领小于(应领*(入库量/生产量))</label>
</Col>
</Row>
</div>
<div id="tb">
<Table
style="margin-top: 20px"
:loading="loading"
size="small"
border
:columns="columns"
:data="pagedData"
>
</Table>
</div>
<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 { Voucherror } from "@/api/Finance";
//import vUpLoad from "@/bill/PrintView";
import { pageingData, export_col_to_excel, sortByKey } from "@/libs/tools";
export default {
//components:{vUpLoad},
data() {
return {
loading: false,
PageSizeOpts: [10, 15, 20, 30],
pageNo: 1,
modal1: false,
printing: false,
strfilter: "",
multiple: false,
pageSize: 15,
datas: [],
ccode: "",
stateList: [
{
value: "超领",
label: "超领",
},
{
value: "缺领",
label: "缺领",
},
],
filter: {
inv_codes: "",
by_finish: ["超领", "缺领"],
inv_std: "",
mo_codes: "",
},
columns: [
{
title: "生产订单号",
align: "center",
key: "MoCode",
},
{
title: "行号",
align: "center",
key: "SortSeq",
width: 80,
},
{
title: "产品编号",
align: "center",
key: "InvCode",
width: 120,
},
{
title: "产品名称",
align: "center",
key: "cInvName",
},
{
title: "子件编号",
align: "center",
key: "InvCode1",
width: 120,
},
{
title: "子件名称",
align: "center",
key: "cInvName1",
},
{
title: "规格型号",
align: "center",
key: "cInvStd",
},
{
title: "应领数量",
align: "center",
key: "Qty",
},
{
title: "已领数量",
align: "center",
key: "IssQty",
},
{
title: "异常情况",
align: "center",
key: "error",
render: (h, params) => {
if (params.row.error === "超领") {
return h(
"span",
{ style: { color: "#ff6600" } },
params.row.error
);
} else {
return h(
"span",
{ style: { color: "#2db7f5" } },
params.row.error
);
}
},
},
],
};
},
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() {
try {
let _filert = {
ccode:
this.filter.mo_codes !== ""
? this.filter.mo_codes.split(/[,\s\n,]/)
: null,
error: this.filter.by_finish,
};
this.loading = true;
let resp = await Voucherror(_filert);
this.pageNo = 1;
this.datas = sortByKey(resp.data.data, "MoCode");
// this.datas = resp.data.data;
} catch (error) {
} finally {
this.loading = false;
}
},
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;
font-size: 12px;
}
.ivu-table td.demo-table-info-nom {
font-size: 11px;
}
.ivu-table td.demo-table-info-ex {
color: #187;
font-weight: 600;
}
body {
padding: 10px 1;
}
</style>