Commit 01afc6b9 authored by Marcus's avatar Marcus

Merge remote-tracking branch 'origin/dev' into dev

parents dea225b1 beea31e7
......@@ -117,7 +117,7 @@
<el-button type="primary" @click="handlerClick('modifyCabinet','修改柜信息')">修改柜信息</el-button>
</div>
<div v-if="isUnderReview">
<el-button type="primary" :disabled=true>封柜审核中</el-button>
<el-button type="primary" @click="jumpReviewDetail">封柜审核中</el-button>
<el-button plain type="primary" @click="canclAudit">取消审核</el-button>
<el-button plain type="primary" @click="$emit('closeDialog')">返回</el-button>
</div>
......@@ -220,6 +220,7 @@ import {
serviceMsg,
getCapacity,
sumStatistics,
toReviewDetail,
} from "../../utils";
import splitOrder from "./splitOrder.vue";
import WorkFlow from "@/components/WorkFlow";
......@@ -519,6 +520,11 @@ export default {
});
});
},
jumpReviewDetail() {
const { cabinetApprovalInfo } = this.shipmentObj;
toReviewDetail.apply(this, [cabinetApprovalInfo.bpmProcessId]);
this.$emit("closeDialog", "close");
},
},
computed: {
/* 是否审核中 */
......
......@@ -30,7 +30,7 @@
<el-date-picker type="datetime" placeholder="请选择日期" v-model="cusDeclarationObj.dcCutOffTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item label="状态" prop="dcCustomsStatus">
<el-radio-group v-model="cusDeclarationObj.dcCustomsStatus">
<el-radio-group v-model="cusDeclarationObj.dcCustomsStatus" :disabled="inReview">
<el-radio v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_DCCUSTOMS_STATUS)" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
......@@ -38,7 +38,7 @@
<!-- 查验 -->
<div v-show="cusDeclarationObj.dcCustomsStatus === '3'">
<el-form-item label="查验">
<el-radio-group v-model="cusDeclarationObj.dcCheckStatus">
<el-radio-group v-model="cusDeclarationObj.dcCheckStatus" :disabled="inReview">
<el-radio v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_CHECK_STATUS)" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
......@@ -70,9 +70,13 @@
</el-form-item>
</el-form>
<el-row class="operate-button" v-if="inReview">
<el-button type="primary" @click="jumpReviewDetail">{{cusDeclarationObj.dcCheckStatus === '1' ? '部分退场审核中' : '全部退场审核中'}}</el-button>
<el-button type="primary" plain @click="canclAudit">{{cusDeclarationObj.dcCheckStatus === '1' ? '取消部分退场审核' : '取消全部退场审核'}}</el-button>
</el-row>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">保存</el-button>
<el-button type="success" @click="onSubmit(2)">提交</el-button>
<el-button type="success" v-if="!inReview" @click="onSubmit(2)">提交</el-button>
<el-button @click="cancel">关闭</el-button>
<el-button type="primary" @click="extraCost" v-show="cusDeclarationObj.dcCustomsStatus === '2' || cusDeclarationObj.dcCustomsStatus === '3'">额外费用</el-button>
</el-row>
......@@ -141,7 +145,12 @@ import {
extraCostUpdate,
approvalCreate,
} from "@/api/ecw/boxSea";
import { formatNumberString, formatDateStr, serviceMsg } from "../utils";
import {
formatNumberString,
formatDateStr,
serviceMsg,
toReviewDetail,
} from "../utils";
import ImageUpload from "@/components/ImageUpload";
/**
......@@ -151,6 +160,9 @@ export default {
name: "cusDeclaration",
inheritAttrs: false,
components: { supplierSelect, ImageUpload },
props: {
shipmentObj: Object,
},
data() {
return {
// 报关对象
......@@ -160,7 +172,9 @@ export default {
dcBoxWgt: [{ required: true, message: "必填", trigger: "change" }],
dcGoodsWgt: [{ required: true, message: "必填", trigger: "change" }],
dcCustomsType: [{ required: true, message: "必填", trigger: "change" }],
dcCustomsStatus: [{ required: true, message: "必填", trigger: "change" }],
dcCustomsStatus: [
{ required: true, message: "必填", trigger: "change" },
],
},
// 弹窗配置
dialogConfig: {
......@@ -173,14 +187,16 @@ export default {
costOrderList: [],
// 额外费用列表
costList: [],
// 是否审核中
inReview: false,
};
},
created() {
const { currNode, shipmentObj } = this.$attrs;
const { currNode } = this.$attrs;
const { voName } = currNode;
let oldData = {
...shipmentObj[voName],
documentInfo: shipmentObj.documentInfo?.split(",") ?? [],
...this.shipmentObj[voName],
documentInfo: this.shipmentObj.documentInfo?.split(",") ?? [],
};
oldData = formatDateStr(oldData, [
"dcCutOffTime",
......@@ -199,36 +215,73 @@ export default {
const newList = Array.from(new Set(documentInfo));
return newList.length > 2 ? "混合报关" : "VGM声明";
},
submitCustomsCreate(operateType) {
customsCreate({
...this.cusDeclarationObj,
shipmentId: this.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
},
/** 提交 */
onSubmit(operateType) {
this.$refs["cusDeclarationForm"].validate((valid) => {
if (valid) {
if (operateType === 1) {
this.submitCustomsCreate(operateType);
return;
// 保存
}
// 提交
const { dcCustomsStatus, dcCheckStatus } = this.cusDeclarationObj;
// 1.状态 报关中/放行 直接提交
if (dcCustomsStatus !== "3") {
this.submitCustomsCreate(operateType);
return;
}
// 2.查验状态,空 直接提交
if (!dcCheckStatus) {
this.submitCustomsCreate(operateType);
return;
}
// 3.查验状态,查验后放行 直接提交
if (dcCheckStatus === "3") {
const { checkExamineStatus } = this.shipmentObj;
// 没有退场审核中的状态
if (checkExamineStatus !== 1) {
this.submitCustomsCreate(operateType);
return;
}
}
// 4.查验状态,退场/部分退场 提示
if (["1", "2"].includes(dcCheckStatus)) {
const { checkExamineStatus } = this.shipmentObj;
// 退场审核状态,1-审核中,2-审核成功,3-审核失败,4-取消
if ([0, 3, 4].includes(checkExamineStatus)) {
this.$modal
.confirm(
`您确认提交${
dcCheckStatus === "1" ? "全部退场" : "部分退场"
}审核吗?`
)
.then(() => {
customsCreate({
...this.cusDeclarationObj,
shipmentId: this.$attrs.shipmentObj.id,
shipmentId: this.shipmentObj.id,
operateType,
}).then((res) => {
// 查验
const { dcCustomsStatus, dcCheckStatus } = this.cusDeclarationObj;
if (dcCustomsStatus === "3") {
// 退场/部分退场
if (["1", "2"].includes(dcCheckStatus)) {
approvalCreate({
approvalStatus: 0,
approvalType: dcCheckStatus === "1" ? 5 : 6, // 5报关全退,6报关部分退
shipmentId: this.$attrs.shipmentObj.id,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
// 触发外层重新查询出货信息
this.$emit("getBoxInfo");
});
});
})
.catch(() => {});
}
} else {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
}
});
}
});
},
......@@ -239,7 +292,7 @@ export default {
return;
}
extraCostOrder({
shipmentId: this.$attrs.shipmentObj.id,
shipmentId: this.shipmentObj.id,
orderNo: this.orderNo,
}).then((res) => {
this.costOrderList = [
......@@ -254,7 +307,7 @@ export default {
/* 查询额外费用订单 */
searchCostList(orderId) {
extraCostList({
shipmentId: this.$attrs.shipmentObj.id,
shipmentId: this.shipmentObj.id,
orderId: orderId,
}).then((res) => {
this.costList = res.data.map((item) => {
......@@ -272,7 +325,7 @@ export default {
fee: row.fee,
orderId: row.orderId,
orderNo: row.orderNo,
shipmentId: this.$attrs.shipmentObj.id,
shipmentId: this.shipmentObj.id,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.searchCostList(row.orderId);
......@@ -321,12 +374,15 @@ export default {
},
// 额外费用
extraCost() {
const { shipmentObj } = this.$attrs;
// 清空额外费用
this.orderNo = "";
this.costOrderList = [];
this.costList = [];
this.$set(this.dialogConfig, "title", `${shipmentObj.selfNo} 报关费用`);
this.$set(
this.dialogConfig,
"title",
`${this.shipmentObj.selfNo} 报关费用`
);
this.$set(this.dialogConfig, "dialogVisible", true);
},
// 计算VGM重量
......@@ -345,6 +401,27 @@ export default {
dcBoxWgtTmp + dcGoodsWgtTmp
);
},
// 审核详情
jumpReviewDetail() {
const { customsApprovalInfo } = this.shipmentObj;
toReviewDetail.apply(this, [customsApprovalInfo.bpmProcessId]);
this.cancel("close");
},
/* 取消审核 */
canclAudit() {
const { currNode, shipmentObj } = this.$attrs;
const { voName } = currNode;
approvalCancel({
applyReason: "取消审核",
id: shipmentObj[voName].id,
shipmentId: shipmentObj.id,
}).then((res) => {
serviceMsg(res, this).then(() => {
// 触发外层重新查询出货信息
this.$emit("getBoxInfo");
});
});
},
},
watch: {
"cusDeclarationObj.dcBoxWgt"(dcBoxWgt) {
......@@ -358,6 +435,18 @@ export default {
this.$set(this.cusDeclarationObj, "dcCheckStatus", "");
}
},
shipmentObj: {
deep: true,
immediate: true,
handler: function (val) {
// 监听查验状态变化
let { checkExamineStatus } = val;
if (checkExamineStatus === 1) {
// 按钮变成审核中
this.inReview = true;
}
},
},
},
};
</script>
......
......@@ -277,7 +277,7 @@
<work-flow xmlkey="shipment_preassemble" v-model="selectedUsers"></work-flow>
</div>
<div v-show="isAudit">
<el-button type="primary" :disabled=true>审核中</el-button>
<el-button type="primary" @click="jumpReviewDetail">审核中</el-button>
<el-button plain type="primary" @click="canclAudit">取消审核</el-button>
<el-button plain type="primary" @click="closeDialog">返回</el-button>
</div>
......@@ -302,7 +302,13 @@ import {
approvalCancel,
} from "@/api/ecw/boxSea";
import userSelect from "./common/userSelect.vue";
import { formatDate, getTotlContent, serviceMsg, getCapacity } from "../utils";
import {
formatDate,
getTotlContent,
serviceMsg,
getCapacity,
toReviewDetail,
} from "../utils";
import dayjs from "dayjs";
import WorkFlow from "@/components/WorkFlow";
......@@ -613,6 +619,11 @@ export default {
});
});
},
jumpReviewDetail() {
const { currNode, shipmentObj } = this.$attrs;
toReviewDetail.apply(this, [shipmentObj[currNode.voName].bpmProcessId]);
this.$emit("closeDialog");
},
},
};
</script>
......
......@@ -56,7 +56,7 @@
</el-table-column>
<el-table-column label="异常状态" align="center" prop="">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleError(scope.row)" icon="el-icon-edit">{{getOrderError(scope.row, 'errorStatus')}}</el-button>
<el-button v-if="scope.row.exceptionList" type="text" size="small" @click="handleError(scope.row)" icon="el-icon-edit">{{getOrderError(scope.row, 'errorStatus')}}</el-button>
</template>
</el-table-column>
<el-table-column label="异常类型" align="center" prop="">
......@@ -100,7 +100,7 @@
<el-button plain type="primary" @click="$emit('closeStart')">返回</el-button>
</div>
<div v-if="isUnderReview">
<el-button type="primary" :disabled=true>卸柜审核中</el-button>
<el-button type="primary" @click="jumpReviewDetail">卸柜审核中</el-button>
<el-button plain type="primary" @click="canclAudit">取消审核</el-button>
<el-button plain type="primary" @click="$emit('closeStart')">返回</el-button>
</div>
......@@ -123,7 +123,7 @@ import {
approvalCancel,
getSectionList,
} from "@/api/ecw/boxSea";
import { serviceMsg, getTotlContent } from "../../utils";
import { serviceMsg, getTotlContent, toReviewDetail } from "../../utils";
import WorkFlow from "@/components/WorkFlow";
/**
......@@ -302,6 +302,11 @@ export default {
path: `/order/pending?id=${row.orderId}`,
});
},
jumpReviewDetail() {
const { cabinetUnloadApprovalInfo } = this.$attrs.shipmentObj;
toReviewDetail.apply(this, [cabinetUnloadApprovalInfo.bpmProcessId]);
this.$emit("closeStart", "close");
},
},
computed: {
/* 是否审核中 */
......
......@@ -20,7 +20,7 @@
<!-- 弹窗 -->
<el-dialog custom-class="shipping-dialog" :title="dialogConfig.title" :visible.sync="dialogConfig.dialogVisible" :width="dialogConfig.width" :fullscreen="dialogConfig.fullscreen" :close-on-click-modal=false :modal-append-to-body=false append-to-body>
<component v-bind:is="currentComponent" v-if="dialogConfig.dialogVisible" @closeDialog="closeDialog" v-bind="$attrs" :shipmentObj="shipmentObj" :currNode="currNode"></component>
<component v-bind:is="currentComponent" v-if="dialogConfig.dialogVisible" @closeDialog="closeDialog" v-bind="$attrs" v-on="$listeners" :shipmentObj="shipmentObj" :currNode="currNode"></component>
</el-dialog>
</div>
</template>
......@@ -178,7 +178,8 @@ export default {
watch: {
/* 监听发货对象 */
shipmentObj(val) {
let newNodes = [];
let newNodes = [],
finish = 0;
// 迭代每个节点
for (let i = 0; i < this.seaBaseData.length; i++) {
const nodes = this.seaBaseData[i];
......@@ -187,6 +188,7 @@ export default {
const node = nodes[j];
const { keyName, voName, status, type } = node;
// agent
if (!keyName && type === "agent") {
if (val[voName]) {
// 已完成agent节点
......@@ -212,6 +214,20 @@ export default {
if (end.includes(val[keyName])) {
node.currStatus = "end";
// 报关
if (type === "cusDeclaration") {
const { dcCustomsStatus, dcCheckStatus } = val;
// 查验状态并且是退场/部分退场
if (dcCustomsStatus === 3 && [1, 2].includes(dcCheckStatus)) {
// 只有审核通过并且已处理才算完成
if (val.checkExamineStatus === 2 && val.checkDealStatus === 1) {
// 已完成节点个数
++nodeIndex;
} else {
continue;
}
}
}
// 已完成节点个数
++nodeIndex;
}
......@@ -219,10 +235,11 @@ export default {
// 如果相等标识该步骤已完成
if (nodeIndex === nodes.length) {
// 加1表示为已完成步骤后一步
this.currIndex = i + 1;
finish = finish + 1;
}
newNodes.push(nodes);
}
this.currIndex = finish;
this.processData = newNodes;
},
},
......
......@@ -1030,6 +1030,18 @@ function serviceMsg(result, _vue) {
});
}
/**
* 跳转审核详情
*
* @param {*} bpmProcessId
*/
function toReviewDetail(bpmProcessId) {
this.$router.push({
path: "/bpm/process-instance/detail",
query: { id: bpmProcessId },
});
}
export {
getStatusName,
getColmnMapping,
......@@ -1044,4 +1056,5 @@ export {
getCapacity,
sumStatistics,
serviceMsg,
toReviewDetail,
};
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