|
@ -7,17 +7,24 @@ |
|
|
<uni-icons type="scan" color="#70798C" size="24" /> |
|
|
<uni-icons type="scan" color="#70798C" size="24" /> |
|
|
</view> |
|
|
</view> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
|
|
|
|
|
|
<uni-forms-item label="姓名" name="patientName"> |
|
|
<uni-forms-item label="姓名" name="patientName"> |
|
|
<uni-easyinput type="text" v-model="baseInfo.patientName" placeholder="请输入姓名" /> |
|
|
<uni-easyinput type="text" v-model="baseInfo.patientName" placeholder="请输入姓名" @change="onBaseChange('patientName', $event)" /> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
|
|
|
|
|
|
<uni-forms-item name="patientGender" label="性别"> |
|
|
<uni-forms-item name="patientGender" label="性别"> |
|
|
<uni-data-checkbox v-model="baseInfo.patientGender" :localdata="GENDER_LIST" /> |
|
|
<uni-data-checkbox v-model="baseInfo.patientGender" :localdata="GENDER_LIST" |
|
|
|
|
|
@change="onBaseChange('patientGender', $event.detail.value)" /> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
|
|
|
|
|
|
<uni-forms-item label="民族" name="patientNation"> |
|
|
<uni-forms-item label="民族" name="patientNation"> |
|
|
<uni-data-select :localdata="nationList" v-model="baseInfo.patientNation" :clear="false" /> |
|
|
<uni-data-select :localdata="nationList" v-model="baseInfo.patientNation" :clear="false" |
|
|
|
|
|
@change="onBaseChange('patientNation', $event)" /> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
|
|
|
|
|
|
<uni-forms-item label="身份证号" name="patientIdCardNo"> |
|
|
<uni-forms-item label="身份证号" name="patientIdCardNo"> |
|
|
<uni-easyinput type="idcard" v-model="baseInfo.patientIdCardNo" placeholder="请输入身份证号" /> |
|
|
<uni-easyinput type="idcard" v-model="baseInfo.patientIdCardNo" placeholder="请输入身份证号" |
|
|
|
|
|
@change="onBaseChange('patientIdCardNo', $event)" /> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
|
|
|
|
|
|
<template v-for="(item, key) in codeForm" :key="key"> |
|
|
<template v-for="(item, key) in codeForm" :key="key"> |
|
@ -28,17 +35,23 @@ |
|
|
</uni-forms> |
|
|
</uni-forms> |
|
|
|
|
|
|
|
|
<uni-section type="line" title="疑似诊断" titleFontSize="16px"> </uni-section> |
|
|
<uni-section type="line" title="疑似诊断" titleFontSize="16px"> </uni-section> |
|
|
<uni-data-checkbox mode="list" v-model="baseInfo.firstAidZlType" :localdata="FIRST_AID_ZL_TYPE" class="white uni-radius-lg uni-pa-6"> |
|
|
<uni-data-checkbox mode="list" v-model="baseInfo.firstAidZlType" :localdata="FIRST_AID_ZL_TYPE" class="white uni-radius-lg uni-pa-6" |
|
|
|
|
|
@change="onBaseChange('firstAidZlType', $event.detail.value)"> |
|
|
</uni-data-checkbox> |
|
|
</uni-data-checkbox> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { reactive, ref } from 'vue'; |
|
|
import { reactive, ref, computed, inject } from 'vue'; |
|
|
|
|
|
import type { Ref } from 'vue' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
import { GENDER_LIST, FIRST_AID_ZL_TYPE } from '@/config/service' |
|
|
import { GENDER_LIST, FIRST_AID_ZL_TYPE } from '@/config/service' |
|
|
import { computed } from 'vue'; |
|
|
|
|
|
import { CODE_DICT } from '@/config/code'; |
|
|
import { CODE_DICT } from '@/config/code'; |
|
|
|
|
|
import { useServiceStore } from '@/store/modules/service'; |
|
|
|
|
|
|
|
|
|
|
|
const firstAidId = inject<Ref<string>>('firstAidId') |
|
|
|
|
|
const userStore = useUserStore() |
|
|
|
|
|
const serviceStore = useServiceStore() |
|
|
|
|
|
|
|
|
const baseInfo = reactive({ |
|
|
const baseInfo = reactive({ |
|
|
patientName: '张三', |
|
|
patientName: '张三', |
|
@ -61,9 +74,8 @@ const codeForm = reactive({ |
|
|
|
|
|
|
|
|
const nationList = ref([]) |
|
|
const nationList = ref([]) |
|
|
|
|
|
|
|
|
const userStore = useUserStore() |
|
|
|
|
|
|
|
|
|
|
|
const token = computed(() => userStore.token) |
|
|
const token = computed(() => userStore.token) |
|
|
|
|
|
const currentPatient = computed(() => serviceStore.currentPatient) |
|
|
|
|
|
|
|
|
// 提交创建急救 |
|
|
// 提交创建急救 |
|
|
async function onSubmit() { |
|
|
async function onSubmit() { |
|
@ -124,9 +136,41 @@ function upload(tempPath: string) { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 基础信息更新 |
|
|
|
|
|
* @param {string} type 字段名 |
|
|
|
|
|
* @param {string} event 值信息 |
|
|
|
|
|
*/ |
|
|
|
|
|
async function onBaseChange(type: string, event: string) { |
|
|
|
|
|
console.log(firstAidId?.value); |
|
|
|
|
|
if (!firstAidId?.value) { |
|
|
|
|
|
uni.$u.alertError('缺少急救id参数') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const param = { [type]: event, firstAidId: firstAidId?.value } |
|
|
|
|
|
try { |
|
|
|
|
|
await uni.$u.api.updateAidBase(param) |
|
|
|
|
|
uni.$u.toast('更新成功') |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
uni.$u.alertError(error) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// code form item change |
|
|
// code form item change |
|
|
function onChange(code: string, value: string) { |
|
|
async function onChange(code: string, value: string) { |
|
|
codeForm[code] = value |
|
|
codeForm[code] = value |
|
|
|
|
|
try { |
|
|
|
|
|
if (!firstAidId?.value) { |
|
|
|
|
|
uni.$u.alertError('缺少急救id参数') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const param = { codeAndAnswerList: [{ questionCode: code, answer: [value], time: '' }], firstAidId: firstAidId?.value, sourceId: '', sourceType: '' } |
|
|
|
|
|
await uni.$u.api.updateAidCode(param) |
|
|
|
|
|
uni.$u.toast('更新成功') |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
uni.$u.alertError(error) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 计算code form 前置条件的显示 |
|
|
// 计算code form 前置条件的显示 |
|
@ -145,6 +189,26 @@ async function getNationList() { |
|
|
uni.$u.alertError(error) |
|
|
uni.$u.alertError(error) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function init() { |
|
|
// 初始获取民族 |
|
|
// 初始获取民族 |
|
|
getNationList() |
|
|
getNationList() |
|
|
|
|
|
|
|
|
|
|
|
// 同步store里的急救信息 |
|
|
|
|
|
if (!currentPatient.value) return |
|
|
|
|
|
for (const key in baseInfo) { |
|
|
|
|
|
baseInfo[key] = currentPatient.value[key] |
|
|
|
|
|
} |
|
|
|
|
|
// 同步code信息 |
|
|
|
|
|
const { recordValDict } = currentPatient.value |
|
|
|
|
|
if (!recordValDict) return |
|
|
|
|
|
|
|
|
|
|
|
for (const key in codeForm) { |
|
|
|
|
|
if (!recordValDict[key]) continue |
|
|
|
|
|
codeForm[key] = recordValDict[key][0]?.answer[0] || '' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init() |
|
|
</script> |
|
|
</script> |
|
|