预配舱单

szh_zidingyibiaoti
lilu 2 years ago
parent 90d2b20245
commit a2c703679d

@ -10,17 +10,25 @@
:defaultActiveFirstOption="false"
:dropdown-style="dropdownStyle"
:backfill="false"
:notFoundContent="inLoading ? '加载中...' : '暂无数据'"
@select="handleSelect"
@change="debounce(handleChange, 0, $event)"
@focus="handleChangeFirst"
@blur="getSelectBlur"
>
<template slot="dataSource">
<a-select-option v-for="(item, index) in dataSourceList" :key="index" :value="index + '-' + item[showLabel[0]]" :label="item[showLabel[0]]">
<a-select-option v-for="(item, index) in dataSourceList" :key="index" :value="index + '-' + item[showLabel[0]]" :label="type.includes('countryName') ? item[showLabel[1]] : item[showLabel[0]]">
<div class="contractno-label" v-if="type === 'contractno'">
<div class="title"> {{ item.contractNo }} / {{ item.contractName || '--' }} </div>
<div class="note"><span>{{ item.contractNote || '--' }}</span></div>
</div>
<template v-else-if="type === 'vessel'">
<div class="vessel-label">
<div class="title"> {{ item.vessel }} </div>
<div class="voyno">航次 <span>{{ item.voyno || '--' }}</span></div>
<div class="etd">ETD: <span>{{ item.etd || '--' }}</span></div>
</div>
</template>
<div class="title" v-else>
<template v-for="(label, lindex) in showLabel">
{{ item[label] }}
@ -34,7 +42,13 @@
</template>
<script>
import {
getContractno
getContractno,
getVesselInfoService,
GetForwarderlist,
BookingTemplate,
CodeCountryList,
GetPortloadlist,
GetPortlist
} from '@/api/modular/main/BookingLedger'
import { AutoComplete } from 'ant-design-vue'
import { mapGetters } from 'vuex'
@ -80,7 +94,8 @@ export default {
return {
value: this.defaultVal || '',
dataSourceList: [],
inEdit: false
inEdit: false,
inLoading: false
}
},
computed: {
@ -117,12 +132,25 @@ export default {
switch (type) {
case 'getContractno':
return getContractno
case 'getVesselInfoService':
return getVesselInfoService
case 'GetForwarderlist':
return GetForwarderlist
case 'BookingTemplate':
return BookingTemplate
case 'CodeCountryList':
return CodeCountryList
case 'GetPortloadlist':
return GetPortloadlist
case 'GetPortlist':
return GetPortlist
}
},
handleSelect (e) {
const num = Number(e.split('-')[0])
const data = this.dataSourceList[num]
this.value = data[this.showLabel[0]]
this.value = this.type.includes('countryName') ? data[this.showLabel[1]] : data[this.showLabel[0]]
console.log('== handleSelect ==', this.value)
this.$emit('select', {
type: this.type,
res: data
@ -136,35 +164,44 @@ export default {
setTimeout(() => {
this.inEdit = false
}, 800)
console.log('== handleChange ==', e)
if (e) {
Object.keys(this.searchQuery).map((item, index) => {
if (['queryItem'].includes(item)) {
if (['Title', 'KeyWord', 'SearchValue', 'name', 'keyword', 'queryItem'].includes(item)) {
this.searchQuery[item] = e
}
})
} else {
Object.keys(this.searchQuery).map((item, index) => {
if (['queryItem'].includes(item)) {
if (['Title', 'KeyWord', 'SearchValue', 'name', 'keyword', 'queryItem'].includes(item)) {
this.searchQuery[item] = ''
}
})
}
this.inLoading = true
this.getFromSelectData(this.emnuCompleteApi(this.searchApi), this.searchQuery).then((data) => {
this.inLoading = false
if (data.rows) {
this.dataSourceList = data.rows
} else {
this.dataSourceList = data
}
console.log(this.dataSourceList)
})
},
handleChangeFirst (e) {
if (this.value && this.dataSourceList.length !== 0) {
return false
}
if (this.bookingInitData[`${this.type}InitList`].length > 0) {
this.dataSourceList = this.bookingInitData[`${this.type}InitList`]
return false
}
if (!['vessel', 'lineName', 'notifypartycountryName', 'consigneecountryName', 'shippercountryName'].includes(this.type) && this.bookingInitData[`${this.type}InitList`].length > 0) {
this.dataSourceList = this.bookingInitData[`${this.type}InitList`]
this.inLoading = false
return false
}
// if (this.bookingInitData[`${this.type}InitList`].length > 0) {
// this.dataSourceList = this.bookingInitData[`${this.type}InitList`]
// return false
// }
this.handleChange(e)
},
getSelectBlur (e) {
@ -196,4 +233,22 @@ export default {
color: #999;
}
}
.vessel-label{
.title{
height: 28px;
line-height: 28px;
font-size: 14px;
font-weight:600;
color: #666;
border-bottom:1px dashed #ddd;
margin-bottom: 4px;
}
.voyno, .etd {
height: 22px;
line-height: 22px;
font-size: 12px;
color: #999;
}
}
</style>

@ -329,6 +329,8 @@ export default {
return this.packageList
case 'carrierid':
return this.carrierList
case 'carrier':
return this.carrierList
case 'issuetype':
return this.issuetypeList
case 'blfrt':
@ -398,7 +400,7 @@ export default {
this.$refs.selectView.$refs.vcSelect.focus()
}
this.open = true
if (['cargoid', 'nobill', 'copynobill', 'carrierid', 'yard', 'kindpkgs', 'issuetype', 'blfrt', 'masterBolIndicator', 'salerCode', 'shippingMethod', 'sourceName', 'notifypartycountry', 'consigneecountry', 'shippercountry'].includes(this.type)) {
if (['cargoid', 'nobill', 'copynobill', 'carrierid', 'carrier', 'yard', 'kindpkgs', 'issuetype', 'blfrt', 'masterBolIndicator', 'salerCode', 'shippingMethod', 'sourceName', 'notifypartycountry', 'consigneecountry', 'shippercountry'].includes(this.type)) {
this.selectList = this.emnuData(this.type)
this.inLoading = false
return false

@ -87,126 +87,129 @@
</template>
</a-row>
<a-row class="from-box" :gutter="10" style="padding-left: 17px;">
<template v-if="!orderDetails.isHBL">
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
<a-form-model-item
class="pre-from-label"
label="船名"
prop="vessel"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
class="copy-input"
ref="vesselView"
type="vessel"
:defaultVal="orderDetails.vessel"
searchApi="getVesselInfoService"
:searchQuery="{
KeyWord: '',
CarrierID: this.orderDetails.carrierid || 'CMA',
ETD: this.orderDetails.etd || '',
}"
:showLabel="['vessel']"
:openSearch="true"
@change="getSelectViewRes"
></selectView>
</a-form-model-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
<a-form-model-item
class="pre-from-label"
label="航次"
prop="voyno"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<inputView type="voyno" :parentVal="orderDetails.voyno" @getInputChange="inputChange" />
</a-form-model-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="4">
<a-form-model-item
class="pre-from-label"
label="船代"
prop="forwarder"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<!-- <selectView
type="forwarder"
:defaultVal="orderDetails.forwarder"
searchApi="GetForwarderlist"
:searchQuery="{ KeyWord: '' }"
:showLabel="['name', 'showCode']"
:openSearch="true"
@change="getSelectViewRes"
></selectView> -->
<selectView
type="shipagency"
:defaultVal="orderDetails.forwarder"
searchApi="GetForwarderlist"
:searchQuery="{ KeyWord: '' }"
:showLabel="['name', 'showCode']"
:openSearch="true"
@change="getSelectViewRes"
></selectView>
</a-form-model-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
<a-form-model-item
class="pre-from-label"
label="船公司"
prop="carrierid"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
type="carrierid"
:defaultVal="orderDetails.carrierid"
searchApi="GetCarrierlist"
:searchQuery="{ keyword: '', type: 'consignor' }"
:showLabel="['cnName', 'code']"
:openSearch="false"
@change="getSelectViewRes"
style="flex: 1; margin-top: -4px;"
></selectView>
</a-form-model-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
<a-form-model-item
class="pre-from-label"
label="开船日期"
prop="etd"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<div class="date-box">
<datePickerView
class="date-picker"
:parentVal="orderDetails.etd"
type="etd"
format="YYYY-MM-DD"
@dateChange="dateChangeFun"
></datePickerView>
</div>
<!-- <selectView
type="carrierid"
:defaultVal="orderDetails.carrierid"
searchApi="GetCarrierlist"
:searchQuery="{ keyword: '', type: 'consignor' }"
:showLabel="['cnName', 'code']"
:openSearch="false"
@change="getSelectViewRes"
style="flex: 1; margin-top: -4px;"
></selectView> -->
</a-form-model-item>
</a-col>
</template>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
<a-form-model-item
class="pre-from-label"
label="船名"
prop="vessel"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<autoView
class="copy-input"
type="vessel"
:defaultVal="orderDetails.vessel"
:dropdownStyle="{ width: '300px' }"
searchApi="getVesselInfoService"
:searchQuery="{
KeyWord: '',
CarrierID: this.orderDetails.carrierid || 'CMA',
ETD: this.orderDetails.etd || '',
}"
:showLabel="['vessel']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
class="copy-input"
ref="vesselView"
type="vessel"
:defaultVal="orderDetails.vessel"
searchApi="getVesselInfoService"
:searchQuery="{
KeyWord: '',
CarrierID: this.orderDetails.carrierid || 'CMA',
ETD: this.orderDetails.etd || '',
}"
:showLabel="['vessel']"
:openSearch="true"
@change="getSelectViewRes"
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
<a-form-model-item
class="pre-from-label"
label="航次"
prop="voyno"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<inputView type="voyno" :parentVal="orderDetails.voyno" @getInputChange="inputChange" />
</a-form-model-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="4">
<a-form-model-item
class="pre-from-label"
label="船代"
prop="forwarder"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
type="shipagency"
:defaultVal="orderDetails.forwarder"
searchApi="GetForwarderlist"
:searchQuery="{ KeyWord: '' }"
:showLabel="['name', 'showCode']"
:openSearch="true"
@change="getSelectViewRes"
></selectView>
</a-form-model-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
<a-form-model-item
class="pre-from-label"
label="船公司"
prop="carrier"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
type="carrier"
:defaultVal="orderDetails.carrier"
searchApi="GetCarrierlist"
:searchQuery="{ keyword: '', type: 'consignor' }"
:showLabel="['cnName', 'code']"
:openSearch="false"
@change="getSelectViewRes"
style="flex: 1; margin-top: -4px;"
></selectView>
</a-form-model-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
<a-form-model-item
class="pre-from-label"
label="开船日期"
prop="etd"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<div class="date-box">
<datePickerView
class="date-picker"
:parentVal="orderDetails.etd"
type="etd"
format="YYYY-MM-DD"
@dateChange="dateChangeFun"
></datePickerView>
</div>
<!-- <selectView
type="carrierid"
:defaultVal="orderDetails.carrierid"
searchApi="GetCarrierlist"
:searchQuery="{ keyword: '', type: 'consignor' }"
:showLabel="['cnName', 'code']"
:openSearch="false"
@change="getSelectViewRes"
style="flex: 1; margin-top: -4px;"
></selectView> -->
</a-form-model-item>
</a-col>
</a-row>
</div>
<div class="pre-mail-info">
@ -225,7 +228,16 @@
:wrapperCol="wrapperCol"
has-feedback
>
<selectView
<autoView
type="shippername"
ref="shippernameInput"
:defaultVal="orderDetails.shippername"
searchApi="BookingTemplate"
:searchQuery="{ Title: '', Type: 20 }"
:showLabel="['title']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
type="shippername"
ref="shippernameInput"
:defaultVal="orderDetails.shippername"
@ -234,7 +246,7 @@
:showLabel="['title']"
:openSearch="true"
@change="getSelectViewRes"
></selectView>
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -253,12 +265,20 @@
<a-form-model-item
class="pre-from-label"
label="国家"
prop="shippercountry"
prop="shippercountryName"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
<autoView
type="shippercountryName"
:defaultVal="orderDetails.shippercountryName"
searchApi="CodeCountryList"
:searchQuery="{ KeyWord: '' }"
:showLabel="['code', 'cnName']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
type="shippercountry"
:defaultVal="orderDetails.shippercountry"
searchApi="CodeCountryList"
@ -266,7 +286,7 @@
:showLabel="['enName', 'cnName']"
:openSearch="false"
@change="getSelectViewRes"
></selectView>
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :span="12">
@ -299,7 +319,16 @@
:wrapperCol="wrapperCol"
has-feedback
>
<selectView
<autoView
type="consigneename"
ref="consigneenameInput"
:defaultVal="orderDetails.consigneename"
searchApi="BookingTemplate"
:searchQuery="{ Title: '', Type: 10 }"
:showLabel="['title']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
type="consigneename"
ref="consigneenameInput"
:defaultVal="orderDetails.consigneename"
@ -308,7 +337,7 @@
:showLabel="['title']"
:openSearch="true"
@change="getSelectViewRes"
></selectView>
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -327,12 +356,20 @@
<a-form-model-item
class="pre-from-label"
label="国家"
prop="consigneecountry"
prop="consigneecountryName"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
<autoView
type="consigneecountryName"
:defaultVal="orderDetails.consigneecountryName"
searchApi="CodeCountryList"
:searchQuery="{ KeyWord: '' }"
:showLabel="['code', 'cnName']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
type="consigneecountry"
:defaultVal="orderDetails.consigneecountry"
searchApi="CodeCountryList"
@ -340,7 +377,7 @@
:showLabel="['enName', 'cnName']"
:openSearch="false"
@change="getSelectViewRes"
></selectView>
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :span="12">
@ -373,7 +410,16 @@
:wrapperCol="wrapperCol"
has-feedback
>
<selectView
<autoView
type="notifypartyname"
ref="notifypartynameInput"
:defaultVal="orderDetails.notifypartyname"
searchApi="BookingTemplate"
:searchQuery="{ Title: '', Type: 30 }"
:showLabel="['title']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
type="notifypartyname"
ref="notifypartynameInput"
:defaultVal="orderDetails.notifypartyname"
@ -382,7 +428,7 @@
:showLabel="['title']"
:openSearch="true"
@change="getSelectViewRes"
></selectView>
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -401,12 +447,20 @@
<a-form-model-item
class="pre-from-label"
label="国家"
prop="notifypartycountry"
prop="notifypartycountryName"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
<autoView
type="notifypartycountryName"
:defaultVal="orderDetails.notifypartycountryName"
searchApi="CodeCountryList"
:searchQuery="{ KeyWord: '' }"
:showLabel="['code', 'cnName']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
type="notifypartycountry"
:defaultVal="orderDetails.notifypartycountry"
searchApi="CodeCountryList"
@ -414,7 +468,7 @@
:showLabel="['enName', 'cnName']"
:openSearch="false"
@change="getSelectViewRes"
></selectView>
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :span="12">
@ -447,7 +501,15 @@
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
<autoView
type="portloadid"
:defaultVal="orderDetails.portloadid"
searchApi="GetPortloadlist"
:searchQuery="{ KeyWord: '' }"
:showLabel="['ediCode', 'enName']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
type="portloadid"
:defaultVal="orderDetails.portloadid"
searchApi="GetPortloadlist"
@ -456,7 +518,7 @@
:openSearch="true"
:isCopy="true"
@change="getSelectViewRes"
></selectView>
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :span="6">
@ -486,7 +548,15 @@
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
<autoView
type="portdischargeid"
:defaultVal="orderDetails.portdischargeid"
searchApi="GetPortlist"
:searchQuery="{ KeyWord: '' }"
:showLabel="['ediCode', 'enName']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
type="portdischargeid"
:defaultVal="orderDetails.portdischargeid"
searchApi="GetPortlist"
@ -494,7 +564,7 @@
:showLabel="['ediCode', 'enName']"
:openSearch="true"
@change="getSelectViewRes"
></selectView>
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :span="6">
@ -524,7 +594,16 @@
:wrapperCol="wrapperCol2"
has-feedback
>
<selectView
<autoView
type="placedeliveryid"
:defaultVal="orderDetails.placedeliveryid"
searchApi="GetPortloadlist"
:searchQuery="{ KeyWord: '' }"
:showLabel="['ediCode', 'enName']"
@select="getAutoViewRes"
></autoView>
<!-- <selectView
type="placedeliveryid"
:defaultVal="orderDetails.placedeliveryid"
searchApi="GetPortloadlist"
@ -532,7 +611,7 @@
:showLabel="['ediCode', 'enName']"
:openSearch="true"
@change="getSelectViewRes"
></selectView>
></selectView> -->
</a-form-model-item>
</a-col>
<a-col :span="6">
@ -814,7 +893,7 @@
<div class="title">备注信息</div>
<div class="remarks-bottom">
<a-row>
<a-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
<a-form-model-item
class="pre-from-label"
label="备注"
@ -834,7 +913,7 @@
<inputView type="remarks" :parentVal="orderDetails.remarks" @getInputChange="inputChange" />
</a-form-model-item>
</a-col>
<a-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<!-- <a-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<a-form-model-item
class="pre-from-label"
label="发送备注"
@ -853,7 +932,7 @@
>
<inputView type="sendremark" :parentVal="orderDetails.sendremark" @getInputChange="inputChange" />
</a-form-model-item>
</a-col>
</a-col> -->
</a-row>
</div>
</div>
@ -935,21 +1014,25 @@ const initData = {
vessel: '',
voyno: '',
carrier: '',
carrierName: '',
carrierid: '',
shippername: '',
shipperaddR1: '',
shippercountry: '',
shippercountryName: '',
shippertel: '',
consigneename: '',
consigneeaddR1: '',
consigneecountry: '',
consigneecountryName: '',
consigneetel: '',
notifypartyname: '',
notifypartyaddR1: '',
notifypartycountry: '',
notifypartycountryName: '',
notifypartytel: '',
portload: '',
@ -1052,17 +1135,17 @@ export default {
shippername: { required: true, title: '发货人', message: '请选择发货人', trigger: 'change' },
shipperaddR1: { required: true, title: '地址', message: '请输入发货地址', trigger: 'change' },
shippercountry: { required: true, title: '国家', message: '请选择发货国家', trigger: 'change' },
shippercountryName: { required: true, title: '国家', message: '请选择发货国家', trigger: 'change' },
shippertel: { required: true, title: '电话', message: '请输入发货电话', trigger: 'change' },
consigneename: { required: true, title: '收货人', message: '请选择收货人', trigger: 'change' },
consigneeaddR1: { required: true, title: '地址', message: '请输入收货地址', trigger: 'change' },
consigneecountry: { required: true, title: '国家', message: '请选择收货国家', trigger: 'change' },
consigneecountryName: { required: true, title: '国家', message: '请选择收货国家', trigger: 'change' },
consigneetel: { required: true, title: '电话', message: '请输入收货电话', trigger: 'change' },
notifypartyname: { required: true, title: '通知人', message: '请选择通知人', trigger: 'change' },
notifypartyaddR1: { required: true, title: '地址', message: '请输入通知地址', trigger: 'change' },
notifypartycountry: { required: true, title: '国家', message: '请选择通知国家', trigger: 'change' },
notifypartycountryName: { required: true, title: '国家', message: '请选择通知国家', trigger: 'change' },
notifypartytel: { required: true, title: '电话', message: '请输入通知电话', trigger: 'change' },
portloadid: { required: true, title: '装货港代码', message: '请选择装货港代码', trigger: 'change' },
@ -1594,22 +1677,27 @@ export default {
hblno: '',
isHBL: isHBL,
etd: $details.etd,
forwarder: $details.forwarder,
forwarder: '',
vessel: $details.vessel,
voyno: $details.voyno,
carrier: $details.carrier,
//
carrier: '',
carrierid: $details.carrierid,
carrierName: $details.carrierName,
shippername: '',
shipperaddR1: '',
shippercountry: '',
shippercountryName: '',
shippertel: '',
consigneename: '',
consigneeaddR1: '',
consigneecountry: '',
consigneecountryName: '',
consigneetel: '',
notifypartyname: '',
notifypartyaddR1: '',
notifypartycountry: '',
notifypartycountryName: '',
notifypartytel: '',
portload: $details.portload,
portloadid: $details.portloadid,
@ -1663,14 +1751,27 @@ export default {
}
const removeArr = []
const tempArr = []
let noRemove = ''
this.selectArr.map((item, index) => {
if (this.orderList[item].id !== 0) {
removeArr.push(this.orderList[item].id)
if (this.orderList[item].state === '已录入') {
removeArr.push(this.orderList[item].id)
} else {
if (this.orderList[item].isHBL) {
noRemove += `分提单${this.orderList[item].hblno ? this.orderList[item].hblno : item}`
} else {
noRemove += `主提单${this.orderList[item].mblno ? this.orderList[item].mblno : item}`
}
}
} else {
tempArr.push(item)
}
})
console.log('删除:', removeArr)
if (noRemove) {
this.$message.error(`${noRemove}已发送,不能删除`)
return false
}
if (removeArr.length === 0) {
this.removeFun(tempArr)
return false
@ -1753,6 +1854,7 @@ export default {
this.$message.error(`${tempstr1}已发送,无需重复发送`)
return false
}
debugger
if (sendArr.length === 0) {
this.$message.error('暂无可发送舱单')
return false
@ -1762,6 +1864,9 @@ export default {
seaeEdiCustEDI(query).then((res) => {
if (res.success) {
this.$message.success('发送成功')
this.selectArr.map((item, index) => {
this.orderList[item].state = '已发送'
})
} else {
this.$message.error(res.message)
}
@ -1782,8 +1887,9 @@ export default {
} else if (['shippername', 'notifypartyname', 'consigneename'].includes(type)) {
this.orderDetails[type] = res.title || ''
this.orderDetails[type.replace('name', 'addR1')] = res.content || ''
} else if (['shippercountry', 'consigneecountry', 'notifypartycountry'].includes(type)) {
this.orderDetails[type] = res.enName || ''
} else if (['shippercountryName', 'consigneecountryName', 'notifypartycountryName'].includes(type)) {
this.orderDetails[type] = res.cnName || '' //
this.orderDetails[type.replace('Name', '')] = res.code || '' //
} else if (['portloadid', 'portdischargeid', 'placedeliveryid'].includes(type)) {
this.orderDetails[type] = res['ediCode'] || ''
this.orderDetails[type.replace('id', '')] = res['code'] || ''
@ -1794,12 +1900,28 @@ export default {
} else if (type === 'yard') {
this.orderDetails[type] = res.name || ''
this.orderDetails[`${type}id`] = res.code || ''
} else if (type === 'carrierid') {
this.orderDetails.carrier = res.enName || ''
} else if (type === 'carrier') {
this.orderDetails.carrier = res.ediCode || ''
this.orderDetails.carrierid = res.code || ''
this.orderDetails.carrierName = res.enName || ''
}
console.log('=== 预订舱信息 ===', this.orderDetails)
},
getAutoViewRes ({ type, res }) {
if (type === 'vessel') {
this.orderDetails.vessel = res.vessel || ''
} else if (['shippername', 'notifypartyname', 'consigneename'].includes(type)) {
this.orderDetails[type] = res.title || ''
this.orderDetails[type.replace('name', 'addR1')] = res.content || ''
} else if (['shippercountryName', 'consigneecountryName', 'notifypartycountryName'].includes(type)) {
this.orderDetails[type] = res.cnName || '' //
this.orderDetails[type.replace('Name', '')] = res.code || '' //
} else if (['portloadid', 'portdischargeid', 'placedeliveryid'].includes(type)) {
this.orderDetails[type] = res['ediCode'] || ''
this.orderDetails[type.replace('id', '')] = res['code'] || ''
}
console.log('== 模糊搜索后的预定舱 ==', this.orderDetails)
},
getTextareaChange({ type, value }) {
this.orderDetails[type] = value
this.$forceUpdate()
@ -1998,6 +2120,13 @@ export default {
// return false
// }
const $data = JSON.parse(JSON.stringify(this.orderDetails))
if ($data.isHBL && !$data.hblno) {
this.$message.error('请填写分提单号')
return false
} else if (!$data.isHBL && !$data.mblno) {
this.$message.error('请填写主提单号')
return false
}
$data.ediCtn.map((item, index) => {
delete item.rowKey
})
@ -2007,6 +2136,7 @@ export default {
res.data[0].ediCtn.map((item, index) => {
item.rowKey = index
})
res.data[0].isHBL = !!res.data[0].hblno
this.orderList[this.editIndex] = res.data[0]
this.orderDetails = res.data[0]
} else {
@ -2024,7 +2154,8 @@ export default {
addOrder() {
this.getNoDataInit(true)
this.editIndex = this.orderList.length - 1
}
},
},
}
</script>

Loading…
Cancel
Save