Commit d14388e1 authored by Facius's avatar Facius

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

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