Commit 486a011c authored by gengchunlei's avatar gengchunlei

居民端小程序 v1.2 医生端图片组件调整以及随访表单微信小程序绑定电话获取

parent 267448ad
...@@ -6,6 +6,7 @@ export function getDict() { ...@@ -6,6 +6,7 @@ export function getDict() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict`, loading: true }) return fetchBase({ url: `/tumour-admin/v1/h5-app/dict`, loading: true })
} }
// 区划编码查询下级 // 区划编码查询下级
export function getAreaChild(parentCode, loading = true) { export function getAreaChild(parentCode, loading = true) {
const key = 'chronic-area-cache' const key = 'chronic-area-cache'
...@@ -34,3 +35,18 @@ export function getResidentInfo(idCard) { ...@@ -34,3 +35,18 @@ export function getResidentInfo(idCard) {
export function getResidentByInfo(params) { export function getResidentByInfo(params) {
return fetchBase({ url: `/chronic-resident/v1/chronic-residents-record/query-resident-info-by-id-card`, body: params, loading: true }) return fetchBase({ url: `/chronic-resident/v1/chronic-residents-record/query-resident-info-by-id-card`, body: params, loading: true })
} }
// 文件上传
export function fileUpload(params) {
return fetchBase({ url: `/chronic-admin/v1/pictures-info/qiniu`, body: params, contentType: 'file' })
}
// 获取模板管理数据
export function getTemplateList() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict`, loading: true })
}
//模板数据主键查询
export function getTemplateById() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict`, loading: true })
}
\ No newline at end of file
...@@ -13,6 +13,10 @@ export function getChronicResidentsId(residentInfoId) { ...@@ -13,6 +13,10 @@ export function getChronicResidentsId(residentInfoId) {
loading: true loading: true
}) })
} }
//获取居民是否存在微信电话
export function getResidentWX(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-residents-record/query-resident-is-wx`, body: params, loading: true})
}
// 主键查询 // 主键查询
export function fetchCurrencyById(params) { export function fetchCurrencyById(params) {
......
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
if (!token) { if (!token) {
token = sessionStorage.getItem('token') token = sessionStorage.getItem('token')
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
token = 'c05b4361-deec-4a64-92d5-b6f4b54ec89b' token = 'e85be59c-b842-4e7a-b8eb-b9be87df2b56'
} }
} }
if (token) { if (token) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div v-if="isPdf" class="p-2 flex items-center view-pdf"> <div v-if="isPdf" class="p-2 flex items-center view-pdf">
<doc-icon type="doc-PDF" style="font-size: .48rem" class="shrink-0"/> <doc-icon type="doc-PDF" style="font-size: .48rem" class="shrink-0"/>
<span class="grow px-4 text-ellipsis">{{name}}</span> <span class="grow px-4 text-ellipsis">{{name}}</span>
<span class="close-btn" @click="removeBtn" v-if="remove"> <span class="close-btn" @click.stop="removeBtn" v-if="remove">
<doc-icon type="close-circle" /> <doc-icon type="close-circle" />
</span> </span>
</div> </div>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="doc-image-default">加载失败</div> <div class="doc-image-default">加载失败</div>
</slot> </slot>
</div> </div>
<span class="close-btn" @click="removeBtn" v-if="remove"> <span class="close-btn" @click.stop="removeBtn" v-if="remove">
<doc-icon type="close-circle" /> <doc-icon type="close-circle" />
</span> </span>
</template> </template>
...@@ -105,9 +105,11 @@ export default { ...@@ -105,9 +105,11 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 90px; min-height: 90px;
border: 1px dashed #d9d9d9;
background: #fafafa;
img { img {
width: 100%; width: 100%;
height: 100%; height: 90px;
object-fit: contain; object-fit: contain;
} }
} }
......
<template> <template>
<div class="doc-image-upload"> <div class='doc-image-upload'>
<div class="text-12 description">{{ description }}</div> <div class='text-12 description'>{{ description }}</div>
<div class="mt-2 py-3 text-center upload-btn" @click="fileSelect"> <div class='mt-2 py-3 text-center upload-btn' @click='fileSelect'>
<doc-icon type="doc-upload" class="mr-2 text-16"/> <doc-icon type='doc-upload' class='mr-2 text-16' />
<span>{{ btText }}</span> <span>{{ btText }}</span>
</div> </div>
<div class="flex flex-wrap mt-4 image-box"> <div class='flex flex-wrap mt-4 image-box'>
<div v-for="item in innerImage.filter(e => e.fileType != 'pdf')" :key="item.id" <div v-for="item in innerImage.filter(e => e.fileType != 'pdf')" :key='item.id'
class="item-img"> class='item-img' @click.stop='toPreview(item)'>
<DocImage :src="item.url" remove/> <DocImage :src='item.trueDownloadUrl' remove @onRemove='removeImage(item)' />
</div> </div>
<div v-for="item in innerImage.filter(e => e.fileType == 'pdf')" :key="item.id" <div v-for="item in innerImage.filter(e => e.fileType == 'pdf')" :key='item.id'
class="item-pdf"> class='item-pdf'>
<DocImage isPdf :src="item.url" name="pdf文件名称" remove/> <DocImage isPdf :src='item.trueDownloadUrl' name='pdf文件名称' remove @onRemove='removeImage(item)' />
</div> </div>
</div> </div>
<input type="file" <input type='file'
accept=".jpg,.jpeg,.png,.pdf" accept='.jpg,.jpeg,.png,.pdf'
ref="fileElem" ref='fileElem'
style="display: none;" style='display: none;'
@change="handleFiles" @change='handleFiles'
:key="inputKey"> :key='inputKey'>
<van-overlay :show='imgShow' @click='imgShow = false'>
<div class='wrapper'>
<van-swipe class='block' :initial-swipe='initSwipe'>
<van-swipe-item v-for="image in innerImage.filter(e => e.fileType != 'pdf')" :key='image'>
<img :src='image.trueDownloadUrl' style='width: 100%;height: 100%' />
</van-swipe-item>
</van-swipe>
</div>
</van-overlay>
</div> </div>
</template> </template>
<script> <script>
import DocImage from './DocImage.vue' import DocImage from './DocImage.vue'
import { showToast } from 'vant' import { showToast } from 'vant'
import { fileUpload } from '@/api/base'
const testUrl = 'https://beta-tumour.zmnyjk.com/chronic-admin/file-proxy/chronic/20241125/1732502450600434289.png?e=1732610606&token=yrkyCAltqk1WVrw1ZNWUl5F5gLxE0O8LJ0Vq4hzi:RYbssXLQIEX6KTcVk5u4tWaxb9o=' const testUrl = 'https://beta-tumour.zmnyjk.com/chronic-admin/file-proxy/chronic/20241125/1732502450600434289.png?e=1732610606&token=yrkyCAltqk1WVrw1ZNWUl5F5gLxE0O8LJ0Vq4hzi:RYbssXLQIEX6KTcVk5u4tWaxb9o='
export default { export default {
name: 'DocImageUpload', name: 'DocImageUpload',
components:{ components: {
DocImage DocImage
}, },
props: { props: {
...@@ -56,7 +67,10 @@ export default { ...@@ -56,7 +67,10 @@ export default {
spinning: false, spinning: false,
inputKey: '1', inputKey: '1',
// viewer显示 // viewer显示
visible: false visible: false,
//显示图片所在位置
initSwipe: 0,
imgShow: false
} }
}, },
computed: { computed: {
...@@ -67,16 +81,16 @@ export default { ...@@ -67,16 +81,16 @@ export default {
return this.innerImage.map(e => e.id).join(',') return this.innerImage.map(e => e.id).join(',')
} }
}, },
methods:{ methods: {
init() { init() {
if (this.imageData?.length) { if (this.imageData?.length) {
this.innerImage = [...this.imageData] this.innerImage = [...this.imageData]
} else { } else {
this.innerImage = [ this.innerImage = [
{ fileType: 'pdf', id: 1, url: testUrl }, { fileType: 'pdf', id: 1, trueDownloadUrl: testUrl },
{ fileType: 'png', id: 2, url: testUrl }, { fileType: 'png', id: 2, trueDownloadUrl: testUrl },
{ fileType: 'png', id: 3, url: testUrl }, { fileType: 'png', id: 3, trueDownloadUrl: testUrl },
{ fileType: 'png', id: 4, url: testUrl }, { fileType: 'png', id: 4, trueDownloadUrl: testUrl }
] ]
} }
}, },
...@@ -102,7 +116,6 @@ export default { ...@@ -102,7 +116,6 @@ export default {
this.addImage(result) this.addImage(result)
this.inputKey = Math.random().toString(16).substring(2, 6) this.inputKey = Math.random().toString(16).substring(2, 6)
this.$emit('change', this.ids, this.innerImage) this.$emit('change', this.ids, this.innerImage)
this.formItemContext.onFieldChange()
}).finally(() => { }).finally(() => {
this.spinning = false this.spinning = false
}) })
...@@ -133,6 +146,13 @@ export default { ...@@ -133,6 +146,13 @@ export default {
if (!item) return if (!item) return
this.innerImage = this.innerImage.filter(e => e.id != item.id) this.innerImage = this.innerImage.filter(e => e.id != item.id)
this.$emit('change', this.ids, this.innerImage) this.$emit('change', this.ids, this.innerImage)
},
//图片预览
toPreview(val) {
let res = this.innerImage.filter(e => e.fileType != 'pdf')
let index = res.findIndex(e => val.id == e.id)
this.initSwipe = index
this.imgShow = true
} }
}, },
watch: { watch: {
...@@ -146,32 +166,49 @@ export default { ...@@ -146,32 +166,49 @@ export default {
} }
</script> </script>
<style lang="less" scoped> <style lang='less' scoped>
.description { .description {
color: #A5AEBE; color: #A5AEBE;
} }
.upload-btn { .upload-btn {
color: var(--van-primary-color); color: var(--van-primary-color);
border: 1px solid #eee; border: 1px solid #eee;
background-color: #FAFAFA; background-color: #FAFAFA;
border-radius: 8px; border-radius: 8px;
} }
.image-box { .image-box {
row-gap: 8px; row-gap: 8px;
column-gap: 12px; column-gap: 12px;
.item-img { .item-img {
width: calc(33.3vw - 8px); width: calc(33.3% - 8px);
} }
.item-pdf { .item-pdf {
width: 100%; width: 100%;
} }
>div {
width: calc(33.3vw - 8px); > div {
width: calc(33.3% - 8px);
position: relative; position: relative;
border-radius: 2px; border-radius: 2px;
img { img {
object-fit: contain; object-fit: contain;
} }
} }
} }
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.block {
width: 100%;
}
}
</style> </style>
...@@ -315,6 +315,7 @@ const defaultForm = (info = {}) => { ...@@ -315,6 +315,7 @@ const defaultForm = (info = {}) => {
//随访类型 //随访类型
visitWayRules: undefined, visitWayRules: undefined,
visitWayRulesName: undefined, visitWayRulesName: undefined,
sendNumber: undefined,
} }
Reflect.ownKeys(form).forEach(key => { Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) { if (info[key] != undefined) {
...@@ -528,11 +529,13 @@ export default { ...@@ -528,11 +529,13 @@ export default {
personId, personId,
visitWay, visitWay,
visitWayRules, visitWayRules,
sendNumber,
...others ...others
} = this.form } = this.form
let par = { let par = {
visitWay, visitWay,
visitWayRules, visitWayRules,
sendNumber,
residentInfoId: this.form.residentInfoId, residentInfoId: this.form.residentInfoId,
residentsRecord: { residentsRecord: {
...others, ...others,
...@@ -541,7 +544,7 @@ export default { ...@@ -541,7 +544,7 @@ export default {
} }
resolve(par) resolve(par)
}).catch((e) => { }).catch((e) => {
console.warn('ArchiveCommon error', e) console.warn('baseInfo error', e)
}) })
}) })
} }
......
...@@ -2,10 +2,32 @@ ...@@ -2,10 +2,32 @@
<div> <div>
<van-form ref='form'> <van-form ref='form'>
<div class='label-title' v-if='showPush'>请选择推送渠道</div> <div class='label-title' v-if='showPush'>请选择推送渠道</div>
<checkBtn class='mt-3' column-1 :options='vxList' v-model:value='checkVx' :fieldNames="{text: 'name', value: 'value'}"></checkBtn> <van-field
v-model='form.isSmsIsWxStr'
style='padding: 0px'
:rules='rules.isSmsIsWxStr'
>
<template #input>
<div class='w-full'>
<checkBtn class='mt-3'
column-1
text-align='left'
:options='vxList'
v-model:value='checkVx'
:fieldNames="{text: 'name', value: 'value'}"
></checkBtn>
<div class='push-lab'>随访信息将通过小程序消息推送给居民</div> <div class='push-lab'>随访信息将通过小程序消息推送给居民</div>
<checkBtn class='mt-3' column-1 :options='messageList' v-model:value='checkMessage' :fieldNames="{text: 'name', value: 'value'}"></checkBtn> <checkBtn class='mt-3'
column-1
text-align='left'
:options='messageList'
v-model:value='checkMessage'
:fieldNames="{text: 'name', value: 'value'}"
></checkBtn>
<div class='push-lab'>随访信息将通过短信方式发送给居民</div> <div class='push-lab'>随访信息将通过短信方式发送给居民</div>
</div>
</template>
</van-field>
<div :class="['label-title', {'mt-5': showPush}]">随访单位</div> <div :class="['label-title', {'mt-5': showPush}]">随访单位</div>
<van-field <van-field
...@@ -14,6 +36,7 @@ ...@@ -14,6 +36,7 @@
readonly readonly
placeholder='随访单位' placeholder='随访单位'
class='input-back mt-2 form-input' class='input-back mt-2 form-input'
:rules='rules.visitUnitName'
@click='show1 = true' @click='show1 = true'
/> />
<DocUnit v-model:show='show1' v-model:value='form.visitUnitId' @change='changeUnit' /> <DocUnit v-model:show='show1' v-model:value='form.visitUnitId' @change='changeUnit' />
...@@ -25,6 +48,7 @@ ...@@ -25,6 +48,7 @@
readonly readonly
placeholder='随访科室' placeholder='随访科室'
class='input-back mt-2 form-input' class='input-back mt-2 form-input'
:rules='rules.visitOfficeName'
@click='show2 = true' @click='show2 = true'
/> />
<DocOffice v-model:show='show2' v-model:value='form.visitOfficeId' @change='changeOffice' <DocOffice v-model:show='show2' v-model:value='form.visitOfficeId' @change='changeOffice'
...@@ -37,6 +61,7 @@ ...@@ -37,6 +61,7 @@
readonly readonly
placeholder='随访医生' placeholder='随访医生'
class='input-back mt-2 form-input' class='input-back mt-2 form-input'
:rules='rules.visitDoctorName'
@click='show3 = true' @click='show3 = true'
/> />
...@@ -85,8 +110,15 @@ export default { ...@@ -85,8 +110,15 @@ export default {
checkVx: undefined, checkVx: undefined,
messageList: [], messageList: [],
checkMessage: undefined, checkMessage: undefined,
form: {}, form: {
rules: {} isSmsIsWx: []
},
rules: {
isSmsIsWxStr: [{ required: true, message: '请选择' }],
visitUnitName: [{ required: true, message: '请选择' }],
visitOfficeName: [{ required: true, message: '请选择' }],
visitDoctorName: [{ required: true, message: '请选择' }],
}
} }
}, },
watch: { watch: {
...@@ -95,7 +127,47 @@ export default { ...@@ -95,7 +127,47 @@ export default {
this.form = this.setForm(this.info) this.form = this.setForm(this.info)
}, },
immediate: true immediate: true
},
'firstForm.residentsRecord': {
handler() {
this.vxList = this.getVxEnum(this.firstForm)
this.messageList = this.getMessageEnum(this.firstForm.residentsRecord)
},
immediate: true,
deep:true
},
'checkMessage': {
handler() {
this.form.isSms = 2
if (this.checkMessage) {
this.form.isSms = 1
this.form.isSmsIsWx.push(1)
this.form.isSmsIsWxStr = 1
} else {
this.form.isSmsIsWx = this.form.isSmsIsWx.filter(item => item !=1)
//判断推送渠道是否存在值
if (!this.checkVx) {
this.form.isSmsIsWxStr = ''
} }
}
}
},
'checkVx': {
handler() {
this.form.isWx = 2
if (this.checkVx) {
this.form.isWx = 1
this.form.isSmsIsWx.push(2)
this.form.isSmsIsWxStr = 2
} else {
this.form.isSmsIsWx = this.form.isSmsIsWx.filter(item => item !=2)
//判断推送渠道是否存在值
if (!this.checkMessage) {
this.form.isSmsIsWxStr = ''
}
}
}
},
}, },
computed: { computed: {
authInfo() { authInfo() {
...@@ -114,17 +186,13 @@ export default { ...@@ -114,17 +186,13 @@ export default {
return res return res
} }
}, },
mounted() {
this.vxList = this.getVxEnum(this.firstForm.residentsRecord)
this.messageList = this.getMessageEnum(this.firstForm.residentsRecord)
},
methods: { methods: {
//微信 //微信
getVxEnum(patientInfo = {}) { getVxEnum(patientInfo = {}) {
return [{ name: `微信 ${patientInfo.weixinTel ? `(${this.$phoneHide(patientInfo.weixinTel)}已注册小程序)` : `(未注册小程序)`}`, value:1 }] return [{ name: `微信 ${patientInfo.sendNumber ? `(${this.$phoneHide(patientInfo.sendNumber)}已注册小程序)` : `(未注册小程序)`}`, value:2 }]
}, },
getMessageEnum(patientInfo = {}) { getMessageEnum(patientInfo = {}) {
return [{ name: `短信 ${patientInfo.telephone ? `(手机号 ${this.$phoneHide(patientInfo.telephone)})` : `(手机号 不存在)`}`, value: 2 }] return [{ name: `短信 ${patientInfo.telephone ? `(手机号 ${this.$phoneHide(patientInfo.telephone)})` : `(手机号 不存在)`}`, value: 1 }]
}, },
setForm(info) { setForm(info) {
const form = { const form = {
...@@ -147,7 +215,10 @@ export default { ...@@ -147,7 +215,10 @@ export default {
createOfficeName: this.authInfo.officeName, createOfficeName: this.authInfo.officeName,
// 录入医生 // 录入医生
createDoctorId: this.authInfo.relationId, createDoctorId: this.authInfo.relationId,
createDoctorName: this.authInfo.nickName createDoctorName: this.authInfo.nickName,
isSms: 2,
isWx: 2,
isSmsIsWx: [],
} }
Reflect.ownKeys(form).forEach(key => { Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) { if (info[key] != undefined) {
...@@ -186,7 +257,6 @@ export default { ...@@ -186,7 +257,6 @@ export default {
resolve(par) resolve(par)
}).catch((e) => { }).catch((e) => {
console.warn('ArchiveCommon error', e) console.warn('ArchiveCommon error', e)
reject(e)
}) })
}) })
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<van-form ref='form'> <van-form ref='form'>
<div class='title'>随访信息</div> <div class='title'>随访信息</div>
<div v-if='showOne'> <div v-if='showOne'>
<div class='no-req-label'>随访内容</div> <div class='label-title'>随访内容</div>
<van-field <van-field
v-model='form.visitContent' v-model='form.visitContent'
placeholder='随访内容' placeholder='随访内容'
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
rows='2' rows='2'
autosize autosize
type='textarea' type='textarea'
:rules='rules.visitContent'
/> />
</div> </div>
<div v-if='showOne'> <div v-if='showOne'>
...@@ -64,117 +65,31 @@ ...@@ -64,117 +65,31 @@
</div> </div>
<!-- 上传随访照片-->
<div v-if='showOne'> <div v-if='showOne'>
<div class='no-req-label mt-5'>上传随访记录</div> <div class='no-req-label mt-5'>上传随访记录</div>
<div class='tips'> <DocImageUpload
支持上传jpg、png、jpeg文件,大小请在10M以内 description="支持上传jpg、png、jpeg文件,大小请在10M以内"
</div> lengthMessage="抱歉,最多可上传6个文件。"
<div class='img-btn mt-2' @click="toUpload('imgId')"> :imageData="[]"
<input type='file' id='imgId' multiple @change='choiceImg' style='display: none' @change="(ids, option) => form.uploadVisitRecord = ids"
:key='new Date().getTime()' accept='image/*,.pdf'> :maxLength="6"
<div class='flex items-center justify-center'> class="mt-2"
<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 imgList'>
<!-- 图片-->
<div v-if="item.imgFlag == 'img'" class='mt-2' style='position: relative'>
<div>
<doc-icon type='doc-remove' class='remove' @click='delImg(item.indexF)'></doc-icon>
</div>
<img :src='item.trueDownloadUrl' class='ml-2' style='width: 95px;height: 95px;'
@click='toPreview(imgList,index)'>
</div>
</div>
</div>
<!-- pdf-->
<div>
<div v-for='item in imgList'>
<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='delImg(item.indexF)'></doc-icon></span>
</div>
</div>
</div>
</div>
</div>
<div v-if='imgList.length > 6' class='warn mt-2'>最多允许上传6张!</div>
</div> </div>
<!-- 现场随访照片-->
<div> <div>
<div class='no-req-label mt-5'>现场随访照片</div> <div class='no-req-label mt-5'>现场随访照片</div>
<div class='tips'> <DocImageUpload
支持上传jpg、png、jpeg文件,大小请在10M以内 description="支持上传jpg、png、jpeg文件,大小请在10M以内"
</div> lengthMessage="抱歉,最多可上传6个文件。"
<div class='img-btn mt-2' @click="toUpload('imgId2')"> :imageData="[]"
<input type='file' id='imgId2' multiple @change='choiceImg2' style='display: none' @change="(ids, option) => form.sceneVisitImage = ids"
:key='new Date().getTime()-10000' accept='image/*,.pdf'> :maxLength="6"
<div class='flex items-center justify-center'> class="mt-2"
<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.trueDownloadUrl' class='ml-2' style='width: 95px;height: 95px;'
@click='toPreview(imgList2 ,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 v-if='imgList2.length > 8' class='warn mt-2'>最多允许上传8张!</div>
</div> </div>
<!-- 图片预览-->
<van-overlay :show='imgShow' @click='imgShow = false'>
<div class='wrapper'>
<van-swipe class='block' :initial-swipe='initSwipe'>
<van-swipe-item v-for='image in showImgList' :key='image'>
<img :src='image' style='width: 100%;height: 100%' />
</van-swipe-item>
</van-swipe>
</div>
</van-overlay>
<div> <div>
<div class='label-title mt-5'>下次随访日期</div> <div class='label-title mt-5'>下次随访日期</div>
...@@ -204,10 +119,11 @@ import dayjs from 'dayjs' ...@@ -204,10 +119,11 @@ import dayjs from 'dayjs'
import DocIcon from '@/components/docIcon/DocIcon' import DocIcon from '@/components/docIcon/DocIcon'
import { showToast } from 'vant' import { showToast } from 'vant'
import { fetchDataHandle } from '@/utils/common' import { fetchDataHandle } from '@/utils/common'
import DocImageUpload from '@/doctor/components/docImageUpload/DocImageUpload'
export default { export default {
name: 'GeneralFUForm', name: 'GeneralFUForm',
components: { DocIcon }, components: { DocImageUpload, DocIcon },
props: { props: {
info: { info: {
default: () => { default: () => {
...@@ -236,12 +152,12 @@ export default { ...@@ -236,12 +152,12 @@ export default {
imgInputList1: [], imgInputList1: [],
imgInputList2: [], imgInputList2: [],
showDate: false, showDate: false,
imgShow: false,
showTime1: false, showTime1: false,
currentTime1: null, currentTime1: null,
showImgList: [], showImgList: [],
initSwipe: 0, initSwipe: 0,
rules: { rules: {
visitContent: [{ required: true, message: '请输入' }],
nextVisitDate: [{ required: true, message: '请选择' }] nextVisitDate: [{ required: true, message: '请选择' }]
}, },
// 筛查日期可选范围 // 筛查日期可选范围
...@@ -255,10 +171,6 @@ export default { ...@@ -255,10 +171,6 @@ 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.imgListInfo1
this.imgList2 = this.imgListInfo2
}
}, },
immediate: true immediate: true
} }
...@@ -307,41 +219,12 @@ export default { ...@@ -307,41 +219,12 @@ export default {
} }
return res 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
}
}, },
created() { created() {
const date = dayjs() const date = dayjs()
this.nextVisitDateRange.max = new Date(date.year() + 10, date.month(), date.date()) this.nextVisitDateRange.max = new Date(date.year() + 10, date.month(), date.date())
this.nextVisitDateRange.min = new Date(date.year(), date.month(), date.date() + 1) this.nextVisitDateRange.min = new Date(date.year(), date.month(), date.date() + 1)
this.form._nextVisitDate = [date.year(), date.month(), date.date() + 1] this.form._nextVisitDate = [date.year(), date.month(), date.date() + 1]
this.form.nextVisitDate = new dayjs().add(1, 'day').format('YYYY-MM-DD')
let time = new dayjs().add(1, 'day').format('YYYY-MM-DD') let time = new dayjs().add(1, 'day').format('YYYY-MM-DD')
this.currentTime1 = time.split('-') this.currentTime1 = time.split('-')
}, },
...@@ -356,7 +239,7 @@ export default { ...@@ -356,7 +239,7 @@ export default {
id: info.id, id: info.id,
diseaseType: info.diseaseType, diseaseType: info.diseaseType,
visitDate: info.visitDate || new dayjs(), visitDate: info.visitDate || new dayjs(),
nextVisitDate: info.nextVisitDate, nextVisitDate: info.nextVisitDate || new dayjs().add(1, 'day').format('YYYY-MM-DD'),
isSms: info.isSms, isSms: info.isSms,
isWx: info.isWx, isWx: info.isWx,
screenTime: new dayjs().add(1, 'day').format('YYYY-MM-DD'), screenTime: new dayjs().add(1, 'day').format('YYYY-MM-DD'),
...@@ -378,96 +261,6 @@ export default { ...@@ -378,96 +261,6 @@ export default {
} }
return form return form
}, },
setTemForm(info) {
const modeArray = this.store.getDict('DC00084')
const visitHealthGuideList = info.contentList || []
const form = {
visitHealthGuideList: modeArray.map(e => {
const item = visitHealthGuideList.find(i => i.templateMode === e.value)
return {
templateMode: e.value,
name: e.name,
templateContent: item ? item.templateContent : '',
id: item ? item.visitId : ''
}
})
}
return form.visitHealthGuideList
},
toUpload(id) {
if (id === 'imgId' && this.imgList.length > 6) {
showToast('最多允许上传6张')
return
}
if (id === 'imgId2' && this.imgList2.length > 8) {
showToast('最多允许上传8张')
return
}
let input = document.getElementById(id)
input.click()
},
choiceImg() {
let input = document.getElementById('imgId')
let file = input.files
let newFile = Array.from(file)
let maxIndexF = this.imgList.length ? Math.max(...this.imgList.map(item => item.indexF)) : 0
newFile.forEach((item, index) => {
item['indexF'] = maxIndexF + index + 1
item['trueDownloadUrl'] = window.URL.createObjectURL(item)
item['imgFlag'] = ''
if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf'
}
if (item.type == 'image/jpeg' || item.type == 'image/png' || item.type == 'image/gif' || item.type == 'image/webp') {
item['imgFlag'] = 'img'
}
})
this.imgList = this.imgList.concat(newFile)
this.imgInputList1 = this.imgInputList1.concat(newFile)
},
choiceImg2() {
let input = document.getElementById('imgId2')
let file = input.files
let newFile = Array.from(file)
let maxIndexF = this.imgList2.length ? Math.max(...this.imgList2.map(item => item.indexF)) : 0
newFile.forEach((item, index) => {
item['indexF'] = maxIndexF + index + 1
item['trueDownloadUrl'] = window.URL.createObjectURL(item)
item['imgFlag'] = ''
if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf'
}
if (item.type == 'image/jpeg' || item.type == 'image/png' || item.type == 'image/gif' || item.type == 'image/webp') {
item['imgFlag'] = 'img'
}
})
this.imgList2 = this.imgList2.concat(newFile)
console.log(this.imgList2)
this.imgInputList2 = this.imgInputList2.concat(newFile)
},
//图片预览
toPreview(list = [], index) {
let res = []
this.showImgList = []
list.forEach(item => {
res.push(item.trueDownloadUrl)
})
this.showImgList = res
this.initSwipe = index
this.imgShow = true
},
//pdf预览
toPdf(item) {
// window.open(item.trueDownloadUrl)
},
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 }) { dataConfirm({ selectedValues }) {
this.form.nextVisitDate = selectedValues.join('-') this.form.nextVisitDate = selectedValues.join('-')
this.showDate = false this.showDate = false
...@@ -496,7 +289,7 @@ export default { ...@@ -496,7 +289,7 @@ export default {
} }
resolve(par) resolve(par)
}).catch((e) => { }).catch((e) => {
console.warn('ArchiveCommon error', e) console.warn('generaFu error', e)
// reject(e) // reject(e)
}) })
}) })
......
...@@ -51,7 +51,7 @@ import BaseInfo from '@/doctor/followUp/generalFU/form/BaseInfo' ...@@ -51,7 +51,7 @@ import BaseInfo from '@/doctor/followUp/generalFU/form/BaseInfo'
import { import {
addCurrency, addCurrency,
fetchCurrencyById, fetchCurrencyById,
getChronicResidentsId, getChronicResidentsId, getResidentWX,
updateCurrency, updateCurrency,
upLoadMultifile upLoadMultifile
} from '@/api/doctor/generalFU' } from '@/api/doctor/generalFU'
...@@ -163,6 +163,7 @@ export default { ...@@ -163,6 +163,7 @@ export default {
} }
} else { } else {
const res = await getChronicResidentsId(this.routerDetail.residentInfoId) const res = await getChronicResidentsId(this.routerDetail.residentInfoId)
const weixinInfo = await getResidentWX({residentInfoId: this.routerDetail.residentInfoId})
const { const {
id, id,
createDate, createDate,
...@@ -177,7 +178,8 @@ export default { ...@@ -177,7 +178,8 @@ export default {
} = res.data } = res.data
this.info = { this.info = {
personId: id, personId: id,
...others ...others,
sendNumber: weixinInfo?.data?.telephone
} }
this.info.diseaseType = this.routerDetail.diseaseType this.info.diseaseType = this.routerDetail.diseaseType
} }
......
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