作业管理
This commit is contained in:
@@ -1,43 +1,32 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 作业管理 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<nav-bar title="任务管理"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-5">
|
||||
<span class="filter_label">关键字</span>
|
||||
</view>
|
||||
<view class="zd-col-14">
|
||||
<input type="text" placeholder="载具号/点位号/作业号" class="filter_input" v-model="keyword" @focus="handleFocus">
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="searchList">查询</button>
|
||||
</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>异常信息</th>
|
||||
<th>托盘号</th>
|
||||
<th>物料类型</th>
|
||||
<th>优先级</th>
|
||||
<th>时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_id === pkId}" @tap="toCheck(e)">
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.unit_id}}</td>
|
||||
<td>{{e.single_weight}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<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.vehicle_code}}</td>
|
||||
<td>{{e.material_type_name}}</td>
|
||||
<td>{{e.priority}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -45,65 +34,93 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" :disabled="disabled">重新下发</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" :disabled="disabled">强制完成</button>
|
||||
<button class="zd-col-7 button-primary" @tap="toJump('operation?title=查询作业')">历史查询</button>
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled1" @tap="toSure1('1')">重新生成</button>
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="toSure2('2')">强制完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {groupMaterList} from '@/utils/getData2.js'
|
||||
import {queryTask, taskOperation} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
keyword: null,
|
||||
keyword: '',
|
||||
startPoint: '',
|
||||
endPoint: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
disabled: false
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
pkId: ''
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
this._queryTask(this.keyword, this.startPoint, this.endPoint)
|
||||
},
|
||||
methods: {
|
||||
handleFocus () {
|
||||
this.keyword = null
|
||||
async _queryTask () {
|
||||
let res = await queryTask(this.keyword, this.startPoint, this.endPoint)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.result]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
toJump (name) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/General/${name}`
|
||||
})
|
||||
},
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._groupMaterList()
|
||||
},
|
||||
async _groupMaterList () {
|
||||
let res = await groupMaterList()
|
||||
if (res.code === '200') {
|
||||
this.dataList = [...res]
|
||||
async _taskOperation (type) {
|
||||
try {
|
||||
let res = await taskOperation(this.pkId, type)
|
||||
if (res.code === '1') {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.pkId = ''
|
||||
this._queryTask()
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
} catch (err) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.material_id ? '' : e.material_id
|
||||
this.pkObj = this.pkId === e.material_id ? e : {}
|
||||
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
|
||||
},
|
||||
toSure () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('setPublicObj', this.pkObj)
|
||||
uni.navigateBack()
|
||||
toSure1 (type) {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._taskOperation(type)
|
||||
},
|
||||
toSure2 (type) {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this._taskOperation(type)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user