Commit 2a864dd6 authored by zhoutong's avatar zhoutong

修复bug

parent 47d26c56
......@@ -187,7 +187,7 @@ export default {
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
return item.orderNo&&item.orderNo.indexOf(val) > -1 || item.tidanNo&&item.tidanNo.indexOf(val) > -1 || item.marks&&item.marks.indexOf(val) > -1
})
}else{
this.orderListFilter = this.orderList
......
......@@ -9,7 +9,7 @@
</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('请输入订单号、提单号、唛头')" @change="selectOrderId">
<el-option v-for="item in statusOrderList" :key="item.orderId" :label="item.orderNo + ' ' + item.arrival" :value="item.orderId"> </el-option>
<el-option v-for="item in statusOrderList" :key="item.orderId" :label="item.orderNo + ' ' + item.clear + ' ' + item.arrival" :value="item.orderId"> </el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('已清关订单')" v-show="cusClearanceObj.clearanceType == 1">
......@@ -17,6 +17,7 @@
</el-form-item>
<div v-if="cusClearanceObj.clearanceOrderIdList.length > 0">
<el-form ref="airArrivalForm" :rules="airArrivalrules" :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>
......@@ -26,6 +27,7 @@
<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>
</div>
<el-form-item :label="$t('预计清关时间')" prop="clEstTime">
......@@ -57,7 +59,7 @@ import dayjs from 'dayjs'
import { clearanceCreate } from '@/api/ecw/boxSea'
import { shipmentOrderList } from '@/api/ecw/boxAir'
import { formatDateStr, serviceMsg, formatDate } from '../utils'
import { updateOrderArrival } from "@/api/ecw/boxAir";
import { updateOrderArrival } from '@/api/ecw/boxAir'
/**
* 清关
......@@ -77,6 +79,10 @@ export default {
clEstTime: [{ required: true, message: this.$t('必填'), trigger: 'change' }],
clClearTime: [{ required: true, message: this.$t('必填'), trigger: 'change' }]
},
airArrivalrules: {
actSecondTime: [{ required: true, message: this.$t('必填'), trigger: 'change' }],
actTime: [{ required: true, message: this.$t('必填'), trigger: 'change' }]
},
// 弹窗配置
dialogVisible: false,
// 提示消息
......@@ -95,7 +101,7 @@ export default {
this.cusClearanceObj = oldData
if (!this.cusClearanceObj.clearanceType) this.$set(this.cusClearanceObj, 'clearanceType', 0)
this.$set(this.cusClearanceObj, 'clearanceOrderIdList', [])
if(this.$attrs.shipmentObj.airArrivalInfo.arrivalOrderList) this.arrivalOrderList = this.$attrs.shipmentObj.airArrivalInfo.arrivalOrderList
if (this.$attrs.shipmentObj.airArrivalInfo.arrivalOrderList) this.arrivalOrderList = this.$attrs.shipmentObj.airArrivalInfo.arrivalOrderList
shipmentOrderList(this.$attrs.shipmentObj.id).then((r) => {
this.orderList = r.data
this.orderListFilter = r.data
......@@ -111,16 +117,12 @@ export default {
this.compareDate(this.cusClearanceObj.clEstTime, val)
},
'cusClearanceObj.clearanceType'(val) {
if(val == 1){
if (val == 1) {
this.$set(this.cusClearanceObj, 'clEstTime', null)
this.$set(this.cusClearanceObj, 'clClearTime', null)
}else{
let oldData = { ...this.$attrs.shipmentObj[this.$attrs.currNode.voName] };
oldData = formatDateStr(
oldData,
["clEstTime", "clClearTime"],
"YYYY-MM-DD HH:mm:ss"
);
} else {
let oldData = { ...this.$attrs.shipmentObj[this.$attrs.currNode.voName] }
oldData = formatDateStr(oldData, ['clEstTime', 'clClearTime'], 'YYYY-MM-DD HH:mm:ss')
this.$set(this.cusClearanceObj, 'clClearTime', oldData.clClearTime)
this.$set(this.cusClearanceObj, 'clEstTime', oldData.clEstTime)
}
......@@ -136,11 +138,17 @@ export default {
tidanNo: item.tidanNo,
marks: item.marks
}
let index = this.cusClearanceObj.clearanceOrderList ? this.cusClearanceObj.clearanceOrderList.findIndex((p) => p.orderId == item.orderId) : -1
if (index != -1) {
json.arrival = this.$t('已清关')
let clearindex = this.cusClearanceObj.clearanceOrderList ? this.cusClearanceObj.clearanceOrderList.findIndex((p) => p.orderId == item.orderId) : -1
if (clearindex != -1) {
json.clear = this.$t('已清关')
} else {
json.clear = this.$t('未清关')
}
let arrivalindex = this.arrivalOrderList ? this.arrivalOrderList.findIndex((p) => p.orderId == item.orderId) : -1
if (arrivalindex != -1) {
json.arrival = this.$t('已到港')
} else {
json.arrival = this.$t('清关')
json.arrival = this.$t('到港')
}
data.push(json)
})
......@@ -152,7 +160,7 @@ export default {
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
return item.orderNo&&item.orderNo.indexOf(val) > -1 || item.tidanNo&&item.tidanNo.indexOf(val) > -1 || item.marks&&item.marks.indexOf(val) > -1
})
} else {
this.orderListFilter = this.orderList
......@@ -199,6 +207,9 @@ export default {
onSubmit(operateType) {
this.$refs['cusClearanceForm'].validate((valid) => {
if (valid) {
if (this.cusClearanceObj.clearanceType == 1) {
this.$refs['airArrivalForm'].validate((arrvalid) => {
if (arrvalid) {
updateOrderArrival({
...this.airArrivalInfo,
shipmentId: this.$attrs.shipmentObj.id,
......@@ -217,6 +228,20 @@ export default {
})
}
})
} else {
clearanceCreate({
...this.cusClearanceObj,
shipmentId: this.$attrs.shipmentObj.id,
clAgentId: this.getClAgent(),
operateType
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel('submit')
})
})
}
}
})
},
/** 取消 */
cancel(type) {
......
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