Commit 85bdb57c authored by gengchunlei's avatar gengchunlei

居民端小程序 v1.2 医生端选择推送渠道

parent 9346eac3
...@@ -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 = '8f7ab9cb-868b-4fa4-b64a-4a1a11521706' token = 'c05b4361-deec-4a64-92d5-b6f4b54ec89b'
} }
} }
if (token) { if (token) {
......
...@@ -101,6 +101,7 @@ export default { ...@@ -101,6 +101,7 @@ export default {
border: 1px solid transparent; border: 1px solid transparent;
background-color: #FAFAFA; background-color: #FAFAFA;
border-radius: 8px; border-radius: 8px;
text-align: center;
transition: all .2s; transition: all .2s;
} }
.check-btn-item-active { .check-btn-item-active {
...@@ -121,7 +122,6 @@ export default { ...@@ -121,7 +122,6 @@ export default {
border-radius: 30px; border-radius: 30px;
padding-top: 4px; padding-top: 4px;
padding-bottom: 4px; padding-bottom: 4px;
text-align: center;
color: #595959; color: #595959;
} }
.check-btn-item-active { .check-btn-item-active {
......
<template> <template>
<div> <div>
<van-form ref='form'> <van-form ref='form'>
<div class='no-req-label'>随访单位</div> <div class='label-title' v-if='showPush'>请选择推送渠道</div>
<van-field <checkBtn column-1 :options='vxList' v-model:value='checkVx' :fieldNames="{text: 'name', value: 'value'}"></checkBtn>
v-model='form.visitUnitName' <div class='push-lab'>随访信息将通过小程序消息推送给居民</div>
is-link <checkBtn column-1 :options='messageList' v-model:value='checkMessage' :fieldNames="{text: 'name', value: 'value'}"></checkBtn>
readonly <div class='push-lab'>随访信息将通过短信方式发送给居民</div>
placeholder='随访单位'
class='input-back mt-2 form-input' <div :class="['label-title', {'mt-5': showPush}]">随访单位</div>
@click="show1 = true" <van-field
/> v-model='form.visitUnitName'
<DocUnit v-model:show="show1" v-model:value="form.visitUnitId" @change="changeUnit"/> is-link
readonly
<div class='no-req-label mt-5'>随访科室</div> placeholder='随访单位'
<van-field class='input-back mt-2 form-input'
v-model='form.visitOfficeName' @click='show1 = true'
is-link />
readonly <DocUnit v-model:show='show1' v-model:value='form.visitUnitId' @change='changeUnit' />
placeholder='随访科室'
class='input-back mt-2 form-input' <div class='label-title mt-5'>随访科室</div>
@click='show2 = true' <van-field
/> v-model='form.visitOfficeName'
<DocOffice v-model:show="show2" v-model:value="form.visitOfficeId" @change="changeOffice" :unitId="form.visitUnitId"/> is-link
readonly
<div class='no-req-label mt-5'>随访医生</div> placeholder='随访科室'
<van-field class='input-back mt-2 form-input'
v-model='form.visitDoctorName' @click='show2 = true'
is-link />
readonly <DocOffice v-model:show='show2' v-model:value='form.visitOfficeId' @change='changeOffice'
placeholder='随访医生' :unitId='form.visitUnitId' />
class='input-back mt-2 form-input'
@click='show3 = true' <div class='label-title mt-5'>随访医生</div>
/> <van-field
v-model='form.visitDoctorName'
<DocOfficeDoctor v-model:show="show3" v-model:value="form.visitDoctorId" @change="changeDoctor" :unitId="form.visitUnitId" :officeId="form.visitOfficeId"/> is-link
readonly
placeholder='随访医生'
class='input-back mt-2 form-input'
@click='show3 = true'
/>
<DocOfficeDoctor v-model:show='show3' v-model:value='form.visitDoctorId' @change='changeDoctor'
:unitId='form.visitUnitId' :officeId='form.visitOfficeId' />
</van-form> </van-form>
</div> </div>
</template> </template>
...@@ -44,15 +52,27 @@ import { useStore } from '@/doctor/store' ...@@ -44,15 +52,27 @@ import { useStore } from '@/doctor/store'
import DocUnit from '@/doctor/components/docUnit/DocUnit' import DocUnit from '@/doctor/components/docUnit/DocUnit'
import DocOffice from '@/doctor/components/docOffice/DocOffice' import DocOffice from '@/doctor/components/docOffice/DocOffice'
import DocOfficeDoctor from '@/doctor/components/docOfficeDoctor/DocOfficeDoctor' import DocOfficeDoctor from '@/doctor/components/docOfficeDoctor/DocOfficeDoctor'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn'
export default { export default {
name: 'CommonBottom', name: 'CommonBottom',
components: { DocOfficeDoctor, DocOffice, DocUnit }, components: { CheckBtn, DocOfficeDoctor, DocOffice, DocUnit },
props: { props: {
info: { info: {
default: () => { default: () => {
return {} return {}
} }
},
firstForm: {
default: () => {
return {}
}
},
modeEnumList: {
default: () => {
return {}
}
} }
}, },
data() { data() {
...@@ -61,6 +81,10 @@ export default { ...@@ -61,6 +81,10 @@ export default {
show1: false, show1: false,
show2: false, show2: false,
show3: false, show3: false,
vxList:[],
checkVx: undefined,
messageList: [],
checkMessage: undefined,
form: {}, form: {},
rules: {} rules: {}
} }
...@@ -76,9 +100,32 @@ export default { ...@@ -76,9 +100,32 @@ export default {
computed: { computed: {
authInfo() { authInfo() {
return this.store.$state.authInfo return this.store.$state.authInfo
},
//是否显示推送渠道
showPush() {
let res = false
let list = []
if (this.firstForm.visitWayRules) {
list = this.firstForm.visitWayRules.split(',').map(item => Number(item))
}
if (list && list.length && (list.includes(2) || list.includes(3) || list.includes(4))) {
res = true
}
return res
} }
}, },
mounted() {
this.vxList = this.getVxEnum(this.firstForm.residentsRecord)
this.messageList = this.getMessageEnum(this.firstForm.residentsRecord)
},
methods: { methods: {
//微信
getVxEnum(patientInfo = {}) {
return [{ name: `${patientInfo.weixinTel ? `(${this.$phoneHide(patientInfo.weixinTel)}已注册小程序)` : `(未注册小程序)`}`, value:1 }]
},
getMessageEnum(patientInfo = {}) {
return [{ name: `${patientInfo.telephone ? `(手机号 ${this.$phoneHide(patientInfo.telephone)})` : `(手机号 不存在)`}`, value: 2 }]
},
setForm(info) { setForm(info) {
const form = { const form = {
visitDate: new dayjs(), visitDate: new dayjs(),
...@@ -134,7 +181,7 @@ export default { ...@@ -134,7 +181,7 @@ 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 = {
...this.form, ...this.form
} }
resolve(par) resolve(par)
}).catch((e) => { }).catch((e) => {
...@@ -166,6 +213,12 @@ export default { ...@@ -166,6 +213,12 @@ export default {
} }
} }
.push-lab {
line-height: 20px;
color: #8C8C8C;
font-size: 12px
}
.no-req-label { .no-req-label {
font-size: 13px; font-size: 13px;
color: #595959; color: #595959;
......
<template> <template>
<div> <div>
<van-nav-bar :title="routerDetail.id ? '修改通用随访': '新增通用随访'" 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'> <div class='p-4 h-overflow'>
<base-info :info='info' <base-info :info='info'
:modeEnumList="modeEnumList" :modeEnumList='modeEnumList'
v-show='step == 1' v-show='step == 1'
ref='baseInfo' ref='baseInfo'
@changeVisitSituation='changeVisitSituation'
></base-info> ></base-info>
<general-f-u-form :info='info' <general-f-u-form :info='info'
:first-form='firstForm' :first-form='firstForm'
:modeEnumList='modeEnumList'
v-show='step == 2' v-show='step == 2'
ref='generalFUForm' ref='generalFUForm'
></general-f-u-form> ></general-f-u-form>
<common-bottom :info='info' <common-bottom :info='info'
:first-form='firstForm'
:modeEnumList='modeEnumList'
v-show='step == 3' v-show='step == 3'
ref='commonBottom' ref='commonBottom'
></common-bottom> ></common-bottom>
</div> </div>
<div class='pt-2 pb-2'> <div class='pt-2 pb-2'>
<div class='px-5 grow flex flex-col justify-end' v-if='step == 1'> <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
@click='toNext(2)'>下一步 @click='toNext(2)'>下一步
</van-button> </van-button>
<van-button type='primary' block round v-if='visitSituation == 2'
@click='toNext(3)'>下一步
</van-button>
</div> </div>
<div class='px-5 flex align-center justify-around' v-if='step == 2'> <div class='px-5 flex align-center justify-around' v-if='step == 2'>
...@@ -63,65 +63,66 @@ const getModeEnum = (patientInfo = {}) => { ...@@ -63,65 +63,66 @@ const getModeEnum = (patientInfo = {}) => {
{ {
value: '1', name: `门诊`, value: '1', name: `门诊`,
children: [ children: [
{value: 1, name: `复检`, disabled: false}, { value: 1, name: `复检`, disabled: false },
{value: 2, name: `指导`, disabled: false}, { value: 2, name: `指导`, disabled: false },
{value: 3, name: `宣教`, disabled: false}, { value: 3, name: `宣教`, disabled: false },
{value: 4, name: `催检`, disabled: true} { value: 4, name: `催检`, disabled: true }
] ]
}, },
{ {
value: '2', name: `住院`, value: '2', name: `住院`,
children: [ children: [
{value: 1, name: `复检`, disabled: false}, { value: 1, name: `复检`, disabled: false },
{value: 2, name: `指导`, disabled: false}, { value: 2, name: `指导`, disabled: false },
{value: 3, name: `宣教`, disabled: false}, { value: 3, name: `宣教`, disabled: false },
{value: 4, name: `催检`, disabled: true} { value: 4, name: `催检`, disabled: true }
] ]
}, },
{ {
value: '3', name: `入户`, value: '3', name: `入户`,
children: [ children: [
{value: 1, name: `复检`, disabled: false}, { value: 1, name: `复检`, disabled: false },
{value: 2, name: `指导`, disabled: false}, { value: 2, name: `指导`, disabled: false },
{value: 3, name: `宣教`, disabled: false}, { value: 3, name: `宣教`, disabled: false },
{value: 4, name: `催检`, disabled: true} { value: 4, name: `催检`, disabled: true }
], ]
}, },
{ {
value: '4', name: `电话`, value: '4', name: `电话`,
children: [ children: [
{value: 1, name: `复检`, disabled: false}, { value: 1, name: `复检`, disabled: false },
{value: 2, name: `指导`, disabled: false}, { value: 2, name: `指导`, disabled: false },
{value: 3, name: `宣教`, disabled: true}, { value: 3, name: `宣教`, disabled: true },
{value: 4, name: `催检`, disabled: false} { value: 4, name: `催检`, disabled: false }
], ]
}, },
{ {
value: '5', name: `短信`, value: '5', name: `短信`,
children: [ children: [
{value: 1, name: `复检`, disabled: true}, { value: 1, name: `复检`, disabled: true },
{value: 2, name: `指导`, disabled: false}, { value: 2, name: `指导`, disabled: false },
{value: 3, name: `宣教`, disabled: false}, { value: 3, name: `宣教`, disabled: false },
{value: 4, name: `催检`, disabled: false} { value: 4, name: `催检`, disabled: false }
], ]
}, },
{ {
value: '6', name: `微信`, value: '6', name: `微信`,
children: [ children: [
{value: 1, name: `复检`, disabled: true}, { value: 1, name: `复检`, disabled: true },
{value: 2, name: `指导`, disabled: false}, { value: 2, name: `指导`, disabled: false },
{value: 3, name: `宣教`, disabled: false}, { value: 3, name: `宣教`, disabled: false },
{value: 4, name: `催检`, disabled: false} { value: 4, name: `催检`, disabled: false }
], ]
}, }
], ],
tel:`(本人电话:${patientInfo.telephone || ''})`, tel: `(本人电话:${patientInfo.telephone || ''})`,
weixi: `(绑定电话:${patientInfo.weixin || '未绑定'})`, weixi: `(绑定电话:${patientInfo.weixin || '未绑定'})`,
telephone: patientInfo.telephone,
weixinTel: patientInfo.weixin, weixinTel: patientInfo.weixin,
//是否下次随访日期必填 //是否下次随访日期必填
nextVisitDateReq: true, nextVisitDateReq: true,
//催检内容是否显示患者姓名 //催检内容是否显示患者姓名
urgeResidentShow: true, urgeResidentShow: true
} }
} }
export default { export default {
...@@ -131,7 +132,6 @@ export default { ...@@ -131,7 +132,6 @@ export default {
return { return {
info: {}, info: {},
resident: {}, resident: {},
visitSituation: 1,
step: 1, step: 1,
//第一步提交的表单 //第一步提交的表单
firstForm: {}, firstForm: {},
...@@ -154,8 +154,8 @@ export default { ...@@ -154,8 +154,8 @@ export default {
if (this.routerDetail.id) { if (this.routerDetail.id) {
const res = await fetchCurrencyById({ id: this.routerDetail.id }) const res = await fetchCurrencyById({ id: this.routerDetail.id })
let result = res.data || {} let result = res.data || {}
const {residentsRecord = {}} = result const { residentsRecord = {} } = result
const {id, ...others} = residentsRecord const { id, ...others } = residentsRecord
this.info = { this.info = {
...others, ...others,
personId: id, personId: id,
...@@ -192,9 +192,6 @@ export default { ...@@ -192,9 +192,6 @@ export default {
} }
this.step = val this.step = val
}, },
changeVisitSituation(val) {
this.visitSituation = val
},
//图片上传 //图片上传
async upload(imgList = []) { async upload(imgList = []) {
let list = [] let list = []
...@@ -257,9 +254,6 @@ export default { ...@@ -257,9 +254,6 @@ export default {
if (this.info.id) { if (this.info.id) {
params.visitRecordId = this.info.visitRecordId params.visitRecordId = this.info.visitRecordId
} }
if (params.visitSituation == 2) {
params.visitWay = 14
}
let fun = this.info.id ? updateCurrency : addCurrency let fun = this.info.id ? updateCurrency : addCurrency
fun(params, true).then(({ code }) => { fun(params, true).then(({ code }) => {
if (code == 'SUCCESS') { if (code == 'SUCCESS') {
...@@ -268,17 +262,9 @@ export default { ...@@ -268,17 +262,9 @@ export default {
}) })
}, },
toBack() { toBack() {
if (this.visitSituation == 1) { if (this.step != 1) {
if (this.step != 1) { this.step--
this.step-- return
return
}
}
if (this.visitSituation == 2) {
if (this.step != 1) {
this.step = 1
return
}
} }
this.$router.back() this.$router.back()
} }
......
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