Commit ea51ea50 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 47777823 0d188aac
import {fetchBase} from '@/api/doctor/doctorFetch'
import { fetchBase } from '@/api/doctor/doctorFetch'
//获取登录信息
export function getAuthInfo() {
......@@ -7,7 +7,11 @@ export function getAuthInfo() {
//查询居民信息
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
})
}
// 主键查询
......@@ -39,3 +43,23 @@ export function getOfficeList(unitId) {
export function getOfficeDoctor(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
......@@ -135,6 +135,7 @@
<script>
import { fetchCurrencyById } from '@/api/doctor/generalFU'
import { showToast } from 'vant'
export default {
name: 'Detail',
......@@ -205,7 +206,7 @@ export default {
methods: {
async load() {
if (!this.routerDetail.relationId) {
this.$message.info('未获取到信息')
showToast('未获取到信息');
return
}
let par = {
......
......@@ -453,6 +453,7 @@ import dayjs from 'dayjs'
const defaultForm = (info = {}) => {
const form = {
id: undefined,
personId: undefined,
residentInfoId: undefined,
// 年龄
currentAge: undefined,
......@@ -666,6 +667,7 @@ export default {
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
const {
personId,
visitSituation,
lossReason,
deathReason,
......@@ -685,8 +687,12 @@ export default {
visitWay,
isHealthGuide,
screenTime,
residentInfoId: this.form.residentInfoId,
urgentInsContent: content,
residentsRecord: {...others},
residentsRecord: {
...others,
id: this.form.personId,
},
}
resolve(
fetchDataHandle(par, {
......
......@@ -64,7 +64,7 @@
<div>
<doc-icon type='doc-remove' class='remove' @click='delImg(item.indexF)'></doc-icon>
</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)'>
</div>
</div>
......@@ -112,7 +112,7 @@
<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;'
<img :src='item.trueDownloadUrl' class='ml-2' style='width: 95px;height: 95px;'
@click='toPreview(index)'>
</div>
</div>
......@@ -187,9 +187,6 @@ export default {
imgList: [],
imgList2: [],
showDate: false,
showOne: false,
showTwo: false,
showThree: false,
rules: {
nextVisitDate: [{required: true,message: '请选择'}]
}
......@@ -199,6 +196,10 @@ export default {
'info': {
handler() {
this.form = this.setForm(this.info)
if (this.info.id) {
this.imgList = this.info.uploadVisitRecordImageList || []
this.imgList2 = this.info.sceneVisitImageList || []
}
},
immediate: true
},
......@@ -291,7 +292,7 @@ export default {
let maxIndexF = Math.max(...this.imgList.map(item => item.indexF));
newFile.forEach((item, index) => {
item['indexF'] = maxIndexF+ index + 1
item['src'] = window.URL.createObjectURL(item)
item['trueDownloadUrl'] = window.URL.createObjectURL(item)
item['imgFlag'] = ''
if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf'
......@@ -309,7 +310,7 @@ export default {
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['trueDownloadUrl'] = window.URL.createObjectURL(item)
item['imgFlag'] = ''
if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf'
......@@ -324,7 +325,7 @@ export default {
toPreview(index) {
// let list = []
// this.imgList.forEach(item => {
// list.push(item.src)
// list.push(item.trueDownloadUrl)
// })
// showImagePreview({
// images: list,
......@@ -335,7 +336,7 @@ export default {
},
//pdf预览
toPdf(item) {
// window.open(item.src)
// window.open(item.trueDownloadUrl)
},
delImg(index) {
this.imgList = this.imgList.filter(item => item.indexF != index)
......@@ -351,9 +352,10 @@ export default {
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
let par = {
img1: this.imgList,
img2: this.imgList2,
img1: this.imgList || [],
img2: this.imgList2 || [],
...this.form,
healthGuideContent: JSON.stringify(this.form.visitHealthGuideList)
}
resolve(par)
}).catch((e) => {
......
......@@ -4,7 +4,8 @@
<div class='p-4 h-overflow'>
<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>
<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'>
......@@ -37,7 +38,13 @@
<script>
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 CommonBottom from '@/doctor/followUp/generalFU/form/CommonBottom'
......@@ -51,7 +58,7 @@ export default {
visitSituation: 1,
step: 1,
//第一步提交的表单
firstForm: {},
firstForm: {}
}
},
created() {
......@@ -66,8 +73,20 @@ export default {
async init() {
this.info = {}
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 = {
personId: id,
...others
}
this.info.diseaseType = this.routerDetail.diseaseType
......@@ -91,10 +110,56 @@ export default {
changeVisitSituation(val) {
this.visitSituation = val
},
//图片上传
async upload(imgList = []) {
let list = []
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() {
if (this.visitSituation == 1) {
......
......@@ -30,11 +30,11 @@ module.exports = defineConfig({
}
},
'/chronic-admin': {
target: 'https://beta-tumour.zmnyjk.com',
// target: 'http://192.168.1.26:8900',
// target: 'https://beta-tumour.zmnyjk.com',
target: 'http://192.168.1.26:8900',
changOrigin: true,
pathRewrite: {
'^/chronic-admin': '/chronic-admin'
'^/chronic-admin': '/'
}
},
'/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