add 设备管理页
@@ -26,6 +26,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
,{
|
||||||
|
"path" : "pages/manage/equip",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
// "pageOrientation": "landscape",
|
// "pageOrientation": "landscape",
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
return {
|
return {
|
||||||
userName: '',
|
userName: '',
|
||||||
menuList: [
|
menuList: [
|
||||||
{title: '配料任务', icon: 'RF07', path: '/pages/manage/mix-task'}
|
{title: '配料任务', icon: 'RF01', path: '/pages/manage/mix-task'},
|
||||||
|
{title: '设备管理', icon: 'RF02', path: '/pages/manage/equip'}
|
||||||
],
|
],
|
||||||
show: false,
|
show: false,
|
||||||
secM: []
|
secM: []
|
||||||
|
|||||||
97
pages/manage/equip.vue
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
<template>
|
||||||
|
<view class="zd_container">
|
||||||
|
<nav-bar :title="title"></nav-bar>
|
||||||
|
<view class="zd_content">
|
||||||
|
<view class="zd_wrapper grid-wraper">
|
||||||
|
<view class="slide_new">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>选择</th>
|
||||||
|
<th>点位编码</th>
|
||||||
|
<th>点位名称</th>
|
||||||
|
<th>点位状态</th>
|
||||||
|
<th>是否启用</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(e, i) in dataList" :key="i" @tap="toCheck(e)">
|
||||||
|
<td>
|
||||||
|
<view class="checkbox">
|
||||||
|
<uni-icons type="checkmarkempty" size="20" :color="e.point_code === pkId ? '#4e6ef2' : '#fff'"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</td>
|
||||||
|
<td>{{ e.point_code }}</td>
|
||||||
|
<td>{{ e.point_name }}</td>
|
||||||
|
<td>{{ e.point_status }}</td>
|
||||||
|
<td>{{ e.is_used }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="zd-row submit-bar">
|
||||||
|
<button class="zd-col-11 button-primary" :disabled="disabled && type === '1'" :class="{'button-info': !pkId}" @tap="toSure('1')">设置有货</button>
|
||||||
|
<button class="zd-col-11 button-primary" :disabled="disabled && type === '0'" :class="{'button-info': !pkId}" @tap="toSure('0')">设置无货</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import NavBar from '@/components/NavBar.vue'
|
||||||
|
import {queryPoints, operation} from '@/utils/getData2.js'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
NavBar
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '',
|
||||||
|
disabled: false,
|
||||||
|
type: '',
|
||||||
|
dataList: [],
|
||||||
|
pkId: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad (options) {
|
||||||
|
this.title = options.title
|
||||||
|
this._queryPoints()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async _queryPoints () {
|
||||||
|
let res = await queryPoints()
|
||||||
|
this.dataList = [...res]
|
||||||
|
},
|
||||||
|
toCheck (e) {
|
||||||
|
this.pkId = this.pkId === e.point_code ? '' : e.point_code
|
||||||
|
},
|
||||||
|
async toSure (type) {
|
||||||
|
this.disabled = true
|
||||||
|
this.type = type
|
||||||
|
if (!this.pkId) {
|
||||||
|
this.disabled = false
|
||||||
|
this.type = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
let res = await operation(this.pkId, type)
|
||||||
|
this._queryPoints()
|
||||||
|
uni.showToast({
|
||||||
|
title: res.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
this.disabled = false
|
||||||
|
this.type = ''
|
||||||
|
} catch (e) {
|
||||||
|
this.disabled = false
|
||||||
|
this.type = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus">
|
||||||
|
|
||||||
|
</style>
|
||||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
@@ -40,3 +40,16 @@ export const confirmZZDevice = (code, work, ncode) => request({
|
|||||||
url:'api/hand/confirmZZDevice',
|
url:'api/hand/confirmZZDevice',
|
||||||
data: {mfg_order_name: code, work_code: work, next_device_code: ncode}
|
data: {mfg_order_name: code, work_code: work, next_device_code: ncode}
|
||||||
})
|
})
|
||||||
|
// 设备管理
|
||||||
|
export const queryPoints = () => request({
|
||||||
|
url: 'api/pda/queryPoints',
|
||||||
|
data: {}
|
||||||
|
})
|
||||||
|
// 更新设备
|
||||||
|
export const operation = (code, type) => request({
|
||||||
|
url: 'api/pda/operation',
|
||||||
|
data: {
|
||||||
|
point_code: code,
|
||||||
|
type: type
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -62,3 +62,11 @@ export const confirmZZDevice = () => {
|
|||||||
let res = {message: 'ok'}
|
let res = {message: 'ok'}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
export const queryPoints = () => {
|
||||||
|
let res = [{point_code: 'aaa1'}]
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
export const operation = () => {
|
||||||
|
let res = {message: 'ok'}
|
||||||
|
return res
|
||||||
|
}
|
||||||