This commit is contained in:
aihe 2024-06-20 19:09:46 +08:00
parent f26308d7f3
commit 8fe82846fe
3 changed files with 32 additions and 15 deletions

View File

@ -9,7 +9,7 @@
</template>
</u-input>
<view class="pos-abt-all">
<view v-if="showTools" @click.stop="">
<view v-if="showRangeTools" @click.stop="">
<tpx-select :list="toolsRangesList" v-model:value="rangeVal" mode="drop" @onChange="handleToolsRangChange">
<view :style="`height: 64rpx;`" ></view>
</tpx-select>
@ -42,6 +42,9 @@
return this.value
}
},
showRangeTools(){
return this.mode?.indexOf("range") > -1 && this.showTools
},
inputValue() {
let val = this.value
if(Array.isArray(val)) {
@ -53,7 +56,11 @@
val[1] = dayjs(val[1]).format(formatStr)
}
}
return val && (val.length > 1 ? val.join("~") : val[0])
// 范围是数组,单个是字符串
if(this.mode?.indexOf("range") > -1) {
val = val && (val.length > 1 ? val.join("~") : val[0])
}
return val
},
},
props: {
@ -69,7 +76,7 @@
},
fontSize: {
default () {
return 26
return 28
}
},
minDate: {
@ -135,19 +142,19 @@
this.handleSwitchCladar()
},
handleChange(val){
// 补全 时间戳
if(val[0].indexOf(":") == -1) {
val[0] = dayjs(val[0]).format(`${formatStr} 00:00:00`)
}
if(val[1].indexOf(":") == -1) {
val[1] = dayjs(val[1]).format(`${formatStr} 23:59:59`)
if(Array.isArray(val)) {
// 补全 时间戳
if(val[0].indexOf(":") == -1) {
val[0] = dayjs(val[0]).format(`${formatStr} 00:00:00`)
}
if(val[1].indexOf(":") == -1) {
val[1] = dayjs(val[1]).format(`${formatStr} 23:59:59`)
}
}
this.$emit('change', val)
this.$emit('update:value', val)
},
handleClaValChange(res) {
const ary = typeof res == 'string' ? [res] : Object.values(res)
const val = [ary[0], ary[ary.length-1]]
handleClaValChange(val) {
this.handleChange(val)
},
handleClaClose(res){

View File

@ -27,6 +27,9 @@
<view class="mt-20">
<tpx-input v-model:value="submitParam.destCity" placeholder="目的城市" :isWhite="true"></tpx-input>
</view>
<view class="mt-20">
<tpx-date-input v-model:value="submitParam.transferDate" placeholder="转件时间" mode="datetime"/>
</view>
</view>
</template>
<template v-slot:footer>
@ -46,7 +49,8 @@
import * as apiService from "@/common/api"
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
import { checkParams } from "@/common/validate"
export default {
components:{ },
props: {
@ -64,6 +68,10 @@
transferCode: '', // 转单同行快递代码
transferBillcode: '', // 转单同行单号
destCity: '', // 目的城市
transferDate: '', // 转件时间
},
submitValidConfig: {
billCode: { required: true, requiredMsg: '运单号不能为空' },
},
}
@ -84,6 +92,7 @@
},
async handleSubmit() {
await checkParams(this.submitParam, this.submitValidConfig)
let scnParam = getScanParams(scanTypeEnum.zhuanJian, { ...this.submitParam })
let res = await apiService.scanRecord({...scnParam, _loading: true})
let { bl, resItem } = ansScanResponse({ res, title: "转件" })

View File

@ -2,7 +2,8 @@ import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
'zh-Hans': zhHans, // 硬重置 中文 语言包顺序, 默认中文
en,
// en,
en: zhHans, // TODO 先注释, 硬重置 中文 语言包顺序, 默认中文
'zh-Hans': zhHans,
'zh-Hant': zhHant
}