This commit is contained in:
2022-09-08 17:38:55 +08:00
parent 68b4f08c51
commit 84c05bb8e2
6 changed files with 202 additions and 190 deletions

View File

@@ -5,18 +5,6 @@
<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"
@@ -27,15 +15,34 @@
</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="option2[this.active2].region_code === 'SSX01'"
></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' : val1 === '' || active1 === '' || active2 === ''}" :disabled="disabled1" @click="_sendEmptyconfirm">确定</button>
<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>
@@ -43,54 +50,45 @@
<script>
import NavBar from '@components/NavBar.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import SearchBox from '@components/SearchBox.vue'
import {sendEmptyqueryArea, sendEmptyqueryPointByArea, sendEmptyconfirm} from '@config/getData1'
import DropdownMenu from '@components/DropdownMenu.vue'
import {sendEmptyqueryPoint, sendEmptyconfirm} from '@config/getData1'
export default {
name: 'SendEmptyPallet',
components: {
NavBar,
DropdownMenu,
SearchBox
SearchBox,
DropdownMenu
},
data () {
return {
val1: '',
option1: [],
active1: '',
open1: false,
val2: '',
option2: [],
active2: '',
open2: false,
option3: [],
active3: '',
open3: false,
disabled1: false
}
},
created () {
this._sendEmptyqueryArea()
this._sendEmptyqueryPoint()
},
methods: {
/** 查询区域 */
async _sendEmptyqueryArea () {
let res = await sendEmptyqueryArea()
if (res.code === '1') {
this.option1 = [...res.result]
this.option1.map(el => {
this.$set(el, 'value', el.area_code)
this.$set(el, 'label', el.area_name)
})
} else {
this.Dialog(res.desc)
}
},
/** 查询点位 */
async _sendEmptyqueryPointByArea (a) {
let res = await sendEmptyqueryPointByArea(a)
async _sendEmptyqueryPoint () {
let res = await sendEmptyqueryPoint()
if (res.code === '1') {
this.option2 = [...res.result]
this.option2 = [...res.result.regionja]
this.option2.map(el => {
this.$set(el, 'value', el.point_id)
this.$set(el, 'label', el.point_name)
this.$set(el, 'value', el.region_id)
this.$set(el, 'label', el.region_name)
})
if (this.option2[this.active2].region_code === 'SSX01') {
this.val1 = ''
}
} else {
this.Dialog(res.desc)
}
@@ -98,12 +96,12 @@ export default {
/** 确认 */
async _sendEmptyconfirm () {
this.disabled1 = true
if (this.val1 === '' || this.active1 === '') {
if (this.val2 === '' || this.active2 === '' || this.active3 === '') {
this.disabled1 = false
return
}
try {
let res = await sendEmptyconfirm(this.option2[this.active2].point_id, this.option2[this.active2].point_code, this.option2[this.active2].point_name, this.val1)
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()
@@ -117,23 +115,11 @@ export default {
},
/** 取消 */
toCancle () {
this.val1 = ''
this.active1 = ''
this.val2 = ''
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
this._sendEmptyqueryPointByArea(this.option1[this.active1].area_code)
},
toggleItem2 () {
if (!this.open2) {
this.open2 = true
@@ -144,6 +130,22 @@ export default {
dropdownMenu2 (i) {
this.active2 = i + ''
this.open2 = 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
}
}
}