Commit cc1908bb authored by zhoutong's avatar zhoutong

多次到港、清关

parent fa42ec17
......@@ -288,3 +288,76 @@ export function takeoffCreate(data) {
}
/***************************** 起运 end *******************************/
/**
* 获取出货订单列表
*
* @export
* @param {*} data
* @return {*}
*/
export function shipmentOrderList(shipmentId) {
return request({
url: "/shipment/box/shipmentOrderList?shipmentId="+shipmentId,
method: "get"
});
}
/**
* 更新订单到港状态
*
* @export
* @param {*} data
* @return {*}
*/
export function updateOrderArrival(data) {
return request({
url: `/ecw/box-arrival-air/updateOrderArrival`,
method: "post",
data: data
});
}
/**
* 更新所有订单到港状态
*
* @export
* @param {*} data
* @return {*}
*/
export function updateAllOrderArrival(data) {
return request({
url: `/ecw/box-arrival-air/updateAllOrderArrival`,
method: "post",
data: data
});
}
/**
* 更新订单清关状态
*
* @export
* @param {*} data
* @return {*}
*/
export function updateOrderClearance(data) {
return request({
url: `/ecw/box-clearance/updateOrderClearance`,
method: "post",
data: data
});
}
/**
* 更新所有订单清关状态
*
* @export
* @param {*} data
* @return {*}
*/
export function updateAllOrderClearance(data) {
return request({
url: `/ecw/box-clearance/updateAllOrderArrival`,
method: "post",
data: data
});
}
\ No newline at end of file
......@@ -58,10 +58,6 @@
<p class="box-weight">
{{getSectionInfo}}
</p>
<div style="margin-left:30px;">
<el-button type="primary" v-hasPermi="['shipment:box:order:select']" size="small" @click="()=>updateStatus('selected')">{{$t('更新所选订单状态')}}</el-button>
<el-button type="primary" v-hasPermi="['shipment:box:order:all']" 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)">
......@@ -69,8 +65,16 @@
</template>
</div>
</div>
<div style="margin:20px 0 20px 0;">
<el-button type="primary" v-hasPermi="['shipment:box:order:select']" size="small" @click="()=>updateStatus('selected')">{{$t('更新所选订单状态')}}</el-button>
<el-button type="primary" v-hasPermi="['shipment:box:order:all']" size="small" @click="()=>updateStatus('all')">{{$t('更新全部订单状态')}}</el-button>
<el-button type="primary" v-if="shipmentObj.sapStatus==152&&(shipmentObj.airArrivalInfo&&shipmentObj.airArrivalInfo.arriveType==1)" v-hasPermi="['shipment:box:order:select']" size="small" @click="()=>updateArrivalStatus('selected')">{{$t('更新所选订单到港状态')}}</el-button>
<el-button type="primary" v-if="shipmentObj.sapStatus==152&&(shipmentObj.airArrivalInfo&&shipmentObj.airArrivalInfo.arriveType==1)" v-hasPermi="['shipment:box:order:all']" size="small" @click="()=>updateArrivalStatus('all')">{{$t('更新全部订单到港状态')}}</el-button>
<el-button type="primary" v-if="shipmentObj.clStatus==132&&(shipmentObj.clearanceInfo&&shipmentObj.clearanceInfo.clearanceType==1)" v-hasPermi="['shipment:box:order:select']" size="small" @click="()=>updateClearStatus('selected')">{{$t('更新所选订单清关状态')}}</el-button>
<el-button type="primary" v-if="shipmentObj.clStatus==132&&(shipmentObj.clearanceInfo&&shipmentObj.clearanceInfo.clearanceType==1)" v-hasPermi="['shipment:box:order:all']" size="small" @click="()=>updateClearStatus('all')">{{$t('更新全部订单清关状态')}}</el-button>
</div>
<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="selection" width="50"></el-table-column>>
<el-table-column align="center" :label="$t('序号')" width="50" prop="tidanNum" />
<el-table-column prop="orderNo" :label="$t('订单号')" align="center">
<template v-slot="scope">
......@@ -203,6 +207,12 @@
<template v-if="dialogConfig.type === 'updateError'">
<updateError v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :errorInfo="errorInfo" />
</template>
<template v-if="dialogConfig.type === 'updateArrival'">
<updateArrival v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :arrivalInfo="arrivalInfo" />
</template>
<template v-if="dialogConfig.type === 'updateClear'">
<updateClear v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :clearInfo="clearInfo" />
</template>
</el-dialog>
</div>
</template>
......@@ -232,6 +242,8 @@ import costForm from "./costForm.vue";
import regError from "./regError.vue";
import editForm from "./editForm.vue";
import updateError from "./updateError.vue";
import updateArrival from "./updateArrival.vue";
import updateClear from "./updateClear.vue";
import { listUser } from "@/api/system/user";
export default {
......@@ -244,6 +256,8 @@ export default {
regError,
editForm,
updateError,
updateArrival,
updateClear
},
created() {
this.transportTypes = this.getDictDatas(
......@@ -332,6 +346,12 @@ export default {
errorType: "",
operate: "",
},
arrivalInfo: {
orderList: []
},
clearInfo: {
orderList: []
},
};
},
methods: {
......@@ -371,6 +391,34 @@ export default {
// 判断异常类型
this.handleCommand("updateError");
},
/* 更新到港状态 */
updateArrivalStatus(type) {
let orders = [];
if (type === "selected") {
if (!this.selectedRows.length) {
this.$message.error("请选择需要更新的订单");
return;
}
orders = this.selectedRows.map(item=>{return item.orderId});
}
this.$set(this.arrivalInfo, "orderList", orders);
this.$set(this.arrivalInfo, "type", type);
this.handleCommand("updateArrival");
},
/* 更新清关状态 */
updateClearStatus(type) {
let orders = [];
if (type === "selected") {
if (!this.selectedRows.length) {
this.$message.error("请选择需要更新的订单");
return;
}
orders = this.selectedRows.map(item=>{return item.orderId});
}
this.$set(this.clearInfo, "orderList", orders);
this.$set(this.clearInfo, "type", type);
this.handleCommand("updateClear");
},
getErrorType() {
for (const [key, value] of Object.entries(this.shipmentObj)) {
// 报关异常 customsHasAbnormal
......@@ -547,6 +595,14 @@ export default {
this.$set(this.dialogConfig, "visible", true);
this.$set(this.dialogConfig, "type", "updateError");
break;
case "updateArrival":
this.$set(this.dialogConfig, "visible", true);
this.$set(this.dialogConfig, "type", "updateArrival");
break;
case "updateClear":
this.$set(this.dialogConfig, "visible", true);
this.$set(this.dialogConfig, "type", "updateClear");
break;
}
},
// 关闭弹框
......
<template>
<div>
<el-form ref="arrivalForm" :rules="rules" :model="airArrivalInfo" label-width="120px">
<!-- <el-form-item :label="$t('预计到港时间')">{{getExpectedTime()}}</el-form-item>
<el-form-item :label="$t('实际到港时间')" prop="apRealTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="arrivalObj.apRealTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<el-form-item :label="$t('到港情况')" prop="arriveType">
<el-radio-group v-model="airArrivalInfo.arriveType">
<el-radio :label="0">{{ $t('一次到港') }}</el-radio>
<el-radio :label="1">{{ $t('多次到港') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('选择订单')" prop="arriveOrderIdList" v-show="airArrivalInfo.arriveType == 1">
<el-select
v-model="airArrivalInfo.arriveOrderIdList"
multiple
filterable
clearable
reserve-keyword
:filter-method="filterOrder"
:placeholder="$t('请输入订单号、提单号、唛头')"
>
<el-option
v-for="(item) in statusOrderList"
:key="item.orderId"
:label="item.orderNo+' '+item.arrival"
:value="item.orderId">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('已到港订单')" v-show="airArrivalInfo.arriveType == 1">
<span v-for="order in airArrivalInfo.arrivalOrderList" :key="order.id">{{order.orderNo}} </span>
</el-form-item>
<el-form-item :label="$t('确认到港')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="arrivalObj.apConfirmTime" value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
<p class="message-area" v-show="showMsg">{{$t('请确认是否有异常,如有异常请进行异常登记')}}</p>
</el-form-item> -->
<el-form-item v-if="dtRealHeadTimeFlag" :label="$t('实际二程起飞时间')" prop="actSecondTime">
<el-form-item v-if="dtRealHeadTimeFlag||airArrivalInfo.arriveType==1" :label="$t('实际二程起飞时间')" prop="actSecondTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.actSecondTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('预计到港时间')" prop="estTime">
......@@ -42,6 +59,7 @@
import regError from "../../regError";
import dayjs from "dayjs";
import { arrivalCreate } from "@/api/ecw/boxSeaAir";
import { shipmentOrderList } from "@/api/ecw/boxAir";
import { formatDateStr, serviceMsg } from "../utils";
/**
......@@ -54,16 +72,28 @@ export default {
regError,
},
data() {
var validateActSecondTime = (rule, value, callback) => {
if(!value && (this.airArrivalInfo.arriveType==0||(this.airArrivalInfo.arriveType==1&&this.airArrivalInfo.arriveOrderIdList.length>0))){
callback(new Error("必填"));
}
callback();
};
var validateActTime = (rule, value, callback) => {
if(!value && (this.airArrivalInfo.arriveType==0||(this.airArrivalInfo.arriveType==1&&this.airArrivalInfo.arriveOrderIdList.length>0))){
callback(new Error("必填"));
}
callback();
};
return {
// 到港对象
airArrivalInfo: {},
// 校验
rules: {
actSecondTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
{ validator: validateActSecondTime, trigger: "change" },
],
actTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
{ validator: validateActTime, trigger: "change" },
]
},
// 弹窗配置
......@@ -73,7 +103,9 @@ export default {
inspectionTimeArrival: this.getDictDatas(
this.DICT_TYPE.BOX_INSPECTION_TIME_ARRIVAL
)[0].value,
dtRealHeadTimeFlag: false
dtRealHeadTimeFlag: false,
orderList: [],
orderListFilter: [],
};
},
created() {
......@@ -88,6 +120,33 @@ export default {
if(this.$attrs.shipmentObj['bookAirInfo'].voyage && this.$attrs.shipmentObj['bookAirInfo'].voyage == 2){
this.dtRealHeadTimeFlag = true
}
if(!this.airArrivalInfo.arriveType) this.$set(this.airArrivalInfo,'arriveType',0)
this.$set(this.airArrivalInfo,'arriveOrderIdList',this.airArrivalInfo.arrivalOrderList.map(item=>{return item.orderId}))
shipmentOrderList(this.$attrs.shipmentObj.id).then(r=>{
this.orderList = r.data
this.orderListFilter = r.data
})
},
computed: {
statusOrderList(){
let data = []
this.orderListFilter.forEach(item=>{
let json = {
orderId: item.orderId,
orderNo: item.orderNo,
tidanNo: item.tidanNo,
marks: item.marks,
}
let index = this.airArrivalInfo.arrivalOrderList.findIndex(p=>p.orderId==item.orderId)
if(index != -1){
json.arrival = this.$t('已到港')
}else{
json.arrival = this.$t('未到港')
}
data.push(json)
})
return data
}
},
watch: {
// 实际二程起飞时间
......@@ -109,6 +168,15 @@ export default {
},
},
methods: {
filterOrder(val){
if(val != ''){
this.orderListFilter = this.orderList.filter(item=>{
return item.orderNo.indexOf(val) > -1 || item.tidanNo.indexOf(val) > -1 || item.marks.indexOf(val) > -1
})
}else{
this.orderListFilter = this.orderList
}
},
regCloseDialog(type) {
this.dialogVisible = false;
if (type === "error") {
......
<template>
<div>
<el-form ref="cusClearanceForm" :rules="rules" :model="cusClearanceObj" label-width="120px">
<!-- <el-form-item :label="$t('清关代理')">{{getClAgent('label')}}</el-form-item> -->
<el-form-item :label="$t('清关情况')" prop="arriveType">
<el-radio-group v-model="cusClearanceObj.clearanceType">
<el-radio :label="0">{{ $t('一次清关') }}</el-radio>
<el-radio :label="1">{{ $t('多次清关') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('选择订单')" prop="clearanceOrderIdList" v-show="cusClearanceObj.clearanceType == 1">
<el-select
v-model="cusClearanceObj.clearanceOrderIdList"
multiple
filterable
clearable
reserve-keyword
:filter-method="filterOrder"
:placeholder="$t('请输入订单号、提单号、唛头')"
>
<el-option
v-for="(item) in statusOrderList"
:key="item.orderId"
:label="item.orderNo+' '+item.arrival"
:value="item.orderId">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('已清关订单')" v-show="cusClearanceObj.clearanceType == 1">
<span v-for="order in cusClearanceObj.clearanceOrderList" :key="order.id">{{order.orderNo}} </span>
</el-form-item>
<!-- <el-form-item v-if="dtRealHeadTimeFlag||airArrivalInfo.arriveType==1" :label="$t('实际二程起飞时间')" prop="actSecondTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.actSecondTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('预计到港时间')" prop="estTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.estTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('实际到港时间')" prop="actTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.actTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item> -->
<el-form-item :label="$t('预计清关时间')" prop="clEstTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cusClearanceObj.clEstTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
......@@ -29,6 +65,7 @@
import regError from "../../regError";
import dayjs from "dayjs";
import { clearanceCreate } from "@/api/ecw/boxSea";
import { shipmentOrderList } from "@/api/ecw/boxAir";
import { formatDateStr, serviceMsg } from "../utils";
/**
......@@ -57,6 +94,8 @@ export default {
dialogVisible: false,
// 提示消息
showMsg: false,
orderList: [],
orderListFilter: [],
};
},
created() {
......@@ -65,6 +104,12 @@ export default {
oldData = formatDateStr(oldData, ["clEstTime"]);
oldData = formatDateStr(oldData, ["clClearTime"], "YYYY-MM-DD HH:mm:ss");
this.cusClearanceObj = oldData;
if(!this.cusClearanceObj.clearanceType) this.$set(this.cusClearanceObj,'clearanceType',0)
this.$set(this.cusClearanceObj,'clearanceOrderIdList',this.cusClearanceObj.clearanceOrderList.map(item=>{return item.orderId}))
shipmentOrderList(this.$attrs.shipmentObj.id).then(r=>{
this.orderList = r.data
this.orderListFilter = r.data
})
},
watch: {
// 预计清关时间
......@@ -76,7 +121,37 @@ export default {
this.compareDate(this.cusClearanceObj.clEstTime, val);
},
},
computed: {
statusOrderList(){
let data = []
this.orderListFilter.forEach(item=>{
let json = {
orderId: item.orderId,
orderNo: item.orderNo,
tidanNo: item.tidanNo,
marks: item.marks,
}
let index = this.cusClearanceObj.clearanceOrderList.findIndex(p=>p.orderId==item.orderId)
if(index != -1){
json.arrival = this.$t('已清关')
}else{
json.arrival = this.$t('未清关')
}
data.push(json)
})
return data
}
},
methods: {
filterOrder(val){
if(val != ''){
this.orderListFilter = this.orderList.filter(item=>{
return item.orderNo.indexOf(val) > -1 || item.tidanNo.indexOf(val) > -1 || item.marks.indexOf(val) > -1
})
}else{
this.orderListFilter = this.orderList
}
},
getClAgent(type) {
const agentId = this.$attrs.shipmentObj.agentInfo.agentId;
if (type === "label") {
......
<template>
<div class="shipping-update-error">
<div class="message-title">{{headerTitle}}</div>
<el-form ref="arrivalForm" :rules="rules" :model="airArrivalInfo" label-width="120px">
<el-form-item :label="$t('实际二程起飞时间')" prop="actSecondTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.actSecondTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('预计到港时间')" prop="estTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.estTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('实际到港时间')" prop="actTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.actTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</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 { updateOrderArrival, updateAllOrderArrival } from "@/api/ecw/boxAir";
export default {
name: "updateError",
inheritAttrs: false,
components: {},
props: {
shipmentObj: Object,
arrivalInfo: Object,
},
data() {
return {
// 到港对象
airArrivalInfo: {},
// 校验
rules: {
actSecondTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
actTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
]
},
headerTitle: "",
};
},
watch: {
arrivalInfo: {
handler: function (val) {
const { orderList, type } = val;
if (type === "selected") {
this.headerTitle = this.$t(
"确定给{selfNo}下的{orderNos}更新状态吗?",
{
selfNo: this.shipmentObj.selfNo,
orderNos: orderList.map((item) => item.orderNo).join(",") ?? "",
}
);
} else {
this.headerTitle = this.$t(
`确定给{selfNo}下的${
type === "all" ? this.$t("所有订单") : this.$t("所选订单")
}更新状态吗?`,
{
selfNo: this.shipmentObj.selfNo,
}
);
}
},
immediate: true,
},
},
methods: {
onSubmit() {
this.$refs["arrivalForm"].validate((valid) => {
if (valid) {
if(this.arrivalInfo.type == 'selected'){
let param = {
shipmentId: this.shipmentObj.id,
orderIdList: this.arrivalInfo.orderList
}
updateOrderArrival({...this.airArrivalInfo, ...param}).then(()=>{
this.$message.success("成功");
this.cancel()
})
}else{
let param = {
shipmentId: this.shipmentObj.id
}
updateAllOrderArrival({...this.airArrivalInfo, ...param}).then(()=>{
this.$message.success("成功");
this.cancel()
})
}
}
});
},
cancel() {
this.$emit("closeDialog");
},
},
};
</script>
<style lang="scss" scoped>
.shipping-update-error {
.message-title {
text-align: center;
font-size: 20px;
margin: 0 20px 10px;
}
}
</style>
<template>
<div class="shipping-update-error">
<div class="message-title">{{headerTitle}}</div>
<el-form ref="arrivalForm" :rules="rules" :model="cusClearanceObj" label-width="120px">
<el-form-item :label="$t('预计清关时间')" prop="clEstTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cusClearanceObj.clEstTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('清关时间')" prop="clClearTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cusClearanceObj.clClearTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<p class="message-area" v-show="showMsg">{{$t('清关时间与预计时间不符,如有异常请登记')}}</p>
</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 { updateOrderClearance, updateAllOrderArrival } from "@/api/ecw/boxAir";
export default {
name: "updateError",
inheritAttrs: false,
components: {},
props: {
shipmentObj: Object,
clearInfo: Object,
},
data() {
return {
// 到港对象
cusClearanceObj: {},
// 校验
rules: {
actSecondTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
actTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
]
},
headerTitle: "",
};
},
watch: {
arrivalInfo: {
handler: function (val) {
const { orderList, type } = val;
if (type === "selected") {
this.headerTitle = this.$t(
"确定给{selfNo}下的{orderNos}更新状态吗?",
{
selfNo: this.shipmentObj.selfNo,
orderNos: orderList.map((item) => item.orderNo).join(",") ?? "",
}
);
} else {
this.headerTitle = this.$t(
`确定给{selfNo}下的${
type === "all" ? this.$t("所有订单") : this.$t("所选订单")
}更新状态吗?`,
{
selfNo: this.shipmentObj.selfNo,
}
);
}
},
immediate: true,
},
},
methods: {
onSubmit() {
this.$refs["arrivalForm"].validate((valid) => {
if (valid) {
if(this.clearInfo.type == 'selected'){
let param = {
shipmentId: this.shipmentObj.id,
orderIdList: this.clearInfo.orderList
}
updateOrderClearance({...this.cusClearanceObj, ...param}).then(()=>{
this.$message.success("成功");
this.cancel()
})
}else{
let param = {
shipmentId: this.shipmentObj.id
}
updateAllOrderArrival({...this.cusClearanceObj, ...param}).then(()=>{
this.$message.success("成功");
this.cancel()
})
}
}
});
},
cancel() {
this.$emit("closeDialog");
},
},
};
</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