Files
hht-yongyu/src/pages/proj/SendEmptyPallet.vue
2022-09-09 09:24:37 +08:00

157 lines
4.2 KiB
Vue

<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="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>
<search-box
label="托盘"
v-model="val1"
:seaShow="false"
:disabled="isSpecial"
></search-box>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">数量</div>
<div class="fxcol mgl20">
<input type="number" class="filter-input filter-scan-input" v-model="val2">
</div>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled' :val2 === '' || active2 === '' || active3 === ''}" :disabled="disabled1" @click="_sendEmptyconfirm">确定</button>
<button class="btn submit-button" @click="toCancle">取消</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {sendEmptyqueryPoint, sendEmptyconfirm} from '@config/getData1'
export default {
name: 'SendEmptyPallet',
components: {
NavBar,
SearchBox,
DropdownMenu
},
data () {
return {
val1: '',
val2: '',
isSpecial: false,
option2: [],
active2: '',
open2: false,
option3: [],
active3: '',
open3: false,
disabled1: false
}
},
created () {
this._sendEmptyqueryPoint()
},
methods: {
/** 查询点位 */
async _sendEmptyqueryPoint () {
let res = await sendEmptyqueryPoint()
if (res.code === '1') {
this.option2 = [...res.result.regionja]
this.option2.map(el => {
this.$set(el, 'value', el.region_id)
this.$set(el, 'label', el.region_name)
})
} else {
this.Dialog(res.desc)
}
},
/** 确认 */
async _sendEmptyconfirm () {
this.disabled1 = true
if (this.val2 === '' || this.active2 === '' || this.active3 === '') {
this.disabled1 = false
return
}
try {
let res = await sendEmptyconfirm(this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code, this.val1, this.val2)
if (res.code === '1') {
this.toast(res.desc)
this.toCancle()
} else {
this.Dialog(res.desc)
}
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
/** 取消 */
toCancle () {
this.val2 = ''
this.active2 = ''
this.active3 = ''
this.disabled1 = false
},
toggleItem2 () {
if (!this.open2) {
this.open2 = true
} else {
this.open2 = false
}
},
dropdownMenu2 (i) {
this.active2 = i + ''
this.open2 = false
if (this.option2[this.active2].region_code === 'SSX01') {
this.val1 = ''
this.isSpecial = true
} else {
this.isSpecial = false
}
this.option3 = this.option2[this.active2].pointArr
this.option3.map(el => {
this.$set(el, 'value', el.point_id)
this.$set(el, 'label', el.point_name)
})
},
toggleItem3 () {
if (!this.open3) {
this.open3 = true
} else {
this.open3 = false
}
},
dropdownMenu3 (i) {
this.active3 = i + ''
this.open3 = false
}
}
}
</script>