Browse Source

优化扫描框

hella_online_20240829
lijuncheng 2 months ago
parent
commit
03843e32a6
  1. 5
      src/mycomponents/scan/winComScan.vue
  2. 8
      src/mycomponents/scan/winComScanBalance.vue
  3. 2
      src/mycomponents/scan/winScanLocation.vue
  4. 2
      src/mycomponents/scan/winScanPackJob.vue
  5. 14
      src/pages/purchaseReceipt/job/receiptDetail.vue
  6. 5
      src/pages/purchaseReceipt/job/receiptJob.vue

5
src/mycomponents/scan/winComScan.vue

@ -6,7 +6,7 @@
<view class="tab_info"> <view class="tab_info">
<view class="conbox"> <view class="conbox">
<textarea inputmode="none" v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;" <textarea inputmode="none" v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;"
:focus="boxfocus" :placeholder="placeholderValue" @focus="getfocus" @blur="losefocus" :focus="boxfocus" :placeholder="placeholderValue"
@input="handelScanMsg" :cursor="cursorIndex" ></textarea> @input="handelScanMsg" :cursor="cursorIndex" ></textarea>
</view> </view>
@ -225,6 +225,7 @@
getfocus() { getfocus() {
let that = this; let that = this;
this.$nextTick(r => { this.$nextTick(r => {
console.log("获取焦点")
that.boxfocus = true; that.boxfocus = true;
}); });
// this.hide() // this.hide()
@ -232,7 +233,9 @@
losefocus() { losefocus() {
let that = this; let that = this;
this.$nextTick(r => { this.$nextTick(r => {
console.log("失去焦点")
that.boxfocus = false; that.boxfocus = false;
uni.hideKeyboard();
}); });
}, },
clear() { clear() {

8
src/mycomponents/scan/winComScanBalance.vue

@ -116,6 +116,10 @@
getScanResult(result) { getScanResult(result) {
this.resultData = result; this.resultData = result;
if(!result.package){
this.showErrorMessage(result.label.code+"包装信息为空")
return;
}
this.getItemCodeType(result.package.itemCode,callBack=>{ this.getItemCodeType(result.package.itemCode,callBack=>{
this.queryBalance(this.resultData) this.queryBalance(this.resultData)
}) })
@ -192,7 +196,9 @@
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
if(this.$refs.comscan){
this.$refs.comscan.getfocus()
}
} }
}); });
}, },

2
src/mycomponents/scan/winScanLocation.vue

@ -13,7 +13,7 @@
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="true" <win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="true"
:boxFocus="true" :isShowHistory="isShowHistory" headerType=""> :isShowHistory="isShowHistory" headerType="">
</win-com-scan> </win-com-scan>
</view> </view>
</view> </view>

2
src/mycomponents/scan/winScanPackJob.vue

@ -70,11 +70,11 @@
methods: { methods: {
// //
openScanPopup(){ openScanPopup(){
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
}, },
// //
closeScanPopup(content) { closeScanPopup(content) {
this.$refs.comscan.losefocus()
this.$refs.popup.close(); this.$refs.popup.close();
this.$emit("close", ''); this.$emit("close", '');
}, },

14
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -14,9 +14,9 @@
@change="switchChange"></u-switch> @change="switchChange"></u-switch>
</view> </view>
</view> </view>
<view class="" v-if="operation=='reject'"> <view class="" v-if ="operation=='reject'">
<uni-section title="拒收原因" type="line"> <uni-section title="拒收原因" type="line">
<uni-easyinput v-model="reasonText" placeholder="请输入拒收原因"></uni-easyinput> <uni-easyinput v-model="reasonText" placeholder="请输入拒收原因" ></uni-easyinput>
</uni-section> </uni-section>
</view> </view>
@ -677,7 +677,6 @@
showMessage(message) { showMessage(message) {
setTimeout(r => { setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
if (res) { if (res) {
this.scanPopupGetFocus() this.scanPopupGetFocus()
@ -688,7 +687,6 @@
showErrorMessage(message) { showErrorMessage(message) {
setTimeout(r => { setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
this.scanPopupGetFocus() this.scanPopupGetFocus()
@ -711,15 +709,7 @@
} }
}, },
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus();
}
},
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1) navigateBack(1)
}) })

5
src/pages/purchaseReceipt/job/receiptJob.vue

@ -342,6 +342,9 @@
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
if(this.$refs.scanPopup){
this.$refs.scanPopup.packGetFocus()
}
} }
}); });
@ -362,8 +365,6 @@
}, },
getScanResult(result) { getScanResult(result) {
try { try {
let filters = [] let filters = []
if (result.label.barType == "BarCode") { if (result.label.barType == "BarCode") {

Loading…
Cancel
Save