指令管理任务管理
This commit is contained in:
182
pages/management/inst-manage.vue
Normal file
182
pages/management/inst-manage.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title" :searchActive="true" @toSearch="toSearch"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="tab_wrapper">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-8 font-style-1" v-for="e in state" :key="e.id" @tap="changeTab(e)">
|
||||
<view class="font-style-1" :class="{'font-style-2': e.id === tab, 'border-r': e.id !== '3'}">{{e.text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-wrapper">
|
||||
<view class="slide_new">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>任务号</th>
|
||||
<th>指令号</th>
|
||||
<th>起始设备</th>
|
||||
<th>目标设备</th>
|
||||
<th>状态</th>
|
||||
<th>载具号</th>
|
||||
<th>agv车号</th>
|
||||
<th>指令执行步骤</th>
|
||||
<th>优先级</th>
|
||||
<th>时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.inst_uuid === pkId}">
|
||||
<td>{{e.task_no}}</td>
|
||||
<td>{{e.instruction_code}}</td>
|
||||
<td>{{e.start_devicecode}}</td>
|
||||
<td>{{e.next_devicecode}}</td>
|
||||
<td>{{['就绪', '执行中', '完成', '取消'][Number(e.inst_status)]}}</td>
|
||||
<td>{{e.carrier}}</td>
|
||||
<td>{{e.carno}}</td>
|
||||
<td>{{e.inst_step}}</td>
|
||||
<td>{{e.priority}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
<view class="zd-row jcenter submit-bar">
|
||||
<button class="button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('1')">指令撤销</button>
|
||||
<button class="button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('2')">重新下发</button>
|
||||
<button class="button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('3')">强制完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="msg_wrapper" :class="show ? 'popshow' : 'pophide'">
|
||||
<view class="msg_content">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">关键字</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input" v-model="val1">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">起始设备</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<search-box
|
||||
v-model="val2"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">目标设备</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<search-box
|
||||
v-model="val3"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row jcenter submit-bar">
|
||||
<button class="button-primary" @tap.stop="show = false">取消</button>
|
||||
<button class="button-primary" @tap.stop="clearUp">清空</button>
|
||||
<button class="button-primary" @tap="_handInsts">查询</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="show" class="msg_mask"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {handInsts, handInst} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}, {id:'2', text: '完成'}, {id:'3', text: '取消'}],
|
||||
tab: '-1',
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
val3: '',
|
||||
data: [],
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
this._handInsts()
|
||||
},
|
||||
methods: {
|
||||
toSearch () {
|
||||
this.show = true
|
||||
this.tab = '-1'
|
||||
},
|
||||
async _handInsts () {
|
||||
this.show = false
|
||||
try {
|
||||
let res = await handInsts(this.val1, this.val2, this.val3)
|
||||
this.data = [...res.data]
|
||||
this.dataList = [...this.data]
|
||||
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
changeTab (e) {
|
||||
this.tab = e.id
|
||||
if (e.id !== '-1') {
|
||||
let arr = this.data.filter(el => {return el.inst_status === e.id})
|
||||
this.dataList = [...arr]
|
||||
} else {
|
||||
this.dataList = [...this.data]
|
||||
}
|
||||
},
|
||||
async _handInst (type) {
|
||||
this.disabled = true
|
||||
if (!this.pkId) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await handInst(type, this.pkId)
|
||||
this.disabled = false
|
||||
this.tab = '-1'
|
||||
this._handInsts()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.val3 = ''
|
||||
this.pkId = ''
|
||||
this.disabled = false
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.inst_uuid ? '' : e.inst_uuid
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
</style>
|
||||
179
pages/management/task-manage.vue
Normal file
179
pages/management/task-manage.vue
Normal file
@@ -0,0 +1,179 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title" :searchActive="true" @toSearch="toSearch"></nav-bar>
|
||||
<view class="zd_content pdt0">
|
||||
<view class="tab_wrapper">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-8 font-style-1" v-for="e in state" :key="e.id" @tap="changeTab(e)">
|
||||
<view class="font-style-1" :class="{'font-style-2': e.id === tab}">{{e.text}}</view>
|
||||
<view class="tab-line" :class="{'tab-line_active': e.id === tab}"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-wrapper">
|
||||
<view class="slide_new">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>任务号</th>
|
||||
<th>起始设备</th>
|
||||
<th>目标设备</th>
|
||||
<th>状态</th>
|
||||
<th>载具号</th>
|
||||
<th>优先级</th>
|
||||
<th>时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_uuid === pkId}">
|
||||
<td>{{e.task_no}}</td>
|
||||
<td>{{e.start_devicecode}}</td>
|
||||
<td>{{e.next_devicecode}}</td>
|
||||
<td>{{['就绪', '执行中', '完成'][Number(e.task_status)]}}</td>
|
||||
<td>{{e.carrier}}</td>
|
||||
<td>{{e.priority}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
<view class="zd-row jcenter submit-bar">
|
||||
<button class="button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handTaskoperation('1')">重新生成</button>
|
||||
<button class="button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handTaskoperation('2')">强制完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="msg_wrapper" :class="show ? 'popshow' : 'pophide'">
|
||||
<view class="msg_content">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">关键字</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input" v-model="val1">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">起始设备</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<search-box
|
||||
v-model="val2"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">目标设备</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<search-box
|
||||
v-model="val3"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row jcenter submit-bar">
|
||||
<button class="button-primary" @tap.stop="show = false">取消</button>
|
||||
<button class="button-primary" @tap.stop="clearUp">清空</button>
|
||||
<button class="button-primary" @tap="_handTasks">查询</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="show" class="msg_mask"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {handTasks, handTaskoperation} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}, {id:'2', text: '完成'}],
|
||||
tab: '-1',
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
val3: '',
|
||||
data: [],
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
this._handTasks()
|
||||
},
|
||||
methods: {
|
||||
toSearch () {
|
||||
this.show = true
|
||||
this.tab = '-1'
|
||||
},
|
||||
async _handTasks () {
|
||||
this.show = false
|
||||
try {
|
||||
let res = await handTasks(this.val1, this.val2, this.val3)
|
||||
this.data = [...res.data]
|
||||
this.dataList = [...this.data]
|
||||
|
||||
} catch (e) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
changeTab (e) {
|
||||
this.tab = e.id
|
||||
if (e.id !== '-1') {
|
||||
let arr = this.data.filter(el => {return el.task_status === e.id})
|
||||
this.dataList = [...arr]
|
||||
} else {
|
||||
this.dataList = [...this.data]
|
||||
}
|
||||
},
|
||||
async _handTaskoperation (type) {
|
||||
this.disabled = true
|
||||
if (!this.pkId) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await handTaskoperation(type, this.pkId)
|
||||
this.disabled = false
|
||||
this.tab = '-1'
|
||||
this._handTasks()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.val3 = ''
|
||||
this.pkId = ''
|
||||
this.disabled = false
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
</style>
|
||||
Reference in New Issue
Block a user