Commit c78d2c48 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 16b46283 3d39a38f
......@@ -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
......@@ -184,8 +184,12 @@ export default {
return {
store: useStore(),
form: {},
//展示用
imgList: [],
imgList2: [],
//input图片值
imgInputList1: [],
imgInputList2: [],
showDate: false,
rules: {
nextVisitDate: [{required: true,message: '请选择'}]
......@@ -197,8 +201,8 @@ export default {
handler() {
this.form = this.setForm(this.info)
if (this.info.id) {
this.imgList = this.info.uploadVisitRecordImageList || []
this.imgList2 = this.info.sceneVisitImageList || []
this.imgList = this.imgListInfo1
this.imgList2 = this.imgListInfo2
}
},
immediate: true
......@@ -231,7 +235,35 @@ export default {
res = true
}
return res
}
},
imgListInfo1() {
const {uploadVisitRecordImageList = []} = this.info
uploadVisitRecordImageList.forEach((item, index) => {
item['imgFlag'] = ''
item['indexF'] = index + 1
if (item.fileType == 'pdf') {
item['imgFlag'] = 'pdf'
}
if (item.fileType == 'img') {
item['imgFlag'] = 'img'
}
})
return uploadVisitRecordImageList
},
imgListInfo2() {
const {sceneVisitImageList = []} = this.info
sceneVisitImageList.forEach((item, index) => {
item['imgFlag'] = ''
item['indexF'] = index + 1
if (item.fileType == 'pdf') {
item['imgFlag'] = 'pdf'
}
if (item.fileType == 'img') {
item['imgFlag'] = 'img'
}
})
return sceneVisitImageList
},
},
methods: {
setForm(info = {}) {
......@@ -302,6 +334,7 @@ export default {
}
})
this.imgList = this.imgList.concat(newFile)
this.imgInputList1 = this.imgInputList1.concat(newFile)
},
choiceImg2() {
let input = document.getElementById('imgId2')
......@@ -320,6 +353,8 @@ export default {
}
})
this.imgList2 = this.imgList2.concat(newFile)
console.log(this.imgList2)
this.imgInputList2 = this.imgInputList2.concat(newFile)
},
//图片预览
toPreview(index) {
......@@ -340,9 +375,11 @@ export default {
},
delImg(index) {
this.imgList = this.imgList.filter(item => item.indexF != index)
this.imgInputList1 = this.imgInputList1.filter(item => item.indexF != index)
},
delImg2(index) {
this.imgList2 = this.imgList2.filter(item => item.indexF != index)
this.imgInputList2 = this.imgInputList2.filter(item => item.indexF != index)
},
dataConfirm({ selectedValues }) {
this.form.nextVisitDate = selectedValues.join('-')
......@@ -354,6 +391,8 @@ export default {
let par = {
img1: this.imgList || [],
img2: this.imgList2 || [],
imgInput1: this.imgInputList1,
imgInput2: this.imgInputList2,
...this.form,
healthGuideContent: JSON.stringify(this.form.visitHealthGuideList)
}
......
<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) {
......@@ -113,40 +119,60 @@ export default {
//图片上传
async upload(imgList = []) {
let list = []
let fileId = Math.random().toString(16).substring(2, 8)
let data = new FormData()
data.append('parentId', fileId)
if (imgList.length) {
let fileId = Math.random().toString(16).substring(2, 8)
let data = new FormData()
data.append('parentId', fileId)
imgList.forEach(item => {
data.append('files', item)
})
let res = await upLoadMultifile(data)
let result = res.data || []
result.forEach(item => {
list.push(item.id)
})
}
return list
},
//原图片数据处理
baseImgHandle(imgList = []) {
let list = []
imgList.forEach(item => {
data.append('files', item)
})
let res = await upLoadMultifile(data)
let result = res.data || []
result.forEach(item => {
list.push(item.id)
})
return list.join()
return list
},
async onsubmit() {
debugger
let baseInfo = await this.$refs.baseInfo.onSubmit()
let generalFUForm = await this.$refs.generalFUForm.onSubmit()
let commonBottom = await this.$refs.commonBottom.onSubmit()
let imgInput1List = []
let imgInput2List = []
let uploadVisitRecord = ''
let sceneVisitImage = ''
let fileId2 = Math.random().toString(16).substring(2, 8)
//图片上传
if (generalFUForm.imgInput1.length) {
imgInput1List = await this.upload(generalFUForm.imgInput1)
}
if (generalFUForm.imgInput2.length) {
imgInput2List = await this.upload(generalFUForm.imgInput2)
}
if (generalFUForm.img1.length) {
uploadVisitRecord = await this.upload(generalFUForm.img1)
let img1List = this.baseImgHandle(generalFUForm.img1)
let lsit1 = [...imgInput1List, ...img1List]
uploadVisitRecord = Array.from(new Set(lsit1)).join()
}
if (generalFUForm.img2.length) {
sceneVisitImage = await this.upload(generalFUForm.img2)
let img2List = this.baseImgHandle(generalFUForm.img2)
let lsit2 = [...imgInput2List, ...img2List]
sceneVisitImage = Array.from(new Set(lsit2)).join()
}
let params = {
...baseInfo,
...generalFUForm,
...commonBottom,
uploadVisitRecord,
sceneVisitImage
sceneVisitImage,
}
if (this.info.id) {
params.visitRecordId = this.info.visitRecordId
......@@ -165,14 +191,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()
}
......
......@@ -86,7 +86,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'>
随访情况
......@@ -67,8 +67,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">
......@@ -176,9 +176,32 @@ export default {
showToast('该居民已标记为死亡,无法新增随访')
return
}
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({
......
This diff is collapsed.
......@@ -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