Commit 2a864dd6 authored by zhoutong's avatar zhoutong

修复bug

parent 47d26c56
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
filterOrder(val){ filterOrder(val){
if(val != ''){ if(val != ''){
this.orderListFilter = this.orderList.filter(item=>{ 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{ }else{
this.orderListFilter = this.orderList this.orderListFilter = this.orderList
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('选择订单')" prop="clearanceOrderIdList" v-show="cusClearanceObj.clearanceType == 1"> <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-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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('已清关订单')" v-show="cusClearanceObj.clearanceType == 1"> <el-form-item :label="$t('已清关订单')" v-show="cusClearanceObj.clearanceType == 1">
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
</el-form-item> </el-form-item>
<div v-if="cusClearanceObj.clearanceOrderIdList.length > 0"> <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-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-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>
...@@ -26,6 +27,7 @@ ...@@ -26,6 +27,7 @@
<el-form-item :label="$t('实际到港时间')" prop="actTime"> <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-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>
</el-form>
</div> </div>
<el-form-item :label="$t('预计清关时间')" prop="clEstTime"> <el-form-item :label="$t('预计清关时间')" prop="clEstTime">
...@@ -57,7 +59,7 @@ import dayjs from 'dayjs' ...@@ -57,7 +59,7 @@ import dayjs from 'dayjs'
import { clearanceCreate } from '@/api/ecw/boxSea' import { clearanceCreate } from '@/api/ecw/boxSea'
import { shipmentOrderList } from '@/api/ecw/boxAir' import { shipmentOrderList } from '@/api/ecw/boxAir'
import { formatDateStr, serviceMsg, formatDate } from '../utils' import { formatDateStr, serviceMsg, formatDate } from '../utils'
import { updateOrderArrival } from "@/api/ecw/boxAir"; import { updateOrderArrival } from '@/api/ecw/boxAir'
/** /**
* 清关 * 清关
...@@ -77,6 +79,10 @@ export default { ...@@ -77,6 +79,10 @@ export default {
clEstTime: [{ required: true, message: this.$t('必填'), trigger: 'change' }], clEstTime: [{ required: true, message: this.$t('必填'), trigger: 'change' }],
clClearTime: [{ 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, dialogVisible: false,
// 提示消息 // 提示消息
...@@ -95,7 +101,7 @@ export default { ...@@ -95,7 +101,7 @@ export default {
this.cusClearanceObj = oldData this.cusClearanceObj = oldData
if (!this.cusClearanceObj.clearanceType) this.$set(this.cusClearanceObj, 'clearanceType', 0) if (!this.cusClearanceObj.clearanceType) this.$set(this.cusClearanceObj, 'clearanceType', 0)
this.$set(this.cusClearanceObj, 'clearanceOrderIdList', []) 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) => { shipmentOrderList(this.$attrs.shipmentObj.id).then((r) => {
this.orderList = r.data this.orderList = r.data
this.orderListFilter = r.data this.orderListFilter = r.data
...@@ -111,16 +117,12 @@ export default { ...@@ -111,16 +117,12 @@ export default {
this.compareDate(this.cusClearanceObj.clEstTime, val) this.compareDate(this.cusClearanceObj.clEstTime, val)
}, },
'cusClearanceObj.clearanceType'(val) { 'cusClearanceObj.clearanceType'(val) {
if(val == 1){ if (val == 1) {
this.$set(this.cusClearanceObj, 'clEstTime', null) this.$set(this.cusClearanceObj, 'clEstTime', null)
this.$set(this.cusClearanceObj, 'clClearTime', null) this.$set(this.cusClearanceObj, 'clClearTime', null)
}else{ } else {
let oldData = { ...this.$attrs.shipmentObj[this.$attrs.currNode.voName] }; let oldData = { ...this.$attrs.shipmentObj[this.$attrs.currNode.voName] }
oldData = formatDateStr( oldData = formatDateStr(oldData, ['clEstTime', 'clClearTime'], 'YYYY-MM-DD HH:mm:ss')
oldData,
["clEstTime", "clClearTime"],
"YYYY-MM-DD HH:mm:ss"
);
this.$set(this.cusClearanceObj, 'clClearTime', oldData.clClearTime) this.$set(this.cusClearanceObj, 'clClearTime', oldData.clClearTime)
this.$set(this.cusClearanceObj, 'clEstTime', oldData.clEstTime) this.$set(this.cusClearanceObj, 'clEstTime', oldData.clEstTime)
} }
...@@ -136,11 +138,17 @@ export default { ...@@ -136,11 +138,17 @@ export default {
tidanNo: item.tidanNo, tidanNo: item.tidanNo,
marks: item.marks marks: item.marks
} }
let index = this.cusClearanceObj.clearanceOrderList ? this.cusClearanceObj.clearanceOrderList.findIndex((p) => p.orderId == item.orderId) : -1 let clearindex = this.cusClearanceObj.clearanceOrderList ? this.cusClearanceObj.clearanceOrderList.findIndex((p) => p.orderId == item.orderId) : -1
if (index != -1) { if (clearindex != -1) {
json.arrival = this.$t('已清关') 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 { } else {
json.arrival = this.$t('清关') json.arrival = this.$t('到港')
} }
data.push(json) data.push(json)
}) })
...@@ -152,7 +160,7 @@ export default { ...@@ -152,7 +160,7 @@ export default {
filterOrder(val) { filterOrder(val) {
if (val != '') { if (val != '') {
this.orderListFilter = this.orderList.filter((item) => { 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 { } else {
this.orderListFilter = this.orderList this.orderListFilter = this.orderList
...@@ -199,6 +207,9 @@ export default { ...@@ -199,6 +207,9 @@ export default {
onSubmit(operateType) { onSubmit(operateType) {
this.$refs['cusClearanceForm'].validate((valid) => { this.$refs['cusClearanceForm'].validate((valid) => {
if (valid) { if (valid) {
if (this.cusClearanceObj.clearanceType == 1) {
this.$refs['airArrivalForm'].validate((arrvalid) => {
if (arrvalid) {
updateOrderArrival({ updateOrderArrival({
...this.airArrivalInfo, ...this.airArrivalInfo,
shipmentId: this.$attrs.shipmentObj.id, shipmentId: this.$attrs.shipmentObj.id,
...@@ -217,6 +228,20 @@ export default { ...@@ -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) { 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