定点作业

This commit is contained in:
2022-11-28 18:25:59 +08:00
parent 85bfebaf72
commit c65400bf41
3 changed files with 193 additions and 17 deletions

View File

@@ -152,6 +152,7 @@ export default {
.dropdown-menu__title_2
line-height .9rem
max-width 1.4rem
background-color #e5e5e5
&::after
right .16rem
.dropdown-menu__title_up

View File

@@ -103,12 +103,20 @@ export const bindingMaterialConfirm = (id, code, mname, pcsn, qty, vcode) => pos
export const queryDevice = () => post2('api/hand/queryDevice', {
})
// 1.2任务生成
export const handTask = (type, num, scode, ncode) => post2('api/hand/task', {
export const handTask = (type, num, scode, fy, fz, ncode, ty, tz) => post2('api/hand/task', {
task_type: type,
emptypallet_num: num,
start_devicecode: scode,
next_devicecode: ncode
form_y: fy,
form_z: fz,
next_devicecode: ncode,
to_y: ty,
to_z: tz
})
// 1.3查询任务类型
export const taskType = () => post2('api/hand/task_type', {
})
// 1.4查询货架点位的列、层
export const storageCode = (code) => post2('api/hand/queryStorageExtra', {
storage_code: code
})

View File

@@ -37,6 +37,26 @@
</dropdown-menu>
</div>
</div>
<div v-show="startShow" class="bottom-filter-tip">
<div class="filter-label txtjustify">起点列</div>
<div class="fxcol mgl20 visible torow">
<dropdown-menu
:option="option4"
:active="active4"
:open="open4"
@toggleItem="toggleItem4"
@dropdownMenu="dropdownMenu4">
</dropdown-menu>
<div class="filter-label filter-label_1 txtjustify">起点层</div>
<dropdown-menu
:option="option5"
:active="active5"
:open="open5"
@toggleItem="toggleItem5"
@dropdownMenu="dropdownMenu5">
</dropdown-menu>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">终点</div>
<div class="fxcol mgl20 visible" >
@@ -53,10 +73,30 @@
</dropdown-menu>
</div>
</div>
<div v-show="endShow" class="bottom-filter-tip">
<div class="filter-label txtjustify">终点列</div>
<div class="fxcol mgl20 visible torow">
<dropdown-menu
:option="option6"
:active="active6"
:open="open6"
@toggleItem="toggleItem6"
@dropdownMenu="dropdownMenu6">
</dropdown-menu>
<div class="filter-label filter-label_1 txtjustify">终点层</div>
<dropdown-menu
:option="option7"
:active="active7"
:open="open7"
@toggleItem="toggleItem7"
@dropdownMenu="dropdownMenu7">
</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" :class="{'btn-disabled':active1 === '' || active2 === '' || active3 === ''}" :disabled="disabled1" @click="_handTask">确定</button>
<button class="btn submit-button" @click="toCancle">取消</button>
</section>
</section>
@@ -65,7 +105,7 @@
<script>
import NavBar from '@components/NavBar.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {taskType, queryDevice, handTask} from '@config/getData2.js'
import {taskType, queryDevice, handTask, storageCode} from '@config/getData2.js'
export default {
name: 'FixedPointTask',
components: {
@@ -80,17 +120,33 @@ export default {
option2: [],
optionNew2: [],
val2: '',
startCode: '',
scode: '',
startType: '',
active2: '',
open2: false,
option3: [],
optionNew3: [],
val3: '',
endCode: '',
ecode: '',
endType: '',
active3: '',
open3: false,
disabled1: false,
val4: '1'
val4: '1',
startShow: false,
option4: [],
active4: '',
open4: false,
option5: [],
active5: '',
open5: false,
endShow: false,
option6: [],
active6: '',
open6: false,
option7: [],
active7: '',
open7: false
}
},
created () {
@@ -115,16 +171,16 @@ export default {
},
/** 确认 */
async _handTask () {
this.disabled1 = true
if (this.val4 <= 0) {
this.val4 = 1
}
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.val4, this.startCode, this.endCode)
let res = await handTask(this.option1[this.active1].value, this.val4, this.scode, this.option4[this.active4].value, this.option5[this.active5].value, this.ecode, this.option6[this.active6].value, this.option7[this.active7].value)
this.toast(res.desc)
this.toCancle()
this.disabled1 = false
@@ -137,12 +193,20 @@ export default {
this.active1 = ''
this.active2 = ''
this.active3 = ''
this.active4 = ''
this.active5 = ''
this.active6 = ''
this.active7 = ''
this.disabled1 = false
this.val2 = ''
this.startCode = ''
this.startType = ''
this.scode = ''
this.val3 = ''
this.endCode = ''
this.endType = ''
this.ecode = ''
this.val4 = '1'
this.startShow = false
this.endShow = false
},
toggleItem1 () {
if (!this.open1) {
@@ -173,7 +237,8 @@ export default {
handleBlur2 () {
this.open2 = false
this.val2 = ''
this.startCode = ''
this.startType = ''
this.scode = ''
},
toggleItem2 () {
if (!this.open2) {
@@ -187,8 +252,19 @@ export default {
this.active2 = i + ''
this.open2 = false
if (this.optionNew2.length > 0) {
this.val2 = this.optionNew2[i].label
this.startCode = this.optionNew2[i].value
this.val2 = this.optionNew2[i].value
this.startType = this.optionNew2[i].device_type
this.scode = this.val2
if (this.startType === 'storage') {
this._storageCode(this.val2, 1)
this.startShow = true
} else {
this.active4 = ''
this.active5 = ''
this.option4 = []
this.option5 = []
this.startShow = false
}
}
},
handleChange3 (e) {
@@ -199,7 +275,8 @@ export default {
handleBlur3 () {
this.open3 = false
this.val3 = ''
this.endCode = ''
this.endType = ''
this.ecode = ''
},
toggleItem3 () {
if (!this.open3) {
@@ -213,10 +290,100 @@ export default {
this.active3 = i + ''
this.open3 = false
if (this.optionNew3.length > 0) {
this.val3 = this.optionNew3[i].label
this.endCode = this.optionNew3[i].value
this.val3 = this.optionNew3[i].value
this.endType = this.optionNew3[i].device_type
this.ecode = this.val3
if (this.endType === 'storage') {
this._storageCode(this.val3, 2)
this.endShow = true
} else {
this.active6 = ''
this.active7 = ''
this.option6 = []
this.option7 = []
this.endShow = false
}
}
},
/** 查询类型 */
async _storageCode (e, type) {
let res = await storageCode(e)
if (type === 1) {
this.option4 = this.buildArray(res.minY, res.maxY)
this.option5 = this.buildArray(res.minZ, res.maxZ)
} else {
this.option6 = this.buildArray(res.minY, res.maxY)
this.option7 = this.buildArray(res.minZ, res.maxZ)
}
},
/** 建数组 */
buildArray (min, max) {
let arr = []
let i = min
while (Number(i) <= Number(max)) {
if (Number(i) < 10) {
arr.push({value: '0' + i, label: '0' + i})
} else {
arr.push({value: i, label: i})
}
i++
}
return arr
},
toggleItem4 () {
if (!this.open4) {
this.open4 = true
} else {
this.open4 = false
}
},
dropdownMenu4 (i) {
this.active4 = i + ''
this.open4 = false
},
toggleItem5 () {
if (!this.open5) {
this.open5 = true
} else {
this.open5 = false
}
},
dropdownMenu5 (i) {
this.active5 = i + ''
this.open5 = false
},
toggleItem6 () {
if (!this.open6) {
this.open6 = true
} else {
this.open6 = false
}
},
dropdownMenu6 (i) {
this.active6 = i + ''
this.open6 = false
},
toggleItem7 () {
if (!this.open7) {
this.open7 = true
} else {
this.open7 = false
}
},
dropdownMenu7 (i) {
this.active7 = i + ''
this.open7 = false
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
.torow
_fj()
.filter-label
width 1.2rem
.filter-label_1
margin 0 .2rem
</style>