This commit is contained in:
2024-06-24 18:01:32 +08:00
parent 4942a11d8a
commit 5d8b77987d
5 changed files with 176 additions and 163 deletions

View File

@@ -14,6 +14,32 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="JSON.stringify(obj) !== '{}'" class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">重量</span>
</view>
<view class="zd-col-17 filter_select">
<input type="number" class="filter_input" v-model="obj.material_weight" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">数量</span>
</view>
<view class="zd-col-17 filter_select">
<input type="number" class="filter_input" v-model="obj.material_qty" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">牌号</span>
</view>
<view class="zd-col-17 filter_select">
<input type="text" class="filter_input" v-model="obj.material_code" disabled>
</view>
</view>
</view>
</view> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button> <button class="zd-col-6 button-default" @tap="clearUp">清空</button>
@@ -35,6 +61,7 @@
return { return {
title: '', title: '',
val1: '', val1: '',
obj: {},
disabled: false disabled: false
}; };
}, },
@@ -46,6 +73,7 @@
methods: { methods: {
clearUp () { clearUp () {
this.val1 = '' this.val1 = ''
this.obj = {}
}, },
async _zpxxTask () { async _zpxxTask () {
this.disabled = true this.disabled = true
@@ -60,6 +88,7 @@
title: res.message, title: res.message,
icon: 'none' icon: 'none'
}) })
this.obj = res
} catch (e) { } catch (e) {
this.disabled = false this.disabled = false
} }

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="zd_container"> <view class="zd_container">
<nav-bar :title="title" :searchActive="true" @toSearch="toSearch"></nav-bar> <nav-bar :title="title"></nav-bar>
<view class="zd_content pdt0"> <view class="zd_content pdt0">
<view class="filter_wrapper"> <view class="filter_wrapper">
<view class="zd-row"> <view class="zd-row">
@@ -13,14 +13,14 @@
<view class="item-wrapper"> <view class="item-wrapper">
<view class="item-wrap" v-for="(e, i) in dataList" :key="i" @tap="toCheck(e)" :class="{isChecked: pkId === e.inst_uuid}"> <view class="item-wrap" v-for="(e, i) in dataList" :key="i" @tap="toCheck(e)" :class="{isChecked: pkId === e.inst_uuid}">
<view class="zd-row"> <view class="zd-row">
<view class="zd-col-10 item-font-1">{{e.task_no}}&nbsp;&#124;&nbsp;{{['就绪', '执行中', '完成','取消'][Number(e.inst_status)]}}</view> <view class="zd-col-15 item-font-1">{{e.task_no}}&nbsp;&#124;&nbsp;{{e.inst_status_name}}</view>
<view class="zd-col-10 item-font-2" style="text-align:right">{{e.create_time}}</view> <view class="zd-col-9 item-font-2" style="text-align:right">{{e.create_time}}</view>
</view> </view>
<view class="zd-row"> <view class="zd-row">
<view class="zd-col-16"> <view class="zd-col-16">
<view class="zd-row"> <view class="zd-row">
<view class="zd-col-6 item-font-3">指令号</view> <view class="zd-col-6 item-font-3">指令号</view>
<view class="zd-col-18 item-font-4">{{e.instruction_code}}</view> <view class="zd-col-18 item-font-4">{{e.inst_no}}</view>
</view> </view>
<view class="zd-row"> <view class="zd-row">
<view class="zd-col-10 item-font-3">指令执行步骤</view> <view class="zd-col-10 item-font-3">指令执行步骤</view>
@@ -53,44 +53,6 @@
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('2')">重新下发</button> <button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('2')">重新下发</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('3')">强制完成</button> <button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('3')">强制完成</button>
</view> </view>
<view class="zd_content msg_wrapper" :class="show ? 'popshow' : 'pophide'">
<view class="msg_content">
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">关键字</span>
</view>
<view class="zd-col-19">
<input type="text" class="filter_input" v-model="val1">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">起始设备</span>
</view>
<view class="zd-col-19">
<search-box
v-model="val2"
/>
</view>
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">目标设备</span>
</view>
<view class="zd-col-19 filter_select">
<search-box
v-model="val3"
/>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-7 button-default" @tap.stop="show = false">取消</button>
<button class="zd-col-7 button-default" @tap.stop="clearUp">清空</button>
<button class="zd-col-7 button-primary" @tap="_handInsts">查询</button>
</view>
</view>
<view v-if="show" class="msg_mask"></view>
</view> </view>
</template> </template>
@@ -105,13 +67,9 @@
}, },
data() { data() {
return { return {
show: false, state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}],
state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}, {id:'2', text: '完成'}, {id:'3', text: '取消'}],
tab: '-1', tab: '-1',
title: '', title: '',
val1: '',
val2: '',
val3: '',
data: [], data: [],
dataList: [], dataList: [],
pkId: '', pkId: '',
@@ -130,15 +88,21 @@
this.tab = '-1' this.tab = '-1'
}, },
async _handInsts () { async _handInsts () {
this.show = false
try { try {
let res = await handInsts(this.val1, this.val2, this.val3) let res = await handInsts(this.val1, this.val2, this.val3)
this.data = [...res.data] if (res.code === '1') {
this.dataList = [...this.data] this.data = [...res.result]
this.dataList = [...this.data]
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
} catch (e) { } catch (e) {
uni.showToast({ uni.showToast({
title: res.message, title: res.desc,
icon: 'none' icon: 'none'
}) })
} }
@@ -160,24 +124,21 @@
} }
try { try {
let res = await handInst(type, this.pkId) let res = await handInst(type, this.pkId)
this.disabled = false if (res.code === '1') {
this.tab = '-1' this.disabled = false
this._handInsts() this.tab = '-1'
uni.showToast({ this._handInsts()
title: res.message, uni.showToast({
icon: 'none' title: res.desc,
}) icon: 'none'
})
} else {
this.disabled = false
}
} catch (e) { } catch (e) {
this.disabled = false this.disabled = false
} }
}, },
clearUp () {
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.pkId = ''
this.disabled = false
},
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.inst_uuid ? '' : e.inst_uuid this.pkId = this.pkId === e.inst_uuid ? '' : e.inst_uuid
} }
@@ -185,5 +146,7 @@
} }
</script> </script>
<style lang="stylus"> <style lang="stylus" scoped>
.item-font-1
font-size 28rpx
</style> </style>

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="zd_container"> <view class="zd_container">
<nav-bar :title="title" :searchActive="true" @toSearch="toSearch"></nav-bar> <nav-bar :title="title"></nav-bar>
<view class="zd_content pdt0"> <view class="zd_content pdt0">
<view class="filter_wrapper"> <view class="filter_wrapper">
<view class="zd-row"> <view class="zd-row">
@@ -20,7 +20,7 @@
<view class="zd-col-16"> <view class="zd-col-16">
<view class="zd-row"> <view class="zd-row">
<view class="zd-col-7 item-font-3">任务状态</view> <view class="zd-col-7 item-font-3">任务状态</view>
<view class="zd-col-17 item-font-4">{{['就绪', '执行中', '完成'][Number(e.task_status)]}}</view> <view class="zd-col-17 item-font-4">{{e.task_status_name}}</view>
</view> </view>
<view class="zd-row"> <view class="zd-row">
<view class="zd-col-7 item-font-3">载具号</view> <view class="zd-col-7 item-font-3">载具号</view>
@@ -44,44 +44,6 @@
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handTaskoperation('1')">重新生成</button> <button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handTaskoperation('1')">重新生成</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handTaskoperation('2')">强制完成</button> <button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handTaskoperation('2')">强制完成</button>
</view> </view>
<view class="zd_content msg_wrapper" :class="show ? 'popshow' : 'pophide'">
<view class="msg_content">
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">关键字</span>
</view>
<view class="zd-col-19">
<input type="text" class="filter_input" v-model="val1">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">起始设备</span>
</view>
<view class="zd-col-19">
<search-box
v-model="val2"
/>
</view>
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">目标设备</span>
</view>
<view class="zd-col-19 filter_select">
<search-box
v-model="val3"
/>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-7 button-default" @tap.stop="show = false">取消</button>
<button class="zd-col-7 button-default" @tap.stop="clearUp">清空</button>
<button class="zd-col-7 button-primary" @tap="_handTasks">查询</button>
</view>
</view>
<view v-if="show" class="msg_mask"></view>
</view> </view>
</template> </template>
@@ -96,13 +58,9 @@
}, },
data() { data() {
return { return {
show: false, state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}],
state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}, {id:'2', text: '完成'}],
tab: '-1', tab: '-1',
title: '', title: '',
val1: '',
val2: '',
val3: '',
data: [], data: [],
dataList: [], dataList: [],
pkId: '', pkId: '',
@@ -116,20 +74,21 @@
this._handTasks() this._handTasks()
}, },
methods: { methods: {
toSearch () {
this.show = true
this.tab = '-1'
},
async _handTasks () { async _handTasks () {
this.show = false
try { try {
let res = await handTasks(this.val1, this.val2, this.val3) let res = await handTasks()
this.data = [...res.data] if (res.code === '1') {
this.dataList = [...this.data] this.data = [...res.result]
this.dataList = [...this.data]
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
} catch (e) { } catch (e) {
uni.showToast({ uni.showToast({
title: res.message, title: res.desc,
icon: 'none' icon: 'none'
}) })
} }
@@ -151,24 +110,21 @@
} }
try { try {
let res = await handTaskoperation(type, this.pkId) let res = await handTaskoperation(type, this.pkId)
this.disabled = false if (res.code === '1') {
this.tab = '-1' this.disabled = false
this._handTasks() this.tab = '-1'
uni.showToast({ this._handTasks()
title: res.message, uni.showToast({
icon: 'none' title: res.desc,
}) icon: 'none'
})
} else {
this.disabled = false
}
} catch (e) { } catch (e) {
this.disabled = false this.disabled = false
} }
}, },
clearUp () {
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.pkId = ''
this.disabled = false
},
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
} }

View File

@@ -126,14 +126,10 @@ export const rgfjskTask = (code) => request({
* 任务管理 * 任务管理
*/ */
// 1.1 1.1 查询无指令的任务(任务号为-开头) // 1.1 1.1 查询无指令的任务(任务号为-开头)
export const handTasks = (key, scode, ncode) => request({ export const handTasks = () => request({
url:'api/hand/tasks', url:'api/hand/tasks',
acsurl: true, acsurl: true,
data: { data: {}
keyword: key,
start_devicecode: scode,
next_devicecode: ncode
}
}) })
// 1.2 任务操作 // 1.2 任务操作
export const handTaskoperation = (type, id) => request({ export const handTaskoperation = (type, id) => request({
@@ -149,14 +145,10 @@ export const handTaskoperation = (type, id) => request({
* 指令管理 * 指令管理
*/ */
// 1.1 查询未完成指令(生成任务号为-开头) // 1.1 查询未完成指令(生成任务号为-开头)
export const handInsts = (key, scode, ncode) => request({ export const handInsts = () => request({
url:'api/hand/insts', url:'api/hand/insts',
acsurl: true, acsurl: true,
data: { data: {}
keyword: key,
start_devicecode: scode,
next_devicecode: ncode
}
}) })
// 1.2 指令操作 // 1.2 指令操作
export const handInst = (type, id) => request({ export const handInst = (type, id) => request({

View File

@@ -502,22 +502,95 @@ export const rgfjskTask = (code) => {
} }
// 任务管理 // 任务管理
export const handTasks = (key, scode, ncode) => { export const handTasks = (key, scode, ncode) => {
let res = { let res = {
"data": [ "result": [
{ {
"task_no": "-087", "material_type": "",
"task_status": "2", "task_status": "1",
"create_time": "2024-03-28 10:54:39", "carrier": "0033",
"carrier": '001', "task_no": "1800358896351711233",
"task_uuid": "012bc5e653ce48949020f1147333aa7f", "create_time": "2024-06-11 10:47:33",
"inst_step": "7", "task_status_name": "执行中",
"next_devicecode": "L1", "next_devicecode": "HCHJ01",
"start_devicecode": "RKSSX2", "start_devicecode": "CYHCX39",
"instruction_code": "163", "material_type_name": "",
"priority": "1" "task_uuid": "718e14a17b744a81bc51a51945355daa",
} "task_type": "1",
], "priority": "1"
"message": "操作成功" },
{
"material_type": "",
"task_status": "1",
"carrier": "3010",
"task_no": "1800768187059539969",
"create_time": "2024-06-12 13:56:04",
"task_status_name": "执行中",
"next_devicecode": "HNJ03DJW",
"start_devicecode": "KLHW19",
"material_type_name": "",
"task_uuid": "f8e5ab3341f64bee887f4acaf403a4be",
"task_type": "1",
"priority": "1"
},
{
"material_type": "",
"task_status": "1",
"carrier": "3011",
"task_no": "1800771496990347265",
"create_time": "2024-06-12 14:06:44",
"task_status_name": "执行中",
"next_devicecode": "KLHW36",
"start_devicecode": "HNJ03DJW",
"material_type_name": "",
"task_uuid": "177eb5d976d245efbe3d5d56c8e93e22",
"task_type": "1",
"priority": "1"
},
{
"material_type": "",
"task_status": "1",
"carrier": "4011",
"task_no": "1800773119993057281",
"create_time": "2024-06-12 14:15:54",
"task_status_name": "执行中",
"next_devicecode": "HNJ04DJW",
"start_devicecode": "KLHW23",
"material_type_name": "",
"task_uuid": "29053a22a18b489eb0af483d897c0468",
"task_type": "1",
"priority": "1"
},
{
"material_type": "",
"task_status": "1",
"carrier": "0030",
"task_no": "1800819807675879425",
"create_time": "2024-06-12 17:18:44",
"task_status_name": "执行中",
"next_devicecode": "RYHCX01",
"start_devicecode": "YJ02XLW02",
"material_type_name": "",
"task_uuid": "6f8642c70ee14bfc8d2699477fa977c7",
"task_type": "1",
"priority": "1"
},
{
"material_type": "",
"task_status": "0",
"carrier": "",
"task_no": "1800820183942696961",
"create_time": "2024-06-12 17:20:14",
"task_status_name": "就绪",
"next_devicecode": "YJ02XLW02",
"start_devicecode": "CPJCK",
"material_type_name": "",
"task_uuid": "f41e5bfb7b32472fa940a8085c1e6d5e",
"task_type": "1",
"priority": "1"
}
],
"code": "1",
"desc": "查询成功"
} }
return res return res
} }