正在显示
12 个修改的文件
包含
162 行增加
和
58 行删除
src/api/htmlToPdf.js
0 → 100644
| 1 | +import html2canvas from 'html2canvas' | ||
| 2 | +/*import jsPDF from 'jspdf'*/ | ||
| 3 | +export default{ | ||
| 4 | + install (Vue, options) { | ||
| 5 | + Vue.prototype.getPdf = function (htmlTitle,currentTime) { | ||
| 6 | + var element = document.getElementById("file"); | ||
| 7 | + html2canvas(element, { | ||
| 8 | + logging:false | ||
| 9 | + }).then(function(canvas) { | ||
| 10 | + var pdf = new jsPDF('p', 'mm', 'a4'); //A4纸,纵向 | ||
| 11 | + var ctx = canvas.getContext('2d'), | ||
| 12 | + a4w = 190, a4h = 277, //A4大小,210mm x 297mm,四边各保留10mm的边距,显示区域190x277 | ||
| 13 | + imgHeight = Math.floor(a4h * canvas.width / a4w), //按A4显示比例换算一页图像的像素高度 | ||
| 14 | + renderedHeight = 0; | ||
| 15 | + | ||
| 16 | + while(renderedHeight < canvas.height) { | ||
| 17 | + var page = document.createElement("canvas"); | ||
| 18 | + page.width = canvas.width; | ||
| 19 | + page.height = Math.min(imgHeight, canvas.height - renderedHeight);//可能内容不足一页 | ||
| 20 | + | ||
| 21 | + //用getImageData剪裁指定区域,并画到前面创建的canvas对象中 | ||
| 22 | + page.getContext('2d').putImageData(ctx.getImageData(0, renderedHeight, canvas.width, Math.min(imgHeight, canvas.height - renderedHeight)), 0, 0); | ||
| 23 | + pdf.addImage(page.toDataURL('image/jpeg', 1.0), 'JPEG', 10, 10, a4w, Math.min(a4h, a4w * page.height / page.width)); //添加图像到页面,保留10mm边距 | ||
| 24 | + | ||
| 25 | + renderedHeight += imgHeight; | ||
| 26 | + if(renderedHeight < canvas.height) | ||
| 27 | + pdf.addPage();//如果后面还有内容,添加一个空页 | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + pdf.save(htmlTitle); | ||
| 31 | + }); | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | +} |
| @@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
| 75 | export default { | 75 | export default { |
| 76 | data() { | 76 | data() { |
| 77 | return { | 77 | return { |
| 78 | - sysName:'易通快速通关申报管理系统', | 78 | + sysName:'河南烩捞大盘鸡', |
| 79 | collapsed:false, | 79 | collapsed:false, |
| 80 | sysUserName: '', | 80 | sysUserName: '', |
| 81 | sysUserAvatar: '', | 81 | sysUserAvatar: '', |
| @@ -74,6 +74,7 @@ | @@ -74,6 +74,7 @@ | ||
| 74 | <el-col :span="24"> | 74 | <el-col :span="24"> |
| 75 | <template> | 75 | <template> |
| 76 | <el-table | 76 | <el-table |
| 77 | + v-loading="listLoading" | ||
| 77 | ref="multipleTable" | 78 | ref="multipleTable" |
| 78 | :data="tableData" | 79 | :data="tableData" |
| 79 | tooltip-effect="dark" | 80 | tooltip-effect="dark" |
| @@ -718,7 +719,8 @@ | @@ -718,7 +719,8 @@ | ||
| 718 | rows:{}, | 719 | rows:{}, |
| 719 | loading:false, | 720 | loading:false, |
| 720 | dialogTableVisible:false, | 721 | dialogTableVisible:false, |
| 721 | - gridData:[] | 722 | + gridData:[], |
| 723 | + listLoading:false | ||
| 722 | } | 724 | } |
| 723 | }, | 725 | }, |
| 724 | methods:{ | 726 | methods:{ |
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | </el-col> | 52 | </el-col> |
| 53 | <el-col :span="12"> | 53 | <el-col :span="12"> |
| 54 | <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button> | 54 | <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button> |
| 55 | - <el-button type="primary" @click="submitForm('ruleForm')">保存发送</el-button> | 55 | + <el-button type="primary" @click="back">返回</el-button> |
| 56 | </el-col> | 56 | </el-col> |
| 57 | </el-row> | 57 | </el-row> |
| 58 | <!--对话提示框--> | 58 | <!--对话提示框--> |
| @@ -179,7 +179,10 @@ | @@ -179,7 +179,10 @@ | ||
| 179 | DialogVisible(){ | 179 | DialogVisible(){ |
| 180 | this.centerDialogVisible=false; | 180 | this.centerDialogVisible=false; |
| 181 | this.$router.push({name:'运单分拨申报',params:{awba:this.ruleForm.awba}}); | 181 | this.$router.push({name:'运单分拨申报',params:{awba:this.ruleForm.awba}}); |
| 182 | - } | 182 | + }, |
| 183 | + back(){ | ||
| 184 | + this.$router.go(-1);//返回上一层 | ||
| 185 | + }, | ||
| 183 | }, | 186 | }, |
| 184 | mounted(){ | 187 | mounted(){ |
| 185 | this.getDefaultData(); | 188 | this.getDefaultData(); |
| @@ -138,15 +138,13 @@ | @@ -138,15 +138,13 @@ | ||
| 138 | this.options = []; | 138 | this.options = []; |
| 139 | this.options2=[]; | 139 | this.options2=[]; |
| 140 | } | 140 | } |
| 141 | - //this.options=res.data.data; | ||
| 142 | - //this.options2=res.data.data; | ||
| 143 | }); | 141 | }); |
| 144 | }, | 142 | }, |
| 145 | /*按钮点击请求方法*/ | 143 | /*按钮点击请求方法*/ |
| 146 | submitForm(formName) { | 144 | submitForm(formName) { |
| 147 | this.$refs[formName].validate((valid) => { | 145 | this.$refs[formName].validate((valid) => { |
| 148 | if (valid) { | 146 | if (valid) { |
| 149 | - this.$router.push({name:'进港原始舱单',params:{flightno:this.ruleForm.flightno,flightdate:this.dateConversion(this.ruleForm.flightdate),originstation:this.ruleForm.originstation,destinationstation:this.ruleForm.destinationstation}}); | 147 | + this.$router.push({path:'/origmaster',query:{flightno:JSON.stringify(this.ruleForm.flightno),flightdate:JSON.stringify(this.dateConversion(this.ruleForm.flightdate)),originstation:JSON.stringify(this.ruleForm.originstation),destinationstation:JSON.stringify(this.ruleForm.destinationstation),awba:JSON.stringify("")}}); |
| 150 | } else { | 148 | } else { |
| 151 | console.log('error submit!!'); | 149 | console.log('error submit!!'); |
| 152 | return false; | 150 | return false; |
| @@ -161,11 +159,11 @@ | @@ -161,11 +159,11 @@ | ||
| 161 | }, | 159 | }, |
| 162 | /*加载默认参数*/ | 160 | /*加载默认参数*/ |
| 163 | getDefaultData(){ | 161 | getDefaultData(){ |
| 164 | - if(this.$route.params.row!=null){ | ||
| 165 | - this.ruleForm.flightno=this.$route.params.row.flightno; | ||
| 166 | - this.ruleForm.flightdate=this.$route.params.row.flightdate; | ||
| 167 | - this.ruleForm.originstation=this.$route.params.row.originstation; | ||
| 168 | - this.ruleForm.destinationstation=this.$route.params.row.destinationstation; | 162 | + if(this.$route.query!=null){ |
| 163 | + this.ruleForm.flightno=JSON.parse(this.$route.query.flightno); | ||
| 164 | + this.ruleForm.flightdate=JSON.parse(this.$route.query.flightdate); | ||
| 165 | + this.ruleForm.originstation=JSON.parse(this.$route.query.originstation); | ||
| 166 | + this.ruleForm.destinationstation=JSON.parse(this.$route.query.destinationstation); | ||
| 169 | } | 167 | } |
| 170 | } | 168 | } |
| 171 | }, | 169 | }, |
| @@ -174,7 +174,7 @@ | @@ -174,7 +174,7 @@ | ||
| 174 | submitForm(formName) { | 174 | submitForm(formName) { |
| 175 | this.$refs[formName].validate((valid) => { | 175 | this.$refs[formName].validate((valid) => { |
| 176 | if (valid) { | 176 | if (valid) { |
| 177 | - this.$router.push({name:'进港理货舱单',params:{flightno:this.ruleForm.flightno,flightdate:this.dateConversion(this.ruleForm.flightdate),originstation:this.ruleForm.originstation,destinationstation:this.ruleForm.destinationstation}}) | 177 | + this.$router.push({path:'/tallymaster',query:{flightno:JSON.stringify(this.ruleForm.flightno),flightdate:JSON.stringify(this.dateConversion(this.ruleForm.flightdate)),originstation:JSON.stringify(this.ruleForm.originstation),destinationstation:JSON.stringify(this.ruleForm.destinationstation),awba:JSON.stringify("")}}) |
| 178 | } else { | 178 | } else { |
| 179 | //console.log('error submit!!'); | 179 | //console.log('error submit!!'); |
| 180 | return false; | 180 | return false; |
| @@ -189,11 +189,11 @@ | @@ -189,11 +189,11 @@ | ||
| 189 | }, | 189 | }, |
| 190 | /*获取默认值方法*/ | 190 | /*获取默认值方法*/ |
| 191 | getDefaultData(){ | 191 | getDefaultData(){ |
| 192 | - if(this.$route.params.row!=null){ | ||
| 193 | - this.ruleForm.flightno=this.$route.params.row.flightno; | ||
| 194 | - this.ruleForm.flightdate=this.$route.params.row.flightdate; | ||
| 195 | - this.ruleForm.originstation=this.$route.params.row.originstation; | ||
| 196 | - this.ruleForm.destinationstation=this.$route.params.row.destinationstation; | 192 | + if(this.$route.query!=null){ |
| 193 | + this.ruleForm.flightno=JSON.parse(this.$route.query.flightno); | ||
| 194 | + this.ruleForm.flightdate=JSON.parse(this.$route.query.flightdate); | ||
| 195 | + this.ruleForm.originstation=JSON.parse(this.$route.query.originstation); | ||
| 196 | + this.ruleForm.destinationstation=JSON.parse(this.$route.query.destinationstation); | ||
| 197 | } | 197 | } |
| 198 | } | 198 | } |
| 199 | }, | 199 | }, |
| @@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
| 58 | </el-col> | 58 | </el-col> |
| 59 | <el-col :span="12"> | 59 | <el-col :span="12"> |
| 60 | <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button> | 60 | <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button> |
| 61 | - <el-button type="primary" @click="submitSend('ruleForm')">保存发送</el-button> | 61 | + <el-button type="primary" @click="back">返回</el-button> |
| 62 | </el-col> | 62 | </el-col> |
| 63 | </el-row> | 63 | </el-row> |
| 64 | <!--对话提示框--> | 64 | <!--对话提示框--> |
| @@ -190,7 +190,10 @@ | @@ -190,7 +190,10 @@ | ||
| 190 | DialogVisible(){ | 190 | DialogVisible(){ |
| 191 | this.centerDialogVisible=false; | 191 | this.centerDialogVisible=false; |
| 192 | this.$router.push({name:'运单分拨申报',params:{awba:this.ruleForm.awba}}); | 192 | this.$router.push({name:'运单分拨申报',params:{awba:this.ruleForm.awba}}); |
| 193 | - } | 193 | + }, |
| 194 | + back(){ | ||
| 195 | + this.$router.go(-1);//返回上一层 | ||
| 196 | + }, | ||
| 194 | }, | 197 | }, |
| 195 | mounted(){ | 198 | mounted(){ |
| 196 | this.getDefaultData(); | 199 | this.getDefaultData(); |
| @@ -30,6 +30,7 @@ | @@ -30,6 +30,7 @@ | ||
| 30 | <el-row> | 30 | <el-row> |
| 31 | <template> | 31 | <template> |
| 32 | <el-table | 32 | <el-table |
| 33 | + v-loading="tableloading" | ||
| 33 | :data="tableData" | 34 | :data="tableData" |
| 34 | style="width: 100%" | 35 | style="width: 100%" |
| 35 | :default-sort = "{prop: 'date', order: 'descending'}" | 36 | :default-sort = "{prop: 'date', order: 'descending'}" |
| @@ -107,7 +108,8 @@ | @@ -107,7 +108,8 @@ | ||
| 107 | flighttime: undefined, | 108 | flighttime: undefined, |
| 108 | currentPage:1, | 109 | currentPage:1, |
| 109 | pageSize:10, | 110 | pageSize:10, |
| 110 | - total:0 | 111 | + total:0, |
| 112 | + tableloading:true | ||
| 111 | } | 113 | } |
| 112 | }, | 114 | }, |
| 113 | methods: { | 115 | methods: { |
| @@ -130,19 +132,19 @@ | @@ -130,19 +132,19 @@ | ||
| 130 | this.listLoading = true; | 132 | this.listLoading = true; |
| 131 | selectFlightLists(params).then(res=>{ | 133 | selectFlightLists(params).then(res=>{ |
| 132 | let response=res.data.data; | 134 | let response=res.data.data; |
| 133 | - console.log(response) | ||
| 134 | this.tableData=response.list; | 135 | this.tableData=response.list; |
| 136 | + this.tableloading=false; | ||
| 135 | this.total=response.total; | 137 | this.total=response.total; |
| 136 | this.listLoading = false; | 138 | this.listLoading = false; |
| 137 | }); | 139 | }); |
| 138 | }, | 140 | }, |
| 139 | /*原始舱单跳转*/ | 141 | /*原始舱单跳转*/ |
| 140 | handleEdit(index, row) { | 142 | handleEdit(index, row) { |
| 141 | - this.$router.push({name:'原始舱单',params:{index,row}}) | 143 | + this.$router.push({path:'/enter',query:{flightno:JSON.stringify(row.flightno),flightdate:JSON.stringify(row.flightdate),originstation:JSON.stringify(row.originstation),destinationstation:JSON.stringify(row.destinationstation)}}) |
| 142 | }, | 144 | }, |
| 143 | /*进港理货跳转*/ | 145 | /*进港理货跳转*/ |
| 144 | handleDelete(index, row) { | 146 | handleDelete(index, row) { |
| 145 | - this.$router.push({name:'进港理货',params:{index,row}}) | 147 | + this.$router.push({path:'entertall',query:{flightno:JSON.stringify(row.flightno),flightdate:JSON.stringify(row.flightdate),originstation:JSON.stringify(row.originstation),destinationstation:JSON.stringify(row.destinationstation)}}) |
| 146 | } | 148 | } |
| 147 | }, | 149 | }, |
| 148 | computed:{ | 150 | computed:{ |
| @@ -42,7 +42,15 @@ | @@ -42,7 +42,15 @@ | ||
| 42 | </el-col> | 42 | </el-col> |
| 43 | <el-col :span="4" class="pub"> | 43 | <el-col :span="4" class="pub"> |
| 44 | <div class="grid-content"> | 44 | <div class="grid-content"> |
| 45 | - <el-button type="primary" size="mini">导出PDF</el-button> | 45 | + <el-dropdown @command="handleCommand"> |
| 46 | + <el-button size="mini" type="primary"> | ||
| 47 | + 导出文件<i class="el-icon-arrow-down el-icon--right"></i> | ||
| 48 | + </el-button> | ||
| 49 | + <el-dropdown-menu slot="dropdown"> | ||
| 50 | + <el-dropdown-item command="PDF">导出PDF</el-dropdown-item> | ||
| 51 | + <el-dropdown-item command="EXCEL">导出EXCEL</el-dropdown-item> | ||
| 52 | + </el-dropdown-menu> | ||
| 53 | + </el-dropdown> | ||
| 46 | </div> | 54 | </div> |
| 47 | </el-col> | 55 | </el-col> |
| 48 | </div> | 56 | </div> |
| @@ -58,6 +66,9 @@ | @@ -58,6 +66,9 @@ | ||
| 58 | <el-col :span="24"> | 66 | <el-col :span="24"> |
| 59 | <template> | 67 | <template> |
| 60 | <el-table | 68 | <el-table |
| 69 | + class="table" | ||
| 70 | + id="pdfDom" | ||
| 71 | + v-loading="tableloading" | ||
| 61 | ref="multipleTable" | 72 | ref="multipleTable" |
| 62 | :data="tableData" | 73 | :data="tableData" |
| 63 | tooltip-effect="dark" | 74 | tooltip-effect="dark" |
| @@ -74,7 +85,7 @@ | @@ -74,7 +85,7 @@ | ||
| 74 | <el-table-column | 85 | <el-table-column |
| 75 | label="运单号" | 86 | label="运单号" |
| 76 | width="185" | 87 | width="185" |
| 77 | - show-overflow-tooltip> | 88 | + > |
| 78 | <template slot-scope="scope"> | 89 | <template slot-scope="scope"> |
| 79 | <span v-if="scope.row.awbh==''||scope.row.awbh==null"> | 90 | <span v-if="scope.row.awbh==''||scope.row.awbh==null"> |
| 80 | {{scope.row.awba}} | 91 | {{scope.row.awba}} |
| @@ -569,7 +580,7 @@ | @@ -569,7 +580,7 @@ | ||
| 569 | </el-col> | 580 | </el-col> |
| 570 | <el-col :span="2" class="pub"> | 581 | <el-col :span="2" class="pub"> |
| 571 | <div class="grid-content"> | 582 | <div class="grid-content"> |
| 572 | - <el-button type="primary" size="mini">返回</el-button> | 583 | + <el-button type="primary" @click="back" size="mini">返回</el-button> |
| 573 | </div> | 584 | </div> |
| 574 | </el-col> | 585 | </el-col> |
| 575 | <el-col :span="2.5" class="pub"> | 586 | <el-col :span="2.5" class="pub"> |
| @@ -681,12 +692,23 @@ | @@ -681,12 +692,23 @@ | ||
| 681 | .pub { | 692 | .pub { |
| 682 | margin-right: 10px; | 693 | margin-right: 10px; |
| 683 | } | 694 | } |
| 695 | + .el-dropdown { | ||
| 696 | + vertical-align: top; | ||
| 697 | + } | ||
| 698 | + .el-dropdown + .el-dropdown { | ||
| 699 | + margin-left: 15px; | ||
| 700 | + } | ||
| 701 | + .el-icon-arrow-down { | ||
| 702 | + font-size: 12px; | ||
| 703 | + } | ||
| 684 | </style> | 704 | </style> |
| 685 | 705 | ||
| 686 | <script> | 706 | <script> |
| 687 | import { getMt1201List,addMt1201,ediMt1201,getFenList,getCountryCode,selectCustomcode,sendCreateMt1201,sendEditeMt1201,sendRemoveMt1201 } from '../../api/mt1201' | 707 | import { getMt1201List,addMt1201,ediMt1201,getFenList,getCountryCode,selectCustomcode,sendCreateMt1201,sendEditeMt1201,sendRemoveMt1201 } from '../../api/mt1201' |
| 688 | import{addResponse,selectResponseList} from "../../api/InResponse"; | 708 | import{addResponse,selectResponseList} from "../../api/InResponse"; |
| 689 | - | 709 | + import FileSaver from "file-saver"; |
| 710 | + import XLSX from "xlsx"; | ||
| 711 | + /*import htmlToPdf from "../../api/htmlToPdf"*/ | ||
| 690 | export default { | 712 | export default { |
| 691 | data() { | 713 | data() { |
| 692 | /*初始数据*/ | 714 | /*初始数据*/ |
| @@ -845,14 +867,42 @@ | @@ -845,14 +867,42 @@ | ||
| 845 | }, | 867 | }, |
| 846 | udStatus:'', | 868 | udStatus:'', |
| 847 | loading:false, | 869 | loading:false, |
| 848 | - temprows:{ | ||
| 849 | - }, | 870 | + temprows:{}, |
| 850 | dialogTableVisible:false, | 871 | dialogTableVisible:false, |
| 851 | - gridData:[] | 872 | + gridData:[], |
| 873 | + tableloading:true, | ||
| 874 | + htmlTitle:'' | ||
| 852 | } | 875 | } |
| 853 | }, | 876 | }, |
| 854 | methods: { | 877 | methods: { |
| 855 | - | 878 | + //导出PDF,EXCEL文件 |
| 879 | + handleCommand(command) { | ||
| 880 | + if(command='EXCEL'){ | ||
| 881 | + this.$message('正在为您下载' + command+'文件'); | ||
| 882 | + this.downLoad(); | ||
| 883 | + }else if(command='PDF'){ | ||
| 884 | + this.htmlTitle=this.defaultQuery.flightno+this.defaultQuery.flightdate; | ||
| 885 | + this.$message('正在为您下载' + command+'文件'); | ||
| 886 | + //this.getPdf(); | ||
| 887 | + } | ||
| 888 | + }, | ||
| 889 | + downLoad(){ | ||
| 890 | + var wb = XLSX.utils.table_to_book(document.querySelector(".table")); | ||
| 891 | + var wbout = XLSX.write(wb, { | ||
| 892 | + bookType: "xlsx", | ||
| 893 | + bookSST: true, | ||
| 894 | + type: "array" | ||
| 895 | + }); | ||
| 896 | + try { | ||
| 897 | + FileSaver.saveAs( | ||
| 898 | + new Blob([wbout], { type: "application/octet-stream" }), | ||
| 899 | + this.defaultQuery.flightno+this.defaultQuery.flightdate+ ".xlsx" // name+'.xlsx'表示导出的excel表格名字 | ||
| 900 | + ); | ||
| 901 | + } catch (e) { | ||
| 902 | + if (typeof console !== "undefined") console.log(e, wbout); | ||
| 903 | + } | ||
| 904 | + return wbout; | ||
| 905 | + }, | ||
| 856 | //回执收发明细 | 906 | //回执收发明细 |
| 857 | handleDetail(index,row){ | 907 | handleDetail(index,row){ |
| 858 | if(row.flightno.length>4){ | 908 | if(row.flightno.length>4){ |
| @@ -914,6 +964,7 @@ | @@ -914,6 +964,7 @@ | ||
| 914 | /*多选框功能*/ | 964 | /*多选框功能*/ |
| 915 | handleSelectionChange(val) { | 965 | handleSelectionChange(val) { |
| 916 | this.multipleSelection = val; | 966 | this.multipleSelection = val; |
| 967 | + console.log(val) | ||
| 917 | }, | 968 | }, |
| 918 | /*编辑主单信息*/ | 969 | /*编辑主单信息*/ |
| 919 | handleEdit(index, row){ | 970 | handleEdit(index, row){ |
| @@ -1087,21 +1138,21 @@ | @@ -1087,21 +1138,21 @@ | ||
| 1087 | }, | 1138 | }, |
| 1088 | /*获取默认值*/ | 1139 | /*获取默认值*/ |
| 1089 | getDefaultData(){ | 1140 | getDefaultData(){ |
| 1090 | - this.defaultQuery.flightno = this.$route.params.flightno; | ||
| 1091 | - this.defaultQuery.flightdate = this.$route.params.flightdate; | ||
| 1092 | - this.defaultQuery.originstation = this.$route.params.originstation; | ||
| 1093 | - this.defaultQuery.destinationstation = this.$route.params.destinationstation; | ||
| 1094 | - this.defaultQuery.awba=this.$route.params.awba; | 1141 | + this.defaultQuery.flightno = JSON.parse(this.$route.query.flightno); |
| 1142 | + this.defaultQuery.flightdate = JSON.parse(this.$route.query.flightdate); | ||
| 1143 | + this.defaultQuery.originstation = JSON.parse(this.$route.query.originstation); | ||
| 1144 | + this.defaultQuery.destinationstation = JSON.parse(this.$route.query.destinationstation); | ||
| 1145 | + this.defaultQuery.awba=JSON.parse(this.$route.query.awba); | ||
| 1095 | }, | 1146 | }, |
| 1096 | /*获取默认数据列表*/ | 1147 | /*获取默认数据列表*/ |
| 1097 | getList(){ | 1148 | getList(){ |
| 1098 | getMt1201List(this.defaultQuery).then(res =>{ | 1149 | getMt1201List(this.defaultQuery).then(res =>{ |
| 1099 | - console.log(res); | ||
| 1100 | this.sumNmmsCount=0; | 1150 | this.sumNmmsCount=0; |
| 1101 | this.sumNmmsPrice=0; | 1151 | this.sumNmmsPrice=0; |
| 1102 | this.sumNmmsWeight=0; | 1152 | this.sumNmmsWeight=0; |
| 1103 | let response=res.data.data; | 1153 | let response=res.data.data; |
| 1104 | this.tableData=response; | 1154 | this.tableData=response; |
| 1155 | + this.tableloading=false; | ||
| 1105 | response.forEach((item,i) => { | 1156 | response.forEach((item,i) => { |
| 1106 | if(item.awba!=null&&item.awbh==""); | 1157 | if(item.awba!=null&&item.awbh==""); |
| 1107 | this.sumNmmsCount=Number(this.sumNmmsCount)+1; | 1158 | this.sumNmmsCount=Number(this.sumNmmsCount)+1; |
| @@ -1152,9 +1203,9 @@ | @@ -1152,9 +1203,9 @@ | ||
| 1152 | this.dialogStatus="create"; | 1203 | this.dialogStatus="create"; |
| 1153 | this.outerVisible = true; | 1204 | this.outerVisible = true; |
| 1154 | this.FenStatus='ediAwbh'; | 1205 | this.FenStatus='ediAwbh'; |
| 1155 | - this.ruleForm.flightno=this.$route.params.flightno; | ||
| 1156 | - this.ruleForm.flightdate=this.$route.params.flightdate; | ||
| 1157 | - this.ruleForm.originstation=this.$route.params.originstation+"-"+this.$route.params.destinationstation; | 1206 | + this.ruleForm.flightno=JSON.parse(this.$route.query.flightno); |
| 1207 | + this.ruleForm.flightdate=JSON.parse(this.$route.query.flightdate); | ||
| 1208 | + this.ruleForm.originstation=JSON.parse(this.$route.query.originstation)+"-"+JSON.parse(this.$route.query.destinationstation); | ||
| 1158 | }, | 1209 | }, |
| 1159 | //新增原始分单 | 1210 | //新增原始分单 |
| 1160 | addFen(formName){ | 1211 | addFen(formName){ |
| @@ -1234,7 +1285,10 @@ | @@ -1234,7 +1285,10 @@ | ||
| 1234 | Allocatearrive(index,row){ | 1285 | Allocatearrive(index,row){ |
| 1235 | this.$router.push({name:'分拨运抵',params:{carrier:row.carrier,flightno:row.flightno.substr(2),awba:row.awba,flightdate:row.flightdate, | 1286 | this.$router.push({name:'分拨运抵',params:{carrier:row.carrier,flightno:row.flightno.substr(2),awba:row.awba,flightdate:row.flightdate, |
| 1236 | turnpiece:row.awbinfo.pcs,turnweight:row.awbinfo.weight,customcode:row.customcode,goodsname:row.goodsname}}); | 1287 | turnpiece:row.awbinfo.pcs,turnweight:row.awbinfo.weight,customcode:row.customcode,goodsname:row.goodsname}}); |
| 1237 | - } | 1288 | + }, |
| 1289 | + back(){ | ||
| 1290 | + this.$router.go(-1);//返回上一层 | ||
| 1291 | + }, | ||
| 1238 | 1292 | ||
| 1239 | }, | 1293 | }, |
| 1240 | /*渲染方法*/ | 1294 | /*渲染方法*/ |
| @@ -42,6 +42,7 @@ | @@ -42,6 +42,7 @@ | ||
| 42 | ref="multipleTable" | 42 | ref="multipleTable" |
| 43 | :data="tableData" | 43 | :data="tableData" |
| 44 | tooltip-effect="dark" | 44 | tooltip-effect="dark" |
| 45 | + v-loading="tableLoading" | ||
| 45 | style="width: 100%" | 46 | style="width: 100%" |
| 46 | @selection-change="handleSelectionChange" | 47 | @selection-change="handleSelectionChange" |
| 47 | row-key="uuid" | 48 | row-key="uuid" |
| @@ -336,7 +337,7 @@ | @@ -336,7 +337,7 @@ | ||
| 336 | <el-row> | 337 | <el-row> |
| 337 | <el-col :span="2.5"><div class="grid-content"><el-button type="primary" v-on:click="addTally" size="mini">新增进港理货</el-button></div></el-col> | 338 | <el-col :span="2.5"><div class="grid-content"><el-button type="primary" v-on:click="addTally" size="mini">新增进港理货</el-button></div></el-col> |
| 338 | <el-col :span="2.5"><div class="grid-content"><el-button type="primary" size="mini">批量发送删除报</el-button></div></el-col> | 339 | <el-col :span="2.5"><div class="grid-content"><el-button type="primary" size="mini">批量发送删除报</el-button></div></el-col> |
| 339 | - <el-col :span="2"><div class="grid-content"><el-button type="primary" size="mini">返回</el-button></div></el-col> | 340 | + <el-col :span="2"><div class="grid-content"><el-button type="primary" @click="back" size="mini">返回</el-button></div></el-col> |
| 340 | <el-col :span="2.5"><div class="grid-content"><span>主单数:{{sumNmmsCount}}</span></div></el-col> | 341 | <el-col :span="2.5"><div class="grid-content"><span>主单数:{{sumNmmsCount}}</span></div></el-col> |
| 341 | <el-col :span="3.5"><div class="grid-content"><span>理货总件数:{{sumNmmsPrice}}</span></div></el-col> | 342 | <el-col :span="3.5"><div class="grid-content"><span>理货总件数:{{sumNmmsPrice}}</span></div></el-col> |
| 342 | <el-col :span="4"><div class="grid-content"><span>理货总重量:{{sumNmmsWeight}}</span></div></el-col> | 343 | <el-col :span="4"><div class="grid-content"><span>理货总重量:{{sumNmmsWeight}}</span></div></el-col> |
| @@ -517,6 +518,7 @@ | @@ -517,6 +518,7 @@ | ||
| 517 | loading:false, | 518 | loading:false, |
| 518 | dialogTableVisible:false, | 519 | dialogTableVisible:false, |
| 519 | gridData:[], | 520 | gridData:[], |
| 521 | + tableLoading:false | ||
| 520 | } | 522 | } |
| 521 | }, | 523 | }, |
| 522 | methods: { | 524 | methods: { |
| @@ -705,20 +707,22 @@ | @@ -705,20 +707,22 @@ | ||
| 705 | }, | 707 | }, |
| 706 | //获取默认值 | 708 | //获取默认值 |
| 707 | getDefaultData(){ | 709 | getDefaultData(){ |
| 708 | - this.defaultQuery.flightno=this.$route.params.flightno; | ||
| 709 | - this.defaultQuery.flightdate=this.$route.params.flightdate; | ||
| 710 | - this.defaultQuery.originstation=this.$route.params.originstation; | ||
| 711 | - this.defaultQuery.destinationstation=this.$route.params.destinationstation; | 710 | + this.defaultQuery.flightno = JSON.parse(this.$route.query.flightno); |
| 711 | + this.defaultQuery.flightdate = JSON.parse(this.$route.query.flightdate); | ||
| 712 | + this.defaultQuery.originstation = JSON.parse(this.$route.query.originstation); | ||
| 713 | + this.defaultQuery.destinationstation = JSON.parse(this.$route.query.destinationstation); | ||
| 714 | + this.defaultQuery.awba=JSON.parse(this.$route.query.awba); | ||
| 712 | }, | 715 | }, |
| 713 | //获取进港理货列表 | 716 | //获取进港理货列表 |
| 714 | getMt5201List(){ | 717 | getMt5201List(){ |
| 718 | + this.tableLoading=true; | ||
| 715 | getMt5201List(this.defaultQuery).then(res =>{ | 719 | getMt5201List(this.defaultQuery).then(res =>{ |
| 716 | this.sumNmmsCount=0; | 720 | this.sumNmmsCount=0; |
| 717 | this.sumNmmsPrice=0; | 721 | this.sumNmmsPrice=0; |
| 718 | this.sumNmmsWeight=0; | 722 | this.sumNmmsWeight=0; |
| 719 | let response=res.data.data; | 723 | let response=res.data.data; |
| 720 | - console.log(res) | ||
| 721 | this.tableData=response; | 724 | this.tableData=response; |
| 725 | + this.tableLoading=false; | ||
| 722 | response.forEach((item,i) => { | 726 | response.forEach((item,i) => { |
| 723 | if(item.awba!=null&&item.awbh==""); | 727 | if(item.awba!=null&&item.awbh==""); |
| 724 | this.sumNmmsCount=Number(this.sumNmmsCount)+1; | 728 | this.sumNmmsCount=Number(this.sumNmmsCount)+1; |
| @@ -732,10 +736,10 @@ | @@ -732,10 +736,10 @@ | ||
| 732 | this.outerVisible = true; | 736 | this.outerVisible = true; |
| 733 | this.dialogStatus="create"; | 737 | this.dialogStatus="create"; |
| 734 | this.FenStatus='ediAwbh'; | 738 | this.FenStatus='ediAwbh'; |
| 735 | - this.ruleForm.flightno=this.$route.params.flightno; | ||
| 736 | - this.ruleForm.flightdate=this.$route.params.flightdate; | ||
| 737 | - this.ruleForm.originstation=this.$route.params.originstation; | ||
| 738 | - this.ruleForm.destinationstation=this.$route.params.destinationstation; | 739 | + this.ruleForm.flightno=JSON.parse(this.$route.query.flightno); |
| 740 | + this.ruleForm.flightdate=JSON.parse(this.$route.query.flightdate); | ||
| 741 | + this.ruleForm.originstation=JSON.parse(this.$route.query.originstation); | ||
| 742 | + this.ruleForm.destinationstation=JSON.parse(this.$route.query.destinationstation); | ||
| 739 | }, | 743 | }, |
| 740 | //新增原始舱单数据 | 744 | //新增原始舱单数据 |
| 741 | createData(formName){ | 745 | createData(formName){ |
| @@ -789,6 +793,9 @@ | @@ -789,6 +793,9 @@ | ||
| 789 | } | 793 | } |
| 790 | }); | 794 | }); |
| 791 | }, | 795 | }, |
| 796 | + back(){ | ||
| 797 | + this.$router.go(-1);//返回上一层 | ||
| 798 | + }, | ||
| 792 | }, | 799 | }, |
| 793 | //渲染方法 | 800 | //渲染方法 |
| 794 | mounted(){ | 801 | mounted(){ |
| @@ -85,6 +85,7 @@ | @@ -85,6 +85,7 @@ | ||
| 85 | <el-col :span="24"> | 85 | <el-col :span="24"> |
| 86 | <template> | 86 | <template> |
| 87 | <el-table | 87 | <el-table |
| 88 | + v-loading="tableloading" | ||
| 88 | ref="multipleTable" | 89 | ref="multipleTable" |
| 89 | :data="tableData" | 90 | :data="tableData" |
| 90 | tooltip-effect="dark" | 91 | tooltip-effect="dark" |
| @@ -253,7 +254,8 @@ | @@ -253,7 +254,8 @@ | ||
| 253 | multipleSelection: [], | 254 | multipleSelection: [], |
| 254 | currentPage:1, | 255 | currentPage:1, |
| 255 | pageSize:100, | 256 | pageSize:100, |
| 256 | - total:0 | 257 | + total:0, |
| 258 | + tableloading:false | ||
| 257 | } | 259 | } |
| 258 | }, | 260 | }, |
| 259 | methods:{ | 261 | methods:{ |
| @@ -282,22 +284,21 @@ | @@ -282,22 +284,21 @@ | ||
| 282 | QueryData(){ | 284 | QueryData(){ |
| 283 | let params={currentPage:this.currentPage,pageSize:this.pageSize,awba:this.defaultQuery.awba,carrier:this.defaultQuery.carrier, | 285 | let params={currentPage:this.currentPage,pageSize:this.pageSize,awba:this.defaultQuery.awba,carrier:this.defaultQuery.carrier, |
| 284 | flightno:this.defaultQuery.flightno,flightdate:this.defaultQuery.flightdate,status:this.defaultQuery.status,messageType:this.defaultQuery.messageType}; | 286 | flightno:this.defaultQuery.flightno,flightdate:this.defaultQuery.flightdate,status:this.defaultQuery.status,messageType:this.defaultQuery.messageType}; |
| 285 | - this.listLoading = true; | 287 | + this.tableloading=true; |
| 286 | QueryData(params).then(res =>{ | 288 | QueryData(params).then(res =>{ |
| 287 | - console.log(res) | ||
| 288 | let response=res.data.data; | 289 | let response=res.data.data; |
| 289 | this.tableData=response.list; | 290 | this.tableData=response.list; |
| 290 | this.total=response.total; | 291 | this.total=response.total; |
| 291 | - this.listLoading = false; | 292 | + this.tableloading = false; |
| 292 | }); | 293 | }); |
| 293 | }, | 294 | }, |
| 294 | //点击进入原始页面 | 295 | //点击进入原始页面 |
| 295 | handleClick(row){ | 296 | handleClick(row){ |
| 296 | - this.$router.push({name:'进港原始舱单',params:{flightno:row.carrier+row.flightno,destinationstation:row.destinationstation,awba:row.awba,flightdate:row.flightdate,originstation:row.originstation}}); | 297 | + this.$router.push({path:'/origmaster',query:{flightno:JSON.stringify(row.carrier+row.flightno),destinationstation:JSON.stringify(row.destinationstation),awba:JSON.stringify(row.awba),flightdate:JSON.stringify(row.flightdate),originstation:JSON.stringify(row.originstation)}}); |
| 297 | }, | 298 | }, |
| 298 | //点击进入理货页面 | 299 | //点击进入理货页面 |
| 299 | handleTally(row){ | 300 | handleTally(row){ |
| 300 | - this.$router.push({name:'进港理货舱单',params:{flightno:row.carrier+row.flightno,destinationstation:row.destinationstation,awba:row.awba,flightdate:row.flightdate,originstation:row.originstation}}); | 301 | + this.$router.push({path:'/tallymaster',query:{flightno:JSON.stringify(row.carrier+row.flightno),destinationstation:JSON.stringify(row.destinationstation),awba:JSON.stringify(row.awba),flightdate:JSON.stringify(row.flightdate),originstation:JSON.stringify(row.originstation)}}); |
| 301 | }, | 302 | }, |
| 302 | //table显示时间转换 | 303 | //table显示时间转换 |
| 303 | timestampToTime(timestamp) { | 304 | timestampToTime(timestamp) { |
src/views/nmms_import/new.vue
已删除
100644 → 0
-
请 注册 或 登录 后发表评论