Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
EcomWeb
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
zhanbo.xu
2025-04-11 13:40:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
886109cd125f15ddfac27721058798400eb3f625
886109cd
1 parent
40ef2a1a
新增申报数据二次预览
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
376 additions
and
34 deletions
src/views/reportingData/data-preview.vue
src/views/reportingData/index.vue
src/views/reportingData/time-dialog.vue
src/views/reportingData/weight-adjust.vue
src/views/reportingData/data-preview.vue
0 → 100644
View file @
886109c
<template>
<el-dialog
class="entryDialog classCUploadDialog"
:title="dataPreviewTitle"
:visible.sync="batchModifyVisible"
:show-close="false"
width="700px"
:close-on-click-modal="false"
>
<div style="margin-bottom: 10px">
<span>
提运单号 数量:<strong>{{ tableData.length }}</strong>
</span>
<span style="margin-left: 20px">
物流运单编号 数量:<strong>{{ selectedDatas.length }}</strong>
</span>
</div>
<Table
class="fedexDetialTable fedexSreachTable"
ref="entryTable"
:data="tableData"
:headerData="headerData"
:border="true"
:pagination="false"
:order="false"
>
</Table>
<div class="dialogOption entrySave revokeOperation">
<el-button
class="entrySaveButton entrySaveButton-background revokeSubmitBtn"
type="primary"
@click="formSubmit"
>
确定
</el-button>
<el-button class="entrySaveButton" @click="cancelModify">关闭</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
dataPreviewTitle: {
type: String,
default: "预览",
},
selectedDatas: {
type: Array,
default: () => [],
},
},
data() {
return {
headerData: [
{
name: "提运单号",
value: "billNo",
width: "180px",
align: "left",
},
{
name: "物流运单编号",
value: "logisticsWaybillNumber",
width: "",
align: "left",
},
],
tableData: [],
batchModifyVisible: false,
};
},
watch: {
showDialog(val) {
if (val) {
this.batchModifyVisible = val;
this.tableData = this.processWaybills(this.selectedDatas);
}
},
},
created() {},
methods: {
processWaybills(data) {
if (!Array.isArray(data)) {
throw new Error("输入参数必须是数组");
}
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() {
this.cancelModify(1);
},
cancelModify(val) {
this.batchModifyVisible = false;
this.$emit("cancelDataPreview", val);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.revokeOperation {
margin-bottom: 25px;
.revokeSubmitBtn {
margin-right: 30px;
}
}
</style>
src/views/reportingData/index.vue
View file @
886109c
...
...
@@ -140,6 +140,14 @@
<el-button
class="entrySaveButton"
size="small"
icon="el-icon-edit"
@click="batchModify"
>
重量调整
</el-button>
<el-button
class="entrySaveButton"
size="small"
icon="el-icon-download"
v-loading="loadings.exportDeclareLoading"
@click="downloadData"
...
...
@@ -442,6 +450,13 @@
:selected="selected"
@close="dialogClose"
/>
<!-- 数据预览 -->
<DataPreview
:showDialog="dataPreviewVisible"
:dataPreviewTitle="dataPreviewTitle"
:selectedDatas="selected"
@cancelDataPreview="cancelDataPreview"
/>
</div>
</template>
...
...
@@ -464,6 +479,7 @@ import TemplateDownloadDialog from "./templateDownloadDialog.vue";
import ExportDialog from "./exportDialog.vue";
import BatchModify from "./batchModify.vue";
import TimeDialog from "./time-dialog.vue";
import DataPreview from "./data-preview.vue";
export default {
name: "ReportingData",
components: {
...
...
@@ -473,6 +489,7 @@ export default {
ExportDialog,
BatchModify,
TimeDialog,
DataPreview,
},
data() {
return {
...
...
@@ -650,6 +667,11 @@ export default {
datasExportVisible: false,
batchModifyVisible: false,
timeVisible: false,
// 数据预览
dataPreviewVisible: false,
dataPreviewTitle: "",
currentLoadingKey: "",
paramsOjb: {},
};
},
created() {
...
...
@@ -849,6 +871,39 @@ export default {
}
this.timeVisible = true;
},
// 申报
postDeclareData(obj, loadingKey) {
// 提交申报数据
declareDataUpload(obj)
.then((res) => {
if (res.code === "200") {
this.alertSuccessMsg("数据已成功提交申报,请等待海关回执。");
} else {
this.alertWarningMsg(res.message);
}
})
.catch((err) => {
console.error(err);
this.alertWarningMsg("申报失败,请稍后重试。");
})
.finally(() => {
// 无论成功或失败,都重置加载状态并刷新数据
this.$set(this.loadings, loadingKey, false);
this.search(0);
});
},
cancelDataPreview(val) {
this.dataPreviewVisible = false;
this.dataPreviewTitle = "";
if (val === 1) {
this.postDeclareData(this.paramsOjb, this.currentLoadingKey);
} else {
this.$set(this.loadings, this.currentLoadingKey, false);
this.paramsOjb = {};
}
},
/**
* 通用申报方法
...
...
@@ -861,14 +916,21 @@ export default {
this.alertWarningMsg("请选择数据!");
return;
}
// 设置加载状态
this.$set(this.loadings, loadingKey, true);
// 构造请求参数
const obj = {
declareIds: this.selected.map((item) => item.declareId),
type: dropdownCode,
};
if (dropdownName === "一键申报" || dropdownName === "清单总分单申报") {
this.dataPreviewVisible = true;
this.dataPreviewTitle = `预览-${dropdownName}`;
this.currentLoadingKey = loadingKey;
this.paramsOjb = obj;
return;
}
// 如果是撤销单申报,显示弹窗并返回
if (dropdownName === "撤销单申报") {
...
...
@@ -878,24 +940,7 @@ export default {
return;
}
// 提交申报数据
declareDataUpload(obj)
.then((res) => {
if (res.code === "200") {
this.alertSuccessMsg("数据已成功提交申报,请等待海关回执。");
} else {
this.alertWarningMsg(res.message);
}
})
.catch((err) => {
console.error(err);
this.alertWarningMsg("申报失败,请稍后重试。");
})
.finally(() => {
// 无论成功或失败,都重置加载状态并刷新数据
this.$set(this.loadings, loadingKey, false);
this.search(0);
});
this.postDeclareData(obj, loadingKey);
},
//切换申报模式
dropdownChange(val) {
...
...
src/views/reportingData/time-dialog.vue
View file @
886109c
...
...
@@ -21,21 +21,6 @@
<el-row :gutter="5">
<el-col :span="8">
<Formitem label="离境时间" prop="leaveTime" type="edit">
<!-- <el-select
type="text"
id="inputInner-edit-leaveTime"
v-model="formData.leaveTimel-date-picker"
clearable
filterable
placeholder=""
>
<el-option
v-for="item in operatorCode"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select> -->
<el-date-picker
class="inputInner--leaveTime"
id="inputInner-edit-leaveTime"
...
...
src/views/reportingData/weight-adjust.vue
0 → 100644
View file @
886109c
<template>
<el-dialog
class="entryDialog classCUploadDialog"
title="重量调整"
:visible.sync="batchModifyVisible"
:show-close="false"
width="60%"
:close-on-click-modal="false"
>
<div>
<el-form
class="fedexFormStyle"
ref="batchModifyForm"
:model="batchModifyFormData"
:rules="batchModifyFormRules"
label-position="left"
size="small"
>
<Formitem label="修改数据" prop="modifyData">
<el-select
type="text"
v-model="batchModifyFormData.modifyData"
clearable
placeholder=""
>
<el-option
v-for="item in modifyDataList"
:key="item.itemValue"
:label="item.itemChineseName"
:value="item.itemValue"
></el-option>
</el-select>
</Formitem>
<Formitem label="修改内容" prop="modifyContent">
<el-input
type="text"
class="inputShadow"
resize="none"
v-model="batchModifyFormData.modifyContent"
clearable
placeholder="请输入修改内容"
></el-input>
</Formitem>
</el-form>
</div>
<div class="dialogOption entrySave revokeOperation">
<el-button
class="entrySaveButton entrySaveButton-background revokeSubmitBtn"
type="primary"
@click="formSubmit"
>确定</el-button
>
<el-button class="entrySaveButton" @click="cancelModify">关闭</el-button>
</div>
</el-dialog>
</template>
<script>
import { bathDeclareDate } from "@/api/declareData-api.js";
import { getDictData } from "@/api/system/dict-api.js";
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
selectedDatas: {
type: Array,
default: () => [],
},
},
data() {
return {
batchModifyVisible: false,
batchModifyFormData: {
modifyData: "",
modifyContent: "",
},
batchModifyFormRules: {
modifyData: [
{ required: true, message: "请选择修改数据", trigger: "change" },
],
modifyContent: [
{ required: true, message: "请输入修改内容", trigger: "blur" },
],
},
modifyDataList: [
{ name: "提运单号", value: "BILLNO" },
{ name: "航班航次号", value: "FLIGHT_NUMBER" },
],
};
},
watch: {
showDialog(val) {
if (val) {
this.batchModifyVisible = val;
this.batchModifyFormData.modifyData = "";
this.batchModifyFormData.modifyContent = "";
}
},
},
created() {
this.getModifyDataList();
},
methods: {
getModifyDataList() {
getDictData({ doctCode: "DATABASE_FIELD" })
.then((res) => {
if (res.code == "200") {
this.modifyDataList = res.data;
}
})
.catch((err) => {
console.error(err);
});
},
formSubmit() {
this.$refs.batchModifyForm.validate((valid) => {
if (valid) {
let obj = {
declareIds: [],
modifyData: this.batchModifyFormData.modifyData,
modifyContent: this.batchModifyFormData.modifyContent,
};
this.selectedDatas.forEach((item) => {
obj.declareIds.push(item.declareId);
});
console.log("datas==", obj);
bathDeclareDate(obj)
.then((res) => {
if (res.code === "200") {
this.msgSuccess("批量修改成功");
this.cancelModify(1);
} else {
this.alertWarningMsg(res.message);
}
})
.catch((err) => {
console.log(err);
this.alertWarningMsg(err.message);
this.cancelModify(1);
});
} else {
return false;
}
});
},
cancelModify(val) {
this.batchModifyVisible = false;
this.$emit("cancelBatchModify", val);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.modelItem {
width: 100%;
.modelItem-title {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
font-size: 14px;
font-weight: 600;
color: #333;
}
}
.revokeOperation {
margin-bottom: 25px;
.revokeSubmitBtn {
margin-right: 30px;
}
}
</style>
Please
register
or
login
to post a comment