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'
...@@ -33,4 +34,19 @@ export function getResidentInfo(idCard) { ...@@ -33,4 +34,19 @@ export function getResidentInfo(idCard) {
// 居民idCard或者tel查询居民信息 // 居民idCard或者tel查询居民信息
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
<div class='push-lab'>随访信息将通过小程序消息推送给居民</div> v-model='form.isSmsIsWxStr'
<checkBtn class='mt-3' column-1 :options='messageList' v-model:value='checkMessage' :fieldNames="{text: 'name', value: 'value'}"></checkBtn> style='padding: 0px'
<div class='push-lab'>随访信息将通过短信方式发送给居民</div> :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>
<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>
</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)
}) })
}) })
} }
......
...@@ -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