zhanbo.xu

feat:新增申报数据二次预览接口

...@@ -250,8 +250,6 @@ export function checkBillNo(data) { ...@@ -250,8 +250,6 @@ export function checkBillNo(data) {
250 return request({ 250 return request({
251 url: "/bus-customer/declareData/checkBillNo", 251 url: "/bus-customer/declareData/checkBillNo",
252 method: "post", 252 method: "post",
253 - data: { 253 + data: data.declareIds,
254 - ...data,
255 - },
256 }); 254 });
257 } 255 }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
12 提运单号 数量:<strong>{{ tableData.length }}</strong> 12 提运单号 数量:<strong>{{ tableData.length }}</strong>
13 </span> 13 </span>
14 <span style="margin-left: 20px"> 14 <span style="margin-left: 20px">
15 - 物流运单编号 数量:<strong>{{ selectedDatas.length }}</strong> 15 + 物流运单编号 数量:<strong>{{ logisticsTotal }}</strong>
16 </span> 16 </span>
17 </div> 17 </div>
18 <Table 18 <Table
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
23 :border="true" 23 :border="true"
24 :pagination="false" 24 :pagination="false"
25 :order="false" 25 :order="false"
26 + :height="tableMaxheight + 'px'"
27 + :maxHeight="tableMaxheight + 'px'"
26 > 28 >
27 </Table> 29 </Table>
28 <div class="dialogOption entrySave revokeOperation"> 30 <div class="dialogOption entrySave revokeOperation">
...@@ -74,6 +76,8 @@ export default { ...@@ -74,6 +76,8 @@ export default {
74 ], 76 ],
75 tableData: [], 77 tableData: [],
76 batchModifyVisible: false, 78 batchModifyVisible: false,
79 + logisticsTotal: 0,
80 + tableMaxheight: 200,
77 }; 81 };
78 }, 82 },
79 watch: { 83 watch: {
...@@ -90,11 +94,30 @@ export default { ...@@ -90,11 +94,30 @@ export default {
90 checkBillNo({ 94 checkBillNo({
91 declareIds: this.selectedDatas.map((item) => item.declareId), 95 declareIds: this.selectedDatas.map((item) => item.declareId),
92 }).then((res) => { 96 }).then((res) => {
93 - if (res.code === 200) { 97 + console.log(res);
94 - this.tableData = res.data.value; 98 + if (+res.code === 200) {
99 + this.tableData = res.data;
100 +
101 + const { total } = this.getLogisticsWaybillDetails(this.tableData);
102 + this.logisticsTotal = total;
103 + this.tableMaxheight =
104 + res.data.length >= 10 ? 500 : res.data.length * 50 + 50;
95 } 105 }
96 }); 106 });
97 }, 107 },
108 + getLogisticsWaybillDetails(data) {
109 + const numbers = data.reduce((acc, item) => {
110 + const validNumbers = item.logisticsWaybillNumber
111 + .split(",")
112 + .filter((num) => num && num.trim());
113 + return [...acc, ...validNumbers];
114 + }, []);
115 +
116 + return {
117 + total: numbers.length,
118 + numbers: numbers,
119 + };
120 + },
98 121
99 formSubmit() { 122 formSubmit() {
100 this.cancelModify(1); 123 this.cancelModify(1);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 <el-dialog 2 <el-dialog
3 class="entryDialog classCUploadDialog" 3 class="entryDialog classCUploadDialog"
4 title="离境单申报" 4 title="离境单申报"
5 - :visible.sync="timeVisible" 5 + :visible.sync="timeVisibleConfig"
6 :show-close="false" 6 :show-close="false"
7 width="700px" 7 width="700px"
8 :close-on-click-modal="false" 8 :close-on-click-modal="false"
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 提运单号 数量:<strong>{{ tableData.length }}</strong> 15 提运单号 数量:<strong>{{ tableData.length }}</strong>
16 </span> 16 </span>
17 <span style="margin-left: 20px"> 17 <span style="margin-left: 20px">
18 - 物流运单编号 数量:<strong>{{ selected.length }}</strong> 18 + 物流运单编号 数量:<strong>{{ logisticsTotal }}</strong>
19 </span> 19 </span>
20 </div> 20 </div>
21 21
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
52 :border="true" 52 :border="true"
53 :pagination="false" 53 :pagination="false"
54 :order="false" 54 :order="false"
55 + :height="tableMaxheight + 'px'"
56 + :maxHeight="tableMaxheight + 'px'"
55 > 57 >
56 </Table> 58 </Table>
57 59
...@@ -82,18 +84,13 @@ export default { ...@@ -82,18 +84,13 @@ export default {
82 }, 84 },
83 }, 85 },
84 }, 86 },
85 - watch: { 87 +
86 - timeVisible(val) {
87 - if (val) {
88 - this.getBillNo();
89 - }
90 - },
91 - },
92 data() { 88 data() {
93 return { 89 return {
94 formData: { 90 formData: {
95 leaveTime: "", 91 leaveTime: "",
96 }, 92 },
93 + timeVisibleConfig: false,
97 headerData: [ 94 headerData: [
98 { 95 {
99 name: "提运单号", 96 name: "提运单号",
...@@ -114,15 +111,29 @@ export default { ...@@ -114,15 +111,29 @@ export default {
114 submitLoading: false, 111 submitLoading: false,
115 }, 112 },
116 loadingText: "", 113 loadingText: "",
114 + logisticsTotal: 0,
115 + tableMaxheight: 200,
117 }; 116 };
118 }, 117 },
118 + watch: {
119 + timeVisible(val) {
120 + if (val) {
121 + this.timeVisibleConfig = val;
122 + this.getBillNo();
123 + }
124 + },
125 + },
119 methods: { 126 methods: {
120 getBillNo() { 127 getBillNo() {
121 checkBillNo({ 128 checkBillNo({
122 - declareIds: this.selectedDatas.map((item) => item.declareId), 129 + declareIds: this.selected.map((item) => item.declareId),
123 }).then((res) => { 130 }).then((res) => {
124 - if (res.code === 200) { 131 + if (+res.code === 200) {
125 - this.tableData = res.data.value; 132 + this.tableData = res.data;
133 + const { total } = this.getLogisticsWaybillDetails(this.tableData);
134 + this.logisticsTotal = total;
135 + this.tableMaxheight =
136 + res.data.length >= 9 ? 500 : res.data.length * 50 + 50;
126 } 137 }
127 }); 138 });
128 }, 139 },
...@@ -139,6 +150,19 @@ export default { ...@@ -139,6 +150,19 @@ export default {
139 } 150 }
140 }); 151 });
141 }, 152 },
153 + getLogisticsWaybillDetails(data) {
154 + const numbers = data.reduce((acc, item) => {
155 + const validNumbers = item.logisticsWaybillNumber
156 + .split(",")
157 + .filter((num) => num && num.trim());
158 + return [...acc, ...validNumbers];
159 + }, []);
160 +
161 + return {
162 + total: numbers.length,
163 + numbers: numbers,
164 + };
165 + },
142 //新增 166 //新增
143 addapi(val) { 167 addapi(val) {
144 this.loadings.dialogLoading = true; 168 this.loadings.dialogLoading = true;
...@@ -163,6 +187,7 @@ export default { ...@@ -163,6 +187,7 @@ export default {
163 leaveTime: "", 187 leaveTime: "",
164 }; 188 };
165 this.loadings.dialogLoading = false; 189 this.loadings.dialogLoading = false;
190 + this.timeVisibleConfig = false;
166 this.$emit("close", flag); 191 this.$emit("close", flag);
167 }, 192 },
168 }, 193 },
......