初步增加扫码功能
This commit is contained in:
@@ -22,6 +22,8 @@ export const BillModalMixin = {
|
|||||||
accountIdList: [],
|
accountIdList: [],
|
||||||
accountMoneyList: [],
|
accountMoneyList: [],
|
||||||
billUnitPirce: '',
|
billUnitPirce: '',
|
||||||
|
scanBarCode: '',
|
||||||
|
scanStatus: true,
|
||||||
spans: {
|
spans: {
|
||||||
labelCol1: {span: 2},
|
labelCol1: {span: 2},
|
||||||
wrapperCol1: {span: 22},
|
wrapperCol1: {span: 22},
|
||||||
@@ -505,6 +507,16 @@ export const BillModalMixin = {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue({'debt':debtNew})
|
this.form.setFieldsValue({'debt':debtNew})
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
scanEnter() {
|
||||||
|
this.scanStatus = false
|
||||||
|
},
|
||||||
|
scanPressEnter() {
|
||||||
|
console.log(this.scanBarCode)
|
||||||
|
},
|
||||||
|
stopScan() {
|
||||||
|
this.scanStatus = true
|
||||||
|
this.scanBarCode = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,21 @@
|
|||||||
:actionButton="true"
|
:actionButton="true"
|
||||||
@valueChange="onValueChange"
|
@valueChange="onValueChange"
|
||||||
@added="onAdded"
|
@added="onAdded"
|
||||||
@deleted="onDeleted" />
|
@deleted="onDeleted">
|
||||||
|
<template #buttonAfter>
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col v-if="scanStatus" :md="6" :sm="24">
|
||||||
|
<a-button @click="scanEnter">扫码录入</a-button>
|
||||||
|
</a-col>
|
||||||
|
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
|
||||||
|
<a-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" />
|
||||||
|
</a-col>
|
||||||
|
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||||
|
<a-button @click="stopScan">收起扫码</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</template>
|
||||||
|
</j-editable-table>
|
||||||
<a-row class="form-row" :gutter="24">
|
<a-row class="form-row" :gutter="24">
|
||||||
<a-col :lg="24" :md="24" :sm="24">
|
<a-col :lg="24" :md="24" :sm="24">
|
||||||
<a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="">
|
<a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="">
|
||||||
|
|||||||
Reference in New Issue
Block a user