zhanbo.xu

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

...@@ -243,3 +243,15 @@ export function declareUpload(data) { ...@@ -243,3 +243,15 @@ export function declareUpload(data) {
243 }, 243 },
244 }); 244 });
245 } 245 }
246 +
247 +// 根据提运单号 查询提运单号下的所有物流运单号
248 +// bus-customer/declareData/checkBillNo
249 +export function checkBillNo(data) {
250 + return request({
251 + url: "/bus-customer/declareData/checkBillNo",
252 + method: "post",
253 + data: {
254 + ...data,
255 + },
256 + });
257 +}
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
39 </template> 39 </template>
40 40
41 <script> 41 <script>
42 +import { checkBillNo } from "@/api/declareData-api.js";
43 +
42 export default { 44 export default {
43 props: { 45 props: {
44 showDialog: { 46 showDialog: {
...@@ -78,38 +80,20 @@ export default { ...@@ -78,38 +80,20 @@ export default {
78 showDialog(val) { 80 showDialog(val) {
79 if (val) { 81 if (val) {
80 this.batchModifyVisible = val; 82 this.batchModifyVisible = val;
81 - this.tableData = this.processWaybills(this.selectedDatas); 83 + this.getBillNo();
82 } 84 }
83 }, 85 },
84 }, 86 },
85 created() {}, 87 created() {},
86 methods: { 88 methods: {
87 - processWaybills(data) { 89 + getBillNo() {
88 - if (!Array.isArray(data)) { 90 + checkBillNo({
89 - throw new Error("输入参数必须是数组"); 91 + declareIds: this.selectedDatas.map((item) => item.declareId),
90 - } 92 + }).then((res) => {
91 - 93 + if (res.code === 200) {
92 - return Array.from( 94 + this.tableData = res.data.value;
93 - data.reduce((map, item) => { 95 + }
94 - const key = item.billNo; 96 + });
95 - if (!map.has(key)) {
96 - map.set(key, {
97 - billNo: key,
98 - logisticsWaybillNumber: [],
99 - });
100 - }
101 - if (item.logisticsWaybillNumber) {
102 - map
103 - .get(key)
104 - .logisticsWaybillNumber.push(item.logisticsWaybillNumber);
105 - }
106 - return map;
107 - }, new Map()),
108 - ([_, value]) => ({
109 - ...value,
110 - logisticsWaybillNumber: value.logisticsWaybillNumber.join(","),
111 - })
112 - );
113 }, 97 },
114 98
115 formSubmit() { 99 formSubmit() {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
68 </template> 68 </template>
69 69
70 <script> 70 <script>
71 -import { declareUpload } from "@/api/declareData-api.js"; 71 +import { declareUpload, checkBillNo } from "@/api/declareData-api.js";
72 export default { 72 export default {
73 props: { 73 props: {
74 timeVisible: { 74 timeVisible: {
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
85 watch: { 85 watch: {
86 timeVisible(val) { 86 timeVisible(val) {
87 if (val) { 87 if (val) {
88 - this.tableData = this.processWaybills(this.selected); 88 + this.getBillNo();
89 } 89 }
90 }, 90 },
91 }, 91 },
...@@ -117,32 +117,14 @@ export default { ...@@ -117,32 +117,14 @@ export default {
117 }; 117 };
118 }, 118 },
119 methods: { 119 methods: {
120 - processWaybills(data) { 120 + getBillNo() {
121 - if (!Array.isArray(data)) { 121 + checkBillNo({
122 - throw new Error("输入参数必须是数组"); 122 + declareIds: this.selectedDatas.map((item) => item.declareId),
123 - } 123 + }).then((res) => {
124 - 124 + if (res.code === 200) {
125 - return Array.from( 125 + this.tableData = res.data.value;
126 - data.reduce((map, item) => { 126 + }
127 - const key = item.billNo; 127 + });
128 - if (!map.has(key)) {
129 - map.set(key, {
130 - billNo: key,
131 - logisticsWaybillNumber: [],
132 - });
133 - }
134 - if (item.logisticsWaybillNumber) {
135 - map
136 - .get(key)
137 - .logisticsWaybillNumber.push(item.logisticsWaybillNumber);
138 - }
139 - return map;
140 - }, new Map()),
141 - ([_, value]) => ({
142 - ...value,
143 - logisticsWaybillNumber: value.logisticsWaybillNumber.join(","),
144 - })
145 - );
146 }, 128 },
147 //数据保存 129 //数据保存
148 submit() { 130 submit() {
......