fix: 健康管理系统,自测问题修复及功能优化完善。
This commit is contained in:
@@ -36,13 +36,14 @@
|
||||
<u--input v-model="form.endTime" 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="exerciseTime" >
|
||||
<!-- <u-form-item label="活动时长" prop="exerciseTime" >
|
||||
<u--input v-model="form.exerciseTime" placeholder="请填写活动时长"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="活动量" prop="activityVolume" >
|
||||
<u--input v-model="form.activityVolume" placeholder="请填写活动量"
|
||||
</u-form-item> -->
|
||||
<u-form-item label="活动量" prop="activityVolumeName" required @click="handleActivityVolume">
|
||||
<u--input v-model="form.activityVolumeName" 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="totalCost" >
|
||||
<u--input v-model="form.totalCost" type="number" placeholder="请填写总费用"
|
||||
@@ -78,6 +79,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="showActivityVolume" :columns="activityVolumeList" keyName="dictLabel" @cancel="handleActivityVolumeCancel"
|
||||
@confirm="handleActivityVolumeConfirm"></u-picker>
|
||||
<u-datetime-picker
|
||||
:show="startTimeShow"
|
||||
mode="datetime"
|
||||
@@ -110,8 +113,13 @@ const birthdayShow = ref(false)
|
||||
const title = ref("活动记录")
|
||||
const startTimeShow = ref(false)
|
||||
const endTimeShow = ref(false)
|
||||
|
||||
const typeList = ref([])
|
||||
const showType = ref(false)
|
||||
|
||||
const activityVolumeList = ref([])
|
||||
const showActivityVolume = ref(false)
|
||||
|
||||
const data = reactive({
|
||||
form: {
|
||||
id: null,
|
||||
@@ -130,7 +138,7 @@ form: {
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
totalCost: null,
|
||||
totalCost: 0,
|
||||
partner: null,
|
||||
costDetail: null
|
||||
},
|
||||
@@ -140,8 +148,7 @@ rules: {
|
||||
partner: [{ required: true, message: '成员不能为空', trigger: ['change', 'blur'] }],
|
||||
startTime: [{ required: true, message: '开始时间不能为空', trigger: ['change', 'blur'] }],
|
||||
endTime: [{ required: true, message: '结束时间不能为空', trigger: ['change', 'blur'] }],
|
||||
exerciseTime: [{ required: true, message: '活动时长不能为空', trigger: ['change', 'blur'] }],
|
||||
activityVolume: [{ required: true, message: '活动量不能为空', trigger: ['change', 'blur'] }],
|
||||
activityVolumeName: [{ required: true, message: '活动量不能为空', trigger: ['change', 'blur'] }],
|
||||
typeName: [{ required: true, message: '类型不能为空', trigger: ['change', 'blur'] }],
|
||||
}
|
||||
})
|
||||
@@ -190,6 +197,10 @@ function getData() {
|
||||
// 类型
|
||||
getDicts('activity_type').then(res => {
|
||||
typeList.value =[res.data]
|
||||
})
|
||||
// 类型
|
||||
getDicts('activity_exercise').then(res => {
|
||||
activityVolumeList.value =[res.data]
|
||||
})
|
||||
if(form.value.id!=null){
|
||||
getActivity(form.value.id).then(res => {
|
||||
@@ -197,6 +208,10 @@ function getData() {
|
||||
// 类型
|
||||
getDicts('activity_type').then(result => {
|
||||
form.value.typeName=dictStr(form.value.type, result.data)
|
||||
})
|
||||
// 类型
|
||||
getDicts('activity_exercise').then(result => {
|
||||
form.value.activityVolumeName=dictStr(form.value.activityVolume, result.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -221,6 +236,24 @@ function getData() {
|
||||
showType.value = false
|
||||
}
|
||||
|
||||
function handleActivityVolume() {
|
||||
if (activityVolumeList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '活动量为空 ', type: 'warning'
|
||||
})
|
||||
} else {
|
||||
showActivityVolume.value = true
|
||||
}
|
||||
}
|
||||
function handleActivityVolumeConfirm(e) {
|
||||
form.value.activityVolumeName = e.value[0].dictLabel
|
||||
form.value.activityVolume = e.value[0].dictValue
|
||||
showActivityVolume.value = false
|
||||
}
|
||||
function handleActivityVolumeCancel() {
|
||||
showActivityVolume.value = false
|
||||
}
|
||||
|
||||
|
||||
function submit() {
|
||||
proxy.$refs['uForm'].validate().then(() => {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<view class="list-item">
|
||||
<view class="item-header">
|
||||
<u--text lines="2" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
|
||||
:text="dictStr(item.type,typeList) +':在'+item.place+',活动'+item.exerciseTime" size="30rpx" color="#333333" :bold="true"></u--text>
|
||||
:text="dictStr(item.type,typeList) +'- 在 '+item.place+' 活动 '+item.exerciseTimeStr" size="30rpx" color="#333333" :bold="true"></u--text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">活动名称:</text>
|
||||
@@ -38,11 +38,11 @@
|
||||
</view> -->
|
||||
<view class="item-row">
|
||||
<text class="row-label">活动量:</text>
|
||||
<text class="row-value">{{ item.activityVolume }}</text>
|
||||
<text class="row-value">{{dictStr(item.activityVolume,activityVolumeList) }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">总费用(元):</text>
|
||||
<text class="row-value">{{ item.totalCost }}</text>
|
||||
<text class="row-label">总费用:</text>
|
||||
<text class="row-value">{{ item.totalCost+' 元' }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">费用明细:</text>
|
||||
@@ -89,6 +89,8 @@ const listData = ref([])
|
||||
const isShow = ref(false)
|
||||
const status = ref('loadmore')
|
||||
const typeList = ref([])
|
||||
const activityVolumeList = ref([])
|
||||
|
||||
|
||||
const flag= ref(true)
|
||||
const data = reactive({
|
||||
@@ -141,6 +143,10 @@ function getList() {
|
||||
// 类型
|
||||
getDicts('activity_type').then(res => {
|
||||
typeList.value = res.data
|
||||
})
|
||||
// 类型
|
||||
getDicts('activity_exercise').then(res => {
|
||||
activityVolumeList.value = res.data
|
||||
})
|
||||
status.value = 'loading'
|
||||
listActivity({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user