Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
SuperMan
Commits
6cee2ae2
Commit
6cee2ae2
authored
Jul 15, 2025
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
2ccd2e4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
226 additions
and
263 deletions
+226
-263
addPassenger.vue
src/components/SalesModule/addPassenger.vue
+226
-263
No files found.
src/components/SalesModule/addPassenger.vue
View file @
6cee2ae2
...
...
@@ -149,7 +149,6 @@
<div
class=
"contForm"
>
<el-form
:model=
"addMsg"
ref=
"addMsg"
label-position=
"right"
:rules=
"rules"
label-width=
"100px"
>
<li>
<el-form-item
:label=
"$t('visaT.nationality')"
prop=
"Nationality"
>
<el-select
v-model=
"addMsg.Nationality"
filterable
size=
mini
class=
"w230"
>
<el-option
v-for=
"item in countryList"
:key=
"item.ID"
:label=
"item.Name"
:value=
"item.ID"
>
...
...
@@ -158,23 +157,10 @@
</el-form-item>
</li>
<li
v-if=
"addMsg.Nationality==2"
>
<el-form-item
:label=
"$t('visaT.Chinesesurname')"
prop=
"SurNameID"
>
<el-select
class=
"w230"
ref=
"options"
v-model=
"addMsg.SurNameID"
filterable
remote
reserve-keyword
placeholder=
"请输入关键词"
:remote-method=
"(query)=>remoteMethod(query,1)"
@
change=
"(e)=>getName(e,1)"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"`$
{item.name}`"
:value="item.value">
<el-form-item
:label=
"$t('visaT.Chinesesurname')"
prop=
"SurNameID"
>
<el-select
class=
"w230"
ref=
"options"
v-model=
"addMsg.SurNameID"
filterable
remote
reserve-keyword
placeholder=
"请输入关键词"
:remote-method=
"(query)=>remoteMethod(query,1)"
@
change=
"(e)=>getName(e,1)"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"`$
{item.name}`" :value="item.value">
<span
style=
"float: left"
>
{{
item
.
label
}}
</span>
<span
style=
"float: right; color: #8492a6; font-size: 13px"
>
{{
item
.
name
}}
</span>
</el-option>
...
...
@@ -182,23 +168,11 @@
</el-form-item>
</li>
<li
v-if=
"addMsg.Nationality==2"
>
<el-form-item
:label=
"$t('admin.admin_Surname')"
prop=
"NameID"
>
<el-select
class=
"w230"
ref=
"optionsNames"
v-model=
"addMsg.NameID"
filterable
remote
reserve-keyword
:placeholder=
"$t('rule.qsrzwm')"
:remote-method=
"(query)=>remoteMethod(query)"
<el-form-item
:label=
"$t('admin.admin_Surname')"
prop=
"NameID"
>
<el-select
class=
"w230"
ref=
"optionsNames"
v-model=
"addMsg.NameID"
filterable
remote
reserve-keyword
:placeholder=
"$t('rule.qsrzwm')"
:remote-method=
"(query)=>remoteMethod(query)"
@
change=
"(e)=>getName(e)"
>
<el-option
v-for=
"item in optionsNames"
:key=
"item.value"
:label=
"`$
{item.name}`"
:value="item.value">
<el-option
v-for=
"item in optionsNames"
:key=
"item.value"
:label=
"`$
{item.name}`" :value="item.value">
<span
style=
"float: left"
>
{{
item
.
label
}}
</span>
<span
style=
"float: right; color: #8492a6; font-size: 13px"
>
{{
item
.
name
}}
</span>
</el-option>
...
...
@@ -228,11 +202,11 @@
</el-input>
</el-form-item>
</li>
<li
>
<!-- v-if="LineId === 14 || LineId === 2"
-->
<el-form-item
:label=
"$t('admin.admin_IDcard')"
prop=
"IdCard"
v-if=
"
addMsg.Nationality==2"
>
<el-input
v-model=
"addMsg.IdCard"
type=
"text"
:class=
" IdCardSure ? '' : 'colorRed'"
size=
mini
class=
"w230"
:placeholder=
"$t('visaT.Pleasefillin')"
@
blur
.
prevent=
"authentication()"
>
<li>
<!--国内线且国籍是中国的才验证身份证
-->
<el-form-item
:label=
"$t('admin.admin_IDcard')"
prop=
"IdCard"
v-if=
"
LineId==90&&addMsg.Nationality==2"
>
<el-input
v-model=
"addMsg.IdCard"
type=
"text"
:class=
" IdCardSure ? '' : 'colorRed'"
size=
mini
class=
"w230"
:placeholder=
"$t('visaT.Pleasefillin')"
@
blur
.
prevent=
"authentication()"
>
</el-input>
</el-form-item>
<el-form-item
:label=
"$t('admin.admin_IDcard')"
v-else
>
...
...
@@ -265,8 +239,8 @@
:placeholder=
"$t('visaT.ptxPassportNo')"
></el-input>
</el-form-item>
<el-form-item
:label=
"$t('system.table_Passport')"
prop=
"PassportNo"
v-else
>
<el-input
v-model=
'addMsg.PassportNo'
:class=
" PassportNoSure ? '' : 'colorRed'"
type=
"text"
size=
mini
class=
"w230"
@
change=
"isValidPassport"
:placeholder=
"$t('visaT.ptxPassportNo')"
></el-input>
<el-input
v-model=
'addMsg.PassportNo'
:class=
" PassportNoSure ? '' : 'colorRed'"
type=
"text"
size=
mini
class=
"w230"
@
change=
"isValidPassport"
:placeholder=
"$t('visaT.ptxPassportNo')"
></el-input>
</el-form-item>
</li>
<li>
...
...
@@ -685,11 +659,11 @@
</el-form>
</div>
<p
style=
"text-align: center; padding: 20px 0;"
>
<
input
type=
"button"
class=
"hollowFixedBtn"
:value=
"$t('pub.cancelBtn')"
@
click=
"goBack"
/
>
<
input
type=
"button"
class=
"normalBtn"
:value=
"$t('pub.saveBtn')"
:style=
"btnState===true?'':'background-color: gray'"
@
click=
"submitForm('addMsg',1)"
/
>
<
input
v-if=
"this.addMsg.Id==0"
type=
"button"
class=
"normalBtn"
:value=
"$t('objFill.baocbjxtj')"
:style=
"btnState===true?'':'background-color: gray'"
@
click=
"submitForm('addMsg',2)"
/
>
<
el-button
plain
@
click=
"goBack"
size=
"small"
>
{{$t('pub.cancelBtn')}}
</el-button
>
<
el-button
type=
"primary"
:loading=
"btnState"
@
click=
"submitForm('addMsg',1)"
size=
"small"
>
{{$t('pub.saveBtn')}}
</el-button
>
<
el-button
v-if=
"addMsg.Id==0"
type=
"primary"
:loading=
"btnState"
@
click=
"submitForm('addMsg',2)"
size=
"small"
>
{{$t('objFill.baocbjxtj')}}
</el-button
>
</p>
</div>
</template>
...
...
@@ -703,8 +677,8 @@
DutyTypeList
:
[],
ppAge
:
0
,
loading
:
false
,
PassportNoSure
:
true
,
IdCardSure
:
true
,
PassportNoSure
:
true
,
IdCardSure
:
true
,
templateType
:
1
,
templateSign
:
""
,
imgBase64String
:
""
,
...
...
@@ -857,7 +831,7 @@
trigger
:
"blur"
},
{
pattern
:
/^
[
0-9a-zA-Z
]
+$/
,
//this.isValidPassport(),
pattern
:
/^
[
0-9a-zA-Z
]
+$/
,
//this.isValidPassport(),
message
:
this
.
$t
(
'visaT.zqdhzh'
)
}
],
...
...
@@ -912,11 +886,11 @@
VisaStartStatus
:
2
,
AirStartStatus
:
2
,
SafeStartStatus
:
2
,
btnState
:
tru
e
,
btnState
:
fals
e
,
roomlist
:
[],
isOneDay
:
0
,
LineId
:
0
,
GroupStartDateStr
:
''
,
//出发团期
GroupStartDateStr
:
''
,
//出发团期
EndDateStr
:
''
,
guoqi
:
false
,
JingDianList
:
[],
...
...
@@ -925,32 +899,31 @@
};
},
methods
:
{
getName
(
e
,
type
)
{
getName
(
e
,
type
)
{
let
findIndex
if
(
type
)
{
findIndex
=
this
.
options
.
findIndex
(
x
=>
x
.
value
==
e
)
if
(
type
)
{
findIndex
=
this
.
options
.
findIndex
(
x
=>
x
.
value
==
e
)
let
obj
=
this
.
options
[
findIndex
]
this
.
addMsg
.
SurName
=
obj
.
name
.
toUpperCase
();
this
.
addMsg
.
ESurName
=
obj
.
label
.
toUpperCase
();
}
else
{
findIndex
=
this
.
optionsNames
.
findIndex
(
x
=>
x
.
value
==
e
)
}
else
{
findIndex
=
this
.
optionsNames
.
findIndex
(
x
=>
x
.
value
==
e
)
let
obj
=
this
.
optionsNames
[
findIndex
]
this
.
addMsg
.
Name
=
obj
.
name
.
toUpperCase
();
this
.
addMsg
.
EName
=
obj
.
label
.
toUpperCase
();
}
},
remoteMethod
(
query
,
type
)
{
remoteMethod
(
query
,
type
)
{
if
(
query
!==
''
)
{
if
(
type
==
1
)
{
if
(
query
!=
this
.
addMsg
.
SurName
)
this
.
addMsg
.
SurName
=
query
this
.
Transformation
(
query
,
'SurName'
)
}
else
{
if
(
query
!=
this
.
addMsg
.
Name
)
this
.
addMsg
.
Name
=
query
this
.
Transformation
(
query
,
'Name'
)
if
(
type
==
1
)
{
if
(
query
!=
this
.
addMsg
.
SurName
)
this
.
addMsg
.
SurName
=
query
this
.
Transformation
(
query
,
'SurName'
)
}
else
{
if
(
query
!=
this
.
addMsg
.
Name
)
this
.
addMsg
.
Name
=
query
this
.
Transformation
(
query
,
'Name'
)
}
}
else
{
if
(
type
==
1
)
this
.
options
=
[];
if
(
type
==
1
)
this
.
options
=
[];
else
this
.
optionsNames
=
[]
}
},
...
...
@@ -1185,88 +1158,20 @@
history
.
go
(
-
1
);
},
submitForm
(
addMsg
,
type
)
{
if
(
this
.
btnState
===
true
)
{
// if(this.LineId!=90&&this.addMsg.Nationality===2&& !this.isValidPassport(this.addMsg.PassportNo)){
// this.Error(this.$t('visaT.Pleasefillin')+this.$t('visaT.zqdhzh'));
// return false;
// }
//提交创建、修改表单
this
.
$refs
[
addMsg
].
validate
(
valid
=>
{
this
.
btnState
=
false
if
(
valid
)
{
this
.
savePassenger
(
type
);
}
else
{
this
.
btnState
=
true
if
(
this
.
addMsg
.
Nationality
==
2
&&
this
.
addMsg
.
SurName
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
0
]);
return
false
;
}
if
(
this
.
addMsg
.
Nationality
==
2
&&
this
.
addMsg
.
Name
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
1
]);
return
false
;
}
if
(
this
.
addMsg
.
Sex
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
2
]);
return
false
;
}
if
(
this
.
addMsg
.
MobilePhone
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
3
]);
return
false
;
}
if
(
this
.
addMsg
.
Birthday
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
4
]);
return
false
;
}
if
(
this
.
addMsg
.
BirthdayAddress
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
5
]);
return
false
;
}
if
(
this
.
addMsg
.
PassportNo
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
6
]);
return
false
;
}
if
(
this
.
addMsg
.
PassportAddress
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
7
]);
return
false
;
}
if
(
this
.
addMsg
.
PassportIssued
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
8
]);
return
false
;
}
if
(
this
.
addMsg
.
PassportExpiry
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
9
]);
return
false
;
}
if
(
this
.
addMsg
.
TravelType
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
11
]);
return
false
;
}
if
(
this
.
addMsg
.
UnitType
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
12
]);
return
false
;
}
if
(
this
.
addMsg
.
DutyType
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
13
]);
return
false
;
}
return
false
;
}
});
}
},
savePassenger
(
type
)
{
this
.
timeOver
()
var
result
=
this
.
isValidPassport
()
if
(
!
result
)
{
return
;
}
if
(
this
.
addMsg
.
Nationality
===
2
&&
!
this
.
isValidIdCardFormat
(
this
.
addMsg
.
IdCard
)){
var
result
=
this
.
isValidPassport
()
if
(
!
result
)
{
return
;
}
if
(
this
.
LineId
==
90
&&
this
.
addMsg
.
Nationality
===
2
)
{
if
(
this
.
addMsg
.
IdCard
==
''
)
{
this
.
$message
.
error
(
this
.
$t
(
'objFill.qingtxsfzhm'
));
return
;
}
if
(
!
this
.
isValidIdCardFormat
(
this
.
addMsg
.
IdCard
))
{
this
.
$message
.
error
(
"无效的身份证号码"
);
return
;
}
if
((
this
.
LineId
===
14
||
this
.
LineId
===
2
)
&&
this
.
addMsg
.
IdCard
===
''
&&
this
.
addMsg
.
Nationality
==
2
)
{
return
this
.
$message
.
error
(
this
.
$t
(
'objFill.qingtxsfzhm'
));
return
;
}
}
this
.
addMsg
.
EconomicCapabilityList
=
[];
this
.
EconomicCapabilityS
.
forEach
(
x
=>
{
...
...
@@ -1281,23 +1186,84 @@
if
(
this
.
addMsg
.
Marriage
==
""
)
{
this
.
addMsg
.
Marriage
=
"0"
;
}
this
.
seveInfo
(
type
)
//提交创建、修改表单
this
.
$refs
[
addMsg
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
btnState
=
true
;
this
.
seveInfo
(
type
);
}
else
{
this
.
btnState
=
false
;
if
(
this
.
addMsg
.
Nationality
==
2
&&
this
.
addMsg
.
SurName
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
0
]);
return
false
;
}
if
(
this
.
addMsg
.
Nationality
==
2
&&
this
.
addMsg
.
Name
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
1
]);
return
false
;
}
if
(
this
.
addMsg
.
Sex
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
2
]);
return
false
;
}
if
(
this
.
addMsg
.
MobilePhone
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
3
]);
return
false
;
}
if
(
this
.
addMsg
.
Birthday
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
4
]);
return
false
;
}
if
(
this
.
addMsg
.
BirthdayAddress
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
5
]);
return
false
;
}
if
(
this
.
addMsg
.
PassportNo
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
6
]);
return
false
;
}
if
(
this
.
addMsg
.
PassportAddress
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
7
]);
return
false
;
}
if
(
this
.
addMsg
.
PassportIssued
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
8
]);
return
false
;
}
if
(
this
.
addMsg
.
PassportExpiry
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
9
]);
return
false
;
}
if
(
this
.
addMsg
.
TravelType
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
11
]);
return
false
;
}
if
(
this
.
addMsg
.
UnitType
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
12
]);
return
false
;
}
if
(
this
.
addMsg
.
DutyType
==
''
)
{
this
.
Error
(
this
.
$t
(
'objFill.v101.Rest.qingtxgrxx'
)[
13
]);
return
false
;
}
return
false
;
}
});
},
seveInfo
(
type
)
{
this
.
apipost
(
"sellorder_post_SetTravelGuestInfo_V2"
,
this
.
addMsg
,
res
=>
{
this
.
btnState
=
false
;
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
$message
.
success
(
res
.
data
.
message
);
if
(
type
==
1
)
{
history
.
go
(
-
1
);
}
else
{
this
.
btnState
=
true
this
.
ClearData
();
}
}
else
{
this
.
btnState
=
true
this
.
$message
.
error
(
res
.
data
.
message
);
}
},
...
...
@@ -1343,7 +1309,6 @@
}
return
combinations
.
join
(
","
);
},
combinePinyinDP
(
pinyinArrays
)
{
const
result
=
[];
const
dfs
=
(
index
,
currentStr
)
=>
{
...
...
@@ -1358,94 +1323,88 @@
dfs
(
0
,
""
);
return
result
.
join
(
","
);
},
Transformation
(
val
,
type
,
input
)
{
Transformation
(
val
,
type
,
input
)
{
let
text
=
this
.
pinyin
(
val
,
{
heteronym
:
true
,
// 启用多音字模式
heteronym
:
true
,
// 启用多音字模式
style
:
this
.
pinyin
.
STYLE_NORMAL
,
segment
:
true
});
// 如果当前字是 "茜",则替换为自定义拼音
if
(
val
.
includes
(
'茜'
))
{
if
(
val
.
includes
(
'茜'
))
{
text
=
text
.
map
(
pinyinArr
=>
{
if
(
pinyinArr
[
0
]
===
'qian'
)
{
// 默认返回的是 qian
return
[
'qiàn'
,
'xī'
];
// 替换成自定义多音字
}
return
pinyinArr
;
});
if
(
pinyinArr
[
0
]
===
'qian'
)
{
// 默认返回的是 qian
return
[
'qiàn'
,
'xī'
];
// 替换成自定义多音字
}
return
pinyinArr
;
});
}
console
.
log
(
"text"
,
text
);
const
pinyinArray
=
text
const
result
=
this
.
combinePinyinDP
(
pinyinArray
);
if
(
type
==
"SurName"
)
{
let
upText
=
result
// this.addMsg.ESurName = upText;
this
.
options
=
[]
let
names
=
upText
.
split
(
','
)
names
.
forEach
((
x
,
index
)
=>
{
names
.
forEach
((
x
,
index
)
=>
{
this
.
options
.
push
({
label
:
x
.
toUpperCase
(),
value
:
index
+
1
,
value
:
index
+
1
,
name
:
this
.
addMsg
.
SurName
.
toUpperCase
(),
})
})
if
(
names
!=
null
&&
names
.
length
==
1
){
if
(
input
){
this
.
addMsg
.
SurNameID
=
this
.
options
[
0
].
value
;
this
.
addMsg
.
ESurName
=
this
.
options
[
0
].
label
;
}
else
{
setTimeout
(()
=>
{
if
(
names
!=
null
&&
names
.
length
==
1
)
{
if
(
input
)
{
this
.
addMsg
.
SurNameID
=
this
.
options
[
0
].
value
;
this
.
addMsg
.
ESurName
=
this
.
options
[
0
].
label
;
},
500
);
}
}
else
{
let
findIndex
=
this
.
options
.
findIndex
(
x
=>
x
.
label
==
this
.
addMsg
.
ESurName
)
if
(
findIndex
!=-
1
){
this
.
addMsg
.
SurNameID
=
this
.
options
[
findIndex
].
value
;
}
else
{
this
.
addMsg
.
SurNameID
=
''
;
this
.
addMsg
.
ESurName
=
''
;
}
else
{
setTimeout
(()
=>
{
this
.
addMsg
.
SurNameID
=
this
.
options
[
0
].
value
;
this
.
addMsg
.
ESurName
=
this
.
options
[
0
].
label
;
},
500
);
}
}
else
{
let
findIndex
=
this
.
options
.
findIndex
(
x
=>
x
.
label
==
this
.
addMsg
.
ESurName
)
if
(
findIndex
!=
-
1
)
{
this
.
addMsg
.
SurNameID
=
this
.
options
[
findIndex
].
value
;
}
else
{
this
.
addMsg
.
SurNameID
=
''
;
this
.
addMsg
.
ESurName
=
''
;
}
}
}
this
.
$forceUpdate
()
this
.
$forceUpdate
()
}
if
(
type
==
"Name"
)
{
let
upText
=
result
// this.addMsg.EName = upText;
this
.
optionsNames
=
[]
let
names
=
upText
.
split
(
','
)
names
.
forEach
((
x
,
index
)
=>
{
let
names
=
upText
.
split
(
','
)
names
.
forEach
((
x
,
index
)
=>
{
this
.
optionsNames
.
push
({
label
:
x
.
toUpperCase
(),
value
:
index
+
1
,
value
:
index
+
1
,
name
:
this
.
addMsg
.
Name
.
toUpperCase
(),
})
})
if
(
names
!=
null
&&
names
.
length
==
1
)
{
if
(
input
)
{
if
(
names
!=
null
&&
names
.
length
==
1
)
{
if
(
input
)
{
this
.
addMsg
.
NameID
=
this
.
optionsNames
[
0
].
value
;
this
.
addMsg
.
EName
=
this
.
optionsNames
[
0
].
label
;
}
else
{
}
else
{
setTimeout
(()
=>
{
if
(
this
.
optionsNames
.
length
>
0
)
{
this
.
addMsg
.
NameID
=
this
.
optionsNames
[
0
].
value
;
this
.
addMsg
.
EName
=
this
.
optionsNames
[
0
].
label
;
}
if
(
this
.
optionsNames
.
length
>
0
)
{
this
.
addMsg
.
NameID
=
this
.
optionsNames
[
0
].
value
;
this
.
addMsg
.
EName
=
this
.
optionsNames
[
0
].
label
;
}
},
500
);
}
}
else
{
let
findIndex
=
this
.
optionsNames
.
findIndex
(
x
=>
x
.
label
==
this
.
addMsg
.
EName
)
if
(
findIndex
!=-
1
)
{
this
.
addMsg
.
NameID
=
this
.
optionsNames
[
findIndex
].
value
;
}
else
{
let
findIndex
=
this
.
optionsNames
.
findIndex
(
x
=>
x
.
label
==
this
.
addMsg
.
EName
)
if
(
findIndex
!=
-
1
)
{
this
.
addMsg
.
NameID
=
this
.
optionsNames
[
findIndex
].
value
;
return
}
this
.
addMsg
.
NameID
=
''
;
this
.
addMsg
.
EName
=
''
;
this
.
addMsg
.
NameID
=
''
;
this
.
addMsg
.
EName
=
''
;
}
}
this
.
$forceUpdate
()
...
...
@@ -1530,30 +1489,28 @@
err
=>
{}
);
},
// 中国护照验证逻辑
isValidPassport
:
function
()
{
var
isCheck
=
true
;
if
(
this
.
addMsg
.
PassportNo
.
length
!==
9
)
{
this
.
$message
.
error
(
"请输入9位护照号"
)
isCheck
=
false
;
return
;
}
if
(
this
.
addMsg
.
Nationality
===
2
){
// 单个字母开头(E或G)后跟8位数字
const
pattern1
=
/^
[
EG
][
0-9
]{8}
$/
;
// 两个字母开头(E开头,第二个字母不能是I或O)后跟7位数字
const
pattern2
=
/^E
[
A-HJ-NP-Z
][
0-9
]{7}
$/
;
this
.
PassportNoSure
=
pattern1
.
test
(
this
.
addMsg
.
PassportNo
)
||
pattern2
.
test
(
this
.
addMsg
.
PassportNo
);
if
(
!
this
.
PassportNoSure
){
this
.
$message
.
error
(
"护照格式不正确"
)
isCheck
=
false
;
return
;
}
}
return
isCheck
;
},
//中国护照验证逻辑
isValidPassport
:
function
()
{
var
isCheck
=
true
;
if
(
this
.
addMsg
.
PassportNo
.
length
!==
9
)
{
this
.
$message
.
error
(
"请输入9位护照号"
)
isCheck
=
false
;
return
;
}
if
(
this
.
addMsg
.
Nationality
===
2
)
{
// 单个字母开头(E或G)后跟8位数字
const
pattern1
=
/^
[
EG
][
0-9
]{8}
$/
;
// 两个字母开头(E开头,第二个字母不能是I或O)后跟7位数字
const
pattern2
=
/^E
[
A-HJ-NP-Z
][
0-9
]{7}
$/
;
this
.
PassportNoSure
=
pattern1
.
test
(
this
.
addMsg
.
PassportNo
)
||
pattern2
.
test
(
this
.
addMsg
.
PassportNo
);
if
(
!
this
.
PassportNoSure
)
{
this
.
$message
.
error
(
"护照格式不正确"
)
isCheck
=
false
;
return
;
}
}
return
isCheck
;
},
getVisaApplyForTypeEnum
()
{
// 获取申请类型
this
.
apipost
(
...
...
@@ -1651,8 +1608,8 @@
if
(
this
.
$route
.
query
.
isOneDay
===
1
)
{
this
.
addMsg
.
IsBed
=
0
}
this
.
Transformation
(
this
.
addMsg
.
SurName
,
'SurName'
,
1
)
this
.
Transformation
(
this
.
addMsg
.
Name
,
'Name'
,
2
)
this
.
Transformation
(
this
.
addMsg
.
SurName
,
'SurName'
,
1
)
this
.
Transformation
(
this
.
addMsg
.
Name
,
'Name'
,
2
)
}
else
{
this
.
$message
.
error
();
}
...
...
@@ -1688,6 +1645,10 @@
);
},
ClearData
()
{
this
.
options
=
[];
this
.
optionsNames
=
[];
this
.
addMsg
.
SurNameID
=
""
;
this
.
addMsg
.
NameID
=
""
;
this
.
addMsg
.
SurName
=
""
;
this
.
addMsg
.
Name
=
""
;
this
.
addMsg
.
Sex
=
""
;
...
...
@@ -1860,73 +1821,75 @@
this
.
addMsg
.
Id
=
this
.
$route
.
query
.
guestId
;
this
.
addMsg
.
TCID
=
this
.
$route
.
query
.
TCID
;
this
.
addMsg
.
OrderId
=
this
.
$route
.
query
.
orderId
;
this
.
Roominformation
()
//调取下房间信息
this
.
Transformation
(
this
.
addMsg
.
SurName
,
'SurName'
,
1
)
this
.
Transformation
(
this
.
addMsg
.
Name
,
'Name'
,
2
)
this
.
addMsg
.
Birthday
=
this
.
getBirthdayFromIdCard
(
IdCard
);
this
.
Transformation
(
this
.
addMsg
.
SurName
,
'SurName'
,
1
)
this
.
Transformation
(
this
.
addMsg
.
Name
,
'Name'
,
2
)
if
(
this
.
LineId
==
90
&&
this
.
addMsg
.
Nationality
==
2
)
{
this
.
addMsg
.
Birthday
=
this
.
getBirthdayFromIdCard
(
IdCard
);
}
}
},
err
=>
{}
);
}
}
this
.
addMsg
.
Birthday
=
this
.
getBirthdayFromIdCard
(
IdCard
);
if
(
this
.
LineId
==
90
&&
this
.
addMsg
.
Nationality
==
2
)
{
this
.
addMsg
.
Birthday
=
this
.
getBirthdayFromIdCard
(
IdCard
);
}
},
//验证身份证号码
isValidIdCardFormat
(
idCard
)
{
const
reg
=
/^
[
1-9
]\d{5}(
18|19|20
)\d{2}(
0
[
1-9
]
|1
[
0-2
])(
0
[
1-9
]
|
[
12
]\d
|3
[
01
])\d{3}[\d
Xx
]
$/
;
return
reg
.
test
(
idCard
);
},
getBirthdayFromIdCard
(
idCard
)
{
// 去除空格并转换为大写(处理末尾可能的小写x)
idCard
=
(
idCard
||
''
).
trim
().
toUpperCase
();
const
len
=
idCard
.
length
;
// 去除空格并转换为大写(处理末尾可能的小写x)
idCard
=
(
idCard
||
''
).
trim
().
toUpperCase
();
const
len
=
idCard
.
length
;
if
(
len
>
0
)
{
// 验证身份证长度
if
(
len
!==
15
&&
len
!==
18
)
{
this
.
$message
.
error
(
"无效的身份证号码"
);
this
.
IdCardSure
=
false
;
return
""
;
this
.
$message
.
error
(
"无效的身份证号码"
);
this
.
IdCardSure
=
false
;
return
""
;
}
let
year
,
month
,
day
;
if
(
len
===
15
)
{
// 15位身份证
year
=
'19'
+
idCard
.
substring
(
6
,
8
);
// 年份补19前缀
if
(
len
===
15
)
{
// 15位身份证
year
=
'19'
+
idCard
.
substring
(
6
,
8
);
// 年份补19前缀
month
=
idCard
.
substring
(
8
,
10
);
day
=
idCard
.
substring
(
10
,
12
);
}
else
{
// 18位身份证
}
else
{
// 18位身份证
year
=
idCard
.
substring
(
6
,
10
);
month
=
idCard
.
substring
(
10
,
12
);
day
=
idCard
.
substring
(
12
,
14
);
}
// 日期有效性验证
const
date
=
new
Date
(
`
${
year
}
-
${
month
}
-
${
day
}
`
);
if
(
isNaN
(
date
.
getTime
()))
{
this
.
$message
.
error
(
"身份证中的出生日期无效"
);
this
.
IdCardSure
=
false
;
return
""
;
this
.
$message
.
error
(
"身份证中的出生日期无效"
);
this
.
IdCardSure
=
false
;
return
""
;
}
this
.
IdCardSure
=
true
;
this
.
IdCardSure
=
true
;
// 返回格式化的出生日期(YYYY-MM-DD)
return
`
${
year
}
-
${
month
.
padStart
(
2
,
'0'
)}
-
${
day
.
padStart
(
2
,
'0'
)}
`
;
},
}
},
getData
:
function
()
{
this
.
loading
=
true
this
.
apipost
(
"sellorder_get_GetTravelGuestList"
,
{
OrderId
:
this
.
$route
.
query
.
orderId
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
GroupStartDateStr
=
res
.
data
.
data
.
GroupStartDateStr
;
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
)
}
this
.
loading
=
false
});
getData
:
function
()
{
this
.
loading
=
true
this
.
apipost
(
"sellorder_get_GetTravelGuestList"
,
{
OrderId
:
this
.
$route
.
query
.
orderId
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
GroupStartDateStr
=
res
.
data
.
data
.
GroupStartDateStr
;
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
)
}
this
.
loading
=
false
});
},
},
mounted
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment