1 下拉加载切换页面获取新数据

2 模糊搜索,已有内容的情况下不调接口
pull/1/head
lilu 2 years ago
parent d14b36def1
commit f17d5b6343

@ -109,7 +109,7 @@
:data-source="forwarderDataArr"
@select="forwarderSelect"
@change="debounce(forwarderChange, 300, $event)"
@focus="forwarderChange"
@focus="forwarderChangeFirst"
/>
<!-- <a-input :allowClear="true" v-model="details.forwarder" /> -->
</a-form-model-item>
@ -185,10 +185,10 @@
v-model="details.contractno"
@select="contractnoSelect"
@change="debounce(contractnoChange, 300, $event)"
@focus="contractnoChange"
@focus="contractnoChangeFirst"
>
<template slot="dataSource">
<a-select-option v-for="(contractno, cindex) in contractnoData" :key="cindex" :value="cindex + ''">
<a-select-option v-for="(contractno, cindex) in contractnoData" :key="cindex" :value="cindex + '/' + contractno.contractNo">
<div class="contractno-label">
<div class="title"> {{ contractno.contractNo }} / {{ contractno.contractName || '--' }} </div>
<div class="note"><span>{{ contractno.contractNote || '--' }}</span></div>
@ -225,10 +225,10 @@
option-label-prop="value"
@select="vesselSelect"
@change="debounce(vesselChange, 300, $event)"
@focus="vesselChange"
@focus="vesselChangeFirst"
>
<template slot="dataSource">
<a-select-option v-for="(vessel, index) in vesselData" :key="index" :value="index + ''">
<a-select-option v-for="(vessel, index) in vesselData" :key="index" :value="vessel.vessel">
<div class="vessel-label">
<div class="title"> {{ vessel.vessel }} </div>
<div class="voyno">航次 <span>{{ vessel.voyno || '--' }}</span></div>
@ -1020,6 +1020,7 @@ export default {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
this.init()
}
}
},
@ -1227,6 +1228,11 @@ export default {
}
this.getDjyCustomerpage(value, 'forwarder', 'booking_agent')
},
forwarderChangeFirst(value) {
console.log('获取焦点', value, this.details.forwarder)
if (this.details.forwarder) { return false }
this.getDjyCustomerpage(value, 'forwarder', 'booking_agent')
},
// - end
// - start
@ -1235,7 +1241,7 @@ export default {
KeyWord: name
})
.then(res => {
if (res.code === 200) {
if (res.code === 200) {
this.carrierData = res.data
const arr = []
res.data.map((item, index) => {
@ -1322,7 +1328,12 @@ export default {
})
},
vesselSelect(value) {
const index = Number(value)
let index = null
this.vesselData.map((item, oindex) => {
if (value === item.vessel) {
index = oindex
}
})
this.details.vessel = this.vesselData[index].vessel
this.details.atd = this.vesselData[index].atd
this.details.etd = this.vesselData[index].etd
@ -1335,6 +1346,10 @@ export default {
}
this.getVessel(value)
},
vesselChangeFirst(value) {
if (this.details.vessel) { return false }
this.getVessel(value)
},
// - end
// - start
@ -1620,14 +1635,21 @@ export default {
})
},
contractnoSelect(value) {
this.details.contractno = this.contractnoData[Number(value)].contractNo
console.log('运费协议 - 选中', value, this.contractnoData)
this.details.contractno = value.substr(value.indexOf('/') + 1, value.length - 1)
},
contractnoChange(value) {
console.log('运费协议 - 内容改变', value, this.contractnoData)
if (!value) {
this.details.vessel = this.details.vessel ? this.details.vessel : ''
this.details.contractno = this.details.contractno ? this.details.contractno : ''
}
this.getContractno(value)
},
contractnoChangeFirst(value) {
console.log('运费协议 - first', value, this.contractnoData)
if (this.details.contractno) { return false }
this.getContractno(value)
},
// - end
inputChange ({ type, value }) {
this.details[type] = value

@ -438,6 +438,7 @@ export default {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
this.init()
}
}
},

@ -946,6 +946,7 @@ export default {
this.shippername = ''
this.consigneename = ''
this.notifypartyname = ''
this.init()
}
}
},

Loading…
Cancel
Save