Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复移动端单据详情字段必填校验的问题 #1221

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions frontend/weixin/src/components/renderField/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ export default defineComponent({
})
const results = validateFns.map(fn => fn())
const required = results.every(item => item)
const allNotSupportTypes = [...notSupportEditTypes, ...notSupportTypes]
const hasNotSupportField = fields.value.some(field => allNotSupportTypes.indexOf(field.type) !== -1)
return required && !hasNotSupportField
return required
}

/** 字段隐藏逻辑处理 */
Expand Down
11 changes: 7 additions & 4 deletions frontend/weixin/src/components/renderField/notSupport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->

<template>
<div v-if="!isViewMode" class="not-support required">
<div v-if="!isViewMode" :class="['not-support', { required: isRequire }]">
<span class="van-ellipsis">{{ item.name }}
<van-icon name="info-o" color="#ffb213" @click="handelNotSupportPrompt" />
</span>
Expand All @@ -36,7 +36,7 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { defineComponent, computed, toRefs } from 'vue'
import { Toast } from 'vant'

export default defineComponent({
Expand All @@ -51,14 +51,17 @@ export default defineComponent({
default: false
}
},
setup() {
setup(props) {
const { item } = toRefs(props)
const isRequire = computed(() => item.value.validate_type === 'REQUIRE')

const handelNotSupportPrompt = () => {
Toast({
message: '暂不支持操作,请至PC端处理',
className: 'not-support-toast'
})
}
return { handelNotSupportPrompt }
return { isRequire, handelNotSupportPrompt }
}
})

Expand Down
Loading