mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
Close pin dialog (#1121)
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
2312711de4
commit
64a62b2e69
@ -311,12 +311,12 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
<el-dialog ref="dialog" :title="$t('form.pos.pinMessage.pin') + attributePin.label" width="40%" :visible.sync="visible">
|
<el-dialog ref="dialog" v-shortkey="{close: ['esc'], enter: ['enter']}" :title="$t('form.pos.pinMessage.pin') + attributePin.label" width="40%" :visible.sync="visible" @shortkey.native="theAction">
|
||||||
<el-input
|
<el-input
|
||||||
id="pin"
|
id="pin"
|
||||||
ref="pin"
|
ref="pin"
|
||||||
v-model="pin"
|
v-model="pin"
|
||||||
:autofocus="true"
|
autofocus
|
||||||
type="password"
|
type="password"
|
||||||
:placeholder="$t('form.pos.tableProduct.pin')"
|
:placeholder="$t('form.pos.tableProduct.pin')"
|
||||||
:focus="true"
|
:focus="true"
|
||||||
@ -477,21 +477,29 @@ export default {
|
|||||||
return this.currentPointOfSales.currentOrder
|
return this.currentPointOfSales.currentOrder
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// watch: {
|
watch: {
|
||||||
// visible(value) {
|
visible(value) {
|
||||||
// if (value && !this.isEmptyValue(this.$refs)) {
|
if (value && !this.isEmptyValue(this.$refs)) {
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
// this.focusPin()
|
this.focusPin()
|
||||||
// }, 500)
|
}, 300)
|
||||||
// } else {
|
}
|
||||||
// this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: value })
|
}
|
||||||
// }
|
},
|
||||||
// }
|
|
||||||
// },
|
|
||||||
created() {
|
created() {
|
||||||
this.findProcess(this.posProcess)
|
this.findProcess(this.posProcess)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
theAction(event) {
|
||||||
|
switch (event.srcKey) {
|
||||||
|
case 'enter':
|
||||||
|
this.openPin(this.pin)
|
||||||
|
break
|
||||||
|
case 'close':
|
||||||
|
this.closePin()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
closePin() {
|
closePin() {
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: false })
|
this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: false })
|
||||||
@ -501,6 +509,7 @@ export default {
|
|||||||
this.$refs.pin.focus()
|
this.$refs.pin.focus()
|
||||||
},
|
},
|
||||||
openPin(pin) {
|
openPin(pin) {
|
||||||
|
this.focusPin()
|
||||||
validatePin({
|
validatePin({
|
||||||
posUuid: this.currentPointOfSales.uuid,
|
posUuid: this.currentPointOfSales.uuid,
|
||||||
pin
|
pin
|
||||||
@ -526,6 +535,7 @@ export default {
|
|||||||
this.pin = ''
|
this.pin = ''
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
this.pin = ''
|
||||||
this.visible = false
|
this.visible = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
id="headerContainer"
|
id="headerContainer"
|
||||||
style="display: -webkit-box; height: 100%"
|
style="display: -webkit-box; height: 100%"
|
||||||
>
|
>
|
||||||
<el-container v-shortkey="{ closeForm: ['esc'] }" style="background: white; height: 100%!important;" @shortkey.native="keyActionClosePin">
|
<el-container style="background: white; height: 100%!important;">
|
||||||
<el-header
|
<el-header
|
||||||
height="auto"
|
height="auto"
|
||||||
:style="isShowedPOSKeyLayout ? 'padding-right: 20px; padding-left: 0px;' : 'padding-right: 0px; padding-left: 0px;'"
|
:style="isShowedPOSKeyLayout ? 'padding-right: 20px; padding-left: 0px;' : 'padding-right: 0px; padding-left: 0px;'"
|
||||||
@ -214,16 +214,15 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-dialog ref="dialog" v-shortkey="{ closeForm: ['esc'] }" :title="$t('form.pos.pinMessage.pin') + infowOverdrawnInvoice.label" width="40%" :visible.sync="visible" @shortkey.native="keyActionClosePin">
|
<el-dialog ref="dialog" v-shortkey="{close: ['esc'], enter: ['enter']}" :title="$t('form.pos.pinMessage.pin') + infowOverdrawnInvoice.label" width="40%" :visible.sync="visible" @shortkey.native="theAction">
|
||||||
<el-input
|
<el-input
|
||||||
id="pin"
|
id="pin"
|
||||||
ref="pin"
|
ref="pin"
|
||||||
v-model="pin"
|
v-model="pin"
|
||||||
:autofocus="true"
|
autofocus
|
||||||
type="password"
|
type="password"
|
||||||
:placeholder="$t('form.pos.tableProduct.pin')"
|
:placeholder="$t('form.pos.tableProduct.pin')"
|
||||||
:focus="true"
|
:focus="true"
|
||||||
@change="openPin(pin)"
|
|
||||||
/>
|
/>
|
||||||
<span style="float: right;">
|
<span style="float: right;">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -218,6 +218,16 @@ export default {
|
|||||||
formatDate,
|
formatDate,
|
||||||
formatPrice,
|
formatPrice,
|
||||||
formatQuantity,
|
formatQuantity,
|
||||||
|
theAction(event) {
|
||||||
|
switch (event.srcKey) {
|
||||||
|
case 'enter':
|
||||||
|
this.openPin(this.pin)
|
||||||
|
break
|
||||||
|
case 'close':
|
||||||
|
this.closePin()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
openPin(pin) {
|
openPin(pin) {
|
||||||
validatePin({
|
validatePin({
|
||||||
posUuid: this.currentPointOfSales.uuid,
|
posUuid: this.currentPointOfSales.uuid,
|
||||||
@ -245,6 +255,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.visible = false
|
this.visible = false
|
||||||
|
this.pin = ''
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
pinAction(action) {
|
pinAction(action) {
|
||||||
@ -309,6 +320,7 @@ export default {
|
|||||||
},
|
},
|
||||||
closePin() {
|
closePin() {
|
||||||
this.visible = false
|
this.visible = false
|
||||||
|
this.pin = ''
|
||||||
this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: false })
|
this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: false })
|
||||||
this.setDocumentType(this.currentOrder.documentType)
|
this.setDocumentType(this.currentOrder.documentType)
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user