扫描 增加确认按钮

This commit is contained in:
aihe 2024-07-11 22:25:52 +08:00
parent 96c076d1fa
commit 62d69c142e
15 changed files with 134 additions and 81 deletions

View File

@ -5,7 +5,7 @@
<u-row justify="between"> <u-row justify="between">
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码" <tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="left"></tpx-scan-input> @scanChange="handleScanValChange" :showConfirm="true" @confirmClick="handleScanValChange" iconPos="left"></tpx-scan-input>
</view> </view>
</u-row> </u-row>
<u-row custom-style="margin-top:20rpx;"> <u-row custom-style="margin-top:20rpx;">
@ -120,9 +120,8 @@
initData() { initData() {
this.submitParam.billCode = this.queryOption.billCode this.submitParam.billCode = this.queryOption.billCode
}, },
async handleSubmit(val) { async handleSubmit() {
let extParam = {} let extParam = {}
val && (extParam.billCode = val);
await checkParams(this.submitParam, this.submitValidConfig) await checkParams(this.submitParam, this.submitValidConfig)
// 转换图片格式 // 转换图片格式
extParam.picUrl = this.submitParam.picUrl.join(",") extParam.picUrl = this.submitParam.picUrl.join(",")
@ -136,7 +135,7 @@
} }
}, },
handleScanValChange: debounce(function(val){ handleScanValChange: debounce(function(val){
val && (this.handleSubmit(val)) this.handleSubmit()
}), }),
resetForm() { resetForm() {
this.submitParam.billCode = '' this.submitParam.billCode = ''

View File

@ -5,7 +5,7 @@
<u-row justify="between"> <u-row justify="between">
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码" <tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="left"></tpx-scan-input> @scanChange="handleScanValChange" :showConfirm="true" @confirmClick="handleScanValChange" iconPos="left"></tpx-scan-input>
</view> </view>
</u-row> </u-row>
<u-row custom-style="margin-top:20rpx;"> <u-row custom-style="margin-top:20rpx;">
@ -99,9 +99,8 @@
initData() { initData() {
this.submitParam.billCode = this.queryOption.billCode this.submitParam.billCode = this.queryOption.billCode
}, },
async handleSubmit(val) { async handleSubmit() {
let extParam = {} let extParam = {}
val && (extParam.billCode = val);
await checkParams(this.submitParam, this.submitValidConfig) await checkParams(this.submitParam, this.submitValidConfig)
let scnParam = getScanParams(scanTypeEnum.faJian, { ...this.submitParam, ...extParam }) let scnParam = getScanParams(scanTypeEnum.faJian, { ...this.submitParam, ...extParam })
let res = await apiService.scanRecord({...scnParam, _loading: true}) let res = await apiService.scanRecord({...scnParam, _loading: true})
@ -112,8 +111,8 @@
this.resetForm() this.resetForm()
} }
}, },
handleScanValChange: debounce(function(val){ handleScanValChange: debounce(function(){
val && (this.handleSubmit(val)) this.handleSubmit()
}), }),
resetForm() { resetForm() {
this.submitParam.billCode = '' this.submitParam.billCode = ''

View File

@ -1,16 +1,22 @@
<template> <template>
<u-input :placeholder="placeholder" :fontSize="fontSize" :modelValue="value" <u-row>
:custom-style="`border-radius: 10rpx;padding: 11rpx 20rpx;${customStyle};`" <u-input :placeholder="placeholder" :fontSize="fontSize" :modelValue="value"
@change="handleInputChange" :custom-style="`border-radius: 10rpx;padding: 11rpx 20rpx;${customStyle};`"
> @change="handleInputChange"
<template v-if="iconPos == 'left'" v-slot:prefix> >
<u-icon @click="handleScan" name="scan" :size="fontSize*1.5"></u-icon> <template v-if="iconPos == 'left'" v-slot:prefix>
</template> <u-icon @click="handleScan" name="scan" :size="fontSize*1.5"></u-icon>
</template>
<template v-if="iconPos == 'right'" v-slot:suffix>
<u-icon @click="handleScan" name="scan" :size="fontSize*1.5"></u-icon>
</template>
</u-input>
<template v-if="iconPos == 'right'" v-slot:suffix> <view v-if="showConfirm" @click="handleConfirm" class="ml-10">
<u-icon @click="handleScan" name="scan" :size="fontSize*1.5"></u-icon> <u-button custom-style="height: 70rpx;" :plain="true">确认</u-button>
</template> </view>
</u-input> </u-row>
<tpx-physics-scan @onChange="handleScanChange"></tpx-physics-scan> <tpx-physics-scan @onChange="handleScanChange"></tpx-physics-scan>
</template> </template>
@ -50,6 +56,11 @@
return '' return ''
} }
}, },
showConfirm:{
default () {
return false
}
},
}, },
data() { data() {
}, },
@ -77,6 +88,9 @@
handleScanChange(val){ handleScanChange(val){
this.$emit('scanChange', val) this.$emit('scanChange', val)
this.handleChange(val) this.handleChange(val)
},
handleConfirm(){
this.$emit('confirmClick')
} }
} }
} }

View File

@ -26,7 +26,9 @@
watch: { watch: {
searchParam: { searchParam: {
handler: function(cval, oval) { handler: function(cval, oval) {
this.getDataList(true) if(this.autoReload) {
this.getDataList(true)
}
}, },
deep: true deep: true
} }
@ -41,6 +43,11 @@
} }
}, },
props: { props: {
autoReload: {
default () {
return true
}
},
searchParam: { searchParam: {
default () { default () {
return {} return {}

View File

@ -4,14 +4,14 @@
<template v-slot:body> <template v-slot:body>
<view class="pos-abt-all"> <view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun" <tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
ref="listRef" ref="listRef" :autoReload="false"
> >
<view class="blcok-white-noradius" style="margin-top: 0;"> <view class="blcok-white-noradius" style="margin-top: 0;">
<u-row justify="between"> <u-row justify="between">
<view style="width: 140rpx;" class="font-weight">运单号</view> <view style="width: 140rpx;" class="font-weight">运单号</view>
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入或扫码" <tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="right"></tpx-scan-input> @scanChange="handleSearch" iconPos="right"></tpx-scan-input>
</view> </view>
</u-row> </u-row>
<u-row justify="between" custom-style="margin-top:20rpx;"> <u-row justify="between" custom-style="margin-top:20rpx;">
@ -20,10 +20,10 @@
<tpx-date-input v-model:value="searchParam._date" placeholder="请选择时间"></tpx-date-input> <tpx-date-input v-model:value="searchParam._date" placeholder="请选择时间"></tpx-date-input>
</view> </view>
</u-row> </u-row>
<!-- <view class="mt-30"> <view class="mt-20">
<u-button @click="handleSubmit()" type="primary" size="large" shape="square" <u-button type="primary" size="large" shape="square" plain="true" @click="handleSearch"
custom-style="height:80rpx;font-size: 30rpx;border-radius: 14rpx;">查询</u-button> custom-style="height:66rpx;font-size: 30rpx;border-radius: 14rpx;">查询</u-button>
</view> --> </view>
</view> </view>
@ -107,6 +107,14 @@
}, },
initData() { initData() {
},
handleSearch(){
setTimeout(()=> {
this.triggerListReload()
}, 300)
},
triggerListReload(){
this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据
}, },
handleSubmit() { handleSubmit() {

View File

@ -4,14 +4,14 @@
<template v-slot:body> <template v-slot:body>
<view class="pos-abt-all"> <view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun" <tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
ref="listRef" ref="listRef" :autoReload="false"
> >
<view class="blcok-white-noradius" style="margin-top: 0;"> <view class="blcok-white-noradius" style="margin-top: 0;">
<u-row justify="between"> <u-row justify="between">
<view style="width: 140rpx;" class="font-weight">运单号</view> <view style="width: 140rpx;" class="font-weight">运单号</view>
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入或扫码" <tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="right"></tpx-scan-input> @scanChange="handleSearch" iconPos="right"></tpx-scan-input>
</view> </view>
</u-row> </u-row>
<u-row justify="between" custom-style="margin-top:20rpx;"> <u-row justify="between" custom-style="margin-top:20rpx;">
@ -20,10 +20,10 @@
<tpx-date-input v-model:value="searchParam._date" placeholder="请选择时间"></tpx-date-input> <tpx-date-input v-model:value="searchParam._date" placeholder="请选择时间"></tpx-date-input>
</view> </view>
</u-row> </u-row>
<!-- <view class="mt-30"> <view class="mt-20">
<u-button @click="handleSubmit()" type="primary" size="large" shape="square" <u-button type="primary" size="large" shape="square" plain="true" @click="handleSearch"
custom-style="height:80rpx;font-size: 30rpx;border-radius: 14rpx;">查询</u-button> custom-style="height:66rpx;font-size: 30rpx;border-radius: 14rpx;">查询</u-button>
</view> --> </view>
</view> </view>
@ -107,6 +107,14 @@
}, },
initData() { initData() {
},
handleSearch(){
setTimeout(()=> {
this.triggerListReload()
}, 300)
},
triggerListReload(){
this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据
}, },
handleSubmit() { handleSubmit() {

View File

@ -7,10 +7,10 @@
<u-row justify="between"> <u-row justify="between">
<view style="width: 130rpx;">运单号</view> <view style="width: 130rpx;">运单号</view>
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="orderNo" @change="handleScanValChange"></tpx-scan-input> <tpx-scan-input v-model:value="orderNo" @scanChange="handleScanValChange"></tpx-scan-input>
</view> </view>
<view class="pl-10"> <view class="pl-10">
<u-button custom-style="height: 74rpx;">确定</u-button> <u-button @click="handleScanValChange" custom-style="height: 74rpx;">确定</u-button>
</view> </view>
</u-row> </u-row>
@ -92,6 +92,7 @@
orderDetailModal: { orderDetailModal: {
show: false show: false
}, },
orderNo: '',
submitParam: { submitParam: {
} }
@ -115,13 +116,14 @@
this.billCode = this.queryOption.billCode || this.queryOption.orderSn this.billCode = this.queryOption.billCode || this.queryOption.orderSn
this.billCode && (this.queryOrderDetail(this.queryOption)) this.billCode && (this.queryOrderDetail(this.queryOption))
}, },
async queryOrderDetail(params) { async queryOrderDetail(params = {}) {
let res = await apiService.getOrderDetail({...params, _loading: true}) let orderNo = this.orderNo
let res = await apiService.getOrderDetail({ billCode: orderNo, orderSn: orderNo, ...params, _loading: true})
this.submitParam = res.data this.submitParam = res.data
this.pageLoading = false this.pageLoading = false
}, },
handleScanValChange: debounce(function(val){ handleScanValChange: debounce(function(){
val && ( this.queryOrderDetail({ billCode: val, orderSn: val, }) ) this.queryOrderDetail()
}), }),
handleDialogClick(curModal){ handleDialogClick(curModal){
curModal.show = true curModal.show = true

View File

@ -4,14 +4,14 @@
<template v-slot:body> <template v-slot:body>
<view class="pos-abt-all"> <view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun" <tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
ref="listRef" ref="listRef" :autoReload="false"
> >
<view class="blcok-white-noradius" style="margin-top: 0;"> <view class="blcok-white-noradius" style="margin-top: 0;">
<u-row justify="between"> <u-row justify="between">
<view style="width: 140rpx;" class="font-weight">运单号</view> <view style="width: 140rpx;" class="font-weight">运单号</view>
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入或扫码" <tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="right"></tpx-scan-input> @scanChange="handleSearch" iconPos="right"></tpx-scan-input>
</view> </view>
</u-row> </u-row>
<u-row justify="between" custom-style="margin-top:20rpx;"> <u-row justify="between" custom-style="margin-top:20rpx;">
@ -20,10 +20,10 @@
<tpx-date-input v-model:value="searchParam._date" placeholder="请选择时间"></tpx-date-input> <tpx-date-input v-model:value="searchParam._date" placeholder="请选择时间"></tpx-date-input>
</view> </view>
</u-row> </u-row>
<!-- <view class="mt-30"> <view class="mt-20">
<u-button @click="handleSubmit()" type="primary" size="large" shape="square" <u-button type="primary" size="large" shape="square" plain="true" @click="handleSearch"
custom-style="height:80rpx;font-size: 30rpx;border-radius: 14rpx;">查询</u-button> custom-style="height:66rpx;font-size: 30rpx;border-radius: 14rpx;">查询</u-button>
</view> --> </view>
</view> </view>
@ -107,6 +107,14 @@
}, },
initData() { initData() {
},
handleSearch(){
setTimeout(()=> {
this.triggerListReload()
}, 300)
},
triggerListReload(){
this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据
}, },
handleSubmit() { handleSubmit() {

View File

@ -7,7 +7,7 @@
<u-row justify="between"> <u-row justify="between">
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码" <tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="left"></tpx-scan-input> @scanChange="handleScanValChange" :showConfirm="true" @confirmClick="handleScanValChange" iconPos="left"></tpx-scan-input>
</view> </view>
</u-row> </u-row>
<u-row custom-style="margin-top:20rpx;"> <u-row custom-style="margin-top:20rpx;">
@ -105,10 +105,8 @@
initData() { initData() {
this.submitParam.billCode = this.queryOption.billCode this.submitParam.billCode = this.queryOption.billCode
}, },
handleScanValChange: debounce(async function(val){ handleScanValChange: debounce(async function(){
if(val) { let preBl = await preCheckScan({ scanType: scanTypeEnum.qianShou, param: { ...this.submitParam } })
let preBl = await preCheckScan({ scanType: scanTypeEnum.qianShou, param: { ...this.submitParam, billCode: val } })
}
}), }),
async handleSubmit() { async handleSubmit() {
await checkParams(this.submitParam, this.submitValidConfig) await checkParams(this.submitParam, this.submitValidConfig)

View File

@ -7,9 +7,10 @@
<u-row justify="between"> <u-row justify="between">
<view style="width: 130rpx;">运单号</view> <view style="width: 130rpx;">运单号</view>
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="submitParam.billCode" @change="handleScanChange"></tpx-scan-input> <tpx-scan-input v-model:value="submitParam.billCode"
@scanChange="handleScanChange" :showConfirm="!showCreateBNoBtn" @confirmClick="handleScanChange"></tpx-scan-input>
</view> </view>
<view class="pl-10" v-if="queryOption.type == pageTypeEnum.create || queryOption.copyBillCode"> <view class="pl-10" v-if="showCreateBNoBtn">
<u-button @click="handleCreateOrderNo()" <u-button @click="handleCreateOrderNo()"
custom-style="font-size: 28rpx;padding:0 10rpx;height: 74rpx;" :plain="true" >系统生成</u-button> custom-style="font-size: 28rpx;padding:0 10rpx;height: 74rpx;" :plain="true" >系统生成</u-button>
</view> </view>
@ -331,6 +332,9 @@
let { submitParam } = this let { submitParam } = this
return submitParam.paymentType == 2 || submitParam.paymentType == 4 || submitParam.paymentType == 5 return submitParam.paymentType == 2 || submitParam.paymentType == 4 || submitParam.paymentType == 5
}, },
showCreateBNoBtn(){
return this.queryOption.type == this.pageTypeEnum.create || this.queryOption.copyBillCode
}
}, },
data() { data() {
return this.getDefaultData() return this.getDefaultData()
@ -433,11 +437,11 @@
initEvent() { initEvent() {
}, },
handleScanChange: debounce(function(val){ handleScanChange: debounce(function(){
// 创建不做 查询详情 // 创建不做 查询详情
if(this.queryOption.type != pageTypeEnum.create) { if(this.queryOption.type != pageTypeEnum.create) {
// 扫码回调 要重新查询新运单信息,并覆盖老的 // 扫码回调 要重新查询新运单信息,并覆盖老的
this.queryOption.billCode = val this.queryOption.billCode = this.submitParam.billCode
this.initData(); this.initData();
this.initEvent() this.initEvent()
} }

View File

@ -4,8 +4,8 @@
<template v-slot:header> <template v-slot:header>
<view class="pgb-header"> <view class="pgb-header">
<view class="com-jianju"> <view class="com-jianju">
<tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入单号或扫码" <tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入单号或扫码"
@change="handleScanValChange" iconPos="right"></tpx-scan-input> @scanChange="handleTriggerChange" :showConfirm="true" @confirmClick="handleTriggerChange" iconPos="right"></tpx-scan-input>
</view> </view>
</view> </view>
</template> </template>
@ -127,10 +127,10 @@
initData() { initData() {
}, },
handleScanValChange: debounce(function(val){ handleTriggerChange: debounce(function(){
val && (this.handleSearch(val)) this.handleSearch()
}), }),
async handleSearch(val) { async handleSearch() {
let res = await apiService.getOrderDetail({...this.searchParam, _loading: true}) let res = await apiService.getOrderDetail({...this.searchParam, _loading: true})
// 通过对象合并才能修改父级 数据 // 通过对象合并才能修改父级 数据
Object.assign(this.modelInfo, res.data || {}) Object.assign(this.modelInfo, res.data || {})

View File

@ -28,9 +28,9 @@
</u-row> </u-row>
</u-row> </u-row>
<view class="mt-30"> <view class="mt-20">
<u-button type="primary" size="large" shape="square" plain="true" @click="handleSearch" <u-button type="primary" size="large" shape="square" plain="true" @click="handleSearch"
custom-style="height:80rpx;font-size: 30rpx;border-radius: 14rpx;">查询</u-button> custom-style="height:66rpx;font-size: 30rpx;border-radius: 14rpx;">查询</u-button>
</view> </view>
</view> </view>

View File

@ -21,7 +21,7 @@
<view style="width: 140rpx;" class="font-weight">运单号</view> <view style="width: 140rpx;" class="font-weight">运单号</view>
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入或扫码" <tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="right"></tpx-scan-input> @scanChange="handleSearch" iconPos="right"></tpx-scan-input>
</view> </view>
</u-row> </u-row>
<u-row justify="between" custom-style="margin-top:16rpx;"> <u-row justify="between" custom-style="margin-top:16rpx;">
@ -30,14 +30,21 @@
<tpx-date-input v-model:value="searchParam._date" placeholder="请选择时间"></tpx-date-input> <tpx-date-input v-model:value="searchParam._date" placeholder="请选择时间"></tpx-date-input>
</view> </view>
</u-row> </u-row>
<view class="mt-20">
<u-button type="primary" size="large" shape="square" plain="true" @click="handleSearch"
custom-style="height:66rpx;font-size: 30rpx;border-radius: 14rpx;">查询</u-button>
</view>
</view> </view>
<view class="com-jianju" style="padding-top: 16rpx;"> <view class="com-jianju" style="padding-top: 16rpx;">
<u-row justify="between" align="top"> <u-row justify="between" align="top">
<u-col span="12"> <u-col span="12">
<!-- 订单状态 --> <!-- 订单状态 -->
<tpx-tabs :list="dicData.emis_waybill_stat_type" v-model:value="searchParam.params.waybillStatType" <tpx-tabs :list="dicData.emis_waybill_stat_type" v-model:value="searchParam.params.waybillStatType"
@tabchange="(val)=> { handleSearchParamChange() }" v-slot="curOrdTab" @tabchange="handleSearch" v-slot="curOrdTab"
> >
<text slot> <text slot>
(<text>{{ staticInfo.orderStat[curOrdTab.item.val] || 0 }}</text>) (<text>{{ staticInfo.orderStat[curOrdTab.item.val] || 0 }}</text>)
@ -50,7 +57,7 @@
<template v-slot:body> <template v-slot:body>
<view class="pos-abt-all"> <view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun" <tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
ref="listRef" @onListReload="listenListReload" ref="listRef" :autoReload="false" @onListReload="listenListReload"
> >
<view class="pgb-cont"> <view class="pgb-cont">
<!-- 列表数据 --> <!-- 列表数据 -->
@ -171,8 +178,8 @@
methods: { methods: {
transSearchPm(param){ transSearchPm(param){
let cpParam = JSON.parse(JSON.stringify(param)) let cpParam = JSON.parse(JSON.stringify(param))
cpParam.params.beginDate = cpParam._date[0] cpParam.params.beginDate = cpParam?._date?.[0]
cpParam.params.endDate = cpParam._date[1] cpParam.params.endDate = cpParam?._date?.[1]
return cpParam return cpParam
}, },
async getListFun(param){ async getListFun(param){
@ -182,6 +189,11 @@
}, },
initData(){ initData(){
},
handleSearch(){
setTimeout(()=> {
this.triggerListReload()
}, 300)
}, },
listenListReload(params){ listenListReload(params){
// list重置到第一页,需重新查询统计数据 // list重置到第一页,需重新查询统计数据
@ -233,9 +245,6 @@
default: default:
break; break;
} }
},
handleSearchParamChange() {
} }
} }
} }

View File

@ -6,7 +6,7 @@
<u-row justify="between"> <u-row justify="between">
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="运单号, 请输入或扫码" <tpx-scan-input v-model:value="submitParam.billCode" placeholder="运单号, 请输入或扫码"
@change="handleScanValChange" iconPos="left"></tpx-scan-input> @scanChange="handleScanValChange" :showConfirm="true" @confirmClick="handleScanValChange" iconPos="left"></tpx-scan-input>
</view> </view>
</u-row> </u-row>
<u-row custom-style="margin-top:20rpx;"> <u-row custom-style="margin-top:20rpx;">
@ -131,12 +131,10 @@
this.resetForm() this.resetForm()
} }
}, },
handleScanValChange: debounce(async function(val){ handleScanValChange: debounce(async function(){
if(val) { let preBl = await preCheckScan({ scanType: scanTypeEnum.heBao, param: { ...this.submitParam }, list: this.resData.list })
let preBl = await preCheckScan({ scanType: scanTypeEnum.heBao, param: { ...this.submitParam, billCode: val }, list: this.resData.list }) if(preBl) {
if(preBl) { this.submitParam.billCode = ''
// this.submitParam.billCode = ''
}
} }
}), }),
resetForm() { resetForm() {

View File

@ -6,7 +6,7 @@
<u-row justify="between"> <u-row justify="between">
<view style="flex:1;"> <view style="flex:1;">
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码" <tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="left"></tpx-scan-input> @scanChange="handleScanValChange" :showConfirm="true" @confirmClick="handleScanValChange" iconPos="left"></tpx-scan-input>
</view> </view>
</u-row> </u-row>
<!-- <u-row custom-style="margin-top:20rpx;"> <!-- <u-row custom-style="margin-top:20rpx;">
@ -96,9 +96,8 @@
initData() { initData() {
this.submitParam.billCode = this.queryOption.billCode this.submitParam.billCode = this.queryOption.billCode
}, },
async handleSubmit(val) { async handleSubmit() {
let extParam = {} let extParam = {}
val && (extParam.billCode = val);
await checkParams(this.submitParam, this.submitValidConfig) await checkParams(this.submitParam, this.submitValidConfig)
let scnParam = getScanParams(scanTypeEnum.chaiBao, { ...this.submitParam, ...extParam }) let scnParam = getScanParams(scanTypeEnum.chaiBao, { ...this.submitParam, ...extParam })
let res = await apiService.scanRecord({...scnParam, _loading: true}) let res = await apiService.scanRecord({...scnParam, _loading: true})
@ -109,8 +108,8 @@
this.resetForm() this.resetForm()
} }
}, },
handleScanValChange: debounce(function(val){ handleScanValChange: debounce(function(){
val && (this.handleSubmit(val)) this.handleSubmit()
}), }),
resetForm() { resetForm() {
this.submitParam.billCode = '' this.submitParam.billCode = ''