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
c84c8975
Commit
c84c8975
authored
Nov 28, 2023
by
Jianli Ou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问题处理
parent
0c1adbd8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
14 deletions
+62
-14
constant.js
src/utils/constant.js
+2
-2
external.vue
src/views/Search/external.vue
+60
-12
No files found.
src/utils/constant.js
View file @
c84c8975
...
@@ -12,8 +12,8 @@ export const GS1_Mark_List = [
...
@@ -12,8 +12,8 @@ export const GS1_Mark_List = [
{
label
:
'GCN-全球优惠券号码'
,
value
:
'GCN'
},
{
label
:
'GCN-全球优惠券号码'
,
value
:
'GCN'
},
{
label
:
'CPID-组件/零件标识符'
,
value
:
'CPID'
},
{
label
:
'CPID-组件/零件标识符'
,
value
:
'CPID'
},
{
label
:
'GMN-全球型号'
,
value
:
'GMN'
},
{
label
:
'GMN-全球型号'
,
value
:
'GMN'
},
{
label
:
'GTIN-商品条码'
,
value
:
'GTIN'
},
//
{ label: 'GTIN-商品条码', value: 'GTIN' },
{
label
:
'GLN-全球位置码'
,
value
:
'GLN'
}
//
{ label: 'GLN-全球位置码', value: 'GLN' }
]
]
/**
/**
...
...
src/views/Search/external.vue
View file @
c84c8975
...
@@ -105,7 +105,7 @@
...
@@ -105,7 +105,7 @@
<p
style=
"font-size:13px;margin:15px 0 0 0 ;"
>
该数据由Active Test Account企业提供,并于2023年5月2日最新更新
</p>
<p
style=
"font-size:13px;margin:15px 0 0 0 ;"
>
该数据由Active Test Account企业提供,并于2023年5月2日最新更新
</p>
<p
style=
"font-size:13px;"
>
该GTIN信息完整
</p>
<p
style=
"font-size:13px;"
>
该GTIN信息完整
</p>
</div>
</div>
<div
class=
"hrefInfo "
>
<div
v-if=
"GtinResultData.linkset"
class=
"hrefInfo "
>
<p>
链接至其他产品信息
</p>
<p>
链接至其他产品信息
</p>
<div
v-if=
"GtinResultData.links.hasRetailers"
class=
"hrefInfoList"
>
<div
v-if=
"GtinResultData.links.hasRetailers"
class=
"hrefInfoList"
>
<p>
有零售商
</p>
<p>
有零售商
</p>
...
@@ -185,7 +185,7 @@
...
@@ -185,7 +185,7 @@
<div
class=
"gtin-cnt"
>
<div
class=
"gtin-cnt"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"col-lg-12"
>
<el-input
v-model=
"glnInputValue"
placeholder=
"请输入GLN"
style=
"margin-top:5px"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-search"
></i></el-input>
<el-input
v-model
.
number
=
"glnInputValue"
placeholder=
"请输入GLN"
style=
"margin-top:5px"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-search"
></i></el-input>
</div>
</div>
<!--
<div
class=
"col-lg-1"
>
-->
<!--
<div
class=
"col-lg-1"
>
-->
<!--
<el-button
class=
"gtin-btn"
>
查询
</el-button>
-->
<!--
<el-button
class=
"gtin-btn"
>
查询
</el-button>
-->
...
@@ -204,13 +204,14 @@
...
@@ -204,13 +204,14 @@
<el-button
class=
"gtin-btn"
@
click=
"searchGLN"
>
查询
</el-button>
<el-button
class=
"gtin-btn"
@
click=
"searchGLN"
>
查询
</el-button>
</div>
</div>
</div>
</div>
<p
class=
"search-num"
>
搜索样例:
<span>
9506000140445
</span></p>
<!--
<p
class=
"search-num"
>
搜索样例:
<span>
9506000140445
</span></p>
-->
<p
class=
"search-num"
></p>
</div>
</div>
<div
v-if=
"glnResultData"
class=
"gtin-result"
>
<div
v-if=
"glnResultData"
class=
"gtin-result"
>
<div
class=
"gtin-result-tip"
>
<div
class=
"gtin-result-tip"
>
<img
src=
"../../assets/image/search/gtinIcon.png"
/>
<img
src=
"../../assets/image/search/gtinIcon.png"
/>
<div>
<div>
<p>
此
商品条码
已经由“
{{
glnResultData
.
gs1Licence
.
licenseeName
}}
”公司注册
</p>
<p>
此
数据
已经由“
{{
glnResultData
.
gs1Licence
.
licenseeName
}}
”公司注册
</p>
</div>
</div>
</div>
</div>
<el-tabs
v-model=
"gtinActiveName2"
@
tab-click=
"handleClick"
>
<el-tabs
v-model=
"gtinActiveName2"
@
tab-click=
"handleClick"
>
...
@@ -477,14 +478,15 @@
...
@@ -477,14 +478,15 @@
<el-button
class=
"gtin-btn"
@
click=
"searchGS1"
>
查询
</el-button>
<el-button
class=
"gtin-btn"
@
click=
"searchGS1"
>
查询
</el-button>
</div>
</div>
</div>
</div>
<p
class=
"search-num"
>
搜索样例:
<span>
9506000140445
</span></p>
<!--
<p
class=
"search-num"
>
搜索样例:
<span>
9506000140445
</span></p>
-->
<p
class=
"search-num"
></p>
</div>
</div>
<div
v-if=
"gs1ResultData"
class=
"gtin-result"
>
<div
v-if=
"gs1ResultData"
class=
"gtin-result"
>
<div
class=
"gtin-result-tip"
style=
"margin-top:20px"
>
<div
class=
"gtin-result-tip"
style=
"margin-top:20px"
>
<img
src=
"../../assets/image/search/gtinIcon.png"
/>
<img
src=
"../../assets/image/search/gtinIcon.png"
/>
<div>
<div>
<p>
{{
gs1ResultData
.
gtin
}}
</p>
<p>
{{
gs1ResultData
.
gtin
}}
</p>
<p>
此商品条码已经由“
{{
gs1ResultData
.
licenseeName
}}
”公司注册
</p>
<p>
此商品条码已经由“
{{
gs1ResultData
.
gs1Licence
.
licenseeName
}}
”公司注册
</p>
</div>
</div>
</div>
</div>
<el-tabs
v-model=
"gtinActiveName3"
@
tab-click=
"handleClick"
class=
"tab3"
>
<el-tabs
v-model=
"gtinActiveName3"
@
tab-click=
"handleClick"
class=
"tab3"
>
...
@@ -607,7 +609,8 @@
...
@@ -607,7 +609,8 @@
layout=
"prev, pager, next"
layout=
"prev, pager, next"
:page-size=
"pageSize"
:page-size=
"pageSize"
:current-page=
"currPage"
:current-page=
"currPage"
:total=
"totalMaxShowNum"
>
:total=
"totalMaxShowNum"
@
current-change=
"currPageChangeEvent"
>
</el-pagination>
</el-pagination>
</div>
</div>
<span
style=
"color: rgb(255, 59, 48)"
v-else
>
{{ errorMsg }}
</span>
<span
style=
"color: rgb(255, 59, 48)"
v-else
>
{{ errorMsg }}
</span>
...
@@ -714,6 +717,27 @@ export default {
...
@@ -714,6 +717,27 @@ export default {
this
.
errorMsg
=
''
this
.
errorMsg
=
''
this
.
captcha
=
''
this
.
captcha
=
''
this
.
getCaptcha
();
this
.
getCaptcha
();
// 各个标签下的数据恢复初始值
this
.
GtinInputValue
=
''
this
.
GtinResultData
=
''
this
.
glnInputValue
=
''
this
.
glnResultData
=
''
this
.
gs1Type
=
''
this
.
gs1InputValue
=
''
this
.
gs1ResultData
=
''
this
.
countryCode
=
''
this
.
licenseeName
=
''
this
.
streetAddress
=
''
this
.
postalCode
=
''
this
.
addressLocality
=
''
this
.
otherFiled
=
false
this
.
qyResultData
=
''
this
.
currPage
=
1
this
.
pageSize
=
10
this
.
total
=
0
this
.
totalMaxShowNum
=
0
this
.
tableData
=
[]
},
},
handleClick
()
{
handleClick
()
{
},
},
...
@@ -749,6 +773,7 @@ export default {
...
@@ -749,6 +773,7 @@ export default {
productSustainabilityInfo
:
''
,
// 可持续性和回收(不建议使用)
productSustainabilityInfo
:
''
,
// 可持续性和回收(不建议使用)
recipeInfo
:
''
// 食谱网站
recipeInfo
:
''
// 食谱网站
}
}
if
(
data
[
0
].
linkset
)
{
Object
.
keys
(
data
[
0
].
linkset
).
forEach
(
item
=>
{
Object
.
keys
(
data
[
0
].
linkset
).
forEach
(
item
=>
{
const
linkDataStructure
=
(
linkObj
)
=>
{
const
linkDataStructure
=
(
linkObj
)
=>
{
return
{
href
:
linkObj
.
href
,
hreflang
:
linkObj
.
hreflang
[
0
],
title
:
linkObj
.
title
,
type
:
linkObj
.
type
}
return
{
href
:
linkObj
.
href
,
hreflang
:
linkObj
.
hreflang
[
0
],
title
:
linkObj
.
title
,
type
:
linkObj
.
type
}
...
@@ -771,6 +796,7 @@ export default {
...
@@ -771,6 +796,7 @@ export default {
})
})
}
}
})
})
}
this
.
GtinResultData
=
data
[
0
]
this
.
GtinResultData
=
data
[
0
]
}
}
!
data
&&
(
this
.
errorMsg
=
'没有查询到相关信息!'
)
!
data
&&
(
this
.
errorMsg
=
'没有查询到相关信息!'
)
...
@@ -789,16 +815,25 @@ export default {
...
@@ -789,16 +815,25 @@ export default {
})
})
},
},
async
searchGLN
()
{
async
searchGLN
()
{
if
(
String
(
this
.
glnInputValue
).
length
!==
13
)
{
this
.
errorMsg
=
'请输入13位GLN!'
return
}
this
.
glnResultData
=
''
this
.
glnResultData
=
''
this
.
errorMsg
=
'正在查询……'
this
.
errorMsg
=
'正在查询……'
const
params
=
{
const
params
=
{
gln
:
this
.
glnInputValue
,
gln
:
String
(
this
.
glnInputValue
)
,
uuid
:
this
.
uuid
,
uuid
:
this
.
uuid
,
captcha
:
this
.
captcha
captcha
:
this
.
captcha
};
};
const
searchResult
=
await
this
.
$api
.
search
.
searchGLN
(
params
);
const
searchResult
=
await
this
.
$api
.
search
.
searchGLN
(
params
);
const
{
returnCode
,
returnMsg
,
data
}
=
searchResult
;
const
{
returnCode
,
returnMsg
,
data
}
=
searchResult
;
if
(
returnCode
===
"0"
)
{
if
(
returnCode
===
"0"
)
{
if
(
!
data
)
{
this
.
errorMsg
=
'没有查询到相关信息!'
this
.
getCaptcha
();
return
}
if
(
data
&&
data
[
0
].
glnRecords
)
{
if
(
data
&&
data
[
0
].
glnRecords
)
{
data
[
0
].
glnRecords
.
forEach
(
item
=>
{
data
[
0
].
glnRecords
.
forEach
(
item
=>
{
if
(
item
.
glnType
===
'LEGAL_ENTITY'
)
data
[
0
].
LEGAL_ENTITY
=
item
if
(
item
.
glnType
===
'LEGAL_ENTITY'
)
data
[
0
].
LEGAL_ENTITY
=
item
...
@@ -837,7 +872,6 @@ export default {
...
@@ -837,7 +872,6 @@ export default {
})
})
}
}
this
.
glnResultData
=
data
?
data
[
0
]
:
''
this
.
glnResultData
=
data
?
data
[
0
]
:
''
!
data
&&
(
this
.
errorMsg
=
'没有查询到相关信息!'
)
}
else
{
}
else
{
this
.
showResult
=
true
;
this
.
showResult
=
true
;
this
.
errorMsg
=
returnMsg
||
'没有查询到相关信息!'
;
this
.
errorMsg
=
returnMsg
||
'没有查询到相关信息!'
;
...
@@ -857,14 +891,22 @@ export default {
...
@@ -857,14 +891,22 @@ export default {
const
{
returnCode
,
returnMsg
,
data
}
=
searchResult
;
const
{
returnCode
,
returnMsg
,
data
}
=
searchResult
;
if
(
returnCode
===
"0"
)
{
if
(
returnCode
===
"0"
)
{
// if (data && this.gs1Type === 'GTIN') data[0] = {...data[0], gs1Licence: data[0]}
// if (data && this.gs1Type === 'GTIN') data[0] = {...data[0], gs1Licence: data[0]}
if
(
!
data
[
0
].
code
)
{
this
.
gs1ResultData
=
data
?
data
[
0
]
:
''
this
.
gs1ResultData
=
data
?
data
[
0
]
:
''
!
data
&&
(
this
.
errorMsg
=
'没有查询到相关信息!'
)
!
data
&&
(
this
.
errorMsg
=
'没有查询到相关信息!'
)
}
else
{
}
else
{
this
.
errorMsg
=
'没有查询到相关信息!'
}
}
else
{
this
.
showResult
=
true
;
this
.
showResult
=
true
;
this
.
errorMsg
=
returnMsg
||
'您输入的GS1标识不正确,请确认后重试。'
;
this
.
errorMsg
=
returnMsg
||
'您输入的GS1标识不正确,请确认后重试。'
;
}
}
this
.
getCaptcha
();
this
.
getCaptcha
();
},
},
currPageChangeEvent
(
e
)
{
this
.
currPage
=
e
this
.
tableData
=
this
.
qyResultData
.
filter
((
item
,
index
)
=>
e
===
1
?
index
<
10
:
index
>=
10
)
},
async
searchQY
()
{
async
searchQY
()
{
this
.
qyResultData
=
''
this
.
qyResultData
=
''
this
.
errorMsg
=
'正在查询……'
this
.
errorMsg
=
'正在查询……'
...
@@ -877,7 +919,7 @@ export default {
...
@@ -877,7 +919,7 @@ export default {
uuid
:
this
.
uuid
,
uuid
:
this
.
uuid
,
captcha
:
this
.
captcha
,
captcha
:
this
.
captcha
,
pageindex
:
this
.
currPage
,
pageindex
:
this
.
currPage
,
pagesize
:
this
.
pageSize
pagesize
:
20
};
};
const
searchResult
=
await
this
.
$api
.
search
.
searchQy
(
params
);
const
searchResult
=
await
this
.
$api
.
search
.
searchQy
(
params
);
const
{
returnCode
,
returnMsg
,
data
}
=
searchResult
;
const
{
returnCode
,
returnMsg
,
data
}
=
searchResult
;
...
@@ -886,9 +928,8 @@ export default {
...
@@ -886,9 +928,8 @@ export default {
item
.
address
=
item
.
address
||
{
addressLocality
:
{
language
:
''
,
value
:
''
},
countryCode
:
''
}
item
.
address
=
item
.
address
||
{
addressLocality
:
{
language
:
''
,
value
:
''
},
countryCode
:
''
}
return
{...
item
,
countrytitle
:
(
this
.
countryList
.
find
(
country
=>
country
.
twocode
===
item
.
address
.
countryCode
)
||
{
countrytitle
:
''
}).
countrytitle
}
return
{...
item
,
countrytitle
:
(
this
.
countryList
.
find
(
country
=>
country
.
twocode
===
item
.
address
.
countryCode
)
||
{
countrytitle
:
''
}).
countrytitle
}
})
})
console
.
log
(
data
.
list
)
this
.
qyResultData
=
data
.
list
this
.
qyResultData
=
data
.
list
this
.
tableData
=
data
.
list
this
.
tableData
=
data
.
list
.
filter
((
item
,
index
)
=>
index
<
10
)
this
.
total
=
data
.
totalCount
this
.
total
=
data
.
totalCount
this
.
totalMaxShowNum
=
Math
.
min
(
data
.
totalCount
,
20
)
this
.
totalMaxShowNum
=
Math
.
min
(
data
.
totalCount
,
20
)
!
data
&&
(
this
.
errorMsg
=
'没有查询到相关信息!'
)
!
data
&&
(
this
.
errorMsg
=
'没有查询到相关信息!'
)
...
@@ -1320,4 +1361,11 @@ export default {
...
@@ -1320,4 +1361,11 @@ export default {
border-bottom-left-radius
:
4px
!important
;
border-bottom-left-radius
:
4px
!important
;
}
}
}
}
.el-collapse-item__arrow
{
transform
:
rotate
(
90deg
);
}
.el-collapse-item__arrow.is-active
{
transform
:
rotate
(
270deg
);
}
</
style
>
</
style
>
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