zhanbo.xu

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

......@@ -250,8 +250,6 @@ export function checkBillNo(data) {
return request({
url: "/bus-customer/declareData/checkBillNo",
method: "post",
data: {
...data,
},
data: data.declareIds,
});
}
......
......@@ -12,7 +12,7 @@
提运单号 数量:<strong>{{ tableData.length }}</strong>
</span>
<span style="margin-left: 20px">
物流运单编号 数量:<strong>{{ selectedDatas.length }}</strong>
物流运单编号 数量:<strong>{{ logisticsTotal }}</strong>
</span>
</div>
<Table
......@@ -23,6 +23,8 @@
:border="true"
:pagination="false"
:order="false"
:height="tableMaxheight + 'px'"
:maxHeight="tableMaxheight + 'px'"
>
</Table>
<div class="dialogOption entrySave revokeOperation">
......@@ -74,6 +76,8 @@ export default {
],
tableData: [],
batchModifyVisible: false,
logisticsTotal: 0,
tableMaxheight: 200,
};
},
watch: {
......@@ -90,11 +94,30 @@ export default {
checkBillNo({
declareIds: this.selectedDatas.map((item) => item.declareId),
}).then((res) => {
if (res.code === 200) {
this.tableData = res.data.value;
console.log(res);
if (+res.code === 200) {
this.tableData = res.data;
const { total } = this.getLogisticsWaybillDetails(this.tableData);
this.logisticsTotal = total;
this.tableMaxheight =
res.data.length >= 10 ? 500 : res.data.length * 50 + 50;
}
});
},
getLogisticsWaybillDetails(data) {
const numbers = data.reduce((acc, item) => {
const validNumbers = item.logisticsWaybillNumber
.split(",")
.filter((num) => num && num.trim());
return [...acc, ...validNumbers];
}, []);
return {
total: numbers.length,
numbers: numbers,
};
},
formSubmit() {
this.cancelModify(1);
......
......@@ -2,7 +2,7 @@
<el-dialog
class="entryDialog classCUploadDialog"
title="离境单申报"
:visible.sync="timeVisible"
:visible.sync="timeVisibleConfig"
:show-close="false"
width="700px"
:close-on-click-modal="false"
......@@ -15,7 +15,7 @@
提运单号 数量:<strong>{{ tableData.length }}</strong>
</span>
<span style="margin-left: 20px">
物流运单编号 数量:<strong>{{ selected.length }}</strong>
物流运单编号 数量:<strong>{{ logisticsTotal }}</strong>
</span>
</div>
......@@ -52,6 +52,8 @@
:border="true"
:pagination="false"
:order="false"
:height="tableMaxheight + 'px'"
:maxHeight="tableMaxheight + 'px'"
>
</Table>
......@@ -82,18 +84,13 @@ export default {
},
},
},
watch: {
timeVisible(val) {
if (val) {
this.getBillNo();
}
},
},
data() {
return {
formData: {
leaveTime: "",
},
timeVisibleConfig: false,
headerData: [
{
name: "提运单号",
......@@ -114,15 +111,29 @@ export default {
submitLoading: false,
},
loadingText: "",
logisticsTotal: 0,
tableMaxheight: 200,
};
},
watch: {
timeVisible(val) {
if (val) {
this.timeVisibleConfig = val;
this.getBillNo();
}
},
},
methods: {
getBillNo() {
checkBillNo({
declareIds: this.selectedDatas.map((item) => item.declareId),
declareIds: this.selected.map((item) => item.declareId),
}).then((res) => {
if (res.code === 200) {
this.tableData = res.data.value;
if (+res.code === 200) {
this.tableData = res.data;
const { total } = this.getLogisticsWaybillDetails(this.tableData);
this.logisticsTotal = total;
this.tableMaxheight =
res.data.length >= 9 ? 500 : res.data.length * 50 + 50;
}
});
},
......@@ -139,6 +150,19 @@ export default {
}
});
},
getLogisticsWaybillDetails(data) {
const numbers = data.reduce((acc, item) => {
const validNumbers = item.logisticsWaybillNumber
.split(",")
.filter((num) => num && num.trim());
return [...acc, ...validNumbers];
}, []);
return {
total: numbers.length,
numbers: numbers,
};
},
//新增
addapi(val) {
this.loadings.dialogLoading = true;
......@@ -163,6 +187,7 @@ export default {
leaveTime: "",
};
this.loadings.dialogLoading = false;
this.timeVisibleConfig = false;
this.$emit("close", flag);
},
},
......