From 4f11d6a54ade61ba7daf8ba856014d2f8994badf Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Sun, 09 May 2021 08:34:19 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/jfpt-Vue
---
src/views/parcel/parcelKind.vue | 138 +++++++++++++++++++++++++++++++++++++--------
1 files changed, 113 insertions(+), 25 deletions(-)
diff --git a/src/views/parcel/parcelKind.vue b/src/views/parcel/parcelKind.vue
index e922997..523d5d3 100644
--- a/src/views/parcel/parcelKind.vue
+++ b/src/views/parcel/parcelKind.vue
@@ -8,9 +8,11 @@
:before-open="beforeOpen"
v-model="form"
ref="crud"
+ :row-style="rowStyle"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
+ @row-click="rowClick"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@@ -18,7 +20,7 @@
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
- <template slot-scope="{ type, size, row }" slot="menu">
+ <!-- <template slot-scope="{ type, size, row }" slot="menu">
<el-button
v-if="row.imgUrl != null || row.imgUrl != ''"
icon="el-icon-view"
@@ -27,19 +29,28 @@
@click.stop="handleParcelPic(row)"
>查看包裹图片
</el-button>
- </template>
+ </template> -->
+ <template slot="menuLeft">
+ <el-button type="warning"
+ size="small"
+ plain
+ icon="el-icon-download"
+ @click="handleExport">导出
+ </el-button>
+ <el-button type="warning"
+ size="small"
+ plain
+ icon="el-icon-pie-chart"
+ @click="handleExportStatis">导出报表
+ </el-button>
+ </template>
</avue-crud>
<template>
<div>
- <!-- style="display:none" -->
- <!-- <el-image
- ref="preview"
- :src="'data:image/png;base64,'+imgUrl"
- :preview-src-list="['data:image/png;base64,'+imgUrl]"
- z-index=9999></el-image> -->
- <el-image-viewer
- v-if="showViewer"
- :on-close="closeViewer"
+ <el-image-viewer
+ class="img"
+ v-if="showViewer"
+ :on-close="closeViewer"
:url-list="['data:image/png;base64,'+imgUrl]" />
</div>
</template>
@@ -66,6 +77,7 @@
form: {},
query: {},
showViewer: false, // 显示查看器
+ activeClass:0,
imgUrl:'',
loading: true,
page: {
@@ -75,13 +87,15 @@
},
selectionList: [],
option: {
+ menu:false,
height:'auto',
- calcHeight: 30,
+ calcHeight: 54,
tip: false,
searchShow: true,
searchMenuSpan: 4,
menuWidth:150,
- border: true,
+ border: false,
+ stripe:true,
index: true,
viewBtn: true,
selection: true,
@@ -122,6 +136,7 @@
format: "yyyy-MM-dd HH:mm:ss",
valueFormat: "yyyy-MM-dd HH:mm:ss",
searchRange: true,
+ searchValue: [this.getStartTime(),this.getEndTime()],
searchSpan: 8,
hide: true,
addDisplay: false,
@@ -199,11 +214,15 @@
},
methods: {
beforeOpen(done, type) {
-
+
done();
},
searchReset() {
+ //清空搜索框中的内容
this.query = {};
+ //清空this.$route.query
+ this.$router.push({ query: {} });
+ this.activeClass=0;
this.onLoad(this.page);
},
searchChange(params, done) {
@@ -219,6 +238,13 @@
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
+ rowClick(row){
+ var that=this;
+ getParcelPic(row.imgUrl).then(res => {
+ that.imgUrl = res.data.data.imgBase64;
+ this.showViewer = true
+ });
+ },
currentChange(currentPage){
this.page.currentPage = currentPage;
},
@@ -227,6 +253,44 @@
},
refreshChange() {
this.onLoad(this.page, this.query);
+ },
+ getStartTime(){
+ if (this.$route.query.startTime != undefined && this.$route.query.startTime != null && this.$route.query.startTime != "" ) {
+ return this.$route.query.startTime
+ }
+ return '';
+ },
+ getEndTime(){
+ if (this.$route.query.endTime != undefined && this.$route.query.endTime != null && this.$route.query.endTime != "" ) {
+ return this.$route.query.endTime
+ }
+ return '';
+ },
+ //给行加颜色
+ rowStyle({row, column, rowIndex}){
+ return {
+ color:"#fe1515"
+ }
+ },
+ //数据导出
+ handleExport() {
+ this.$confirm("是否导出违禁品数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ }).then(() => {
+ window.open(`/api/blade-jfpts/parcel/parcel/export-parcelKind?startTime=${this.$route.query.startTime}&endTime=${this.$route.query.endTime}&decisioDiagramResult=${this.$route.query.decisioDiagramResult}&timeDesc=${this.$route.query.timeDesc}`);
+ });
+ },
+ //数据报表导出
+ handleExportStatis() {
+ let startTime = this.$route.query.startTime==undefined? '':this.$route.query.startTime;
+ let endTime = this.$route.query.endTime==undefined? '':this.$route.query.endTime;
+ let decisioDiagramResult = this.$route.query.decisioDiagramResult==undefined? '':this.$route.query.decisioDiagramResult;
+ let timeDesc = this.$route.query.timeDesc;
+ //window.open(`http://localhost:8108/ureport/excel?_u=blade-parcelKind.statis.ureport.xml&startTime=${startTime}&endTime=${endTime}&decisioDiagramResult=${decisioDiagramResult}&timeDesc=${timeDesc}`);
+ //window.open(`http://localhost:8108/ureport/preview?_u=blade-parcelKind.statis.ureport.xml&startTime=${startTime}&endTime=${endTime}&decisioDiagramResult=${decisioDiagramResult}&timeDesc=${timeDesc}`);
+ window.open(`https://web.byisf.com/api/blade-report/ureport/preview?_u=blade-parcelKind.statis.ureport.xml&startTime=${startTime}&endTime=${endTime}&decisioDiagramResult=${decisioDiagramResult}&timeDesc=${timeDesc}`);
},
onLoad(page, params = {}) {
const { dateTime } = this.query;
@@ -248,6 +312,23 @@
decisioDiagramResult:this.$route.query.decisioDiagramResult
};
}
+ this.activeClass=4;
+ }
+
+ if(this.activeClass==0){
+ this.page.currentPage = 1;
+ // 当前时间
+ var date = new Date();
+ //年
+ var Y = date.getFullYear();
+ //月
+ var M = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
+ //日
+ var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
+ params = {
+ startTime:Y + "-" + M + "-" + D + " 00:00:00",
+ endTime:Y +"-" +M +"-" + D + " 23:59:59"
+ }
}
if (dateTime) {
@@ -265,6 +346,14 @@
};
}
+ if (this.$route.query.timeDesc) {
+ values = {
+ ...params,
+ timeDesc: this.$route.query.timeDesc,
+ ...this.query,
+ };
+ }
+
this.loading = true;
getKindList(page.currentPage, page.pageSize,values).then(res => {
const data = res.data.data;
@@ -274,18 +363,17 @@
this.selectionClear();
});
},
- handleParcelPic(row) {
- var that = this;
- getParcelPic(row.imgUrl).then(res => {
- that.imgUrl = res.data.data.imgBase64;
- //that.$refs.preview.clickHandler();
- this.showViewer = true
- });
- },
// 关闭查看器
- closeViewer() {
- this.showViewer = false
- }
+ closeViewer() {
+ this.showViewer = false
+ }
}
};
</script>
+<style lang="scss">
+ .img {
+ .el-icon-circle-close {
+ color: white;
+ }
+ }
+</style>
--
Gitblit v1.9.3