Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_move
Project
Project
Details
Activity
Releases
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
胡宝山
template_move
Commits
e2c592e2
Commit
e2c592e2
authored
Nov 10, 2024
by
xfxmcy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test v0.0.1
parent
3cc2769a
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
949 additions
and
110 deletions
+949
-110
instrument.js
src/api/instrument/instrument.js
+14
-0
query.js
src/api/query/query.js
+4
-2
WebViewContact.js
src/utils/WebViewContact.js
+58
-1
common.js
src/utils/common.js
+15
-9
detail.vue
src/views/inventory/detail.vue
+166
-31
index.vue
src/views/inventory/index.vue
+3
-3
index.vue
src/views/query/index.vue
+97
-24
index.vue
src/views/setup/index.vue
+0
-1
uhfIndex.vue
src/views/setup/uhfIndex.vue
+358
-0
index.vue
src/views/track/index.vue
+232
-37
vue.config.js
vue.config.js
+2
-2
No files found.
src/api/instrument/instrument.js
View file @
e2c592e2
...
@@ -189,6 +189,20 @@ export function getInventoryPdDetail(query) {
...
@@ -189,6 +189,20 @@ export function getInventoryPdDetail(query) {
})
})
}
}
export
function
getALl
(
query
)
{
return
request
({
url
:
'/insstrumentinfo/findInventoryPdAll'
,
method
:
'get'
,
params
:
query
})
}
export
function
pdSubmit
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/insstrumentinfo/pdSubmit'
,
method
:
'post'
,
data
:
data
})
}
export
function
delInventoryPd
(
query
)
{
export
function
delInventoryPd
(
query
)
{
return
request
({
return
request
({
url
:
'/insstrumentinfo/deleteInventoryPd'
,
method
:
'get'
,
params
:
query
url
:
'/insstrumentinfo/deleteInventoryPd'
,
method
:
'get'
,
params
:
query
...
...
src/api/query/query.js
View file @
e2c592e2
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
// 查询仪器管理详细信息
// 查询仪器管理详细信息
export
function
getInsStrumentInfo
(
businessId
)
{
export
function
getInsStrumentInfo
(
query
)
{
return
request
({
return
request
({
url
:
'/insstrumentinfo/detail/'
+
businessId
,
method
:
'get'
url
:
'/insstrumentinfo/pdaQuery'
,
params
:
query
,
method
:
'get'
})
})
}
}
src/utils/WebViewContact.js
View file @
e2c592e2
...
@@ -8,6 +8,56 @@ export const openCamera = (params) => {
...
@@ -8,6 +8,56 @@ export const openCamera = (params) => {
})
})
})
})
}
}
// 开始识别
export
const
startPower
=
(
params
)
=>
{
return
new
Promise
(
resolve
=>
{
DS_BRIDGE
.
call
(
'startPower'
,
params
,
res
=>
{
resolve
(
res
)
})
})
}
// 停止识别
export
const
stopPower
=
(
params
)
=>
{
return
new
Promise
(
resolve
=>
{
DS_BRIDGE
.
call
(
'stopPower'
,
params
,
res
=>
{
resolve
(
res
)
})
})
}
// 设置功率
export
const
setPower
=
(
params
)
=>
{
return
new
Promise
(
resolve
=>
{
DS_BRIDGE
.
call
(
'setPower'
,
params
,
res
=>
{
resolve
(
res
)
})
})
}
// 设置功率
export
const
clearPower
=
(
params
)
=>
{
return
new
Promise
(
resolve
=>
{
DS_BRIDGE
.
call
(
'clearPower'
,
params
,
res
=>
{
resolve
(
res
)
})
})
}
// 设置声音
// 分5档, 0-5
// 传过去的对象里面volumeValue设置系统音量值
export
const
addVolume
=
(
params
)
=>
{
return
new
Promise
(
resolve
=>
{
DS_BRIDGE
.
call
(
'addVolume'
,
params
,
res
=>
{
resolve
(
res
)
})
})
}
// 减小声音
export
const
reduceVolume
=
(
params
)
=>
{
return
new
Promise
(
resolve
=>
{
DS_BRIDGE
.
call
(
'reduceVolume'
,
params
,
res
=>
{
resolve
(
res
)
})
})
}
// 拍照取相册 实现调用存储功能(带相册,文件资源功能)
// 拍照取相册 实现调用存储功能(带相册,文件资源功能)
export
const
openCameraStorage
=
(
params
)
=>
{
export
const
openCameraStorage
=
(
params
)
=>
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
...
@@ -35,7 +85,14 @@ export const openScan = (params) => {
...
@@ -35,7 +85,14 @@ export const openScan = (params) => {
export
const
WebView
=
{
export
const
WebView
=
{
openCamera
,
openCamera
,
startPower
,
stopPower
,
clearPower
,
setPower
,
addVolume
,
reduceVolume
,
openCameraStorage
,
openCameraStorage
,
openCameraAll
,
openCameraAll
,
openScan
openScan
,
DS_BRIDGE
}
}
src/utils/common.js
View file @
e2c592e2
...
@@ -182,27 +182,33 @@ export function includePermission(accessName) {
...
@@ -182,27 +182,33 @@ export function includePermission(accessName) {
if
(
!
store
.
getters
.
permissions
)
{
return
false
}
if
(
!
store
.
getters
.
permissions
)
{
return
false
}
return
(
store
.
getters
.
permissions
.
includes
(
accessName
)
||
store
.
getters
.
permissions
.
includes
(
'*:*:*'
))
return
(
store
.
getters
.
permissions
.
includes
(
accessName
)
||
store
.
getters
.
permissions
.
includes
(
'*:*:*'
))
}
}
// 控制音频启用状态
// 控制音频启用状态
const
isAudioAble
=
false
const
isAudioAble
=
true
const
isSuccessAudioAble
=
false
const
isSuccessAudioAble
=
true
const
errorSound
=
new
Audio
(
require
(
'../assets/audio/y1840.mp3'
))
// const errorSound = new Audio(require('../assets/audio/y1840.mp3'))
const
successSound
=
new
Audio
(
require
(
'../assets/audio/8858.mp3'
))
// const successSound = new Audio(require('../assets/audio/8858.mp3'))
export
function
playAudio
(
start
)
{
export
function
playAudio
(
start
)
{
if
(
!
isAudioAble
)
{
if
(
!
isAudioAble
)
{
return
return
}
}
if
(
start
)
{
if
(
start
)
{
const
errorSound
=
new
Audio
(
require
(
'../assets/audio/y1840.mp3'
))
errorSound
.
play
()
errorSound
.
play
()
/*setTimeout(() => {
errorSound.play()
}, 500)*/
}
else
{
}
else
{
//
errorSound.pause()
//errorSound.pause()
}
}
}
}
export
function
successAudio
(
start
)
{
export
function
successAudio
(
start
)
{
if
(
!
isSuccessAudioAble
)
{
if
(
!
isSuccessAudioAble
)
{
return
return
}
}
if
(
start
)
{
if
(
start
)
{
const
successSound
=
new
Audio
(
require
(
'../assets/audio/8858.mp3'
))
successSound
.
play
()
successSound
.
play
()
}
else
{
}
else
{
// successSound.pause()
// successSound.pause()
...
@@ -211,9 +217,9 @@ export function successAudio(start) {
...
@@ -211,9 +217,9 @@ export function successAudio(start) {
// 自定义转换成大写的
// 自定义转换成大写的
export
function
customUpperCase
(
sourceStr
)
{
export
function
customUpperCase
(
sourceStr
)
{
return
sourceStr
&&
sourceStr
!==
''
?
sourceStr
.
toUpperCase
()
.
trim
()
:
sourceStr
return
sourceStr
&&
sourceStr
!==
''
?
sourceStr
.
toUpperCase
()
:
sourceStr
}
}
export
function
UpperCaseStr
(
sourceStr
)
{
export
function
trimAnd
UpperCaseStr
(
sourceStr
)
{
return
sourceStr
&&
sourceStr
!==
''
?
sourceStr
.
replace
(
/
\s
+/g
,
''
).
toUpperCase
()
:
sourceStr
return
sourceStr
&&
sourceStr
!==
''
?
sourceStr
.
trim
(
).
toUpperCase
()
:
sourceStr
}
}
src/views/inventory/detail.vue
View file @
e2c592e2
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
<div>
<div>
<el-row
:gutter=
"20"
type=
"flex"
justify=
"center"
>
<el-row
:gutter=
"20"
type=
"flex"
justify=
"center"
>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-button
class=
"submitBtn"
type=
"primary"
:loading=
"
isStarting"
@
click=
"startInventory
"
>
<el-button
class=
"submitBtn"
type=
"primary"
:loading=
"
!ready"
@
click=
"handleStartPower
"
>
<span>
开始盘点
</span>
<span>
开始盘点
</span>
</el-button>
</el-button>
</el-col>
</el-col>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<el-button
class=
"submitBtn"
type=
"primary"
:loading=
"isEnding"
@
click=
"endInventory
"
>
<el-button
class=
"submitBtn"
type=
"primary"
@
click=
"handleStopPower
"
>
<span>
结束盘点
</span>
<span>
结束盘点
</span>
</el-button>
</el-button>
</el-col>
</el-col>
...
@@ -16,14 +16,19 @@
...
@@ -16,14 +16,19 @@
<!-- 新增统计数据展示 -->
<!-- 新增统计数据展示 -->
<div
class=
"padding"
>
<div
class=
"padding"
>
<el-row
style=
"margin-top: 20px;"
>
<el-row
style=
"margin-top: 20px;"
>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
style=
"text-align: center"
>
<span
style=
"margin-right: 10px"
:class=
"statusClass"
>
{{
this
.
statusText
}}
</span>
</el-col>
</el-row>
<el-row
style=
"margin-top: 20px;"
>
<el-col
:span=
"12"
>
<div
class=
"statistics"
>
<div
class=
"statistics"
>
<p>
合计:
{{
this
.
count
}}
</p>
<p>
合计:
<span
style=
"margin-left: 10px"
>
{{
this
.
count
}}
</span>
</p>
</div>
</div>
</el-col>
</el-col>
<el-col
:span=
"
24
"
>
<el-col
:span=
"
12
"
>
<div
class=
"statistics"
>
<div
class=
"statistics"
>
<p>
已盘:
{{
this
.
completedCount
}}
</p>
<p>
已盘:
<span
style=
"color: red;margin-left: 10px"
>
{{
this
.
completedCount
}}
</span>
</p>
</div>
</div>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -61,8 +66,8 @@
...
@@ -61,8 +66,8 @@
<pagination
<pagination
v-show=
"total>0"
v-show=
"total>0"
:total=
"total"
:total=
"total"
:page
.
sync=
"
detailQ
ueryParams.page"
:page
.
sync=
"
q
ueryParams.page"
:limit
.
sync=
"
detailQ
ueryParams.rows"
:limit
.
sync=
"
q
ueryParams.rows"
layout=
"total, prev, pager, next"
layout=
"total, prev, pager, next"
@
pagination=
"getInventoryPdDetail(id)"
@
pagination=
"getInventoryPdDetail(id)"
/>
/>
...
@@ -71,9 +76,11 @@
...
@@ -71,9 +76,11 @@
</template>
</template>
<
script
>
<
script
>
import
{
getInventoryPdDetail
}
from
'@/api/instrument/instrument'
import
{
getInventoryPdDetail
,
getALl
,
pdSubmit
}
from
'@/api/instrument/instrument'
import
commonField
from
'@/utils/commonField'
import
commonField
from
'@/utils/commonField'
import
deviceField
from
'@/utils/device/deviceField'
import
deviceField
from
'@/utils/device/deviceField'
import
{
getToken
}
from
'@/utils/auth'
import
{
playAudio
,
successAudio
}
from
'@/utils/common'
export
default
{
export
default
{
name
:
'Instrument'
,
name
:
'Instrument'
,
...
@@ -96,14 +103,12 @@ export default {
...
@@ -96,14 +103,12 @@ export default {
// 盘点弹出层标题
// 盘点弹出层标题
inventoryTitle
:
''
,
inventoryTitle
:
''
,
inventoryOpen
:
false
,
inventoryOpen
:
false
,
// 管理字典
insManageList
:
{},
completedCount
:
0
,
count
:
0
,
// 类型字典
// 类型字典
insTypeList
:
{},
insTypeList
:
{},
// 日期范围
// 日期范围
dateRange
:
[],
dateRange
:
[],
statusClass
:
'status_b'
,
statusText
:
'进行中'
,
id
:
''
,
id
:
''
,
// 查询参数
// 查询参数
queryParams
:
{
queryParams
:
{
...
@@ -112,19 +117,22 @@ export default {
...
@@ -112,19 +117,22 @@ export default {
pdCode
:
undefined
,
pdCode
:
undefined
,
userName
:
undefined
userName
:
undefined
},
},
detailQueryParams
:
{
ready
:
false
,
page
:
1
,
rows
:
10
,
pdId
:
undefined
,
insCode
:
undefined
},
// 表单参数
// 表单参数
form
:
{},
form
:
{},
// 表单校验
// 表单校验
fileFakeList
:
[],
fileFakeList
:
[],
fileList
:
[],
fileList
:
[],
dialogImageUrl
:
''
,
dialogImageUrl
:
''
,
dialogVisible
:
false
dialogVisible
:
false
,
// 所有集合
allList
:
[],
completedCount
:
0
,
count
:
0
,
// 精简数组, {id, insRfid, status, sync } sync 1 已同步数据库 0 未同步
sampleList
:[],
timer
:
undefined
}
}
},
},
computed
:
{
computed
:
{
...
@@ -140,25 +148,149 @@ export default {
...
@@ -140,25 +148,149 @@ export default {
},
},
created
()
{
created
()
{
this
.
id
=
this
.
$route
.
query
.
businessId
;
this
.
id
=
this
.
$route
.
query
.
businessId
;
this
.
getInventoryPdDetail
(
this
.
id
)
this
.
reloadAll
(
this
.
id
)
let
_that
=
this
let
sampleListCache
=
this
.
sampleList
// 接受扫描结果, resultInfo ,android返回的key
this
.
$WebView
.
DS_BRIDGE
.
register
(
'resultInfo'
,
args
=>
{
// 根据resultInfo的key拿到Android实时推送的数据解析后赋值回显
// [{rssi: '-75.60', typeId: 'Exxxxxxx' }]
let
resList
=
JSON
.
parse
(
args
)
resList
.
forEach
(
x
=>
{
_that
.
sampleList
.
forEach
(
y
=>
{
if
(
x
.
typeId
==
y
.
insRfid
&&
y
.
status
!=
'1'
)
{
y
.
status
=
'1'
}
})
})
_that
.
completedCount
=
sampleListCache
.
filter
(
x
=>
x
.
status
==
'1'
).
length
})
this
.
timer
=
setInterval
(()
=>
{
let
_that
=
this
let
ids
=
[]
this
.
sampleList
.
forEach
(
y
=>
{
if
(
y
.
status
==
'1'
&&
y
.
sync
==
'0'
)
{
ids
.
push
(
y
.
id
)
}
})
if
(
ids
.
length
==
0
)
{
return
}
let
param
=
{
businessId
:
this
.
id
,
ids
:
ids
.
join
(
','
)
}
pdSubmit
(
param
).
then
(
response
=>
{
if
(
response
.
code
==
200
){
ids
.
forEach
(
x
=>
{
_that
.
sampleList
.
forEach
(
y
=>
{
if
(
y
.
status
==
'1'
&&
y
.
sync
==
'0'
&&
x
==
y
.
id
)
{
y
.
sync
=
'1'
}
})
})
setTimeout
(()
=>
{
// successAudio(true)
},
500
);
// 2000毫秒 = 2秒
if
(
response
.
data
.
lastCount
===
0
)
{
// successAudio(true)
this
.
$message
({
message
:
"盘点已完成!"
,
type
:
'success'
})
this
.
statusClass
=
'status_e'
this
.
statusText
=
'盘点完成'
this
.
handleClearPower
()
// 停止
this
.
handleStopPower
()
clearInterval
(
this
.
timer
)
}
}
else
{
this
.
$message
({
message
:
response
.
message
,
type
:
'error'
})
// playAudio(true)
// 停止
this
.
handleClearPower
()
this
.
handleStopPower
()
clearInterval
(
this
.
timer
)
}
})
},
2500
);
},
beforeDestroy
()
{
this
.
handleClearPower
()
this
.
handleStopPower
()
clearInterval
(
this
.
timer
)
// 清除定时器
},
},
methods
:
{
methods
:
{
/** 开始识别按钮*/
handleStartPower
()
{
let
selectList
=
[]
this
.
sampleList
.
forEach
(
x
=>
{
if
(
x
.
status
!=
'1'
)
{
selectList
.
push
(
x
.
insRfid
)
}
})
this
.
startState
=
true
const
params
=
{
flag
:
'startPower'
,
//selectValue: selectList,
selectValue
:
[],
tokenMsg
:
getToken
()
}
// 补充逻辑:如果设置筛选有值就调筛选逻辑,传id过去,筛选没值就不传id过去
this
.
$WebView
.
startPower
(
params
).
then
(
res
=>
{
})
},
/** 清空数据按钮*/
handleClearPower
()
{
const
params
=
{
flag
:
'clearPower'
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
clearPower
(
params
).
then
(
res
=>
{
})
},
/** 停止识别按钮*/
handleStopPower
()
{
this
.
startState
=
false
const
params
=
{
flag
:
'stopPower'
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
stopPower
(
params
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
},
// 详情窗口关闭
// 详情窗口关闭
infoWinCancel
()
{
infoWinCancel
()
{
this
.
infoOpen
=
false
this
.
infoOpen
=
false
},
},
/** 详情按钮操作 */
/** 详情按钮操作 */
handleInfo
()
{
handleInfo
()
{
this
.
infoOpen
=
true
this
.
getInventoryPdDetail
(
this
.
id
)
},
},
getInventoryPdDetail
(
id
)
{
getInventoryPdDetail
(
id
)
{
this
.
detailQueryParams
.
pdId
=
id
getInventoryPdDetail
({
pdId
:
id
}).
then
(
response
=>
{
getInventoryPdDetail
(
this
.
detailQueryParams
).
then
(
response
=>
{
this
.
detailList
=
response
.
rows
this
.
detailList
=
response
.
rows
this
.
total
=
response
.
total
this
.
total
=
response
.
total
this
.
detailQueryParams
.
page
=
response
.
pageNu
this
.
infoOpen
=
true
this
.
detailQueryParams
.
rows
=
response
.
pageSize
})
this
.
countStatus
()
},
reloadAll
(
id
)
{
getALl
({
pdId
:
id
}).
then
(
response
=>
{
this
.
allList
=
response
.
data
this
.
ready
=
true
this
.
count
=
this
.
allList
.
length
this
.
completedCount
=
this
.
allList
.
filter
(
x
=>
x
.
pdStatus
==
'1'
).
length
this
.
allList
.
forEach
(
x
=>
{
if
(
x
.
insRfid
)
{
this
.
sampleList
.
push
({
id
:
x
.
businessId
,
insRfid
:
x
.
insRfid
,
status
:
x
.
pdStatus
,
sync
:
x
.
pdStatus
==
'1'
?
1
:
0
})
}
})
})
})
},
},
endInventory
(){
endInventory
(){
...
@@ -170,10 +302,6 @@ export default {
...
@@ -170,10 +302,6 @@ export default {
this
.
$router
.
back
()
this
.
$router
.
back
()
})
})
},
},
countStatus
()
{
this
.
completedCount
=
this
.
detailList
.
filter
(
item
=>
item
.
pdStatus
===
'1'
).
length
;
this
.
count
=
this
.
total
;
},
// 根据状态控制当前行的颜色
// 根据状态控制当前行的颜色
changeColor
({
row
,
rowIndex
})
{
changeColor
({
row
,
rowIndex
})
{
if
(
row
.
pdStatus
===
'1'
)
{
if
(
row
.
pdStatus
===
'1'
)
{
...
@@ -222,4 +350,11 @@ export default {
...
@@ -222,4 +350,11 @@ export default {
padding-left
:
50px
;
/* 设置左边的间距 */
padding-left
:
50px
;
/* 设置左边的间距 */
padding-top
:
50px
;
padding-top
:
50px
;
}
}
.status_b
{
color
:
red
;
}
.status_e
{
color
:
green
;
}
</
style
>
</
style
>
src/views/inventory/index.vue
View file @
e2c592e2
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<div
v-if=
"themeType === '8'"
class=
"tableTitle"
>
设备
盘点
</div>
<div
v-if=
"themeType === '8'"
class=
"tableTitle"
>
仪器
盘点
</div>
<div
style=
"padding:5px 10px"
>
<div
style=
"padding:5px 10px"
>
<el-table
v-loading=
"loading"
border
:data=
"insStrumentInfoList"
>
<el-table
v-loading=
"loading"
border
:data=
"insStrumentInfoList"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
align=
"center"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
align=
"center"
/>
...
@@ -9,9 +9,9 @@
...
@@ -9,9 +9,9 @@
{{
scope
.
row
.
pdCode
||
'-'
}}
{{
scope
.
row
.
pdCode
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
创建时间"
width=
"150
"
prop=
"insJdrq"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"
日期
"
prop=
"insJdrq"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createDate
|
transformDateByFormat
(
'
YYYY-MM-DD HH:mm
'
)
}}
</span>
<span>
{{
scope
.
row
.
createDate
|
transformDateByFormat
(
'
MM-DD
'
)
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"50px"
>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"50px"
>
...
...
src/views/query/index.vue
View file @
e2c592e2
<
template
>
<
template
>
<div
@
keyup
.
enter=
"handleQuery"
style=
"display: flex; flex-direction: column; height: 78vh;"
>
<div
@
keyup
.
enter=
"handleQuery"
style=
"display: flex; flex-direction: column; height: 78vh;"
>
<el-form
ref=
"queryForm"
:model=
"queryParams"
:inline=
"true"
<el-form
ref=
"queryForm"
:model=
"queryParams"
:inline=
"true"
@
submit
.
native
.
prevent
style=
"border-bottom: 1px solid #dcdcdc;"
>
style=
"border-bottom: 1px solid #dcdcdc;"
>
<el-form-item
label=
"
编号
"
prop=
"insCode"
style=
"padding-left: 10px"
>
<el-form-item
label=
""
prop=
"insCode"
style=
"padding-left: 10px"
>
<el-input
<el-input
v-model=
"queryParams.businessId"
v-model=
"queryParams.businessId"
placeholder=
"请输入编号"
placeholder=
"请输入编号"
...
@@ -10,10 +11,10 @@
...
@@ -10,10 +11,10 @@
autofocus
autofocus
:maxlength=
"30"
:maxlength=
"30"
size=
"small"
size=
"small"
style=
"width: 1
2
0px;"
style=
"width: 1
4
0px;"
/>
/>
<el-button
<el-button
style=
"width: 7
5
px;margin-left: 0"
style=
"width: 7
0
px;margin-left: 0"
:class=
"commonField.queryClass"
:class=
"commonField.queryClass"
:type=
"commonField.typePrimary"
:type=
"commonField.typePrimary"
:icon=
"commonField.queryIcon"
:icon=
"commonField.queryIcon"
...
@@ -22,7 +23,7 @@
...
@@ -22,7 +23,7 @@
>
查询
>
查询
</el-button>
</el-button>
<el-button
<el-button
style=
"width: 7
5
px;margin-left: 0"
style=
"width: 7
0
px;margin-left: 0"
:class=
"commonField.resetClass"
:class=
"commonField.resetClass"
:icon=
"commonField.resetIcon"
:icon=
"commonField.resetIcon"
:size=
"commonField.smallSize"
:size=
"commonField.smallSize"
...
@@ -104,7 +105,7 @@
...
@@ -104,7 +105,7 @@
</el-row>
</el-row>
<el-row
:span=
"24"
>
<el-row
:span=
"24"
>
<el-form-item
label=
"实物:"
prop=
"insImplementation"
>
<el-form-item
label=
"实物:"
prop=
"insImplementation"
>
<div
class=
"photo-wall"
v-if=
"fileFakeList.length > 0"
>
<
!--<
div class="photo-wall" v-if="fileFakeList.length > 0">
<el-carousel height="150px" style="width: 150px;" indicator-position="none">
<el-carousel height="150px" style="width: 150px;" indicator-position="none">
<el-carousel-item v-for="(item, index) in fileFakeList" >
<el-carousel-item v-for="(item, index) in fileFakeList" >
<el-image
<el-image
...
@@ -117,24 +118,52 @@
...
@@ -117,24 +118,52 @@
/>
/>
</el-carousel-item>
</el-carousel-item>
</el-carousel>
</el-carousel>
</div>-->
<el-button
style=
"width: 70px;margin-left: 0px; margin-bottom: 5px"
:class=
"commonField.queryClass"
:type=
"commonField.typePrimary"
:icon=
"commonField.importIcon"
:size=
"commonField.smallSize"
@
click=
"handlePpenCameraAll1"
>
拍照
</el-button>
<div
class=
"photo-wall"
style=
"display: flex"
v-if=
"fileFakeList.length > 0"
v-for=
"(item, index) in fileFakeList"
>
<el-image
@
click=
"handlePreview(item)"
:key=
"index"
:src=
"item.url"
:teleported=
"true"
style=
"width: 150px; height: 150px;margin-top: 5%"
fit=
"cover"
/>
<el-button
type=
"danger"
icon=
"el-icon-delete"
circle
style=
"height: 40px;margin-left: 5%;margin-top: 10%"
></el-button>
</div>
</div>
</el-form-item>
</el-form-item>
</el-row>
</el-row>
<el-row
:span=
"24"
>
<el-row
:span=
"24"
>
<el-form-item
label=
"参照物:"
prop=
"file"
>
<el-form-item
label=
"铭牌:"
prop=
"file"
>
<div
class=
"photo-wall"
v-if=
"fileList.length > 0"
>
<el-button
<el-carousel
height=
"150px"
style=
"width: 150px;"
indicator-position=
"none"
>
style=
"width: 70px;margin-left: 0px; margin-bottom: 5px"
<el-carousel-item
v-for=
"(item, index) in fileList"
>
:class=
"commonField.queryClass"
<el-image
:type=
"commonField.typePrimary"
@
click=
"handlePreview(item)"
:icon=
"commonField.importIcon"
:key=
"index"
:size=
"commonField.smallSize"
:src=
"item.url"
@
click=
"handlePpenCameraAll2"
z-index=
"2000"
>
拍照
style=
"width: 150px; height: 150px;"
</el-button>
fit=
"cover"
/>
<div
class=
"photo-wall"
style=
"display: flex"
v-if=
"fileList.length > 0"
v-for=
"(item, index) in fileList"
>
</el-carousel-item>
<el-image
</el-carousel>
@
click=
"handlePreview(item)"
:key=
"index"
:src=
"item.url"
:teleported=
"true"
style=
"width: 150px; height: 150px;margin-top: 5%"
fit=
"cover"
/>
<el-button
type=
"danger"
icon=
"el-icon-delete"
circle
style=
"height: 40px;margin-left: 5%;margin-top: 10%"
></el-button>
</div>
</div>
</el-form-item>
</el-form-item>
</el-row>
</el-row>
...
@@ -192,16 +221,29 @@
...
@@ -192,16 +221,29 @@
</el-row>
</el-row>
</el-form>
</el-form>
</div>
</div>
<div
style=
"margin-top: 20px;"
>
<el-button
style=
"width: 120px;margin-left: 5%"
:class=
"commonField.queryClass"
:type=
"commonField.typePrimary"
:icon=
"commonField.addIcon"
:size=
"commonField.smallSize"
@
click=
"handleQuery"
>
打印标签
</el-button>
</div>
<el-dialog
:visible
.
sync=
"dialogVisible"
:close-on-click-modal=
"true"
>
<el-dialog
:visible
.
sync=
"dialogVisible"
:close-on-click-modal=
"true"
>
<img
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
>
<img
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
>
</el-dialog>
</el-dialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
commonField
from
"@/utils/commonField"
;
import
commonField
from
"@/utils/commonField"
import
{
getInsStrumentInfo
}
from
"@/api/query/query"
;
import
{
getToken
}
from
'@/utils/auth'
import
{
getDict
}
from
"@/api/system/dict/data"
;
import
{
getInsStrumentInfo
}
from
"@/api/query/query"
import
deviceField
from
"@/utils/device/deviceField"
;
import
{
getDict
}
from
"@/api/system/dict/data"
import
deviceField
from
"@/utils/device/deviceField"
import
{
openCameraAll
,
openCameraStorage
}
from
'@/utils/WebViewContact'
export
default
{
export
default
{
name
:
"index"
,
name
:
"index"
,
...
@@ -270,6 +312,28 @@ export default {
...
@@ -270,6 +312,28 @@ export default {
this
.
getInsType
()
// 获取类型字典
this
.
getInsType
()
// 获取类型字典
},
},
methods
:
{
methods
:
{
/** 全部实现功能(带相机,相册,文件资源功能)*/
handlePpenCameraAll1
()
{
const
params
=
{
subPath
:
'shiwu'
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
openCameraAll
(
params
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
console
.
info
(
imgUrlForm
)
this
.
fileList
.
push
(
imgUrlForm
)
})
},
handlePpenCameraAll2
()
{
const
params
=
{
subPath
:
'mp'
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
openCameraAll
(
params
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
this
.
fileFakeList
.
push
(
imgUrlForm
)
})
},
handlePreview
(
file
)
{
handlePreview
(
file
)
{
this
.
dialogImageUrl
=
file
.
url
this
.
dialogImageUrl
=
file
.
url
this
.
dialogVisible
=
true
this
.
dialogVisible
=
true
...
@@ -278,7 +342,7 @@ export default {
...
@@ -278,7 +342,7 @@ export default {
if
(
this
.
queryParams
.
businessId
===
''
)
{
if
(
this
.
queryParams
.
businessId
===
''
)
{
return
return
}
}
getInsStrumentInfo
(
this
.
queryParams
.
businessId
).
then
(
response
=>
{
getInsStrumentInfo
(
{
code
:
this
.
queryParams
.
businessId
}
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
form
=
response
.
data
this
.
fileList
=
response
.
data
.
filelist
.
filter
(
fileItem
=>
{
this
.
fileList
=
response
.
data
.
filelist
.
filter
(
fileItem
=>
{
return
fileItem
.
insFileType
===
'2'
return
fileItem
.
insFileType
===
'2'
...
@@ -292,6 +356,15 @@ export default {
...
@@ -292,6 +356,15 @@ export default {
this
.
fileFakeList
.
forEach
(
fileItem
=>
{
this
.
fileFakeList
.
forEach
(
fileItem
=>
{
fileItem
.
instrumentId
=
this
.
form
.
businessId
fileItem
.
instrumentId
=
this
.
form
.
businessId
})
})
// 临时调试
/*this.fileFakeList.forEach(fileItem => {
fileItem.url = 'https://gips0.baidu.com/it/u=2539703269,1031275508&fm=3042&app=3042&f=JPEG&wm=1,huayi,0,0,13,9&wmo=0,0&w=1280&h=960'
})
this.fileList.forEach(fileItem => {
fileItem.url = 'https://gips0.baidu.com/it/u=2539703269,1031275508&fm=3042&app=3042&f=JPEG&wm=1,huayi,0,0,13,9&wmo=0,0&w=1280&h=960'
})*/
})
})
},
},
/** 查询按钮操作 */
/** 查询按钮操作 */
...
...
src/views/setup/index.vue
View file @
e2c592e2
...
@@ -74,7 +74,6 @@ export default {
...
@@ -74,7 +74,6 @@ export default {
tokenMsg
:
getToken
()
tokenMsg
:
getToken
()
}
}
this
.
$WebView
.
openCameraStorage
(
params
).
then
(
res
=>
{
this
.
$WebView
.
openCameraStorage
(
params
).
then
(
res
=>
{
console
.
log
(
'拍照2'
,
res
)
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
})
},
},
...
...
src/views/setup/uhfIndex.vue
0 → 100644
View file @
e2c592e2
<
template
>
<!-- uhf扫码枪按钮操控 -->
<div
class=
"setup_module"
>
<div
class=
"button_row"
style=
"display: flex;"
>
<el-button
class=
"button_rowBtn"
type=
"primary"
@
click=
"handleStartPower"
>
开始识别
</el-button>
<el-button
class=
"button_rowBtn"
type=
"primary"
@
click=
"handleStopPower"
>
停止识别
</el-button>
</div>
<div
class=
"button_row"
style=
"display: flex;"
>
<el-button
class=
"button_rowBtn"
type=
"primary"
@
click=
"handleClearPower"
>
清空数据
</el-button>
<el-button
class=
"button_rowBtn"
type=
"primary"
@
click=
"handleSetPower"
>
设置功率
</el-button>
</div>
<div
class=
"button_row"
style=
"display: flex;"
>
<el-button
class=
"button_rowBtn"
type=
"primary"
@
click=
"handleSelect"
>
设置筛选
</el-button>
</div>
<!--
<div
class=
"button_row"
>
-->
<!--
<el-button
class=
"button_rowBtn"
type=
"primary"
@
click=
"handleAddVolume"
>
音量+
</el-button>
-->
<!--
</div>
-->
<!--
<div
class=
"button_row"
>
-->
<!--
<el-button
class=
"button_rowBtn"
type=
"primary"
@
click=
"handleReduceVolume"
>
音量-
</el-button>
-->
<!--
</div>
-->
<!--展示页-->
<div
class=
""
style=
"margin-bottom: 10px;font-size: 60px"
>
{{
resultInfo
.
length
}}
条
</div>
<el-table
:data=
"tableList"
style=
"width: 100%"
>
<el-table-column
prop=
"typeId"
label=
"ID"
min-width=
"220"
/>
<el-table-column
prop=
"rssi"
label=
"RSSI"
min-width=
"60"
/>
<el-table-column
label=
"操作"
min-width=
"100"
>
<template
slot-scope=
"scope"
>
<el-button
@
click=
"handleFilter(scope.row)"
>
筛选
</el-button>
</
template
>
</el-table-column>
</el-table>
<el-pagination
style=
"width: 100%"
:page-size
.
sync=
"pageInfo.pageSize"
:total=
"resultInfo.length"
:pager-count=
"5"
hide-on-single-page
layout=
"prev,next"
:current-page
.
sync=
"pageInfo.pageNum"
/>
<!-- <div v-for="(item, index) in resultInfo" :key="index">-->
<!-- <div class="">{{ item.typeId }}</div>-->
<!-- <div class="">{{ item.rssi }}</div>-->
<!-- </div>-->
<!-- 对话框 -->
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
class=
"dialog-form"
>
<el-dialog
:visible
.
sync=
"dialogVisible"
title=
"功率设置"
width=
"30%"
:before-close=
"handleClose"
>
<el-form-item
prop=
"inputValue"
>
<!-- 数量限制1-30-->
<el-input
v-model=
"form.inputValue"
placeholder=
"请输入功率值"
clearable
oninput=
"value=value.replace(/[^0-9.]/g,'')"
style=
"margin-bottom: 20px;"
type=
"number"
:min=
"1"
:max=
"30"
:step=
"1"
@
input=
"validateInput"
@
change=
"watchInput"
@
clear=
"clearInput"
/>
</el-form-item>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmInput"
>
确认
</el-button>
</span>
</el-dialog>
</el-form>
<!-- 设置筛选弹出框 -->
<el-dialog
:visible
.
sync=
"dialogVisibleSelect"
title=
"筛选设置"
width=
"30%"
:before-close=
"handleCloseSelect"
>
<el-input
v-model=
"selectValue"
placeholder=
"-"
clearable
style=
"margin-bottom: 20px;"
disabled
/>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisibleSelect = false"
>
取消
</el-button>
<el-button
@
click=
"clearSelect"
>
清除
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
{
getToken
}
from
'@/utils/auth'
export
default
{
name
:
'Index'
,
data
()
{
return
{
// 假数据
selectValue
:
''
,
selectValueList
:
[],
dialogVisible
:
false
,
// 控制对话框显示与隐藏
dialogVisibleSelect
:
false
,
// 控制设置筛选对话框显示与隐藏
startState
:
false
,
// 是否正在开启开始识别
form
:
{
inputValue
:
''
},
rules
:
{
inputValue
:
[
{
required
:
true
,
message
:
'功率值不能为空!'
,
trigger
:
'blur'
}
]
},
// 设置特定音量
volumeSValue
:
0
,
resultInfo
:
[],
pageInfo
:
{
pageNum
:
1
,
pageSize
:
50
}
}
},
computed
:
{
tableList
()
{
const
start
=
(
this
.
pageInfo
.
pageNum
-
1
)
*
this
.
pageInfo
.
pageSize
const
end
=
start
+
this
.
pageInfo
.
pageSize
return
this
.
resultInfo
.
slice
(
start
,
end
)
}
},
created
()
{
this
.
startState
=
false
// 组件创建时,也可以从缓存中读取值
const
storedValue
=
localStorage
.
getItem
(
'inputValue'
)
if
(
storedValue
!==
null
)
{
this
.
form
.
inputValue
=
storedValue
}
else
{
this
.
form
.
inputValue
=
30
}
// 扫描结果
this
.
$WebView
.
DS_BRIDGE
.
register
(
'resultInfo'
,
args
=>
{
console
.
log
(
'扫出来的结果啊:'
,
args
)
this
.
resultInfo
=
JSON
.
parse
(
args
)
})
},
methods
:
{
// 清除筛选值
clearSelect
()
{
this
.
dialogVisibleSelect
=
false
this
.
selectValue
=
''
this
.
selectValueList
=
[]
},
// 点击当条筛选值
handleFilter
(
row
)
{
console
.
log
(
'当前行的typeId值:'
,
row
.
typeId
)
// 检查元素是否已经存在于数组中
if
(
!
this
.
selectValueList
.
includes
(
row
.
typeId
))
{
// 如果不存在,则添加到数组中
this
.
selectValueList
.
push
(
row
.
typeId
)
// 给筛选设置设置默认值,将数组中的元素用逗号拼接
this
.
selectValue
=
this
.
selectValueList
.
join
(
','
)
console
.
log
(
'打印selectValueList值:'
,
this
.
selectValueList
)
console
.
log
(
'打印selectValue值:'
,
this
.
selectValue
)
}
else
{
// 如果已存在,可以在这里添加一些逻辑,比如打印一条消息或者什么都不做
console
.
log
(
'该typeId值已存在,不再添加。'
)
console
.
log
(
'打印selectValueList值:'
,
this
.
selectValueList
)
console
.
log
(
'打印selectValue值:'
,
this
.
selectValue
)
}
},
// 设置筛选弹窗
handleSelect
()
{
console
.
log
(
'打开了设置筛选'
,
''
)
console
.
log
(
'selectValue的值啊啊啊'
,
this
.
selectValue
)
this
.
dialogVisibleSelect
=
true
// 显示对话框
},
// 输入效率值校验
validateInput
(
value
)
{
if
(
value
===
''
||
value
===
null
)
{
this
.
form
.
inputValue
=
''
// 允许清空输入
}
else
if
(
!
Number
.
isInteger
(
+
value
)
||
value
<
1
||
value
>
30
)
{
this
.
form
.
inputValue
=
1
// 如果输入不合法或包含小数,重置为1或其他默认值
}
else
{
this
.
form
.
inputValue
=
value
// 合法输入,更新formData
}
},
watchInput
(
event
)
{
const
value
=
event
.
target
.
value
const
numberValue
=
+
value
// 尝试将输入转换为数字
if
(
!
Number
.
isInteger
(
numberValue
)
||
numberValue
<
1
||
numberValue
>
9
)
{
// 如果输入包含小数或不在这个范围内,重置输入框
event
.
target
.
value
=
this
.
form
.
inputValue
}
},
/** 开始识别按钮*/
handleStartPower
()
{
this
.
startState
=
true
const
params
=
{
flag
:
'startPower'
,
selectValue
:
this
.
selectValueList
,
tokenMsg
:
getToken
()
}
// 补充逻辑:如果设置筛选有值就调筛选逻辑,传id过去,筛选没值就不传id过去
this
.
$WebView
.
startPower
(
params
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
},
/** 清空数据按钮*/
handleClearPower
()
{
const
params
=
{
flag
:
'clearPower'
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
clearPower
(
params
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
},
/** 停止识别按钮*/
handleStopPower
()
{
this
.
startState
=
false
console
.
log
(
'调用前'
,
getToken
())
const
params
=
{
flag
:
'stopPower'
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
stopPower
(
params
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
},
// clear按钮
clearInput
()
{
this
.
form
.
inputValue
=
''
// 清除输入框内容
this
.
$nextTick
(()
=>
{
// 手动触发表单验证,但忽略错误提示
this
.
$refs
.
formRef
.
validateField
(
'inputValue'
,
valid
=>
{
// 这里不进行任何操作,只是为了避免自动验证
})
})
},
// clear筛选按钮
clearSelectInput
()
{
this
.
selectValue
=
''
// 清除输入框内容
},
/** 确认按钮*/
confirmInput
()
{
this
.
$refs
.
formRef
.
validate
((
valid
)
=>
{
if
(
valid
)
{
// 表单验证通过
this
.
dialogVisible
=
false
// 存储值到localStorage
localStorage
.
setItem
(
'inputValue'
,
this
.
form
.
inputValue
)
// 未开启
const
paramsNone
=
{
flag
:
'setPowerNone'
,
// 设置的功率值
msg
:
this
.
form
.
inputValue
,
tokenMsg
:
getToken
()
}
// 开启中
const
paramsScand
=
{
flag
:
'setPowerScand'
,
// 设置的功率值
msg
:
this
.
form
.
inputValue
,
tokenMsg
:
getToken
()
}
if
(
this
.
startState
)
{
this
.
$WebView
.
setPower
(
paramsScand
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
}
else
{
// 没开
this
.
$WebView
.
setPower
(
paramsNone
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
}
}
else
{
// 表单验证失败
console
.
error
(
'功率值不能为空!'
)
return
false
}
})
},
/** 关闭弹窗*/
handleClose
()
{
console
.
log
(
'对话框被关闭'
)
this
.
dialogVisible
=
false
// 关闭对话框
},
/** 关闭筛选设置弹窗*/
handleCloseSelect
()
{
console
.
log
(
'筛选设置对话框被关闭'
)
this
.
dialogVisibleSelect
=
false
// 关闭对话框
},
/** 设置功率按钮*/
handleSetPower
()
{
this
.
dialogVisible
=
true
// 显示对话框
// 从localStorage中读取值
const
storedValue
=
localStorage
.
getItem
(
'inputValue'
)
if
(
storedValue
!==
null
)
{
this
.
form
.
inputValue
=
storedValue
}
this
.
dialogVisible
=
true
// 显示对话框
},
/** 增加音量按钮*/
handleAddVolume
()
{
console
.
log
(
'调用前'
,
getToken
())
const
params
=
{
flag
:
'addVolume'
,
// 设置的系统音量值,传0,1,2,3,4五个档位
volumeValue
:
this
.
volumeSValue
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
addVolume
(
params
).
then
(
res
=>
{
console
.
log
(
'addVolume'
,
res
)
console
.
log
(
'addVolume'
,
JSON
.
parse
(
res
))
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
},
/** 减小音量按钮*/
handleReduceVolume
()
{
console
.
log
(
'调用前'
,
getToken
())
const
params
=
{
flag
:
'reduceVolume'
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
reduceVolume
(
params
).
then
(
res
=>
{
console
.
log
(
'reduceVolume'
,
res
)
console
.
log
(
'reduceVolume'
,
JSON
.
parse
(
res
))
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.setup_module
{
padding
:
0px
20px
20px
20px
;
.button_row
{
margin
:
0px
20px
20px
20px
;
.button_rowBtn
{
font-size
:
17px
;
width
:
160px
;
}
.button_rowText
{
margin-top
:
10px
;
}
}
}
</
style
>
src/views/track/index.vue
View file @
e2c592e2
<
template
>
<
template
>
<div
@
keyup
.
enter=
"handleQuery"
style=
"display: flex; flex-direction: column; height: 78vh;"
>
<div
@
keyup
.
enter=
"handleQuery"
style=
"display: flex; flex-direction: column; height: 78vh;"
>
<el-form
ref=
"queryForm"
:model=
"queryParams"
:inline=
"true"
<el-form
ref=
"queryForm"
:model=
"queryParams"
:inline=
"true"
@
submit
.
native
.
prevent
style=
"border-bottom: 1px solid #dcdcdc;"
>
style=
"border-bottom: 1px solid #dcdcdc;"
>
<el-form-item
label=
"
编号
"
prop=
"insCode"
style=
"padding-left: 10px"
>
<el-form-item
label=
""
prop=
"insCode"
style=
"padding-left: 10px"
>
<el-input
<el-input
v-model=
"queryParams.businessId"
v-model=
"queryParams.businessId"
placeholder=
"请输入编号"
placeholder=
"请输入编号"
...
@@ -10,10 +11,10 @@
...
@@ -10,10 +11,10 @@
autofocus
autofocus
:maxlength=
"30"
:maxlength=
"30"
size=
"small"
size=
"small"
style=
"width: 1
2
0px;"
style=
"width: 1
4
0px;"
/>
/>
<el-button
<el-button
style=
"width: 7
5
px;margin-left: 0"
style=
"width: 7
0
px;margin-left: 0"
:class=
"commonField.queryClass"
:class=
"commonField.queryClass"
:type=
"commonField.typePrimary"
:type=
"commonField.typePrimary"
:icon=
"commonField.queryIcon"
:icon=
"commonField.queryIcon"
...
@@ -22,7 +23,7 @@
...
@@ -22,7 +23,7 @@
>
查询
>
查询
</el-button>
</el-button>
<el-button
<el-button
style=
"width: 7
5
px;margin-left: 0"
style=
"width: 7
0
px;margin-left: 0"
:class=
"commonField.resetClass"
:class=
"commonField.resetClass"
:icon=
"commonField.resetIcon"
:icon=
"commonField.resetIcon"
:size=
"commonField.smallSize"
:size=
"commonField.smallSize"
...
@@ -104,37 +105,31 @@
...
@@ -104,37 +105,31 @@
</el-row>
</el-row>
<el-row
:span=
"24"
>
<el-row
:span=
"24"
>
<el-form-item
label=
"实物:"
prop=
"insImplementation"
>
<el-form-item
label=
"实物:"
prop=
"insImplementation"
>
<div
class=
"photo-wall"
v-if=
"fileFakeList.length > 0"
>
<div
class=
"photo-wall"
style=
"display: flex"
v-if=
"fileFakeList.length > 0"
v-for=
"(item, index) in fileFakeList"
>
<el-carousel
height=
"150px"
style=
"width: 150px;"
indicator-position=
"none"
>
<el-image
<el-carousel-item
v-for=
"(item, index) in fileFakeList"
>
@
click=
"handlePreview(item)"
<el-image
:key=
"index"
@
click=
"handlePreview(item)"
:src=
"item.url"
:key=
"index"
:teleported=
"true"
:src=
"item.url"
style=
"width: 150px; height: 150px;margin-top: 5%"
:teleported=
"true"
fit=
"cover"
style=
"width: 150px; height: 150px;"
/>
fit=
"cover"
<el-button
type=
"danger"
icon=
"el-icon-delete"
circle
style=
"height: 40px;margin-left: 5%;margin-top: 10%"
></el-button>
/>
</el-carousel-item>
</el-carousel>
</div>
</div>
</el-form-item>
</el-form-item>
</el-row>
</el-row>
<el-row
:span=
"24"
>
<el-row
:span=
"24"
>
<el-form-item
label=
"参照物:"
prop=
"file"
>
<el-form-item
label=
"铭牌:"
prop=
"file"
>
<div
class=
"photo-wall"
v-if=
"fileList.length > 0"
>
<div
class=
"photo-wall"
style=
"display: flex"
v-if=
"fileList.length > 0"
v-for=
"(item, index) in fileList"
>
<el-carousel
height=
"150px"
style=
"width: 150px;"
indicator-position=
"none"
>
<el-image
<el-carousel-item
v-for=
"(item, index) in fileList"
>
@
click=
"handlePreview(item)"
<el-image
:key=
"index"
@
click=
"handlePreview(item)"
:src=
"item.url"
:key=
"index"
:teleported=
"true"
:src=
"item.url"
style=
"width: 150px; height: 150px;margin-top: 5%"
z-index=
"2000"
fit=
"cover"
style=
"width: 150px; height: 150px;"
/>
fit=
"cover"
<el-button
type=
"danger"
icon=
"el-icon-delete"
circle
style=
"height: 40px;margin-left: 5%;margin-top: 10%"
></el-button>
/>
</el-carousel-item>
</el-carousel>
</div>
</div>
</el-form-item>
</el-form-item>
</el-row>
</el-row>
...
@@ -192,16 +187,74 @@
...
@@ -192,16 +187,74 @@
</el-row>
</el-row>
</el-form>
</el-form>
</div>
</div>
<div
style=
"margin-top: 20px;"
>
<el-row
:gutter=
"24"
type=
"flex"
justify=
"center"
>
<el-col
:span=
"4"
>
<el-button
class=
"submitBtn"
type=
"primary"
@
click=
"locat"
>
<span>
仪器定位
</span>
</el-button>
</el-col>
<el-col
:span=
"2"
>
</el-col>
<el-col
:span=
"4"
>
<el-button
class=
"submitBtn"
type=
"primary"
@
click=
"cancel"
>
<span>
取消定位
</span>
</el-button>
</el-col>
<el-col
:span=
"2"
>
</el-col>
<el-col
:span=
"4"
>
<el-button
class=
"submitBtn"
type=
"primary"
@
click=
"googlv"
>
<span>
设置功率
</span>
</el-button>
</el-col>
</el-row>
</div>
<el-dialog
:visible
.
sync=
"dialogVisible"
:close-on-click-modal=
"true"
>
<el-dialog
:visible
.
sync=
"dialogVisible"
:close-on-click-modal=
"true"
>
<img
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
>
<img
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
>
</el-dialog>
</el-dialog>
<!-- 对话框 -->
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
class=
"dialog-form"
>
<el-dialog
:visible
.
sync=
"dialogVisibleGL"
title=
"功率设置"
width=
"30%"
:before-close=
"handleClose"
>
<el-form-item
prop=
"inputValue"
>
<!-- 数量限制1-30-->
<el-input
v-model=
"form.inputValue"
placeholder=
"请输入功率值"
clearable
oninput=
"value=value.replace(/[^0-9.]/g,'')"
style=
"margin-bottom: 20px;"
type=
"number"
:min=
"1"
:max=
"30"
:step=
"1"
@
input=
"validateInput"
@
change=
"watchInput"
@
clear=
"clearInput"
/>
</el-form-item>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisibleGL = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmInput"
>
确认
</el-button>
</span>
</el-dialog>
</el-form>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
commonField
from
"@/utils/commonField"
;
import
commonField
from
"@/utils/commonField"
import
{
getInsStrumentInfo
}
from
"@/api/query/query"
;
import
{
getToken
}
from
'@/utils/auth'
import
{
getDict
}
from
"@/api/system/dict/data"
;
import
{
getInsStrumentInfo
}
from
"@/api/query/query"
import
deviceField
from
"@/utils/device/deviceField"
;
import
{
getDict
}
from
"@/api/system/dict/data"
import
deviceField
from
"@/utils/device/deviceField"
import
{
openCameraAll
,
openCameraStorage
}
from
'@/utils/WebViewContact'
export
default
{
export
default
{
name
:
"index"
,
name
:
"index"
,
...
@@ -221,8 +274,10 @@ export default {
...
@@ -221,8 +274,10 @@ export default {
queryParams
:
{
queryParams
:
{
businessId
:
''
,
businessId
:
''
,
},
},
dialogVisibleGL
:
false
,
// 控制对话框显示与隐藏
// 表单参数
// 表单参数
form
:
{
form
:
{
inputValue
:
''
,
businessId
:
''
,
businessId
:
''
,
insCode
:
''
,
insCode
:
''
,
insType
:
''
,
insType
:
''
,
...
@@ -250,11 +305,18 @@ export default {
...
@@ -250,11 +305,18 @@ export default {
insSureRemark
:
''
,
insSureRemark
:
''
,
insManage
:
''
,
insManage
:
''
,
insDeptId
:
''
,
insDeptId
:
''
,
insRfid
:
''
,
deptName
:
''
,
deptName
:
''
,
createDate
:
''
,
createDate
:
''
,
createUsername
:
''
,
createUsername
:
''
,
flag
:
'1'
flag
:
'1'
}
},
startState
:
false
,
// 是否正在开启开始识别
rules
:
{
inputValue
:
[
{
required
:
true
,
message
:
'功率值不能为空!'
,
trigger
:
'blur'
}
]
},
}
}
},
},
computed
:
{
computed
:
{
...
@@ -268,8 +330,84 @@ export default {
...
@@ -268,8 +330,84 @@ export default {
created
()
{
created
()
{
this
.
getInsManageList
()
this
.
getInsManageList
()
this
.
getInsType
()
// 获取类型字典
this
.
getInsType
()
// 获取类型字典
this
.
$WebView
.
DS_BRIDGE
.
register
(
'resultInfo'
,
args
=>
{
// 根据resultInfo的key拿到Android实时推送的数据解析后赋值回显
// [{rssi: '-75.60', typeId: 'Exxxxxxx' }]
let
resList
=
JSON
.
parse
(
args
)
})
},
},
methods
:
{
methods
:
{
// 输入效率值校验
validateInput
(
value
)
{
if
(
value
===
''
||
value
===
null
)
{
this
.
form
.
inputValue
=
''
// 允许清空输入
}
else
if
(
!
Number
.
isInteger
(
+
value
)
||
value
<
1
||
value
>
30
)
{
this
.
form
.
inputValue
=
1
// 如果输入不合法或包含小数,重置为1或其他默认值
}
else
{
this
.
form
.
inputValue
=
value
// 合法输入,更新formData
}
},
watchInput
(
event
)
{
const
value
=
event
.
target
.
value
const
numberValue
=
+
value
// 尝试将输入转换为数字
if
(
!
Number
.
isInteger
(
numberValue
)
||
numberValue
<
1
||
numberValue
>
9
)
{
// 如果输入包含小数或不在这个范围内,重置输入框
event
.
target
.
value
=
this
.
form
.
inputValue
}
},
// clear按钮
clearInput
()
{
this
.
form
.
inputValue
=
''
// 清除输入框内容
this
.
$nextTick
(()
=>
{
// 手动触发表单验证,但忽略错误提示
this
.
$refs
.
formRef
.
validateField
(
'inputValue'
,
valid
=>
{
// 这里不进行任何操作,只是为了避免自动验证
})
})
},
/** 确认按钮*/
confirmInput
()
{
this
.
$refs
.
formRef
.
validate
((
valid
)
=>
{
if
(
valid
)
{
// 表单验证通过
this
.
dialogVisibleGL
=
false
// 存储值到localStorage
localStorage
.
setItem
(
'inputValue'
,
this
.
form
.
inputValue
)
// 未开启
const
paramsNone
=
{
flag
:
'setPowerNone'
,
// 设置的功率值
msg
:
this
.
form
.
inputValue
,
tokenMsg
:
getToken
()
}
// 开启中
const
paramsScand
=
{
flag
:
'setPowerScand'
,
// 设置的功率值
msg
:
this
.
form
.
inputValue
,
tokenMsg
:
getToken
()
}
if
(
this
.
startState
)
{
this
.
$WebView
.
setPower
(
paramsScand
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
}
else
{
// 没开
this
.
$WebView
.
setPower
(
paramsNone
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
}
}
else
{
// 表单验证失败
console
.
error
(
'功率值不能为空!'
)
return
false
}
})
},
/** 关闭弹窗*/
handleClose
()
{
this
.
dialogVisibleGL
=
false
// 关闭对话框
},
handlePreview
(
file
)
{
handlePreview
(
file
)
{
this
.
dialogImageUrl
=
file
.
url
this
.
dialogImageUrl
=
file
.
url
this
.
dialogVisible
=
true
this
.
dialogVisible
=
true
...
@@ -278,7 +416,7 @@ export default {
...
@@ -278,7 +416,7 @@ export default {
if
(
this
.
queryParams
.
businessId
===
''
)
{
if
(
this
.
queryParams
.
businessId
===
''
)
{
return
return
}
}
getInsStrumentInfo
(
this
.
queryParams
.
businessId
).
then
(
response
=>
{
getInsStrumentInfo
(
{
code
:
this
.
queryParams
.
businessId
}
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
form
=
response
.
data
this
.
fileList
=
response
.
data
.
filelist
.
filter
(
fileItem
=>
{
this
.
fileList
=
response
.
data
.
filelist
.
filter
(
fileItem
=>
{
return
fileItem
.
insFileType
===
'2'
return
fileItem
.
insFileType
===
'2'
...
@@ -292,6 +430,15 @@ export default {
...
@@ -292,6 +430,15 @@ export default {
this
.
fileFakeList
.
forEach
(
fileItem
=>
{
this
.
fileFakeList
.
forEach
(
fileItem
=>
{
fileItem
.
instrumentId
=
this
.
form
.
businessId
fileItem
.
instrumentId
=
this
.
form
.
businessId
})
})
// 临时调试
/*this.fileFakeList.forEach(fileItem => {
fileItem.url = 'https://gips0.baidu.com/it/u=2539703269,1031275508&fm=3042&app=3042&f=JPEG&wm=1,huayi,0,0,13,9&wmo=0,0&w=1280&h=960'
})
this.fileList.forEach(fileItem => {
fileItem.url = 'https://gips0.baidu.com/it/u=2539703269,1031275508&fm=3042&app=3042&f=JPEG&wm=1,huayi,0,0,13,9&wmo=0,0&w=1280&h=960'
})*/
})
})
},
},
/** 查询按钮操作 */
/** 查询按钮操作 */
...
@@ -321,6 +468,54 @@ export default {
...
@@ -321,6 +468,54 @@ export default {
this
.
insTypeList
=
result
.
data
this
.
insTypeList
=
result
.
data
})
})
},
},
locat
()
{
if
(
!
this
.
form
.
insRfid
)
{
this
.
$message
({
message
:
"设备无RFID!"
,
type
:
'error'
})
return
;
}
let
selectList
=
[
this
.
form
.
insRfid
]
this
.
startState
=
true
const
params
=
{
flag
:
'startPower'
,
selectValue
:
selectList
,
tokenMsg
:
getToken
()
}
// 补充逻辑:如果设置筛选有值就调筛选逻辑,传id过去,筛选没值就不传id过去
this
.
$WebView
.
startPower
(
params
).
then
(
res
=>
{
})
},
/** 清空数据按钮*/
handleClearPower
()
{
const
params
=
{
flag
:
'clearPower'
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
clearPower
(
params
).
then
(
res
=>
{
})
},
/** 停止识别按钮*/
handleStopPower
()
{
this
.
startState
=
false
const
params
=
{
flag
:
'stopPower'
,
tokenMsg
:
getToken
()
}
this
.
$WebView
.
stopPower
(
params
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
},
cancel
()
{
this
.
handleClearPower
()
this
.
handleStopPower
()
},
googlv
()
{
// 从localStorage中读取值
const
storedValue
=
localStorage
.
getItem
(
'inputValue'
)
if
(
storedValue
!==
null
)
{
this
.
form
.
inputValue
=
storedValue
}
this
.
dialogVisibleGL
=
true
// 显示对话框
}
}
}
}
}
...
...
vue.config.js
View file @
e2c592e2
...
@@ -91,8 +91,8 @@ module.exports = {
...
@@ -91,8 +91,8 @@ module.exports = {
// target: `http://192.168.1.12:8082/`, // 孙浩
// target: `http://192.168.1.12:8082/`, // 孙浩
// target: `http://192.168.1.41:8082/`,
// target: `http://192.168.1.41:8082/`,
// target: `http://49.232.167.247:20014/`, // 线上
// target: `http://49.232.167.247:20014/`, // 线上
// target: `http://192.168.1.30:8082
/`,
target
:
`http://106.3.99.36:20101
/`
,
target
:
`http://192.168.0.3:8092/`
,
//
target: `http://192.168.0.3:8092/`,
// target: `http://localhost:8092/`,
// target: `http://localhost:8092/`,
// target: `http://49.232.167.247:20014/`,
// target: `http://49.232.167.247:20014/`,
// changeOrigin: true,
// changeOrigin: 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