zhanbo.xu

feat: 新增汇总申报预览

...@@ -67,3 +67,12 @@ export function getCustomers(data) { ...@@ -67,3 +67,12 @@ export function getCustomers(data) {
67 data: data, 67 data: data,
68 }); 68 });
69 } 69 }
70 +
71 +// POST /exportSummary​/preview 预览
72 +export function preview(data) {
73 + return request({
74 + url: "/bus-customer/exportSummary/preview",
75 + method: "post",
76 + data: data,
77 + });
78 +}
......
...@@ -194,7 +194,8 @@ ...@@ -194,7 +194,8 @@
194 ref="entryTable" 194 ref="entryTable"
195 :data="tableData" 195 :data="tableData"
196 :headerData="headerData" 196 :headerData="headerData"
197 - :maxHeight="tableMaxheight" 197 + :height="tableMaxheight + 'px'"
198 + :maxHeight="tableMaxheight + 'px'"
198 :border="true" 199 :border="true"
199 :pagination="true" 200 :pagination="true"
200 :order="false" 201 :order="false"
...@@ -372,14 +373,18 @@ export default { ...@@ -372,14 +373,18 @@ export default {
372 formItemconsignmentCode: false, 373 formItemconsignmentCode: false,
373 formItemconsignmentHeadCode: false, 374 formItemconsignmentHeadCode: false,
374 }, 375 },
375 - tableMaxheight: null, 376 + tableMaxheight: 500,
376 }; 377 };
377 }, 378 },
378 created() { 379 created() {
379 this.search(0); 380 this.search(0);
381 + this.calculateTableHeight();
380 }, 382 },
381 mounted() { 383 mounted() {
382 - this.tableMaxheight = window.innerHeight - 300; 384 + window.addEventListener("resize", this.calculateTableHeight);
385 + },
386 + beforeDestroy() {
387 + window.removeEventListener("resize", this.calculateTableHeight);
383 }, 388 },
384 watch: { 389 watch: {
385 $route() { 390 $route() {
...@@ -387,6 +392,9 @@ export default { ...@@ -387,6 +392,9 @@ export default {
387 }, 392 },
388 }, 393 },
389 methods: { 394 methods: {
395 + calculateTableHeight() {
396 + this.tableMaxheight = window.innerHeight - 300;
397 + },
390 //查询 398 //查询
391 search(val) { 399 search(val) {
392 this.loadings.searchLoading = true; 400 this.loadings.searchLoading = true;
......
1 +<template>
2 + <el-dialog
3 + class="entryDialog classCUploadDialog"
4 + :title="pageData.ebpName"
5 + :visible.sync="outerVisible"
6 + :show-close="false"
7 + width="900px"
8 + :close-on-click-modal="false"
9 + :destroy-on-close="true"
10 + v-loading="loadings.dialogLoading"
11 + @close="close(false)"
12 + >
13 + <div style="margin-bottom: 10px">
14 + <span> 汇总清单数量:{{ pageData.count }} </span>
15 + <span style="margin-left: 20px">
16 + 汇总申报地海关:{{ pageData.portCode }}
17 + </span>
18 + </div>
19 + <Table
20 + class="fedexDetialTable fedexSreachTable"
21 + ref="entryTable"
22 + :data="pageData.value"
23 + :headerData="headerData"
24 + :border="true"
25 + :pagination="true"
26 + :order="false"
27 + :page="page.pageIndex"
28 + :pageSizes="[20, 30, 50, 100]"
29 + :totalCount="page.total"
30 + @sizeChange="sizeChange"
31 + @currentChange="currentChange"
32 + >
33 + </Table>
34 + <div class="dialogOption entrySave">
35 + <el-button
36 + class="entrySaveButton"
37 + :disabled="loadings.submitLoading"
38 + @click="submit"
39 + >
40 + 提 交
41 + </el-button>
42 + <el-button class="entrySaveButton" @click="close(false)">关 闭</el-button>
43 + </div>
44 + </el-dialog>
45 +</template>
46 +
47 +<script>
48 +import { preview, declareSummaryApplication } from "@/api/exportSummary-api.js";
49 +
50 +export default {
51 + props: {
52 + outerVisible: {
53 + type: Boolean,
54 + default: false,
55 + },
56 + selected: {
57 + type: Object,
58 + default: () => {
59 + return {};
60 + },
61 + },
62 + },
63 + watch: {
64 + outerVisible(val) {
65 + if (val) {
66 + this.loadings.dialogLoading = false;
67 + this.fetchPreview();
68 + }
69 + },
70 + },
71 + data() {
72 + return {
73 + loadings: {
74 + dialogLoading: false,
75 + submitLoading: false,
76 + },
77 + title: "",
78 + page: {
79 + pageIndex: 1,
80 + pageSize: 20,
81 + total: 0,
82 + },
83 + pageData: {
84 + count: 0,
85 + ebpName: "预览",
86 + portCode: "",
87 + value: [],
88 + },
89 + headerData: [
90 + {
91 + name: "提运单号",
92 + value: "billNo",
93 + width: "",
94 + align: "left",
95 + },
96 + {
97 + name: "物流运单编号",
98 + value: "logisticsNo",
99 + width: "",
100 + align: "left",
101 + },
102 + {
103 + name: "清单编号",
104 + value: "invtNo",
105 + width: "",
106 + align: "left",
107 + },
108 + {
109 + name: "清单申报时间",
110 + value: "createTime",
111 + width: "",
112 + align: "left",
113 + },
114 + ],
115 + };
116 + },
117 + methods: {
118 + fetchPreview() {
119 + preview({
120 + ...this.selected,
121 + ...this.page,
122 + }).then((res) => {
123 + if (res.code === "200") {
124 + console.log(res.data);
125 + this.pageData = {
126 + ...res.data,
127 + value: res.data.pageData.value,
128 + };
129 + console.log(this.pageData);
130 + this.page.total = res.data.pageData.totalItems;
131 + }
132 + });
133 + },
134 + search(val) {
135 + if (val == 0) {
136 + this.page.pageIndex = 1;
137 + }
138 + this.fetchPreview();
139 + },
140 + sizeChange(val) {
141 + this.page.pageSize = val;
142 + this.search(1);
143 + },
144 + currentChange(val) {
145 + this.page.pageIndex = val.page;
146 + this.search(1);
147 + },
148 + //数据保存
149 + submit() {
150 + declareSummaryApplication(this.selected).then((response) => {
151 + if (response.data) {
152 + this.msgSuccess("汇总申报成功");
153 + this.$router.push("summaryDataSearch");
154 + } else {
155 + this.msgError(response.message);
156 + }
157 + });
158 + },
159 + //新增
160 + addapi(val) {
161 + // declareUpload(val)
162 + // .then((res) => {
163 + // if (res.code === "200") {
164 + // this.msgSuccess(res.message);
165 + // this.close(true);
166 + // } else {
167 + // this.alertWarningMsg(res.message);
168 + // this.loadings.dialogLoading = false;
169 + // }
170 + // })
171 + // .catch((err) => {
172 + // console.log(err);
173 + // this.loadings.dialogLoading = false;
174 + // });
175 + },
176 +
177 + close(flag) {
178 + this.formData = {
179 + operatorCode: "",
180 + domesticTrafNo: "",
181 + };
182 + this.loadings.dialogLoading = false;
183 + this.$emit("close", flag);
184 + },
185 + },
186 +};
187 +</script>
188 +
189 +<style lang="scss" scoped>
190 +@import "@/assets/styles/variables.scss";
191 +</style>
...@@ -149,7 +149,15 @@ ...@@ -149,7 +149,15 @@
149 </el-row> 149 </el-row>
150 </el-form> 150 </el-form>
151 </div> 151 </div>
152 + <!-- 预览弹窗 -->
153 + <DialogVue
154 + :outerVisible="outerVisible"
155 + :selected="selected"
156 + @close="dialogClose"
157 + />
158 + <!-- -->
152 <div class="entrySave"> 159 <div class="entrySave">
160 + <el-button class="entrySaveButton" @click="preview">预览</el-button>
153 <el-button class="entrySaveButton" @click="submit">提交</el-button> 161 <el-button class="entrySaveButton" @click="submit">提交</el-button>
154 <el-button class="entrySaveButton" @click="cancel">取消</el-button> 162 <el-button class="entrySaveButton" @click="cancel">取消</el-button>
155 </div> 163 </div>
...@@ -161,7 +169,11 @@ import { getCurrUserPortInfo } from "@/api/system/user.js"; ...@@ -161,7 +169,11 @@ import { getCurrUserPortInfo } from "@/api/system/user.js";
161 import { getNewCustomerList } from "@/api/declareData-api.js"; 169 import { getNewCustomerList } from "@/api/declareData-api.js";
162 import { getDictData } from "@/api/system/dict-api.js"; 170 import { getDictData } from "@/api/system/dict-api.js";
163 import { declareSummaryApplication } from "@/api/exportSummary-api.js"; 171 import { declareSummaryApplication } from "@/api/exportSummary-api.js";
172 +import DialogVue from "./dialog.vue";
164 export default { 173 export default {
174 + components: {
175 + DialogVue,
176 + },
165 name: "", 177 name: "",
166 data() { 178 data() {
167 return { 179 return {
...@@ -207,6 +219,8 @@ export default { ...@@ -207,6 +219,8 @@ export default {
207 summaryFlag: [], 219 summaryFlag: [],
208 itemNameFlag: [], 220 itemNameFlag: [],
209 declareType: [], 221 declareType: [],
222 + outerVisible: false,
223 + selected: {},
210 }; 224 };
211 }, 225 },
212 created() { 226 created() {
...@@ -219,6 +233,18 @@ export default { ...@@ -219,6 +233,18 @@ export default {
219 this.getDeclareType(); 233 this.getDeclareType();
220 }, 234 },
221 methods: { 235 methods: {
236 + preview() {
237 + this.$refs.editForm.validate((valid) => {
238 + if (!valid) {
239 + return;
240 + }
241 + this.selected = JSON.parse(JSON.stringify(this.formData));
242 + this.outerVisible = true;
243 + });
244 + },
245 + dialogClose() {
246 + this.outerVisible = false;
247 + },
222 searchUserData(val) { 248 searchUserData(val) {
223 this.formData.customsCode = val; 249 this.formData.customsCode = val;
224 this.formData.ebpcode = ""; 250 this.formData.ebpcode = "";
......