This commit is contained in:
2023-12-11 17:57:30 +08:00
parent 345b93891f
commit fc85dd6175

View File

@@ -11,22 +11,67 @@
</div>
</div>
<div class="box2 buttons_wrapper">
<button class="button_control" @click="toSure('3')"><p>{{ $t('carrypoint.button1') }}</p></button>
<button class="button_control" @click="toSure('4')"><p>{{ $t('carrypoint.button2') }}</p></button>
<button class="button_control" @click="toSure('1')"><p>{{ $t('carrypoint.button3') }}</p></button>
<button class="button_control" @click="toSure('1')"><p>{{ $t('carrypoint.button4') }}</p></button>
<button class="button_control" @click="toSure(selectObj.point_code, '3')"><p>{{ $t('carrypoint.button1') }}</p></button>
<button class="button_control" @click="toSure(selectObj.point_code, '4')"><p>{{ $t('carrypoint.button2') }}</p></button>
<button class="button_control" @click="showDialog('1')"><p>{{ $t('carrypoint.button3') }}</p></button>
<button class="button_control" @click="toSure(selectObj.point_code, '1')"><p>{{ $t('carrypoint.button4') }}</p></button>
</div>
</div>
<jxDialog
ref="child"
:title="$t('carrypoint.dialoginfo')"
:type="type"
:unclick="unclick"
@toSure="toSureDialog"
@toCancle="toCancle"
>
<div v-if="type === '1' || type === '2'" class="form_wraper">
<div class="form">
<div class="form_item">
<div class="form_item__label"><i>*</i>{{ $t('carrypoint.pointcode') }}</div>
<div class="form_item__content">
<!-- <input type="text" class="form_item__input" v-model="pointcode" @focus="show" data-layout="normal"> -->
<keyboard-input
inputClass="form_item__input"
keyboardClass="pointcode"
:value="pointcode"
@inputChange="inputChange1"
@inputFocus="inputFocus"
></keyboard-input>
</div>
</div>
</div>
</div>
</jxDialog>
</div>
<vue-touch-keyboard id="keyboard" :options="keyoptions" v-if="visible" :layout="layout" :cancel="hide" :accept="accept" :input="input" :next="next" />
</div>
</template>
<script>
import jxDialog from '@components/dialog.vue'
import KeyboardInput from '@components/keyboard-input'
import {queryPoint, confirmPoint} from '@/config/getData.js'
export default {
name: 'CarryPoint',
components: {
jxDialog,
KeyboardInput
},
data () {
return {
type: '',
title: '',
pointcode: '',
unclick: false,
disabled: false,
visible: false,
layout: 'normal',
input: null,
keyoptions: {
useKbEvents: false,
preventClickEvent: false
},
statusbg: false,
pkId: '',
selectObj: {},
@@ -159,6 +204,39 @@ export default {
this.initData()
},
methods: {
showDialog (type, e) {
this.type = type
this.$refs.child.active = true
switch (type) {
case '1':
this.pointcode = ''
this.remark = ''
this.unclick = true
break
}
},
toSureDialog (type) {
switch (type) {
case '1':
this.confirmPoint(this.pointcode, '1')
break
}
this.hide()
},
toCancle () {
this.hide()
},
inputFocus () {
this.visible = false
},
hide () {
this.visible = false
},
inputChange1 (val) {
// this.pointcode = val
// 限制只能输入数字
this.pointcode = val.replace(/[^\d]/g, '')
},
// 这个接口需要放到agv上去才行
async initData () {
let res = await queryPoint()
@@ -168,8 +246,8 @@ export default {
this.toast(res.desc)
}
},
async confirmPoint (type) {
let res = await confirmPoint(this.selectObj.point_code, type)
async confirmPoint (pcode, type) {
let res = await confirmPoint(pcode, type)
if (res.code === '1') {
this.toast(res.desc)
this.selectObj = {}
@@ -232,8 +310,8 @@ export default {
background center / 100% 100% url(../../../images/new/bg1.png) no-repeat !important
.box2
position fixed
left 300px
left 310px
bottom 50px
.button_control p
font-size 28px
.enClass .button_control p
font-size 28px
</style>