修改输入框 + 搜索输入防抖

dev
lilu 2 years ago
parent 7c66d9c8fa
commit 9e9bf94531

@ -1,69 +0,0 @@
<template>
<div class="booking-detail">
<!-- 基本信息 -->
<basicInfo :type="type"></basicInfo>
<!-- 收发通信息 -->
<mailingInfo></mailingInfo>
<!-- 货物信息 -->
<cargoInfo></cargoInfo>
<!-- 签单信息 -->
<billInfo></billInfo>
<!-- 备注信息 -->
<remarksInfo></remarksInfo>
<!-- 箱型 -->
<goodsTable></goodsTable>
</div>
</template>
<script>
import basicInfo from '../modules/basicInfo'
import mailingInfo from '../modules/mailingInfo'
import cargoInfo from '../modules/cargoInfo'
import billInfo from '../modules/billInfo'
import remarksInfo from '../modules/remarksInfo'
import goodsTable from '../modules/goodsTable'
export default {
components: {
basicInfo,
mailingInfo,
cargoInfo,
billInfo,
remarksInfo,
goodsTable
},
props: {
type: {
type: String,
default: ''
}
},
data() {
return {
}
},
created() {},
methods: {
}
}
</script>
<style lang="less">
.base-tit {
font-size: 14px;
font-weight: 600;
color: #666;
position: relative;
&::before {
content: '';
position: absolute;
width: 3px;
height: 30px;
background: #ccc;
top: 0;
left: 0;
}
i {
margin-right: 10px;
margin-left: 10px;
}
}
</style>

@ -11,7 +11,8 @@
has-feedback has-feedback
prop="bookingEDIExt.sendCode" prop="bookingEDIExt.sendCode"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.sendCode" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.sendCode" /> -->
<inputView type="sendCode" :parentVal="details.sendCode" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -22,20 +23,10 @@
has-feedback has-feedback
prop="bookingEDIExt.receiveCode" prop="bookingEDIExt.receiveCode"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.receiveCode" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.receiveCode" /> -->
<inputView type="receiveCode" :parentVal="details.bookingEDIExt.receiveCode" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<!-- <a-col :span="8">
<a-form-model-item
label="销售EDI代码"
:labelCol="{ xs: { span: 24 }, sm: { span: 9 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
prop="bookingEDIExt.salerCode"
>
<a-input :allowClear="true" v-model="details.bookingEDIExt.salerCode" />
</a-form-model-item>
</a-col> -->
<a-col :span="8"> <a-col :span="8">
<a-form-model-item <a-form-model-item
label="EDI联系人名称" label="EDI联系人名称"
@ -44,7 +35,8 @@
has-feedback has-feedback
prop="bookingEDIExt.ediAttn" prop="bookingEDIExt.ediAttn"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.ediAttn" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.ediAttn" /> -->
<inputView type="ediAttn" :parentVal="details.bookingEDIExt.ediAttn" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -55,7 +47,8 @@
has-feedback has-feedback
prop="bookingEDIExt.ediAttnTel" prop="bookingEDIExt.ediAttnTel"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.ediAttnTel" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.ediAttnTel" /> -->
<inputView type="ediAttnTel" :parentVal="details.bookingEDIExt.ediAttnTel" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -66,7 +59,8 @@
has-feedback has-feedback
prop="bookingEDIExt.ediAttnMail" prop="bookingEDIExt.ediAttnMail"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.ediAttnMail" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.ediAttnMail" /> -->
<inputView type="ediAttnMail" :parentVal="details.bookingEDIExt.ediAttnMail" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -77,7 +71,8 @@
has-feedback has-feedback
prop="bookingEDIExt.amsConsignee" prop="bookingEDIExt.amsConsignee"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.amsConsignee" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.amsConsignee" /> -->
<inputView type="amsConsignee" :parentVal="details.bookingEDIExt.amsConsignee" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -88,7 +83,8 @@
has-feedback has-feedback
prop="bookingEDIExt.amsNotifyParty" prop="bookingEDIExt.amsNotifyParty"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.amsNotifyParty" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.amsNotifyParty" /> -->
<inputView type="amsNotifyParty" :parentVal="details.bookingEDIExt.amsNotifyParty" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -99,7 +95,8 @@
has-feedback has-feedback
prop="bookingEDIExt.opEName" prop="bookingEDIExt.opEName"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.opEName" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.opEName" /> -->
<inputView type="opEName" :parentVal="details.bookingEDIExt.opEName" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -110,7 +107,8 @@
has-feedback has-feedback
prop="bookingEDIExt.opTel" prop="bookingEDIExt.opTel"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.opTel" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.opTel" /> -->
<inputView type="opTel" :parentVal="details.bookingEDIExt.opTel" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -121,7 +119,8 @@
has-feedback has-feedback
prop="bookingEDIExt.opEmail" prop="bookingEDIExt.opEmail"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.opEmail" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.opEmail" /> -->
<inputView type="opEmail" :parentVal="details.bookingEDIExt.opEmail" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -132,7 +131,8 @@
has-feedback has-feedback
prop="bookingEDIExt.goodsName" prop="bookingEDIExt.goodsName"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.goodsName" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.goodsName" /> -->
<inputView type="goodsName" :parentVal="details.bookingEDIExt.goodsName" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -157,7 +157,8 @@
has-feedback has-feedback
prop="scaccode" prop="scaccode"
> >
<a-input :allowClear="true" v-model="details.scaccode" /> <!-- <a-input :allowClear="true" v-model="details.scaccode" /> -->
<inputView type="scaccode" :parentVal="details.scaccode" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -168,7 +169,8 @@
has-feedback has-feedback
prop="itncode" prop="itncode"
> >
<a-input :allowClear="true" v-model="details.itncode" /> <!-- <a-input :allowClear="true" v-model="details.itncode" /> -->
<inputView type="itncode" :parentVal="details.itncode" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -179,7 +181,8 @@
has-feedback has-feedback
prop="bookingEDIExt.orderRemark" prop="bookingEDIExt.orderRemark"
> >
<a-input v-model="details.bookingEDIExt.orderRemark" /> <!-- <a-input v-model="details.bookingEDIExt.orderRemark" /> -->
<inputView type="orderRemark" :parentVal="details.bookingEDIExt.orderRemark" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="23"> <a-col :span="23">
@ -190,7 +193,8 @@
has-feedback has-feedback
prop="freightpayer" prop="freightpayer"
> >
<a-input :allowClear="true" v-model="details.freightpayer" /> <!-- <a-input :allowClear="true" v-model="details.freightpayer" /> -->
<inputView type="freightpayer" :parentVal="details.bookingEDIExt.freightpayer" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="23"> <a-col :span="23">
@ -273,7 +277,8 @@
has-feedback has-feedback
prop="bookingEDIExt.consigneeEdiCode" prop="bookingEDIExt.consigneeEdiCode"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.consigneeEdiCode" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.consigneeEdiCode" /> -->
<inputView type="consigneeEdiCode" :parentVal="details.bookingEDIExt.consigneeEdiCode" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -284,7 +289,8 @@
has-feedback has-feedback
prop="bookingEDIExt.shipperEdiCode" prop="bookingEDIExt.shipperEdiCode"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.shipperEdiCode" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.shipperEdiCode" /> -->
<inputView type="shipperEdiCode" :parentVal="details.bookingEDIExt.shipperEdiCode" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -295,7 +301,8 @@
has-feedback has-feedback
prop="bookingEDIExt.notifyCdoe" prop="bookingEDIExt.notifyCdoe"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.notifyCdoe" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.notifyCdoe" /> -->
<inputView type="notifyCdoe" :parentVal="details.bookingEDIExt.notifyCdoe" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -321,7 +328,8 @@
has-feedback has-feedback
prop="bookingEDIExt.emanifestHbl" prop="bookingEDIExt.emanifestHbl"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.emanifestHbl" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.emanifestHbl" /> -->
<inputView type="emanifestHbl" :parentVal="details.bookingEDIExt.emanifestHbl" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -395,7 +403,8 @@
has-feedback has-feedback
prop="bookingEDIExt.acihbl" prop="bookingEDIExt.acihbl"
> >
<a-input :allowClear="true" v-model="details.bookingEDIExt.acihbl" /> <!-- <a-input :allowClear="true" v-model="details.bookingEDIExt.acihbl" /> -->
<inputView type="acihbl" :parentVal="details.bookingEDIExt.acihbl" @getInputChange="inputChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@ -406,7 +415,12 @@
</div> </div>
</template> </template>
<script> <script>
import inputView from '../modules/inputView'
let timer;
export default { export default {
components: {
inputView
},
props: { props: {
details: { details: {
type: Object, type: Object,
@ -474,6 +488,12 @@ export default {
this.iscontainersoc = this.details.iscontainersoc ? '1' : '0' this.iscontainersoc = this.details.iscontainersoc ? '1' : '0'
}, },
methods: { methods: {
debounce (func, wait, ...args) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
func.apply(this, args);
}, wait);
},
checkbasic () { checkbasic () {
this.$refs.ediFrom.validate(valid => { this.$refs.ediFrom.validate(valid => {
if (valid) { if (valid) {
@ -490,6 +510,17 @@ export default {
handleSaleChange (val) { handleSaleChange (val) {
this.details.bookingEDIExt.salerCode = val.split('|')[0] this.details.bookingEDIExt.salerCode = val.split('|')[0]
this.details.bookingEDIExt.salerCodeName = val.split('|')[1] this.details.bookingEDIExt.salerCodeName = val.split('|')[1]
},
inputChange ({ type, value }) {
const bookingEDIExtArr = ['receiveCode', 'ediAttn', 'ediAttnTel', 'ediAttnMail', 'amsConsignee', 'amsNotifyParty', 'opEName', 'opTel', 'opEmail', 'goodsName', 'orderRemark', 'freightpayer', 'consigneeEdiCode', 'shipperEdiCode', 'notifyCdoe', 'emanifestHbl', 'acihbl']
if (bookingEDIExtArr.includes(type)) {
this.details.bookingEDIExt[type] = value
console.log(this.details.bookingEDIExt[type])
} else {
this.details[type] = value
console.log(this.details[type])
}
this.$forceUpdate()
} }
} }
} }

@ -100,7 +100,7 @@ import cargoInfo from '../modules/cargoInfo'
import billInfo from '../modules/billInfo' import billInfo from '../modules/billInfo'
import remarksInfo from '../modules/remarksInfo' import remarksInfo from '../modules/remarksInfo'
import goodsTable from '../modules/goodsTable' import goodsTable from '../modules/goodsTable'
import basicItem from './basicItem' // import basicItem from './basicItem'
import ediMore from './ediMore' import ediMore from './ediMore'
import { BookingOrderUpdate, BookingOrderAdd } from '@/api/modular/main/BookingLedger' import { BookingOrderUpdate, BookingOrderAdd } from '@/api/modular/main/BookingLedger'
@ -142,7 +142,7 @@ export default {
billInfo, billInfo,
remarksInfo, remarksInfo,
goodsTable, goodsTable,
basicItem, // basicItem,
ediMore ediMore
}, },
data() { data() {

@ -134,7 +134,7 @@ import billInfo from './modules/billInfo'
import remarksInfo from './modules/remarksInfo' import remarksInfo from './modules/remarksInfo'
import goodsTable from './modules/goodsTable' import goodsTable from './modules/goodsTable'
import rightContent from './modules/rightContent' import rightContent from './modules/rightContent'
import basicItem from './components/basicItem' // import basicItem from './components/basicItem'
import ediMore from './components/ediMore' import ediMore from './components/ediMore'
import sedOrder from './components/sedOrder' import sedOrder from './components/sedOrder'
@ -262,7 +262,7 @@ export default {
remarksInfo, remarksInfo,
goodsTable, goodsTable,
rightContent, rightContent,
basicItem, // basicItem,
ediMore, ediMore,
sedOrder sedOrder
}, },

@ -22,8 +22,8 @@
v-model="details.customername" v-model="details.customername"
:data-source="customerDataArr" :data-source="customerDataArr"
@select="customerSelect" @select="customerSelect"
@change="customerChange"
@focus="customerChange" @focus="customerChange"
@change="debounce(customerChange, 300, $event)"
> >
</auto-complete> </auto-complete>
<span <span
@ -45,6 +45,7 @@
has-feedback> has-feedback>
<inputView type="mblno" :parentVal="details.mblno" :ishd="ishd" @getInputChange="inputChange"/> <inputView type="mblno" :parentVal="details.mblno" :ishd="ishd" @getInputChange="inputChange"/>
<!-- <a-input :allowClear="true" v-model="mblno" :disabled="ishd" @onValuesChange="inputChange('mblno')"/> --> <!-- <a-input :allowClear="true" v-model="mblno" :disabled="ishd" @onValuesChange="inputChange('mblno')"/> -->
<!-- <input type="text" class="ant-input" v-model="details.mblno" :disabled="ishd"> -->
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="8"> <a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="8">
@ -64,7 +65,7 @@
/> --> /> -->
<a-select <a-select
v-model="details.carrierid" v-model="details.carrierid"
@change="handleCarrierChange" @change="debounce(handleCarrierChange, 300, $event)"
show-search show-search
:dropdownMatchSelectWidth="false" :dropdownMatchSelectWidth="false"
:filter-option="filterOption" :filter-option="filterOption"
@ -92,7 +93,7 @@
v-model="details.forwarder" v-model="details.forwarder"
:data-source="forwarderDataArr" :data-source="forwarderDataArr"
@select="forwarderSelect" @select="forwarderSelect"
@change="forwarderChange" @change="debounce(forwarderChange, 300, $event)"
@focus="forwarderChange" @focus="forwarderChange"
/> />
<!-- <a-input :allowClear="true" v-model="details.forwarder" /> --> <!-- <a-input :allowClear="true" v-model="details.forwarder" /> -->
@ -167,7 +168,7 @@
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
v-model="details.contractno" v-model="details.contractno"
@select="contractnoSelect" @select="contractnoSelect"
@change="contractnoChange" @change="debounce(contractnoChange, 300, $event)"
@focus="contractnoChange" @focus="contractnoChange"
> >
<template slot="dataSource"> <template slot="dataSource">
@ -206,7 +207,7 @@
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
option-label-prop="value" option-label-prop="value"
@select="vesselSelect" @select="vesselSelect"
@change="vesselChange" @change="debounce(vesselChange, 300, $event)"
@focus="vesselChange" @focus="vesselChange"
> >
<template slot="dataSource"> <template slot="dataSource">
@ -366,7 +367,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="shipagencySelect" @select="shipagencySelect"
@change="shipagencyChange" @change="debounce(shipagencyChange, 300, $event)"
@focus="shipagencyChange" @focus="shipagencyChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -406,7 +407,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="saleSelect" @select="saleSelect"
@change="saleChange" @change="debounce(saleChange, 300, $event)"
@focus="saleChange" @focus="saleChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -428,7 +429,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="opSelect" @select="opSelect"
@change="opChange" @change="debounce(opChange, 300, $event)"
@focus="opChange" @focus="opChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -450,7 +451,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="docSelect" @select="docSelect"
@change="docChange" @change="debounce(docChange, 300, $event)"
@focus="docChange" @focus="docChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -467,13 +468,13 @@
<auto-complete <auto-complete
:allowClear="true" :allowClear="true"
class="customer-input" class="customer-input"
v-model="details.custservice"
:data-source="custserviceUserListArr"
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
v-model="details.custservice"
:data-source="custserviceUserListArr"
@select="custserviceSelect" @select="custserviceSelect"
@change="custserviceChange"
@focus="custserviceChange" @focus="custserviceChange"
@change="debounce(custserviceChange, 300, $event)"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -547,6 +548,7 @@ import {
DjyCustomerContacts DjyCustomerContacts
} from '@/api/modular/main/BookingLedger' } from '@/api/modular/main/BookingLedger'
let timer;
export default { export default {
name: 'BookingDetail', name: 'BookingDetail',
components: { components: {
@ -928,6 +930,12 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
debounce (func, wait, ...args) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
func.apply(this, args);
}, wait);
},
checkbasic () { checkbasic () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs.basicFrom.validate(valid => { this.$refs.basicFrom.validate(valid => {
@ -1266,11 +1274,13 @@ export default {
// //
saleSelect(value) { saleSelect(value) {
console.log('销售选中', value)
this.details.sale = value this.details.sale = value
const index = this.saleUserListArr.indexOf(value) const index = this.saleUserListArr.indexOf(value)
this.details.saleid = this.saleUserList[index].id this.details.saleid = this.saleUserList[index].id
}, },
saleChange(value) { saleChange(value) {
console.log('销售搜索内容: ', value)
if (!value) { if (!value) {
this.details.sale = this.details.sale ? this.details.sale : '' this.details.sale = this.details.sale ? this.details.sale : ''
} }

@ -27,7 +27,7 @@
<a-select <a-select
class="customer-input" class="customer-input"
v-model="details.issuetype" v-model="details.issuetype"
@change="handleIssuetypeChange" @change="debounce(handleIssuetypeChange, 300, $event)"
show-search show-search
:filter-option="filterOption" :filter-option="filterOption"
:dropdownMatchSelectWidth="false" :dropdownMatchSelectWidth="false"
@ -67,7 +67,7 @@
v-model="details.issueplace" v-model="details.issueplace"
:data-source="issueplaceDataArr" :data-source="issueplaceDataArr"
@select="issueplaceSelect" @select="issueplaceSelect"
@change="issueplaceChange" @change="debounce(issueplaceChange, 300, $event)"
@focus="issueplaceChange" @focus="issueplaceChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -146,7 +146,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px'}" :dropdown-style="{ width: '200px'}"
@select="prepardatSelect" @select="prepardatSelect"
@change="prepardatChange" @change="debounce(prepardatChange, 300, $event)"
@focus="prepardatChange" @focus="prepardatChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -167,7 +167,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px'}" :dropdown-style="{ width: '200px'}"
@select="payableatSelect" @select="payableatSelect"
@change="payableatChange" @change="debounce(payableatChange, 300, $event)"
@focus="payableatChange" @focus="payableatChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -188,7 +188,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px'}" :dropdown-style="{ width: '200px'}"
@select="blfrtSelect" @select="blfrtSelect"
@change="blfrtChange" @change="debounce(blfrtChange, 300, $event)"
@focus="blfrtChange" @focus="blfrtChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -221,7 +221,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px'}" :dropdown-style="{ width: '200px'}"
@select="serviceSelect" @select="serviceSelect"
@change="serviceChange" @change="debounce(serviceChange, 300, $event)"
@focus="serviceChange" @focus="serviceChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -369,6 +369,7 @@
import { AutoComplete } from 'ant-design-vue' import { AutoComplete } from 'ant-design-vue'
import { GetPortloadlist, GetPortlist, GetFrt, GetService, Codeissuetypelist } from '@/api/modular/main/BookingLedger' import { GetPortloadlist, GetPortlist, GetFrt, GetService, Codeissuetypelist } from '@/api/modular/main/BookingLedger'
let timer;
export default { export default {
name: '', name: '',
components: { components: {
@ -520,6 +521,12 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
debounce (func, wait, ...args) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
func.apply(this, args);
}, wait);
},
checkbasic () { checkbasic () {
this.$refs.billFrom.validate(valid => { this.$refs.billFrom.validate(valid => {
if (valid) { if (valid) {

@ -45,8 +45,8 @@
v-model="details.goodsname" v-model="details.goodsname"
:data-source="goodsnameDataArr" :data-source="goodsnameDataArr"
@select="goodsnameSelect" @select="goodsnameSelect"
@change="goodsnameChange"
@focus="goodsnameChange" @focus="goodsnameChange"
@change="debounce(goodsnameChange, 300, $event)"
/> />
</a-form-model-item> </a-form-model-item>
</div> </div>
@ -97,6 +97,8 @@ import {
getGoodsname getGoodsname
} from '@/api/modular/main/BookingLedger' } from '@/api/modular/main/BookingLedger'
import { AutoComplete } from 'ant-design-vue' import { AutoComplete } from 'ant-design-vue'
let timer;
export default { export default {
name: '', name: '',
components: { components: {
@ -175,6 +177,12 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
debounce (func, wait, ...args) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
func.apply(this, args);
}, wait);
},
checkbasic () { checkbasic () {
this.$refs.cargoFrom.validate(valid => { this.$refs.cargoFrom.validate(valid => {
console.log(valid) console.log(valid)

@ -1,12 +1,15 @@
<template> <template>
<a-input <div class="input-content">
<input
class="ant-input input-box"
:type="inputType" :type="inputType"
:allowClear="true"
v-model="value" v-model="value"
@blur="inputBlur"
:disabled="ishd" :disabled="ishd"
@blur="inputBlur"
@change="inputChange" @change="inputChange"
/> />
<a-icon type="close-circle" theme="filled" class="ant-input-suffix input-icon" @click="clearInput" v-if="value"/>
</div>
</template> </template>
<script> <script>
export default { export default {
@ -14,25 +17,25 @@ export default {
props: { props: {
parentVal: { parentVal: {
type: [String, Number], type: [String, Number],
default: '', default: ''
}, },
type: { type: {
type: String, type: String,
default: '', default: ''
}, },
ishd: { ishd: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
inputType: { inputType: {
type: String, type: String,
default: 'text', default: 'text'
}, },
}, },
data() { data() {
return { return {
// value: this.parentVal || '', // value: this.parentVal || '',
value: this.parentVal !== 0 && !this.parentVal ? '' : this.parentVal, value: this.parentVal !== 0 && !this.parentVal ? '' : this.parentVal
} }
}, },
watch: { watch: {
@ -40,7 +43,8 @@ export default {
this.value = nval this.value = nval
}, },
}, },
mounted() {}, mounted() {
},
methods: { methods: {
inputBlur() { inputBlur() {
this.$emit('getInputChange', { this.$emit('getInputChange', {
@ -55,7 +59,44 @@ export default {
value: this.value value: this.value
}) })
} }
},
clearInput () {
this.value = ''
this.$emit('getInputChange', {
type: this.type,
value: this.value
})
} }
} }
} }
</script> </script>
<style lang="less">
.input-content{
position: relative;
.input-box {
width: 100%;
}
.input-icon{
position: absolute;
top: 50%;
z-index: 2;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
color: rgba(0, 0, 0, 0.25);
line-height: 0;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
opacity: 0;
right: 10px;
}
&:hover{
.input-icon{
opacity: 1;
}
}
}
</style>

@ -21,9 +21,10 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="shipperSelect" @select="shipperSelect"
@change="shipperChange"
@focus="shipperChange" @focus="shipperChange"
@change="debounce(shipperChange, 300, $event)"
/> />
<!-- @change="shipperChange" -->
<a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('shipper')"> <a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('shipper')">
保存 保存
</a-button> </a-button>
@ -66,9 +67,10 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="consigneeSelect" @select="consigneeSelect"
@change="consigneeChange"
@focus="consigneeChange" @focus="consigneeChange"
@change="debounce(consigneeChange, 300, $event)"
/> />
<!-- @change="consigneeChange" -->
<a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('consignee')"></a-button <a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('consignee')"></a-button
> >
<div class="right"> <div class="right">
@ -108,9 +110,10 @@
class="customer-input" class="customer-input"
:data-source="notifyDataArr" :data-source="notifyDataArr"
@select="notifySelect" @select="notifySelect"
@change="notifyChange"
@focus="notifyChange" @focus="notifyChange"
@change="debounce(notifyChange, 300, $event)"
/> />
<!-- @change="notifyChange" -->
<a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('notifyparty')"></a-button <a-button class="save-btn" type="link" size="small" icon="save" @click="saveModel('notifyparty')"></a-button
> >
<div class="right"> <div class="right">
@ -166,7 +169,7 @@
class="customer-input" class="customer-input"
:default-value="details.yard" :default-value="details.yard"
v-model="details.yard" v-model="details.yard"
@change="handleYardChange" @change="debounce(handleYardChange, 300, $event)"
show-search show-search
:filter-option="filterOption" :filter-option="filterOption"
:dropdownMatchSelectWidth="false" :dropdownMatchSelectWidth="false"
@ -201,9 +204,10 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="customserSelect" @select="customserSelect"
@change="customserChange"
@focus="customserChange" @focus="customserChange"
@change="debounce(customserChange, 300, $event)"
/> />
<!-- @change="customserChange" -->
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -223,8 +227,8 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="truckerSelect" @select="truckerSelect"
@change="truckerChange"
@focus="truckerChange" @focus="truckerChange"
@change="debounce(truckerChange, 300, $event)"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -245,8 +249,8 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="agentidSelect" @select="agentidSelect"
@change="agentidChange"
@focus="agentidChange" @focus="agentidChange"
@change="debounce(agentidChange, 300, $event)"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -341,8 +345,8 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '300px' }" :dropdown-style="{ width: '300px' }"
@select="placereceiptSelect" @select="placereceiptSelect"
@change="placereceiptChange"
@focus="placereceiptChange" @focus="placereceiptChange"
@change="debounce(placereceiptChange, 300, $event)"
></auto-complete> ></auto-complete>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -376,8 +380,8 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '300px' }" :dropdown-style="{ width: '300px' }"
@select="portloadSelect" @select="portloadSelect"
@change="portloadChange"
@focus="portloadChange" @focus="portloadChange"
@change="debounce(portloadChange, 300, $event)"
></auto-complete> ></auto-complete>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -411,8 +415,8 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '300px' }" :dropdown-style="{ width: '300px' }"
@select="transportSelect" @select="transportSelect"
@change="transportChange"
@focus="transportChange" @focus="transportChange"
@change="debounce(transportChange, 300, $event)"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -446,8 +450,8 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '300px' }" :dropdown-style="{ width: '300px' }"
@select="portdischargeSelect" @select="portdischargeSelect"
@change="portdischargeChange"
@focus="portdischargeChange" @focus="portdischargeChange"
@change="debounce(portdischargeChange, 300, $event)"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -481,8 +485,8 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '300px' }" :dropdown-style="{ width: '300px' }"
@select="destinationSelect" @select="destinationSelect"
@change="destinationChange"
@focus="destinationChange" @focus="destinationChange"
@change="debounce(destinationChange, 300, $event)"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -516,7 +520,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '300px' }" :dropdown-style="{ width: '300px' }"
@select="placedeliverySelect" @select="placedeliverySelect"
@change="placedeliveryChange" @change="debounce(placedeliveryChange, 300, $event)"
@focus="placedeliveryChange" @focus="placedeliveryChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -567,7 +571,7 @@
:dropdown-match-select-width="false" :dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }" :dropdown-style="{ width: '200px' }"
@select="kindpkgsSelect" @select="kindpkgsSelect"
@change="kindpkgsChange" @change="debounce(kindpkgsChange, 300, $event)"
@focus="kindpkgsChange" @focus="kindpkgsChange"
/> />
</a-form-model-item> </a-form-model-item>
@ -745,6 +749,8 @@ import {
BookingTemplateAdd, BookingTemplateAdd,
DjyCustomerpage DjyCustomerpage
} from '@/api/modular/main/BookingLedger' } from '@/api/modular/main/BookingLedger'
let timer;
export default { export default {
components: { components: {
XCard, XCard,
@ -1083,6 +1089,12 @@ export default {
}, 2000) }, 2000)
}, },
methods: { methods: {
debounce (func, wait, ...args) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
func.apply(this, args);
}, wait);
},
checkbasic () { checkbasic () {
this.$refs.mailingFrom.validate(valid => { this.$refs.mailingFrom.validate(valid => {
console.log(valid) console.log(valid)

Loading…
Cancel
Save