Commit 1797f095 authored by huhaiqing's avatar huhaiqing

海运代码合并

parent 606fd033
......@@ -318,3 +318,12 @@ export function downloadLadingCopy(params) {
params,
});
}
// 更新异常订单状态
export function updateAbnormalOrder(data) {
return request({
url: "/shipment/box/updateAbnormalOrder",
method: "post",
data,
});
}
......@@ -203,7 +203,14 @@ export const DICT_TYPE = {
BOX_SEA_AIR: 'shipping_process_sea_air', // 海空联运流程流程
BOX_SHIPPING_BRAND_TYPE: 'shipping_brand_type', // 出货品牌类型
BOX_SHIPPING_NOTICE_TYPE: 'shipping_notice_type', // 出货通知类型
BOX_ORDER_SHIPMENT_STATE: 'order_shipment_state'
BOX_ORDER_SHIPMENT_STATE: 'order_shipment_state',
BOX_INSPECTION_TIME_CUSTOMS: 'inspection_time_customs', // 校验时间-报关
BOX_INSPECTION_TIME_SHIPPING: 'inspection_time_shipping', // 校验时间-起运
BOX_INSPECTION_TIME_ARRIVAL: 'inspection_time_arrival', // 校验时间-到港
BOX_SHIPPING_UPDATE_TYPE: "shipping_update_type",// 更新类型
BOX_CUSTOMS_ERROR_TYPE: "customs_error_type",// 报关异常状态
BOX_SHIPPING_ERROR_TYPE: "shipping_error_type",// 起运异常状态
BOX_ARRIVAL_ERROR_TYPE: "arrival_error_type",// 到港异常状态
}
/**
......
......@@ -178,7 +178,7 @@
</el-table-column>
<el-table-column :label="$t('操作')" align="center" width="80">
<template slot-scope="scope">
<el-button type="text" @click="handleCommand(scope.row, 'sea')">{{$t('处理')}}</el-button>
<el-button type="text" @click="handleCommand(scope.row, 'handle')">{{$t('处理')}}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -372,7 +372,9 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm(this.$t('是否确认删除出货编号为 {no} 的数据项?', {no: row.selfNo}))
.confirm(
this.$t("是否确认删除出货编号为 {no} 的数据项?", { no: row.selfNo })
)
.then(function () {
return deletebox(row.id);
})
......@@ -432,11 +434,14 @@ export default {
case "editLadingBill":
const cabinetLabel = this.getCabinetName(row.cabinetId);
const title = this.$t('查看提单 {selfNo} 柜号:{cubNo} 柜型:{cabinetLabel}', {
const title = this.$t(
"查看提单 {selfNo} 柜号:{cubNo} 柜型:{cabinetLabel}",
{
selfNo: row.selfNo,
cubNo: row.cubNo,
cabinetLabel: cabinetLabel
})
cabinetLabel: cabinetLabel,
}
);
this.$set(this.dialogCfg, "title", title);
this.$set(this.dialogCfg, "fullscreen", true);
break;
......@@ -453,7 +458,7 @@ export default {
downloadFile(
command,
{ shipmentId: row.id },
this.$t('预装单')+`(${row.selfNo}).xlsx`,
this.$t("预装单") + `(${row.selfNo}).xlsx`,
"xlsx"
);
break;
......@@ -461,7 +466,7 @@ export default {
downloadFile(
command,
{ shipmentId: row.id },
this.$t('已装单') + `(${row.selfNo}).xlsx`,
this.$t("已装单") + `(${row.selfNo}).xlsx`,
"xlsx"
);
break;
......@@ -469,7 +474,7 @@ export default {
downloadFile(
command,
{ shipmentId: row.id },
this.$t('应收汇总表') + `(${row.selfNo}).xlsx`,
this.$t("应收汇总表") + `(${row.selfNo}).xlsx`,
"xlsx"
);
break;
......@@ -486,6 +491,16 @@ export default {
case "downloadLadingCopy":
downloadFileByUrl(command, { shipmentId: row.id });
break;
case "handle":
const { noticeType } = row;
if ([1, 2, 3, 4, 8].includes(noticeType)) {
this.$router.push("/boxSea/shippingSea/" + row.id);
}
if ([5, 6, 7].includes(noticeType)) {
this.$router.push("/boxSea/query/" + row.id);
}
this.closeDialog();
break;
}
if (["editLadingBill", "cost", "error"].includes(command)) {
......
......@@ -55,6 +55,10 @@
<p class="box-weight">
{{getSectionInfo}}
</p>
<div style="margin-left:30px;">
<el-button type="primary" size="small" @click="()=>updateStatus('selected')">{{$t('更新所选订单状态')}}</el-button>
<el-button type="primary" size="small" @click="()=>updateStatus('all')">{{$t('更新全部订单状态')}}</el-button>
</div>
<div class="document-status">
<p>{{$t('单证状态')}}</p>
<template v-for="(item, index) in getDocStatus(sectionObj.sectionOrderList)">
......@@ -62,7 +66,8 @@
</template>
</div>
</div>
<el-table :data="sectionObj.sectionOrderList" style="width: 100%" border>
<el-table :data="sectionObj.sectionOrderList" style="width: 100%" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" :selectable="selectable"></el-table-column>>
<el-table-column type="index" align="center" :label="$t('序号')" width="50" />
<el-table-column prop="orderNo" :label="$t('订单号')" align="center">
<template v-slot="scope">
......@@ -93,6 +98,11 @@
</template>
</el-table-column>
<el-table-column prop="customsFee" :label="$t('报关费用')" align="center"></el-table-column>
<el-table-column prop="" :label="$t('操作')" align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" :disabled="scope.row.abnormalDealStatus === 1" @click="()=>updateStatus('single', scope.row)">{{$t('更新状态')}}</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane :label="$t('状态')" name="status">
......@@ -137,7 +147,7 @@
<el-tab-pane :label="$t('异常')" name="error">
<el-table :data="errorList" style="width: 100%" border>
<el-table-column type="index" align="center" :label="$t('序号')" width="50" />
<el-table-column prop="opStep" :label="$t('操作步骤')" align="center">
<el-table-column prop="opStep" :label="$t('操作')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PROCESS" :value="scope.row.opStep" />
</template>
......@@ -147,8 +157,9 @@
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_TICKET_EXCEPTION" :value="scope.row.opStep" />
</template>
</el-table-column>
<el-table-column prop="abnDetail" :label="$t('异常详情')" align="center" width="800"></el-table-column>
<el-table-column prop="" :label="$t('异常时间')" align="center">
<el-table-column prop="abnDetail" :label="$t('异常描述')" align="center" width="700"></el-table-column>
<el-table-column prop="delayDays" :label="$t('异常延迟天数')" align="center"></el-table-column>
<el-table-column prop="" :label="$t('异常时间')" align="center" width="300">
<template slot-scope="scope">
<span v-if="scope.row.abnStartTime">{{formatDate(scope.row.abnStartTime)}} - </span>
<span v-if="scope.row.abnEndTime">{{formatDate(scope.row.abnEndTime)}}</span>
......@@ -182,6 +193,9 @@
<template v-if="dialogConfig.type === 'error'">
<regError v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" />
</template>
<template v-if="dialogConfig.type === 'updateError'">
<updateError v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :errorInfo="errorInfo" />
</template>
</el-dialog>
</div>
</template>
......@@ -199,8 +213,6 @@ import { getChannelList } from "@/api/ecw/channel";
import { getCabinetPage } from "@/api/ecw/cabinet";
import { getWarehouseList } from "@/api/ecw/warehouse";
import {
getSeaStatus,
getStatusName,
getTotlContent,
formatDate,
serviceMsg,
......@@ -212,6 +224,7 @@ import { getSupplierPage } from "@/api/ecw/supplier";
import costForm from "./costForm.vue";
import regError from "./regError.vue";
import editForm from "./editForm.vue";
import updateError from "./updateError.vue";
export default {
name: "boxDetail",
......@@ -222,6 +235,7 @@ export default {
costForm,
regError,
editForm,
updateError,
},
created() {
this.transportTypes = this.getDictDatas(
......@@ -276,18 +290,85 @@ export default {
{ title: this.$t("预装单"), serviceName: "downloadPreloadGoodsList" },
{ title: this.$t("已装单"), serviceName: "downloadLoadGoodsList" },
{ title: this.$t("应收汇总表"), serviceName: "downloadReceivableList" },
{ title: this.$t("提货单"), serviceName: "zipDownload", fileFormat: "zip" },
{
title: this.$t("提货单"),
serviceName: "zipDownload",
fileFormat: "zip",
},
{
title: "agent list",
serviceName: "downloadAgentListFiles",
type: "url",
},
{ title: "soncap", serviceName: "downloadSoncapFiles", type: "url" },
{ title: this.$t("提单Copy"), serviceName: "downloadLadingCopy", type: "url" },
{
title: this.$t("提单Copy"),
serviceName: "downloadLadingCopy",
type: "url",
},
],
// 选中行
selectedRows: [],
// 修改异常
errorInfo: {
orderList: [],
},
};
},
methods: {
selectable(row, index) {
if (row.abnormalDealStatus === 1) return false;
return true;
},
/* 全选 */
handleSelectionChange(selected) {
this.selectedRows = selected;
},
/* 更新状态 */
updateStatus(type, row) {
let orders = [];
if (type === "selected") {
if (!this.selectedRows.length) {
this.$message.error("请选择需要更新的订单");
return;
}
orders = this.selectedRows;
} else if (type === "all") {
// 筛选未处理的订单
orders = this.sectionObj.sectionOrderList.filter(
(item) => item.abnormalDealStatus === 0
);
if (!orders.length) {
this.$message.error("没有订单需要更新");
return;
}
} else if (type === "single") {
orders = [row];
}
this.getErrorType();
this.$set(this.errorInfo, "orderList", orders);
// 判断异常类型
this.handleCommand("updateError");
},
getErrorType() {
for (const [key, value] of Object.entries(this.shipmentObj)) {
// 报关异常 customsInfo
if (key === "customsInfo" && value.hasAbnormal) {
this.$set(this.errorInfo, "errorType", "customs");
this.$set(this.dialogConfig, "title", this.$t("更新报关异常状态"));
}
// 起运异常 shippingInfo
if (key === "shippingInfo" && value.hasAbnormal) {
this.$set(this.errorInfo, "errorType", "shipping");
this.$set(this.dialogConfig, "title", this.$t("更新起运异常状态"));
}
// 到港异常 arrivalInfo
if (key === "arrivalInfo" && value.hasAbnormal) {
this.$set(this.errorInfo, "errorType", "arrival");
this.$set(this.dialogConfig, "title", this.$t("更新到港异常状态"));
}
}
},
// 初始化字典数据
initData() {
// 查询渠道
......@@ -316,7 +397,7 @@ export default {
this.sectionList = res.data.map((item, index) => {
return {
...item,
title: this.$t('第{index}部分', {index: index + 1}),
title: this.$t("第{index}部分", { index: index + 1 }),
};
});
});
......@@ -363,7 +444,7 @@ export default {
// 供应商
getSupplier(id) {
let arr = this.allSupplier.find((item) => item.id == id) ?? {};
return this.$l(arr, 'company');
return this.$l(arr, "company");
},
editCostClick(row) {
this.costDetail = row;
......@@ -401,15 +482,19 @@ export default {
this.$set(this.dialogConfig, "title", this.$t("费用登记"));
this.$set(this.dialogConfig, "type", "cost");
break;
case "error":
this.$set(this.dialogConfig, "visible", true);
this.$set(this.dialogConfig, "title", this.$t("异常登记"));
this.$set(this.dialogConfig, "type", "error");
break;
case "delete":
this.$modal
.confirm(
$t('是否确认删除出货编号为 {no} 的数据项?', {no: this.shipmentObj.selfNo})
this.$t("是否确认删除出货编号为 {no} 的数据项?", {
no: this.shipmentObj.selfNo,
})
)
.then(() => {
return deletebox(this.shipmentId);
......@@ -430,6 +515,11 @@ export default {
})
.catch(() => {});
break;
case "updateError":
this.$set(this.dialogConfig, "visible", true);
this.$set(this.dialogConfig, "type", "updateError");
break;
}
},
// 关闭弹框
......@@ -446,6 +536,9 @@ export default {
this.errorList = res.data;
});
}
if (type === "detail") {
this.getBoxGoodsDetail();
}
},
formatDate,
downloadDetailFile(row) {
......@@ -483,7 +576,7 @@ export default {
return (shippingChannelId) => {
for (const channelItem of this.channelList) {
if (channelItem.channelId == shippingChannelId) {
return this.$l(channelItem, 'name');
return this.$l(channelItem, "name");
}
}
};
......@@ -498,20 +591,14 @@ export default {
}
};
},
/* 状态 */
getBoxStatus() {
return (shippingVO) => {
return getStatusName(getSeaStatus(shippingVO));
};
},
/* 总计 */
getBoxSum() {
return (boxStatistics) => {
if (boxStatistics) {
return this.$t("{num}箱 {volum}m³", {
num: boxStatistics.num ?? 0,
volume: boxStatistics.weight ?? 0
})
volume: boxStatistics.weight ?? 0,
});
/* `${boxStatistics.num ?? 0} ${boxStatistics.volume ?? 0}m3 ${
boxStatistics.weight ?? 0
}kg`; */
......@@ -523,7 +610,7 @@ export default {
getCityName() {
return (id) => {
let arr = this.warehouseList.filter((item) => item.id == id);
return arr.length > 0 ? this.$l(arr[0], 'title') : this.$t("无");
return arr.length > 0 ? this.$l(arr[0], "title") : this.$t("无");
};
},
// 部分信息
......
......@@ -17,12 +17,17 @@
<el-form-item :label="$t('异常情况')">
<el-input v-model="errorObj.abnDetail" type="textarea" rows="2" :placeholder="$t('请输入异常情况')"></el-input>
</el-form-item>
<el-form-item :label="$t('异常时间')" prop="arrivalTime" class="two-element">
<el-form-item :label="$t('异常时间')" prop="arrivalTime" class="three-element">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="errorObj.abnStartTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="errorObj.abnEndTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<div class="delayTime">延迟时间:{{delayDay}}</div>
</el-form-item>
<el-form-item :label="$t('是否更新订单状态')">
<el-form-item :label="$t('通知人')">
<userSelect v-model="errorObj.notifyUsers" :placeholder="$t('请选择通知人')" :allUsers="this.$attrs.allUsers" multiple />
</el-form-item>
<!-- <el-form-item :label="$t('是否更新订单状态')">
<el-radio-group v-model="errorObj.orderStatus">
<el-radio v-for="item in status" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
......@@ -32,7 +37,7 @@
</el-form-item>
<el-form-item :label="$t('英文内容')">
<el-input v-model="errorObj.contentEn" type="textarea" rows="2" :placeholder="$t('请输入英文内容')"></el-input>
</el-form-item>
</el-form-item> -->
</el-form>
<el-row class="operate-button">
......@@ -45,12 +50,16 @@
<script>
import { abnormalCreate } from "@/api/ecw/boxSea";
import { serviceMsg } from "./shippingSea/utils";
import userSelect from "./shippingSea/nodePage/common/userSelect.vue";
import dayjs from "dayjs";
/**
* 异常登记
*/
export default {
name: "regError",
inheritAttrs: false,
components: { userSelect },
data() {
return {
// 异常对象
......@@ -66,23 +75,47 @@ export default {
label: this.$t(""),
},
],
flag: 'sea'
flag: "sea",
delayDay: 0,
};
},
created() {
const { currNode } = this.$attrs;
this.errorObj = { opStep: currNode?.dataKey ?? undefined };
if(this.$attrs.shipmentObj.bosType == 'seaAir'){
this.flag = 'seaAir';
if (this.$attrs.shipmentObj.bosType == "seaAir") {
this.flag = "seaAir";
}
},
watch: {
// 异常开始时间
"errorObj.abnStartTime"(val) {
this.compareDate(val, this.errorObj.abnEndTime);
},
// 异常结束时间
"errorObj.abnEndTime"(val) {
this.compareDate(this.errorObj.abnStartTime, val);
},
},
methods: {
// 时间比较
compareDate(abnStartTime, abnEndTime) {
this.delayDay = 0;
let date1 = null,
date2 = null;
if (abnStartTime) date1 = dayjs(abnStartTime);
if (abnEndTime) date2 = dayjs(abnEndTime);
if (date1 && date2) {
this.delayDay = date2.diff(date1, "day");
}
},
/** 提交 */
onSubmit() {
this.$refs["errorForm"].validate((valid) => {
if (valid) {
abnormalCreate({
...this.errorObj,
delayDays: this.delayDay,
notifyUsers: this.errorObj.notifyUsers?.join(",") ?? "",
shipmentId: this.$attrs.shipmentObj.id,
}).then((res) => {
serviceMsg(res, this).then(() => {
......@@ -108,18 +141,14 @@ export default {
.operate-button {
text-align: center;
}
.two-element-formItem {
display: flex;
> :last-child {
width: 100%;
margin-left: 10px;
}
}
.two-element {
.three-element {
.el-form-item__content {
display: flex;
> :last-child {
margin-left: 10px;
> .el-date-editor {
margin-right: 10px;
}
> .delayTime {
width: 300px;
}
}
}
......
......@@ -93,7 +93,6 @@
import { approvalDetail } from "@/api/ecw/box";
import {
getSeaStatus,
getStatusName,
getTotlContent,
} from "./shippingSea/utils";
import { getCabinetPage } from "@/api/ecw/cabinet";
......@@ -196,12 +195,6 @@ export default {
}
};
},
/* 货柜状态 */
getCabinetStatus() {
return (shippingVO) => {
return getStatusName(getSeaStatus(shippingVO));
};
},
/* 体积重量 */
getVolumeWeight() {
return (total) => {
......
......@@ -24,7 +24,7 @@
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('票异常')" :visible.sync="dialogVisible" width="700px" :modal-append-to-body=false append-to-body destroy-on-close>
<regError @closeDialog="dialogVisible = false" v-bind="$attrs" />
<regError @closeDialog="regCloseDialog" v-bind="$attrs" />
</el-dialog>
</div>
</template>
......@@ -50,12 +50,17 @@ export default {
arrivalObj: {},
// 校验
rules: {
apRealTime: [{ required: true, message: this.$t("必填"), trigger: "change" }],
apRealTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
},
// 弹窗配置
dialogVisible: false,
// 提示消息
showMsg: false,
inspectionTimeArrival: this.getDictDatas(
this.DICT_TYPE.BOX_INSPECTION_TIME_ARRIVAL
)[0].value,
};
},
created() {
......@@ -76,11 +81,19 @@ export default {
},
},
methods: {
regCloseDialog(type) {
this.dialogVisible = false;
if (type === "error") {
this.$emit("getBoxInfo");
}
},
// 获取预计到港时间
getExpectedTime() {
const { shippingInfo } = this.$attrs.shipmentObj;
if (shippingInfo) {
return dayjs(shippingInfo.dtEstArrivalTime).format("YYYY-MM-DD HH:mm:ss");
return dayjs(shippingInfo.dtEstArrivalTime).format(
"YYYY-MM-DD HH:mm:ss"
);
}
return null;
},
......@@ -93,7 +106,7 @@ export default {
if (apConfirmTime) date2 = dayjs(apConfirmTime);
if (date1 && date2) {
const days = date2.diff(date1, "day");
if (days > 5) {
if (days > this.inspectionTimeArrival) {
this.showMsg = true;
}
}
......
......@@ -35,6 +35,9 @@
<el-form-item :label="$t('截关时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cusDeclarationObj.dcCutOffTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('报关时间')" prop="dcDecTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cusDeclarationObj.dcDecTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('状态')" prop="dcCustomsStatus">
<el-radio-group v-model="cusDeclarationObj.dcCustomsStatus" :disabled="inReview || isCheckDeal('status')">
<el-radio v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_DCCUSTOMS_STATUS)" :key="item.value" :label="item.value">{{item.label}}</el-radio>
......@@ -88,6 +91,7 @@
<el-button type="success" v-if="!inReview" @click="onSubmit(2)" :disabled="isCheckDeal('submit')">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button type="primary" @click="extraCost" v-show="cusDeclarationObj.dcCustomsStatus === '2' || cusDeclarationObj.dcCustomsStatus === '3'">{{$t('额外费用')}}</el-button>
<el-button type="primary" @click="exceptionReg" :disabled="!isShowError">{{$t('异常登记')}}</el-button>
</el-row>
<!-- 对话框 -->
......@@ -141,6 +145,11 @@
</el-row>
</el-row>
</el-dialog>
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('票异常')" :visible.sync="regDialogVisible" width="700px" :modal-append-to-body=false append-to-body destroy-on-close>
<regError @closeDialog="regCloseDialog" v-bind="$attrs" :shipmentObj="shipmentObj" />
</el-dialog>
</div>
</template>
......@@ -165,6 +174,8 @@ import {
} from "../utils";
import ImageUpload from "@/components/ImageUpload";
import Decimal from "decimal.js";
import regError from "../../regError";
import dayjs from "dayjs";
/**
* 报关
......@@ -172,7 +183,7 @@ import Decimal from "decimal.js";
export default {
name: "cusDeclaration",
inheritAttrs: false,
components: { supplierSelect, ImageUpload },
components: { supplierSelect, ImageUpload, regError },
props: {
shipmentObj: Object,
},
......@@ -194,6 +205,9 @@ export default {
dcCustomsStatus: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
dcDecTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
},
// 弹窗配置
dialogConfig: {
......@@ -208,6 +222,12 @@ export default {
costList: [],
// 是否审核中
inReview: false,
// 异常登记
regDialogVisible: false,
isShowError: false,
inspectionTimecustoms: this.getDictDatas(
this.DICT_TYPE.BOX_INSPECTION_TIME_CUSTOMS
)[0].value,
};
},
created() {
......@@ -228,15 +248,39 @@ export default {
"dcCutOffTime",
"dcCheckTime",
"dcPassTime",
"dcDecTime",
]);
oldData = formatNumberString(oldData, [
"dcCustomsType",
"dcCustomsStatus",
"dcCheckStatus",
]);
this.cusDeclarationObj = oldData;
},
methods: {
regCloseDialog(type) {
this.regDialogVisible = false;
if (type === "error") {
this.$emit("getBoxInfo");
}
},
// 时间比较
compareDate(dcDecTime, dcPassTime) {
this.isShowError = false;
let date1 = null,
date2 = null;
if (dcDecTime) date1 = dayjs(dcDecTime);
if (dcPassTime) date2 = dayjs(dcPassTime);
if (date1 && date2) {
const delayDay = date2.diff(date1, "day");
if (delayDay >= this.inspectionTimecustoms) this.isShowError = true;
}
},
// 异常登记
exceptionReg() {
this.regDialogVisible = true;
},
/* 跳转订单详情 */
jumpOrderDetail(row) {
this.$router.push({
......@@ -520,6 +564,20 @@ export default {
}
},
},
// 报关时间
"cusDeclarationObj.dcDecTime"(val) {
this.compareDate(val, this.cusDeclarationObj.dcPassTime);
},
// 放行时间
"cusDeclarationObj.dcPassTime"(val) {
this.compareDate(this.cusDeclarationObj.dcDecTime, val);
},
// 查验状态
"cusDeclarationObj.dcCheckStatus"(val) {
if (val !== this.cusDeclarationObj.dcCheckStatus) {
this.$set(this.cusDeclarationObj, "dcPassTime", "");
}
},
},
computed: {
/* 获取报关审核退场状态文字 */
......
......@@ -19,12 +19,12 @@
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button type="primary" @click="exceptionReg" :disabled="!showMsg">{{$t('异常登记')}}</el-button>
<el-button type="primary" @click="exceptionReg" :disabled="!isShowError">{{$t('异常登记')}}</el-button>
</el-row>
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('票异常')" :visible.sync="dialogVisible" width="700px" :modal-append-to-body=false append-to-body destroy-on-close>
<regError @closeDialog="dialogVisible = false" v-bind="$attrs" />
<regError @closeDialog="regCloseDialog" v-bind="$attrs" />
</el-dialog>
</div>
</template>
......@@ -56,6 +56,11 @@ export default {
dialogVisible: false,
// 提示消息
showMsg: false,
// 异常登记
isShowError: false,
inspectionTimeShipping: this.getDictDatas(
this.DICT_TYPE.BOX_INSPECTION_TIME_SHIPPING
)[0].value,
};
},
created() {
......@@ -69,9 +74,16 @@ export default {
// 实际开船时间
"departureObj.dtRealShipTime"(val) {
this.compareDate(val, this.getSailingTime());
this.compareDate1(val, this.getSailingTime());
},
},
methods: {
regCloseDialog(type) {
this.dialogVisible = false;
if (type === "error") {
this.$emit("getBoxInfo");
}
},
// 时间比较
compareDate(dtRealShipTime, sailTime) {
this.showMsg = false;
......@@ -83,6 +95,17 @@ export default {
this.showMsg = true;
}
},
compareDate1(dtRealShipTime, sailTime) {
this.isShowError = false;
let date1 = null,
date2 = null;
if (dtRealShipTime) date1 = dayjs(dtRealShipTime);
if (sailTime) date2 = dayjs(sailTime);
if (date1 && date2) {
const delayDay = date1.diff(date2, "day");
if (delayDay >= this.inspectionTimeShipping) this.isShowError = true;
}
},
// 异常登记
exceptionReg() {
this.dialogVisible = true;
......
......@@ -236,6 +236,10 @@ export default {
if (end.includes(val[keyName])) {
node.currStatus = "end";
// 判断是否存在异常未处理
if (val[voName].hasAbnormal) {
continue;
}
// 报关
if (type === "cusDeclaration") {
const { dcCustomsStatus, dcCheckStatus } = val;
......
......@@ -45,7 +45,7 @@ import { getDockPage } from "@/api/ecw/dock";
import { listUser } from "@/api/system/user";
// 这里引入的数据切换语言后要刷新才生效,优化办法是label同时配备labelEn字段,然后再页面上用$l函数调用
import { getSeaStatus, getStatusName, seaBaseData } from "./utils";
import { seaBaseData } from "./utils";
/**
* 海运操作主页面
*/
......@@ -115,12 +115,6 @@ export default {
});
},
},
watch: {
/* 监听发货对象 */
shipmentObj(val) {
// this.statusLabel = getStatusName(getSeaStatus(val));
},
},
};
</script>
......
......@@ -4,79 +4,6 @@ import FileSaver from "file-saver";
import Decimal from "decimal.js";
import i18n from "@/i18n";
/**
* 节点状态值
*
* @return {*}
*/
function getStatusName(statu) {
const statusName = new Map();
statusName.set(11, i18n.$t("未订舱"));
statusName.set(12, i18n.$t("已订舱"));
statusName.set(21, i18n.$t("未预装"));
statusName.set(22, i18n.$t("预装中"));
statusName.set(23, i18n.$t("预装审核中"));
statusName.set(24, i18n.$t("预装审核失败"));
statusName.set(25, i18n.$t("预装审核成功"));
statusName.set(2111, i18n.$t("未理货"));
statusName.set(2112, i18n.$t("已理货"));
statusName.set(31, i18n.$t("未派车"));
statusName.set(32, i18n.$t("已派车"));
statusName.set(41, i18n.$t("未装柜"));
statusName.set(42, i18n.$t("装柜中"));
statusName.set(43, i18n.$t("已装柜、待封柜"));
statusName.set(44, i18n.$t("封柜审核中"));
statusName.set(45, i18n.$t("封柜审核失败"));
statusName.set(46, i18n.$t("封柜审核成功"));
statusName.set(47, i18n.$t("已封柜,待出仓"));
statusName.set(51, i18n.$t("未报关"));
statusName.set(52, i18n.$t("报关中"));
statusName.set(53, i18n.$t("已报关"));
statusName.set(61, i18n.$t("未配船"));
statusName.set(62, i18n.$t("已配船"));
statusName.set(71, i18n.$t("未提单补料"));
statusName.set(72, i18n.$t("已提单补料"));
statusName.set(81, i18n.$t("未驳船"));
statusName.set(82, i18n.$t("已驳船"));
statusName.set(91, i18n.$t("未起运"));
statusName.set(92, i18n.$t("已起运"));
statusName.set(101, i18n.$t("未上传"));
statusName.set(102, i18n.$t("已上传"));
statusName.set(111, i18n.$t("未清关文件"));
statusName.set(112, i18n.$t("已清关文件"));
statusName.set(121, i18n.$t("未到港"));
statusName.set(122, i18n.$t("已到港"));
statusName.set(131, i18n.$t("未清关"));
statusName.set(132, i18n.$t("已清关"));
statusName.set(181, i18n.$t("未卸柜"));
statusName.set(182, i18n.$t("卸柜中"));
statusName.set(183, i18n.$t("卸柜审核中"));
statusName.set(184, i18n.$t("卸柜审核失败"));
statusName.set(185, i18n.$t("卸柜审核成功"));
statusName.set(186, i18n.$t("已卸柜"));
statusName.set(191, i18n.$t("未结算"));
statusName.set(192, i18n.$t("结算中"));
statusName.set(193, i18n.$t("已结算"));
return statusName.get(statu);
}
/**
* 海运流程
*
......@@ -1537,7 +1464,6 @@ function downloadFileByUrl(funName, params) {
}
export {
getStatusName,
getColmnMapping,
getSeaStatus,
seaBaseData,
......
......@@ -44,7 +44,7 @@ import { getSupplierPage } from "@/api/ecw/supplier";
import { getChannelList } from '@/api/ecw/channel';
import { getDockPage } from "@/api/ecw/dock";
import { listUser } from "@/api/system/user";
import { getSeaStatus, getStatusName, seaAirBaseData } from "../shippingSea/utils";
import { seaAirBaseData } from "../shippingSea/utils";
import {arrryToKeyedObjectBy} from '@/utils/index'
/**
......@@ -130,12 +130,6 @@ export default {
});
},
},
watch: {
/* 监听发货对象 */
shipmentObj(val) {
this.statusLabel = getStatusName(getSeaStatus(val));
},
},
};
</script>
......
<template>
<div class="shipping-update-error">
<!-- 更新报关异常状态 -->
<div class="message-title">{{headerTitle}}</div>
<el-form ref="updateErrorForm" :rules="rules" :model="updateObj" label-width="140px">
<el-form-item :label="$t('更新类型')" prop="type">
<el-radio-group v-model="updateObj.type">
<el-radio v-for="item in this.getDictDatas(this.DICT_TYPE.BOX_SHIPPING_UPDATE_TYPE)" :key="item.value" :label="item.value">{{$l(item, 'label')}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('更新订单状态')">
<el-radio-group v-model="updateObj.updateOrder">
<el-radio v-for="item in types" :key="item.value" :label="item.value">{{$l(item, 'label')}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="customize">
<el-input v-model="updateObj.customize" :placeholder="$t('请输入')" :disabled="!isEnter"></el-input>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { updateAbnormalOrder } from "@/api/ecw/box";
import { serviceMsg } from "./shippingSea/utils";
export default {
name: "updateError",
inheritAttrs: false,
components: {},
props: {
shipmentObj: Object,
errorInfo: Object,
},
data() {
return {
updateObj: {},
rules: {
type: [{ required: true, message: this.$t("必填"), trigger: "change" }],
},
types: [],
isEnter: false,
headerTitle: "",
};
},
methods: {
onSubmit() {
this.$refs["updateErrorForm"].validate((valid) => {
if (valid) {
let text = "";
// 自定义
if (this.updateObj.updateOrder === "0") {
text = this.updateObj.customize;
} else {
const dict = this.types.find(
(item) => item.value === this.updateObj.updateOrder
);
text = this.$l(dict, "label");
}
const { orderList } = this.errorInfo;
updateAbnormalOrder({
shipmentId: this.shipmentObj.id,
orderIdList: orderList.map((item) => item.orderId) ?? [],
type: this.updateObj.type,
text,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.$emit("closeDialog", "detail");
});
});
}
});
},
cancel() {
this.$emit("closeDialog");
},
},
watch: {
errorInfo: {
handler: function (val) {
const { errorType, orderList } = val;
this.headerTitle = this.$t("确定给{selfNo}下的{orderNos}更新状态吗?", {
selfNo: this.shipmentObj.selfNo,
orderNos: orderList.map((item) => item.orderNo).join(",") ?? "",
});
switch (errorType) {
// 报关异常
case "customs":
this.types = this.getDictDatas(
this.DICT_TYPE.BOX_CUSTOMS_ERROR_TYPE
);
break;
case "shipping":
this.types = this.getDictDatas(
this.DICT_TYPE.BOX_SHIPPING_ERROR_TYPE
);
break;
case "arrival":
this.types = this.getDictDatas(
this.DICT_TYPE.BOX_ARRIVAL_ERROR_TYPE
);
break;
}
},
immediate: true,
},
"updateObj.updateOrder"(val) {
if (val === "0") {
this.isEnter = true;
this.rules.customize = [
{ required: true, message: this.$t("必填"), trigger: "change" },
];
} else {
this.isEnter = false;
this.rules.customize = [];
this.$refs["updateErrorForm"].clearValidate("customize");
}
},
},
};
</script>
<style lang="scss" scoped>
.shipping-update-error {
.message-title {
text-align: center;
font-size: 20px;
margin: 0 20px 10px;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment