add设备管理页

This commit is contained in:
2025-02-19 15:11:07 +08:00
parent 306e434234
commit 008d5e998d
7 changed files with 125 additions and 4 deletions

View File

@@ -48,6 +48,13 @@ export const pdaPause = (code) => post('api/pda/pause', {
work_code: code
})
// 生成退桶任务
export const callTask = (scode, ncode) => post('api/pda/callTask', {
export const callTask = (scode) => post('api/pda/callTask', {
start_device_code: scode
})
// 设备管理
export const queryPoints = () => post('api/pda/queryPoints', {})
// 更新设备
export const operation = (code, type) => post('api/pad/operation', {
point_code: code,
type: type
})

View File

@@ -22,3 +22,11 @@ export const handLogin = (user, password) => {
}
return res
}
export const queryPoints = () => {
let res = [{point_code: 'aaa1'}]
return res
}
export const operation = () => {
let res = {message: 'ok'}
return res
}

BIN
src/images/menu/RF3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -17,7 +17,7 @@
</el-select>
</div>
</div>
<div class="zd-row jccenter button-wrap">
<div class="zd-row jccenter button-wrap button-wrap-1">
<button class="button btn-primary" :class="{'btn-info': !val1}" :disabled="disabled" @click="_callTask">生成任务</button>
</div>
</div>
@@ -73,4 +73,9 @@ export default {
<style lang="stylus" scoped>
// @import '~@style/mixin'
.setup-wrap
display flex
flex-direction column
justify-content center
padding 1.93rem 1.26rem 1.12rem 1.39rem
</style>

95
src/pages/equip.vue Normal file
View File

@@ -0,0 +1,95 @@
<template>
<div class="contianer">
<jxHeader type="2" title="设备管理"></jxHeader>
<div class="contianer content">
<div class="contianer content_wraper">
<div class="contianer mgt2 grid_wraper">
<table>
<tr>
<th>点位编码</th>
<th>点位名称</th>
<th>点位状态</th>
<th>是否启用</th>
<th style="text-align: center">操作</th>
</tr>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{ e.point_code }}</td>
<td>{{ e.point_name }}</td>
<td>{{ e.point_status }}</td>
<td>{{ e.is_used }}</td>
<td>
<div class="zd-row btn_wraper">
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled1}" :disabled="disabled1" @click="isFull(e, '1')">设置有货</button>
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled2}" :disabled="disabled2" @click="isEmpty(e, '0')">设置无货</button>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</template>
<script>
import jxHeader from '@components/header.vue'
import {queryPoints, operation} from '@config/getData.js'
export default {
components: {
jxHeader
},
data () {
return {
dataList: [],
disabled1: false,
disabled2: false
}
},
mounted () {
this._queryPoints()
},
methods: {
async _queryPoints () {
let res = await queryPoints()
this.dataList = [...res]
this.dataList.map(el => {
this.$set(el, 'checked', false)
})
},
isFull (e, type) {
this.disabled1 = true
e.checked = true
this._operation(e, type)
},
isEmpty (e, type) {
this.disabled2 = true
e.checked = true
this._operation(e, type)
},
async _operation (e, type) {
try {
let res = await operation(e.point_code, type)
this._queryPoints()
this.$message({
message: res.message,
type: 'success'
})
this.disabled1 = false
this.disabled2 = false
e.checked = false
} catch (e) {
this.disabled1 = false
this.disabled2 = false
e.checked = false
}
}
}
}
</script>
<style lang="stylus" scoped>
// @import '~@style/mixin'
.btn_wraper
width 3rem
margin 0 auto
</style>

View File

@@ -7,7 +7,7 @@
<div class="contianer content contianer-1">
<div class="zd-row jccenter contianer content_wraper">
<div class="nav" v-for="(e, i) in menu" :key="i" @click="toPage(e)">
<img class="nav_icon" :src="require('../images/menu/' + e.icon + '.png')" alt="e.title" :style="{'background-color': ['#ff814a', '#4982fd'][i]}">
<img class="nav_icon" :src="require('../images/menu/' + e.icon + '.png')" alt="e.title" :style="{'background-color': ['#ff814a', '#4982fd', '#13a144'][i]}">
<div class="nav_txt">{{ e.title }}</div>
</div>
</div>
@@ -27,7 +27,8 @@ export default {
userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).person_name : '',
menu: [
{title: '工单管理', icon: 'RF1', path: 'index'},
{title: '退桶任务', icon: 'RF2', path: 'calltask'}
{title: '退桶任务', icon: 'RF2', path: 'calltask'},
{title: '设备管理', icon: 'RF3', path: 'equip'}
]
}
},

View File

@@ -6,6 +6,7 @@ const Home = r => require.ensure([], () => r(require('@page/home')), 'Home')
const Index = r => require.ensure([], () => r(require('@page/index')), 'Index')
const Task = r => require.ensure([], () => r(require('@page/task')), 'Task')
const CallTask = r => require.ensure([], () => r(require('@page/call-task')), 'CallTask')
const Equip = r => require.ensure([], () => r(require('@page/equip')), 'Equip')
Vue.use(Router)
export default new Router({
@@ -33,6 +34,10 @@ export default new Router({
{
path: '/calltask',
component: CallTask
},
{
path: '/equip',
component: Equip
}
]
})