@ -1,26 +1,35 @@
< template >
< a -collapse class = "collapse-box" :bordered ="false" v-model ="showKey" >
< a -collapse -panel key = "1" :showArrow ="false" >
< template slot = "header" >
< div class = "base-tit" > < i class = "iconfont icon-goods" > < / i > 货物信息 < span
class = "click-btn"
@ click . stop = "tabStopFun" > < / span > < / div >
< template # header >
< div class = "base-tit"
> < i class = "iconfont icon-goods" > < / i > 货物信息
< span class = "click-btn" @click.stop ="tabStopFun" > < / s p a n
> < / div >
< / template >
< template slot = "extra" >
< div class = "tab-change" > < i class = "iconfont icon-xia" : class = "{ 'active': !showKey.includes('1') }" > < / i > < / div >
< template # extra >
< div class = "tab-change"
> < i class = "iconfont icon-xia" : class = "{ active: !showKey.includes('1') }" > < / i
> < / div >
< / template >
< div class = "container cargo-info" >
< a -form -model :selfUpdate ="true" ref = "cargoFrom" :model ="details" :rules ="rules" >
< a -form :selfUpdate ="true" ref = "cargoFrom" :model ="details" :rules ="rules" >
< a -row :gutter ="10" >
< a -col :span ="5" >
< div class = "cargo-info-tit" : class = "{ 'required': rules['marks'] && rules['marks'][0].required }" >
< div > Seal No . ( 封志号 ) < span
@ click = "handleOpen(1)"
style = "cursor: pointer;"
class = "copy-btn iconfont icon-bianji" > < / span > < / div >
< div
class = "cargo-info-tit"
: class = "{ required: rules['marks'] && rules['marks'][0].required }"
>
< div
> Seal No . ( 封志号 ) < span
@ click = "handleOpen(1)"
style = "cursor: pointer"
class = "copy-btn iconfont icon-bianji"
> < / s p a n
> < / div >
< div > Marks & Nos . ( 标记与号码 ) < / div >
< / div >
< a -form -model -item has -feedback prop = "marks" class = "textarea-label" label = "" >
< a -form - item has -feedback prop = "marks" class = "textarea-label" label = "" >
< div class = "bottom" >
< textareaView
class = "input-box"
@ -30,862 +39,54 @@
: disabled = "BookingLockOrder['marks'] && isLockBooking"
: height = "100"
: openToCDB = "true"
@ getTextareaChange = "getTextareaChange" / >
@ getTextareaChange = "getTextareaChange"
/ >
< div
class = "line-count"
id = "marks-scroll-right"
v - if = "Object.keys(details).length > 1 && details.marks.length > 1" >
< div v-for ="(num, index) in details.marks.split('\n')" :key ="index" > {{ num.length }} < / div >
< / div >
< / div >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="10" >
< div class = "line" >
<!-- < div
class = "left"
: class = "{ 'required': rules['description'] && rules['description'][0].required }"
v - if = "details.carrierid !== 'PIL'" >
< div > Description of Goods < / div >
< div > ( 包装种类与货名 ) < span
@ click = "handleOpen(2)"
style = "cursor: pointer;"
class = "copy-btn iconfont icon-bianji" > < / span > < / div >
< / div > -- >
< div class = "left" >
< div class = "title" : class = "{ 'required': rules['description'] && rules['description'][0].required }" >
< span
@ click = "handleOpen(2)"
style = "cursor: pointer;color: black;margin: 0px;"
class = "copy-btn iconfont icon-bianji" > < / span >
Description of Goods ( 包装种类与货名 ) < / div >
< a -form -model -item
has - feedback
prop = "goodsname"
label = ""
: class = "{ 'goods-name-box': rules['goodsname'] && rules['goodsname'][0].required }" >
< i
style = "top: 4px;"
class = "icon required goods-required"
v - if = "rules['goodsname'] && rules['goodsname'][0].required" > < / i >
<!-- : showLabel = "['goodsNameEN', 'goodsCode']" -- >
< selectView
type = "goodsname"
: defaultVal = "details.goodsname"
searchApi = "getGoodsname"
: disabled = "BookingLockOrder['goodsname'] && isLockBooking"
: searchQuery = "{ queryItem: '', top: 50 }"
: showLabel = "['goodsNameEN', 'goodsCode']"
: openSearch = "true"
@ change = "getSelectViewRes"
style = "width: 75%;max-width:210px;" > < / selectView >
< / a - f o r m - m o d e l - i t e m >
< / div >
< div class = "cargo-mark" >
< div : class = "{ 'required': rules['cargoid'] && rules['cargoid'][0].required }" class = "tit" > 货物标志 < / div >
< a -form -model -item class = "cargoid" has -feedback prop = "cargoid" label = "" style = "margin-top:-6px;" >
< selectView
type = "cargoid"
: defaultVal = "details.cargoid"
searchApi = "cargoData"
: searchQuery = "{ name: '' }"
: disabled = "BookingLockOrder['cargoid'] && isLockBooking"
: showLabel = "['name']"
: openSearch = "false"
@ change = "getSelectViewRes"
style = "width: 120px;margin-top:7px;" > < / selectView >
< / a - f o r m - m o d e l - i t e m >
< / div >
< div class = "input" >
< div : class = "{ 'required': rules['hscode'] && rules['hscode'][0].required }" calss = "tit" > HS编码 < / div >
< a -form -model -item class = "cargoid" has -feedback prop = "hscode" label = "" style = "margin-top:-2px;" >
<!-- < a -input size = "small" :allowClear ="true" v -model = " details.hscode " / > -- >
< inputView : ishd = "BookingLockOrder['hscode'] && isLockBooking" type = "hscode" size = "small" :parentVal ="details.hscode" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / div >
< / div >
< a -form -model -item has -feedback prop = "description" class = "textarea-label" label = "" >
< div class = "bottom" >
< textareaView
id = "description-scroll"
class = "input-box"
: parentVal = "details.description"
: disabled = "BookingLockOrder['description'] && isLockBooking"
type = "description"
: height = "100"
: openToCDB = "true"
@ getTextareaChange = "getTextareaChange" / >
< div
class = "line-count"
id = "description-scroll-right"
v - if = "Object.keys(details).length > 1 && details.description.length > 1" >
< div v-for ="(num, index) in details.description.split('\n')" :key ="index" > {{ num.length }} < / div >
v - if = "Object.keys(details).length > 1 && details.marks.length > 1"
>
< div v-for ="(num, index) in details.marks.split('\n')" :key ="index" > {{
num . length
} } < / div >
< / div >
< / div >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="9" >
< a -col :span ="12" >
< a -form -model -item
class = "from-label pkgs-line-box"
label = "件数"
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
has - feedback
prop = "pkgs" >
< div class = "line-box" >
< a -input
: allowClear = "true"
size = "small"
: disabled = "BookingLockOrder['pkgs'] && isLockBooking"
v - model = "details.pkgs"
type = "number"
@ change = "changePkgs" / >
< i class = "iconfont icon-bianji1 edit-icon" @click ="editTextEntryModel('pkgs')" > < / i >
< / div >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" style = "overflow: hidden" >
< a -form -model -item
class = "from-label"
label = "包装"
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
has - feedback
prop = "kindpkgs" >
< selectView
type = "kindpkgs"
: defaultVal = "details.kindpkgs"
searchApi = "GetPackage"
: disabled = "BookingLockOrder['kindpkgs'] && isLockBooking"
: searchQuery = "{ KeyWord: '' }"
: showLabel = "['name']"
: openSearch = "false"
@ change = "getSelectViewRes" >
< / selectView >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" style = "overflow: hidden" >
< a -form -model -item
class = "from-label kgs-line-box"
label = "毛重"
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
has - feedback
prop = "kgs" >
< div class = "line-box" >
< a -input : disabled = "BookingLockOrder['kgs'] && isLockBooking" size = "small" :allowClear ="true" v -model = " details.kgs " / >
< i class = "iconfont icon-bianji1 edit-icon" @click ="editTextEntryModel('kgs')" > < / i >
< span class = "unit" > KGS < / span >
< / div >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" style = "overflow: hidden" >
< a -form -model -item
class = "from-label cbm-line-box"
label = "尺寸"
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
has - feedback
prop = "cbm" >
< div class = "line-box" >
< a -input : disabled = "BookingLockOrder['cbm'] && isLockBooking" size = "small" :allowClear ="true" v -model = " details.cbm " / >
< i class = "iconfont icon-bianji1 edit-icon" @click ="editTextEntryModel('cbm')" > < / i >
< span class = "unit" > CBM < / span >
< / div >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< template v-if ="details.cargoid == 'R'" >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "设置温度"
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
has - feedback
prop = "tempset"
>
< inputView : ishd = "BookingLockOrder['tempset'] && isLockBooking" type = "tempset" size = "small" :parentVal ="details.tempset" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "冷藏通风量"
: labelCol = "labelColCode"
: wrapperCol = "wrapperColCode"
has - feedback
prop = "reeferf"
>
< inputView : ishd = "BookingLockOrder['reeferf'] && isLockBooking" type = "reeferf" size = "small" :parentVal ="details.reeferf" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "温度单位"
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
has - feedback
prop = "tempid"
>
< a -select : disabled = "BookingLockOrder['tempid'] && isLockBooking" size = "small" : default -value = " details.tempid | | ' C 摄 氏 ' " v-model ="details.tempid" >
< a -select -option value = "C" > C摄氏 < / a - s e l e c t - o p t i o n >
< a -select -option value = "F" > F华氏 < / a - s e l e c t - o p t i o n >
< / a - s e l e c t >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "最低温度"
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
has - feedback
prop = "tempmin"
>
< inputView : ishd = "BookingLockOrder['tempmin'] && isLockBooking" type = "tempmin" size = "small" :parentVal ="details.tempmin" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "最高温度"
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
has - feedback
prop = "tempmax"
>
< inputView : ishd = "BookingLockOrder['tempmax'] && isLockBooking" type = "tempmax" size = "small" :parentVal ="details.tempmax" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "湿度"
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
has - feedback
prop = "humidity" >
< inputView : ishd = "BookingLockOrder['humidity'] && isLockBooking" type = "humidity" size = "small" :parentVal ="details.humidity" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< / template >
< template v-if ="details.cargoid == 'D'" >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "危险品等级"
: labelCol = "labelColCode"
: wrapperCol = "wrapperColCode"
has - feedback
prop = "dclass"
>
< inputView : ishd = "BookingLockOrder['dclass'] && isLockBooking" type = "dclass" size = "small" :parentVal ="details.dclass" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "危险品编号"
: labelCol = "labelColCode"
: wrapperCol = "wrapperColCode"
has - feedback
prop = "dunno"
>
< inputView : ishd = "BookingLockOrder['dunno'] && isLockBooking" type = "dunno" size = "small" :parentVal ="details.dunno" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "危险品页号"
: labelCol = "labelColCode"
: wrapperCol = "wrapperColCode"
has - feedback
prop = "dpage"
>
< inputView : ishd = "BookingLockOrder['dpage'] && isLockBooking" type = "dpage" size = "small" :parentVal ="details.dpage" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "危险品标签"
: labelCol = "labelColCode"
: wrapperCol = "wrapperColCode"
has - feedback
prop = "dlabel"
>
< inputView : ishd = "BookingLockOrder['dlabel'] && isLockBooking" type = "dlabel" size = "small" :parentVal ="details.dlabel" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< a -col :span ="12" >
< a -form -model -item
class = "from-label"
label = "危险品联系人"
: labelCol = " {
xs : { span : 24 } ,
sm : { span : 10 } ,
md : { span : 12 }
} "
: wrapperCol = " {
xs : { span : 24 } ,
sm : { span : 14 } ,
md : { span : 12 }
} "
has - feedback
prop = "linkman"
>
< inputView : ishd = "BookingLockOrder['linkman'] && isLockBooking" type = "linkman" size = "small" :parentVal ="details.linkman" @getInputChange ="inputChange" / >
< / a - f o r m - m o d e l - i t e m >
< / a - c o l >
< / template >
< / a - c o l >
< a -col class = "num-box" :span ="24" >
< span class = "label" > 件数大写 : < / span >
< a -input
: allowClear = "true"
class = "input-val num-box-right"
v - model = "details.totalno"
disabled
placeholder = "自动生成" / >
< / a - f o r m - i t e m >
< / a - c o l >
< / a - r o w >
< / a - f o r m -m o d e l >
< / a - f o r m >
< / div >
< a -modal :title ="modelTitle" :width ="900" :visible ="visible" @ ok = "visible = false" @ cancel = "visible = false" >
< div >
< div v-if ="modelType === 1" style="display: flex;" >
< textareaView
class = "input-box"
id = "marks-scroll"
: parentVal = "details.marks"
type = "marks"
: height = "500"
style = "font-size:20px;margin-right: 10px;"
: openToCDB = "true"
@ getTextareaChange = "getTextareaChange" / >
< div
class = "line-count"
id = "marks-scroll-right"
v - if = "Object.keys(details).length > 1 && details.marks.length > 1" >
< div v-for ="(num, index) in details.marks.split('\n')" :key ="index" > {{ num.length }} < / div >
< / div >
< / div >
< div v-if ="modelType === 2" style="display: flex;" >
< textareaView
id = "description-scroll"
class = "input-box"
: parentVal = "details.description"
type = "description"
: height = "500"
style = "font-size:20px;margin-right: 10px;"
: openToCDB = "true"
@ getTextareaChange = "getTextareaChange" / >
< div
class = "line-count"
id = "description-scroll-right"
v - if = "Object.keys(details).length > 1 && details.description.length > 1" >
< div v-for ="(num, index) in details.description.split('\n')" :key ="index" > {{ num.length }} < / div >
< / div >
< / div >
< / div >
< / a - m o d a l >
< a -modal width = "500px" :maskClosable ="false" v-model ="textEntryModalVisible" :title ="textEntryModalTitle" >
< div class = "text-entry-box" >
<!-- 件数包装 -- >
< a -form v-if ="textEntryType === 'pkgs'" >
< div class = "text-input" >
< a -textarea
v - model = "details.pkgstotal"
placeholder = "请输入内容"
: auto - size = "{ minRows: 6, maxRows: 9 }"
@ change = "pkgsTextChange" / >
< / div >
< div class = "total" v-if ="pkgstotalRes" > 总 计 : {{ pkgstotalRes }} < / div >
< / a - f o r m >
<!-- 毛重 -- >
< a -form v-if ="textEntryType === 'kgs'" >
< div class = "text-input" >
< a -textarea
v - model = "details.kgstotal"
placeholder = "请输入内容"
: auto - size = "{ minRows: 6, maxRows: 9 }"
@ change = "kgsTextChange" / >
< / div >
< div class = "total" v-if ="kgstotalRes" > 总 计 : {{ kgstotalRes }} / KGS < / div >
< / a - f o r m >
<!-- 尺码 -- >
< a -form v-if ="textEntryType === 'cbm'" >
< div class = "text-input" >
< a -textarea
v - model = "details.cbmtotal"
placeholder = "请输入内容"
: auto - size = "{ minRows: 6, maxRows: 9 }"
@ change = "cbmTextChange" / >
< / div >
< div class = "total" v-if ="cbmtotalRes" > 总 计 : {{ cbmtotalRes }} / CBM < / div >
< / a - f o r m >
< / div >
< template slot = "footer" >
< a -button type = "primary" @click ="textEntryClose" > 确 定 < / a -button >
< / template >
< / a - m o d a l >
< / a - c o l l a p s e - p a n e l >
< / a - c o l l a p s e >
< / template >
< script >
import textareaView from '../components/textareaView'
import selectView from '../components/selectView'
import inputView from '../components/inputView'
let timer ;
export default {
name : '' ,
components : {
textareaView ,
selectView ,
inputView
} ,
props : {
details : {
type : Object ,
default : ( ) => {
return { }
}
} ,
moreStr : {
type : String ,
default : ''
} ,
rules : {
type : Object ,
default : ( ) => {
return { }
}
} ,
inSave : {
type : Boolean ,
default : false
} ,
isParent : {
type : String ,
default : ''
} ,
isLockBooking : {
type : Boolean ,
default : false
}
} ,
data ( ) {
return {
showKey : [ '1' ] ,
modelTitle : '' ,
modelType : 0 ,
visible : false ,
labelCol : {
xs : { span : 24 } ,
sm : { span : 8 } ,
md : { span : 8 }
} ,
wrapperCol : {
xs : { span : 24 } ,
sm : { span : 16 } ,
md : { span : 16 }
} ,
labelColCode : {
xs : { span : 24 } ,
sm : { span : 8 } ,
md : { span : 10 }
} ,
wrapperColCode : {
xs : { span : 24 } ,
sm : { span : 16 } ,
md : { span : 14 }
} ,
shippername : '' ,
consigneename : '' ,
notifypartyname : '' ,
foreignAgentname : '' ,
notifypartY2name : '' ,
modelVisible : false ,
modelconfirm : false ,
BookingLockOrder : { } ,
modelName : '' ,
yardType : '' ,
yardVisible : false ,
customerModelconfirm : false ,
textEntryModalVisible : false ,
textEntryType : '' ,
textEntryModalTitle : '' ,
pkgstotalRes : 0 ,
kgstotalRes : 0 ,
cbmtotalRes : 0 ,
portdischargeHasline : false ,
destinationidHasline : false ,
userHasLine : false
/ / g o o d s n a m e D a t a : [ ]
}
} ,
watch : {
details : {
handler ( nval , oval ) {
if ( ! this . inSave ) {
this . $emit ( 'changeDetail' , {
detail : nval ,
type : 'cargoInfo'
} )
}
} ,
deep : true
} ,
moreStr ( nval , oval ) {
if ( nval !== oval ) {
let str = this . details . description
if ( str . length > 0 ) {
str += '\n'
}
this . details . description = str + nval
}
} ,
'$route.query' : {
immediate : true ,
handler ( nD , oD ) {
this . id = this . $route . query . id
}
}
} ,
created ( ) { } ,
mounted ( ) {
const marksScroll = document . getElementById ( 'marks-scroll' )
if ( marksScroll ) {
marksScroll . addEventListener ( 'scroll' , ( ) => {
document . getElementById ( 'marks-scroll-right' ) . scrollTop = marksScroll . scrollTop
} )
}
const descriptionScroll = document . getElementById ( 'description-scroll' )
if ( descriptionScroll ) {
descriptionScroll . addEventListener ( 'scroll' , ( ) => {
document . getElementById ( 'description-scroll-right' ) . scrollTop = descriptionScroll . scrollTop
} )
}
const obj = { }
this . $options . filters [ 'dictData' ] ( 'BookingLockOrder' ) . forEach ( item => {
obj [ item . code ] = true
} )
this . BookingLockOrder = obj
setTimeout ( ( ) => {
this . changePkgs ( )
} , 2000 )
} ,
methods : {
SetTOTALNO ( SS ) {
SS = SS . toString ( )
const i = SS . indexOf ( '\n' )
let num = 0
let strKind = ''
let enCapital = ''
if ( i > 0 ) {
const slist = SS . split ( '\n' )
for ( let i = 0 ; i < slist . length ; i += 1 ) {
const member = slist [ i ]
const strNum = this . GetStringNum ( member )
if ( i == 0 ) {
strKind = member . substring ( strNum . length )
}
num = parseFloat ( num ) . add ( parseFloat ( strNum ) )
}
if ( strKind !== '' ) {
enCapital = strKind
} else {
strKind = this . details . kindpkgs
enCapital = this . ToEn ( num ) . toUpperCase ( ) + ' ' + strKind + ' ONLY.'
}
} else {
const strNum = this . GetStringNum ( SS )
strKind = SS . substring ( strNum . length )
if ( strKind !== '' ) {
console . log ( strKind )
enCapital = strKind
} else {
strKind = this . details . kindpkgs
enCapital = 'SAY:' + this . ToEn ( strNum ) . toUpperCase ( ) + ' ' + strKind + ' ONLY.'
}
}
return enCapital
} ,
ToEn ( a ) {
/ / e s l i n t - d i s a b l e - n e x t - l i n e n o - a r r a y - c o n s t r u c t o r
const arr1 = new Array ( '' , ' thousand' , ' million' , ' billion' )
const b = a . length
let f = null
let h = 0
let g = ''
const e = Math . ceil ( b / 3 )
const k = b - e * 3
g = ''
for ( f = k ; f < b ; f += 3 ) {
++ h
/ / e s l i n t - d i s a b l e - n e x t - l i n e n o - u n d e f
const num3 = f >= 0 ? a . substring ( f , f + 3 ) : a . substring ( 0 , k + 3 )
/ / e s l i n t - d i s a b l e - n e x t - l i n e n o - u n d e f
const strEng = this . English ( num3 )
/ / e s l i n t - d i s a b l e - n e x t - l i n e e q e q e q
if ( strEng != '' ) {
/ / e s l i n t - d i s a b l e - n e x t - l i n e e q e q e q
if ( g != '' ) g += ' '
g += this . English ( num3 ) + arr1 [ e - h ]
}
}
return g
} ,
English ( a ) {
/ / e s l i n t - d i s a b l e - n e x t - l i n e n o - a r r a y - c o n s t r u c t o r
var arr1 = new Array ( '' , ' thousand' , ' million' , ' billion' )
/ / e s l i n t - d i s a b l e - n e x t - l i n e n o - a r r a y - c o n s t r u c t o r
var arr2 = new Array ( 'zero' , 'ten' , 'twenty' , 'thirty' , 'forty' , 'fifty' , 'sixty' , 'seventy' , 'eighty' , 'ninety' )
/ / e s l i n t - d i s a b l e - n e x t - l i n e n o - a r r a y - c o n s t r u c t o r
var arr3 = new Array ( 'zero' , 'one' , 'two' , 'three' , 'four' , 'five' , 'six' , 'seven' , 'eight' , 'nine' )
/ / e s l i n t - d i s a b l e - n e x t - l i n e n o - a r r a y - c o n s t r u c t o r
var arr4 = new Array (
'ten' ,
'eleven' ,
'twelve' ,
'thirteen' ,
'fourteen' ,
'fifteen' ,
'sixteen' ,
'seventeen' ,
'eighteen' ,
'nineteen'
)
let strRet = ''
/ / e s l i n t - d i s a b l e - n e x t - l i n e e q e q e q
if ( a . length == 3 && a . substr ( 0 , 3 ) != '000' ) {
if ( a . substr ( 0 , 1 ) != '0' ) {
strRet += arr3 [ a . substr ( 0 , 1 ) ] + ' hundred'
if ( a . substr ( 1 , 2 ) != '00' ) strRet += ' and '
} else {
strRet += ' and '
}
a = a . substring ( 1 )
}
if ( a . length == 2 ) {
if ( a . substr ( 0 , 1 ) == '0' ) a = a . substring ( 1 )
else if ( a . substr ( 0 , 1 ) == '1' ) strRet += arr4 [ a . substr ( 1 , 2 ) ]
else {
strRet += arr2 [ a . substr ( 0 , 1 ) ]
if ( a . substr ( 1 , 1 ) != '0' ) strRet += '-'
a = a . substring ( 1 )
}
}
if ( a . length == 1 && a . substr ( 0 , 1 ) != '0' ) strRet += arr3 [ a . substr ( 0 , 1 ) ]
return strRet
} ,
editTextEntryModel ( type ) {
this . textEntryModalVisible = true
this . textEntryType = type
if ( type === 'pkgs' ) {
this . textEntryModalTitle = '件数/包装'
if ( this . details . pkgstotal ) {
this . pkgsTextChange ( )
} else {
this . pkgstotalRes = 0
}
} else if ( type === 'kgs' ) {
this . textEntryModalTitle = '毛重'
if ( this . details . kgstotal ) {
this . kgsTextChange ( )
} else {
this . kgstotalRes = 0
}
} else if ( type === 'cbm' ) {
this . textEntryModalTitle = '尺码'
if ( this . details . cbmtotal ) {
this . cbmTextChange ( )
} else {
this . cbmtotalRes = 0
}
}
} ,
textEntryClose ( ) {
this . textEntryModalVisible = false
this . textEntryModalTitle = ''
this . textEntryType = false
} ,
GetStringNum ( str ) {
var num = 0
if ( str == null || str == '' ) return num
if ( str . length == 0 ) return num
var if _find = false
var str _num = ''
for ( var i = 0 ; i < str . length ; i += 1 ) {
var member = str . substr ( i , 1 )
if (
member == '0' ||
member == '1' ||
member == '2' ||
member == '3' ||
member == '4' ||
member == '5' ||
member == '6' ||
member == '7' ||
member == '8' ||
member == '9' ||
member == '.' ||
member == '-'
) {
if ( ! if _find ) {
str _num = str _num + member
}
} else {
if _find = true
}
}
return str _num
} ,
pkgsTextChange ( ) {
const pkgsTexyVal = this . details . pkgstotal
const arr = pkgsTexyVal . split ( /\n|\r/g )
let pkgs = 0
let kindpkgs = ''
arr . map ( ( item , index ) => {
const regexStr = item . match ( /[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g )
if ( regexStr && Number ( regexStr [ 0 ] ) ) {
const num1 = Number ( regexStr [ 0 ] )
pkgs = ( pkgs * 100 + num1 * 100 ) / 100
}
if ( ! kindpkgs && regexStr && /^[a-zA-Z]+$/ . test ( regexStr [ 1 ] ) ) {
kindpkgs = regexStr [ 1 ]
}
} )
this . details . pkgs = parseInt ( pkgs )
this . details . kindpkgs = kindpkgs
this . pkgstotalRes = parseInt ( pkgs )
} ,
kgsTextChange ( ) {
const kgsTexyVal = this . details . kgstotal
const arr = kgsTexyVal . split ( /\n|\r/g )
let kgs = 0
arr . map ( ( item , index ) => {
const regexStr = item . match ( /[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g )
if ( regexStr && Number ( regexStr [ 0 ] ) ) {
const num1 = Number ( regexStr [ 0 ] )
kgs = ( kgs * 100 + num1 * 100 ) / 100
}
} )
this . details . kgs = kgs
this . kgstotalRes = kgs
} ,
cbmTextChange ( ) {
const cbmTexyVal = this . details . cbmtotal
const arr = cbmTexyVal . split ( /\n|\r/g )
let cbm = 0
arr . map ( ( item , index ) => {
const regexStr = item . match ( /[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g )
if ( regexStr && Number ( regexStr [ 0 ] ) ) {
const num1 = Number ( regexStr [ 0 ] )
cbm = ( cbm * 100 + num1 * 100 ) / 100
}
} )
this . details . cbm = cbm
this . cbmtotalRes = cbm
} ,
handleOpen ( type ) {
this . modelType = type
if ( type === 1 ) {
this . modelTitle = '唛头'
} else {
this . modelTitle = '货物描述'
}
this . visible = true
} ,
debounce ( func , wait , ... args ) {
if ( timer ) clearTimeout ( timer ) ;
timer = setTimeout ( ( ) => {
func . apply ( this , args ) ;
} , wait ) ;
} ,
checkbasic ( ) {
this . $refs . cargoFrom . validate ( valid => {
if ( valid ) {
console . log ( '验证成功!' ) ;
return true ;
} else {
console . log ( '验证失败!' ) ;
return false ;
}
} ) ;
} ,
handleChange ( value ) {
this . details . cargoid = value
} ,
getTextareaChange ( { type , value } ) {
this . details [ type ] = value
this . $forceUpdate ( )
} ,
getSelectViewRes ( { type , res } ) {
if ( type === 'goodsname' ) {
this . details . goodscode = res . goodsCode || ''
this . details . goodsname = res . goodsNameEN || ''
} else if ( type === 'cargoid' ) {
this . details . cargoid = res . code || ''
if ( res . code == 'R' ) {
this . rules [ 'goodsname' ] [ 0 ] . required = true
} else {
this . rules [ 'goodsname' ] [ 0 ] . required = false
}
} else if ( [ 'kindpkgs' ] . includes ( type ) ) {
this . details . kindpkgs = res [ 'name' ] || ''
const enCapitalRes = this . SetTOTALNO ( this . details . pkgs )
this . $emit ( 'pkgsEnCapital' , enCapitalRes )
}
} ,
changePkgs ( ) {
const enCapitalRes = this . SetTOTALNO ( this . details . pkgs )
this . $emit ( 'pkgsEnCapital' , enCapitalRes )
} ,
inputChange ( { type , value } ) {
this . details [ type ] = value
if ( type === 'pkgs' ) {
this . changePkgs ( )
}
this . $forceUpdate ( )
} ,
tabStopFun ( ) {
return false
} ,
tabChangeFun ( ) {
}
< script lang = "ts" setup >
import { ref , reactive , getCurrentInstance , h , watch , onMounted } from 'vue'
const showKey = ref ( [ '1' ] )
function tabStopFun ( ) {
return false
}
}
< / script >
< style lang = "less" scoped >
. copy - btn {
margin - left : 10 px ;
. copy - btn {
margin - left : 10 px ;
& : hover {
color : @ primary - color ! important ;
& : hover {
color : @ primary - color ! important ;
}
}
}
/deep/ . ant - form - explain {
display : none ! important ;
}
/deep/ . ant - form - explain {
display : none ! important ;
}
/deep/ . ant - form - item - children - icon . anticon - check - circle {
display : none ;
}
/deep/ . ant - form - item - children - icon . anticon - check - circle {
display : none ;
}
< / style >
< style lang = "less" scoped >
@ import url ( '../style/cargoInfo.less' ) ;
@ import url ( '../style/mailingInfo.less' ) ;
. cargo - info {
@ import url ( '../style/cargoInfo.less' ) ;
@ import url ( '../style/mailingInfo.less' ) ;
. cargo - info {
padding - bottom : 20 px ;
}
}
< / style >