zhanbo.xu

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

......@@ -243,3 +243,15 @@ export function declareUpload(data) {
},
});
}
// 根据提运单号 查询提运单号下的所有物流运单号
// bus-customer/declareData/checkBillNo
export function checkBillNo(data) {
return request({
url: "/bus-customer/declareData/checkBillNo",
method: "post",
data: {
...data,
},
});
}
......
......@@ -39,6 +39,8 @@
</template>
<script>
import { checkBillNo } from "@/api/declareData-api.js";
export default {
props: {
showDialog: {
......@@ -78,38 +80,20 @@ export default {
showDialog(val) {
if (val) {
this.batchModifyVisible = val;
this.tableData = this.processWaybills(this.selectedDatas);
this.getBillNo();
}
},
},
created() {},
methods: {
processWaybills(data) {
if (!Array.isArray(data)) {
throw new Error("输入参数必须是数组");
getBillNo() {
checkBillNo({
declareIds: this.selectedDatas.map((item) => item.declareId),
}).then((res) => {
if (res.code === 200) {
this.tableData = res.data.value;
}
return Array.from(
data.reduce((map, item) => {
const key = item.billNo;
if (!map.has(key)) {
map.set(key, {
billNo: key,
logisticsWaybillNumber: [],
});
}
if (item.logisticsWaybillNumber) {
map
.get(key)
.logisticsWaybillNumber.push(item.logisticsWaybillNumber);
}
return map;
}, new Map()),
([_, value]) => ({
...value,
logisticsWaybillNumber: value.logisticsWaybillNumber.join(","),
})
);
},
formSubmit() {
......
......@@ -68,7 +68,7 @@
</template>
<script>
import { declareUpload } from "@/api/declareData-api.js";
import { declareUpload, checkBillNo } from "@/api/declareData-api.js";
export default {
props: {
timeVisible: {
......@@ -85,7 +85,7 @@ export default {
watch: {
timeVisible(val) {
if (val) {
this.tableData = this.processWaybills(this.selected);
this.getBillNo();
}
},
},
......@@ -117,32 +117,14 @@ export default {
};
},
methods: {
processWaybills(data) {
if (!Array.isArray(data)) {
throw new Error("输入参数必须是数组");
getBillNo() {
checkBillNo({
declareIds: this.selectedDatas.map((item) => item.declareId),
}).then((res) => {
if (res.code === 200) {
this.tableData = res.data.value;
}
return Array.from(
data.reduce((map, item) => {
const key = item.billNo;
if (!map.has(key)) {
map.set(key, {
billNo: key,
logisticsWaybillNumber: [],
});
}
if (item.logisticsWaybillNumber) {
map
.get(key)
.logisticsWaybillNumber.push(item.logisticsWaybillNumber);
}
return map;
}, new Map()),
([_, value]) => ({
...value,
logisticsWaybillNumber: value.logisticsWaybillNumber.join(","),
})
);
},
//数据保存
submit() {
......