采购报表

This commit is contained in:
杰 朱
2021-05-25 00:40:12 +08:00
parent d1727522c1
commit 3f18fdbff0
14 changed files with 1231 additions and 25 deletions

View File

@@ -0,0 +1,312 @@
<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>

View File

@@ -105,16 +105,16 @@ export default {
inv_std: "",
po_codes: "",
app_codes: "",
dates: [getMonth("s", -1), getMonth("e", 0)],
dates: [getMonth("s", -6), getMonth("e", 0)],
dates2: [],
by_finish: false
},
},
columns: [
{
title: "采购订单号",
align: "center",
key: "cpoid",
width: 110,
},
{

View File

@@ -0,0 +1,335 @@
<template>
<div>
<h4>采购订单跟进表</h4>
<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="3">
<label>生产订单期间</label>
<div>
<DatePicker v-model="filter.dates2" type="daterange"></DatePicker>
</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>
<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 { InventoryPoc } 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,
loading: false,
strfilter: "",
multiple: false,
pageSize: 15,
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
},
columns: [
{
title: "业务员",
align: "center",
key: "cpersonname",
},
{
title: "订单号",
align: "center",
key: "cordercode",
},
{
title: "订单日期",
align: "center",
key: "dpodate",
},
{
title: "预计到货日期",
align: "center",
key: "dArriveDate",
},
{
title: "供应商",
align: "center",
key: "cvenabbname",
},
{
title: "存货编码",
align: "center",
key: "cinvcode",
},
{
title: "存货名称",
align: "center",
key: "cinvname",
className: "demo-table-info-new",
},
{
title: "规格型号",
align: "center",
key: "cinvstd",
},
{
title: "单位",
align: "center",
key: "cinvm_unit",
},
{
title: "订单数量",
align: "center",
key: "iquantity",
width: 100,
},
{
title: "未交量",
align: "center",
key: "wjh",
width: 100,
},
{
title: "未入库",
align: "center",
key: "wrk",
width: 100,
},
{
title: "现存量",
align: "center",
key: "xcl",
width: 100,
},
{
title: "缺料量",
align: "center",
key: "qll",
width: 100,
},
{
title: "补料量",
align: "center",
key: "bull",
width: 100,
},
{
title: "本月出库",
align: "center",
key: "iQuantity00",
width: 100,
},
{
title: "上月出库",
align: "center",
key: "iQuantity01",
width: 100,
},
],
};
},
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 _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,
by_finish: this.filter.by_finish
};
this.loading = true;
let resp = await InventoryPoc(_filert);
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>