fix: 健康管理系统,自测问题修复及功能优化完善。
This commit is contained in:
@@ -29,6 +29,15 @@
|
||||
<u--input v-model="form.birthday" disabled disabledColor="#ffffff" placeholder="请选择发生时间" inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="性别" prop="sexName" required @click="handleSex">
|
||||
<u--input v-model="form.sexName" disabled disabledColor="#ffffff" placeholder="请选择性别"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-down"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="身份证" prop="identityCard" >
|
||||
<u--input v-model="form.identityCard" placeholder="请填写身份证"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="排序" prop="ranking" >
|
||||
<u--input v-model="form.ranking" type="number" placeholder="请填写排序"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
@@ -65,6 +74,8 @@
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<u-picker itemHeight="88" :show="showType" :columns="typeList" keyName="dictLabel" @cancel="handleTypeCancel"
|
||||
@confirm="handleTypeConfirm"></u-picker>
|
||||
<u-picker itemHeight="88" :show="showSex" :columns="sexList" keyName="dictLabel" @cancel="handleSexCancel"
|
||||
@confirm="handleSexConfirm"></u-picker>
|
||||
<u-datetime-picker
|
||||
:show="birthdayShow"
|
||||
mode="date"
|
||||
@@ -89,6 +100,10 @@ const title = ref("成员管理")
|
||||
|
||||
const typeList = ref([])
|
||||
const showType = ref(false)
|
||||
|
||||
const sexList = ref([])
|
||||
const showSex = ref(false)
|
||||
|
||||
const data = reactive({
|
||||
form: {
|
||||
id: null,
|
||||
@@ -105,6 +120,8 @@ form: {
|
||||
nickName: null,
|
||||
height: null,
|
||||
weight: null,
|
||||
sex: null,
|
||||
identityCard: null,
|
||||
ranking: 0
|
||||
},
|
||||
rules: {
|
||||
@@ -112,6 +129,7 @@ rules: {
|
||||
nickName: [{ required: true, message: '昵称不能为空', trigger: ['change', 'blur'] }],
|
||||
birthday: [{ required: true, message: '生日不能为空', trigger: ['change', 'blur'] }],
|
||||
typeName: [{ required: true, message: '类型不能为空', trigger: ['change', 'blur'] }],
|
||||
sexName: [{ required: true, message: '性别不能为空', trigger: ['change', 'blur'] }],
|
||||
}
|
||||
})
|
||||
const { form, rules} = toRefs(data)
|
||||
@@ -127,7 +145,7 @@ onLoad((option) => {
|
||||
getData()
|
||||
})
|
||||
onReady(() => {
|
||||
form.value.birthday = dayjs(new Date().getTime()).format("YYYY-MM-DD")
|
||||
// form.value.birthday = dayjs(new Date().getTime()).format("YYYY-MM-DD")
|
||||
})
|
||||
function dictStr(val, arr) {
|
||||
let str = ''
|
||||
@@ -142,6 +160,10 @@ function getData() {
|
||||
// 类型
|
||||
getDicts('person_type').then(res => {
|
||||
typeList.value =[res.data]
|
||||
})
|
||||
// 类型
|
||||
getDicts('sys_user_sex').then(res => {
|
||||
sexList.value =[res.data]
|
||||
})
|
||||
if(form.value.id!=null){
|
||||
getPerson(form.value.id).then(res => {
|
||||
@@ -149,6 +171,10 @@ function getData() {
|
||||
// 类型
|
||||
getDicts('person_type').then(result => {
|
||||
form.value.typeName=dictStr(form.value.type, result.data)
|
||||
})
|
||||
// 类型
|
||||
getDicts('sys_user_sex').then(result => {
|
||||
form.value.sexName=dictStr(form.value.sex, result.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -173,6 +199,24 @@ function getData() {
|
||||
showType.value = false
|
||||
}
|
||||
|
||||
function handleSex() {
|
||||
if (sexList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '性别为空 ', type: 'warning'
|
||||
})
|
||||
} else {
|
||||
showSex.value = true
|
||||
}
|
||||
}
|
||||
function handleSexConfirm(e) {
|
||||
form.value.sexName = e.value[0].dictLabel
|
||||
form.value.sex = e.value[0].dictValue
|
||||
showSex.value = false
|
||||
}
|
||||
function handleSexCancel() {
|
||||
showSex.value = false
|
||||
}
|
||||
|
||||
function selectBirthday() {
|
||||
birthdayShow.value = true
|
||||
proxy.$refs['birthdayRef'].innerValue = new Date().getTime()
|
||||
|
||||
Reference in New Issue
Block a user