Commit d14388e1 authored by Facius's avatar Facius

feat: 【前后台】流水号限制长度8位数字,输入框提示:请填写交易流水号后8位数字

parent 4af0ed5f
<!-- ******************* 输入框 ******************* -->
<template>
<view :style="{'width': fieldsWidth}">
<u-input :type="type" class="input-item" v-model="dataValue" @input="valueChange" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false" :border="border" border-color="#ECECEC" :maxlength="maxlength" :cursor-spacing="10" :disabled="isDisabled" hold-keyboard/>
<view class="content" v-if="slotContent">
<text class="txt">{{ slotContent }}</text>
</view>
</view>
<view :style="{ width: fieldsWidth }">
<u-input
:type="type"
class="input-item"
v-model="dataValue"
@input="valueChange"
:placeholder="placeholderText"
:placeholder-style="placeholderStyle"
:custom-style="customStyle"
:clearable="false"
:border="border"
border-color="#ECECEC"
:maxlength="maxlength"
:cursor-spacing="10"
:disabled="isDisabled"
hold-keyboard
/>
<view class="content" v-if="slotContent">
<text class="txt">{{ slotContent }}</text>
</view>
</view>
</template>
<script>
import stringMixin from './stringMixin'
export default {
name: 'XhInput', // 新建 input
components: {},
mixins: [stringMixin],
props: {
placeholder: {
type: String,
default: '请输入'
},
item: {
type: Object,
default() {
return {}
}
},
type: {
type: String,
default: 'text'
},
slotContent: {
type: String,
default: ''
}
},
data() {
return {
inputType: 'text'
}
},
computed: {
maxlength() {
return this.type == 'digit' ? 9 : 140
},
fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
},
placeholderStyle() {
return 'color:#999999;font-size:26rpx'
},
customStyle() {
return {
'background-color': this.backgroundColor,
'border-radius': '12rpx',
'color': '#333333',
'padding-left': this.textarea ? '0rpx' : '20rpx',
'font-size':'26rpx',
'height': '76rpx'
}
},
border() {
return this.textarea
},
textarea() {
return this.inputType == 'textarea'
},
backgroundColor() {
return this.textarea ? 'transparent' : '#F4F5F7'
},
isDisabled() {
return this.item.fieldsName === 'pipeAmount' || this.disabled ? true : false
}
},
watch: {},
mounted() {},
methods: {}
import stringMixin from './stringMixin'
export default {
name: 'XhInput', // 新建 input
components: {},
mixins: [stringMixin],
props: {
placeholder: {
type: String,
default: '请输入',
},
item: {
type: Object,
default() {
return {}
},
},
type: {
type: String,
default: 'text',
},
slotContent: {
type: String,
default: '',
},
},
data() {
return {
inputType: 'text',
}
},
computed: {
isDigit() {
return this.type == 'digit'
},
maxlength() {
return this.isDigit ? 9 : (this.isESerialNum ? 8 : 140)
},
fieldsWidth() {
return this.item.fieldsWidth ? this.item.fieldsWidth + 'rpx' : '100%'
},
placeholderStyle() {
return 'color:#999999;font-size:26rpx'
},
customStyle() {
return {
'background-color': this.backgroundColor,
'border-radius': '12rpx',
color: '#333333',
'padding-left': this.textarea ? '0rpx' : '20rpx',
'font-size': '26rpx',
height: '76rpx',
}
},
border() {
return this.textarea
},
textarea() {
return this.inputType == 'textarea'
},
backgroundColor() {
return this.textarea ? 'transparent' : '#F4F5F7'
},
isDisabled() {
return this.item.fieldsName === 'pipeAmount' || this.disabled
? true
: false
},
isESerialNum() {
return this.item.fieldsName === 'eSerialNum'
},
placeholderText() {
return this.isESerialNum ? '请填写交易流水号后8位数字' : this.placeholder
}
},
watch: {},
mounted() {},
methods: {},
}
</script>
<style lang="scss" scoped>
.input-item{
background: #F4F5F7;
}
.content {
padding-top: 20rpx;
line-height: 45rpx;
.txt {
font-size: 24rpx;
color: #999;
}
}
.input-item {
background: #f4f5f7;
}
.content {
padding-top: 20rpx;
line-height: 45rpx;
.txt {
font-size: 24rpx;
color: #999;
}
}
</style>
......@@ -347,7 +347,7 @@ const formType = new Map([
['decimal', ['input', 'digit']],
['double', ['input', 'digit']],
['integer', ['input', 'digit']],
['string', ['input', 'text']],
['string', ['input', 'number']],
['jscode', ['input', 'text']],
['multiinput', ['multiinput', 'text']],
['select', ['select', 'text']],
......@@ -827,7 +827,10 @@ export default {
panelResult.required++
let value = this.form[ele.fieldsName]
if (value && !Array.isArray(value)) {
panelResult.submitted++
// 非付款流水号 || 8位付款流水号
if (ele.fieldsName != 'eSerialNum' || value.length == 8) {
panelResult.submitted++
}
} else if (value && Array.isArray(value) && value.length > 0) {
if (ele.fieldsName === 'materialList') {
let hasMate = false
......@@ -950,7 +953,7 @@ export default {
maintainFields: this.handleSaveData(),
currentStep: this.list[this.tabIndex].panelFieldsName,
nextStep: this.list[this.tabIndex + 1].panelFieldsName,
version: 2
version: 2,
}
uni.showLoading({
title: '加载中',
......@@ -1135,12 +1138,12 @@ export default {
const actualPaid = groupItem.items.find(
(v) => v.fieldsName === 'actualPaid'
)
actualPaid.required = data.value != '03'
if (actualPaid) actualPaid.required = data.value != '03'
const eSerialNum = groupItem.items.find(
(v) => v.fieldsName === 'eSerialNum'
)
eSerialNum.required = data.value != '03'
if (eSerialNum) eSerialNum.required = data.value != '03'
}
if (
......@@ -1196,7 +1199,7 @@ export default {
orderNumber: this.orderNumber,
fieldsName: this.photoItem.fieldsName,
fieldsTitle: this.photoItem.fieldsTitle,
uploadType: 'camera'
uploadType: 'camera',
}
const value = await this.saveToTask(val, order)
this.$refs[
......@@ -1213,13 +1216,13 @@ export default {
let options = {
sourceType: ['album'], //['album', 'camera']
count: 3,
sizeType: ['original']
sizeType: ['original'],
}
const order = {
orderNumber: this.orderNumber,
fieldsName: this.photoItem.fieldsName,
fieldsTitle: this.photoItem.fieldsTitle,
uploadType: 'album'
uploadType: 'album',
}
const value = await this.chooseImg(options, order)
self.$refs[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment