|
@ -1,19 +1,21 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="sell-box-test"> |
|
|
<view class="sell-box-test"> |
|
|
<device-name></device-name> |
|
|
|
|
|
|
|
|
<device-name :name="optionsQuery.name"></device-name> |
|
|
<view class="sbt-tit">测试货道</view> |
|
|
<view class="sbt-tit">测试货道</view> |
|
|
<view class="sbt-tip">您可自定义测试某个货道,也可以批量测试所有货道</view> |
|
|
<view class="sbt-tip">您可自定义测试某个货道,也可以批量测试所有货道</view> |
|
|
<view class="sbt-section"> |
|
|
<view class="sbt-section"> |
|
|
<view class="ss-item"> |
|
|
|
|
|
|
|
|
<!-- <view class="ss-item"> |
|
|
<view class="si-tit">批量测试货道</view> |
|
|
<view class="si-tit">批量测试货道</view> |
|
|
<view class="si-ipt"><input placeholder="请输入运行圈数" /></view> |
|
|
<view class="si-ipt"><input placeholder="请输入运行圈数" /></view> |
|
|
<view class="si-btn" hover-class="hover-active">执行</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="si-btn" hover-class="hover-active" @click="testAllBtn">执行</view> |
|
|
|
|
|
</view> --> |
|
|
<view class="ss-item"> |
|
|
<view class="ss-item"> |
|
|
<view class="si-tit">自定义测试</view> |
|
|
<view class="si-tit">自定义测试</view> |
|
|
<picker><view class="si-ipt"><input placeholder="请选择货道编号" disabled/><image></image></view></picker> |
|
|
|
|
|
<view class="si-ipt"><input placeholder="请输入运行圈数" /></view> |
|
|
|
|
|
<view class="si-btn" hover-class="hover-active">执行</view> |
|
|
|
|
|
|
|
|
<picker :range="goodsList" range-key="grid_id" @change="pickerChange"> |
|
|
|
|
|
<view class="si-ipt"><input placeholder="请选择货道编号" disabled :value="curTestCargoLane.grid_id"/><view></view></view> |
|
|
|
|
|
</picker> |
|
|
|
|
|
<view class="si-ipt"><input placeholder="请输入运行圈数" v-model="testOneNum" /></view> |
|
|
|
|
|
<view class="si-btn" hover-class="hover-active" @click="testOneBtn">执行</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -21,9 +23,101 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import device_name from '../../components/device_name/device_name'; |
|
|
import device_name from '../../components/device_name/device_name'; |
|
|
|
|
|
import deviceServer from '../../js/device_server'; |
|
|
|
|
|
import deviceApi from '../../js/device_api'; |
|
|
|
|
|
import util from '../../../../utils/util'; |
|
|
|
|
|
import { mapState } from 'vuex'; |
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
'device-name': device_name |
|
|
'device-name': device_name |
|
|
|
|
|
}, |
|
|
|
|
|
computed: { |
|
|
|
|
|
...mapState({ |
|
|
|
|
|
curStoreInfo: state => state.device.curStoreInfo, |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
data(){ |
|
|
|
|
|
return { |
|
|
|
|
|
curTestCargoLane: {}, |
|
|
|
|
|
goodsList: [], |
|
|
|
|
|
optionsQuery: {}, |
|
|
|
|
|
testOneNum: 1 |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
onLoad(options){ |
|
|
|
|
|
let _query = util.jsonPar(options.query); |
|
|
|
|
|
this.optionsQuery = _query || {}; |
|
|
|
|
|
this.getGoodsList(_query.id) |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
// testAllBtn: util.debounce(function(){ |
|
|
|
|
|
// let { curStoreInfo, optionsQuery } = this; |
|
|
|
|
|
// console.log(optionsQuery) |
|
|
|
|
|
// util.showLoad(); |
|
|
|
|
|
// deviceServer.get({ |
|
|
|
|
|
// url: deviceApi.vendingTestAll, |
|
|
|
|
|
// data: { |
|
|
|
|
|
// stadium_id: curStoreInfo.id, |
|
|
|
|
|
// stadium_hardware_id: optionsQuery.id |
|
|
|
|
|
// }, |
|
|
|
|
|
// isDefaultGet: false |
|
|
|
|
|
// }) |
|
|
|
|
|
// .then(res=>{ |
|
|
|
|
|
// util.hideLoad(); |
|
|
|
|
|
// if(res.data.code == 0){ |
|
|
|
|
|
// util.showNone(res.data.message || '操作成功!'); |
|
|
|
|
|
// }else{ |
|
|
|
|
|
// util.showNone(res.data.message || '操作失败!'); |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// .catch(util.hideLoad) |
|
|
|
|
|
// }, 300, 300), |
|
|
|
|
|
testOneBtn: util.debounce(function(){ |
|
|
|
|
|
let { curStoreInfo, optionsQuery, curTestCargoLane,testOneNum } = this; |
|
|
|
|
|
util.showLoad(); |
|
|
|
|
|
deviceServer.get({ |
|
|
|
|
|
url: deviceApi.vendingTestOne, |
|
|
|
|
|
data: { |
|
|
|
|
|
id: curTestCargoLane.id, |
|
|
|
|
|
stadium_id: curStoreInfo.id, |
|
|
|
|
|
stadium_hardware_id: optionsQuery.id, |
|
|
|
|
|
number: testOneNum, |
|
|
|
|
|
}, |
|
|
|
|
|
isDefaultGet: false |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res=>{ |
|
|
|
|
|
util.hideLoad(); |
|
|
|
|
|
if(res.data.code == 0){ |
|
|
|
|
|
util.showNone(res.data.message || '操作成功!'); |
|
|
|
|
|
}else{ |
|
|
|
|
|
util.showNone(res.data.message || '操作失败!'); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(util.hideLoad) |
|
|
|
|
|
}, 300, 300), |
|
|
|
|
|
|
|
|
|
|
|
pickerChange(e){ |
|
|
|
|
|
let { goodsList } = this; |
|
|
|
|
|
this.curTestCargoLane = goodsList[e.detail.value]; |
|
|
|
|
|
console.log(e) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getGoodsList(hardware_id){ |
|
|
|
|
|
util.showLoad(); |
|
|
|
|
|
deviceServer.get({ |
|
|
|
|
|
url: deviceApi.vendingGoodsList, |
|
|
|
|
|
data: { hardware_id }, |
|
|
|
|
|
failMsg: '加载失败!' |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res=>{ |
|
|
|
|
|
util.hideLoad(); |
|
|
|
|
|
let _list = res.list || []; |
|
|
|
|
|
let _goodsArr = []; |
|
|
|
|
|
_list.forEach(e=>{if(e.vending_goods.length)_goodsArr.push(...e.vending_goods)}); |
|
|
|
|
|
this.goodsList = _goodsArr; |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(util.hideLoad); |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
@ -72,12 +166,14 @@ export default { |
|
|
font-size: 28upx; |
|
|
font-size: 28upx; |
|
|
color: #333; |
|
|
color: #333; |
|
|
} |
|
|
} |
|
|
>image{ |
|
|
|
|
|
|
|
|
>view{ |
|
|
flex-shrink: 0; |
|
|
flex-shrink: 0; |
|
|
margin-left: 20upx; |
|
|
margin-left: 20upx; |
|
|
width: 40upx; |
|
|
|
|
|
height: 40upx; |
|
|
|
|
|
background-color: #333; |
|
|
|
|
|
|
|
|
width: 0upx; |
|
|
|
|
|
height: 0upx; |
|
|
|
|
|
border-left: 12upx solid transparent; |
|
|
|
|
|
border-right: 12upx solid transparent; |
|
|
|
|
|
border-top: 16upx solid #333; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.si-btn{ |
|
|
.si-btn{ |
|
|