Commit 2d7a8e08 authored by huhaiqing's avatar huhaiqing

海运开发

parent 35da61a1
......@@ -275,6 +275,28 @@ export function clearanceCreate(data) {
});
}
/**
* 卸柜
*
* @export
* @param {*} data
* @return {*}
*/
export function unloadCreate(data) {
if (data.id) {
return request({
url: "/ecw/box-cabinet-unload/update",
method: "put",
data,
});
}
return request({
url: "/ecw/box-cabinet-unload/create",
method: "post",
data,
});
}
/**
* 结算
*
......@@ -283,6 +305,13 @@ export function clearanceCreate(data) {
* @return {*}
*/
export function settlementCreate(data) {
if (data.id) {
return request({
url: "/ecw/box-settlement/update",
method: "put",
data,
});
}
return request({
url: "/ecw/box-settlement/create",
method: "post",
......@@ -290,6 +319,21 @@ export function settlementCreate(data) {
});
}
/**
* 出货审核
*
* @export
* @param {*} data
* @return {*}
*/
export function approvalCreate(data) {
return request({
url: "/ecw/box-approval/create",
method: "post",
data,
});
}
/***************************** 预装 start **********************************/
/**
......
......@@ -247,8 +247,8 @@
<el-row style="margin-top: 15px">
<el-row>
<el-form ref="operatorForm" :model="operatorData" size="small" :inline="true" label-width="120px" :rules="rules">
<el-form-item label="目的地操作员" prop="operator">
<userSelect v-model="operatorData.operator" placeholder="请选择目的地操作员" :allUsers="this.$attrs.allUsers" size="small" />
<el-form-item label="目的地操作员" prop="noticeUser">
<userSelect v-model="operatorData.noticeUser" placeholder="请选择目的地操作员" :allUsers="this.$attrs.allUsers" size="small" />
</el-form-item>
</el-form>
</el-row>
......@@ -269,6 +269,7 @@ import {
serviceMsg,
createGoods,
deleteGoods,
approvalCreate,
} from "@/api/ecw/boxSea";
import userSelect from "./common/userSelect.vue";
......@@ -310,12 +311,10 @@ export default {
queryParams: {},
pageParam: { pageNo: 1, pageSize: 5 },
// 目的地操作员
operatorData: {
operator: null,
},
operatorData: {},
// 校验
rules: {
operator: [{ required: true, message: "必填", trigger: "change" }],
noticeUser: [{ required: true, message: "必填", trigger: "change" }],
},
// 出货信息
shipmentObj: this.$attrs.shipmentObj,
......@@ -392,7 +391,16 @@ export default {
onSubmit() {
this.$refs["operatorForm"].validate((valid) => {
if (valid) {
alert("submit!");
approvalCreate({
...this.operatorData,
shipmentId: this.$attrs.shipmentObj.id,
approvalStatus: 0,
approvalType: 1,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.$emit("closeDialog", "submit");
});
});
}
});
},
......
<template>
<div>
<el-form ref="reviewForm" :model="reviewObj" label-width="120px">
<el-form-item label="申请理由">
<el-input v-model="reviewObj.remark" type="textarea" rows="2" placeholder="请输入申请理由"></el-input>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="success" @click="onSubmit">发起申请</el-button>
<el-button @click="cancel">关闭</el-button>
</el-row>
</div>
</template>
<script>
import { approvalCreate } from "@/api/ecw/boxSea";
/**
* 预装反审
*/
export default {
name: "review",
inheritAttrs: false,
data() {
return {
// 反审对象
reviewObj: {},
};
},
methods: {
/** 提交 */
onSubmit() {
this.$refs["reviewForm"].validate((valid) => {
if (valid) {
approvalCreate({
shipmentId: this.$attrs.shipmentObj.id,
...this.reviewObj,
approvalStatus: -1,
approvalType: 1,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
......@@ -19,6 +19,7 @@
<script>
import { settlementCreate, serviceMsg } from "@/api/ecw/boxSea";
import { formatDateStr } from "../utils";
/**
* 结算
*/
......@@ -31,6 +32,12 @@ export default {
settlementObj: {},
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, ["slSettlementTime", "slSettledTime"]);
this.settlementObj = oldData;
},
methods: {
/** 提交 */
onSubmit(operateType) {
......@@ -42,15 +49,15 @@ export default {
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel();
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel() {
this.$emit("closeDialog");
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
......
......@@ -2,8 +2,7 @@
<div>
<el-form ref="unloadingForm" :model="unloadingObj" label-width="100px">
<el-form-item label="网点">
<el-select v-model="unloadingObj.ulOutletsId" placeholder="请选择网点">
</el-select>
<dockSelect v-model="unloadingObj.ulOutletsId" placeholder="请选择网点" :allDocks="this.$attrs.allDocks" />
</el-form-item>
<el-form-item label="到仓时间">
<el-date-picker type="date" placeholder="请选择日期" v-model="unloadingObj.ulWarehouseTime" value-format="yyyy-MM-dd"></el-date-picker>
......@@ -29,8 +28,9 @@
<script>
import startUnloading from "./startUnloading.vue";
import { clearanceCreate, serviceMsg } from "@/api/ecw/boxSea";
import { unloadCreate, serviceMsg } from "@/api/ecw/boxSea";
import { formatDateStr } from "../../utils";
import dockSelect from "../common/dockSelect.vue";
/**
* 卸柜
......@@ -38,7 +38,7 @@ import { formatDateStr } from "../../utils";
export default {
name: "unloading",
inheritAttrs: false,
components: { startUnloading },
components: { startUnloading, dockSelect },
data() {
return {
// 清关对象
......@@ -65,7 +65,7 @@ export default {
return;
}
}
clearanceCreate({
unloadCreate({
...this.unloadingObj,
shipmentId: this.$attrs.shipmentObj.id,
operateType,
......@@ -79,7 +79,7 @@ export default {
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", "type");
this.$emit("closeDialog", type);
},
// 开始卸柜
startUnloading() {
......
......@@ -32,6 +32,7 @@
import bookingWidget from "./nodePage/booking.vue";
import trailerWidget from "./nodePage/trailer.vue";
import preinstallWidget from "./nodePage/preinstall.vue";
import preinstallReviewWidget from "./nodePage/preinstallReview.vue";
import agentWidget from "./nodePage/agent.vue";
import cabinetWidget from "./nodePage/cabinet/index.vue";
import cusDeclarationWidget from "./nodePage/cusDeclaration.vue";
......@@ -69,6 +70,7 @@ export default {
cusClearanceWidget,
unloadingWidget,
settlementWidget,
preinstallReviewWidget,
},
props: {
shipmentObj: Object,
......@@ -87,8 +89,6 @@ export default {
currentComponent: "",
// 当前步骤节点坐标
currIndex: 0,
// 当前步骤节点状态
currNodeStatus: "",
// 当前节点
currNode: {},
};
......@@ -104,10 +104,10 @@ export default {
},
/** 节点点击 */
nodeClick(currIndex, node) {
if (currIndex > this.currIndex) {
/* if (currIndex > this.currIndex) {
this.$message.error("请先完成上一步");
return;
}
} */
this.currNode = node;
this.currentComponent = `${node.type}Widget`;
this.$set(this.dialogConfig, "width", "500px");
......@@ -128,8 +128,16 @@ export default {
break;
// 预装
case "preinstall":
// 预装反审
const status = this.shipmentObj[node.keyName];
if ([23, 24].includes(status)) {
this.currentComponent = `preinstallReviewWidget`;
this.$set(this.dialogConfig, "width", "700px");
this.$set(this.dialogConfig, "title", "预装反审");
} else {
this.$set(this.dialogConfig, "fullscreen", true);
this.$set(this.dialogConfig, "title", "出货安排(预装)");
}
break;
}
this.$set(this.dialogConfig, "dialogVisible", true);
......@@ -158,17 +166,14 @@ export default {
if (start.includes(val[keyName]) && val[voName]) {
node.currStatus = "wait";
this.currNodeStatus = val[keyName];
}
if (wait.includes(val[keyName])) {
node.currStatus = "wait";
this.currNodeStatus = val[keyName];
}
if (end.includes(val[keyName])) {
node.currStatus = "end";
this.currNodeStatus = val[keyName];
// 已完成节点个数
++nodeIndex;
}
......@@ -180,10 +185,6 @@ export default {
}
}
},
/* 监听当前状态 */
currNodeStatus(val) {
this.$emit("setStatus", val);
},
},
};
</script>
......
......@@ -392,6 +392,7 @@ export default {
case "warehouse":
val = this.getWarehouse(Number(val));
break;
case "shipping_dcCustoms_status":
case "shipping_customs_type":
val = this.getDict(type, String(val));
break;
......@@ -411,9 +412,7 @@ export default {
);
},
getDock(id) {
return (
this.$attrs.allDocks.find((item) => item.id === id)?.titleZh ?? id
);
return this.$attrs.allDocks.find((item) => item.id === id)?.titleZh ?? id;
},
getWarehouse(id) {
return (
......
......@@ -26,7 +26,7 @@
</el-card>
<!-- 海运流程图 -->
<seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :warehouseList="warehouseList" @setStatus="setStatus" @getBoxInfo="getBoxInfo" />
<seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :warehouseList="warehouseList" @getBoxInfo="getBoxInfo" />
<!-- 海运步骤图 -->
<seaStepDetail :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :warehouseList="warehouseList" />
......@@ -106,10 +106,6 @@ export default {
var arr = this.warehouseList.filter((item) => item.id == id);
return arr.length > 0 ? arr[0].titleZh : "";
},
/* 设置状态值 */
setStatus(status) {
this.statusLabel = statusName.get(status);
},
// 出货
getBoxInfo() {
getbox(this.shipmentId).then((res) => {
......@@ -118,6 +114,41 @@ export default {
});
},
},
watch: {
/* 监听发货对象 */
shipmentObj(val) {
debugger
let currNodeStatus = 11,
isBreak = false;
// 迭代每个节点
for (let i = 0; i < this.seaBaseData.length; i++) {
const nodes = this.seaBaseData[i];
for (let j = 0; j < nodes.length; j++) {
const node = nodes[j];
const { keyName, voName, status } = node;
if (!keyName) continue;
const { start, wait, end } = status;
if (start.includes(val[keyName]) && val[voName]) {
currNodeStatus = val[keyName];
}
if (wait.includes(val[keyName])) {
currNodeStatus = val[keyName];
isBreak = true;
break;
}
if (end.includes(val[keyName])) {
currNodeStatus = val[keyName];
}
}
if (isBreak) break;
}
console.log(currNodeStatus)
this.statusLabel = statusName.get(currNodeStatus);
},
},
};
</script>
......
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