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
9d0ff674
Commit
9d0ff674
authored
Mar 23, 2026
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
ca18282a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
53 deletions
+70
-53
addPassenger.vue
src/components/SalesModule/addPassenger.vue
+70
-53
No files found.
src/components/SalesModule/addPassenger.vue
View file @
9d0ff674
...
...
@@ -675,7 +675,7 @@
loading
:
false
,
PassportNoSure
:
true
,
IdCardSure
:
true
,
templateType
:
1
,
templateType
:
2
,
//1-身份证,2-护照
templateSign
:
""
,
imgBase64String
:
""
,
addMsg
:
{
...
...
@@ -1020,8 +1020,6 @@
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
console
.
log
(
"res.data.data"
,
res
.
data
.
data
);
this
.
JingDianList
=
res
.
data
.
data
}
else
{
this
.
$message
.
error
(
this
.
$t
(
'objFill .chaozuosib'
))
...
...
@@ -1042,6 +1040,34 @@
}
}
},
//识别类型切换
changeType
()
{
let
preview
=
document
.
getElementById
(
"img"
);
preview
.
src
=
""
;
this
.
imgBase64String
=
''
;
let
file
=
document
.
getElementById
(
"file"
);
file
.
value
=
''
;
},
onUpload
(
val
)
{
let
preview
=
document
.
getElementById
(
"img"
);
let
file
=
document
.
getElementById
(
"file"
).
files
[
0
];
let
reader
=
new
FileReader
();
reader
.
onloadend
=
function
()
{
preview
.
src
=
reader
.
result
;
};
if
(
file
)
{
reader
.
readAsDataURL
(
file
);
}
else
{
preview
.
src
=
""
;
}
this
.
lrz
(
file
,
{
//quality: 0.7
}).
then
(
res
=>
{
this
.
imgBase64String
=
res
.
base64
;
this
.
commonTextDiscern
();
});
},
//OCR识别
commonTextDiscern
()
{
if
(
this
.
imgBase64String
==
''
)
{
...
...
@@ -1049,35 +1075,55 @@
return
;
}
let
params
=
{
base64
:
""
,
base64
:
this
.
imgBase64String
,
Type
:
1
,
//1-中国大陆护照,2-身份证
};
params
.
base64
=
this
.
imgBase64String
;
let
url
=
this
.
domainManager
().
UploadUrl
;
let
ocrUrl
=
this
.
domainManager
().
ocrUrl
;
if
(
this
.
templateType
==
1
)
{
params
.
Type
=
2
;
}
else
{
params
.
Type
=
1
;
}
this
.
loading
=
true
;
this
.
UploadCard
(
params
.
Type
,
params
.
base64
,
res
=>
{
this
.
$http
({
headers
:
{
'Content-Type'
:
'application/json'
},
method
:
'post'
,
url
:
ocrUrl
+
'/PaddleOCR/DetectText'
,
data
:
params
}).
then
(
res
=>
{
this
.
loading
=
false
;
if
(
res
.
data
.
S
tatusCode
==
1
)
{
if
(
res
.
data
.
S
uccess
)
{
var
tempObj
=
res
.
data
;
if
(
tempObj
)
{
//中文姓
if
(
tempObj
.
SurName
&&
tempObj
.
SurName
!=
''
)
{
this
.
addMsg
.
SurName
=
tempObj
.
SurName
.
toUpperCase
();
this
.
Transformation
(
this
.
addMsg
.
SurName
,
'SurName'
);
if
(
tempObj
.
SureName
&&
tempObj
.
SureName
!=
''
)
{
this
.
addMsg
.
SurName
=
tempObj
.
SureName
.
toUpperCase
();
if
(
tempObj
.
EnSureName
&&
tempObj
.
EnSureName
!=
''
)
{
this
.
addMsg
.
ESurName
=
tempObj
.
EnSureName
.
toUpperCase
();
}
else
{
var
tempSurNameArray
=
this
.
Transformation
(
tempObj
.
SureName
);
if
(
tempSurNameArray
.
length
>
0
)
{
this
.
addMsg
.
ESurName
=
tempSurNameArray
[
0
].
label
;
}
}
}
//中文名
if
(
tempObj
.
Name
&&
tempObj
.
Name
!=
''
)
{
this
.
addMsg
.
Name
=
tempObj
.
Name
.
toUpperCase
();
this
.
Transformation
(
this
.
addMsg
.
Name
,
'Name'
);
if
(
tempObj
.
EnName
&&
tempObj
.
EnName
!=
''
)
{
this
.
addMsg
.
EName
=
tempObj
.
EnName
.
toUpperCase
();
}
else
{
var
tempNameNameArray
=
this
.
Transformation
(
tempObj
.
Name
);
if
(
tempNameNameArray
.
length
>
0
)
{
this
.
addMsg
.
EName
=
tempNameNameArray
[
0
].
label
;
}
}
}
//性别
if
(
tempObj
.
Gender
&&
tempObj
.
Gender
!=
''
)
{
if
(
tempObj
.
Gender
==
'男
'
)
{
if
(
tempObj
.
Sex
&&
tempObj
.
Sex
!=
''
)
{
if
(
tempObj
.
Sex
==
'M
'
)
{
this
.
addMsg
.
Sex
=
"1"
;
}
else
{
this
.
addMsg
.
Sex
=
"2"
;
...
...
@@ -1091,8 +1137,8 @@
//大陆护照
if
(
params
.
Type
==
1
)
{
//护照号
if
(
tempObj
.
PassportN
umber
&&
tempObj
.
PassportNumber
!=
''
)
{
this
.
addMsg
.
PassportNo
=
tempObj
.
PassportN
umber
;
if
(
tempObj
.
PassportN
o
&&
tempObj
.
PassportNo
!=
''
)
{
this
.
addMsg
.
PassportNo
=
tempObj
.
PassportN
o
;
}
//出生地
if
(
tempObj
.
BirthAddress
&&
tempObj
.
BirthAddress
!=
''
)
{
...
...
@@ -1114,47 +1160,20 @@
//大陆身份证
else
if
(
params
.
Type
==
2
)
{
//家庭居住地、家庭详细地址
if
(
tempObj
.
BirthAddress
&&
tempObj
.
Birth
Address
!=
''
)
{
this
.
addMsg
.
Address
=
tempObj
.
Birth
Address
;
this
.
addMsg
.
AddressDetail
=
tempObj
.
Birth
Address
;
if
(
tempObj
.
Address
&&
tempObj
.
Address
!=
''
)
{
this
.
addMsg
.
Address
=
tempObj
.
Address
;
this
.
addMsg
.
AddressDetail
=
tempObj
.
Address
;
}
//身份证号
if
(
tempObj
.
PassportN
umber
&&
tempObj
.
PassportNumber
!=
''
)
{
this
.
addMsg
.
IdCard
=
tempObj
.
PassportN
umber
;
if
(
tempObj
.
PassportN
o
&&
tempObj
.
PassportNo
!=
''
)
{
this
.
addMsg
.
IdCard
=
tempObj
.
PassportN
o
;
}
}
}
}
}
,
faild
=>
{
}
).
catch
(
err
=>
{
this
.
loading
=
false
;
});
},
//识别类型切换
changeType
()
{
let
preview
=
document
.
getElementById
(
"img"
);
preview
.
src
=
""
;
this
.
imgBase64String
=
''
;
let
file
=
document
.
getElementById
(
"file"
);
file
.
value
=
''
;
},
onUpload
(
val
)
{
let
preview
=
document
.
getElementById
(
"img"
);
let
file
=
document
.
getElementById
(
"file"
).
files
[
0
];
let
reader
=
new
FileReader
();
reader
.
onloadend
=
function
()
{
preview
.
src
=
reader
.
result
;
};
if
(
file
)
{
reader
.
readAsDataURL
(
file
);
}
else
{
preview
.
src
=
""
;
}
this
.
lrz
(
file
,
{
quality
:
0.7
}).
then
(
res
=>
{
this
.
imgBase64String
=
res
.
base64
.
slice
(
23
);
this
.
commonTextDiscern
();
});
})
},
goBack
()
{
history
.
go
(
-
1
);
...
...
@@ -1325,7 +1344,7 @@
dfs
(
0
,
""
);
return
result
.
join
(
","
);
},
Transformation
(
val
)
{
Transformation
(
val
)
{
let
resultArray
=
[];
let
textArray
=
this
.
pinyin
(
val
,
{
heteronym
:
true
,
// 启用多音字模式
...
...
@@ -1436,7 +1455,6 @@
err
=>
{}
);
},
// 中国护照验证逻辑
isValidPassport
:
function
()
{
var
isCheck
=
true
;
...
...
@@ -1559,7 +1577,6 @@
this
.
addMsg
.
TravelType
=
obj
.
TravelType
.
toString
();
this
.
addMsg
.
Marriage
=
""
if
(
obj
&&
obj
.
Marriage
)
{
console
.
log
(
obj
.
Marriage
,
"obj.Marriage"
);
this
.
addMsg
.
Marriage
=
obj
.
Marriage
.
toString
()
||
"0"
;
}
if
(
this
.
addMsg
.
Marriage
==
"0"
)
{
...
...
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