From f5641fd76ef90a66599e8ce121f3acfd97d779e8 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 16 Jul 2021 11:44:43 +0800
Subject: [PATCH] 样式
---
src/views/parcel/parcelKind.vue | 983 ++++++++++++++++++++++++++++++---------------------------
1 files changed, 522 insertions(+), 461 deletions(-)
diff --git a/src/views/parcel/parcelKind.vue b/src/views/parcel/parcelKind.vue
index c521c50..62c15ac 100644
--- a/src/views/parcel/parcelKind.vue
+++ b/src/views/parcel/parcelKind.vue
@@ -1,26 +1,28 @@
<template>
- <basic-container>
- <avue-crud :option="option"
- :table-loading="loading"
- :data="data"
- :page="page"
- :permission="permissionList"
- :before-open="beforeOpen"
- v-model="form"
- ref="crud"
- :row-style="rowStyle"
- @row-update="rowUpdate"
- @row-save="rowSave"
- @row-del="rowDel"
- @row-click="rowClick"
- :search.sync="search"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad">
+ <basic-container>
+ <avue-crud
+ :option="option"
+ :table-loading="loading"
+ :data="data"
+ :page="page"
+ :permission="permissionList"
+ :before-open="beforeOpen"
+ v-model="form"
+ ref="crud"
+ :row-style="rowStyle"
+ @row-update="rowUpdate"
+ @row-save="rowSave"
+ @row-del="rowDel"
+ @row-click="rowClick"
+ :search.sync="search"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ >
<!-- <template slot-scope="{ type, size, row }" slot="menu">
<el-button
v-if="row.imgUrl != null || row.imgUrl != ''"
@@ -31,462 +33,521 @@
>查看包裹图片
</el-button>
</template> -->
- <template slot="menuLeft">
- <el-button
- v-bind:class="activeClass == 0 ? 'btn-color' : ''"
- size="small "
- @click="getParcelKindData(0)"
- >本日
- </el-button>
- <el-button
- v-bind:class="activeClass == 1 ? 'btn-color' : ''"
- size="small "
- @click="getParcelKindData(1)"
- >本周
- </el-button>
- <el-button
- v-bind:class="activeClass == 2 ? 'btn-color' : ''"
- size="small "
- @click="getParcelKindData(2)"
- >本月
- </el-button>
- </template>
+ <template slot="menuLeft">
+ <el-button
+ v-bind:class="activeClass == 0 ? 'btn-color' : ''"
+ size="small "
+ @click="getParcelKindData(0)"
+ >本日
+ </el-button>
+ <el-button
+ v-bind:class="activeClass == 1 ? 'btn-color' : ''"
+ size="small "
+ @click="getParcelKindData(1)"
+ >本周
+ </el-button>
+ <el-button
+ v-bind:class="activeClass == 2 ? 'btn-color' : ''"
+ size="small "
+ @click="getParcelKindData(2)"
+ >本月
+ </el-button>
+ </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>
+ <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>
<el-image-viewer
- class="img"
- v-if="showViewer"
- :on-close="closeViewer"
- :url-list="['data:image/png;base64,'+imgUrl]" />
+ class="img"
+ v-if="showViewer"
+ :on-close="closeViewer"
+ :url-list="['data:image/png;base64,' + imgUrl]"
+ />
</div>
</template>
- </basic-container>
-
+ </basic-container>
</template>
<script>
- import {getKindList, getParcelPic} from "@/api/parcel/parcel";
- import {mapGetters} from "vuex";
- import Vue from 'vue';
- import ElementUI from 'element-ui'
- import 'element-ui/lib/theme-chalk/index.css'
- import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
- Vue.use(ElementUI)
+import { getKindList, getParcelPic } from "@/api/parcel/parcel";
+import { mapGetters } from "vuex";
+import Vue from "vue";
+import ElementUI from "element-ui";
+import "element-ui/lib/theme-chalk/index.css";
+import ElImageViewer from "element-ui/packages/image/src/image-viewer";
+Vue.use(ElementUI);
-
- export default {
- name:'index',
- components: { ElImageViewer },
- data() {
- return {
- form: {},
- query: {},
- search:{},
- showViewer: false, // 显示查看器
- activeClass:0,
- imgUrl:'',
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- selectionList: [],
- option: {
- menu:false,
- height:'auto',
- calcHeight: 54,
- tip: false,
- searchShow: true,
- searchMenuSpan: 4,
- menuWidth:150,
- border: false,
- stripe:true,
- index: true,
- viewBtn: true,
- selection: true,
- labelWidth:150,
- dialogClickModal: false,
- headerAlign: 'center',
- align: 'center',
- tree:true,
- column: [
- {
- label: '坐标',
- prop: 'test',
- hide: true,
- span: 100,
- component: "avueMap",
- clickChild: (obj) => {
- this.form.jd = obj.latitude
- this.form.wd = obj.longitude
+export default {
+ name: "index",
+ components: { ElImageViewer },
+ data() {
+ return {
+ form: {},
+ query: {},
+ search: {},
+ showViewer: false, // 显示查看器
+ activeClass: 0,
+ imgUrl: "",
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ selectionList: [],
+ option: {
+ menu: false,
+ height: "auto",
+ calcHeight: 54,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 4,
+ menuWidth: 150,
+ border: false,
+ //stripe:true,
+ index: true,
+ viewBtn: true,
+ selection: true,
+ labelWidth: 150,
+ dialogClickModal: false,
+ headerAlign: "center",
+ align: "center",
+ tree: true,
+ column: [
+ {
+ label: "坐标",
+ prop: "test",
+ hide: true,
+ span: 100,
+ component: "avueMap",
+ clickChild: (obj) => {
+ this.form.jd = obj.latitude;
+ this.form.wd = obj.longitude;
+ },
+ },
+ {
+ label: "包裹ID",
+ prop: "packageId",
+ },
+ {
+ label: "包裹图片KEY",
+ prop: "imgUrl",
+ hide: true,
+ },
+ {
+ label: "安检时间",
+ prop: "createTime",
+ },
+ {
+ label: "安检时间",
+ prop: "dateTime",
+ type: "datetime",
+ 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,
+ editDisplay: false,
+ viewDisplay: false,
+ search: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入时间",
+ trigger: "blur",
},
- },
- {
- label: "包裹ID",
- prop: "packageId",
- },
- {
- label: "包裹图片KEY",
- prop: "imgUrl",
- hide:true
- },
- {
- label: "安检时间",
- prop: "createTime",
- },
- {
- label: "安检时间",
- prop: "dateTime",
- type: "datetime",
- 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,
- editDisplay: false,
- viewDisplay: false,
- search: true,
- rules: [
- {
- required: true,
- message: "请输入时间",
- trigger: "blur"
- }
- ]
- },
- // {
- // label: "违禁类型",
- // search: true,
- // searchLabelWidth: 120,
- // searchSpan: 4,
- // hide: true,
- // prop: "decisioDiagramResult",
- // type: "select",
- // dicData: [
- // {
- // label: "是",
- // value: "contraband"
- // },
- // {
- // label: "否",
- // value: "normal"
- // },
- // ]
- // },
- {
- label: '违禁品名称',
- prop: 'objName'
- },
- {
- label: '违禁品编号',
- prop: 'objCode'
- },
- {
- label: '等级',
- prop: 'levName',
- span:120
- },
- {
- label: '坐标',
- prop: 'coords',
- span:500
- }
- ]
- },
- data: [],
- flag: false
+ ],
+ },
+ // {
+ // label: "违禁类型",
+ // search: true,
+ // searchLabelWidth: 120,
+ // searchSpan: 4,
+ // hide: true,
+ // prop: "decisioDiagramResult",
+ // type: "select",
+ // dicData: [
+ // {
+ // label: "是",
+ // value: "contraband"
+ // },
+ // {
+ // label: "否",
+ // value: "normal"
+ // },
+ // ]
+ // },
+ {
+ label: "违禁品名称",
+ prop: "objName",
+ },
+ {
+ label: "违禁品编号",
+ prop: "objCode",
+ },
+ {
+ label: "等级",
+ prop: "levName",
+ span: 120,
+ },
+ {
+ label: "坐标",
+ prop: "coords",
+ span: 500,
+ },
+ ],
+ },
+ data: [],
+ flag: false,
+ };
+ },
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(null, false),
+ viewBtn: this.vaildData(null, false),
+ delBtn: this.vaildData(null, false),
+ editBtn: this.vaildData(null, false),
};
},
- computed: {
- ...mapGetters(["permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(null, false),
- viewBtn: this.vaildData(null, false),
- delBtn: this.vaildData(null, false),
- editBtn: this.vaildData(null, false)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
},
- 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) {
- //清空this.$route.query
- this.$router.push({ query: {} });
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- selectionClear() {
- 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;
- },
- sizeChange(pageSize){
- this.page.pageSize = pageSize;
- },
- 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
- }
- // 当前时间
- 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();
- return Y + "-" + M + "-" + D+ " 00:00:00";
- },
- getEndTime(){
- if (this.$route.query.endTime != undefined && this.$route.query.endTime != null && this.$route.query.endTime != "" ) {
- return this.$route.query.endTime
- }
- // 当前时间
- 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();
- return Y + "-" + M + "-" + D+ " 23:59:59";
- },
- getParcelKindData(e) {
- var that = this;
- this.query={};
- //清空this.$route.query
- this.$router.push({ query: {} });
- that.activeClass = e;
- var today = new Date();
- var params ={};
- if(e==0){
- params = {
- startTime:this.showToDay(today)+ " 00:00:00",
- endTime:this.showToDay(today)+ " 23:59:59"
- };
- //修改搜索框中的值
- this.search.dateTime=[this.showToDay(today)+ " 00:00:00",this.showToDay(today)+ " 23:59:59"]
- }
- if(e==1){
- params = {
- startTime:this.showWeekFirstDay(today)+ " 00:00:00",
- endTime:this.showToDay(today)+ " 23:59:59"
- };
- //修改搜索框中的值
- this.search.dateTime=[this.showWeekFirstDay(today)+ " 00:00:00",this.showToDay(today)+ " 23:59:59"]
- }
- if(e==2){
- params = {
- startTime:this.showMonthFirstDay(today)+ " 00:00:00",
- endTime:this.showToDay(today)+ " 23:59:59"
- };
- //修改搜索框中的值
- this.search.dateTime=[this.showMonthFirstDay(today)+ " 00:00:00",this.showToDay(today)+ " 23:59:59"]
- }
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- },
- //本日
- showToDay(Nowdate){
- var M=Number(Nowdate.getMonth())+1;
- if(M<10){
- M="0"+M;
- }
- var day = Nowdate.getDate();
- if(day<10){
- day = "0"+day;
- }
- return Nowdate.getFullYear()+"-"+M+"-"+day;
- },
-
- //本周第一天
- showWeekFirstDay(Nowdate){
- var WeekFirstDay=new Date(Nowdate-(Nowdate.getDay()-1)*86400000);
- var M=Number(WeekFirstDay.getMonth())+1;
- if(M<10){
- M="0"+M;
- }
- var day = WeekFirstDay.getDate();
- if(day<10){
- day = "0"+day;
- }
- return WeekFirstDay.getFullYear()+"-"+M+"-"+day;
- },
-
- //本月第一天
- showMonthFirstDay(Nowdate){
- var MonthFirstDay=new Date(Nowdate.getFullYear(),Nowdate.getMonth(),1);
- var M=Number(MonthFirstDay.getMonth())+1;
- if(M<10){
- M="0"+M;
- }
- return MonthFirstDay.getFullYear()+"-"+M+"-"+"0"+MonthFirstDay.getDate();
- },
- //给行加颜色
- rowStyle({row, column, rowIndex}){
- return {
- color:"#fe1515"
- }
- },
- //数据导出
- handleExport() {
- this.$confirm("是否导出违禁品数据?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- window.open(`/api/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;
- let values = {
- ...params,
- };
-
- if (this.$route.query.decisioDiagramResult && this.$route.query != undefined && this.$route.query != null && this.$route.query != "" ) {
- if (this.$route.query.startTime != undefined && this.$route.query.startTime != null && this.$route.query.startTime != "" ) {
- this.page.currentPage = 1;
- params = {
- startTime:this.$route.query.startTime,
- endTime:this.$route.query.endTime,
- decisioDiagramResult:this.$route.query.decisioDiagramResult
- }
- } else {
- this.page.currentPage = 1;
- params = {
- 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) {
- values = {
- ...params,
- startTime: dateTime[0],
- endTime: dateTime[1],
- ...this.query,
- };
- values.dateTime = null;
- } else {
- values = {
- ...params,
- ...this.query,
- };
- }
-
- 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;
- this.page.total = data.totalSize;
- this.data = data.data;
- this.loading = false;
- this.selectionClear();
- });
- },
- // 关闭查看器
- closeViewer() {
- this.showViewer = false
+ },
+ 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) {
+ //清空this.$route.query
+ this.$router.push({ query: {} });
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ done();
+ },
+ selectionChange(list) {
+ this.selectionList = list;
+ },
+ selectionClear() {
+ 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;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ 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;
}
- }
- };
+ // 当前时间
+ 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();
+ return Y + "-" + M + "-" + D + " 00:00:00";
+ },
+ getEndTime() {
+ if (
+ this.$route.query.endTime != undefined &&
+ this.$route.query.endTime != null &&
+ this.$route.query.endTime != ""
+ ) {
+ return this.$route.query.endTime;
+ }
+ // 当前时间
+ 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();
+ return Y + "-" + M + "-" + D + " 23:59:59";
+ },
+ getParcelKindData(e) {
+ var that = this;
+ this.query = {};
+ //清空this.$route.query
+ this.$router.push({ query: {} });
+ that.activeClass = e;
+ var today = new Date();
+ var params = {};
+ if (e == 0) {
+ params = {
+ startTime: this.showToDay(today) + " 00:00:00",
+ endTime: this.showToDay(today) + " 23:59:59",
+ };
+ //修改搜索框中的值
+ this.search.dateTime = [
+ this.showToDay(today) + " 00:00:00",
+ this.showToDay(today) + " 23:59:59",
+ ];
+ }
+ if (e == 1) {
+ params = {
+ startTime: this.showWeekFirstDay(today) + " 00:00:00",
+ endTime: this.showToDay(today) + " 23:59:59",
+ };
+ //修改搜索框中的值
+ this.search.dateTime = [
+ this.showWeekFirstDay(today) + " 00:00:00",
+ this.showToDay(today) + " 23:59:59",
+ ];
+ }
+ if (e == 2) {
+ params = {
+ startTime: this.showMonthFirstDay(today) + " 00:00:00",
+ endTime: this.showToDay(today) + " 23:59:59",
+ };
+ //修改搜索框中的值
+ this.search.dateTime = [
+ this.showMonthFirstDay(today) + " 00:00:00",
+ this.showToDay(today) + " 23:59:59",
+ ];
+ }
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ },
+ //本日
+ showToDay(Nowdate) {
+ var M = Number(Nowdate.getMonth()) + 1;
+ if (M < 10) {
+ M = "0" + M;
+ }
+ var day = Nowdate.getDate();
+ if (day < 10) {
+ day = "0" + day;
+ }
+ return Nowdate.getFullYear() + "-" + M + "-" + day;
+ },
+
+ //本周第一天
+ showWeekFirstDay(Nowdate) {
+ var WeekFirstDay = new Date(Nowdate - (Nowdate.getDay() - 1) * 86400000);
+ var M = Number(WeekFirstDay.getMonth()) + 1;
+ if (M < 10) {
+ M = "0" + M;
+ }
+ var day = WeekFirstDay.getDate();
+ if (day < 10) {
+ day = "0" + day;
+ }
+ return WeekFirstDay.getFullYear() + "-" + M + "-" + day;
+ },
+
+ //本月第一天
+ showMonthFirstDay(Nowdate) {
+ var MonthFirstDay = new Date(
+ Nowdate.getFullYear(),
+ Nowdate.getMonth(),
+ 1
+ );
+ var M = Number(MonthFirstDay.getMonth()) + 1;
+ if (M < 10) {
+ M = "0" + M;
+ }
+ return (
+ MonthFirstDay.getFullYear() +
+ "-" +
+ M +
+ "-" +
+ "0" +
+ MonthFirstDay.getDate()
+ );
+ },
+ //给行加颜色
+ rowStyle({ row, column, rowIndex }) {
+ return {
+ color: "#fe1515",
+ };
+ },
+ //数据导出
+ handleExport() {
+ this.$confirm("是否导出违禁品数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ window.open(
+ `/api/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;
+ let values = {
+ ...params,
+ };
+
+ if (
+ this.$route.query.decisioDiagramResult &&
+ this.$route.query != undefined &&
+ this.$route.query != null &&
+ this.$route.query != ""
+ ) {
+ if (
+ this.$route.query.startTime != undefined &&
+ this.$route.query.startTime != null &&
+ this.$route.query.startTime != ""
+ ) {
+ this.page.currentPage = 1;
+ params = {
+ startTime: this.$route.query.startTime,
+ endTime: this.$route.query.endTime,
+ decisioDiagramResult: this.$route.query.decisioDiagramResult,
+ };
+ } else {
+ this.page.currentPage = 1;
+ params = {
+ 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) {
+ values = {
+ ...params,
+ startTime: dateTime[0],
+ endTime: dateTime[1],
+ ...this.query,
+ };
+ values.dateTime = null;
+ } else {
+ values = {
+ ...params,
+ ...this.query,
+ };
+ }
+
+ 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;
+ this.page.total = data.totalSize;
+ this.data = data.data;
+ this.loading = false;
+ this.selectionClear();
+ });
+ },
+ // 关闭查看器
+ closeViewer() {
+ this.showViewer = false;
+ },
+ },
+};
</script>
<style lang="scss">
- .img {
- .el-icon-circle-close {
- color: white;
- }
- }
+.img {
+ .el-icon-circle-close {
+ color: white;
+ }
+}
</style>
--
Gitblit v1.9.3