|
|
@ -184,28 +184,20 @@
|
|
|
|
<el-col :span="2">
|
|
|
|
<el-col :span="2">
|
|
|
|
<div class="ao-text">
|
|
|
|
<div class="ao-text">
|
|
|
|
<el-link
|
|
|
|
<el-link
|
|
|
|
@click.native.stop="scanChange()"
|
|
|
|
|
|
|
|
target="_blank">{{ scanText }}
|
|
|
|
target="_blank">{{ scanText }}
|
|
|
|
</el-link>
|
|
|
|
</el-link>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="16">
|
|
|
|
<el-col :span="16">
|
|
|
|
<el-form-item prop="code">
|
|
|
|
<el-form-item prop="code">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-if="!isScan"
|
|
|
|
id="inputer"
|
|
|
|
@focus="getInputFocus($event)"
|
|
|
|
@focus="getInputFocus($event)"
|
|
|
|
@keypress.enter.native="enterKey($event)"
|
|
|
|
@keypress.enter.native="enterKey($event)"
|
|
|
|
ref='inputRef'
|
|
|
|
ref='inputRef'
|
|
|
|
|
|
|
|
style="ime-mode:disabled"
|
|
|
|
class="ime-disabled"
|
|
|
|
|
|
|
|
v-model="formData.code"
|
|
|
|
v-model="formData.code"
|
|
|
|
></el-input>
|
|
|
|
></el-input>
|
|
|
|
<!-- style="ime-mode:inactive"-->
|
|
|
|
|
|
|
|
<!-- class="ime-disabled"-->
|
|
|
|
|
|
|
|
<div id="inputer" tabindex="0" v-if="isScan"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <input type="text" id="inputer" ime-mode="disabled" tabindex="0">-->
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="2">
|
|
|
|
<el-col :span="2">
|
|
|
@ -497,11 +489,11 @@ export default {
|
|
|
|
this.formData.corpOrderId = this.formData.corpOrderId.trim();
|
|
|
|
this.formData.corpOrderId = this.formData.corpOrderId.trim();
|
|
|
|
this.actionEnable = true;
|
|
|
|
this.actionEnable = true;
|
|
|
|
if (event == null) {
|
|
|
|
if (event == null) {
|
|
|
|
// this.$refs.inputRef.focus();
|
|
|
|
|
|
|
|
var inputer = document.getElementById("inputer");
|
|
|
|
var inputer = document.getElementById("inputer");
|
|
|
|
this.formData.code = inputer.innerText.replace("\r", "");
|
|
|
|
this.formData.code = inputer.innerText.replace("\r", "");
|
|
|
|
inputer.focus();
|
|
|
|
inputer.focus();
|
|
|
|
} else event.target.select();
|
|
|
|
} else event.target.select();
|
|
|
|
|
|
|
|
this.$refs.inputRef.select();
|
|
|
|
if (this.$isBlank(this.formData.action)) {
|
|
|
|
if (this.$isBlank(this.formData.action)) {
|
|
|
|
this.$message.warning("请选择单据类型!");
|
|
|
|
this.$message.warning("请选择单据类型!");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -528,7 +520,7 @@ export default {
|
|
|
|
tQuery.action = this.formData.action;
|
|
|
|
tQuery.action = this.formData.action;
|
|
|
|
console.log(tQuery.action);
|
|
|
|
console.log(tQuery.action);
|
|
|
|
this.addCodeSubmit(tQuery);
|
|
|
|
this.addCodeSubmit(tQuery);
|
|
|
|
|
|
|
|
this.$refs.inputRef.select();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -633,7 +625,7 @@ export default {
|
|
|
|
this.isScan = !this.isScan;
|
|
|
|
this.isScan = !this.isScan;
|
|
|
|
if (this.isScan) {
|
|
|
|
if (this.isScan) {
|
|
|
|
this.scanText = "扫码录入:";
|
|
|
|
this.scanText = "扫码录入:";
|
|
|
|
document.getElementById("inputer").focus();
|
|
|
|
// document.getElementById("inputer").focus();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.scanText = "手动录入:";
|
|
|
|
this.scanText = "手动录入:";
|
|
|
|
// this.$refs.inputRef.focus();
|
|
|
|
// this.$refs.inputRef.focus();
|
|
|
@ -925,17 +917,13 @@ export default {
|
|
|
|
sc.onInput = function (text) {
|
|
|
|
sc.onInput = function (text) {
|
|
|
|
//onInput事件在检测到回车键按下或在连续输入后超过500ms没有继续输入时触发
|
|
|
|
//onInput事件在检测到回车键按下或在连续输入后超过500ms没有继续输入时触发
|
|
|
|
if (text.includes("delete")) {
|
|
|
|
if (text.includes("delete")) {
|
|
|
|
inputer.innerText = "";
|
|
|
|
|
|
|
|
that.formData.code = "";
|
|
|
|
that.formData.code = "";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (that.sitcomScan) {
|
|
|
|
if (that.sitcomScan) {
|
|
|
|
inputer.innerText = inputer.innerText + text;//.replace("\r", "")
|
|
|
|
that.formData.code = that.formData.code;
|
|
|
|
console.log(" inputer.innerText:" + inputer.innerText);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
inputer.innerText = text;
|
|
|
|
that.formData.code = text;
|
|
|
|
that.formData.code = inputer.innerText;
|
|
|
|
|
|
|
|
that.addCode(null);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
inputer.focus();//别忘了给要监听的节点放置焦点,如果是div一类默认不具备焦点的节点需要给它加上“tabindex”属性。不建议传入document、Body等全局节点,可能会影响其它输入控件的流畅性。
|
|
|
|
inputer.focus();//别忘了给要监听的节点放置焦点,如果是div一类默认不具备焦点的节点需要给它加上“tabindex”属性。不建议传入document、Body等全局节点,可能会影响其它输入控件的流畅性。
|
|
|
|