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" >
......
...@@ -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