组盘解盘功能优化

This commit is contained in:
2024-03-23 16:54:11 +08:00
parent 5e8b9adb6c
commit b8ddbb2c50
3 changed files with 69 additions and 44 deletions

View File

@@ -1,57 +1,55 @@
<template> <template>
<div class="md-modal" v-if="mdShow"> <div>
<transition name="bounce"> <div class="modal-inner" :class="mdShow ? 'popshow' : 'pophide'">
<div class="modal-inner"> <div class="modal_line"></div>
<div class="modal-content"> <div class="modal-content">
<!-- <div class="modal-message">{{question}}</div> --> <slot></slot>
<slot></slot>
</div>
<div class="mgt15 fxrow">
<button class="fxcol btn btn-disabled submit-button" @click="closeModal">取消</button>
<button class="btn btn-disabled submit-button bl1px" v-if="comfirmDisable">确认</button>
<button class="btn submit-button" v-if="!comfirmDisable" @click="comfirm">确认</button>
</div>
</div>
</transition>
<transition name="fade">
<div class="overlay"></div>
</transition>
</div> </div>
<div class="submit-bar">
<button class="btn submit-button" @click="closeModal">取消</button>
<button class="btn submit-button" @click="comfirm">确认</button>
</div>
</div>
<div v-show="mdShow" class="overlay"></div>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'Modal', name: 'Modal',
props: { props: {
// question: String, mdShow: Boolean
mdShow: Boolean,
comfirmDisable: Boolean,
type: String
}, },
methods: { methods: {
closeModal () { closeModal () {
this.$emit('closeModalCallback') this.$emit('closeModalCallback')
}, },
comfirm () { comfirm () {
this.$emit('comfirmCallback', this.type) this.$emit('comfirmCallback')
} }
} }
} }
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
.popshow
transform translateY(0)
.pophide
transform translateY(100%)
.modal-inner .modal-inner
position fixed position: fixed;
top 50% top: auto;
left 50% bottom: 0
width 80% left: 0;
font-size .28rem width: 100%;
overflow hidden // height: 50%;
transition .3s padding: .2rem;
border-radius 4px background-color: #fff;
background-color #fff box-shadow: 0 -.8rem .16rem 0 rgba(28,31,33,.1);
transform translate3d(-50%, -50%, 0) border-top-left-radius: .2rem;
z-index 2018 border-top-right-radius: .2rem;
z-index: 301;
transition: all .3s;
.overlay .overlay
position fixed position fixed
top 0 top 0
@@ -60,10 +58,18 @@ export default {
height 100% height 100%
background-color rgba(0, 0, 0, .7) background-color rgba(0, 0, 0, .7)
z-index 11 z-index 11
>>>.btn .modal_line
border-radius 0 width 1rem
>>>.submit-button height .1rem
margin 0 background-color #e0e0e1
.bl1px border-radius .6rem
border-left 1px solid #fff margin 0 auto 1rem auto
.modal-content
font-size .34rem
color #000
line-height .4rem
margin 0 .15rem 1rem .15rem
.submit-bar
position static
box-shadow none
</style> </style>

View File

@@ -127,7 +127,11 @@ export default {
try { try {
let res = await rfReadMatBarCodeStatePackage(this.val1, val) let res = await rfReadMatBarCodeStatePackage(this.val1, val)
if (res.ErrNO === '1') { if (res.ErrNO === '1') {
this.open = true if (this.active === '') {
this.open = true
} else {
this._rfTrayPackage()
}
} else { } else {
this.toast(res.ErrMsg) this.toast(res.ErrMsg)
this.val2 = '' this.val2 = ''
@@ -184,7 +188,6 @@ export default {
this._rfReadTrayStoragePackage() this._rfReadTrayStoragePackage()
this.toast(res.ErrMsg) this.toast(res.ErrMsg)
this.val2 = '' this.val2 = ''
this.active = ''
this.$refs.myInput2.handleScan() this.$refs.myInput2.handleScan()
} else { } else {
this.Dialog(res.ErrMsg) this.Dialog(res.ErrMsg)

View File

@@ -40,27 +40,33 @@
</div> </div>
</section> </section>
<section class="submit-bar"> <section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled' : !val1}" :disabled="disabled" @click="_rfTrayUnPackage">解盘</button> <button class="btn submit-button" :class="{'btn-disabled' : !val1}" :disabled="disabled" @click="toSure">解盘</button>
<button class="btn submit-button" @click="toCancle">取消</button> <button class="btn submit-button" @click="toCancle">取消</button>
</section> </section>
<modal :mdShow="mdShow" @closeModalCallback="closeModalCallback" @comfirmCallback="comfirmCallback">
是否确认解盘
</modal>
</section> </section>
</template> </template>
<script> <script>
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import SearchBox from '@components/SearchBox.vue'
import Modal from '../../components/Modal.vue'
import {rfReadTrayStateUnPackage, rfReadTrayStorageUnPackage, rfTrayUnPackage} from '@config/getData2' import {rfReadTrayStateUnPackage, rfReadTrayStorageUnPackage, rfTrayUnPackage} from '@config/getData2'
export default { export default {
name: 'GroupDisk', name: 'GroupDisk',
components: { components: {
NavBar, NavBar,
SearchBox SearchBox,
Modal
}, },
data () { data () {
return { return {
val1: '', val1: '',
dataList: [], dataList: [],
disabled: false disabled: false,
mdShow: false
} }
}, },
mounted () { mounted () {
@@ -106,6 +112,9 @@ export default {
this._rfReadTrayStateUnPackage(e) this._rfReadTrayStateUnPackage(e)
} }
}, },
toSure () {
this.mdShow = true
},
/** 解盘 */ /** 解盘 */
async _rfTrayUnPackage () { async _rfTrayUnPackage () {
this.disabled = true this.disabled = true
@@ -136,6 +145,13 @@ export default {
this.dataList = [] this.dataList = []
this.disabled = false this.disabled = false
this.$refs.myInput1.handleScan() this.$refs.myInput1.handleScan()
},
closeModalCallback () {
this.mdShow = false
},
comfirmCallback () {
this.mdShow = false
this._rfTrayUnPackage()
} }
} }
} }