312 lines
6.7 KiB
Vue
312 lines
6.7 KiB
Vue
|
|
<template>
|
||
|
|
<div>
|
||
|
|
<h4>采购查询汇总</h4>
|
||
|
|
<div>
|
||
|
|
<Row :gutter="16">
|
||
|
|
<Col span="20">
|
||
|
|
<Modal width="1366" v-model="modal1" title="详情" @on-cancel="cancel">
|
||
|
|
<Table
|
||
|
|
style="margin-top: 20px"
|
||
|
|
height="768"
|
||
|
|
size="small"
|
||
|
|
border
|
||
|
|
:columns="columnsDetail"
|
||
|
|
:data="dataDetail"
|
||
|
|
>
|
||
|
|
</Table>
|
||
|
|
</Modal>
|
||
|
|
</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
|
||
|
|
:loading="loading"
|
||
|
|
: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 { Purchasesum,Purchasesumpuapp } from "@/api/Purchase";
|
||
|
|
import {
|
||
|
|
pageingData,
|
||
|
|
export_col_to_excel,
|
||
|
|
dateFormatFull,
|
||
|
|
dateFormat,
|
||
|
|
sortByKey,
|
||
|
|
getMonth,
|
||
|
|
} from "@/libs/tools";
|
||
|
|
export default {
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
PageSizeOpts: [10, 15, 20, 30],
|
||
|
|
pageNo: 1,
|
||
|
|
modal1: false,
|
||
|
|
loading: false,
|
||
|
|
strfilter: "",
|
||
|
|
multiple: false,
|
||
|
|
pageSize: 15,
|
||
|
|
dataDetail : [],
|
||
|
|
datas: [],
|
||
|
|
filter: {
|
||
|
|
inv_codes: "",
|
||
|
|
inv_std: "",
|
||
|
|
po_codes: "",
|
||
|
|
app_codes: "",
|
||
|
|
dates: [getMonth("s", -6), getMonth("e", 0)],
|
||
|
|
dates2: [getMonth("s", -6), getMonth("e", 2)],
|
||
|
|
by_finish: false,
|
||
|
|
},
|
||
|
|
columnsDetail: [
|
||
|
|
{
|
||
|
|
title: "业务员",
|
||
|
|
align: "center",
|
||
|
|
key: "cMaker",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "请购单号",
|
||
|
|
align: "center",
|
||
|
|
key: "ccode",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "请购日期",
|
||
|
|
align: "center",
|
||
|
|
key: "dDatel",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "存货编码",
|
||
|
|
align: "center",
|
||
|
|
key: "cInvCode",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "存货名称",
|
||
|
|
align: "center",
|
||
|
|
key: "cinvname",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "规格型号",
|
||
|
|
align: "center",
|
||
|
|
key: "cinvstd",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "数量",
|
||
|
|
align: "center",
|
||
|
|
key: "RQTY",
|
||
|
|
},
|
||
|
|
],
|
||
|
|
columns: [
|
||
|
|
{
|
||
|
|
title: "业务员",
|
||
|
|
align: "center",
|
||
|
|
key: "cpersonname",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "未下单记录",
|
||
|
|
align: "center",
|
||
|
|
key: "puappnumall",
|
||
|
|
|
||
|
|
render: (h, params) => {
|
||
|
|
return h("div", [
|
||
|
|
h(
|
||
|
|
"a",
|
||
|
|
{
|
||
|
|
props: {
|
||
|
|
type: "primary",
|
||
|
|
size: "small",
|
||
|
|
},
|
||
|
|
style: { color: "#2db7f5" },
|
||
|
|
domProps: {
|
||
|
|
title: params.row.puappnumall, //添加title属性
|
||
|
|
},
|
||
|
|
on: {
|
||
|
|
click: () => {
|
||
|
|
this.handleShow(params.row.cpersonname); //点击事件
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
params.row.puappnumall
|
||
|
|
),
|
||
|
|
]);
|
||
|
|
},
|
||
|
|
},
|
||
|
|
|
||
|
|
{
|
||
|
|
title: "请购三天后未下单记录",
|
||
|
|
align: "center",
|
||
|
|
key: "puappnum03",
|
||
|
|
render: (h, params) => {
|
||
|
|
return h("div", [
|
||
|
|
h(
|
||
|
|
"a",
|
||
|
|
{
|
||
|
|
props: {
|
||
|
|
type: "primary",
|
||
|
|
size: "small",
|
||
|
|
},
|
||
|
|
style: { color: "#2db7f5" },
|
||
|
|
domProps: {
|
||
|
|
title: params.row.puappnum03, //添加title属性
|
||
|
|
},
|
||
|
|
on: {
|
||
|
|
click: () => {
|
||
|
|
this.handleShow2(params.row.cpersonname); //点击事件
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
params.row.puappnum03
|
||
|
|
),
|
||
|
|
]);
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "两个月内计划工单缺品种数",
|
||
|
|
align: "center",
|
||
|
|
key: "mommouth02",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "四个月内计划工单缺品种数",
|
||
|
|
align: "center",
|
||
|
|
key: "mommouth04",
|
||
|
|
},
|
||
|
|
],
|
||
|
|
};
|
||
|
|
},
|
||
|
|
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 handleShow(h) {
|
||
|
|
let _filert2 = {
|
||
|
|
cpersonname: h,
|
||
|
|
cInvCode: null,
|
||
|
|
cday:0
|
||
|
|
};
|
||
|
|
let respd = await Purchasesumpuapp(_filert2);
|
||
|
|
this.dataDetail = sortByKey(respd.data.data, "ccode");
|
||
|
|
this.modal1 = true;
|
||
|
|
},
|
||
|
|
async handleShow2(h) {
|
||
|
|
let _filert2 = {
|
||
|
|
cpersonname: h,
|
||
|
|
cInvCode: null,
|
||
|
|
cday:3
|
||
|
|
};
|
||
|
|
let respd = await Purchasesumpuapp(_filert2);
|
||
|
|
this.dataDetail = sortByKey(respd.data.data, "ccode");
|
||
|
|
this.modal1 = true;
|
||
|
|
},
|
||
|
|
cancel() {
|
||
|
|
this.dataDetail = [];
|
||
|
|
this.modal1 = false;
|
||
|
|
},
|
||
|
|
async loadData() {
|
||
|
|
try {
|
||
|
|
this.loading = true;
|
||
|
|
let resp = await Purchasesum();
|
||
|
|
this.pageNo = 1;
|
||
|
|
this.datas = resp.data.data;
|
||
|
|
// this.datas = sortByKey(resp.data.data, "cordercode");
|
||
|
|
} 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;
|
||
|
|
}
|
||
|
|
.ivu-table td.demo-table-info-ex {
|
||
|
|
color: #187;
|
||
|
|
font-weight: 600;
|
||
|
|
}
|
||
|
|
body {
|
||
|
|
padding: 10px 1;
|
||
|
|
}
|
||
|
|
</style>
|