连续扫码优化

This commit is contained in:
2025-05-29 19:33:10 +08:00
parent ccbfae0c30
commit 0645bb4949
4 changed files with 96 additions and 7 deletions

87
components/LinkScan.vue Normal file
View File

@@ -0,0 +1,87 @@
<template>
<view class="search_wraper">
<input
type="text"
class="filter_input pdr120"
confirm-type="go"
:value="value"
:focus="focusState"
@focus="handleFocus"
@blur="handleBlur"
@confirm="handleSend">
<view class="filter_num">{{editValue.toString()}}</view>
<view class="zd-row buttons_wraper">
<uni-icons v-show="editValue.length > 0" class="pdr10" type="clear" size="24" color="#666" @tap="linkDel"></uni-icons>
<uni-icons v-show="value !== '' && value !== null && value !== undefined" class="pdr10" type="clear" size="24" color="#666" @tap="toDel"></uni-icons>
<uni-icons type="scan" size="22" :color="focusState ? '#ff6a00' : '#4e6ef2'" @tap="focusState=true"></uni-icons>
</view>
</view>
</template>
<script>
import permision from "@/utils/permission.js"
export default {
data() {
return {
focusState: false
};
},
model: {
prop: 'value',
event: 'input'
},
props: {
value: String,
editValue: Array
},
methods: {
handleFocus () {
this.focusState = true
},
handleBlur (e) {
this.$emit('input', e.target.value)
// if (e.target.value.length) {
// this.$emit('handleChange', e.target.value)
// }
this.focusState = false
},
toDel () {
this.$emit('input', '')
this.$emit('handleDel')
},
linkDel () {
this.$emit('linkDel')
},
handleSend (e) {
this.$emit('input', e.target.value)
if (e.target.value.length) {
this.$emit('handleChange', e.target.value)
}
}
}
}
</script>
<style lang="stylus" scoped>
@import '../common/style/mixin.styl';
.search_wraper
position relative
_wh(100%, 80rpx)
.pdr120
padding-right: 50%;
.buttons_wraper
position absolute
top 0
right 10rpx
_wh(auto, 80rpx)
.pdr10
padding-right 10rpx
.filter_num
position absolute
top 0
right 50px
width calc(50% - 50px)
overflow hidden
text-overflow ellipsis
line-height 80rpx
</style>

View File

@@ -20,12 +20,12 @@
<span class="filter_label">出库单据编号</span>
</view>
<view class="zd-col-16 zd-row relative">
<view class="filter_num">{{editValue.toString()}}</view>
<search-box
<link-scan
:editValue="editValue"
v-model="val2"
@handleChange="handleChange2"
@linkDel="toDel"
/>
<uni-icons v-show="editValue.length > 0" class="absolute del-icon" type="clear" size="24" color="#666" @tap="toDel"></uni-icons>
</view>
</view>
<view class="zd-row border-bottom">
@@ -91,11 +91,13 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import LinkScan from '@/components/LinkScan.vue'
import {queryTargetPoint, getCtuOrderList, ctuOutConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
SearchBox,
LinkScan
},
data() {
return {

View File

@@ -177,8 +177,8 @@
title: res.msg,
icon: 'none'
})
let data = Object.assign({}, this.data, {lxCode: this.val2})
setTimeout(this.toPrint(data), 800)
// let data = Object.assign({}, this.data, {lxCode: this.val2})
// setTimeout(this.toPrint(data), 800)
this.clearUp()
} else {
this.disabled = false

View File

@@ -242,7 +242,7 @@ export const structattrPage = () => {
export const getCtuOrderList = () => {
let res = {
"code": "200",
data: '3',
data: 'JDSCLLSQ250500293',
content: [{material_name: '1', status: '1'}, {material_name: '2', status: '1'}, {material_name: '3', status: '1'}, {material_name: '4', status: '1'}, {material_name: '5', status: '1'}, {material_name: '6', status: '1'}, {material_name: '7', status: '1'}, {material_name: '8', status: '1'}, {material_name: '9', status: '0'}, {material_name: '10', status: '1'}]
}
return res