作业管理

This commit is contained in:
2025-09-19 16:19:49 +08:00
parent e0c1c8c7e4
commit 68b082132a
4 changed files with 146 additions and 134 deletions

View File

@@ -1,6 +1,5 @@
# 注意事项 # 注意事项
+ 原生APP云打包使用自有证书 + 原生APP云打包使用自有证书
+ 证书别名testalias + 证书别名testalias
+ 接口在线地址:(https://apifox.com/apidoc/shared-e9d4798e-2db1-493d-a0cb-7a0e881c4bd6/api-160097540) + 接口在线地址:(http://47.111.78.178:8014/)
+ app图标为lms + app图标为lms
+ 接口在线地址http://47.98.105.245:8001/project/21/interface/api/cat_122

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="zd_container"> <view class="zd_container">
<!-- 机台工单维护 --> <!-- 历史查询 -->
<nav-bar :title="title" :inner="true"></nav-bar> <nav-bar :title="title" :inner="true"></nav-bar>
<view class="zd_content"> <view class="zd_content">
<view class="zd_wrapper"> <view class="zd_wrapper">
@@ -25,9 +25,9 @@
<span class="filter_label">关键字</span> <span class="filter_label">关键字</span>
</view> </view>
<view class="zd-col-14"> <view class="zd-col-14">
<input type="text" placeholder="载具号/点位号/作业号" class="filter_input" v-model="keyword" @focus="handleFocus"> <input type="text" placeholder="载具号/起点/终点/任务号" class="filter_input" v-model="keyword" @focus="handleFocus">
</view> </view>
<button class="mini-btn" type="primary" size="mini" @tap="searchList">查询</button> <button class="mini-btn" type="primary" size="mini" @tap="_queryHistoryTask">查询</button>
</view> </view>
</view> </view>
<view class="zd_wrapper grid-wraper"> <view class="zd_wrapper grid-wraper">
@@ -48,21 +48,23 @@
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_id === pkId}" @tap="toCheck(e)"> <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.create_time}}</td>
<td>{{e.material_name}}</td> <td>{{e.vehicle_code}}</td>
<td>{{e.material_spec}}</td> <td>{{e.point_code1}}</td>
<td>{{e.unit_id}}</td> <td>{{e.point_code2}}</td>
<td>{{e.single_weight}}</td> <td>{{['生成', '', '', '下发', '执行中', '完成'][Number(e.task_status)]}}</td>
<td>{{e.pcsn}}</td> <td>{{e.task_code}}</td>
<td>{{e.config_name}}</td>
<td>{{e.car_no}}</td>
<td>{{e.remark}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</view> </view>
</view> </view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button> <button class="zd-col-24 button-primary" @tap="toSure">返回</button>
</view> </view>
</view> </view>
</template> </template>
@@ -71,7 +73,7 @@
import NavBar from '@/components/NavBar.vue' import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue' import SearchBox from '@/components/SearchBox.vue'
import {getDate} from '@/utils/utils.js' import {getDate} from '@/utils/utils.js'
import {groupMaterList} from '@/utils/getData2.js' import {queryHistoryTask} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar, NavBar,
@@ -86,19 +88,7 @@
keyword: null, keyword: null,
date1: currentDate, date1: currentDate,
date2: currentDate, date2: currentDate,
dataList: [], dataList: []
pkId: '',
pkObj: {},
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10
}; };
}, },
computed: { computed: {
@@ -111,6 +101,7 @@
}, },
onLoad (options) { onLoad (options) {
this.title = options.title this.title = options.title
this._queryHistoryTask()
}, },
methods: { methods: {
handleFocus () { handleFocus () {
@@ -122,48 +113,24 @@
bindDateChange2: function(e) { bindDateChange2: function(e) {
this.date2 = e.detail.value this.date2 = e.detail.value
}, },
searchList () { async _queryHistoryTask () {
this.dataList = [] try {
this.pageNum = 1 let res = await queryHistoryTask(this.keyword, this.date1, this.date2)
this._groupMaterList() if (res && res.data) {
}, this.dataList = [...res.data]
async _groupMaterList () {
let res = await groupMaterList(this.pageNum + '', this.pageSize + '', this.val1)
if (res.code === '200') {
this.totalCount = res.totalElements
if (res.totalElements > 0) {
const dataMap = res.content
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
this.reload = false
} else { } else {
this.dataList = [] this.dataList = []
uni.showToast({
title: res.message,
icon: 'none'
})
} }
if (this.totalCount == this.dataList.length) { } catch (e) {
this.reload = false this.dataList = []
this.status = 'noMore'
}
} }
}, },
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._groupMaterList()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = this.pkId === e.material_id ? '' : e.material_id
this.pkObj = this.pkId === e.material_id ? e : {}
},
toSure () { toSure () {
if (this.pkId) { uni.navigateBack()
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateBack()
}
} }
} }
} }

View File

@@ -1,32 +1,44 @@
<template> <template>
<view class="zd_container"> <view class="zd_container">
<nav-bar title="任务管理"></nav-bar> <!-- 任务管理 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content"> <view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">关键字</span>
</view>
<view class="zd-col-13">
<search-box v-model="keyword"/>
</view>
<button class="mini-btn" type="primary" size="mini" @tap="_queryTask">查询</button>
</view>
</view>
<view class="zd_wrapper grid-wraper"> <view class="zd_wrapper grid-wraper">
<view class="slide_new"> <view class="slide_new">
<table> <table>
<thead> <thead>
<tr> <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>
<th>时间</th> <th>备注</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_uuid === pkId}"> <tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_id === 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.vehicle_code}}</td>
<td>{{e.material_type_name}}</td> <td>{{e.point_code1}}</td>
<td>{{e.priority}}</td> <td>{{e.point_code2}}</td>
<td>{{e.create_time}}</td> <td>{{['生成', '', '', '下发', '执行中', '完成'][Number(e.task_status)]}}</td>
<td>{{e.task_code}}</td>
<td>{{e.config_name}}</td>
<td>{{e.car_no}}</td>
<td>{{e.remark}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -34,89 +46,114 @@
</view> </view>
</view> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled1" @tap="toSure1('1')">重新生成</button> <button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" :disabled="disabled1" @tap="_taskOperation">重新生成</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="toSure2('2')">强制完成</button> <button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_forceConfirmTask">强制完成</button>
<button class="zd-col-6 button-primary" @tap="toJump('operation?title=历史查询')">历史查询</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import NavBar from '@/components/NavBar.vue' import NavBar from '@/components/NavBar.vue'
import {queryTask, taskOperation} from '@/utils/getData2.js' import SearchBox from '@/components/SearchBox.vue'
import {queryTask, taskOperation, forceConfirmTask} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar NavBar,
SearchBox
}, },
data() { data() {
return { return {
title: '',
keyword: '', keyword: '',
startPoint: '',
endPoint: '',
dataList: [], dataList: [],
disabled1: false, disabled1: false,
disabled2: false, disabled2: false,
disabled3: false, pkId: '',
pkId: '' pkObj: {}
}; };
}, },
created () { onLoad (options) {
this._queryTask(this.keyword, this.startPoint, this.endPoint) this.title = options.title
}, this._queryTask()
},
methods: { methods: {
toJump (name) {
uni.navigateTo({
url: `/pages/General/${name}`
})
},
async _queryTask () { 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'
})
}
},
async _taskOperation (type) {
try { try {
let res = await taskOperation(this.pkId, type) let res = await queryTask(this.keyword)
if (res.code === '1') { if (res && res.data) {
this.disabled1 = false this.dataList = [...res.data]
this.disabled2 = false
this.pkId = ''
this._queryTask()
uni.showToast({
title: res.desc,
icon: 'none'
})
} else { } else {
this.dataList = []
uni.showToast({ uni.showToast({
title: res.desc, title: res.message,
icon: 'none' icon: 'none'
}) })
this.disabled1 = false
this.disabled2 = false
} }
} catch (err) { } catch (e) {
this.disabled1 = false this.dataList = []
this.disabled2 = false
} }
}, },
toCheck (e) { async _taskOperation () {
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
},
toSure1 (type) {
this.disabled1 = true this.disabled1 = true
if (!this.pkId) { if (!this.pkId) {
this.disabled1 = false this.disabled1 = false
return return
} }
this._taskOperation(type) try {
let res = await taskOperation(this.pkObj)
if (res) {
this._queryTask()
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
} catch (err) {
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
}
}, },
toSure2 (type) { async _forceConfirmTask () {
this.disabled2 = true this.disabled2 = true
if (!this.pkId) { if (!this.pkId) {
this.disabled2 = false this.disabled2 = false
return return
} }
this._taskOperation(type) try {
let res = await forceConfirmTask(this.pkObj)
if (res) {
this._queryTask()
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
} catch (err) {
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
}
},
toCheck (e) {
this.pkId = this.pkId === e.task_id ? '' : e.task_id
this.pkObj = this.pkId === e.task_id ? e : {}
} }
} }
} }

View File

@@ -153,20 +153,29 @@ export const clearMaterial = (code, scode) => request({
/** /**
* 任务管理 * 任务管理
*/ */
// 1.1 查询未完成指令 // 查询
export const queryTask = (keyword, scode, ncode) => request({ export const queryTask = (keyword) => request({
url:'api/hand/tasks', url:'api/pdaTask/queryTask',
data: { data: {
keyword: keyword, search: keyword
start_devicecode: scode,
next_devicecode: ncode
} }
}) })
// 1.2 指令操作 // 历史查询
export const taskOperation = (uuid, type) => request({ export const queryHistoryTask = (keyword, st, et) => request({
url:'api/hand/taskoperation', url:'api/pdaTask/queryHistoryTask',
data: { data: {
inst_uuid: uuid, search: keyword,
type: type start_time: st,
end_time: et
} }
})
// 重新下发
export const taskOperation = (data) => request({
url:'api/pdaTask/againSendTask',
data: data
})
// 强制完成任务
export const forceConfirmTask = (data) => request({
url:'api/pdaTask/forceConfirmTask',
data: data
}) })