给单据增加回车事件
This commit is contained in:
@@ -1429,6 +1429,9 @@
|
||||
this.$nextTick(() => {
|
||||
tbody.scrollTop = tbody.scrollHeight
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.autoJumpNextInputBill('billModal')
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 在指定位置添加一行
|
||||
@@ -2739,8 +2742,55 @@
|
||||
return content.substr(0,len)
|
||||
}
|
||||
return content;
|
||||
},
|
||||
/** 回车后自动跳到下一个input **/
|
||||
autoJumpNextInputBill(domInfo) {
|
||||
let that = this
|
||||
let domIndex = 0
|
||||
let inputs = document.getElementById(domInfo).getElementsByTagName('input')
|
||||
inputs[domIndex].focus()
|
||||
document.getElementById(domInfo).addEventListener('keydown',function(e){
|
||||
if(e.keyCode === 13){
|
||||
domIndex++
|
||||
if(domIndex === inputs.length) {
|
||||
domIndex = 0
|
||||
that.handleClickAdd()
|
||||
}
|
||||
inputs[domIndex].focus()
|
||||
}
|
||||
})
|
||||
for(let i=0; i<inputs.length; i++){
|
||||
//这个index就是做个介质,来获取当前的i是第几个
|
||||
inputs[i].index = i;
|
||||
inputs[i].onclick = function () {
|
||||
domIndex = this.index
|
||||
}
|
||||
inputs[i].onselect = function () {
|
||||
domIndex = this.index
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 自动选中特殊的key **/
|
||||
autoSelectBySpecialKey(specialKey) {
|
||||
let trs = this.getElement('tbody').getElementsByClassName('tr')
|
||||
let trEls = []
|
||||
for (let tr of trs) {
|
||||
trEls.push(tr)
|
||||
}
|
||||
trEls.forEach(tr => {
|
||||
let { idx } = tr.dataset
|
||||
let value = this.inputValues[idx]
|
||||
for (let key in value) {
|
||||
if (value.hasOwnProperty(key)) {
|
||||
let elid = `${key}${value.id}`
|
||||
let el = document.getElementById(elid)
|
||||
if (el && key === specialKey) {
|
||||
el.select()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.destroyCleanGroupRequest = true
|
||||
|
||||
@@ -306,7 +306,10 @@
|
||||
},
|
||||
onSearch() {
|
||||
if(this.dataSource && this.dataSource.length===1) {
|
||||
if(this.queryParam.q === this.dataSource[0].mBarCode) {
|
||||
if(this.queryParam.q === this.dataSource[0].mBarCode||
|
||||
this.queryParam.q === this.dataSource[0].name||
|
||||
this.queryParam.q === this.dataSource[0].standard||
|
||||
this.queryParam.q === this.dataSource[0].model) {
|
||||
let arr = []
|
||||
arr.push(this.dataSource[0].id)
|
||||
this.selectedRowKeys = arr
|
||||
|
||||
@@ -326,6 +326,7 @@ export const BillModalMixin = {
|
||||
that.getStockByDepotBarCode(row, target)
|
||||
target.recalcAllStatisticsColumns()
|
||||
that.autoChangePrice(target)
|
||||
target.autoSelectBySpecialKey('operNumber')
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -655,6 +656,7 @@ export const BillModalMixin = {
|
||||
}
|
||||
//置空扫码的内容
|
||||
this.scanBarCode = ''
|
||||
this.$refs.scanBarCode.focus()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<a-col :lg="6" :md="12" :sm="24"></a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24"></a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -51,7 +51,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<a-col :lg="6" :md="12" :sm="24"></a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24"></a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -51,7 +51,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<a-col :lg="6" :md="12" :sm="24"></a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24"></a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -51,7 +51,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24"></a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -66,7 +66,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24"></a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -66,7 +66,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -70,7 +70,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<j-editable-table id="purchaseInModal"
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -74,7 +74,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
@@ -178,7 +178,7 @@
|
||||
import { FormTypes } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
import { BillModalMixin } from '../mixins/BillModalMixin'
|
||||
import { getMpListShort, changeListFmtMinus,handleIntroJs,autoJumpNextInput } from "@/utils/util"
|
||||
import { getMpListShort, changeListFmtMinus,handleIntroJs } from "@/utils/util"
|
||||
import { getAction } from '@/api/manage'
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
@@ -324,9 +324,6 @@
|
||||
let url = this.readOnly ? this.url.detailList : this.url.detailList;
|
||||
this.requestSubTableData(url, params, this.materialTable);
|
||||
}
|
||||
setTimeout(function() {
|
||||
autoJumpNextInput('purchaseInModal')
|
||||
},100)
|
||||
//复制新增单据-初始化单号和日期
|
||||
if(this.action === 'copyAdd') {
|
||||
this.model.id = ''
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24"></a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -67,7 +67,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</a-row>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :lg="18" :md="12" :sm="24">
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -73,7 +73,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</a-row>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :lg="18" :md="12" :sm="24">
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -80,7 +80,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -70,7 +70,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -73,7 +73,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="billModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -75,7 +75,7 @@
|
||||
<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-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
|
||||
</a-col>
|
||||
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
|
||||
<a-button @click="stopScan">收起扫码</a-button>
|
||||
|
||||
Reference in New Issue
Block a user