|
@@ -40,6 +40,8 @@ import { getCookie } from "@/utils/util.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ //导出excel标题
|
|
|
+ tableTitle: null,
|
|
|
//报表所有数据
|
|
|
totalArr: [],
|
|
|
//纯内转数据
|
|
@@ -88,7 +90,7 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
.then(() => {
|
|
|
- this.openFullScreen();
|
|
|
+ this.openFullScreen1();
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$message.info("取消导出");
|
|
@@ -119,148 +121,121 @@ export default {
|
|
|
openFullScreen1() {
|
|
|
let startTime = null;
|
|
|
let endTime = null;
|
|
|
+ let orgCode = null;
|
|
|
if (this.startTime && this.endTime) {
|
|
|
startTime = sjTime(this.startTime);
|
|
|
endTime = sjTime(this.endTime);
|
|
|
}
|
|
|
+ if (
|
|
|
+ getCookie("orgCode") != "dagangadmin" &&
|
|
|
+ getCookie("orgCode") != "zidonghuabu"
|
|
|
+ ) {
|
|
|
+ orgCode = getCookie("orgCode");
|
|
|
+ }
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: "请等待导出",
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
|
});
|
|
|
- if (
|
|
|
- getCookie("orgCode") == "dagangadmin" ||
|
|
|
- getCookie("orgCode") == "zidonghuabu"
|
|
|
- ) {
|
|
|
- this.axios
|
|
|
- .post(
|
|
|
- "/api/v1/tms/getInwardInFactory?apiId=486&orgCode=null&isPage=yes&startTime=" +
|
|
|
- startTime +
|
|
|
- "&endTime=" +
|
|
|
- endTime +
|
|
|
- "&index=" +
|
|
|
- this.input
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- this.inwardArr = res.data.data;
|
|
|
- this.totalArr = this.totalArr.concat(this.inwardArr);
|
|
|
- this.axios
|
|
|
- .post(
|
|
|
- "/api/v1/tms/getPurchaseInwardList?apiId=486&orgCode=null&isPage=yes&startTime=" +
|
|
|
- startTime +
|
|
|
- "&endTime=" +
|
|
|
- endTime +
|
|
|
- "&index=" +
|
|
|
- this.input +
|
|
|
- "&i=" +
|
|
|
- new Date()
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- this.purInward = res.data.data;
|
|
|
- this.totalArr = this.totalArr.concat(this.purInward);
|
|
|
- this.axios
|
|
|
- .post(
|
|
|
- "/api/v1/tms/getSaleOrderList?apiId=486&orgCode=null&isPage=yes&startTime=" +
|
|
|
- startTime +
|
|
|
- "&endTime=" +
|
|
|
- endTime +
|
|
|
- "&index=" +
|
|
|
- this.input +
|
|
|
- "&i=" +
|
|
|
- new Date()
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- this.saleReport = res.data.data;
|
|
|
- this.totalArr = this.totalArr.concat(this.saleReport);
|
|
|
- this.axios
|
|
|
- .post(
|
|
|
- "/api/v1/tms/getPurchaseOrderList?apiId=486&orgCode=null&isPage=yes&startTime=" +
|
|
|
- startTime +
|
|
|
- "&endTime=" +
|
|
|
- endTime +
|
|
|
- "&index=" +
|
|
|
- this.input +
|
|
|
- "&i=" +
|
|
|
- new Date()
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- this.purReport = res.data.data;
|
|
|
- this.totalArr = this.totalArr.concat(this.purReport);
|
|
|
- this.exportAllReportToExcel();
|
|
|
- loading.close();
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
+ if (this.activeName == "first") {
|
|
|
this.axios
|
|
|
.post(
|
|
|
- "/api/v1/tms/getInwardInFactory?apiId=486&isPage=yes&orgCode=" +
|
|
|
- getCookie("orgCode") +
|
|
|
- "&startTime=" +
|
|
|
+ "/api/v1/tms/getInwardInFactory?apiId=486&isPage=yes&startTime=" +
|
|
|
startTime +
|
|
|
"&endTime=" +
|
|
|
endTime +
|
|
|
"&index=" +
|
|
|
- this.input
|
|
|
+ this.input +
|
|
|
+ "&orgCode=" +
|
|
|
+ orgCode
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.totalArr = [];
|
|
|
+ this.inwardArr = [];
|
|
|
+ this.tableTitle = "纯内转统计报表";
|
|
|
this.inwardArr = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.inwardArr);
|
|
|
+ this.exportAllReportToExcel();
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.close();
|
|
|
+ }, 2000);
|
|
|
});
|
|
|
+ } else if (this.activeName == "second") {
|
|
|
this.axios
|
|
|
.post(
|
|
|
- "/api/v1/tms/getPurchaseInwardList?apiId=486&isPage=yes&orgCode=" +
|
|
|
- getCookie("orgCode") +
|
|
|
- "&startTime=" +
|
|
|
+ "/api/v1/tms/getPurchaseInwardList?apiId=486&isPage=yes&startTime=" +
|
|
|
startTime +
|
|
|
"&endTime=" +
|
|
|
endTime +
|
|
|
"&index=" +
|
|
|
- this.input
|
|
|
+ this.input +
|
|
|
+ "&orgCode=" +
|
|
|
+ orgCode
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.totalArr = [];
|
|
|
+ this.purInward = [];
|
|
|
+ this.tableTitle = "采购内转统计报表";
|
|
|
this.purInward = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.purInward);
|
|
|
+ this.exportAllReportToExcel();
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.close();
|
|
|
+ }, 2000);
|
|
|
});
|
|
|
+ } else if (this.activeName == "third") {
|
|
|
this.axios
|
|
|
.post(
|
|
|
- "/api/v1/tms/getSaleOrderList?apiId=486&isPage=yes&orgCode=" +
|
|
|
- getCookie("orgCode") +
|
|
|
- "&startTime=" +
|
|
|
+ "/api/v1/tms/getSaleOrderList?apiId=486&isPage=yes&startTime=" +
|
|
|
startTime +
|
|
|
"&endTime=" +
|
|
|
endTime +
|
|
|
"&index=" +
|
|
|
- this.input
|
|
|
+ this.input +
|
|
|
+ "&orgCode=" +
|
|
|
+ orgCode
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ thia.totalArr = [];
|
|
|
+ this.saleReport = [];
|
|
|
+ this.tableTitle = "销售内转统计报表";
|
|
|
this.saleReport = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.saleReport);
|
|
|
+ this.exportAllReportToExcel();
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.close();
|
|
|
+ }, 2000);
|
|
|
});
|
|
|
+ } else {
|
|
|
this.axios
|
|
|
.post(
|
|
|
- "/api/v1/tms/getPurchaseOrderList?apiId=486&isPage=yes&orgCode=" +
|
|
|
- getCookie("orgCode") +
|
|
|
- "&startTime=" +
|
|
|
+ "/api/v1/tms/getPurchaseOrderList?apiId=486&isPage=yes&startTime=" +
|
|
|
startTime +
|
|
|
"&endTime=" +
|
|
|
endTime +
|
|
|
"&index=" +
|
|
|
- this.input
|
|
|
+ this.input +
|
|
|
+ "&orgCode=" +
|
|
|
+ orgCode
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.totalArr = [];
|
|
|
+ this.purReport = [];
|
|
|
+ this.tableTitle = "采购燃料统计报表";
|
|
|
this.purReport = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.purReport);
|
|
|
this.exportAllReportToExcel();
|
|
|
- loading.close();
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.close();
|
|
|
+ }, 2000);
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
openFullScreen() {
|
|
|
let startTime = null;
|
|
|
let endTime = null;
|
|
|
+ this.totalArr = [];
|
|
|
if (this.startTime && this.endTime) {
|
|
|
startTime = sjTime(this.startTime);
|
|
|
endTime = sjTime(this.endTime);
|
|
@@ -285,6 +260,7 @@ export default {
|
|
|
this.input
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.inwardArr = [];
|
|
|
this.inwardArr = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.inwardArr);
|
|
|
this.axios
|
|
@@ -299,6 +275,7 @@ export default {
|
|
|
new Date()
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.purInward = [];
|
|
|
this.purInward = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.purInward);
|
|
|
this.axios
|
|
@@ -313,6 +290,7 @@ export default {
|
|
|
new Date()
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.saleReport = [];
|
|
|
this.saleReport = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.saleReport);
|
|
|
this.axios
|
|
@@ -327,10 +305,14 @@ export default {
|
|
|
new Date()
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.purReport = [];
|
|
|
this.purReport = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.purReport);
|
|
|
+ this.tableTitle = "全部内转车辆报表";
|
|
|
this.exportAllReportToExcel();
|
|
|
- loading.close();
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.close();
|
|
|
+ }, 2000);
|
|
|
});
|
|
|
});
|
|
|
});
|
|
@@ -348,6 +330,7 @@ export default {
|
|
|
this.input
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.inwardArr = [];
|
|
|
this.inwardArr = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.inwardArr);
|
|
|
});
|
|
@@ -363,6 +346,7 @@ export default {
|
|
|
this.input
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.purInward = [];
|
|
|
this.purInward = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.purInward);
|
|
|
});
|
|
@@ -378,6 +362,7 @@ export default {
|
|
|
this.input
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.saleReport = [];
|
|
|
this.saleReport = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.saleReport);
|
|
|
});
|
|
@@ -393,10 +378,13 @@ export default {
|
|
|
this.input
|
|
|
)
|
|
|
.then(res => {
|
|
|
+ this.purReport = [];
|
|
|
this.purReport = res.data.data;
|
|
|
this.totalArr = this.totalArr.concat(this.purReport);
|
|
|
this.exportAllReportToExcel();
|
|
|
- loading.close();
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.close();
|
|
|
+ }, 2000);
|
|
|
});
|
|
|
}
|
|
|
},
|