修改扫码

This commit is contained in:
x
2026-06-03 13:05:15 +08:00
parent 19801f44a6
commit b60645131e
11 changed files with 233 additions and 125 deletions

View File

@@ -133,7 +133,8 @@ export default {
font-size: 14px;
}
input {
font-size: 15px;
/* font-size: 15px; */
font-size: 28rpx;
color: #333;
}
</style>

View File

@@ -0,0 +1,73 @@
<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="zd-row buttons_wraper">
<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
},
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')
},
handleSend (e) {
this.$emit('input', e.target.value)
if (e.target.value.length) {
this.$emit('handleChange', e.target.value)
}
}
}
}
</script>
<style lang="stylus">
@import '../common/style/mixin.styl';
.search_wraper
position relative
_wh(100%, 80rpx)
.pdr120
padding-right: 120rpx;
.buttons_wraper
position absolute
top 0
right 10rpx
_wh(auto, 80rpx)
.pdr10
padding-right 10rpx
</style>

View File

@@ -8,10 +8,12 @@
:focus="focusState"
@focus="handleFocus"
@blur="handleBlur"
@input="handleInput"
@confirm="handleSend">
<view class="zd-row buttons_wraper">
<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>
<uni-icons type="camera" size="28" style="marginLeft: 30rpx;" @tap="toPhone"></uni-icons>
</view>
</view>
</template>
@@ -42,6 +44,13 @@
// }
this.focusState = false
},
handleInput (e) {
this.$emit('input', e.target.value)
// this.$emit('handleInput', e.target.value)
if (e.target.value.length) {
this.$emit('handleInput', e.target.value)
}
},
toDel () {
this.$emit('input', '')
this.$emit('handleDel')
@@ -51,7 +60,49 @@
if (e.target.value.length) {
this.$emit('handleChange', e.target.value)
}
},
async toPhone() {
// #ifdef APP-PLUS
let status = await this.checkPermission();
if (status !== 1) {
return;
}
// #endif
uni.scanCode({
success: (res) => {
this.$emit('input', res.result)
this.$emit('handleChange', res.result)
},
fail: (err) => {
// uni.showToast({
// title: '出错',
// icon: 'none'
// })
}
});
}
// #ifdef APP-PLUS
,
async checkPermission(code) {
let status = permision.isIOS ? await permision.requestIOS('camera') :
await permision.requestAndroid('android.permission.CAMERA');
if (status === null || status === 1) {
status = 1;
} else {
uni.showModal({
content: "需要相机权限",
confirmText: "设置",
success: function(res) {
if (res.confirm) {
permision.gotoAppSetting();
}
}
})
}
return status;
}
// #endif
}
}
</script>

View File

@@ -41,7 +41,7 @@
return {
userName: '',
menuList: [
{title: '原料管理', path: 'RF04', sonTree: [{title: '来料入库', path: '/pages/zw/ll-instore'}, {title: '空载具入库', path: '/pages/zw/kzj-instore'}, {title: '空载具出库', path: '/pages/zw/kzj-outstore'}, {title: '点位属性设置', path: '/pages/zw/point-attrset'}, {title: '物料组盘', path: '/pages/zw/wl-groupplate'}, {title: '点位更新', path: '/pages/zw/confirm-quhuo'}]},
{title: '原料管理', path: 'RF04', sonTree: [{title: '物料组盘', path: '/pages/zw/wl-groupplate'}, {title: '来料入库', path: '/pages/zw/ll-instore'}, {title: '空载具入库', path: '/pages/zw/kzj-instore'}, {title: '空载具出库', path: '/pages/zw/kzj-outstore'}, {title: '点位属性设置', path: '/pages/zw/point-attrset'}, {title: '点位更新', path: '/pages/zw/confirm-quhuo'}]},
{title: '解包管理', path: 'RF03', sonTree: [{title: '解包上料', path: '/pages/zw/jb-up-mater'}, {title: '解包出桶', path: '/pages/zw/jb-lower-mater'}, {title: '解包退料', path: '/pages/zw/jb-return-mater'}, {title: '人车安全', path: '/pages/zw/mancar-safe'}]},
{title: '缓存管理', path: 'RF06', sonTree: [{title: '料桶盘点', path: '/pages/zw/materbox-instore'}, {title: '物料入库', path: '/pages/zw/wlrk'}]},
{title: '产线管理', path: 'RF02', sonTree: [{title: '手工叫料', path: '/pages/zw/manual-callmater'}, {title: '手工退料', path: '/pages/zw/manual-returnmater'}]},

View File

@@ -42,7 +42,7 @@
<span class="filter_label">料桶编码</span>
</view>
<view class="zd-col-17">
<search-box v-model="val2"/>
<search-box v-model="val2" @handleInput="handleInput" @handleChange="handleChange2"/>
</view>
</view>
</view>
@@ -63,7 +63,7 @@
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.workorder_id}">
<td>{{e.workorder_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{JSON.parse(e.ext_data).batch_no}}</td>
<td>{{e.workorder_status_name}}</td>
<td>{{e.operator}}</td>
<td>{{e.plan_weight}}</td>
@@ -96,35 +96,22 @@
</view>
</view>
<!-- 第二行库位信息带下拉箭头 -->
<!-- 第二行库位信息 使用 uni-data-select -->
<view class="form-line">
<text class="label no-wrap">库位信息</text>
<view class="select-box" @click="openSelect">
<text class="select-text">{{ selectStructName || '请选择' }}</text>
<!-- 下拉箭头 -->
<view class="arrow-down"></view>
</view>
<text class="label">库位信息</text>
<uni-data-select
v-model="selectStructCode"
:localdata="structList"
placeholder=""
@change="onStructChange"
></uni-data-select>
</view>
<!-- 按钮 -->
<!-- 按钮 -->
<view class="btn-group">
<button class="btn cancel" @click="closeDialog">取消</button>
<button class="btn save" @click="save">保存</button>
</view>
</view>
<!-- 库位选择弹窗最高层级 -->
<view class="select-popup" v-if="showSelect" @click="showSelect = false">
<view class="select-content" @click.stop>
<view
class="select-item"
v-for="item in structList"
:key="item.struct_code"
@click="selectStruct(item)"
>
{{ item.struct_name }}
</view>
</view>
</view>
</view>
</template>
@@ -159,11 +146,11 @@
standError: '',
disabled: false,
statusMap: {
'1': '未生产',
'2': '已下发',
'1': '未开始',
'2': '已下发',
'3': '生产中',
'4': '等待下料',
'5': '完成'
'4': '等待',
'5': '完成'
},
reload: false,
status: 'more',
@@ -177,14 +164,16 @@
pageSize: 100,
showDialog: false,
selectType: '0',
showSelect: false,
selectStructName: '',
selectStructCode: '',
// structList: [
// { struct_code: 'A01', struct_name: 'A区01库位' },
// { struct_code: 'A02', struct_name: 'A区02库位' },
// { struct_code: 'B01', struct_name: 'B区01库位' },
// ]
// { value: 'A01', text: 'A区01库位' },
// { value: 'A02', text: 'A区02库位' },
// { value: 'B01', text: 'B区01库位' },
// { value: 'B21', text: 'B区21库位' },
// { value: 'B31', text: 'B区31库位' },
// { value: 'B02', text: 'B区02库位' }
// ],
structList: []
};
},
@@ -197,6 +186,16 @@
// this._pointList('DDJBQ')
},
methods: {
handleInput (e) {
if (e) {
this.val2 = e.slice(-4)
}
},
handleChange2 (e) {
if (e) {
this.val2 = e.slice(-4)
}
},
closeDialog() {
this.showDialog = false
},
@@ -211,17 +210,13 @@
}
this.showDialog = true
},
openSelect() {
if (!this.pkId) {
return
// 库位选择事件
onStructChange(e) {
this.selectStructCode = e
let item = this.structList.find(i => i.value === e)
if (item) {
this.selectStructName = item.text
}
this._structListByWorkId()
this.showSelect = true
},
selectStruct(item) {
this.selectStructCode = item.struct_code
this.selectStructName = item.struct_name
this.showSelect = false
},
handleBlur () {
if (this.val3) {
@@ -439,7 +434,7 @@
},
async _downMaterial () {
try {
let res = await downMaterial(this.pkId, 'DDJBQ', this.val3, this.index2, this.val1, this.val2, this.selectType, this.selectStructCode, this.selectStructName)
let res = await downMaterial(this.pkId, this.index, this.val3, this.index2, this.val1, this.val2, this.selectType, this.selectStructCode, this.selectStructName)
if (res.code === '200') {
uni.showToast({
title: res.message,
@@ -461,7 +456,7 @@
}
</script>
<style lang="stylus" scoped>
/* 弹窗最高层级 永远在最上层 */
/* 弹窗最高层级 */
.dialog {
position: fixed;
top: 50%;
@@ -471,10 +466,9 @@
max-width: 650rpx;
background: #fff;
border-radius: 16rpx;
z-index: 9999 !important; /* 最高层级 */
overflow: hidden;
z-index: 9999 !important;
// overflow: hidden;
}
.form-line {
display: flex;
align-items: center;
@@ -482,7 +476,7 @@
}
.label {
font-size: 30rpx;
width: 140rpx;
// width: 140rpx;
flex-shrink: 0;
}
.no-wrap {
@@ -523,53 +517,6 @@
white-space: nowrap;
}
/* 下拉框 + 箭头 */
.select-box {
flex: 1;
padding: 20rpx;
border: 2rpx solid #eee;
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.select-text {
font-size: 28rpx;
color: #666;
}
/* 下拉箭头 */
.arrow-down {
width: 0;
height: 0;
border-left: 8rpx solid transparent;
border-right: 8rpx solid transparent;
border-top: 10rpx solid #999;
}
/* 库位选择弹层(比主弹窗更高) */
.select-popup {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.2);
z-index: 99999 !important;
display: flex;
align-items: center;
justify-content: center;
}
.select-content {
width: 70%;
max-width: 500rpx;
background: #fff;
border-radius: 12rpx;
overflow: hidden;
}
.select-item {
padding: 28rpx;
font-size: 30rpx;
text-align: center;
border-bottom: 1rpx solid #eee;
}
/* 按钮 */
.btn-group {
display: flex;

View File

@@ -46,7 +46,7 @@
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.workorder_id}">
<td>{{e.workorder_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{JSON.parse(e.ext_data).batch_no}}</td>
<td>{{e.workorder_status_name}}</td>
<td>{{e.operator}}</td>
<td>{{e.plan_weight}}</td>
@@ -114,8 +114,10 @@
selectType: '0', // 选中的类型
statusMap: {
'1': '未开始',
'2': '已下发',
'3': '生产中',
'5': '已结束'
'4': '等待中',
'5': '已完成'
},
reload: false,
status: 'more',
@@ -291,7 +293,7 @@
max-width: 600rpx;
background: #fff;
border-radius: 16rpx;
z-index: 100;
z-index: 9999 !important; /* 最高层级 */
overflow: hidden;
}

View File

@@ -38,7 +38,7 @@
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.workorder_id}">
<td>{{e.workorder_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{JSON.parse(e.ext_data).batch_no}}</td>
<td>{{e.workorder_status_name}}</td>
<td>{{e.operator}}</td>
<td>{{e.plan_weight}}</td>
@@ -106,8 +106,10 @@
selectType: '0', // 选中的类型
statusMap: {
'1': '未开始',
'2': '已下发',
'3': '生产中',
'5': '已结束'
'4': '等待中',
'5': '已完成'
},
reload: false,
status: 'more',
@@ -265,13 +267,13 @@
let res = await callMaterialFinish(this.pkId, this.index2, this.index)
if (res.code === '200') {
uni.showToast({
title: res.message,
title: '操作成功',
icon: 'none'
})
this.clearUp()
} else {
uni.showToast({
title: res.message,
title: '操作失败',
icon: 'none'
})
this.disabled = false
@@ -294,7 +296,7 @@
max-width: 600rpx;
background: #fff;
border-radius: 16rpx;
z-index: 100;
z-index: 9999 !important; /* 最高层级 */
overflow: hidden;
}

View File

@@ -266,7 +266,7 @@
max-width: 600rpx;
background: #fff;
border-radius: 16rpx;
z-index: 100;
z-index: 9999 !important; /* 最高层级 */
overflow: hidden;
}

View File

@@ -54,10 +54,10 @@
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">数量</span>
<span class="filter_label">数量</span>
</view>
<view class="zd-col-16">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.qty" disabled>
<input type="text" class="filter_input" v-model="currentData.qty" disabled>
</view>
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
</view>

View File

@@ -19,8 +19,10 @@
<view class="zd-col-17">
<search-box
v-model="val2"
@handleInput="handleInput"
@handleChange="handleChange"
/>
<!-- <search-box v-model="val2" @handleInput="handleInput" /> -->
</view>
</view>
<view v-if="Object.prototype.toString.call(currentData) === '[object Object]' ">
@@ -129,7 +131,7 @@
this.title = options.title
},
created () {
this._structList()
// this._structList()
},
methods: {
async _structList () {
@@ -163,8 +165,15 @@
this.index = ''
this.disabled3 = false
},
handleChange (e) {
handleInput (e) {
if (e) {
this.val2 = e.slice(-4)
}
},
handleChange () {
this.val2 = this.val2.slice(-4)
if (this.val2) {
this.currentData = {}
this._jbGetLtInfo()
}
},

View File

@@ -58,7 +58,16 @@
<span class="filter_label">料桶编码</span>
</view>
<view class="zd-col-17 filter_select">
<!-- <zxz-uni-data-select v-model="index1" filterable :localdata="options1"></zxz-uni-data-select> -->
<uni-data-select
v-model="vehicleCode"
:localdata="options3"
@change="selectChange3"
filterable
clearable
></uni-data-select>
</view>
<!-- <view class="zd-col-17 filter_select">
<zxz-uni-data-select v-model="index1" filterable :localdata="options1"></zxz-uni-data-select>
<view class="input-wrapper">
<input
class="input-field"
@@ -75,12 +84,12 @@
@change="onPickerChange"
>
<view class="picker-trigger">
<!-- <text class="picker-text">></text> -->
<text class="picker-text">></text>
<text class="uni-icons zd_icon_wraper uniui-bottom" style="color: rgb(153, 153, 153); font-size: 14px;"></text>
</view>
</picker>
</view>
</view>
</view> -->
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
@@ -132,15 +141,18 @@
selectedIndex: 0,
vehicleOptions: [],
// vehicleOptions: [
// 'TB-001',
// 'TB-002',
// 'TB-003',
// 'TB-004',
// 'TB-005',
// 'TB-006',
// 'TB-007',
// 'TB-008'
// 'TB001',
// 'TB002',
// 'TB003',
// 'TB004',
// 'TB005',
// 'TB006',
// 'TB007',
// 'TB008'
// ],
// options3: [{text:'AB001', value: 'A001'}, {text:'AB002', value: 'A002'}],
options3: [],
index3: '',
disabled: false
};
},
@@ -179,7 +191,11 @@
selectChange2 (e) {
this.index2 = e
},
selectChange3 (e) {
this.vehicleCode = e
},
onInput(e) {
this.vehicleCode = this.vehicleCode.slice(-4)
// console.log('输入内容:', e.detail.value)
},
onPickerChange(e) {
@@ -210,12 +226,18 @@
try {
let res = await vehiclelist()
if (res) {
this.vehicleOptions = res.data.map(item => item.value);
// this.vehicleOptions = res.data.map(item => item.value);
this.options3 = res.data.map(item => ({
text: item.value.slice(-4),
value: item.value.slice(-4) // 截取字符串后四位
}))
} else {
this.vehicleOptions = []
// this.vehicleOptions = []
this.options3 = []
}
} catch (e) {
this.vehicleOptions = []
// this.vehicleOptions = []
this.options3 = []
}
},
toJump () {
@@ -234,6 +256,7 @@
this.index = ''
this.vehicleCode = ''
this.index2 = ''
this.index3 = ''
this.disabled = false
this._vehiclelist()
this._structList()