单据扫码,流向查询,扫码拦截问题

master
anthonywj 3 years ago
parent 53375967c0
commit 8fc8a93dec

@ -1,4 +1,4 @@
{ {
"BASE_URL": "http://139.159.187.130/SPMS_SERVER", "BASE_URL": "http://192.168.0.109:9996",
"SERVER_IP": "http://192.168.0.109:9996" "SERVER_IP": "http://192.168.0.109:9996"
} }

@ -96,7 +96,7 @@ const KeyScaner = /** @class */ (function () {
KeyScaner.prototype.onTick = function () { KeyScaner.prototype.onTick = function () {
if (this.keybufs && this.keybufs.length > 0 && (!this.altBuf || this.altBuf.length == 0) && new Date().getTime() - this.lastTime > 500) { if (this.keybufs && this.keybufs.length > 0 && (!this.altBuf || this.altBuf.length == 0) && new Date().getTime() - this.lastTime > 500) {
//有缓存的字符且没有缓存的alt字符 且 与上次按键时间超过500毫秒。 收集输入 //有缓存的字符且没有缓存的alt字符 且 与上次按键时间超过500毫秒。 收集输入
this.completeInput(); // this.completeInput();
} }
}; };
/** /**

@ -395,6 +395,14 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
thirdId: {
type: Object,
required: true,
},
idSpliUdi: {
type: Object,
required: true,
}
}, },
data() { data() {
@ -412,9 +420,11 @@ export default {
}, },
combineLoading: false, combineLoading: false,
combineQuery: { combineQuery: {
idSpliUdi: false,
thirdId: "", thirdId: "",
relId: "", relId: "",
erpName: "", erpName: "",
thirdName:null,
keys: [], keys: [],
}, },
checked: true, checked: true,
@ -607,7 +617,11 @@ export default {
}, },
combine() { combine() {
if (this.idSpliUdi) {
this.combineQuery.idSpliUdi = true;
this.combineQuery.thirdId = this.thirdId;
this.combineQuery.erpName = this.data.thirdName;
}
combineUdi(this.combineQuery) combineUdi(this.combineQuery)
.then((response) => { .then((response) => {
this.combineLoading = false; this.combineLoading = false;

@ -75,10 +75,10 @@
>选入产品 >选入产品
</el-button </el-button
> >
<!-- <el-button type="primary" icon="search" @click="intentImportErp"--> <!-- <el-button type="primary" icon="search" @click="intentImportErp"-->
<!-- >添加产品信息--> <!-- >添加产品信息-->
<!-- </el-button--> <!-- </el-button-->
<!-- >--> <!-- >-->
<!-- <el-button type="primary" @click="addProductVisible=true"></el-button>--> <!-- <el-button type="primary" @click="addProductVisible=true"></el-button>-->
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
@ -185,8 +185,8 @@
v-if="isSpCombine" v-if="isSpCombine"
type="text" type="text"
size="small" size="small"
:disabled="scope.row.thirdId==scope.row.nameCode" :disabled="scope.row.thirdId==scope.row.nameCode || scope.row.thirdId==null || scope.row.nameCode==null"
@click.native.stop="intentImportErp(scope.row)" @click.native.stop="splitSelectUdi(scope.row)"
>拆分产品 >拆分产品
</el-button> </el-button>
@ -1302,11 +1302,15 @@
<selectLocalUdi <selectLocalUdi
:closeDialog="closeDialog" :closeDialog="closeDialog"
:relId="relId" :relId="relId"
:thirdId="thirdId"
:idSpliUdi="idSpliUdi"
:isImportUdi="isImportUdi" :isImportUdi="isImportUdi"
:data="thisData" :data="thisData"
@closeUdi="closeUdi" @closeUdi="closeUdi"
></selectLocalUdi> ></selectLocalUdi>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
title="选入产品信息" title="选入产品信息"
:visible.sync="selectProductVisible" :visible.sync="selectProductVisible"
@ -1385,6 +1389,7 @@ export default {
filterType: null, filterType: null,
auditStatus: null, auditStatus: null,
}, },
idSpliUdi: false,
newType: 2, newType: 2,
selectProductVisible: false, selectProductVisible: false,
addProductVisible: false, addProductVisible: false,
@ -1663,8 +1668,20 @@ export default {
this.isImportUdi = true; this.isImportUdi = true;
this.thisData = val; this.thisData = val;
console.log("-----" + this.relId); console.log("-----" + this.relId);
this.idSpliUdi = false;
this.thirdId = val.thirdId;
this.selectLocalVisible = true; this.selectLocalVisible = true;
}, },
splitSelectUdi(val) {
this.thirdId = val.thirdId;
this.isImportUdi = true;
this.thisData = val;
this.idSpliUdi = true;
console.log("-----" + this.relId);
this.selectLocalVisible = true;
},
intentImportUdi() { intentImportUdi() {
this.relId = null; this.relId = null;
this.selectLocalVisible = true; this.selectLocalVisible = true;

@ -5,48 +5,57 @@
<el-form <el-form
:inline="true" :inline="true"
:model="filterQuery" :model="filterQuery"
style="display: flex"
label-width="480px" label-width="480px"
size="mini" size="mini"
> >
<el-form-item class="query-form-item" label-width="100px">
<el-input <el-row>
v-model="filterQuery.code" <el-form-item class="query-form-item" label-width="100px">
placeholder="UDI码" <el-input
style="width: 500px" id="inputer"
@keyup.enter.native="keyup_submit($event)" v-model="filterQuery.code"
></el-input> placeholder="UDI码"
</el-form-item> ref='inputRef'
<el-form-item class="query-form-item"> style="width: 500px"
<el-select @keypress.enter.native="enterKey($event)"
v-model="filterQuery.supId" ></el-input>
filterable <el-checkbox v-model="sitcomScan" style="margin-left: 15px"></el-checkbox>
remote </el-form-item>
clearable="true"
reserve-keyword </el-row>
placeholder="请输入供应商名称" <el-row>
:remote-method="findMethod" <el-form-item class="query-form-item">
size="mini" <el-select
style="width: 100%" v-model="filterQuery.supId"
:loading="loading" filterable
> remote
<el-option clearable="true"
v-for="item in fromOptions" reserve-keyword
:key="item.name" placeholder="请输入供应商名称"
:label="item.name" :remote-method="findMethod"
:value="item.erpId" size="mini"
style="width: 100%"
:loading="loading"
> >
<span style="float: left">{{ item.name }}</span> <el-option
</el-option> v-for="item in fromOptions"
</el-select> :key="item.name"
</el-form-item> :label="item.name"
:value="item.erpId"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item style="display: flex">
<el-button type="primary" icon="search" @click="getList"
>查询
</el-button
>
</el-form-item>
</el-row>
<el-form-item style="display: flex">
<el-button type="primary" icon="search" @click="getList"
>查询
</el-button
>
</el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -308,6 +317,7 @@ import selectErpOrder from "../warehouse/DialogSelectErpOrder";
import {getBussinessType} from "../../api/basic/bussinessType"; import {getBussinessType} from "../../api/basic/bussinessType";
import {filterOrderTrace} from "@/api/inventory/invCodeTrace"; import {filterOrderTrace} from "@/api/inventory/invCodeTrace";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain"; import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import A from "@/plugin/KeyScaner";
const formJson = { const formJson = {
site_id: "", site_id: "",
@ -335,6 +345,7 @@ export default {
limit: 20, limit: 20,
supId: null, supId: null,
}, },
sitcomScan: false,
checkStatus: { checkStatus: {
1: "校验异常", 1: "校验异常",
0: "未校验", 0: "未校验",
@ -475,6 +486,15 @@ export default {
this.actDateRange = []; this.actDateRange = [];
this.getList(); this.getList();
}, },
enterKey(event) {
if (this.sitcomScan) {
return;
} else {
this.$refs.inputRef.select();
this.onSubmit();
}
},
onSubmit() { onSubmit() {
this.getList(); this.getList();
}, },
@ -567,11 +587,17 @@ export default {
this.filterQuery.customerId = store.getters.customerId; this.filterQuery.customerId = store.getters.customerId;
filterOrderTrace(this.filterQuery) filterOrderTrace(this.filterQuery)
.then((response) => { .then((response) => {
console.log(response) if (response.code == 20000) {
this.loading = false; this.loading = false;
this.list = response.data.list || []; this.list = response.data.list || [];
this.detailList = []; this.detailList = [];
this.total = response.data.total || 0; this.total = response.data.total || 0;
} else {
this.loading = false;
this.$message.error(response.message);
}
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
@ -948,6 +974,23 @@ export default {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
}; };
var that = this;
var inputer = document.getElementById("inputer");
window.sc = new A.KeyScaner(inputer);//DOM
sc.onInput = function (text) {
//onInput500ms
if (text.includes("delete")) {
that.formData.code = "";
return;
}
if (that.sitcomScan) {
that.filterQuery.code = that.filterQuery.code;
} else {
that.filterQuery.code = text;
}
};
inputer.focus();//divtabindexdocumentBody
}, },
created() { created() {

@ -3,7 +3,7 @@
<div> <div>
<h3 class="toptitle">平和县医院</h3> <h3 class="toptitle">诏安县总医院</h3>
</div> </div>
<el-form <el-form

@ -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) {
//onInput500ms //onInput500ms
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();//divtabindexdocumentBody inputer.focus();//divtabindexdocumentBody

@ -114,26 +114,21 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="3"> <el-col :span="3">
<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"
v-model="formData.code" v-model="formData.code"
></el-input> ></el-input>
<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">
@ -150,10 +145,12 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="16" style="margin-left: 40px"> <el-col :span="14" style="margin-left: 40px">
</el-col>
<el-col :span="2">
<el-checkbox v-model="sitcomScan"></el-checkbox> <el-checkbox v-model="sitcomScan"></el-checkbox>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="3">
<div class="text item" style="margin-left: 30px"> 条码数量{{ total }} <div class="text item" style="margin-left: 30px"> 条码数量{{ total }}
</div> </div>
</el-col> </el-col>
@ -420,7 +417,6 @@ export default {
}, },
addCode(event) { addCode(event) {
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();
@ -715,24 +711,19 @@ export default {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
}; };
var that = this; var that = this;
var inputer = document.getElementById("inputer"); var inputer = document.getElementById("inputer");
window.sc = new A.KeyScaner(inputer);//DOM window.sc = new A.KeyScaner(inputer);//DOM
sc.onInput = function (text) { sc.onInput = function (text) {
//onInput500ms //onInput500ms
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();//divtabindexdocumentBody inputer.focus();//divtabindexdocumentBody
@ -790,6 +781,7 @@ export default {
text-align: right; text-align: right;
margin-top: 10px; margin-top: 10px;
} }
#inputer { #inputer {
width: 100%; width: 100%;
min-height: 30px; min-height: 30px;

Loading…
Cancel
Save