Commit cf6ad67a authored by gengchunlei's avatar gengchunlei

慢综 医生端 随访表单

parent 038258f0
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
const res = await getDict() const res = await getDict()
this.store.$patch({ dict: res.data || {} }) this.store.$patch({ dict: res.data || {} })
const user = await getAuthInfo() const user = await getAuthInfo()
this.store.$patch(user.data) this.store.$patch({authInfo: user.data || {}})
this.visible = true this.visible = true
} else { } else {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import { getOfficeList } from '@/api/doctor/generalFU.js' import { getOfficeList } from '@/api/doctor/generalFU.js'
export default { export default {
name: 'DocUnit', name: 'DocOffice',
props: { props: {
show: Boolean, show: Boolean,
value: [String, Number], value: [String, Number],
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import { getOfficeDoctor } from '@/api/doctor/generalFU.js' import { getOfficeDoctor } from '@/api/doctor/generalFU.js'
export default { export default {
name: 'DocUnit', name: 'DocOfficeDoctor',
props: { props: {
show: Boolean, show: Boolean,
value: [String, Number], value: [String, Number],
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<div>{{ info.disposalOpinion }}</div> <div>{{ info.disposalOpinion }}</div>
</div> </div>
</div> </div>
<div class='mt-2' v-if="(showOne || showTwo) && info.visitSituation == 1"> <div class='mt-2' v-if="(showOne || showTwo) && info.visitSituation == 1 && info.isHealthGuide == 1">
<div>健康指导</div> <div>健康指导</div>
<div class='white-b mt-2'> <div class='white-b mt-2'>
<div class='flex flex-wrap' v-for="(item, index) in healthInterventionsInfo.visitHealthGuideList" > <div class='flex flex-wrap' v-for="(item, index) in healthInterventionsInfo.visitHealthGuideList" >
......
...@@ -88,6 +88,30 @@ ...@@ -88,6 +88,30 @@
class='input-back mt-2 form-input' class='input-back mt-2 form-input'
:rules='rules.contactName' :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> <div class='label-title mt-5'>现住址</div>
<van-field <van-field
v-model='form.presentCodeName' v-model='form.presentCodeName'
...@@ -114,7 +138,7 @@ ...@@ -114,7 +138,7 @@
<div class='flex items-center justify-between mt-5'> <div class='flex items-center justify-between mt-5'>
<div class='label-title '>户口地址</div> <div class='label-title '>户口地址</div>
<van-button size='mini' plain type='primary' <van-button size='mini' plain type='primary'
@click='setRegisteredAddress'>同步住址 @click='setRegisteredAddress'>同步住址
</van-button> </van-button>
</div> </div>
...@@ -143,7 +167,7 @@ ...@@ -143,7 +167,7 @@
<div class='title mt-5'>随访信息</div> <div class='title mt-5'>随访信息</div>
<div class='label-title mt-5'>本次随访情况</div> <div class='label-title mt-5'>本次随访情况</div>
<van-field name='radio' :rules='rules.visitSituation' class='p-12-0' > <van-field name='radio' :rules='rules.visitSituation' class='p-12-0'>
<template #input> <template #input>
<van-radio-group v-model='form.visitSituation' class='w-full' shape='dot'> <van-radio-group v-model='form.visitSituation' class='w-full' shape='dot'>
<van-cell-group> <van-cell-group>
...@@ -297,24 +321,25 @@ ...@@ -297,24 +321,25 @@
<div> <div>
是否指导? 是否指导?
</div> </div>
<van-radio-group v-model="form.isHealthGuide" direction="horizontal" shape='dot'> <van-radio-group v-model='form.isHealthGuide' direction='horizontal'
shape='dot'>
<div class='flex items-center w-full'> <div class='flex items-center w-full'>
<van-cell title="是" clickable <van-cell title='是' clickable
@click="form.isHealthGuide = '1'" @click="form.isHealthGuide = '1'"
style='flex: 1' style='flex: 1'
class='input-back form-input' class='input-back form-input'
> >
<template #right-icon> <template #right-icon>
<van-radio name="1" /> <van-radio name='1' />
</template> </template>
</van-cell> </van-cell>
<van-cell title="否" clickable <van-cell title='否' clickable
@click="form.isHealthGuide = '2'" @click="form.isHealthGuide = '2'"
style='flex: 1' style='flex: 1'
class='input-back form-input ml-2' class='input-back form-input ml-2'
> >
<template #right-icon> <template #right-icon>
<van-radio name="2" /> <van-radio name='2' />
</template> </template>
</van-cell> </van-cell>
</div> </div>
...@@ -335,24 +360,25 @@ ...@@ -335,24 +360,25 @@
<div> <div>
是否指导? 是否指导?
</div> </div>
<van-radio-group v-model="form.isHealthGuide" direction="horizontal" shape='dot'> <van-radio-group v-model='form.isHealthGuide' direction='horizontal'
shape='dot'>
<div class='flex items-center w-full'> <div class='flex items-center w-full'>
<van-cell title="是" clickable <van-cell title='是' clickable
@click="form.isHealthGuide = '1'" @click="form.isHealthGuide = '1'"
style='flex: 1' style='flex: 1'
class='input-back form-input' class='input-back form-input'
> >
<template #right-icon> <template #right-icon>
<van-radio name="1" /> <van-radio name='1' />
</template> </template>
</van-cell> </van-cell>
<van-cell title="否" clickable <van-cell title='否' clickable
@click="form.isHealthGuide = '2'" @click="form.isHealthGuide = '2'"
style='flex: 1' style='flex: 1'
class='input-back form-input ml-2' class='input-back form-input ml-2'
> >
<template #right-icon> <template #right-icon>
<van-radio name="2" /> <van-radio name='2' />
</template> </template>
</van-cell> </van-cell>
</div> </div>
...@@ -374,15 +400,15 @@ ...@@ -374,15 +400,15 @@
催检内容: 催检内容:
</div> </div>
<div> <div>
请您于{{form.screenTime}}到{{authInfo.unitName }}棉一社区服务中心进行复查,祝早日 恢复健康! 请您于{{ form.screenTime }}到{{ authInfo.unitName }}进行复查,祝早日 恢复健康!
</div> </div>
<div class='mt-2' style='text-align: center'> <div class='mt-2' style='text-align: center'>
<span style='color: #607FF0' @click='showTime1 = true'>修改日期</span> <span style='color: #607FF0' @click='showTime1 = true'>修改日期</span>
</div> </div>
</div> </div>
</div> </div>
<van-popup v-model:show="showTime1" position="bottom"> <van-popup v-model:show='showTime1' position='bottom'>
<van-date-picker @confirm="timeConfirm1" @cancel="showBirth = false" /> <van-date-picker @confirm='timeConfirm1' @cancel='showBirth = false' />
</van-popup> </van-popup>
<van-cell title='微信(催检)' clickable @click="form.visitWay = '12'" <van-cell title='微信(催检)' clickable @click="form.visitWay = '12'"
...@@ -399,15 +425,15 @@ ...@@ -399,15 +425,15 @@
催检内容: 催检内容:
</div> </div>
<div> <div>
请您于{{form.screenTime}}到{{authInfo.unitName }}棉一社区服务中心进行复查,祝早日 恢复健康! 请您于{{ form.screenTime }}到{{ authInfo.unitName }}进行复查,祝早日 恢复健康!
</div> </div>
<div class='mt-2' style='text-align: center'> <div class='mt-2' style='text-align: center'>
<span style='color: #607FF0' @click='showTime2 = true'>修改日期</span> <span style='color: #607FF0' @click='showTime2 = true'>修改日期</span>
</div> </div>
</div> </div>
</div> </div>
<van-popup v-model:show="showTime2" position="bottom"> <van-popup v-model:show='showTime2' position='bottom'>
<van-date-picker @confirm="timeConfirm2" @cancel="showBirth = false" /> <van-date-picker @confirm='timeConfirm2' @cancel='showBirth = false' />
</van-popup> </van-popup>
</van-cell-group> </van-cell-group>
</van-radio-group> </van-radio-group>
...@@ -420,7 +446,7 @@ ...@@ -420,7 +446,7 @@
<script> <script>
import { addToArr, fetchDataHandle } from '@/utils/common' import { addToArr, fetchDataHandle } from '@/utils/common'
import { useStore } from '@/resident/store' import { useStore } from '@/doctor/store'
import DocAddress from '@/components/docAddress/DocAddress' import DocAddress from '@/components/docAddress/DocAddress'
import dayjs from 'dayjs' import dayjs from 'dayjs'
...@@ -488,7 +514,7 @@ const defaultForm = (info = {}) => { ...@@ -488,7 +514,7 @@ const defaultForm = (info = {}) => {
// diseaseId: undefined, // diseaseId: undefined,
// 与居民关系 // 与居民关系
relation: undefined, relation: undefined,
// relationOther: undefined, relationOther: undefined,
// 人群 // 人群
// chronicTagsArray: undefined, // chronicTagsArray: undefined,
// 建档单位、科室、医生 // 建档单位、科室、医生
...@@ -504,19 +530,15 @@ const defaultForm = (info = {}) => { ...@@ -504,19 +530,15 @@ const defaultForm = (info = {}) => {
deathReason: undefined, deathReason: undefined,
lossReasonOther: undefined, lossReasonOther: undefined,
visitWay: '5', visitWay: '5',
isHealthGuide: undefined, isHealthGuide: '1',
screenTime: new dayjs().add(1, 'day').format('YYYY-MM-DD'), screenTime: new dayjs().add(1, 'day').format('YYYY-MM-DD')
} }
Reflect.ownKeys(form).forEach(key => { Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) { if (info[key] != undefined) {
form[key] = info[key] form[key] = info[key]
} }
}) })
return fetchDataHandle(form, { return form
registeredCode: 'addToArr',
presentCode: 'addToArr'
// birthCode: 'addToArr'
})
} }
export default { export default {
name: 'BaseInfo', name: 'BaseInfo',
...@@ -531,9 +553,9 @@ export default { ...@@ -531,9 +553,9 @@ export default {
data() { data() {
return { return {
store: useStore(), store: useStore(),
authInfo: {},
// 民族 // 民族
showNational: false, showNational: false,
showRelation: false,
// 现住址 // 现住址
showPresent: false, showPresent: false,
// 户籍地址 // 户籍地址
...@@ -561,14 +583,29 @@ export default { ...@@ -561,14 +583,29 @@ export default {
} }
} }
}, },
computed: {
authInfo() {
return this.store.$state.authInfo
}
},
watch: { watch: {
'info': { 'info': {
handler() { handler() {
this.form = defaultForm(this.info) this.form = defaultForm(this.info)
// this.addressRecord.presentCode = addToArr(this.form.presentCode) if (this.form.presentCode) {
// this.addressRecord.registeredCode = addToArr(this.form.registeredCode) this.addressRecord.presentCode = addToArr(this.form.presentCode)
}
if (this.form.registeredCode) {
this.addressRecord.registeredCode = addToArr(this.form.registeredCode)
}
}, },
immediate: true immediate: true
},
'form.visitSituation': {
handler() {
this.$emit('changeVisitSituation', this.form.visitSituation)
}
} }
}, },
methods: { methods: {
...@@ -578,6 +615,12 @@ export default { ...@@ -578,6 +615,12 @@ export default {
this.form.nationalName = selectedOptions[0].name this.form.nationalName = selectedOptions[0].name
this.showNational = false this.showNational = false
}, },
//与居民关系
relationlConfirm({ selectedValues, selectedOptions }) {
this.form.relation = selectedValues[0]
this.form.relationName = selectedOptions[0].name
this.showRelation = false
},
// 现住址 // 现住址
presentChange(val) { presentChange(val) {
const selectedOptions = val.selectedOptions const selectedOptions = val.selectedOptions
...@@ -603,13 +646,13 @@ export default { ...@@ -603,13 +646,13 @@ export default {
}, },
toTel() { toTel() {
// 创建一个电话号码的URL // 创建一个电话号码的URL
let phoneNumber = '18487350810'; // 替换为需要拨打的号码 let phoneNumber = this.form.telephone // 替换为需要拨打的号码
let url = 'tel:' + encodeURIComponent(phoneNumber); let url = 'tel:' + encodeURIComponent(phoneNumber)
// 创建一个a标签 // 创建一个a标签
let a = document.createElement('a'); let a = document.createElement('a')
a.href = url; a.href = url
// 触发a标签的点击事件 // 触发a标签的点击事件
a.click(); a.click()
}, },
timeConfirm1({ selectedValues }) { timeConfirm1({ selectedValues }) {
this.form.screenTime = selectedValues.join('-') this.form.screenTime = selectedValues.join('-')
...@@ -619,24 +662,40 @@ export default { ...@@ -619,24 +662,40 @@ export default {
this.form.screenTime = selectedValues.join('-') this.form.screenTime = selectedValues.join('-')
this.showTime2 = false this.showTime2 = false
}, },
toNext() {
// this.$refs.form.validate().then(() => {
this.$emit('changeStep', 2)
// }).catch(err => console.warn(err))
},
onSubmit() { onSubmit() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => { this.$refs.form.validate().then(() => {
const {
visitSituation,
lossReason,
deathReason,
lossReasonOther,
visitWay,
isHealthGuide,
screenTime,
...others
} = this.form
let time = dayjs(screenTime).format('YYYY-MM-DD')
let content = `请您于${time}${this.authInfo.unitName}进行复查,祝早日恢复健康!`
let par = {
visitSituation,
lossReason,
deathReason,
lossReasonOther,
visitWay,
isHealthGuide,
screenTime,
urgentInsContent: content,
residentsRecord: {...others},
}
resolve( resolve(
fetchDataHandle(this.form, { fetchDataHandle(par, {
// birthCode: 'arrToAdd',
presentCode: 'arrToAdd', presentCode: 'arrToAdd',
registeredCode: 'arrToAdd' registeredCode: 'arrToAdd'
}) })
) )
}).catch((e) => { }).catch((e) => {
console.warn('ArchiveCommon error', e) console.warn('ArchiveCommon error', e)
reject(e)
}) })
}) })
} }
...@@ -683,6 +742,7 @@ export default { ...@@ -683,6 +742,7 @@ export default {
padding: 8px; padding: 8px;
border-radius: 0px 0px 8px 8px; border-radius: 0px 0px 8px 8px;
} }
.tel { .tel {
background: #FFFFFF; background: #FFFFFF;
padding: 8px; padding: 8px;
...@@ -693,6 +753,7 @@ export default { ...@@ -693,6 +753,7 @@ export default {
color: #607FF0; color: #607FF0;
font-weight: bold; font-weight: bold;
} }
.p-12-0 { .p-12-0 {
padding: 12px 0px; padding: 12px 0px;
} }
...@@ -708,6 +769,7 @@ export default { ...@@ -708,6 +769,7 @@ export default {
:deep(.van-field__error-message) { :deep(.van-field__error-message) {
position: absolute; position: absolute;
} }
:deep(.van-cell:after) { :deep(.van-cell:after) {
border-bottom: 0px; border-bottom: 0px;
} }
......
...@@ -11,27 +11,30 @@ ...@@ -11,27 +11,30 @@
class='input-back mt-2 form-input' class='input-back mt-2 form-input'
@click="show1 = true" @click="show1 = true"
/> />
<DocUnit v-model:show="show1" v-model:value="value1" @change="(option) => value1 = option"/> <DocUnit v-model:show="show1" v-model:value="form.visitUnitId" @change="changeUnit"/>
<div class='no-req-label mt-5'>随访科室</div> <div class='no-req-label mt-5'>随访科室</div>
<van-field <van-field
v-model='form.visitOfficeName' v-model='form.visitOfficeName'
is-link is-link
disabled readonly
placeholder='随访科室' placeholder='随访科室'
class='input-back mt-2 form-input' class='input-back mt-2 form-input'
@click='show2 = true'
/> />
<DocOffice v-model:show="show2" v-model:value="value2" @change="(option) => value2 = option" unitId="21649"/> <DocOffice v-model:show="show2" v-model:value="form.visitOfficeId" @change="changeOffice" :unitId="form.visitUnitId"/>
<div class='no-req-label mt-5'>随访医生</div> <div class='no-req-label mt-5'>随访医生</div>
<van-field <van-field
v-model='form.visitDoctorName' v-model='form.visitDoctorName'
is-link is-link
disabled readonly
placeholder='随访医生' placeholder='随访医生'
class='input-back mt-2 form-input' class='input-back mt-2 form-input'
@click='show3 = true'
/> />
<DocOfficeDoctor v-model:show="show3" v-model:value="value3" @change="(option) => value3 = option" unitId="21649" officeId="36234"/>
<DocOfficeDoctor v-model:show="show3" v-model:value="form.visitDoctorId" @change="changeDoctor" :unitId="form.visitUnitId" :officeId="form.visitOfficeId"/>
</van-cell-group> </van-cell-group>
</van-form> </van-form>
</div> </div>
...@@ -40,9 +43,13 @@ ...@@ -40,9 +43,13 @@
<script> <script>
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { useStore } from '@/doctor/store' import { useStore } from '@/doctor/store'
import DocUnit from '@/doctor/components/docUnit/DocUnit'
import DocOffice from '@/doctor/components/docOffice/DocOffice'
import DocOfficeDoctor from '@/doctor/components/docOfficeDoctor/DocOfficeDoctor'
export default { export default {
name: 'CommonBottom', name: 'CommonBottom',
components: { DocOfficeDoctor, DocOffice, DocUnit },
props: { props: {
info: { info: {
default: () => { default: () => {
...@@ -53,10 +60,9 @@ export default { ...@@ -53,10 +60,9 @@ export default {
data() { data() {
return { return {
store: useStore(), store: useStore(),
authInfo: {}, show1: false,
showPopup: false, show2: false,
searchText: undefined, show3: false,
searchResults: [],
form: {}, form: {},
rules: {} rules: {}
} }
...@@ -69,11 +75,11 @@ export default { ...@@ -69,11 +75,11 @@ export default {
immediate: true immediate: true
} }
}, },
// computed: { computed: {
// authInfo() { authInfo() {
// return store.state.authInfo return this.store.$state.authInfo
// } }
// }, },
methods: { methods: {
setForm(info) { setForm(info) {
const form = { const form = {
...@@ -105,8 +111,39 @@ export default { ...@@ -105,8 +111,39 @@ export default {
}) })
return form return form
}, },
onSearch() { changeUnit(val) {
debugger this.form.visitUnitName = val.unitName
this.form.visitUnitId = val.id
this.form.visitOfficeId = undefined
this.form.visitOfficeName = undefined
this.form.visitDoctorId = undefined
this.form.visitDoctorName = undefined
this.show1 = false
},
changeOffice(val) {
this.form.visitOfficeId = val.id
this.form.visitOfficeName = val.officeName
this.form.visitDoctorId = undefined
this.form.visitDoctorName = undefined
this.show2 = false
},
changeDoctor(val) {
this.form.visitDoctorId = val.id
this.form.visitDoctorName = val.staffName
this.show3 = false
},
onSubmit() {
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
let par = {
...this.form,
}
resolve(par)
}).catch((e) => {
console.warn('ArchiveCommon error', e)
reject(e)
})
})
} }
} }
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<van-form ref='form'> <van-form ref='form'>
<div class='title'>随访信息</div> <div class='title'>随访信息</div>
<van-cell-group inset> <van-cell-group inset>
<div v-if="showOne && firstForm.visitSituation == 1">
<div class='no-req-label'>随访内容</div> <div class='no-req-label'>随访内容</div>
<van-field <van-field
v-model='form.visitContent' v-model='form.visitContent'
...@@ -12,6 +13,8 @@ ...@@ -12,6 +13,8 @@
autosize autosize
type='textarea' type='textarea'
/> />
</div>
<div v-if="showOne && firstForm.visitSituation == 1">
<div class='no-req-label mt-5'>处置意见</div> <div class='no-req-label mt-5'>处置意见</div>
<van-field <van-field
v-model='form.idCard' v-model='form.idCard'
...@@ -21,6 +24,8 @@ ...@@ -21,6 +24,8 @@
placeholder='处置意见' placeholder='处置意见'
class='input-back mt-2 form-input' class='input-back mt-2 form-input'
/> />
</div>
<div v-if='(showOne || showTwo) && firstForm.visitSituation == 1 && firstForm.isHealthGuide == 1'>
<div class='no-req-label mt-5'>健康指导</div> <div class='no-req-label mt-5'>健康指导</div>
<div class='health mt-2'> <div class='health mt-2'>
<div class='health-cell mt-2' v-for='item in form.visitHealthGuideList'> <div class='health-cell mt-2' v-for='item in form.visitHealthGuideList'>
...@@ -35,12 +40,14 @@ ...@@ -35,12 +40,14 @@
/> />
</div> </div>
</div> </div>
</div>
<div v-if="showOne && firstForm.visitSituation == 1">
<div class='no-req-label mt-5'>上传随访记录</div> <div class='no-req-label mt-5'>上传随访记录</div>
<div class='tips'> <div class='tips'>
支持上传jpg、png、jpeg文件,大小请在10M以内 支持上传jpg、png、jpeg文件,大小请在10M以内
</div> </div>
<div class='img-btn mt-2' @click='toUpload'> <div class='img-btn mt-2' @click="toUpload('imgId')">
<input type='file' id='imgId' multiple @change='choiceImg' style='display: none' :key='new Date().getTime()'> <input type='file' id='imgId' multiple @change='choiceImg' style='display: none' :key='new Date().getTime()'>
<div class='flex items-center justify-center'> <div class='flex items-center justify-center'>
<div> <div>
...@@ -81,7 +88,57 @@ ...@@ -81,7 +88,57 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div v-if="showOne && firstForm.visitSituation == 1">
<div class='no-req-label mt-5'>现场随访照片</div>
<div class='tips'>
支持上传jpg、png、jpeg文件,大小请在10M以内
</div>
<div class='img-btn mt-2' @click="toUpload('imgId2')">
<input type='file' id='imgId2' multiple @change='choiceImg2' style='display: none' :key='new Date().getTime()-10000'>
<div class='flex items-center justify-center'>
<div>
<doc-icon type='doc-upload' class='doc-up' />
</div>
<div class='ml-2'>上传图片</div>
</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' style='position: relative'>
<div>
<doc-icon type='doc-remove' class='remove' @click='delImg2(item.indexF)'></doc-icon>
</div>
<img :src='item.src' class='ml-2' style='width: 95px;height: 95px;'
@click='toPreview(index)'>
</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>
<span><doc-icon type='doc-remove' style='font-size: .24rem'
@click='delImg2(item.indexF)'></doc-icon></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div v-if="firstForm.visitSituation == 1">
<div class='label-title mt-5'>下次随访日期</div> <div class='label-title mt-5'>下次随访日期</div>
<van-field <van-field
v-model='form.nextVisitDate' v-model='form.nextVisitDate'
...@@ -95,7 +152,7 @@ ...@@ -95,7 +152,7 @@
<van-popup v-model:show="showDate" position="bottom"> <van-popup v-model:show="showDate" position="bottom">
<van-date-picker @confirm="dataConfirm" @cancel="showDate = false" /> <van-date-picker @confirm="dataConfirm" @cancel="showDate = false" />
</van-popup> </van-popup>
</div>
</van-cell-group> </van-cell-group>
</van-form> </van-form>
</div> </div>
...@@ -106,6 +163,7 @@ import { useStore } from '@/resident/store' ...@@ -106,6 +163,7 @@ import { useStore } from '@/resident/store'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import DocIcon from '@/components/docIcon/DocIcon' import DocIcon from '@/components/docIcon/DocIcon'
import { showImagePreview } from 'vant' import { showImagePreview } from 'vant'
import { fetchDataHandle } from '@/utils/common'
export default { export default {
name: 'GeneralFUForm', name: 'GeneralFUForm',
...@@ -115,15 +173,23 @@ export default { ...@@ -115,15 +173,23 @@ export default {
default: () => { default: () => {
return {} return {}
} }
} },
firstForm: {
default: () => {
return {}
}
},
}, },
data() { data() {
return { return {
store: useStore(), store: useStore(),
authInfo: {},
form: {}, form: {},
imgList: [], imgList: [],
imgList2: [],
showDate: false, showDate: false,
showOne: false,
showTwo: false,
showThree: false,
rules: { rules: {
nextVisitDate: [{required: true,message: '请选择'}] nextVisitDate: [{required: true,message: '请选择'}]
} }
...@@ -135,6 +201,35 @@ export default { ...@@ -135,6 +201,35 @@ export default {
this.form = this.setForm(this.info) this.form = this.setForm(this.info)
}, },
immediate: true immediate: true
},
},
computed: {
//复检指导
showOne() {
const {visitWay} = this.firstForm
let res = false
if (visitWay == 5 || visitWay == 6 || visitWay == 7 || visitWay == 8) {
res = true
}
return res
},
//微信、短信指导
showTwo() {
const {visitWay} = this.firstForm
let res = false
if (visitWay == 9 || visitWay == 11) {
res = true
}
return res
},
//催检
showThree() {
const {visitWay} = this.firstForm
let res = false
if (visitWay == 10 || visitWay == 12) {
res = true
}
return res
} }
}, },
methods: { methods: {
...@@ -185,16 +280,17 @@ export default { ...@@ -185,16 +280,17 @@ export default {
} }
return form.visitHealthGuideList return form.visitHealthGuideList
}, },
toUpload() { toUpload(id) {
let input = document.getElementById('imgId') let input = document.getElementById(id)
input.click() input.click()
}, },
choiceImg() { choiceImg() {
let input = document.getElementById('imgId') let input = document.getElementById('imgId')
let file = input.files let file = input.files
let newFile = Array.from(file) let newFile = Array.from(file)
let maxIndexF = Math.max(...this.imgList.map(item => item.indexF));
newFile.forEach((item, index) => { newFile.forEach((item, index) => {
item['indexF'] = index + 1 item['indexF'] = maxIndexF+ index + 1
item['src'] = window.URL.createObjectURL(item) item['src'] = window.URL.createObjectURL(item)
item['imgFlag'] = '' item['imgFlag'] = ''
if (item.type == 'application/pdf') { if (item.type == 'application/pdf') {
...@@ -206,6 +302,24 @@ export default { ...@@ -206,6 +302,24 @@ export default {
}) })
this.imgList = this.imgList.concat(newFile) this.imgList = this.imgList.concat(newFile)
}, },
choiceImg2() {
let input = document.getElementById('imgId2')
let file = input.files
let newFile = Array.from(file)
let maxIndexF = Math.max(...this.imgList2.map(item => item.indexF));
newFile.forEach((item, index) => {
item['indexF'] = maxIndexF+ index + 1
item['src'] = window.URL.createObjectURL(item)
item['imgFlag'] = ''
if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf'
}
if (item.type == 'image/jpeg' || item.type == 'image/png') {
item['imgFlag'] = 'img'
}
})
this.imgList2 = this.imgList2.concat(newFile)
},
//图片预览 //图片预览
toPreview(index) { toPreview(index) {
// let list = [] // let list = []
...@@ -226,11 +340,28 @@ export default { ...@@ -226,11 +340,28 @@ export default {
delImg(index) { delImg(index) {
this.imgList = this.imgList.filter(item => item.indexF != index) this.imgList = this.imgList.filter(item => item.indexF != index)
}, },
delImg2(index) {
this.imgList2 = this.imgList2.filter(item => item.indexF != index)
},
dataConfirm({ selectedValues }) { dataConfirm({ selectedValues }) {
this.form.nextVisitDate = selectedValues.join('-') this.form.nextVisitDate = selectedValues.join('-')
this.showDate = false this.showDate = false
}, },
onSubmit() {
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
let par = {
img1: this.imgList,
img2: this.imgList2,
...this.form,
}
resolve(par)
}).catch((e) => {
console.warn('ArchiveCommon error', e)
// reject(e)
})
})
}
} }
} }
</script> </script>
......
...@@ -2,26 +2,34 @@ ...@@ -2,26 +2,34 @@
<div> <div>
<van-nav-bar title='新增通用随访' left-text='' left-arrow @click-left='toBack'></van-nav-bar> <van-nav-bar title='新增通用随访' left-text='' left-arrow @click-left='toBack'></van-nav-bar>
<div class='p-4 h-overflow'> <div class='p-4 h-overflow'>
<base-info :info="info" v-show='step == 1' ref='baseInfo'></base-info> <base-info :info='info' v-show='step == 1' ref='baseInfo'
<general-f-u-form :info='info' v-show='step == 2' ref='generalFUForm'></general-f-u-form> @changeVisitSituation='changeVisitSituation'></base-info>
<general-f-u-form :info='info' :first-form='firstForm' v-show='step == 2' ref='generalFUForm'></general-f-u-form>
<common-bottom :info='info' v-show='step == 3' ref='commonBottom'></common-bottom> <common-bottom :info='info' v-show='step == 3' ref='commonBottom'></common-bottom>
</div> </div>
<div class='pt-2 pb-2'> <div class='pt-2 pb-2'>
<div class="px-5 grow flex flex-col justify-end" v-if='step == 1'> <div class='px-5 grow flex flex-col justify-end' v-if='step == 1'>
<van-button type="primary" block round <van-button type='primary' block round v-if='visitSituation ==1'
@click="toNext(2)">下一步</van-button> @click='toNext(2)'>下一步
</van-button>
<van-button type='primary' block round v-if='visitSituation ==2'
@click='toNext(3)'>下一步
</van-button>
</div> </div>
<div class="px-5 flex align-center justify-around" v-if='step == 2'> <div class='px-5 flex align-center justify-around' v-if='step == 2'>
<van-button type="primary" round plain style="width: 44%" <van-button type='primary' round plain style='width: 44%'
@click="toNext(1)">上一步</van-button> @click='toNext(1)'>上一步
<van-button type="primary" round style="width: 44%" </van-button>
@click="toNext(3)">下一步</van-button> <van-button type='primary' round style='width: 44%'
@click='toNext(3)'>下一步
</van-button>
</div> </div>
<div class="px-5 grow flex flex-col justify-end" v-if='step == 3'> <div class='px-5 grow flex flex-col justify-end' v-if='step == 3'>
<van-button type="primary" block round <van-button type='primary' block round
@click="onsubmit">提交</van-button> @click='onsubmit'>提交
</van-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -40,7 +48,10 @@ export default { ...@@ -40,7 +48,10 @@ export default {
return { return {
info: {}, info: {},
resident: {}, resident: {},
visitSituation: 1,
step: 1, step: 1,
//第一步提交的表单
firstForm: {},
} }
}, },
created() { created() {
...@@ -55,9 +66,9 @@ export default { ...@@ -55,9 +66,9 @@ export default {
async init() { async init() {
this.info = {} this.info = {}
const res = await getChronicResidentsId(this.routerDetail.residentInfoId) const res = await getChronicResidentsId(this.routerDetail.residentInfoId)
const { id, ...others} = res.data const { id, ...others } = res.data
this.info = { this.info = {
...others ...others
} }
this.info.diseaseType = this.routerDetail.diseaseType this.info.diseaseType = this.routerDetail.diseaseType
if (this.routerDetail.id) { if (this.routerDetail.id) {
...@@ -68,18 +79,37 @@ export default { ...@@ -68,18 +79,37 @@ export default {
} }
} }
}, },
toNext(val) { async toNext(val) {
if (val == 2) {
this.firstForm = await this.$refs.baseInfo.onSubmit()
}
if (val == 3) {
await this.$refs.generalFUForm.onSubmit()
}
this.step = val this.step = val
}, },
onsubmit() { changeVisitSituation(val) {
this.visitSituation = val
}, },
async onsubmit() {
let baseInfo = await this.$refs.baseInfo.onSubmit()
let generalFUForm = await this.$refs.generalFUForm.onSubmit()
let commonBottom = await this.$refs.commonBottom.onSubmit()
},
toBack() { toBack() {
if (this.step != 1) { if (this.visitSituation == 1) {
this.step-- if (this.step != 1) {
} else { this.step--
this.$router.back() }
return
} }
if (this.visitSituation == 2) {
if (this.step != 1) {
this.step = 1
}
return
}
this.$router.back()
} }
} }
} }
...@@ -89,6 +119,7 @@ export default { ...@@ -89,6 +119,7 @@ export default {
:deep(.van-nav-bar .van-icon) { :deep(.van-nav-bar .van-icon) {
color: #000000; color: #000000;
} }
.h-overflow { .h-overflow {
height: calc(100vh - 110px); height: calc(100vh - 110px);
overflow-y: auto; overflow-y: auto;
......
...@@ -15,11 +15,6 @@ export const useStore = defineStore('chronic', { ...@@ -15,11 +15,6 @@ export const useStore = defineStore('chronic', {
if (!dict) return [] if (!dict) return []
return this.dict[dict] || [] return this.dict[dict] || []
}, },
setAuthInfo(authInfo) {
if (!authInfo) return {}
this.authInfo = authInfo
return
},
getDictValue(dict, value) { getDictValue(dict, value) {
let array = [] let array = []
if (typeof dict === 'string') { if (typeof dict === 'string') {
......
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