Commit 1c971b73 authored by songrui's avatar songrui

Merge branch 'chronic-master' of…

Merge branch 'chronic-master' of http://gitlab.yiboshi.com/nightkis1995/frontend-h5 into chronic-master
parents 68c65d99 cf6ad67a
......@@ -58,7 +58,7 @@ export default {
const res = await getDict()
this.store.$patch({ dict: res.data || {} })
const user = await getAuthInfo()
this.store.$patch(user.data)
this.store.$patch({authInfo: user.data || {}})
this.visible = true
} else {
......
......@@ -17,7 +17,7 @@
import { getOfficeList } from '@/api/doctor/generalFU.js'
export default {
name: 'DocUnit',
name: 'DocOffice',
props: {
show: Boolean,
value: [String, Number],
......
......@@ -17,7 +17,7 @@
import { getOfficeDoctor } from '@/api/doctor/generalFU.js'
export default {
name: 'DocUnit',
name: 'DocOfficeDoctor',
props: {
show: Boolean,
value: [String, Number],
......
......@@ -97,7 +97,7 @@
<div>{{ info.disposalOpinion }}</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 class='white-b mt-2'>
<div class='flex flex-wrap' v-for="(item, index) in healthInterventionsInfo.visitHealthGuideList" >
......
......@@ -11,27 +11,30 @@
class='input-back mt-2 form-input'
@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>
<van-field
v-model='form.visitOfficeName'
is-link
disabled
readonly
placeholder='随访科室'
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>
<van-field
v-model='form.visitDoctorName'
is-link
disabled
readonly
placeholder='随访医生'
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-form>
</div>
......@@ -40,9 +43,13 @@
<script>
import dayjs from 'dayjs'
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 {
name: 'CommonBottom',
components: { DocOfficeDoctor, DocOffice, DocUnit },
props: {
info: {
default: () => {
......@@ -53,10 +60,9 @@ export default {
data() {
return {
store: useStore(),
authInfo: {},
showPopup: false,
searchText: undefined,
searchResults: [],
show1: false,
show2: false,
show3: false,
form: {},
rules: {}
}
......@@ -69,11 +75,11 @@ export default {
immediate: true
}
},
// computed: {
// authInfo() {
// return store.state.authInfo
// }
// },
computed: {
authInfo() {
return this.store.$state.authInfo
}
},
methods: {
setForm(info) {
const form = {
......@@ -105,8 +111,39 @@ export default {
})
return form
},
onSearch() {
debugger
changeUnit(val) {
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 @@
<van-form ref='form'>
<div class='title'>随访信息</div>
<van-cell-group inset>
<div v-if="showOne && firstForm.visitSituation == 1">
<div class='no-req-label'>随访内容</div>
<van-field
v-model='form.visitContent'
......@@ -12,6 +13,8 @@
autosize
type='textarea'
/>
</div>
<div v-if="showOne && firstForm.visitSituation == 1">
<div class='no-req-label mt-5'>处置意见</div>
<van-field
v-model='form.idCard'
......@@ -21,6 +24,8 @@
placeholder='处置意见'
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='health mt-2'>
<div class='health-cell mt-2' v-for='item in form.visitHealthGuideList'>
......@@ -35,12 +40,14 @@
/>
</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'>
<div class='img-btn mt-2' @click="toUpload('imgId')">
<input type='file' id='imgId' multiple @change='choiceImg' style='display: none' :key='new Date().getTime()'>
<div class='flex items-center justify-center'>
<div>
......@@ -81,7 +88,57 @@
</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>
<van-field
v-model='form.nextVisitDate'
......@@ -95,7 +152,7 @@
<van-popup v-model:show="showDate" position="bottom">
<van-date-picker @confirm="dataConfirm" @cancel="showDate = false" />
</van-popup>
</div>
</van-cell-group>
</van-form>
</div>
......@@ -106,6 +163,7 @@ import { useStore } from '@/resident/store'
import dayjs from 'dayjs'
import DocIcon from '@/components/docIcon/DocIcon'
import { showImagePreview } from 'vant'
import { fetchDataHandle } from '@/utils/common'
export default {
name: 'GeneralFUForm',
......@@ -115,15 +173,23 @@ export default {
default: () => {
return {}
}
}
},
firstForm: {
default: () => {
return {}
}
},
},
data() {
return {
store: useStore(),
authInfo: {},
form: {},
imgList: [],
imgList2: [],
showDate: false,
showOne: false,
showTwo: false,
showThree: false,
rules: {
nextVisitDate: [{required: true,message: '请选择'}]
}
......@@ -135,6 +201,35 @@ export default {
this.form = this.setForm(this.info)
},
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: {
......@@ -185,16 +280,17 @@ export default {
}
return form.visitHealthGuideList
},
toUpload() {
let input = document.getElementById('imgId')
toUpload(id) {
let input = document.getElementById(id)
input.click()
},
choiceImg() {
let input = document.getElementById('imgId')
let file = input.files
let newFile = Array.from(file)
let maxIndexF = Math.max(...this.imgList.map(item => item.indexF));
newFile.forEach((item, index) => {
item['indexF'] = index + 1
item['indexF'] = maxIndexF+ index + 1
item['src'] = window.URL.createObjectURL(item)
item['imgFlag'] = ''
if (item.type == 'application/pdf') {
......@@ -206,6 +302,24 @@ export default {
})
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) {
// let list = []
......@@ -226,11 +340,28 @@ export default {
delImg(index) {
this.imgList = this.imgList.filter(item => item.indexF != index)
},
delImg2(index) {
this.imgList2 = this.imgList2.filter(item => item.indexF != index)
},
dataConfirm({ selectedValues }) {
this.form.nextVisitDate = selectedValues.join('-')
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>
......
......@@ -2,26 +2,34 @@
<div>
<van-nav-bar title='新增通用随访' 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'></base-info>
<general-f-u-form :info='info' v-show='step == 2' ref='generalFUForm'></general-f-u-form>
<base-info :info='info' v-show='step == 1' ref='baseInfo'
@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>
</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
@click="toNext(2)">下一步</van-button>
<div class='px-5 grow flex flex-col justify-end' v-if='step == 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'
@click='toNext(3)'>下一步
</van-button>
</div>
<div class="px-5 flex align-center justify-around" v-if='step == 2'>
<van-button type="primary" round plain style="width: 44%"
@click="toNext(1)">上一步</van-button>
<van-button type="primary" round style="width: 44%"
@click="toNext(3)">下一步</van-button>
<div class='px-5 flex align-center justify-around' v-if='step == 2'>
<van-button type='primary' round plain style='width: 44%'
@click='toNext(1)'>上一步
</van-button>
<van-button type='primary' round style='width: 44%'
@click='toNext(3)'>下一步
</van-button>
</div>
<div class="px-5 grow flex flex-col justify-end" v-if='step == 3'>
<van-button type="primary" block round
@click="onsubmit">提交</van-button>
<div class='px-5 grow flex flex-col justify-end' v-if='step == 3'>
<van-button type='primary' block round
@click='onsubmit'>提交
</van-button>
</div>
</div>
</div>
......@@ -40,7 +48,10 @@ export default {
return {
info: {},
resident: {},
visitSituation: 1,
step: 1,
//第一步提交的表单
firstForm: {},
}
},
created() {
......@@ -55,9 +66,9 @@ export default {
async init() {
this.info = {}
const res = await getChronicResidentsId(this.routerDetail.residentInfoId)
const { id, ...others} = res.data
const { id, ...others } = res.data
this.info = {
...others
...others
}
this.info.diseaseType = this.routerDetail.diseaseType
if (this.routerDetail.id) {
......@@ -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
},
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() {
if (this.step != 1) {
this.step--
} else {
this.$router.back()
if (this.visitSituation == 1) {
if (this.step != 1) {
this.step--
}
return
}
if (this.visitSituation == 2) {
if (this.step != 1) {
this.step = 1
}
return
}
this.$router.back()
}
}
}
......@@ -89,6 +119,7 @@ export default {
:deep(.van-nav-bar .van-icon) {
color: #000000;
}
.h-overflow {
height: calc(100vh - 110px);
overflow-y: auto;
......
......@@ -15,11 +15,6 @@ export const useStore = defineStore('chronic', {
if (!dict) return []
return this.dict[dict] || []
},
setAuthInfo(authInfo) {
if (!authInfo) return {}
this.authInfo = authInfo
return
},
getDictValue(dict, value) {
let array = []
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