Commit cf7c775d authored by gengchunlei's avatar gengchunlei

慢综 医生端 随访表单接口对接, 详情接口对接,修改基本信息接口对接

parent ea51ea50
......@@ -8,3 +8,8 @@ export function queryResidentInfo(params) {
export function queryVisitByPage(params, loading) {
return fetchBase({ url: `/chronic-admin/v1/chronic-visit-record/page`, body: params, loading })
}
//更新居民基本信息
export function updateResident(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-residents-record/update`, body: params, loading: true })
}
\ No newline at end of file
......@@ -5,56 +5,56 @@
<div class='title'>居民信息</div>
<div class='detail-div mt-2'>
<div class='flex items-center justify-between'>
<div>证件类型</div>
<div class='label'>证件类型</div>
<div>{{ residentInfo.certificateTypeName || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>证件号码</div>
<div class='label'>证件号码</div>
<div>{{ residentInfo.idCard || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>姓名</div>
<div class='label'>姓名</div>
<div>{{ residentInfo.residentName || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>性别</div>
<div class='label'>性别</div>
<div>{{ residentInfo.genderName || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>出生日期</div>
<div class='label'>出生日期</div>
<div>{{ residentInfo.dataBirth || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>民族</div>
<div class='label'>民族</div>
<div>{{ residentInfo.nationalName || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>年龄</div>
<div class='label'>年龄</div>
<div>{{ residentInfo.currentAge || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>本人电话</div>
<div class='label'>本人电话</div>
<div>{{ residentInfo.telephone || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>联系人姓名</div>
<div class='label'>联系人姓名</div>
<div>{{ residentInfo.contactName || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>与居民关系</div>
<div class='label'>与居民关系</div>
<div>{{ residentInfo.relationName || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>联系电话</div>
<div class='label'>联系电话</div>
<div>{{ residentInfo.contactPhone || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>现住址</div>
<div>{{ residentInfo.fullNowAddress || '-' }}</div>
<div class='flex flex-wrap justify-between mt-2'>
<div class='label'>现住址</div>
<div style='flex: 1'>{{ residentInfo.fullNowAddress || '-' }}</div>
</div>
<div class='flex items-center justify-between mt-2'>
<div>户籍地址</div>
<div>{{ residentInfo.fullPermanentAddress || '-' }}</div>
<div class='flex flex-wrap justify-between mt-2'>
<div class='label'>户籍地址</div>
<div style='flex: 1'>{{ residentInfo.fullPermanentAddress || '-' }}</div>
</div>
</div>
<div class='title mt-2'>随访信息</div>
......@@ -87,22 +87,76 @@
</div>
<div class='mt-2' v-if="showOne && info.visitSituation == 1">
<div>随访内容</div>
<div class='white-b mt-2'>
<div class='white-b mt-2' style='min-height: 60px'>
<div>{{ info.visitContent }}</div>
</div>
</div>
<div class='mt-2' v-if="showOne && info.visitSituation == 1">
<div>处置意见</div>
<div class='white-b mt-2'>
<div class='white-b mt-2' style='min-height: 60px'>
<div>{{ info.disposalOpinion }}</div>
</div>
</div>
<div class='mt-2' v-if="(showOne || showTwo) && info.visitSituation == 1 && info.isHealthGuide == 1">
<div>健康指导</div>
<div class='white-b mt-2'>
<div class='flex flex-wrap' v-for="(item, index) in healthInterventionsInfo.visitHealthGuideList" >
<div v-if="item.name != '无'">{{item.name}}</div>
<div>{{item.templateContent || '-'}}</div>
<div class='flex flex-wrap mt-2' v-for="(item, index) in healthInterventionsInfo.visitHealthGuideList" >
<div v-if="item.name != '无'" class='label'>{{item.name}}</div>
<div style='flex: 1'>{{item.templateContent }}</div>
</div>
</div>
</div>
<div class='mt-2' v-if='imgList1.length'>
<div>随访记录</div>
<div class='flex items-center' style='flex-wrap: wrap'>
<div v-for='(item, index) in imgList1'>
<!-- 图片-->
<div v-if="item.imgFlag == 'img'" class='mt-2'>
<img :src='item.trueDownloadUrl' class='ml-2' style='width: 95px;height: 95px;'>
</div>
</div>
</div>
<!-- pdf-->
<div>
<div v-for='item in imgList1'>
<div class='mt-2 pdf' v-if="item.imgFlag == 'pdf'">
<div class='flex items-center justify-between'>
<div class='flex items-center' @click.stop='toPdf(item)'>
<div>
<doc-icon type='doc-PDF' style='font-size: .48rem'></doc-icon>
</div>
<div class='ml-1'>{{ item.name }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='mt-2' v-if='imgList2.length'>
<div>现场随访照片</div>
<div class='flex items-center' style='flex-wrap: wrap'>
<div v-for='(item, index) in imgList2'>
<!-- 图片-->
<div v-if="item.imgFlag == 'img'" class='mt-2'>
<img :src='item.trueDownloadUrl' class='ml-2' style='width: 95px;height: 95px;'>
</div>
</div>
</div>
<!-- pdf-->
<div>
<div v-for='item in imgList2'>
<div class='mt-2 pdf' v-if="item.imgFlag == 'pdf'">
<div class='flex items-center justify-between'>
<div class='flex items-center' @click.stop='toPdf(item)'>
<div>
<doc-icon type='doc-PDF' style='font-size: .48rem'></doc-icon>
</div>
<div class='ml-1'>{{ item.name }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -126,7 +180,7 @@
</div>
</div>
</div>
<div class="px-5 flex align-center justify-around">
<div class="px-5 flex align-center justify-around pt-2 pb-2">
<van-button type="primary" round plain style="width: 70%;background: #F0F3FF;border: 0px"
@click="toBack">返回</van-button>
</div>
......@@ -136,6 +190,7 @@
<script>
import { fetchCurrencyById } from '@/api/doctor/generalFU'
import { showToast } from 'vant'
import { useStore } from '@/doctor/store'
export default {
name: 'Detail',
......@@ -144,6 +199,7 @@ export default {
},
data() {
return {
store: useStore(),
info: {},
residentInfo: {}
}
......@@ -181,7 +237,7 @@ export default {
},
//健康指导
healthInterventionsInfo() {
const modeArray = this.$dict('DC00084')
const modeArray = this.store.getDict('DC00084')
let visitHealthGuideList = []
if (this.info.healthGuideContent) {
visitHealthGuideList = JSON.parse(this.info.healthGuideContent)
......@@ -198,7 +254,33 @@ export default {
})
}
return res
}
},
imgList1() {
const {uploadVisitRecordImageList = []} = this.info
uploadVisitRecordImageList.forEach(item => {
item['imgFlag'] = ''
if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf'
}
if (item.type == 'image/jpeg' || item.type == 'image/png') {
item['imgFlag'] = 'img'
}
})
return uploadVisitRecordImageList
},
imgList2() {
const {sceneVisitImageList = []} = this.info
sceneVisitImageList.forEach(item => {
item['imgFlag'] = ''
if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf'
}
if (item.type == 'image/jpeg' || item.type == 'image/png') {
item['imgFlag'] = 'img'
}
})
return sceneVisitImageList
},
},
created() {
this.load()
......@@ -248,6 +330,10 @@ export default {
border-radius: 8px;
}
.label {
width: 104px;
}
:deep(.van-nav-bar .van-icon) {
color: #000000;
}
......
......@@ -171,16 +171,16 @@
<template #input>
<van-radio-group v-model='form.visitSituation' class='w-full' shape='dot'>
<van-cell-group>
<van-cell title='在访' clickable @click="form.visitSituation = '1'"
<van-cell title='在访' clickable @click="form.visitSituation = 1"
class='input-back form-input'>
<template #right-icon>
<van-radio name='1' />
<van-radio :name='1' />
</template>
</van-cell>
<van-cell title='失访' clickable @click="form.visitSituation = '2'"
<van-cell title='失访' clickable @click="form.visitSituation = 2"
class='input-back mt-2 form-input'>
<template #right-icon>
<van-radio name='2' />
<van-radio :name='2' />
</template>
</van-cell>
</van-cell-group>
......@@ -194,22 +194,22 @@
<template #input>
<van-radio-group v-model='form.lossReason' class='w-full' shape='dot'>
<van-cell-group>
<van-cell title='无法联系' clickable @click="form.lossReason = '1'"
<van-cell title='无法联系' clickable @click="form.lossReason = 1"
class='input-back form-input'>
<template #right-icon>
<van-radio name='1' />
<van-radio :name='1' />
</template>
</van-cell>
<van-cell title='患者拒绝随访' clickable @click="form.lossReason = '2'"
<van-cell title='患者拒绝随访' clickable @click="form.lossReason = 2"
class='input-back mt-2 form-input'>
<template #right-icon>
<van-radio name='2' />
<van-radio :name='2' />
</template>
</van-cell>
<van-cell title='死亡' clickable @click="form.lossReason = '3'"
<van-cell title='死亡' clickable @click="form.lossReason = 3"
class='input-back mt-2 form-input'>
<template #right-icon>
<van-radio name='3' />
<van-radio :name='3' />
</template>
</van-cell>
<van-field
......@@ -219,10 +219,10 @@
placeholder='死亡原因'
class='input-back mt-2 form-input'
/>
<van-cell title='其他' clickable @click="form.lossReason = '9'"
<van-cell title='其他' clickable @click="form.lossReason = 9"
class='input-back mt-2 form-input'>
<template #right-icon>
<van-radio name='9' />
<van-radio :name='9' />
</template>
</van-cell>
<van-field
......@@ -242,12 +242,12 @@
<template #input>
<van-radio-group v-model='form.visitWay' class='w-full' shape='dot'>
<van-cell-group>
<van-cell title='门诊' clickable @click="form.visitWay = '5'"
<van-cell title='门诊' clickable @click="form.visitWay = 5"
class='input-back form-input'
:style="{borderRadius: form.visitWay == 5 ? '8px 8px 0px 0px ': '8px'}"
>
<template #right-icon>
<van-radio name='5' />
<van-radio :name='5' />
</template>
</van-cell>
......@@ -259,12 +259,12 @@
<div @click='toTel' class='tel-label'>点击拨打</div>
</div>
</div>
<van-cell title='住院' clickable @click="form.visitWay = '6'"
<van-cell title='住院' clickable @click="form.visitWay = 6"
class='input-back mt-2 form-input'
:style="{borderRadius: form.visitWay == 6 ? '8px 8px 0px 0px ': '8px'}"
>
<template #right-icon>
<van-radio name='6' />
<van-radio :name='6' />
</template>
</van-cell>
<div class='tel-back' v-if='form.visitWay == 6'>
......@@ -275,12 +275,12 @@
<div @click='toTel' class='tel-label'>点击拨打</div>
</div>
</div>
<van-cell title='入户' clickable @click="form.visitWay = '7'"
<van-cell title='入户' clickable @click="form.visitWay = 7"
class='input-back mt-2 form-input'
:style="{borderRadius: form.visitWay == 7 ? '8px 8px 0px 0px ': '8px'}"
>
<template #right-icon>
<van-radio name='7' />
<van-radio :name='7' />
</template>
</van-cell>
<div class='tel-back' v-if='form.visitWay == 7'>
......@@ -291,12 +291,12 @@
<div @click='toTel' class='tel-label'>点击拨打</div>
</div>
</div>
<van-cell title='电话' clickable @click="form.visitWay = '8'"
<van-cell title='电话' clickable @click="form.visitWay = 8"
class='input-back mt-2 form-input'
:style="{borderRadius: form.visitWay == 8 ? '8px 8px 0px 0px ': '8px'}"
>
<template #right-icon>
<van-radio name='8' />
<van-radio :name='8' />
</template>
</van-cell>
<div class='tel-back' v-if='form.visitWay == 8'>
......@@ -308,12 +308,12 @@
</div>
</div>
<van-cell title='短信(指导)' clickable @click="form.visitWay = '9'"
<van-cell title='短信(指导)' clickable @click="form.visitWay = 9"
class='input-back mt-2 form-input'
:style="{borderRadius: form.visitWay == 9 ? '8px 8px 0px 0px ': '8px'}"
>
<template #right-icon>
<van-radio name='9' />
<van-radio :name='9' />
</template>
</van-cell>
<div class='tel-back' v-if='form.visitWay == 9'>
......@@ -325,21 +325,21 @@
shape='dot'>
<div class='flex items-center w-full'>
<van-cell title='是' clickable
@click="form.isHealthGuide = '1'"
@click="form.isHealthGuide = 1"
style='flex: 1'
class='input-back form-input'
>
<template #right-icon>
<van-radio name='1' />
<van-radio :name='1' />
</template>
</van-cell>
<van-cell title='否' clickable
@click="form.isHealthGuide = '2'"
@click="form.isHealthGuide = 2"
style='flex: 1'
class='input-back form-input ml-2'
>
<template #right-icon>
<van-radio name='2' />
<van-radio :name='2' />
</template>
</van-cell>
</div>
......@@ -347,12 +347,12 @@
</div>
</div>
<van-cell title='微信(指导)' clickable @click="form.visitWay = '11'"
<van-cell title='微信(指导)' clickable @click="form.visitWay = 11"
class='input-back mt-2 form-input'
:style="{borderRadius: form.visitWay == 11 ? '8px 8px 0px 0px ': '8px'}"
>
<template #right-icon>
<van-radio name='11' />
<van-radio :name='11' />
</template>
</van-cell>
<div class='tel-back' v-if='form.visitWay == 11'>
......@@ -364,21 +364,21 @@
shape='dot'>
<div class='flex items-center w-full'>
<van-cell title='是' clickable
@click="form.isHealthGuide = '1'"
@click="form.isHealthGuide = 1"
style='flex: 1'
class='input-back form-input'
>
<template #right-icon>
<van-radio name='1' />
<van-radio :name='1' />
</template>
</van-cell>
<van-cell title='否' clickable
@click="form.isHealthGuide = '2'"
@click="form.isHealthGuide = 2"
style='flex: 1'
class='input-back form-input ml-2'
>
<template #right-icon>
<van-radio name='2' />
<van-radio :name='2' />
</template>
</van-cell>
</div>
......@@ -386,12 +386,12 @@
</div>
</div>
<van-cell title='短信(催检)' clickable @click="form.visitWay = '10'"
<van-cell title='短信(催检)' clickable @click="form.visitWay = 10"
class='input-back mt-2 form-input'
:style="{borderRadius: form.visitWay == 10 ? '8px 8px 0px 0px ': '8px'}"
>
<template #right-icon>
<van-radio name='10' />
<van-radio :name='10' />
</template>
</van-cell>
<div class='tel-back' v-if='form.visitWay == 10'>
......@@ -411,12 +411,12 @@
<van-date-picker @confirm='timeConfirm1' @cancel='showBirth = false' />
</van-popup>
<van-cell title='微信(催检)' clickable @click="form.visitWay = '12'"
<van-cell title='微信(催检)' clickable @click="form.visitWay = 12"
class='input-back mt-2 form-input'
:style="{borderRadius: form.visitWay == 12 ? '8px 8px 0px 0px ': '8px'}"
>
<template #right-icon>
<van-radio name='12' />
<van-radio :name='12' />
</template>
</van-cell>
<div class='tel-back' v-if='form.visitWay == 12'>
......@@ -526,12 +526,12 @@ const defaultForm = (info = {}) => {
// createUnitId: undefined,
// createUnitName: undefined
//本次随访情况
visitSituation: '1',
visitSituation: 1,
lossReason: undefined,
deathReason: undefined,
lossReasonOther: undefined,
visitWay: '5',
isHealthGuide: '1',
visitWay: 5,
isHealthGuide: 1,
screenTime: new dayjs().add(1, 'day').format('YYYY-MM-DD')
}
Reflect.ownKeys(form).forEach(key => {
......@@ -694,12 +694,7 @@ export default {
id: this.form.personId,
},
}
resolve(
fetchDataHandle(par, {
presentCode: 'arrToAdd',
registeredCode: 'arrToAdd'
})
)
resolve(par)
}).catch((e) => {
console.warn('ArchiveCommon error', e)
})
......
<template>
<div>
<van-nav-bar title='新增通用随访' left-text='' left-arrow @click-left='toBack'></van-nav-bar>
<van-nav-bar :title="routerDetail.id ? '修改通用随访': '新增通用随访'" left-text='' left-arrow @click-left='toBack'></van-nav-bar>
<div class='p-4 h-overflow'>
<base-info :info='info' v-show='step == 1' ref='baseInfo'
@changeVisitSituation='changeVisitSituation'></base-info>
......@@ -10,10 +10,10 @@
</div>
<div class='pt-2 pb-2'>
<div class='px-5 grow flex flex-col justify-end' v-if='step == 1'>
<van-button type='primary' block round v-if='visitSituation ==1'
<van-button type='primary' block round v-if='visitSituation == 1'
@click='toNext(2)'>下一步
</van-button>
<van-button type='primary' block round v-if='visitSituation ==2'
<van-button type='primary' block round v-if='visitSituation == 2'
@click='toNext(3)'>下一步
</van-button>
</div>
......@@ -72,31 +72,37 @@ export default {
methods: {
async init() {
this.info = {}
const res = await getChronicResidentsId(this.routerDetail.residentInfoId)
const {
id,
createDate,
createDoctorId,
createDoctorName,
createOfficeId,
createOfficeName,
createUnitId,
createUnitName,
updated,
...others
} = res.data
this.info = {
personId: id,
...others
}
this.info.diseaseType = this.routerDetail.diseaseType
if (this.routerDetail.id) {
const res = await fetchCurrencyById({ id: this.routerDetail.id })
let result = res.data || {}
const {residentsRecord = {}} = result
const {id, ...others} = residentsRecord
this.info = {
...others,
personId: id,
...result
}
} else {
const res = await getChronicResidentsId(this.routerDetail.residentInfoId)
const {
id,
createDate,
createDoctorId,
createDoctorName,
createOfficeId,
createOfficeName,
createUnitId,
createUnitName,
updated,
...others
} = res.data
this.info = {
personId: id,
...others
}
this.info.diseaseType = this.routerDetail.diseaseType
}
},
async toNext(val) {
if (val == 2) {
......@@ -127,7 +133,6 @@ export default {
return list.join()
},
async onsubmit() {
debugger
let baseInfo = await this.$refs.baseInfo.onSubmit()
let generalFUForm = await this.$refs.generalFUForm.onSubmit()
let commonBottom = await this.$refs.commonBottom.onSubmit()
......@@ -146,7 +151,7 @@ export default {
...generalFUForm,
...commonBottom,
uploadVisitRecord,
sceneVisitImage
sceneVisitImage,
}
if (this.info.id) {
params.visitRecordId = this.info.visitRecordId
......@@ -165,14 +170,14 @@ export default {
if (this.visitSituation == 1) {
if (this.step != 1) {
this.step--
return
}
return
}
if (this.visitSituation == 2) {
if (this.step != 1) {
this.step = 1
return
}
return
}
this.$router.back()
}
......
......@@ -84,7 +84,10 @@ export default {
},
methods: {
toEdit() {
let par = {
residentInfoId: this.info.residentInfoId
}
this.$router.push({path: `/doctor/resident/base/update`, query: par})
}
}
......
......@@ -13,7 +13,7 @@
finished-text="没有更多了"
@load="onMore"
>
<div v-for='item in list' :key="item.id" class="p-4 mt-3 card">
<div v-for='item in list' :key="item.id" class="p-4 mt-3 card" @click.stop='toDetail(item)'>
<div class='flex items-center'>
<div class='detail-left'>
随访日期
......@@ -59,8 +59,8 @@
<div class="flex justify-end">
<van-button round type="primary" class="card-bt" style="margin-right: .12rem"
@click="editBtn(item)">修改</van-button>
<van-button round type="primary" class="card-bt" @click="delBtn(item)">删除</van-button>
@click.stop="editBtn(item)">修改</van-button>
<van-button round type="primary" class="card-bt" @click.stop="delBtn(item)">删除</van-button>
</div>
<span class="px-3 float-bt">
......@@ -164,10 +164,32 @@ export default {
this.load()
},
addBtn() {
let par = {
residentInfoId: this.baseInfo.residentInfoId
}
this.$router.push({
path: `/doctor/followUp/generalFU/add`,
query: par
})
},
toDetail(item) {
let par = {
relationId: item. relationId
}
this.$router.push({
path: `/doctor/followUp/generalFU/detail`,
query: par
})
},
editBtn(item) {
let par = {
id: item.relationId,
residentInfoId: this.baseInfo.residentInfoId
}
this.$router.push({
path: `/doctor/followUp/generalFU/add`,
query: par
})
},
delBtn(item) {
showConfirmDialog({
......
<template>
<div>
<van-nav-bar title='修改居民信息' left-text='' left-arrow
@click-left='toBack'></van-nav-bar>
<div class='p-4 h-overflow'>
<van-form ref='form'>
<div class='title'>居民信息</div>
<van-cell-group inset>
<div class='label-title'>证件类型</div>
<van-field
v-model='form.certificateTypeName'
is-link
disabled
placeholder='证件类型'
class='input-back mt-2 form-input'
:rules='rules.certificateTypeName'
/>
<div class='label-title mt-5'>证件号码</div>
<van-field
v-model='form.idCard'
disabled
placeholder='证件号码'
class='input-back mt-2 form-input'
:rules='rules.idCard'
/>
<div class='label-title mt-5'>姓名</div>
<van-field
v-model='form.residentName'
clearable
placeholder='姓名'
class='input-back mt-2 form-input'
:rules='rules.residentName'
/>
<div class='label-title mt-5'>性别</div>
<van-field
v-model='form.genderName'
is-link
disabled
placeholder='性别'
class='input-back mt-2 form-input'
:rules='rules.genderName'
/>
<div class='label-title mt-5'>出生日期</div>
<van-field
v-model='form.dataBirth'
is-link
disabled
placeholder='出生日期'
class='input-back mt-2 form-input'
:rules='rules.dataBirth'
/>
<div class='label-title mt-5'>民族</div>
<van-field
v-model='form.nationalName'
is-link
readonly
name='national'
placeholder='请选择'
class='input-back mt-2 form-input'
:rules='rules.nationalName'
@click='showNational = true' />
<van-popup v-model:show='showNational' position='bottom'>
<van-picker
:columns-field-names="{ text: 'name', value: 'value' }"
:columns="store.getDict('DC00006')"
@confirm='nationalConfirm'
@cancel='showNational = false'
/>
</van-popup>
<div class='label-title mt-5'>年龄</div>
<van-field
v-model='form.currentAge'
disabled
placeholder='年龄'
class='input-back mt-2 form-input'
:rules='rules.currentAge'
/>
<div class='label-title mt-5'>本人电话</div>
<van-field
v-model='form.telephone'
clearable
placeholder='本人电话'
class='input-back mt-2 form-input'
:rules='rules.telephone'
/>
<div class='no-req-label mt-5'>联系人姓名</div>
<van-field
v-model='form.contactName'
clearable
placeholder='联系人姓名'
class='input-back mt-2 form-input'
:rules='rules.contactName'
/>
<div class='no-req-label mt-5'>与居民关系</div>
<van-field
v-model='form.relationName'
readonly
is-link
placeholder='与居民关系'
class='input-back mt-2 form-input'
@click='showRelation= true'
/>
<van-popup v-model:show='showRelation' position='bottom'>
<van-picker
:columns-field-names="{ text: 'name', value: 'value' }"
:columns="store.getDict('DC00023')"
@confirm='relationlConfirm'
@cancel='showRelation = false'
/>
</van-popup>
<van-field
v-if='form.relation == 99'
v-model='form.relationOther'
clearable
placeholder='其他关系'
class='input-back mt-2 form-input'
/>
<div class='label-title mt-5'>现住址</div>
<van-field
v-model='form.presentCodeName'
is-link
readonly
placeholder='请选择所在地区'
class='input-back mt-2 form-input'
:rules='rules.presentCodeName'
@click='showPresent = true'
/>
<van-popup v-model:show='showPresent' :close-on-click-overlay='false' position='bottom'>
<DocAddress v-model:value='form.presentCode' @close='showPresent = false'
:viewData='addressRecord.presentCode'
@change='presentChange' />
</van-popup>
<div class='no-req-label mt-5'>详细地址</div>
<van-field
v-model='form.nowAddress'
clearable
class='input-back mt-2 form-input'
placeholder='请填写详细地址'
maxlength='50'
/>
<div class='flex items-center justify-between mt-5'>
<div class='label-title '>户口地址</div>
<van-button size='mini' plain type='primary'
@click='setRegisteredAddress'>同步现住址
</van-button>
</div>
<van-field
v-model='form.registeredCodeName'
is-link
readonly
placeholder='请选择所在地区'
class='input-back mt-2 form-input'
:rules='rules.registeredCode'
@click='showRegistered = true'
/>
<van-popup v-model:show='showRegistered' :close-on-click-overlay='false' position='bottom'>
<DocAddress v-model:value='form.registeredCode' @close='showRegistered = false'
:viewData='addressRecord.registeredCode'
@change='registeredChange' />
</van-popup>
<div class='no-req-label mt-5'>详细地址</div>
<van-field
v-model='form.permanentAddress'
clearable
class='input-back mt-2 form-input'
placeholder='请填写详细地址'
maxlength='50'
/>
</van-cell-group>
</van-form>
</div>
<div class='px-5 grow flex flex-col justify-end pt-2 pb-2'>
<van-button type='primary' block round
@click='onSubmit'>提交
</van-button>
</div>
</div>
</template>
<script>
import { addToArr, fetchDataHandle } from '@/utils/common'
import { useStore } from '@/doctor/store'
import DocAddress from '@/components/docAddress/DocAddress'
import dayjs from 'dayjs'
import { getChronicResidentsId } from '@/api/doctor/generalFU'
import { updateResident } from '@/api/doctor/resident'
const defaultForm = (info = {}) => {
const form = {
id: undefined,
residentInfoId: undefined,
// 年龄
currentAge: undefined,
// 出生地详细地址
birthAddress: undefined,
// 出生地编码
birthCode: undefined,
// 证件类型,[DC00004]
certificateType: 1,
certificateTypeName: '身份证',
// 联系人姓名
contactName: undefined,
contactName2: undefined,
// 联系人电话
contactPhone: undefined,
// 与居民关系,[DC00023]
contactRelation: undefined,
contactRelationName: undefined,
// 出生日期
dataBirth: undefined,
// 职业,[DC00010]
duty: undefined,
dutyName: undefined,
// 文化程度(学历),[DC00007]
education: undefined,
educationName: undefined,
// 性别,[DC00005]
gender: undefined,
genderName: undefined,
// 身份证号
idCard: undefined,
// innerMarital: undefined,
// 民族,[DC00006]
national: undefined,
nationalName: undefined,
// 现住址
nowAddress: undefined,
// 户籍地址
permanentAddress: undefined,
// 现住址编码
presentCode: undefined,
presentCodeName: undefined,
// 户籍地编码
registeredCode: undefined,
registeredCodeName: undefined,
// 居民档案id
residentId: undefined,
// 姓名
residentName: undefined,
// 本人电话
telephone: undefined,
// 工作单位
workUnit: undefined,
// 与居民关系
relation: undefined,
relationOther: undefined
// 人群
}
Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) {
form[key] = info[key]
}
})
return form
}
export default {
name: 'BaseInfo',
components: { DocAddress },
props: {
info: {
default: () => {
return {}
}
}
},
data() {
return {
store: useStore(),
// 民族
showNational: false,
showRelation: false,
// 现住址
showPresent: false,
// 户籍地址
showRegistered: false,
// 地址回显使用
addressRecord: {},
form: {},
rules: {
certificateTypeName: [{ required: true, message: '请选择证件类型' }],
idCard: [{ required: true, message: '请填写证件号码' }],
residentName: [{ required: true, message: '请填写姓名' }],
genderName: [{ required: true, message: '请选择性别' }],
dataBirth: [{ required: true, message: '请选择出生日期' }],
nationalName: [{ required: true, message: '请选择名族' }],
currentAge: [{ required: true, message: '请填写年龄' }],
telephone: [{ required: true, message: '请填写本人电话' }],
contactName: [{ required: false, message: '请填写联系人姓名' }],
presentCodeName: [{ required: true, message: '请选择所在地区' }],
registeredCode: [{ required: true, message: '请选择所在地区' }]
}
}
},
computed: {
authInfo() {
return this.store.$state.authInfo
},
routerDetail() {
return this.$route.query
}
},
created() {
this.load()
},
methods: {
async load() {
const res = await getChronicResidentsId(this.routerDetail.residentInfoId)
this.form = defaultForm(res.data)
if (this.form.presentCode) {
this.addressRecord.presentCode = addToArr(this.form.presentCode)
}
if (this.form.registeredCode) {
this.addressRecord.registeredCode = addToArr(this.form.registeredCode)
}
},
// 民族
nationalConfirm({ selectedValues, selectedOptions }) {
this.form.national = selectedValues[0]
this.form.nationalName = selectedOptions[0].name
this.showNational = false
},
//与居民关系
relationlConfirm({ selectedValues, selectedOptions }) {
this.form.relation = selectedValues[0]
this.form.relationName = selectedOptions[0].name
this.showRelation = false
},
// 现住址
presentChange(val) {
const selectedOptions = val.selectedOptions
this.form.presentCodeName = selectedOptions.map(e => e.text).join('/')
},
// 户口地址
registeredChange(val) {
const selectedOptions = val.selectedOptions
this.form.registeredCodeName = selectedOptions.map(e => e.text).join('/')
if (!this.form.presentCode && selectedOptions.length >= 5) {
this.form.presentCode = val.value
this.form.presentCodeName = this.form.registeredCodeName
}
},
// 同步现住址
setRegisteredAddress() {
this.$refs.form.validate(['presentCode']).then(res => {
this.form.registeredCode = this.form.presentCode
this.form.registeredCodeName = this.form.presentCodeName
this.form.permanentAddress = this.form.nowAddress
this.addressRecord.registeredCode = addToArr(this.form.presentCode)
}).catch(err => console.warn(err))
},
onSubmit() {
this.$refs.form.validate().then(() => {
let par = {
...this.form
}
updateResident(par).then(() => {
this.toBack()
})
}).catch((e) => {
console.warn('ArchiveCommon error', e)
})
},
toBack() {
this.$router.back()
}
}
}
</script>
<style scoped lang='less'>
.h-overflow {
height: calc(100vh - 110px);
overflow-y: auto;
}
.title {
font-weight: bold;
margin-bottom: 20px;
}
.label-title {
font-size: 13px;
color: #595959;
font-weight: 500;
&::after {
content: "*";
color: red;
font-weight: bold;
margin-left: 4px;
}
}
.no-req-label {
font-size: 13px;
color: #595959;
font-weight: 500;
}
.form-input {
padding: 8px 12px;
border-radius: 8px;
}
.input-back {
background: #FAFAFA;
}
.tel-back {
background: #F5F5F5;
padding: 8px;
border-radius: 0px 0px 8px 8px;
}
.tel {
background: #FFFFFF;
padding: 8px;
border-radius: 8px;
}
.tel-label {
color: #607FF0;
font-weight: bold;
}
.p-12-0 {
padding: 12px 0px;
}
:deep(.van-nav-bar .van-icon) {
color: #000000;
}
:deep(.van-cell-group--inset) {
overflow: visible;
}
:deep(.van-cell) {
overflow: visible;
}
:deep(.van-field__error-message) {
position: absolute;
}
:deep(.van-cell:after) {
border-bottom: 0px;
}
</style>
\ No newline at end of file
......@@ -67,7 +67,13 @@ const routes = [
component: () => import(/* webpackChunkName: "page-doctor" */ '@/doctor/resident/Visit.vue')
},
]
}
},
//修改基本信息
{
path: 'resident/base/update',
name: 'doctor-resident-base-update',
component: () => import(/* webpackChunkName: "page-doctor" */ '@/doctor/resident/form/BaseInfo.vue')
},
]
}
]
......
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