This commit is contained in:
杰 朱
2022-04-11 13:33:53 +08:00
parent f4b34807a9
commit 480efb7334
2 changed files with 239 additions and 241 deletions

View File

@@ -4,34 +4,21 @@
<div>
<Row :gutter="16">
<Col span="4">
<label>生产订单号</label>
<Input autosize type="textarea" v-model="filter.mo_codes" />
<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>
<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
>
<Button size="large" type="primary" icon="ios-search" @click="handleClick">查询</Button>
<Button size="large" type="success" @click="handelExport">导出</Button>
</Col>
</Row>
</div>
@@ -39,245 +26,247 @@
<div>
<Row :gutter="16">
<Col span="4">
<label></label>
<label></label>
</Col>
<Col span="12">
<label>超领:已领大于应领; 缺领:已领小于(应领*(入库量/生产量))</label>
<label>超领:已领大于应领; 缺领:已领小于(应领*(入库量/生产量))</label>
</Col>
</Row>
</Row>
</div>
<div id="tb">
<Table
style="margin-top: 20px"
:loading="loading"
size="small"
border
:columns="columns"
:data="pagedData"
>
<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"
/>
<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
);
}
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: "缺领",
},
{
value: "无应领",
label: "无应领",
},
],
filter: {
inv_codes: "",
by_finish: ["超领", "缺领"],
inv_std: "",
mo_codes: "",
},
],
};
},
computed: {
total() {
return this.datas.length;
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
);
}
},
},
],
};
},
pagedData() {
return pageingData(this.datas, this.pageSize, this.pageNo);
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() {
mounted() {
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;
}
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;
},
},
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;
}
<style>
h3 {
margin: 40px 0 0;
}
.ivu-table .demo-table-info-row td {
background-color: #2db7f5;
color: #fff;
}
.ivu-table .demo-table-error-row td {
background-color: #ff6600;
color: #fff;
}
ul {
list-style-type: none;
padding: 0;
}
.ivu-table td.demo-table-info-old {
color: #2db7f5;
}
li {
display: inline-block;
margin: 0 10px;
}
.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;
}
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>