Commit d56bbee8 authored by gengchunlei's avatar gengchunlei

慢综 医生端 随访表单接口对接

parent cf6ad67a
import {fetchBase} from '@/api/doctor/doctorFetch' import { fetchBase } from '@/api/doctor/doctorFetch'
//获取登录信息 //获取登录信息
export function getAuthInfo() { export function getAuthInfo() {
...@@ -7,7 +7,11 @@ export function getAuthInfo() { ...@@ -7,7 +7,11 @@ export function getAuthInfo() {
//查询居民信息 //查询居民信息
export function getChronicResidentsId(residentInfoId) { export function getChronicResidentsId(residentInfoId) {
return fetchBase({ url: `/chronic-admin/v1/chronic-residents-record/resident-info`,body:{"residentInfoId":residentInfoId},loading: true}) return fetchBase({
url: `/chronic-admin/v1/chronic-residents-record/resident-info`,
body: { 'residentInfoId': residentInfoId },
loading: true
})
} }
// 主键查询 // 主键查询
...@@ -38,4 +42,24 @@ export function getOfficeList(unitId) { ...@@ -38,4 +42,24 @@ export function getOfficeList(unitId) {
// 根据科室id查询医生 // 根据科室id查询医生
export function getOfficeDoctor(unitId, officeId) { export function getOfficeDoctor(unitId, officeId) {
return fetchBase({ url: `/tumour-admin/v1/sys-user/org-office-doctors/${unitId}/${officeId}` }) return fetchBase({ url: `/tumour-admin/v1/sys-user/org-office-doctors/${unitId}/${officeId}` })
}
// 新增通用随访
export function addCurrency(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-visit-currency/save`, body: params, loading: true })
}
//修改通用随访
export function updateCurrency(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-visit-currency/update`, body: params, loading: true })
}
//图片上传
export function upLoadMultifile(params) {
return fetchBase({
url: `/chronic-admin/v1/pictures-info/multifile`,
body: params,
loading: false,
contentType: 'file'
})
} }
\ No newline at end of file
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
let token = getQueryVariable('token') let token = getQueryVariable('token')
if (!token) { if (!token) {
// token = sessionStorage.getItem('token') // token = sessionStorage.getItem('token')
token = '842c7b77-9f98-43b7-bfe4-909d22472904' token = '4a3719ad-a7d8-47ae-accc-3e332ac2117b'
} }
if (token) { if (token) {
sessionStorage.setItem('token', token) sessionStorage.setItem('token', token)
......
...@@ -135,6 +135,7 @@ ...@@ -135,6 +135,7 @@
<script> <script>
import { fetchCurrencyById } from '@/api/doctor/generalFU' import { fetchCurrencyById } from '@/api/doctor/generalFU'
import { showToast } from 'vant'
export default { export default {
name: 'Detail', name: 'Detail',
...@@ -205,7 +206,7 @@ export default { ...@@ -205,7 +206,7 @@ export default {
methods: { methods: {
async load() { async load() {
if (!this.routerDetail.relationId) { if (!this.routerDetail.relationId) {
this.$message.info('未获取到信息') showToast('未获取到信息');
return return
} }
let par = { let par = {
......
...@@ -453,6 +453,7 @@ import dayjs from 'dayjs' ...@@ -453,6 +453,7 @@ import dayjs from 'dayjs'
const defaultForm = (info = {}) => { const defaultForm = (info = {}) => {
const form = { const form = {
id: undefined, id: undefined,
personId: undefined,
residentInfoId: undefined, residentInfoId: undefined,
// 年龄 // 年龄
currentAge: undefined, currentAge: undefined,
...@@ -666,6 +667,7 @@ export default { ...@@ -666,6 +667,7 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => { this.$refs.form.validate().then(() => {
const { const {
personId,
visitSituation, visitSituation,
lossReason, lossReason,
deathReason, deathReason,
...@@ -685,8 +687,12 @@ export default { ...@@ -685,8 +687,12 @@ export default {
visitWay, visitWay,
isHealthGuide, isHealthGuide,
screenTime, screenTime,
residentInfoId: this.form.residentInfoId,
urgentInsContent: content, urgentInsContent: content,
residentsRecord: {...others}, residentsRecord: {
...others,
id: this.form.personId,
},
} }
resolve( resolve(
fetchDataHandle(par, { fetchDataHandle(par, {
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<div> <div>
<doc-icon type='doc-remove' class='remove' @click='delImg(item.indexF)'></doc-icon> <doc-icon type='doc-remove' class='remove' @click='delImg(item.indexF)'></doc-icon>
</div> </div>
<img :src='item.src' class='ml-2' style='width: 95px;height: 95px;' <img :src='item.trueDownloadUrl' class='ml-2' style='width: 95px;height: 95px;'
@click='toPreview(index)'> @click='toPreview(index)'>
</div> </div>
</div> </div>
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
<div> <div>
<doc-icon type='doc-remove' class='remove' @click='delImg2(item.indexF)'></doc-icon> <doc-icon type='doc-remove' class='remove' @click='delImg2(item.indexF)'></doc-icon>
</div> </div>
<img :src='item.src' class='ml-2' style='width: 95px;height: 95px;' <img :src='item.trueDownloadUrl' class='ml-2' style='width: 95px;height: 95px;'
@click='toPreview(index)'> @click='toPreview(index)'>
</div> </div>
</div> </div>
...@@ -187,9 +187,6 @@ export default { ...@@ -187,9 +187,6 @@ export default {
imgList: [], imgList: [],
imgList2: [], imgList2: [],
showDate: false, showDate: false,
showOne: false,
showTwo: false,
showThree: false,
rules: { rules: {
nextVisitDate: [{required: true,message: '请选择'}] nextVisitDate: [{required: true,message: '请选择'}]
} }
...@@ -199,6 +196,10 @@ export default { ...@@ -199,6 +196,10 @@ export default {
'info': { 'info': {
handler() { handler() {
this.form = this.setForm(this.info) this.form = this.setForm(this.info)
if (this.info.id) {
this.imgList = this.info.uploadVisitRecordImageList || []
this.imgList2 = this.info.sceneVisitImageList || []
}
}, },
immediate: true immediate: true
}, },
...@@ -291,7 +292,7 @@ export default { ...@@ -291,7 +292,7 @@ export default {
let maxIndexF = Math.max(...this.imgList.map(item => item.indexF)); let maxIndexF = Math.max(...this.imgList.map(item => item.indexF));
newFile.forEach((item, index) => { newFile.forEach((item, index) => {
item['indexF'] = maxIndexF+ index + 1 item['indexF'] = maxIndexF+ index + 1
item['src'] = window.URL.createObjectURL(item) item['trueDownloadUrl'] = window.URL.createObjectURL(item)
item['imgFlag'] = '' item['imgFlag'] = ''
if (item.type == 'application/pdf') { if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf' item['imgFlag'] = 'pdf'
...@@ -309,7 +310,7 @@ export default { ...@@ -309,7 +310,7 @@ export default {
let maxIndexF = Math.max(...this.imgList2.map(item => item.indexF)); let maxIndexF = Math.max(...this.imgList2.map(item => item.indexF));
newFile.forEach((item, index) => { newFile.forEach((item, index) => {
item['indexF'] = maxIndexF+ index + 1 item['indexF'] = maxIndexF+ index + 1
item['src'] = window.URL.createObjectURL(item) item['trueDownloadUrl'] = window.URL.createObjectURL(item)
item['imgFlag'] = '' item['imgFlag'] = ''
if (item.type == 'application/pdf') { if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf' item['imgFlag'] = 'pdf'
...@@ -324,7 +325,7 @@ export default { ...@@ -324,7 +325,7 @@ export default {
toPreview(index) { toPreview(index) {
// let list = [] // let list = []
// this.imgList.forEach(item => { // this.imgList.forEach(item => {
// list.push(item.src) // list.push(item.trueDownloadUrl)
// }) // })
// showImagePreview({ // showImagePreview({
// images: list, // images: list,
...@@ -335,7 +336,7 @@ export default { ...@@ -335,7 +336,7 @@ export default {
}, },
//pdf预览 //pdf预览
toPdf(item) { toPdf(item) {
// window.open(item.src) // window.open(item.trueDownloadUrl)
}, },
delImg(index) { delImg(index) {
this.imgList = this.imgList.filter(item => item.indexF != index) this.imgList = this.imgList.filter(item => item.indexF != index)
...@@ -351,9 +352,10 @@ export default { ...@@ -351,9 +352,10 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => { this.$refs.form.validate().then(() => {
let par = { let par = {
img1: this.imgList, img1: this.imgList || [],
img2: this.imgList2, img2: this.imgList2 || [],
...this.form, ...this.form,
healthGuideContent: JSON.stringify(this.form.visitHealthGuideList)
} }
resolve(par) resolve(par)
}).catch((e) => { }).catch((e) => {
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<div class='p-4 h-overflow'> <div class='p-4 h-overflow'>
<base-info :info='info' v-show='step == 1' ref='baseInfo' <base-info :info='info' v-show='step == 1' ref='baseInfo'
@changeVisitSituation='changeVisitSituation'></base-info> @changeVisitSituation='changeVisitSituation'></base-info>
<general-f-u-form :info='info' :first-form='firstForm' v-show='step == 2' ref='generalFUForm'></general-f-u-form> <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'>
...@@ -37,7 +38,13 @@ ...@@ -37,7 +38,13 @@
<script> <script>
import BaseInfo from '@/doctor/followUp/generalFU/form/BaseInfo' import BaseInfo from '@/doctor/followUp/generalFU/form/BaseInfo'
import { fetchCurrencyById, getChronicResidentsId } from '@/api/doctor/generalFU' import {
addCurrency,
fetchCurrencyById,
getChronicResidentsId,
updateCurrency,
upLoadMultifile
} from '@/api/doctor/generalFU'
import GeneralFUForm from '@/doctor/followUp/generalFU/form/GeneralFUForm' import GeneralFUForm from '@/doctor/followUp/generalFU/form/GeneralFUForm'
import CommonBottom from '@/doctor/followUp/generalFU/form/CommonBottom' import CommonBottom from '@/doctor/followUp/generalFU/form/CommonBottom'
...@@ -51,7 +58,7 @@ export default { ...@@ -51,7 +58,7 @@ export default {
visitSituation: 1, visitSituation: 1,
step: 1, step: 1,
//第一步提交的表单 //第一步提交的表单
firstForm: {}, firstForm: {}
} }
}, },
created() { created() {
...@@ -66,8 +73,20 @@ export default { ...@@ -66,8 +73,20 @@ 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,
createDate,
createDoctorId,
createDoctorName,
createOfficeId,
createOfficeName,
createUnitId,
createUnitName,
updated,
...others
} = res.data
this.info = { this.info = {
personId: id,
...others ...others
} }
this.info.diseaseType = this.routerDetail.diseaseType this.info.diseaseType = this.routerDetail.diseaseType
...@@ -79,23 +98,69 @@ export default { ...@@ -79,23 +98,69 @@ export default {
} }
} }
}, },
async toNext(val) { async toNext(val) {
if (val == 2) { if (val == 2) {
this.firstForm = await this.$refs.baseInfo.onSubmit() this.firstForm = await this.$refs.baseInfo.onSubmit()
} }
if (val == 3) { if (val == 3) {
await this.$refs.generalFUForm.onSubmit() await this.$refs.generalFUForm.onSubmit()
} }
this.step = val this.step = val
}, },
changeVisitSituation(val) { changeVisitSituation(val) {
this.visitSituation = val this.visitSituation = val
}, },
async onsubmit() { //图片上传
let baseInfo = await this.$refs.baseInfo.onSubmit() async upload(imgList = []) {
let generalFUForm = await this.$refs.generalFUForm.onSubmit() let list = []
let commonBottom = await this.$refs.commonBottom.onSubmit() 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.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()
let uploadVisitRecord = ''
let sceneVisitImage = ''
let fileId2 = Math.random().toString(16).substring(2, 8)
//图片上传
if (generalFUForm.img1.length) {
uploadVisitRecord = await this.upload(generalFUForm.img1)
}
if (generalFUForm.img2.length) {
sceneVisitImage = await this.upload(generalFUForm.img2)
}
let params = {
...baseInfo,
...generalFUForm,
...commonBottom,
uploadVisitRecord,
sceneVisitImage
}
if (this.info.id) {
params.visitRecordId = this.info.visitRecordId
}
if (params.visitSituation == 2) {
params.visitWay = 14
}
let fun = this.info.id ? updateCurrency : addCurrency
fun(params, true).then(({ code }) => {
if (code == 'SUCCESS') {
this.$router.back()
}
})
},
toBack() { toBack() {
if (this.visitSituation == 1) { if (this.visitSituation == 1) {
if (this.step != 1) { if (this.step != 1) {
......
...@@ -30,11 +30,11 @@ module.exports = defineConfig({ ...@@ -30,11 +30,11 @@ module.exports = defineConfig({
} }
}, },
'/chronic-admin': { '/chronic-admin': {
target: 'https://beta-tumour.zmnyjk.com', // target: 'https://beta-tumour.zmnyjk.com',
// target: 'http://192.168.1.26:8900', target: 'http://192.168.1.26:8900',
changOrigin: true, changOrigin: true,
pathRewrite: { pathRewrite: {
'^/chronic-admin': '/chronic-admin' '^/chronic-admin': '/'
} }
}, },
'/chronic-resident': { '/chronic-resident': {
......
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