From f13aacd58f88b9dd292fe557af328890202f4cf0 Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Fri, 21 Jun 2024 11:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 3 --- src/components/addHealthConfigModal.vue | 24 ++++++++++++++++++++---- src/layout/components/Menu/Menu.vue | 1 + src/router/index.js | 1 + 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/components.d.ts b/components.d.ts index 7029145..9c9cf27 100644 --- a/components.d.ts +++ b/components.d.ts @@ -17,14 +17,11 @@ declare module '@vue/runtime-core' { AddVisitConfigModal: typeof import('./src/components/addVisitConfigModal.vue')['default'] ChatRecord: typeof import('./src/components/chatRecord.vue')['default'] ConfirmModal: typeof import('./src/components/confirmModal.vue')['default'] - copy: typeof import('./src/components/medinceDetailModal copy.vue')['default'] CouponDetail: typeof import('./src/components/couponDetail.vue')['default'] DeleteModal: typeof import('./src/components/DeleteModal.vue')['default'] DoctorModal: typeof import('./src/components/doctorModal.vue')['default'] - ElButton: typeof import('element-plus/es')['ElButton'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] - ElTree: typeof import('element-plus/es')['ElTree'] FamilyModal: typeof import('./src/components/familyModal.vue')['default'] GiveCouponModal: typeof import('./src/components/giveCouponModal.vue')['default'] HospitalDetailModal: typeof import('./src/components/hospitalDetailModal.vue')['default'] diff --git a/src/components/addHealthConfigModal.vue b/src/components/addHealthConfigModal.vue index 81ac587..e161cf3 100644 --- a/src/components/addHealthConfigModal.vue +++ b/src/components/addHealthConfigModal.vue @@ -73,7 +73,7 @@ + :loading="loading" @search="healthConfig" :disabled="id?true:false" @change="changePackage"> {{ item.package_id }} @@ -85,7 +85,7 @@ + :loading="loading" @search="handleGetDoctor" @change="changeDoctor" :disabled="(id || !packagePrice)?true:false" @click="isSelectPackage"> {{ item.user_name }} @@ -105,7 +105,7 @@ class="input-demo" :step="1" :precision="0" :min="0" - />  提示:问诊金额{{tuwenPrice}}元,健康包金额{{modalForm.service_price}}元 + />  提示:问诊金额{{tuwenPrice*6*.5}}元,健康包金额{{packagePrice}}元 @@ -180,6 +180,15 @@ const handleGetDoctor=async(name='',id='')=>{ } loading.value=false; }; +const packagePrice=ref(null); +const changePackage=(val)=>{ + packageList.value.forEach(item=>{ + if(item.package_id==val){ + packagePrice.value=item.discount_product_total_amount; + } + }) + +} const healthConfig=async()=>{ const {code,data}=await getHealthConfigAddList({ limit:100 @@ -190,6 +199,8 @@ const healthConfig=async()=>{ } const reset=()=>{ product_data.value=[]; + packagePrice.value=null; + tuwenPrice.value=''; }; let multi_point_status=null; @@ -204,7 +215,7 @@ const configDetail=async()=>{ if(code==200){ if(data.inquiry_price){ tuwenPrice.value=data.inquiry_price; - emits('setPrice',data.inquiry_price*0.6*5) + emits('setPrice',data.inquiry_price*0.6*5+packagePrice.value) }else{ proxy.$message.warning('该医生需要开启图文问诊,才能开通此服务'); } @@ -216,6 +227,11 @@ const configDetail=async()=>{ } const changeDoctor=(val)=>{ configDetail(); +} +const isSelectPackage=()=>{ + if(packagePrice.value==null && !id.value){ + proxy.$message.warning('请先选择健康包'); + } } const {modalVisible,id,modalForm}=toRefs(props); const emits = defineEmits(['healthVisibleChange','freshList']); diff --git a/src/layout/components/Menu/Menu.vue b/src/layout/components/Menu/Menu.vue index 03e53b1..e249bf0 100644 --- a/src/layout/components/Menu/Menu.vue +++ b/src/layout/components/Menu/Menu.vue @@ -33,6 +33,7 @@ const props = defineProps({ }, }); const {menuList} = storeToRefs(permissionStore); + const route = useRoute(); const router = useRouter(); diff --git a/src/router/index.js b/src/router/index.js index 1837141..b1def9f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -80,6 +80,7 @@ router.beforeEach(async(to, from, next) => { if (store.token && permissionStore.addRouters.length==0) { await permissionStore.getButtonRole(); const menuResult = await permissionStore.getMenuRole(); + console.log( permissionStore.addRouters) permissionStore.addRouters.forEach((route) => { router.addRoute('/', route); });