Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
吴迪
gs1
Commits
ea6a0ed8
Commit
ea6a0ed8
authored
Jan 16, 2022
by
tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 查询只能输入中英文字符和数字
parent
a2eb745a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
5 deletions
+46
-5
bike.vue
src/views/Search/bike.vue
+3
-0
external.vue
src/views/Search/external.vue
+3
-0
gln.vue
src/views/Search/gln.vue
+11
-0
glossary.vue
src/views/Search/glossary.vue
+3
-0
internal.vue
src/views/Search/internal.vue
+8
-2
shortcode.vue
src/views/Search/shortcode.vue
+10
-3
validation.js
src/views/Search/validation.js
+8
-0
No files found.
src/views/Search/bike.vue
View file @
ea6a0ed8
...
...
@@ -112,6 +112,9 @@ export default {
params
.
firmName
=
this
.
search
.
code
}
this
.
searchCodeShow
=
this
.
search
.
code
;
if
(
this
.
hasSpecialString
(
this
.
searchCodeShow
)){
return
true
}
this
.
showResult
=
true
;
const
searchGlnRes
=
await
this
.
$api
.
search
.
searchBike
(
params
);
const
{
returnCode
,
data
}
=
searchGlnRes
;
...
...
src/views/Search/external.vue
View file @
ea6a0ed8
...
...
@@ -108,6 +108,9 @@ export default {
},
async
handleSearch
()
{
this
.
searchCodeShow
=
this
.
search
.
code
;
if
(
this
.
hasSpecialString
(
this
.
searchCodeShow
)){
return
true
}
this
.
showResult
=
true
;
const
params
=
{
"code"
:
this
.
search
.
code
,
...
...
src/views/Search/gln.vue
View file @
ea6a0ed8
...
...
@@ -124,8 +124,19 @@ export default {
this
.
captchaPath
=
window
.
URL
.
createObjectURL
(
res
.
body
);
});
},
hasSpecialString
(
string
){
const
regName
=
/^
[\u
4e00-
\u
9fa5_a-zA-Z0-9
]
+$/
;
if
(
!
regName
.
test
(
string
)){
this
.
$message
.
error
(
'查询值只能包含中英文字符和数字!'
);
return
true
;
}
return
true
},
async
handleSearch
()
{
this
.
searchCodeShow
=
this
.
search
.
code
;
if
(
this
.
hasSpecialString
(
this
.
searchCodeShow
)){
return
true
}
this
.
showResult
=
true
;
const
params
=
{...
this
.
search
};
const
searchGlnRes
=
await
this
.
$api
.
search
.
searchGln
(
params
);
...
...
src/views/Search/glossary.vue
View file @
ea6a0ed8
...
...
@@ -100,6 +100,9 @@ export default {
captcha
:
this
.
captcha
,
};
this
.
searchCodeShow
=
this
.
search
.
code
;
if
(
this
.
hasSpecialString
(
this
.
searchCodeShow
)){
return
true
}
this
.
showResult
=
true
;
const
searchGlnRes
=
await
this
.
$api
.
search
.
searchGlossary
(
params
);
const
{
returnCode
,
data
}
=
searchGlnRes
;
...
...
src/views/Search/internal.vue
View file @
ea6a0ed8
...
...
@@ -387,8 +387,6 @@ export default {
},
async
handleSearchCompany
()
{
this
.
showResult
=
true
;
this
.
resultType
=
'company'
if
(
this
.
company
===
CODE
)
{
this
.
searchCodeShow
=
this
.
companySearch
.
code
;
}
else
if
(
this
.
company
===
NAME
)
{
...
...
@@ -396,6 +394,11 @@ export default {
}
else
{
this
.
searchCodeShow
=
this
.
companySearch
.
address
;
}
if
(
this
.
hasSpecialString
(
this
.
searchCodeShow
)){
return
true
}
this
.
showResult
=
true
;
this
.
resultType
=
'company'
const
params
=
{
type
:
this
.
company
,
uuid
:
this
.
uuid
,
code
:
this
.
searchCodeShow
,
captcha
:
this
.
captcha
,};
const
searchGlnRes
=
await
this
.
$api
.
search
.
searchInternal
(
params
);
const
{
returnCode
,
data
}
=
searchGlnRes
;
...
...
@@ -422,6 +425,9 @@ export default {
if
(
!
this
.
productSearch
.
code
)
{
return
this
.
$message
.
error
(
'请输入商品条码'
);
}
if
(
this
.
hasSpecialString
(
this
.
productSearch
.
code
)){
return
true
}
this
.
showResult
=
true
;
this
.
resultType
=
'product'
;
const
params
=
{
code
:
this
.
productSearch
.
code
};
...
...
src/views/Search/shortcode.vue
View file @
ea6a0ed8
...
...
@@ -129,8 +129,6 @@ export default {
},
methods
:
{
async
handleSearchCompany
()
{
this
.
showResult
=
true
;
const
params
=
{
shortCode
:
""
,
firmName
:
""
,
...
...
@@ -140,13 +138,22 @@ export default {
};
if
(
this
.
company
===
CODE
)
{
params
.
shortCode
=
this
.
companySearch
.
code
;
if
(
this
.
hasSpecialString
(
this
.
companySearch
.
code
)){
return
true
}
}
else
if
(
this
.
company
===
NAME
)
{
params
.
firmName
=
this
.
companySearch
.
name
;
if
(
this
.
hasSpecialString
(
this
.
companySearch
.
name
)){
return
true
}
}
else
{
params
.
registerAddress
=
this
.
companySearch
.
address
;
if
(
this
.
hasSpecialString
(
this
.
companySearch
.
address
)){
return
true
}
}
this
.
showResult
=
true
;
const
searchGlnRes
=
await
this
.
$api
.
search
.
searchGetList
(
params
);
console
.
log
(
searchGlnRes
)
const
{
returnCode
,
data
}
=
searchGlnRes
;
if
(
returnCode
===
"0"
)
{
// this.result = data;
...
...
src/views/Search/validation.js
View file @
ea6a0ed8
...
...
@@ -21,5 +21,13 @@ export default {
this
.
captchaPath
=
window
.
URL
.
createObjectURL
(
res
.
body
);
});
},
hasSpecialString
(
string
){
const
regName
=
/^
[\u
4e00-
\u
9fa5_a-zA-Z0-9
]
+$/
;
if
(
!
regName
.
test
(
string
)){
this
.
$message
.
error
(
'查询值只能包含中英文字符和数字!'
);
return
true
;
}
return
true
}
},
}
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