指令、任务管理

This commit is contained in:
2024-07-18 15:40:32 +08:00
parent 2a02886a3d
commit c0fb3571e1
14 changed files with 421 additions and 151 deletions

View File

@@ -35,7 +35,9 @@
{id: '1', name: '工单管理', icon: 'RF01', path: '/pages/modules/man-paichan'},
{id: '2', name: '涂线板', icon: 'RF02', path: '/pages/modules/wire-board'},
{id: '3', name: '物料库存', icon: 'RF03', path: '/pages/modules/mater-inventory'},
{id: '4', name: '库存管理', icon: 'RF04', path: '/pages/modules/point-manage'}
{id: '4', name: '库存管理', icon: 'RF04', path: '/pages/modules/point-manage'},
{id: '5', name: '指令管理', icon: 'RF05', path: '/pages/modules/command-manage'},
{id: '6', name: '任务管理', icon: 'RF06', path: '/pages/modules/task-manage'}
]
};
},

View File

@@ -3,17 +3,19 @@
<nav-bar title="设置" :inner2="true" @goIn="goIn" :show1="false"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="input-wrap">
<view class="input-label">服务器地址</view>
<view class="setup-item">
<view class="setup-label">LMS地址</view>
<input type="text" class="setup-input" placeholder="请输入服务器地址" v-model="addrip">
</view>
</view>
<!-- <view class="zd_wrapper">
<view class="input-wrap">
<view class="input-label">刷新时间(s)</view>
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
<view class="setup-item">
<view class="setup-label">ACS地址</view>
<input type="text" class="setup-input" placeholder="请输入ACS地址" v-model="acsip">
</view>
</view> -->
<!-- <view class="setup-item">
<view class="setup-label">刷新时间(s)</view>
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
</view> -->
</view>
</view>
<view class="submit-bar">
<button class="submit-button" @click="_submit">确认</button>
@@ -29,9 +31,8 @@
},
data() {
return {
options: [],
index: '',
addrip: this.$store.getters.baseUrl,
acsip: this.$store.getters.acsUrl,
setTime: this.$store.getters.setTime / 1000
};
},
@@ -49,15 +50,22 @@
})
return
}
if (this.setTime === '') {
if (this.acsip === '') {
uni.showToast({
title: '请填写刷新时间',
title: '请填写ACS地址',
icon: 'none'
})
return
}
// if (this.setTime === '') {
// uni.showToast({
// title: '请填写刷新时间',
// icon: 'none'
// })
// return
// }
// 存值
this.$store.dispatch('setConfig',{baseUrl: this.addrip, setTime: this.setTime * 1000, setPrintName: this.index})
this.$store.dispatch('setConfig',{baseUrl: this.addrip, acsUrl: this.acsip, setTime: this.setTime * 1000})
uni.redirectTo({
url: '/pages/login/login'
})
@@ -68,15 +76,16 @@
<style lang="stylus">
@import '../../common/style/mixin.styl';
.input-wrap
.setup-item
width 100%
_fj()
.input-label
wh(200rpx, 58rpx)
_font(28rpx,58rpx,#464646)
margin-bottom 40rpx
.setup-label
_font(24rpx,40rpx,#000)
.setup-input
_wh(calc(100% - 200rpx), 58rpx)
_wh(100%, 80rpx)
background #fff
_font(28rpx,58rpx,#323232)
padding 0 10rpx
_font(28rpx,80rpx,#323232)
padding 0 28rpx
border 2px solid #e9ecf3
border-radius 12rpx
</style>

View File

@@ -0,0 +1,166 @@
<template>
<view class="zd_container">
<nav-bar title="指令管理"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label">关键字</view>
<view class="filter_input_wraper">
<input type="text" class="filter_input" v-model="val1">
</view>
</view>
<view class="filter_item">
<view class="filter_label">起始设备</view>
<view class="filter_input_wraper">
<search-box
v-model="val2"
/>
</view>
</view>
<view class="filter_item">
<view class="filter_label">目标设备</view>
<view class="filter_input_wraper">
<search-box
v-model="val3"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>任务号</th>
<th>指令号</th>
<th>起点</th>
<th>终点</th>
<th>状态</th>
<th>执行步骤</th>
<th>载具号</th>
<th>优先级</th>
<th>时间</th>
<th>agv车号</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>{{e.inst_status_name}}</td>
<td>{{e.inst_step}}</td>
<td>{{e.carrier}}</td>
<td>{{e.priority}}</td>
<td>{{e.create_time}}</td>
<td>{{e.carno}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar_new">
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="toSure1('1')">指令撤销</button>
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="toSure2('2')">重新下发</button>
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="toSure3('3')">强制完成</button>
<button class="zd-col-5 submit-button_new" :disabled="disabled" @tap="_handInsts">查询</button>
</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 {
val1: '',
val2: '',
val3: '',
data: [],
dataList: [],
disabled: false,
pkId: ''
};
},
created () {
this._handInsts(this.val1, this.val2, this.val3)
},
methods: {
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) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
},
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.pkId = ''
this._handInsts()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
toCheck (e) {
this.pkId = this.pkId === e.inst_uuid ? '' : e.inst_uuid
},
toSure1 (type) {
this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
this._handInst(type)
},
toSure2 (type) {
this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
this._handInst(type)
},
toSure3 (type) {
this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
this._handInst(type)
}
}
}
</script>
<style lang="stylus">
// .submit-bar
// justify-content: space-around;
// .submit-button
// margin: 0 0px 10px 0;
</style>

View File

@@ -0,0 +1,151 @@
<template>
<view class="zd_container">
<nav-bar title="任务管理"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label">关键字</view>
<view class="filter_input_wraper">
<input type="text" class="filter_input" v-model="val1">
</view>
</view>
<view class="filter_item">
<view class="filter_label">起始设备</view>
<view class="filter_input_wraper">
<search-box
v-model="val2"
/>
</view>
</view>
<view class="filter_item">
<view class="filter_label">目标设备</view>
<view class="filter_input_wraper">
<search-box
v-model="val3"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<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>{{e.task_status_name}}</td>
<td>{{e.priority}}</td>
<td>{{e.create_time}}</td>
<td>{{e.carrier}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar_new">
<button class="zd-col-8 submit-button_new" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="toSure1('1')">重新生成</button>
<button class="zd-col-8 submit-button_new" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="toSure2('2')">强制完成</button>
<button class="zd-col-5 submit-button_new" :disabled="disabled" @tap="_handTasks">查询</button>
</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 {
val1: '',
val2: '',
val3: '',
data: [],
dataList: [],
disabled: false,
pkId: ''
};
},
created () {
this._handTasks()
},
methods: {
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'
})
}
},
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.pkId = ''
this._handTasks()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
toCheck (e) {
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
},
toSure1 (type) {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
this._handTaskoperation(type)
},
toSure2 (type) {
this.disabled2 = true
if (!this.pkId) {
this.disabled2 = false
return
}
this._handTaskoperation(type)
}
}
}
</script>
<style lang="stylus">
// .submit-bar
// justify-content: space-around;
// .submit-button
// margin: 0 0px 10px 0;
</style>