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
ea4689b0
Commit
ea4689b0
authored
Nov 12, 2024
by
小费同学阿
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问题一:图片上传修复
parent
92c63847
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
34 deletions
+59
-34
WebViewContact.js
src/utils/WebViewContact.js
+10
-0
detail.vue
src/views/inventory/detail.vue
+36
-33
index.vue
src/views/query/index.vue
+13
-1
No files found.
src/utils/WebViewContact.js
View file @
ea4689b0
...
...
@@ -40,6 +40,15 @@ export const clearPower = (params) => {
})
})
}
// 播放音乐
// 分别传1,2,3播放三种不同的音乐
export
const
startMusic
=
(
params
)
=>
{
return
new
Promise
(
resolve
=>
{
DS_BRIDGE
.
call
(
'startMusic'
,
params
,
res
=>
{
resolve
(
res
)
})
})
}
// 设置声音
// 分5档, 0-5
// 传过去的对象里面volumeValue设置系统音量值
...
...
@@ -89,6 +98,7 @@ export const WebView = {
stopPower
,
clearPower
,
setPower
,
startMusic
,
addVolume
,
reduceVolume
,
openCameraStorage
,
...
...
src/views/inventory/detail.vue
View file @
ea4689b0
...
...
@@ -3,12 +3,12 @@
<div>
<el-row
:gutter=
"20"
type=
"flex"
justify=
"center"
>
<el-col
:span=
"12"
>
<el-button
class=
"submitBtn"
type=
"primary"
:loading=
"!ready"
@
click=
"handleStartPower"
>
<el-button
class=
"submitBtn"
type=
"primary"
:loading=
"!ready"
@
click=
"handleStartPower"
>
<span>
开始盘点
</span>
</el-button>
</el-col>
<el-col
:span=
"6"
>
<el-button
class=
"submitBtn"
type=
"primary"
@
click=
"handleStopPower"
>
<el-button
class=
"submitBtn"
type=
"primary"
@
click=
"handleStopPower"
>
<span>
结束盘点
</span>
</el-button>
</el-col>
...
...
@@ -17,7 +17,7 @@
<div
class=
"padding"
>
<el-row
style=
"margin-top: 20px;"
>
<el-col
:span=
"24"
style=
"text-align: center"
>
<span
style=
"margin-right: 10px"
:class=
"statusClass"
>
{{
this
.
statusText
}}
</span>
<span
style=
"margin-right: 10px"
:class=
"statusClass"
>
{{
this
.
statusText
}}
</span>
</el-col>
</el-row>
<el-row
style=
"margin-top: 20px;"
>
...
...
@@ -51,7 +51,7 @@
@
close=
"infoWinCancel"
>
<el-table
:row-style=
"rowStyle"
border
:data=
"detailList"
max-height=
"450"
>
<el-table-column
type=
"index"
label=
"序号"
fixed=
"left"
width=
"50"
align=
"center"
/>
<el-table-column
type=
"index"
label=
"序号"
fixed=
"left"
width=
"50"
align=
"center"
/>
<el-table-column
label=
"管理编号"
width=
"120"
prop=
"insCode"
:show-overflow-tooltip=
"true"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
insCode
||
'-'
}}
...
...
@@ -76,11 +76,11 @@
</template>
<
script
>
import
{
getInventoryPdDetail
,
getALl
,
pdSubmit
}
from
'@/api/instrument/instrument'
import
{
getInventoryPdDetail
,
getALl
,
pdSubmit
}
from
'@/api/instrument/instrument'
import
commonField
from
'@/utils/commonField'
import
deviceField
from
'@/utils/device/deviceField'
import
{
getToken
}
from
'@/utils/auth'
import
{
playAudio
,
successAudio
}
from
'@/utils/common'
import
{
getToken
}
from
'@/utils/auth'
import
{
playAudio
,
successAudio
}
from
'@/utils/common'
export
default
{
name
:
'Instrument'
,
...
...
@@ -127,10 +127,10 @@ export default {
dialogVisible
:
false
,
// 所有集合
allList
:
[],
completedCount
:
0
,
count
:
0
,
completedCount
:
0
,
count
:
0
,
// 精简数组, {id, insRfid, status, sync } sync 1 已同步数据库 0 未同步
sampleList
:[],
sampleList
:
[],
timer
:
undefined
}
...
...
@@ -158,9 +158,9 @@ export default {
let
resList
=
JSON
.
parse
(
args
)
resList
.
forEach
(
x
=>
{
_that
.
sampleList
.
forEach
(
y
=>
{
if
(
x
.
typeId
==
y
.
insRfid
&&
y
.
status
!=
'1'
)
{
y
.
status
=
'1'
}
if
(
x
.
typeId
==
y
.
insRfid
&&
y
.
status
!=
'1'
)
{
y
.
status
=
'1'
}
})
})
_that
.
completedCount
=
sampleListCache
.
filter
(
x
=>
x
.
status
==
'1'
).
length
...
...
@@ -169,22 +169,22 @@ export default {
let
_that
=
this
let
ids
=
[]
this
.
sampleList
.
forEach
(
y
=>
{
if
(
y
.
status
==
'1'
&&
y
.
sync
==
'0'
)
{
if
(
y
.
status
==
'1'
&&
y
.
sync
==
'0'
)
{
ids
.
push
(
y
.
id
)
}
})
if
(
ids
.
length
==
0
)
{
if
(
ids
.
length
==
0
)
{
return
}
let
param
=
{
businessId
:
this
.
id
,
businessId
:
this
.
id
,
ids
:
ids
.
join
(
','
)
}
pdSubmit
(
param
).
then
(
response
=>
{
if
(
response
.
code
==
200
)
{
if
(
response
.
code
==
200
)
{
ids
.
forEach
(
x
=>
{
_that
.
sampleList
.
forEach
(
y
=>
{
if
(
y
.
status
==
'1'
&&
y
.
sync
==
'0'
&&
x
==
y
.
id
)
{
if
(
y
.
status
==
'1'
&&
y
.
sync
==
'0'
&&
x
==
y
.
id
)
{
y
.
sync
=
'1'
}
})
...
...
@@ -192,9 +192,9 @@ export default {
setTimeout
(()
=>
{
// successAudio(true)
},
500
);
// 2000毫秒 = 2秒
if
(
response
.
data
.
lastCount
===
0
)
{
if
(
response
.
data
.
lastCount
===
0
)
{
// successAudio(true)
this
.
$message
({
message
:
"盘点已完成!"
,
type
:
'success'
})
this
.
$message
({
message
:
"盘点已完成!"
,
type
:
'success'
})
this
.
statusClass
=
'status_e'
this
.
statusText
=
'盘点完成'
this
.
handleClearPower
()
...
...
@@ -202,9 +202,8 @@ export default {
this
.
handleStopPower
()
clearInterval
(
this
.
timer
)
}
}
else
{
this
.
$message
({
message
:
response
.
message
,
type
:
'error'
})
}
else
{
this
.
$message
({
message
:
response
.
message
,
type
:
'error'
})
// playAudio(true)
// 停止
this
.
handleClearPower
()
...
...
@@ -225,7 +224,7 @@ export default {
handleStartPower
()
{
let
selectList
=
[]
this
.
sampleList
.
forEach
(
x
=>
{
if
(
x
.
status
!=
'1'
)
{
if
(
x
.
status
!=
'1'
)
{
selectList
.
push
(
x
.
insRfid
)
}
})
...
...
@@ -234,6 +233,8 @@ export default {
flag
:
'startPower'
,
//selectValue: selectList,
selectValue
:
[],
// 是否播放提示音
alertVoice
:
true
,
tokenMsg
:
getToken
()
}
// 补充逻辑:如果设置筛选有值就调筛选逻辑,传id过去,筛选没值就不传id过去
...
...
@@ -269,31 +270,31 @@ export default {
this
.
getInventoryPdDetail
(
this
.
id
)
},
getInventoryPdDetail
(
id
)
{
getInventoryPdDetail
({
pdId
:
id
}).
then
(
response
=>
{
getInventoryPdDetail
({
pdId
:
id
}).
then
(
response
=>
{
this
.
detailList
=
response
.
rows
this
.
total
=
response
.
total
this
.
infoOpen
=
true
})
},
reloadAll
(
id
)
{
getALl
({
pdId
:
id
}).
then
(
response
=>
{
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
)
{
if
(
x
.
insRfid
)
{
this
.
sampleList
.
push
({
id
:
x
.
businessId
,
id
:
x
.
businessId
,
insRfid
:
x
.
insRfid
,
status
:
x
.
pdStatus
,
sync
:
x
.
pdStatus
==
'1'
?
1
:
0
sync
:
x
.
pdStatus
==
'1'
?
1
:
0
})
}
})
})
},
endInventory
(){
endInventory
()
{
this
.
$confirm
(
'确定结束盘点吗?'
,
'结束盘点'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
...
...
@@ -303,7 +304,7 @@ export default {
})
},
// 根据状态控制当前行的颜色
changeColor
({
row
,
rowIndex
})
{
changeColor
({
row
,
rowIndex
})
{
if
(
row
.
pdStatus
===
'1'
)
{
return
{
background
:
'orange'
...
...
@@ -311,8 +312,8 @@ export default {
}
},
// 结合有效期和悬停的样式
rowStyle
({
row
,
rowIndex
})
{
const
style
=
this
.
changeColor
({
row
,
rowIndex
})
rowStyle
({
row
,
rowIndex
})
{
const
style
=
this
.
changeColor
({
row
,
rowIndex
})
return
Object
.
assign
({},
style
)
}
}
...
...
@@ -346,6 +347,7 @@ export default {
width
:
30px
;
margin-left
:
3px
;
}
.padding
{
padding-left
:
50px
;
/* 设置左边的间距 */
padding-top
:
50px
;
...
...
@@ -354,6 +356,7 @@ export default {
.status_b
{
color
:
red
;
}
.status_e
{
color
:
green
;
}
...
...
src/views/query/index.vue
View file @
ea4689b0
...
...
@@ -243,7 +243,6 @@ import { getToken } from '@/utils/auth'
import
{
getInsStrumentInfo
}
from
"@/api/query/query"
import
{
getDict
}
from
"@/api/system/dict/data"
import
deviceField
from
"@/utils/device/deviceField"
import
{
openCameraAll
,
openCameraStorage
}
from
'@/utils/WebViewContact'
export
default
{
name
:
"index"
,
...
...
@@ -308,10 +307,23 @@ export default {
}
},
created
()
{
// 播放音乐
this
.
startMusic
(
'1'
)
this
.
getInsManageList
()
this
.
getInsType
()
// 获取类型字典
},
methods
:
{
/** 播放音乐*/
startMusic
(
type
){
console
.
log
(
'要播放的音乐类型为:'
,
type
)
const
params
=
{
subPath
:
'startMusic'
,
tokenMsg
:
getToken
(),
type
:
type
}
this
.
$WebView
.
startMusic
(
params
).
then
(
res
=>
{
})
},
/** 全部实现功能(带相机,相册,文件资源功能)*/
handlePpenCameraAll1
()
{
const
params
=
{
...
...
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