定点任务

This commit is contained in:
2022-11-23 16:32:24 +08:00
parent 3a525f7cc0
commit b2db8af681
4 changed files with 171 additions and 0 deletions

View File

@@ -97,3 +97,16 @@ export const bindingMaterialConfirm = (id, code, mname, pcsn, qty, vcode) => pos
qty: qty,
vehicle_code: vcode
})
/** 定点任务 */
// 1.1查询设备起点和终点
export const queryDevice = () => post('api/hand/queryDevice', {
})
// 1.2任务生成
export const handTask = (scode, ncode) => post('api/hand/task', {
start_devicecode: scode,
next_devicecode: ncode
})
// 1.3查询任务类型
export const taskType = () => post('api/hand/task_type', {
})

View File

@@ -24,6 +24,7 @@
<li @click="goInner('/SendEmptyPallet')">送空托盘</li>
<li @click="goInner('/CallEmptyPallet')">呼叫空托盘</li>
<li @click="goInner('/GroupPallet')">组盘</li>
<li @click="goInner('/FixedPointTask')">定点任务</li>
</ul>
</div>
</section>

View File

@@ -0,0 +1,152 @@
<template>
<section>
<nav-bar title="定点任务"></nav-bar>
<section class="content mgt186">
<div class="filter-wraper">
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">任务类型</div>
<div class="fxcol mgl20 visible" >
<dropdown-menu
:option="option1"
:active="active1"
:open="open1"
@toggleItem="toggleItem1"
@dropdownMenu="dropdownMenu1">
</dropdown-menu>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">起点</div>
<div class="fxcol mgl20 visible" >
<dropdown-menu
:option="option2"
:active="active2"
:open="open2"
@toggleItem="toggleItem2"
@dropdownMenu="dropdownMenu2">
</dropdown-menu>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">终点</div>
<div class="fxcol mgl20 visible" >
<dropdown-menu
:option="option3"
:active="active3"
:open="open3"
@toggleItem="toggleItem3"
@dropdownMenu="dropdownMenu3">
</dropdown-menu>
</div>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled':active2 === '' || active3 === ''}" :disabled="disabled1" @click="_handTask">确定</button>
<button class="btn submit-button" @click="toCancle">取消</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {taskType, queryDevice, handTask} from '@config/getData2.js'
export default {
name: 'FixedPointTask',
components: {
NavBar,
DropdownMenu
},
data () {
return {
option1: [],
active1: '',
open1: false,
option2: [],
active2: '',
open2: false,
option3: [],
active3: '',
open3: false,
disabled1: false
}
},
created () {
this._queryDevice()
},
methods: {
/** 查询类型 */
async _taskType () {
let res = await taskType()
this.option1 = [...res.result]
},
/** 查询点位 */
async _queryDevice () {
let res = await queryDevice()
this.option2 = [...res.result]
this.option2.map(el => {
this.$set(el, 'value', el.device_code)
this.$set(el, 'label', el.device_name)
})
this.option3 = [...this.option2]
},
/** 确认 */
async _handTask () {
this.disabled1 = true
if (this.active1 === '' || this.active2 === '' || this.active3 === '') {
this.disabled1 = false
return
}
try {
let res = await handTask(this.option1[this.active1].value, this.option2[this.active2].value, this.option3[this.active3].value)
this.toast(res.desc)
this.toCancle()
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
/** 取消 */
toCancle () {
this.active1 = ''
this.active2 = ''
this.active3 = ''
this.disabled1 = false
},
toggleItem1 () {
if (!this.open1) {
this.open1 = true
} else {
this.open1 = false
}
},
dropdownMenu1 (i) {
this.active1 = i + ''
this.open1 = false
},
toggleItem2 () {
if (!this.open2) {
this.open2 = true
} else {
this.open2 = false
}
},
dropdownMenu2 (i) {
this.active2 = i + ''
this.open2 = false
},
toggleItem3 () {
if (!this.open3) {
this.open3 = true
} else {
this.open3 = false
}
},
dropdownMenu3 (i) {
this.active3 = i + ''
this.open3 = false
}
}
}
</script>

View File

@@ -15,6 +15,7 @@ const EquipCallMater = r => require.ensure([], () => r(require('../pages/proj/Eq
const SendEmptyPallet = r => require.ensure([], () => r(require('../pages/proj/SendEmptyPallet')), 'SendEmptyPallet')
const CallEmptyPallet = r => require.ensure([], () => r(require('../pages/proj/CallEmptyPallet')), 'CallEmptyPallet')
const GroupPallet = r => require.ensure([], () => r(require('../pages/proj/GroupPallet')), 'GroupPallet')
const FixedPointTask = r => require.ensure([], () => r(require('../pages/proj/FixedPointTask')), 'FixedPointTask')
Vue.use(Router)
@@ -78,6 +79,10 @@ export default new Router({
{
path: '/GroupPallet', // 组盘
component: GroupPallet
},
{
path: '/FixedPointTask', // 定点任务
component: FixedPointTask
}
],
scrollBehavior (to, from, savedPosition) {