Commit 0abc7c96 authored by songrui's avatar songrui

诊断 接口对接

parent 90fe4509
...@@ -19,3 +19,8 @@ export function getInspectCode(configType) { ...@@ -19,3 +19,8 @@ export function getInspectCode(configType) {
export function queryDiseaseCode(params) { export function queryDiseaseCode(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-disease-code/icd-list`, body: params, loading: true }) return fetchBase({ url: `/chronic-admin/v1/chronic-disease-code/icd-list`, body: params, loading: true })
} }
//获取诊断详细信息
export function getDiagnoseDetail(id){
return fetchBase({ url: `/chronic-admin/v1/chronic-diagnose-record/record`,body:{ id: id }, loading: true })
}
\ No newline at end of file
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
if (!token) { if (!token) {
token = sessionStorage.getItem('token') token = sessionStorage.getItem('token')
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
token = '0d1698ec-49a1-40db-bbfa-bcdf5b16d13b' token = 'f44efca7-3c9b-4638-b8b0-8e35c6fbb54b'
} }
} }
if (token) { if (token) {
......
...@@ -45,6 +45,9 @@ export default { ...@@ -45,6 +45,9 @@ export default {
methods: { methods: {
init() { init() {
this.innerValue = this.value this.innerValue = this.value
this.multipleCheck()
},
multipleCheck() {
if (this.multiple) { if (this.multiple) {
if (this.value != null && !Array.isArray(this.value)) { if (this.value != null && !Array.isArray(this.value)) {
console.warn('CheckBtn: multiple must be Array type') console.warn('CheckBtn: multiple must be Array type')
...@@ -92,6 +95,7 @@ export default { ...@@ -92,6 +95,7 @@ export default {
value: { value: {
handler(value) { handler(value) {
this.innerValue = value this.innerValue = value
this.multipleCheck()
}, },
immediate: true immediate: true
}, },
......
...@@ -98,10 +98,10 @@ ...@@ -98,10 +98,10 @@
@change="onSelectInputConfirm"></InputSelect> @change="onSelectInputConfirm"></InputSelect>
</div> </div>
<van-field name="imageData" <van-field name="imageData"
class="no-back mb-2" class="no-back"
label="图片上传" label="图片上传"
label-align="top" label-align="top"
style="order: 99"> style="padding: 0">
<template #input> <template #input>
<DocImageUpload :imageData="imageData" <DocImageUpload :imageData="imageData"
@change="(ids, option) => image = ids" @change="(ids, option) => image = ids"
......
...@@ -3,9 +3,12 @@ ...@@ -3,9 +3,12 @@
<DocNavBar :title="`${id ? '修改' : '新增'}慢病诊断`" class="shrink-0" <DocNavBar :title="`${id ? '修改' : '新增'}慢病诊断`" class="shrink-0"
:backFunc="onBack"></DocNavBar> :backFunc="onBack"></DocNavBar>
<div class="p-4 overflow-y-auto grow" ref="all"> <div class="p-4 overflow-y-auto grow" ref="all">
<DiseaseSelect v-if="step == 1" :excludeType="excludeType" ref="DiseaseSelect"/> <DiseaseSelect v-if="step == 1"
:excludeType="excludeType"
:value="diseaseType"
ref="DiseaseSelect"/>
<archiveCommon :info="baseInfo" v-else-if="step == 2"></archiveCommon> <archiveCommon :info="baseInfo" v-else-if="step == 2"></archiveCommon>
<FormCont :diseaseType="innerDiseaseType" v-else-if="step == 3"/> <FormCont :info="diagnoseInfo" :diseaseType="innerDiseaseType" v-else-if="step == 3"/>
</div> </div>
<div class="shrink-0"> <div class="shrink-0">
<div class='bottom-small-line'></div> <div class='bottom-small-line'></div>
...@@ -36,8 +39,10 @@ import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue' ...@@ -36,8 +39,10 @@ import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue'
import archiveCommon from '@/doctor/components/archiveCommon/archiveCommon.vue' import archiveCommon from '@/doctor/components/archiveCommon/archiveCommon.vue'
import DiseaseSelect from './DiseaseSelect.vue' import DiseaseSelect from './DiseaseSelect.vue'
import FormCont from './FormCont.vue' import FormCont from './FormCont.vue'
import { fetchDataHandle } from '@/utils/common.js'
import { getChronicResidentsId } from '@/api/doctor/generalFU' import { getChronicResidentsId } from '@/api/doctor/generalFU'
import { showSuccessToast } from 'vant' import { showSuccessToast } from 'vant'
import { getDiagnoseDetail } from '@/api/doctor/disease.js'
export default { export default {
components: { components: {
...@@ -51,6 +56,8 @@ export default { ...@@ -51,6 +56,8 @@ export default {
step: 1, step: 1,
// 患者基础信息 // 患者基础信息
baseInfo: {}, baseInfo: {},
// 诊断信息
diagnoseInfo: {},
innerDiseaseType: null innerDiseaseType: null
} }
}, },
...@@ -59,11 +66,15 @@ export default { ...@@ -59,11 +66,15 @@ export default {
return this.$route.query.id return this.$route.query.id
}, },
diseaseType() { diseaseType() {
return this.$route.query.diseaseType const val = this.$route.query.diseaseType
return val ? +val : undefined
}, },
residentInfoId() { residentInfoId() {
return this.$route.query.residentInfoId return this.$route.query.residentInfoId
}, },
idCard() {
return this.$route.query.idCard
},
excludeType() { excludeType() {
const excludeType = this.$route.query.excludeType const excludeType = this.$route.query.excludeType
return excludeType && excludeType.split(',').map(e => Number(e)) return excludeType && excludeType.split(',').map(e => Number(e))
...@@ -75,10 +86,21 @@ export default { ...@@ -75,10 +86,21 @@ export default {
methods: { methods: {
async init() { async init() {
if (this.id) { if (this.id) {
const res = await getDiagnoseDetail(this.id)
const result = res.data || {}
this.diagnoseInfo = fetchDataHandle(result, {
diagnoseResult: 'strToArrNum'
})
this.baseInfo = result.residentsRecord || {}
} else { } else {
if (this.residentInfoId) {
let res = await getChronicResidentsId(this.residentInfoId) let res = await getChronicResidentsId(this.residentInfoId)
this.baseInfo = res.data || {} this.baseInfo = res.data || {}
this.diagnoseInfo.residentInfoId = this.residentInfoId
} else if (this.idCard) {
// 新建用户
this.baseInfo.idCard = this.idCard
}
} }
}, },
submit() { submit() {
......
...@@ -21,7 +21,8 @@ import { useStore } from '@/doctor/store/index.js' ...@@ -21,7 +21,8 @@ import { useStore } from '@/doctor/store/index.js'
export default { export default {
props: { props: {
// 排除已选择的疾病 // 排除已选择的疾病
excludeType: { default: () => [] } excludeType: { default: () => [] },
value: { default: () => [] }
}, },
data() { data() {
return { return {
...@@ -33,6 +34,10 @@ export default { ...@@ -33,6 +34,10 @@ export default {
methods: { methods: {
onSelect(item) { onSelect(item) {
if (this.excludeType.includes(item.value)) return if (this.excludeType.includes(item.value)) return
if (this.value) {
this.$message.info('编辑状态下 慢病类型 无法修改')
return
}
this.diseaseType = item.value this.diseaseType = item.value
}, },
submit() { submit() {
...@@ -45,6 +50,14 @@ export default { ...@@ -45,6 +50,14 @@ export default {
resolve(this.diseaseType) resolve(this.diseaseType)
}) })
} }
},
watch: {
value: {
handler(val) {
this.diseaseType = val
},
immediate: true
}
} }
} }
</script> </script>
......
<template>
<van-form ref='form' class="doc-form doctor-info">
<div class="doc-form-label" required>筛查单位</div>
<van-field is-link
v-model='form.diseaseUnitName'
readonly
placeholder='请选择'
name="diseaseUnitId"
/>
<div class="doc-form-label" required>筛查科室</div>
<van-field is-link
v-model='form.diseaseOfficeName'
readonly
placeholder='请选择'
name="diseaseOfficeId"
@click="showOffice = true"
:rules="[{ required: true, message: '请选择' }]"
/>
<DocOffice v-model:show="showOffice"
v-model:value="form.diseaseOfficeId"
:unitId="form.diseaseUnitId"
@change="officeChange"
/>
<div class="doc-form-label" required>筛查医生</div>
<van-field is-link
v-model='form.diseaseDoctorName'
readonly
placeholder='请选择'
name="diseaseDoctorId"
@click="showDoctor = true"
:rules="[{ required: true, message: '请选择' }]"
/>
<DocOfficeDoctor v-model:show="showDoctor"
:allowClear="false"
v-model:value="form.diseaseDoctorId"
:unitId="form.diseaseUnitId"
:officeId="form.diseaseOfficeId"
@change="(option) => { form.diseaseDoctorName = option.staffName }"
/>
</van-form>
</template>
<script>
import { useStore } from '@/doctor/store'
import dayjs from 'dayjs'
import DocOffice from '@/doctor/components/docOffice/DocOffice.vue'
import DocOfficeDoctor from '@/doctor/components/docOfficeDoctor/DocOfficeDoctor.vue'
const defaultForm = (info = {}) => {
const form = {
createDate: undefined,
// 诊断单位
diseaseUnitId: undefined,
diseaseUnitName: undefined,
// 诊断科室
diseaseOfficeId: undefined,
diseaseOfficeName: undefined,
// 诊断医生
diseaseDoctorId: undefined,
diseaseDoctorName: undefined,
// 录入单位
createUnitId: undefined,
createUnitName: undefined,
// 录入科室
createOfficeId: undefined,
createOfficeName: undefined,
// 录入医生
createDoctorId: undefined,
createDoctorName: undefined
}
Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) {
form[key] = info[key]
}
})
return form
}
export default {
components: {
DocOffice,
DocOfficeDoctor
},
props: {
info: { default: () => ({}) }
},
data() {
return {
form: {},
store: useStore(),
showUnit: false,
showOffice: false,
showDoctor: false
}
},
computed: {
authInfo() {
return this.store.authInfo
}
},
methods: {
initForm() {
this.form.createDate = dayjs().format('YYYY-MM-DD')
// 诊断单位
this.form.diseaseUnitId = this.authInfo.unitId
this.form.diseaseUnitName = this.authInfo.unitName
// 诊断科室
this.form.diseaseOfficeId = this.authInfo.officeId
this.form.diseaseOfficeName = this.authInfo.officeName
// 诊断医生
this.form.diseaseDoctorId = this.authInfo.relationId
this.form.diseaseDoctorName = this.authInfo.nickName
// 录入单位
this.form.createUnitId = this.authInfo.unitId
this.form.createUnitName = this.authInfo.unitName
// 录入科室
this.form.createOfficeId = this.authInfo.officeId
this.form.createOfficeName = this.authInfo.officeName
// 录入医生
this.form.createDoctorId = this.authInfo.relationId
this.form.createDoctorName = this.authInfo.nickName
},
unitChange(option = {}) {
this.form.diseaseUnitName = option.unitName
this.form.diseaseDoctorId = undefined
this.form.diseaseDoctorName = undefined
this.form.diseaseOfficeId = undefined
this.form.diseaseOfficeName = undefined
},
officeChange(option = {}) {
this.form.diseaseOfficeName = option.officeName
this.form.diseaseDoctorId = undefined
this.form.diseaseDoctorName = undefined
},
submit() {
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
resolve(this.form)
}).catch((e) => {
reject(e)
})
})
}
},
watch: {
info: {
handler(info) {
this.form = defaultForm(info)
if (!this.info.id) {
this.initForm()
}
},
immediate: true
}
}
}
</script>
<style lang="less" scoped></style>
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
readonly readonly
name="manageDate" name="manageDate"
placeholder="请选择" placeholder="请选择"
@click="showManageDate = true" @click="showDate('manageDate')"
:rules="rules.requiredSelect" :rules="rules.requiredSelect"
/> />
<van-popup v-model:show="showManageDate" position="bottom"> <van-popup v-model:show="dateOption.show" position="bottom">
<van-date-picker v-model="form._screenDate" <van-date-picker
:min-date="manageDateRange.min" :min-date="dateRange.min"
:max-date="manageDateRange.max" :max-date="dateRange.max"
@confirm="manageDateConfirm" @cancel="showManageDate = false" /> @confirm="dateConfirm" @cancel="dateOption.show = false" />
</van-popup> </van-popup>
<div class='doc-form-label' required>诊断名称</div> <div class='doc-form-label' required>诊断名称</div>
...@@ -34,21 +34,166 @@ ...@@ -34,21 +34,166 @@
:diseaseType="diseaseType" :diseaseType="diseaseType"
@change="icdChange"/> @change="icdChange"/>
<div class='doc-form-label' required>诊断评估</div> <div class='doc-form-label' required>诊断日期</div>
<van-field
v-model="form.diseaseDate"
is-link
readonly
name="diseaseDate"
placeholder="请选择"
@click="showDate('diseaseDate')"
:rules="rules.requiredSelect"
/>
<div class='doc-form-label' required v-if="![1, 4].includes(diseaseType)">诊断评估</div>
<template v-if="diseaseType == 1">
<div class='doc-form-label' required>高血压分级</div> <div class='doc-form-label' required>高血压分级</div>
<van-field
v-model="form.diagnoseAssessName"
is-link
readonly
name="diagnoseAssess"
placeholder="请选择"
@click="showOptions('diagnoseAssess', 'CP00096')"
:rules="rules.requiredSelect"
/>
<div class='doc-form-label' required>高血压危险分层</div> <div class='doc-form-label' required>高血压危险分层</div>
<van-field
v-model="form.diagnoseLevelName"
is-link
readonly
name="diagnoseLevel"
placeholder="请选择"
@click="showOptions('diagnoseLevel', 'CP00097')"
:rules="rules.requiredSelect"
/>
</template>
<template v-else-if="diseaseType == 4">
<div class='doc-form-label' required>缺血性脑卒中</div> <div class='doc-form-label' required>缺血性脑卒中</div>
<van-field
v-model="form.diagnoseResultName"
is-link
readonly
name="diagnoseResult"
placeholder="请选择"
@click="showOptions('diagnoseResult', 'CP00103', 'checkbox')"
:rules="rules.requiredSelect"
/>
<div class='doc-form-label' required>出血性脑卒中</div> <div class='doc-form-label' required>出血性脑卒中</div>
<van-field
v-model="form.diagnoseLevelName"
is-link
readonly
name="diagnoseLevel"
placeholder="请选择"
@click="showOptions('diagnoseLevel', 'CP00104')"
:rules="rules.requiredSelect"
/>
</template>
<template v-else-if="[2,3].includes(diseaseType)">
<!-- 糖尿病 冠心病 -->
<van-field
v-model="form.diagnoseResultName"
is-link
readonly
name="diagnoseResult"
placeholder="请选择"
@click="showOptions('diagnoseResult', resultSelectOption.dictMap[diseaseType], 'checkbox')"
:rules="rules.requiredSelect"
/>
</template>
<template v-else>
<!-- 慢阻肺 慢性肾脏病 血脂异常 -->
<van-field
v-model="form.diagnoseAssessName"
is-link
readonly
name="diagnoseAssess"
placeholder="请选择"
@click="showOptions('diagnoseAssess', resultSelectOption.dictMap[diseaseType])"
:rules="rules.requiredSelect"
/>
</template>
<van-popup v-model:show="resultSelectOption.show" position="bottom">
<div class="pt-4 pb-4 popup-checkbox">
<div class="flex justify-between pb-2">
<button class="van-picker__cancel van-haptics-feedback" @click="optionCancel">取消</button>
<span class="text-16" >请选择 {{ resultSelectOption.formType === 'radio' ? '(仅单选)' : '(可多选)' }}</span>
<div v-if="resultSelectOption.formType === 'radio'" style="width: .32rem;"></div>
<button v-else class="van-picker__confirm van-haptics-feedback" @click="optionConfirm">确认</button>
</div>
<div class="bottom-small-line"></div>
<CheckBtn v-if="resultSelectOption.formType === 'radio'"
v-model:value="resultSelectOption.value"
:options="resultSelectOption.array"
round column-1
class="py-3 px-4"
activeStyleNone :clearable="false"
@change="optionChange"/>
<CheckBtn v-else
v-model:value="resultSelectOption.value"
:options="resultSelectOption.array"
multiple round column-1
class="py-3 px-4" />
</div>
</van-popup>
</van-form> </van-form>
<InstpectCommon :disease="diseaseType"/>
<CheckCommon :disease="diseaseType"/> <div class='mt-5 mb-2' style="color: #595959;">是否进行检验</div>
<van-field :border="false"
name="isInspect"
style="padding: 0"
:rules="rules.requiredSelect">
<template #input>
<van-radio-group v-model="form.isInspect"
direction="horizontal"
class="w-full doc-radio-group">
<van-radio v-for="item in store.getDict('CP00120')"
:key="item.value" :name="item.value"
label-position="left">{{item.name}}</van-radio>
</van-radio-group>
</template>
</van-field>
<InstpectCommon v-if="form.isInspect == 1"
:disease="diseaseType"
:imageVisible="true"
:info="inspectInfo"
ref="inspect"/>
<div class='mt-5 mb-2' style="color: #595959;">是否进行检查</div>
<van-field :border="false"
name="isCheck"
style="padding: 0"
:rules="rules.requiredSelect">
<template #input>
<van-radio-group v-model="form.isCheck"
direction="horizontal"
class="w-full doc-radio-group">
<van-radio v-for="item in store.getDict('CP00120')"
:key="item.value" :name="item.value"
label-position="left">{{item.name}}</van-radio>
</van-radio-group>
</template>
</van-field>
<CheckCommon v-if="form.isCheck == 1"
:disease="diseaseType"
:info="checkInfo"
ref="check"/>
<DoctorInfo :info="info"/>
</div> </div>
</template> </template>
<script> <script>
import { useStore } from '@/doctor/store'
import InstpectCommon from '../common/Instpect.vue' import InstpectCommon from '../common/Instpect.vue'
import CheckCommon from '../common/Check.vue' import CheckCommon from '../common/Check.vue'
import DiagnosePicker from './DiagnosePicker.vue' import DiagnosePicker from './DiagnosePicker.vue'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
import DoctorInfo from './DoctorInfo.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
const defaultForm = (info = {}) => { const defaultForm = (info = {}) => {
...@@ -57,26 +202,26 @@ const defaultForm = (info = {}) => { ...@@ -57,26 +202,26 @@ const defaultForm = (info = {}) => {
residentInfoId: undefined, residentInfoId: undefined,
// 纳入管理日期 // 纳入管理日期
manageDate: undefined, manageDate: undefined,
_manageDate: undefined,
// 诊断名称code // 诊断名称code
icdCode: undefined, icdCode: undefined,
diseaseName: undefined, diseaseName: undefined,
// 诊断日期 // 诊断日期
diseaseDate: undefined, diseaseDate: undefined,
// 诊断评估 // 诊断评估
// 高血压分级 // 用于单选
diagnoseAssess: undefined, diagnoseAssess: undefined,
diagnoseAssessName: undefined, diagnoseAssessName: undefined,
// 用于单选 // 高血压危险分层 出血性脑卒中
diagnoseLevel: undefined, diagnoseLevel: undefined,
diagnoseLevelName: undefined, diagnoseLevelName: undefined,
// 用于多选 // 用于多选
diagnoseResult: undefined, diagnoseResult: [],
diagnoseResultName: undefined, diagnoseResultName: undefined,
// 是否需要检查 // 是否需要检查
isInspect: 2, isInspect: 2,
// 是否需要检查 // 是否需要检查
isCheck: 2 isCheck: 2,
diseaseType: undefined
} }
Reflect.ownKeys(form).forEach(key => { Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) { if (info[key] != undefined) {
...@@ -90,25 +235,113 @@ export default { ...@@ -90,25 +235,113 @@ export default {
components: { components: {
InstpectCommon, InstpectCommon,
CheckCommon, CheckCommon,
DiagnosePicker DiagnosePicker,
CheckBtn,
DoctorInfo
}, },
props: { props: {
diseaseType: [Number, String] diseaseType: [Number, String],
info: { default: () => ({}) }
}, },
data() { data() {
return { return {
store: useStore(),
form: defaultForm(), form: defaultForm(),
// 纳入管理日期 // 纳入管理日期
manageDateRange: { dateRange: {
min: undefined, min: undefined,
max: undefined max: undefined
}, },
showManageDate: false,
// 诊断名称
showIcd: false,
rules: { rules: {
requiredSelect: [{ required: true, message: '请选择' }], requiredSelect: [{ required: true, message: '请选择' }],
requiredInput: [{ required: true, message: '请输入' }] requiredInput: [{ required: true, message: '请输入' }]
},
// 诊断名称
showIcd: false,
// 诊断评估 选择配置
resultSelectOption: {
show: false,
formType: '', // radio checkbox
field: '', // diagnoseAssess diagnoseLevel diagnoseResult
array: [],
name: '',
value: undefined,
dictMap: {
2: 'CP00101',
3: 'CP00102',
5: 'CP00105',
6: 'CP00106',
7: 'CP00095'
}
},
// 日期选择选择
dateOption: {
show: false,
field: ''
}
}
},
computed: {
// 检查项
checkList() {
const diagnoseInspectList = this.info.diagnoseInspectList || []
return diagnoseInspectList.filter(e => e.projectType === 1)
},
// 检验项
inspectList() {
const diagnoseInspectList = this.info.diagnoseInspectList || []
return diagnoseInspectList.filter(e => e.projectType === 0)
},
// 检验项图片
inspectFileList() {
return this.info.inspectFileList || []
},
inspectInfo() {
const projects = [], insTypes = []
this.inspectList.forEach(e => {
const pList = e.inspectDetailed ? JSON.parse(e.inspectDetailed) : []
const iList = pList.map( i => i.insType) || []
projects.push(...pList)
insTypes.push(...iList)
})
return {
image: this.info.inspectFile || '',
imageData: this.info.inspectFileList || [],
items: projects,
inspect: Array.from(new Set(insTypes))
}
},
checkInfo() {
const insTypes = [], items = []
this.checkList.forEach(e => {
const pList = e.inspectDetailed ? JSON.parse(e.inspectDetailed) : []
const iList = pList.map( i => i.insType) || []
insTypes.push(...iList)
if (e.inspectFile) {
items.push({
itemValue: e.inspectFile,
itemType: 5,
inspectFile: e.inspectFile,
inspectFileList: e.inspectFileList,
insType: pList[0]?.insType,
insName: pList[0]?.insName,
itemCode: pList[0]?.insType + '-2'
})
}
//未上传图片并存在结论的数据
items.push({
itemValue: pList[0]?.itemValue,
itemType: 1,
inspectFile: undefined,
inspectFileList: [],
insType: pList[0]?.insType,
insName: pList[0]?.insName,
itemCode: pList[0]?.itemCode
})
})
return {
items,
check: Array.from(new Set(insTypes))
} }
} }
}, },
...@@ -119,18 +352,82 @@ export default { ...@@ -119,18 +352,82 @@ export default {
init() { init() {
const date = dayjs() const date = dayjs()
this.form.manageDate = date.format('YYYY-MM-DD') this.form.manageDate = date.format('YYYY-MM-DD')
this.form._manageDate = [date.year(), date.month() + 1, date.date()] // this.form._manageDate = [date.year(), date.month() + 1, date.date()]
this.manageDateRange.max = new Date(date.year(), date.month(), date.date()) this.dateRange.max = new Date(date.year(), date.month(), date.date())
this.manageDateRange.min = new Date(date.year() - 20, date.month(), date.date()) this.dateRange.min = new Date(date.year() - 20, date.month(), date.date())
}, },
// 纳入管理日期 submit() {
manageDateConfirm({ selectedValues }) { this.form.diseaseType = this.diseaseType
this.form.manageDate = selectedValues.join('-') },
this.showManageDate = false // 日期确定
dateConfirm({ selectedValues }) {
this.form[this.dateOption.field] = selectedValues.join('-')
this.dateOption.show = false
}, },
// 诊断名称 // 诊断名称
icdChange(option) { icdChange(option) {
this.form.diseaseName = option.diseaseName this.form.diseaseName = option.diseaseName
},
// 日期选择
showDate(field) {
this.dateOption.show = true
this.dateOption.field = field
},
// 诊断评估 选择配置
showOptions(field, dict, formType = 'radio') {
this.resultSelectOption.field = field
this.resultSelectOption.formType = formType
this.resultSelectOption.array = this.store.getDict(dict)
this.resultSelectOption.value = this.form[field]
this.resultSelectOption.show = true
},
optionCancel() {
this.resultSelectOption.show = false
this.resultSelectOption.value = undefined
},
optionConfirm() {
const field = this.resultSelectOption.field
const fieldName = field + 'Name'
this.form[field] = this.resultSelectOption.value
console.log('this.form[field]', this.form[field])
this.form[fieldName] = this.resultSelectOption.array.map(e => {
return this.form[field].includes(e.value) ? e.name : ''
}).filter(e => e).join('、')
this.resultSelectOption.show = false
this.resultSelectOption.value = undefined
},
optionChange(val, option) {
const field = this.resultSelectOption.field
const fieldName = field + 'Name'
this.form[field] = val
this.form[fieldName] = option.name
this.resultSelectOption.show = false
this.resultSelectOption.value = undefined
},
// 处理诊断评估字段回显
fieldNameHandler() {
const mark = this.diseaseType
if (mark == 1) {
this.form.diagnoseAssessName = this.store.getDictValue('CP00096', this.form.diagnoseAssess)
this.form.diagnoseLevelName = this.store.getDictValue('CP00097', this.form.diagnoseLevel)
} else if ([2, 3].includes(mark)) {
this.form.diagnoseResultName = this.store.getDictValue(this.resultSelectOption.dictMap[mark], this.form.diagnoseResult)
} else if (mark == 4) {
this.form.diagnoseResultName = this.store.getDictValue('CP00103', this.form.diagnoseResult)
this.form.diagnoseLevelName = this.store.getDictValue('CP00104', this.form.diagnoseLevel)
} else if ([5, 6, 7].includes(mark)) {
this.form.diagnoseAssessName = this.store.getDictValue(this.resultSelectOption.dictMap[mark], this.form.diagnoseAssess)
}
}
},
watch: {
info: {
handler(info) {
this.form = defaultForm(info)
this.fieldNameHandler()
},
immediate: true
} }
} }
} }
......
...@@ -58,7 +58,10 @@ export default { ...@@ -58,7 +58,10 @@ export default {
}, },
residentInfoId() { residentInfoId() {
return this.$route.query.residentInfoId return this.$route.query.residentInfoId
} },
idCard() {
return this.$route.query.idCard
},
}, },
created() { created() {
this.init() this.init()
...@@ -76,10 +79,15 @@ export default { ...@@ -76,10 +79,15 @@ export default {
this.baseInfo = this.screenInfo.residentsRecord this.baseInfo = this.screenInfo.residentsRecord
console.log(this.screenInfo) console.log(this.screenInfo)
} else { } else {
if (this.residentInfoId) {
let res = await getChronicResidentsId(this.residentInfoId) let res = await getChronicResidentsId(this.residentInfoId)
this.baseInfo = res.data || {} this.baseInfo = res.data || {}
this.screenInfo.currentAge = this.baseInfo.currentAge this.screenInfo.currentAge = this.baseInfo.currentAge
this.screenInfo.residentInfoId = this.residentInfoId this.screenInfo.residentInfoId = this.residentInfoId
} else if (this.idCard) {
// 新建用户
this.baseInfo.idCard = this.idCard
}
} }
}, },
toNext(val) { toNext(val) {
......
...@@ -29,6 +29,12 @@ export const useStore = defineStore('chronic', { ...@@ -29,6 +29,12 @@ export const useStore = defineStore('chronic', {
if (!array || !array.length) { if (!array || !array.length) {
return '' return ''
} }
if (value instanceof Array) {
return value.map(v => {
let temp = array.find(e => e.value == v) || {}
return temp.name || ''
}).filter(e => e).join('、')
}
let temp = array.find(e => e.value == value) || {} let temp = array.find(e => e.value == value) || {}
return temp.name || '' return temp.name || ''
}, },
......
...@@ -64,8 +64,18 @@ function setDirective(app) { ...@@ -64,8 +64,18 @@ function setDirective(app) {
app.directive('destory', { app.directive('destory', {
beforeUnmount(el, binding, vnode, prevVnod) { beforeUnmount(el, binding, vnode, prevVnod) {
const field = binding.arg const field = binding.arg
const form = binding.value const value = binding.value
const modifiers = binding.modifiers const modifiers = binding.modifiers
if (value instanceof Array) {
const form = value[0]
for (let i = 1; i < value.length; i++) {
if (form[value[i]] != null) {
form[value[i]] = modifiers.string ? '' : undefined
}
}
return
}
const form = value
if (form && field && form[field] != null) { if (form && field && form[field] != null) {
form[field] = modifiers.string ? '' : undefined form[field] = modifiers.string ? '' : undefined
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment