jinhui.wang

校验增加,下载逻辑修改

...@@ -125,6 +125,8 @@ export default { ...@@ -125,6 +125,8 @@ export default {
125 }, 125 },
126 //确定配舱 126 //确定配舱
127 submit() { 127 submit() {
128 + this.$refs.form.validate(val => {
129 + if (val) {
128 this.loading = true; 130 this.loading = true;
129 let arr = []; 131 let arr = [];
130 this.tableData.forEach((item) => { 132 this.tableData.forEach((item) => {
...@@ -182,6 +184,8 @@ export default { ...@@ -182,6 +184,8 @@ export default {
182 this.loading = false; 184 this.loading = false;
183 this.msgWarning('航班号或航班日期不能为空') 185 this.msgWarning('航班号或航班日期不能为空')
184 } 186 }
187 + }
188 + })
185 }, 189 },
186 dialogBeforeClose() { 190 dialogBeforeClose() {
187 this.cleaerForm(); 191 this.cleaerForm();
......
...@@ -125,6 +125,8 @@ export default { ...@@ -125,6 +125,8 @@ export default {
125 }, 125 },
126 //确定配舱 126 //确定配舱
127 submit() { 127 submit() {
128 + this.$refs.form.validate(val => {
129 + if (val) {
128 this.loading = true; 130 this.loading = true;
129 let arr = []; 131 let arr = [];
130 this.tableData.forEach((item) => { 132 this.tableData.forEach((item) => {
...@@ -182,6 +184,8 @@ export default { ...@@ -182,6 +184,8 @@ export default {
182 this.loading = false; 184 this.loading = false;
183 this.msgWarning('航班号或航班日期不能为空') 185 this.msgWarning('航班号或航班日期不能为空')
184 } 186 }
187 + }
188 + })
185 }, 189 },
186 dialogBeforeClose() { 190 dialogBeforeClose() {
187 this.cleaerForm(); 191 this.cleaerForm();
......
...@@ -23,24 +23,26 @@ ...@@ -23,24 +23,26 @@
23 :loading="loading" @currentChange="currentChange"> 23 :loading="loading" @currentChange="currentChange">
24 <template v-slot:queryParameter="scope"> 24 <template v-slot:queryParameter="scope">
25 <el-popover placement="top" width="350" trigger="hover"> 25 <el-popover placement="top" width="350" trigger="hover">
26 - <ul v-if="scope.row.queryParameter != null && scope.row.queryParameter != ''"> 26 + <ul style="height:300px;overflow-y:scroll;"
27 + v-if="scope.row.queryParameter != null && scope.row.queryParameter != ''">
27 <li v-for="(item, index) in JSON.stringify(JSON.parse(scope.row.queryParameter)).split(',')" 28 <li v-for="(item, index) in JSON.stringify(JSON.parse(scope.row.queryParameter)).split(',')"
28 - :key="index">{{ item }}</li> 29 + :key="index" style="border-bottom:1px solid #E4E7ED;margin-bottom:5px">{{ item }}</li>
29 </ul> 30 </ul>
30 <el-button type="text" slot="reference">查 看</el-button> 31 <el-button type="text" slot="reference">查 看</el-button>
31 </el-popover> 32 </el-popover>
32 </template> 33 </template>
33 <template v-slot:downloadPath="scope"> 34 <template v-slot:downloadPath="scope">
34 - <el-button v-if="scope.row.downloadPath != null" type="text" size="mini" icon="el-icon-download" 35 + <el-button v-if="scope.row.downloadPath != null && scope.row.status == 1" type="text" size="mini"
35 - @click="download(scope.row)">下载 36 + icon="el-icon-download" @click="download(scope.row)">下载
36 </el-button> 37 </el-button>
38 + <span v-else>暂无下载</span>
37 </template> 39 </template>
38 </Tables> 40 </Tables>
39 </div> 41 </div>
40 </template> 42 </template>
41 43
42 <script> 44 <script>
43 -import { findArchiveCargoLog } from "@/api/system/logConfig.js"; 45 +import { findArchiveCargoLog, isExistZip } from "@/api/system/logConfig.js";
44 import { downLoadZip } from "@/utils/zipdownload"; 46 import { downLoadZip } from "@/utils/zipdownload";
45 47
46 export default { 48 export default {
...@@ -55,7 +57,7 @@ export default { ...@@ -55,7 +57,7 @@ export default {
55 tableHeader: this.tableHeaders['archiveData'], 57 tableHeader: this.tableHeaders['archiveData'],
56 tableHeight: null, 58 tableHeight: null,
57 total: 0, 59 total: 0,
58 - loading: false 60 + loading: false,
59 } 61 }
60 }, 62 },
61 created() { 63 created() {
...@@ -91,10 +93,19 @@ export default { ...@@ -91,10 +93,19 @@ export default {
91 }) 93 })
92 }, 94 },
93 download(val) { 95 download(val) {
94 - let url = 'entrymanager/entryExcel/download' 96 + isExistZip(val).then(res => {
97 + if (res.code === 200) {
98 + setTimeout(() => {
99 + let url = '/archiveCargoLog/downloadZip'
95 let filename = val.packageName 100 let filename = val.packageName
96 downLoadZip(url, val, filename) 101 downLoadZip(url, val, filename)
97 - 102 + }, 500);
103 + } else {
104 + this.msgWarning(res.msg)
105 + }
106 + }).catch(err => {
107 + console.log(err)
108 + })
98 }, 109 },
99 currentChange(val) { 110 currentChange(val) {
100 this.selectForm.page = val.page 111 this.selectForm.page = val.page
......