|
|
@ -1,44 +1,45 @@ |
|
|
|
<template> |
|
|
|
<view style="border: 1px solid #e5e5e5"> |
|
|
|
<view v-for="(item, index) in medicineInfo" :key="index"> |
|
|
|
<template v-for="(colItem, itemIndex) in item"> |
|
|
|
<u-collapse |
|
|
|
v-if="colItem.showType === 1" |
|
|
|
:key="itemIndex" |
|
|
|
:head-style="headStyle" |
|
|
|
:body-style="bodyStyle" |
|
|
|
:accordion="false" |
|
|
|
style="border-bottom: 1px solid #f8f8f8" |
|
|
|
> |
|
|
|
<u-collapse-item :title="colItem.name" :open="false"> |
|
|
|
<!-- 单选 --> |
|
|
|
<view v-if="colItem.type === 1"> |
|
|
|
<u-radio-group v-model="colItem.value"> |
|
|
|
<u-radio |
|
|
|
class="mb-2" |
|
|
|
@change="change($event, index, itemIndex, colItem.type)" |
|
|
|
v-for="(radioItem, radioIndex) in colItem.radioList" |
|
|
|
:key="radioIndex" |
|
|
|
:name="radioItem" |
|
|
|
> |
|
|
|
{{ radioItem }} |
|
|
|
</u-radio> |
|
|
|
</u-radio-group> |
|
|
|
</view> |
|
|
|
</u-collapse-item> |
|
|
|
</u-collapse> |
|
|
|
<view v-else :key="itemIndex" class="flex justify-between items-center text-sm" style="border-bottom: 1px solid #f8f8f8"> |
|
|
|
<view class="pl-4 py-3 font-bold" style="border-bottom: 1px solid #f8f8f8">{{ item.title }}</view> |
|
|
|
<template v-for="(colItem, itemIndex) in item.date"> |
|
|
|
<view :key="itemIndex" class="flex justify-between items-center text-sm" style="border-bottom: 1px solid #f8f8f8"> |
|
|
|
<view class="ml-4 my-3">{{ colItem.name }}</view> |
|
|
|
<!-- 单选 --> |
|
|
|
<view v-if="colItem.type === 1"> |
|
|
|
<u-radio-group v-model="colItem.value" class="flex items-center"> |
|
|
|
<u-radio |
|
|
|
@change="change($event, index, itemIndex, colItem.type)" |
|
|
|
v-for="(radioItem, radioIndex) in colItem.radioList" |
|
|
|
:key="radioIndex" |
|
|
|
:name="radioItem" |
|
|
|
> |
|
|
|
{{ radioItem }} |
|
|
|
</u-radio> |
|
|
|
</u-radio-group> |
|
|
|
</view> |
|
|
|
<!-- 数字输入框 --> |
|
|
|
<view v-if="colItem.type === 3" class="pr-7"> |
|
|
|
<u-input v-model="colItem.value" type="number" input-align="right" /> |
|
|
|
</view> |
|
|
|
<!-- input 文本输入框 --> |
|
|
|
<view v-if="colItem.type === 8" class="pr-7"> |
|
|
|
<u-input v-model="colItem.value" input-align="right" /> |
|
|
|
<!-- 数字输入框+单选 --> |
|
|
|
<view v-if="colItem.type === 4" class="flex flex-nowrap"> |
|
|
|
<u-input |
|
|
|
:clearable="false" |
|
|
|
class="flex-1 mr-3" |
|
|
|
v-model="colItem.value" |
|
|
|
placeholder="每日总剂量(单位: mg)" |
|
|
|
type="number" |
|
|
|
input-align="center" |
|
|
|
@focus="colItem.checked = false" |
|
|
|
/> |
|
|
|
<u-checkbox-group @change="change($event, index, itemIndex, colItem.type)"> |
|
|
|
<u-checkbox v-model="colItem.checked" shape="circle">未服用</u-checkbox> |
|
|
|
</u-checkbox-group> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<view class="w-full h-2 bg-gray-100" v-if="index !== medicineInfo.length - 1"></view> |
|
|
|
</view> |
|
|
|
<u-button type="primary" class="m-4">开始填表</u-button> |
|
|
|
</view> |
|
|
@ -63,6 +64,7 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
change(e, index, itemIndex, type) { |
|
|
|
console.log('e: ', e); |
|
|
|
console.log('type: ', type); |
|
|
|
this.medicineInfo[index][itemIndex].value = e; |
|
|
|
}, |
|
|
|