Commit ea4689b0 authored by 小费同学阿's avatar 小费同学阿 💬

问题一:图片上传修复

parent 92c63847
...@@ -40,6 +40,15 @@ export const clearPower = (params) => { ...@@ -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 // 分5档, 0-5
// 传过去的对象里面volumeValue设置系统音量值 // 传过去的对象里面volumeValue设置系统音量值
...@@ -89,6 +98,7 @@ export const WebView = { ...@@ -89,6 +98,7 @@ export const WebView = {
stopPower, stopPower,
clearPower, clearPower,
setPower, setPower,
startMusic,
addVolume, addVolume,
reduceVolume, reduceVolume,
openCameraStorage, openCameraStorage,
......
...@@ -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="!ready" @click="handleStartPower"> <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" @click="handleStopPower"> <el-button class="submitBtn" type="primary" @click="handleStopPower">
<span>结束盘点</span> <span>结束盘点</span>
</el-button> </el-button>
</el-col> </el-col>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class="padding"> <div class="padding">
<el-row style="margin-top: 20px;"> <el-row style="margin-top: 20px;">
<el-col :span="24" style="text-align: center"> <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-col>
</el-row> </el-row>
<el-row style="margin-top: 20px;"> <el-row style="margin-top: 20px;">
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
@close="infoWinCancel" @close="infoWinCancel"
> >
<el-table :row-style="rowStyle" border :data="detailList" max-height="450"> <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"> <el-table-column label="管理编号" width="120" prop="insCode" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.insCode || '-' }} {{ scope.row.insCode || '-' }}
...@@ -76,11 +76,11 @@ ...@@ -76,11 +76,11 @@
</template> </template>
<script> <script>
import { getInventoryPdDetail,getALl, pdSubmit } 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 {getToken} from '@/utils/auth'
import { playAudio, successAudio } from '@/utils/common' import {playAudio, successAudio} from '@/utils/common'
export default { export default {
name: 'Instrument', name: 'Instrument',
...@@ -127,10 +127,10 @@ export default { ...@@ -127,10 +127,10 @@ export default {
dialogVisible: false, dialogVisible: false,
// 所有集合 // 所有集合
allList: [], allList: [],
completedCount:0, completedCount: 0,
count:0, count: 0,
// 精简数组, {id, insRfid, status, sync } sync 1 已同步数据库 0 未同步 // 精简数组, {id, insRfid, status, sync } sync 1 已同步数据库 0 未同步
sampleList:[], sampleList: [],
timer: undefined timer: undefined
} }
...@@ -158,9 +158,9 @@ export default { ...@@ -158,9 +158,9 @@ export default {
let resList = JSON.parse(args) let resList = JSON.parse(args)
resList.forEach(x => { resList.forEach(x => {
_that.sampleList.forEach(y => { _that.sampleList.forEach(y => {
if(x.typeId == y.insRfid && y.status != '1') { if (x.typeId == y.insRfid && y.status != '1') {
y.status = '1' y.status = '1'
} }
}) })
}) })
_that.completedCount = sampleListCache.filter(x => x.status == '1').length _that.completedCount = sampleListCache.filter(x => x.status == '1').length
...@@ -169,22 +169,22 @@ export default { ...@@ -169,22 +169,22 @@ export default {
let _that = this let _that = this
let ids = [] let ids = []
this.sampleList.forEach(y => { this.sampleList.forEach(y => {
if(y.status == '1' && y.sync == '0') { if (y.status == '1' && y.sync == '0') {
ids.push(y.id) ids.push(y.id)
} }
}) })
if(ids.length == 0 ) { if (ids.length == 0) {
return return
} }
let param = { let param = {
businessId : this.id, businessId: this.id,
ids: ids.join(',') ids: ids.join(',')
} }
pdSubmit(param).then(response => { pdSubmit(param).then(response => {
if(response.code == 200){ if (response.code == 200) {
ids.forEach(x => { ids.forEach(x => {
_that.sampleList.forEach(y => { _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' y.sync = '1'
} }
}) })
...@@ -192,9 +192,9 @@ export default { ...@@ -192,9 +192,9 @@ export default {
setTimeout(() => { setTimeout(() => {
// successAudio(true) // successAudio(true)
}, 500); // 2000毫秒 = 2秒 }, 500); // 2000毫秒 = 2秒
if(response.data.lastCount === 0) { if (response.data.lastCount === 0) {
// successAudio(true) // successAudio(true)
this.$message({ message: "盘点已完成!", type: 'success' }) this.$message({message: "盘点已完成!", type: 'success'})
this.statusClass = 'status_e' this.statusClass = 'status_e'
this.statusText = '盘点完成' this.statusText = '盘点完成'
this.handleClearPower() this.handleClearPower()
...@@ -202,9 +202,8 @@ export default { ...@@ -202,9 +202,8 @@ export default {
this.handleStopPower() this.handleStopPower()
clearInterval(this.timer) clearInterval(this.timer)
} }
} } else {
else { this.$message({message: response.message, type: 'error'})
this.$message({ message: response.message, type: 'error' })
// playAudio(true) // playAudio(true)
// 停止 // 停止
this.handleClearPower() this.handleClearPower()
...@@ -225,7 +224,7 @@ export default { ...@@ -225,7 +224,7 @@ export default {
handleStartPower() { handleStartPower() {
let selectList = [] let selectList = []
this.sampleList.forEach(x => { this.sampleList.forEach(x => {
if(x.status != '1') { if (x.status != '1') {
selectList.push(x.insRfid) selectList.push(x.insRfid)
} }
}) })
...@@ -234,6 +233,8 @@ export default { ...@@ -234,6 +233,8 @@ export default {
flag: 'startPower', flag: 'startPower',
//selectValue: selectList, //selectValue: selectList,
selectValue: [], selectValue: [],
// 是否播放提示音
alertVoice: true,
tokenMsg: getToken() tokenMsg: getToken()
} }
// 补充逻辑:如果设置筛选有值就调筛选逻辑,传id过去,筛选没值就不传id过去 // 补充逻辑:如果设置筛选有值就调筛选逻辑,传id过去,筛选没值就不传id过去
...@@ -269,31 +270,31 @@ export default { ...@@ -269,31 +270,31 @@ export default {
this.getInventoryPdDetail(this.id) this.getInventoryPdDetail(this.id)
}, },
getInventoryPdDetail(id) { getInventoryPdDetail(id) {
getInventoryPdDetail({pdId : id}).then(response => { getInventoryPdDetail({pdId: id}).then(response => {
this.detailList = response.rows this.detailList = response.rows
this.total = response.total this.total = response.total
this.infoOpen = true this.infoOpen = true
}) })
}, },
reloadAll(id) { reloadAll(id) {
getALl({pdId : id}).then(response => { getALl({pdId: id}).then(response => {
this.allList = response.data this.allList = response.data
this.ready = true this.ready = true
this.count = this.allList.length this.count = this.allList.length
this.completedCount = this.allList.filter(x => x.pdStatus == '1').length this.completedCount = this.allList.filter(x => x.pdStatus == '1').length
this.allList.forEach(x => { this.allList.forEach(x => {
if(x.insRfid) { if (x.insRfid) {
this.sampleList.push({ this.sampleList.push({
id : x.businessId, id: x.businessId,
insRfid: x.insRfid, insRfid: x.insRfid,
status: x.pdStatus, status: x.pdStatus,
sync : x.pdStatus == '1' ? 1 : 0 sync: x.pdStatus == '1' ? 1 : 0
}) })
} }
}) })
}) })
}, },
endInventory(){ endInventory() {
this.$confirm('确定结束盘点吗?', '结束盘点', { this.$confirm('确定结束盘点吗?', '结束盘点', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -303,7 +304,7 @@ export default { ...@@ -303,7 +304,7 @@ export default {
}) })
}, },
// 根据状态控制当前行的颜色 // 根据状态控制当前行的颜色
changeColor({ row, rowIndex }) { changeColor({row, rowIndex}) {
if (row.pdStatus === '1') { if (row.pdStatus === '1') {
return { return {
background: 'orange' background: 'orange'
...@@ -311,8 +312,8 @@ export default { ...@@ -311,8 +312,8 @@ export default {
} }
}, },
// 结合有效期和悬停的样式 // 结合有效期和悬停的样式
rowStyle({ row, rowIndex }) { rowStyle({row, rowIndex}) {
const style = this.changeColor({ row, rowIndex }) const style = this.changeColor({row, rowIndex})
return Object.assign({}, style) return Object.assign({}, style)
} }
} }
...@@ -346,6 +347,7 @@ export default { ...@@ -346,6 +347,7 @@ export default {
width: 30px; width: 30px;
margin-left: 3px; margin-left: 3px;
} }
.padding { .padding {
padding-left: 50px; /* 设置左边的间距 */ padding-left: 50px; /* 设置左边的间距 */
padding-top: 50px; padding-top: 50px;
...@@ -354,6 +356,7 @@ export default { ...@@ -354,6 +356,7 @@ export default {
.status_b { .status_b {
color: red; color: red;
} }
.status_e { .status_e {
color: green; color: green;
} }
......
...@@ -243,7 +243,6 @@ import { getToken } from '@/utils/auth' ...@@ -243,7 +243,6 @@ import { getToken } from '@/utils/auth'
import {getInsStrumentInfo} from "@/api/query/query" import {getInsStrumentInfo} from "@/api/query/query"
import {getDict} from "@/api/system/dict/data" import {getDict} from "@/api/system/dict/data"
import deviceField from "@/utils/device/deviceField" import deviceField from "@/utils/device/deviceField"
import { openCameraAll, openCameraStorage } from '@/utils/WebViewContact'
export default { export default {
name: "index", name: "index",
...@@ -308,10 +307,23 @@ export default { ...@@ -308,10 +307,23 @@ export default {
} }
}, },
created() { created() {
// 播放音乐
this.startMusic('1')
this.getInsManageList() this.getInsManageList()
this.getInsType()// 获取类型字典 this.getInsType()// 获取类型字典
}, },
methods: { methods: {
/** 播放音乐*/
startMusic(type){
console.log('要播放的音乐类型为:',type)
const params = {
subPath: 'startMusic',
tokenMsg: getToken(),
type: type
}
this.$WebView.startMusic(params).then(res => {
})
},
/** 全部实现功能(带相机,相册,文件资源功能)*/ /** 全部实现功能(带相机,相册,文件资源功能)*/
handlePpenCameraAll1() { handlePpenCameraAll1() {
const params = { const params = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment