generated from ccsens_fe/uni-vue3-template
19 changed files with 529 additions and 53 deletions
@ -0,0 +1,95 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-forms-item v-for="key in CODE_LIST_1" :key="key" :label="CODE_DICT[key].text" :name="key"> |
||||
|
<CodeFormItem :code="key" :value="codeAidForm[key]" @on-change="onChange(key, $event)" /> |
||||
|
</uni-forms-item> |
||||
|
|
||||
|
<!-- 溶栓开始前 --> |
||||
|
<uni-collapse ref="collapse"> |
||||
|
<uni-collapse-item :border="false" :open="true"> |
||||
|
<template v-slot:title><text class="uni-main-color">溶栓开始前</text></template> |
||||
|
<view class="u-p-l-30 u-p-t-20"> |
||||
|
<uni-forms-item v-for="key in CODE_LIST_2" :key="key" :name="key"> |
||||
|
<template v-slot:label> |
||||
|
<view class="full-height flex" style="width: 135px"> |
||||
|
<!-- @ts-ignore --> |
||||
|
{{ CODE_DICT[key]?.text }} <text v-if="CODE_DICT[key].description" |
||||
|
class="uni-secondary-color">{{ CODE_DICT[key].description }}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
<CodeFormItem :code="key" :value="codeAidForm[key]" @on-change="onChange(key, $event)" /> |
||||
|
</uni-forms-item> |
||||
|
</view> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
|
||||
|
<template v-for="key in CODE_LIST_3" :key="key" :name="key"> |
||||
|
<uni-forms-item v-if="computeShow(key, codeAidForm)"> |
||||
|
<template v-slot:label> |
||||
|
<view class="full-height flex" style="width: 135px"> |
||||
|
<!-- @ts-ignore --> |
||||
|
{{ CODE_DICT[key]?.text }} <text v-if="CODE_DICT[key].description" |
||||
|
class="uni-secondary-color">{{ CODE_DICT[key].description }}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
<CodeFormItem :code="key" :value="codeAidForm[key]" @on-change="onChange(key, $event)" /> |
||||
|
</uni-forms-item> |
||||
|
</template> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import { CODE_DICT } from '@/config/code'; |
||||
|
import { computed, reactive } from 'vue'; |
||||
|
import { computeShow } from '@/utils/common' |
||||
|
import { useServiceStore } from '@/store/modules/service'; |
||||
|
|
||||
|
const emits = defineEmits(['on-change']) |
||||
|
|
||||
|
const serviceStore = useServiceStore() |
||||
|
|
||||
|
const currentPatient = computed(() => serviceStore.currentPatient) |
||||
|
const currentCar = computed(() => serviceStore.currentCar) |
||||
|
|
||||
|
const CODE_LIST_1 = ['JMRS-TOOL', 'JMRS-TH-TIME', 'JMRS-SIGN'] |
||||
|
// 溶栓前form item list |
||||
|
const CODE_LIST_2 = ['JMRS-Q-NIHSS', 'JMRS-Q-SYSTOLIC-PRESSURE', 'JMRS-Q-DIASTOLIC-PRESSURE'] |
||||
|
|
||||
|
const CODE_LIST_3 = ['JMRS-RSCS', 'JMRS-TIME', 'JMRS-RSYW-ZL', 'JMRS-RSYW-ZL-ELSE', 'JMRS-TZJL', 'JMRS-JDJL', 'JMRS-GYSD', 'JMRS-15-NIHSS', 'JMRS-30-NIHSS', 'JMRS-45-NIHSS', 'JMRS-60-NIHSS', 'JMRS-H-NIHSS', 'JMRS-BFZ'] |
||||
|
|
||||
|
const codeAidForm = reactive({ |
||||
|
'JMRS-TOOL': '去查看', |
||||
|
'JMRS-TH-TIME': '', |
||||
|
'JMRS-SIGN': '去签署', |
||||
|
'JMRS-Q-NIHSS': '', |
||||
|
'JMRS-Q-SYSTOLIC-PRESSURE': '', |
||||
|
'JMRS-Q-DIASTOLIC-PRESSURE': '', |
||||
|
'JMRS-RSCS': '', 'JMRS-TIME': '', 'JMRS-RSYW-ZL': '', 'JMRS-RSYW-ZL-ELSE': '', 'JMRS-TZJL': '', 'JMRS-JDJL': '', 'JMRS-GYSD': '', 'JMRS-15-NIHSS': '', 'JMRS-30-NIHSS': '', 'JMRS-45-NIHSS': '', 'JMRS-60-NIHSS': '', 'JMRS-H-NIHSS': '', 'JMRS-BFZ': [''] |
||||
|
}) |
||||
|
|
||||
|
function onChange(key, event) { |
||||
|
codeAidForm[key] = event |
||||
|
emits('on-change', key, event) |
||||
|
} |
||||
|
|
||||
|
function init() { |
||||
|
|
||||
|
// 同步store里的急救信息 |
||||
|
if (!currentPatient.value) return |
||||
|
// 同步code信息 |
||||
|
const { recordValDict } = currentPatient.value |
||||
|
if (!recordValDict) return |
||||
|
|
||||
|
for (const key in codeAidForm) { |
||||
|
if (!recordValDict[key]) continue |
||||
|
if (CODE_DICT[key].type === 'checkbox') { |
||||
|
codeAidForm[key] = recordValDict[key][0]?.answer || [''] |
||||
|
} else { |
||||
|
codeAidForm[key] = recordValDict[key][0]?.answer[0] || [''] |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
init() |
||||
|
</script> |
@ -0,0 +1,25 @@ |
|||||
|
<template> |
||||
|
<uni-card :border="false"> |
||||
|
<view class="uni-secondary-color u-font-sm"> |
||||
|
<text class="u-m-r-30">{{ currentPatient?.patientName }}</text> |
||||
|
<text class="u-m-r-30">{{ currentPatient?.patientAge }}</text> |
||||
|
<text>{{ gender }}</text> |
||||
|
</view> |
||||
|
</uni-card> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import { useServiceStore } from '@/store/modules/service'; |
||||
|
import { computed } from 'vue'; |
||||
|
import { GET_GENDER_TEXT_BY_CODE } from '@/config/service'; |
||||
|
|
||||
|
const serviceStore = useServiceStore() |
||||
|
|
||||
|
const currentPatient = computed(() => serviceStore.currentPatient) |
||||
|
|
||||
|
const gender = computed(() => { |
||||
|
const val = currentPatient.value?.patientGender |
||||
|
if (!val) return '' |
||||
|
return GET_GENDER_TEXT_BY_CODE(Number(val)) |
||||
|
}) |
||||
|
</script> |
@ -0,0 +1,17 @@ |
|||||
|
import { onLoad } from '@dcloudio/uni-app' |
||||
|
import { ref } from 'vue' |
||||
|
|
||||
|
export function useGetFirstAidId(callback?: Function) { |
||||
|
const firstAidId = ref('') |
||||
|
onLoad(option => { |
||||
|
if (option?.firstAidId) { |
||||
|
firstAidId.value = option.firstAidId |
||||
|
// 新建过来的
|
||||
|
callback && callback(option.firstAidId) |
||||
|
} else { |
||||
|
firstAidId.value = '' |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
return { firstAidId } |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
<template> |
||||
|
<div class="JMRS-SIGN">JMRS-SIGN</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped></style> |
@ -0,0 +1,8 @@ |
|||||
|
<template> |
||||
|
<div class="JMRS-TOOL">JMRS-TOOL</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped></style> |
@ -0,0 +1,37 @@ |
|||||
|
<template> |
||||
|
<view class="u-p-30"> |
||||
|
<NameGenderAge /> |
||||
|
|
||||
|
<uni-card title="评分标准" :border="false"> |
||||
|
<uni-data-checkbox mode="list" v-model="formData.value" :localdata="MRS_LIST"></uni-data-checkbox> |
||||
|
|
||||
|
<view class="flex justify-center u-p-30"> |
||||
|
<u-button type="primary" size="medium" @click="onSubmit" class="bg-main" shape="circle">提交</u-button> |
||||
|
</view> |
||||
|
</uni-card> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import { reactive } from 'vue'; |
||||
|
import { MRS_LIST } from '@/config/service' |
||||
|
import { useGetFirstAidId } from '@/hooks/useGetFirstAidId'; |
||||
|
|
||||
|
const { firstAidId } = useGetFirstAidId() |
||||
|
|
||||
|
const formData = reactive({ value: '' }) |
||||
|
|
||||
|
async function onSubmit() { |
||||
|
try { |
||||
|
const answer = [formData.value] |
||||
|
const param = { codeAndAnswerList: [{ questionCode: 'RYPG-MRS', answer, time: '' }], firstAidId: firstAidId?.value, sourceId: '', sourceType: '' } |
||||
|
await uni.$u.api.updateAidCode(param) |
||||
|
uni.$u.toast('更新成功') |
||||
|
|
||||
|
// 更新数据 |
||||
|
uni.navigateBack() |
||||
|
} catch (error) { |
||||
|
uni.$u.alertError(error) |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,8 @@ |
|||||
|
<template> |
||||
|
<div class="NIHSS">NIHSS</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped></style> |
Loading…
Reference in new issue