zhanbo.xu

feat: 根据需求优化和开发

......@@ -292,3 +292,24 @@ export function getTotalDocumentsLevelLog(data) {
data: data,
});
}
// 分单级 根据提运单号获取操作日志
export function getOperationLogByLogisticsNo(data) {
return request({
url:
"/bus-customer/declareData/getOperationLogByLogisticsNo/" +
data.LogisticsNo,
method: "get",
data: data,
});
}
// ​/declareData​/getOperationLogByBillNo​/{billNo}
// 总 根据提运单号获取操作日志
export function getOperationLogByBillNo(data) {
return request({
url: "/bus-customer/declareData/getOperationLogByBillNo/" + data.billNo,
method: "get",
data: data,
});
}
......
......@@ -147,24 +147,7 @@
离境单申报
</el-button>
</div>
<section style="position: fixed; top: 35%; right: 10%">
<TablePopover
ref="allLogDataStatusPopover"
dataKey="allLogDataStatus"
idKey="declareId"
:parentDom="$refs.entryTable"
:receiptDataHead="logDataHead"
:rowData="selectedLogRow"
:tableData="tableData"
@popoverChange="popoverChange"
@popoverClose="popoverClose"
>
<div slot="title">
<span style="font-weight: 700; color: #515a6e">提运单号:</span>
{{ selectedLogRow.billNo }}
</div>
</TablePopover>
</section>
<Table
class="fedexDetialTable fedexSreachTable"
ref="entryTable"
......@@ -335,6 +318,18 @@
:selected="selected"
@close="timeClose"
/>
<!-- 日志 -->
<section style="position: fixed; top: 35%; right: 10%">
<PopoverComponent
:receiptDataHead="logDataHead"
:optionsColumn="optionsColumn"
:logFunction="getTotalDocumentsLevelLog"
:optionsFunction="getOperationLogByBillNo"
:optionsVisible="optionsVisible"
:rowData="selectedLogRow"
@close="popperClose"
/>
</section>
</div>
</template>
......@@ -346,11 +341,13 @@ import {
getLogisticsReceipt,
getTotalReceipt,
getTotalDocumentsLevelLog,
getOperationLogByBillNo,
} from "@/api/declareData-api.js";
import DialogVue from "./dialog.vue";
import DataPreview from "../reportingData/data-preview.vue";
import TimeDialog from "../reportingData/time-dialog.vue";
import { getCurrUserPortInfo } from "@/api/system/user.js";
import PopoverComponent from "./popover-component.vue";
export default {
name: "SupervisePlaceManage",
......@@ -358,13 +355,12 @@ export default {
DialogVue,
DataPreview,
TimeDialog,
PopoverComponent,
},
data() {
return {
portList: [],
activePortType: false,
// 控制日志弹窗的显示和隐藏
allLogDataStatusPopoverType: false,
// 存储选中的日志数据
selectedLogRow: {},
selected: [],
......@@ -491,6 +487,32 @@ export default {
align: "left",
},
],
optionsColumn: [
{
name: "操作类型",
value: "operationType",
width: "",
align: "left",
},
{
name: "提运单号",
value: "billNo",
width: "",
align: "left",
},
{
name: "物流运单编号",
value: "logisticsNo",
width: "",
align: "left",
},
{
name: "修改内容",
value: "content",
width: "",
align: "left",
},
],
loadings: {
sreachLoading: false,
declaration: false,
......@@ -502,6 +524,8 @@ export default {
dataPreviewTitle: "",
// 离境单申报
timeVisible: false,
// 获取操作日志
optionsVisible: false,
};
},
created() {
......@@ -517,26 +541,32 @@ export default {
this.searchPortDictData();
},
methods: {
getTotalDocumentsLevelLog: getTotalDocumentsLevelLog,
getOperationLogByBillNo: getOperationLogByBillNo,
//申报日志
popperClose() {
this.optionsVisible = false;
},
showTotalLog(row) {
this.$store.state.viewOption.loadingDatas = true;
// this.$store.state.viewOption.loadingDatas = true;
this.selectedLogRow = row;
this.$set(row, "logLoading", true);
this.optionsVisible = true;
// this.$set(row, "logLoading", true);
this.receiptApi(row.billNo, "allLogDataStatus").then((logData) => {
this.$set(row, "popoverData", logData);
if (!this.selectedLogRow.popoverData.length) {
this.$store.state.viewOption.loadingDatas = false;
}
// this.receiptApi(row.billNo, "allLogDataStatus").then((logData) => {
// this.$set(row, "popoverData", logData);
// if (!this.selectedLogRow.popoverData.length) {
// this.$store.state.viewOption.loadingDatas = false;
// }
// 手动触发状态更新
this.$nextTick(() => {
// 强制设置弹窗状态为true
row.allLogDataStatusPopoverType = true;
// 强制更新表格
this.tableData = [...this.tableData];
});
});
// // 手动触发状态更新
// this.$nextTick(() => {
// // 强制设置弹窗状态为true
// row.allLogDataStatusPopoverType = true;
// // 强制更新表格
// this.tableData = [...this.tableData];
// });
// });
},
//获取口岸子字典
searchPortDictData() {
......@@ -665,7 +695,7 @@ export default {
item.totalReceiptStatusPopoverType = false;
item.popoverData = [];
});
this.selectedLogRow.allLogDataStatusPopoverType = false;
this.$refs.entryTable.$refs.tables.$refs.bodyWrapper.style.overflowY =
"auto";
},
......@@ -715,20 +745,6 @@ export default {
console.log(err);
reject();
});
} else if (type == "allLogDataStatus") {
let objVal = { billNo: billNo };
getTotalDocumentsLevelLog(objVal)
.then((res) => {
if (res.code === "200") {
resolve(res.data);
} else {
reject();
}
})
.catch((err) => {
console.log(err);
reject();
});
}
});
},
......@@ -753,7 +769,6 @@ export default {
this.$refs.arrivalInReceiptStatusPopover.tableLoading = false; //运抵单回执
this.$refs.logisticsDepartureReceiptStatusPopover.tableLoading = false; // 离境单回执
this.$refs.totalReceiptStatusPopover.tableLoading = false;
this.$refs.allLogDataStatusPopoverType = false;
});
});
},
......
<template>
<el-popover
popper-class="arrival-declare-popper"
placement="left"
:visible-arrow="false"
title=""
width="750"
trigger="manual"
v-model="popperVisible"
>
<div style="position: absolute; right: 10px; z-index: 10">
<i
class="el-icon-close"
style="cursor: pointer; font-size: 20px; font-weight: 700"
@click.stop="popoverClose"
></i>
</div>
<el-tabs v-model="tabsKey" @tab-click="handleClick">
<el-tab-pane label="回执日志" name="1">
<div>
<span style="font-weight: 700; color: #515a6e">提运单号:</span>
{{ rowData.billNo }}
</div>
<el-table
:pagination="false"
:border="true"
tooltip-effect="dark"
max-height="300px"
:data="logData"
rowKey="id"
>
<el-table-column
v-for="(item, index) in receiptDataHead"
:key="index"
:prop="item.value"
:label="item.name"
:align="item.align"
:width="item.width"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="操作日志" name="2">
<el-table
:pagination="false"
:border="true"
tooltip-effect="dark"
max-height="300px"
:data="optionsData"
rowKey="id"
>
<el-table-column
v-for="(item, index) in optionsColumn"
:key="index"
:prop="item.value"
:label="item.name"
:align="item.align"
:width="item.width"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<el-button
slot="reference"
type="text"
@click.stop="popoverChange(rowData, dataKey)"
>
<slot name="buttonLabel"></slot>
</el-button>
</el-popover>
</template>
<script>
export default {
props: {
rowData: {
tpye: Object,
default: null,
},
receiptDataHead: {
type: Array,
default() {
return [];
},
},
optionsColumn: {
type: Array,
default() {
return [];
},
},
logFunction: {
type: Function,
default: null,
},
optionsFunction: {
type: Function,
default: null,
},
optionsVisible: {
type: Boolean,
default: false,
},
},
data() {
return {
tableLoading: false,
popperVisible: false,
tabsKey: "1",
logData: [],
optionsData: [],
};
},
computed: {},
watch: {
optionsVisible(val) {
if (val) {
this.tabsKey = "1";
this.fetchData();
this.popperVisible = true;
}
},
},
methods: {
fetchData() {
const { billNo } = this.rowData;
let objVal = { billNo: billNo };
this.logFunction(objVal)
.then((res) => {
if (res.code === "200") {
console.log(res.data);
this.logData = res.data;
}
})
.catch((err) => {
console.log(err);
});
},
// tab点击事件
handleClick(tab, event) {
console.log(tab.name, event);
if (+tab.name === 2) {
const { billNo } = this.rowData;
let objVal = { billNo: billNo };
this.optionsFunction(objVal)
.then((res) => {
if (res.code === "200") {
console.log(res.data);
this.optionsData = res.data;
}
})
.catch((err) => {
console.log(err);
});
}
},
//弹框关闭
popoverClose() {
this.popperVisible = false;
this.$emit("close");
},
//弹框状态改版
popoverChange(data, type) {
console.log(data, type);
this.popoverClose();
let arr = JSON.parse(JSON.stringify(this.tableData));
arr.forEach((item) => {
item.popoverData = [];
if (data[this.idKey] != item[this.idKey]) {
// item[`${type}PopoverLoading`] = false;
item[`${type}PopoverType`] = false;
} else {
// item[`${type}PopoverLoading`] = true;
item[`${type}PopoverType`] = !JSON.parse(
JSON.stringify(item[`${type}PopoverType`])
);
}
});
if (!data[`${type}PopoverType`]) {
this.parentDom.$refs.tables.$refs.bodyWrapper.style.overflowY =
"hidden";
} else {
this.parentDom.$refs.tables.$refs.bodyWrapper.style.overflowY = "auto";
}
this.$emit("popoverChange", {
tableData: arr,
data: data,
type: !data[`${type}PopoverType`],
status: type,
});
this.$nextTick(() => {
document.getElementsByClassName("el-table__row").forEach((dom1, i) => {
if (i == data.index) {
dom1.classList.add("activeRow");
} else {
dom1.classList.remove("hover-row");
dom1.classList.remove("activeRow");
}
});
let interval = setInterval(() => {
if (
document.getElementsByClassName(`popper${type}${data[this.idKey]}`)
.length == 1
) {
clearInterval(interval);
}
document
.getElementsByClassName(`popper${type}${data[this.idKey]}`)
.forEach((dom, index) => {
if (index > 0) {
dom.style.display = "none";
dom.remove();
}
});
}, 100);
});
},
},
};
</script>
<style lang="scss" scoped>
.tableList {
width: 200px;
max-height: 500px;
padding: 5px;
margin: 0;
position: absolute;
bottom: 35px;
right: 0px;
border: 1px solid #ccc;
border-radius: 3%;
background: #fff;
overflow-y: scroll;
}
</style>
......@@ -203,6 +203,25 @@ export default {
2
)}%`;
},
// 二次确认
cancelBatchModify(obj) {
modifyWeight(obj)
.then((res) => {
if (res.code === "200") {
this.msgSuccess("修改成功");
this.cancelModify(1);
} else {
this.msgError(res.message);
// this.cancelModify(0);
this.dialogLoading = false;
}
})
.catch((err) => {
console.log(err);
this.alertWarningMsg(err.message);
// this.cancelModify(0);
});
},
formSubmit() {
this.$refs.batchModifyForm.validate((valid) => {
......@@ -213,21 +232,20 @@ export default {
weight: this.weightForm.weight,
};
console.log("datas==", obj);
modifyWeight(obj)
.then((res) => {
if (res.code === "200") {
this.msgSuccess("修改成功");
this.cancelModify(1);
} else {
this.msgError(res.message);
// this.cancelModify(0);
this.dialogLoading = false;
}
this.$confirm(
`是否确认操作[${this.weightForm.billNo}]的重量调整?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
this.cancelBatchModify(obj);
})
.catch((err) => {
console.log(err);
this.alertWarningMsg(err.message);
// this.cancelModify(0);
.catch(() => {
this.cancelModify(0);
});
} else {
return false;
......