| | |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @row-click="rowClick" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | |
| | | @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 != ''" |
| | |
| | | @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> |
| | | <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> |
| | | |
| | | |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, getParcelPic} from "@/api/parcel/parcel"; |
| | | import {getList,exportParcelStatis, getParcelPic} from "@/api/parcel/parcel"; |
| | | import {mapGetters} from "vuex"; |
| | | import ElImageViewer from 'element-ui/packages/image/src/image-viewer' |
| | | |
| | |
| | | showViewer: false, // 显示查看器 |
| | | imgUrl:'', |
| | | loading: true, |
| | | dialogTableVisible: false, |
| | | parcelConversation:false, |
| | | oldParcelSatart:false, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | menu:false, |
| | | height:'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 54, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | activeClass: 3, |
| | | border: true, |
| | | border: false, |
| | | stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | searchRange: true, |
| | | searchSpan: 8, |
| | | searchValue:[this.getStartTime(),this.getEndTime()], |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | |
| | | { |
| | | label: "是否违禁", |
| | | search: true, |
| | | searchValue: this.getIsKindParams(), |
| | | searchLabelWidth: 120, |
| | | searchSpan: 4, |
| | | hide: true, |
| | |
| | | }, |
| | | methods: { |
| | | beforeOpen(done, type) { |
| | | console.log(type); |
| | | if (["view"].includes(type)) { |
| | | getDetail(this.form.imgUrl).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | //清空搜索框中的内容 |
| | | this.query = {}; |
| | | //清空this.$route.query |
| | | this.$router.push({ query: {} }); |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | rowClick(row){ |
| | | var that=this; |
| | | getParcelPic(row.imgUrl).then(res => { |
| | | that.imgUrl = res.data.data.imgBase64; |
| | | this.showViewer = true |
| | | }); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | |
| | | 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 ''; |
| | | }, |
| | | getIsKindParams(){ |
| | | if(this.$route.query.decisioDiagramResult && this.$route.query!='' && this.$route.query!=null && this.$route.query!=undefined){ |
| | | //回显 |
| | | return this.$route.query.decisioDiagramResult |
| | | } |
| | | }, |
| | | //给行加颜色 |
| | | rowStyle({row, column, rowIndex}){ |
| | | if(row.mechineMark==1){ |
| | | return { |
| | | color:"#fe1515" |
| | | } |
| | | } |
| | | }, |
| | | //数据导出 |
| | | handleExport() { |
| | | this.$confirm("是否导出包裹数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | window.open(`/api/blade-jfpts/parcel/parcel/export-parcel?startTime=${this.$route.query.startTime}&endTime=${this.$route.query.endTime}&decisioDiagramResult=${this.$route.query.decisioDiagramResult}`); |
| | | }); |
| | | }, |
| | | //数据报表导出 |
| | | 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==undefined? '':this.$route.query.timeDesc; |
| | | //window.open(`http://localhost:8108/ureport/excel?_u=blade-parcel.statis.ureport.xml&startTime=${startTime}&endTime=${endTime}&decisioDiagramResult=${decisioDiagramResult}&timeDesc=${timeDesc}`); |
| | | window.open(`https://web.byisf.com/api/blade-report/ureport/preview?_u=blade-parcel.statis.ureport.xml&startTime=${startTime}&endTime=${endTime}&decisioDiagramResult=${decisioDiagramResult}&timeDesc=${timeDesc}`); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const { dateTime } = this.query; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | if (dateTime) { |
| | | values = { |
| | | ...params, |
| | |
| | | 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 |
| | |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss"> |
| | | .img { |
| | | .el-icon-circle-close { |
| | | color: white; |
| | | } |
| | | } |
| | | </style> |