浏览代码

医保移动支付后推送医生评价

lighter 9 月之前
父节点
当前提交
034d22f001

+ 8 - 0
src/api/comment.js

@@ -15,3 +15,11 @@ export function fetchDoctorComments(data) {
         data
     })
 }
+
+export function getVisitInfo(visitId) {
+    return request({
+        url: '/comment/getVisitInfo',
+        method: 'get',
+        params: { visitId },
+    })
+}

+ 0 - 9
src/components/bind-card-method/index.vue

@@ -1,9 +0,0 @@
-<template>
-  <div style="padding: 20px">
-    <van-button type="primary" block to="/bindPatientCard">绑定已有的诊疗卡</van-button>
-    <div style="height: 10px"></div>
-<!--    <van-button type="primary" plain block to="/createPatientCard">我没有诊疗卡</van-button>-->
-<!--    <div style="height: 10px"></div>-->
-    <van-button type="success" plain block to="/addElectronicHealthCard">通过电子健康证绑卡</van-button>
-  </div>
-</template>

+ 157 - 0
src/components/doctor-grade/index.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="comment-wrapper">
+    <div class="comment-bar-title">
+      <div class="comment-bar-title_icon">
+        <van-icon name="comment" />
+      </div>
+      <div class="comment-bar-title_text">
+        服务评价
+      </div>
+      <div class="comment-bar-title_subtext">
+        请为本次医生服务进行评价
+      </div>
+    </div>
+
+    <div class="comment-content-box">
+      <div>
+        <span style="color: #333333; font-size: 14px">评分:</span>
+        <van-rate
+            v-model="comment.commentLevel"
+            :size="20"
+            color="#ffd21e"
+            void-icon="star"
+            void-color="#eee"
+        />
+        <span style="margin-left: 12px; font-size: 12px; color: rgb(255,0,0)">({{rateLevelExplain}})</span>
+      </div>
+      <van-field
+          v-model="comment.commentContent"
+          rows="3"
+          autosize
+          type="textarea"
+          placeholder="您对医生的服务还有哪些建议或意见"
+          style="border: 1px solid lightgray; border-radius: 5px; margin-top: 12px"
+      />
+      <div class="comment-submit-box">
+        <van-button
+            size="small"
+            type="danger"
+            round
+            plain
+            :disabled="disableSubmitComment"
+            style="width: 120px"
+            @click="submitComment(null)"
+        >
+          提交
+        </van-button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import {computed, reactive, ref} from "vue";
+import {commitNewComment} from "@/api/comment";
+import {showDialog} from "vant";
+
+defineExpose({
+  submitComment
+})
+
+const props = defineProps({
+  order: {
+    type: Object,
+    required: true,
+  }
+})
+
+const comment = reactive({
+  commentLevel: 5,
+  commentContent: '',
+  doctorName: '',
+  hisOrdNum: '',
+  patientName: '',
+  patientId: ''
+})
+
+const rateLevelExplain = computed(() => {
+  switch (comment.commentLevel) {
+    case 5:
+      return '非常满意'
+    case 4:
+      return '满意'
+    case 3:
+      return '一般'
+    case 2:
+      return '不满意'
+    case 1:
+      return '非常不满意'
+  }
+})
+
+const disableSubmitComment = ref(false)
+function submitComment(callback) {
+  if (disableSubmitComment.value) {
+    callback()
+  } else {
+    comment.doctorCode = props.order.doctorCode;
+    comment.doctorName = props.order.doctorName
+    comment.hisOrdNum = props.order.hisOrdNum
+    comment.patientId = props.order.patientId
+    comment.patientName = props.order.patientName
+    commitNewComment(comment).then(() => {
+      disableSubmitComment.value = true
+      if (null === callback) {
+        showDialog({
+          type: 'success',
+          message: '提交成功,感谢您的评价!',
+        })
+      } else {
+        callback()
+      }
+    })
+  }
+}
+
+</script>
+
+<style scoped>
+.comment-wrapper {
+  background-image: linear-gradient(#fca46d, #fcd5b3);
+  margin: 24px 12px;
+  border-radius: 10px;
+  padding-bottom: 12px;
+}
+.comment-bar-title {
+  display: flex;
+  align-items: center;
+  padding: 4px 0 2px 16px;
+}
+.comment-bar-title_icon {
+  color: #dc2424;
+  font-size: 18px;
+  margin-top: 3px;
+}
+.comment-bar-title_text {
+  color: #dc2424;
+  margin-left: 6px;
+  font-size: 14px;
+  line-height: 30px;
+}
+.comment-bar-title_subtext {
+  margin-left: 8px;
+  font-size: 12px;
+  color: white;
+  line-height: 30px;
+}
+.comment-content-box {
+  background-color: white;
+  margin: 0 12px;
+  padding: 12px;
+}
+.comment-submit-box {
+  width: 100%;
+  margin-top: 12px;
+  text-align: center;
+}
+</style>

+ 7 - 0
src/router/index.js

@@ -329,6 +329,13 @@ export const constantRoutes = [
       title: '住院服务满意度调查',
     },
   },
+  {
+    path: '/doctorGradeByPush/:visitId',
+    component: () => import('../views/isolations/DoctorGradeByPush.vue'),
+    meta: {
+      title: '医生评价'
+    }
+  },
   {
     path: '/assessments/covid/:patientId?/:from?',
     component: () => import('../views/hospital-service/assessments/Covid19Assessment.vue'),

+ 38 - 0
src/views/isolations/DoctorGradeByPush.vue

@@ -0,0 +1,38 @@
+<template>
+  <window-size :showBackNav="false">
+
+    <van-tag class="m-tag" type="primary" plain>就诊信息</van-tag>
+
+    <van-cell title="门诊ID" :value="order.patientId" />
+    <van-cell title="就诊人" :value="order.patientName" />
+    <van-cell title="就诊时间" :value="order.visitDate" />
+    <van-cell title="就诊科室" :value="order.deptName" />
+    <van-cell title="看诊医生" :value="order.doctorName" />
+
+    <DoctorGrade :order="order" />
+  </window-size>
+</template>
+
+<script setup>
+import DoctorGrade from '@/components/doctor-grade/index.vue'
+import {onMounted, ref} from "vue";
+import {useRouter} from "vue-router";
+import {getVisitInfo} from "@/api/comment";
+
+const router = useRouter()
+const routerValue = router.currentRoute.value
+const visitId = routerValue.params.visitId
+const order = ref({})
+
+onMounted(() => {
+  getVisitInfo(visitId).then(res => {
+    order.value = res
+  })
+})
+</script>
+
+<style scoped>
+.m-tag {
+  margin: 8px;
+}
+</style>

+ 10 - 135
src/views/public-pages/PaymentSuccess.vue

@@ -107,54 +107,11 @@
       </div>
     </div>
 
-    <div v-if="createOrderRequest.orderType === 2" class="comment-wrapper">
-      <div class="comment-bar-title">
-        <div class="comment-bar-title_icon">
-          <van-icon name="comment" />
-        </div>
-        <div class="comment-bar-title_text">
-          服务评价
-        </div>
-        <div class="comment-bar-title_subtext">
-          请为本次医生服务进行评价
-        </div>
-      </div>
-
-      <div class="comment-content-box">
-        <div>
-          <span style="color: #333333; font-size: 14px">评分:</span>
-          <van-rate
-              v-model="comment.commentLevel"
-              :size="20"
-              color="#ffd21e"
-              void-icon="star"
-              void-color="#eee"
-          />
-          <span style="margin-left: 12px; font-size: 12px; color: rgb(255,0,0)">({{rateLevelExplain}})</span>
-        </div>
-        <van-field
-            v-model="comment.commentContent"
-            rows="3"
-            autosize
-            type="textarea"
-            placeholder="您对医生的服务还有哪些建议或意见"
-            style="border: 1px solid lightgray; border-radius: 5px; margin-top: 12px"
-        />
-        <div class="comment-submit-box">
-          <van-button
-              size="small"
-              type="danger"
-              round
-              plain
-              :disabled="disableSubmitComment"
-              style="width: 120px"
-              @click="submitComment(null)"
-          >
-            提交
-          </van-button>
-        </div>
-      </div>
-    </div>
+    <DoctorGrade
+        ref="doctorGrade"
+        v-show="createOrderRequest.orderType === 2"
+        :order="createOrderRequest"
+    />
 
     <van-popup v-model:show="showOrderDetail" position="top" :style="{ height: '100%' }">
       <wx-order-detail @close="showOrderDetail = false" />
@@ -165,12 +122,12 @@
 <script setup>
 import {useRouter} from "vue-router";
 import store from "@/store";
-import {computed, reactive, ref} from "vue";
-import {commitNewComment} from "@/api/comment";
-import {showDialog} from "vant";
+import {ref} from "vue";
 import WxOrderDetail from '@/components/wx-order-detail/index.vue'
+import DoctorGrade from '@/components/doctor-grade/index.vue'
 
 const router = useRouter()
+const doctorGrade = ref(null)
 const createOrderRequest = store.getters.getCreateOrderRequest
 if (createOrderRequest.orderType !== 6 && !createOrderRequest.patientId) {
   router.push('/404')
@@ -185,61 +142,17 @@ function closePage() {
 }
 
 function autoSubmit(callback) {
-  if (createOrderRequest.orderType === 2 && !disableSubmitComment.value) {
-    submitComment(callback)
+  if (createOrderRequest.orderType === 2) {
+    doctorGrade.value.submitComment(callback)
   } else {
     callback()
   }
 }
 
-const comment = reactive({
-  commentLevel: 5,
-  commentContent: '',
-  doctorName: '',
-  hisOrdNum: '',
-  patientName: '',
-  patientId: ''
-})
-
-const rateLevelExplain = computed(() => {
-  switch (comment.commentLevel) {
-    case 5:
-      return '非常满意'
-    case 4:
-      return '满意'
-    case 3:
-      return '一般'
-    case 2:
-      return '不满意'
-    case 1:
-      return '非常不满意'
-  }
-})
-
 const showOrderDetail = ref(false)
 function checkMyOrder() {
   showOrderDetail.value = true
 }
-
-const disableSubmitComment = ref(false)
-function submitComment(callback) {
-  comment.doctorCode = createOrderRequest.doctorCode
-  comment.doctorName = createOrderRequest.doctorName
-  comment.hisOrdNum = createOrderRequest.hisOrdNum
-  comment.patientId = createOrderRequest.patientId
-  comment.patientName = createOrderRequest.patientName
-  commitNewComment(comment).then(res => {
-    disableSubmitComment.value = true
-    if (null === callback) {
-      showDialog({
-        type: 'success',
-        message: '提交成功,感谢您的评价!',
-      })
-    } else {
-      callback()
-    }
-  })
-}
 </script>
 
 <style lang="scss">
@@ -305,43 +218,5 @@ function submitComment(callback) {
   .money-color {
     color: orangered;
   }
-  .comment-wrapper {
-    background-image: linear-gradient(#fca46d, #fcd5b3);
-    margin: 24px 12px;
-    border-radius: 10px;
-    padding-bottom: 12px;
-  }
-  .comment-bar-title {
-    display: flex;
-    align-items: center;
-    padding: 4px 0 2px 16px;
-  }
-  .comment-bar-title_icon {
-    color: #dc2424;
-    font-size: 18px;
-    margin-top: 3px;
-  }
-  .comment-bar-title_text {
-    color: #dc2424;
-    margin-left: 6px;
-    font-size: 14px;
-    line-height: 30px;
-  }
-  .comment-bar-title_subtext {
-    margin-left: 8px;
-    font-size: 12px;
-    color: white;
-    line-height: 30px;
-  }
-  .comment-content-box {
-    background-color: white;
-    margin: 0 12px;
-    padding: 12px;
-  }
-  .comment-submit-box {
-    width: 100%;
-    margin-top: 12px;
-    text-align: center;
-  }
 }
 </style>