|
@@ -0,0 +1,140 @@
|
|
|
+<template>
|
|
|
+ <page-layer>
|
|
|
+ <template #header>
|
|
|
+ <el-date-picker type="daterange" v-model="dateRange" style="width: 200px" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
+ <el-select v-model="inquiry.commentLevel" :clearable="true" style="width: 90px" placeholder="评价星级">
|
|
|
+ <el-option v-for="item in commentsLevels" :value="item.value" :label="item.label"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="inquiry.deleted" :clearable="true" style="width: 80px" placeholder="状态">
|
|
|
+ <el-option label="全部" value=""></el-option>
|
|
|
+ <el-option label="未删除" :value="0"></el-option>
|
|
|
+ <el-option label="已删除" :value="1"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input v-model="inquiry.doctorName" placeholder="医生姓名" clearable style="width: 90px"></el-input>
|
|
|
+ <el-divider direction="vertical"></el-divider>
|
|
|
+ <el-button icon="Search" type="primary" @click="handleClickSearch">检索</el-button>
|
|
|
+ </template>
|
|
|
+ <template #main>
|
|
|
+ <el-table :data="comments.list" stripe :height="tableHeight" highlight-current-row>
|
|
|
+ <el-table-column prop="doctorCode" label="医生编码" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="doctorCodeRs" label="医生工号" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="doctorName" label="医生姓名" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="department" label="医生科室" width="120"></el-table-column>
|
|
|
+ <el-table-column label="评价星级" width="140">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-rate disabled size="small" v-model="scope.row.commentLevel" :colors="levelColors" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="评价内容">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="ellipsis-text" :title="scope.row.commentContent">
|
|
|
+ {{ scope.row.commentContent }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="commentTime" label="评价时间" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="patientId" label="患者ID" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="patientName" label="患者姓名" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="patPhoneNo" label="患者电话" width="90"></el-table-column>
|
|
|
+ <el-table-column label="评价状态" width="80">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ scope.row.deleted === 0 ? '未删除' : '已删除' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="80">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button v-if="scope.row.deleted === 0" icon="Delete" type="danger" @click="changeCommentStatus(scope.row, 1)">删除</el-button>
|
|
|
+ <el-button v-else icon="Refresh" type="success" @click="changeCommentStatus(scope.row, 0)">恢复</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="inquiry.pageNum"
|
|
|
+ :page-sizes="[15, 30, 45, 70, 100]"
|
|
|
+ :page-size="inquiry.pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next"
|
|
|
+ :total="comments.totalSize"
|
|
|
+ style="margin-top: 5px"
|
|
|
+ ></el-pagination>
|
|
|
+ </template>
|
|
|
+ </page-layer>
|
|
|
+</template>
|
|
|
+<script setup>
|
|
|
+import PageLayer from "@/layout/PageLayer.vue";
|
|
|
+import {getComments,updateCommentStatus} from "@/api/outpatient/comments";
|
|
|
+import {getDateRangeFormatDate} from "@/utils/date";
|
|
|
+import store from "@/store";
|
|
|
+import {ElMessage} from "element-plus";
|
|
|
+
|
|
|
+const windowSize = store.state.app.windowSize
|
|
|
+const tableHeight = windowSize.h - 55
|
|
|
+
|
|
|
+const commentsLevels = [
|
|
|
+ { label: '5星最好评', value: 5 },
|
|
|
+ { label: '4星好评', value: 4 },
|
|
|
+ { label: '3星中评', value: 3 },
|
|
|
+ { label: '2星差评', value: 2 },
|
|
|
+ { label: '1星最差评', value: 1 },
|
|
|
+]
|
|
|
+
|
|
|
+const levelColors = ref(['#99A9BF', '#F7BA2A', '#FF9900'])
|
|
|
+
|
|
|
+const dateRange = ref([])
|
|
|
+
|
|
|
+const formatDateRange = () => {
|
|
|
+ if (dateRange.value.length === 2) {
|
|
|
+ const format = getDateRangeFormatDate(dateRange.value)
|
|
|
+ inquiry.startTime = format.startTime
|
|
|
+ inquiry.endTime = format.endTime
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const inquiry = reactive({
|
|
|
+ startTime: null,
|
|
|
+ endTime: null,
|
|
|
+ commentLevel: null,
|
|
|
+ doctorName: null,
|
|
|
+ deleted: null,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 15,
|
|
|
+})
|
|
|
+
|
|
|
+const comments = reactive({
|
|
|
+ totalSize: 0,
|
|
|
+ list: []
|
|
|
+})
|
|
|
+const handleClickSearch = () => {
|
|
|
+ formatDateRange()
|
|
|
+ getComments(inquiry).then(res => {
|
|
|
+ comments.totalSize = res.totalSize
|
|
|
+ comments.list = res.list
|
|
|
+ }).catch(() => {
|
|
|
+ comments.totalSize = 0
|
|
|
+ comments.list = []
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const handleSizeChange = (val) => {
|
|
|
+ inquiry.pageSize = val
|
|
|
+ handleClickSearch()
|
|
|
+}
|
|
|
+const handleCurrentChange = (val) => {
|
|
|
+ inquiry.pageNum = val
|
|
|
+ handleClickSearch()
|
|
|
+}
|
|
|
+
|
|
|
+const changeCommentStatus = (row, deleted) => {
|
|
|
+ updateCommentStatus(row.id, deleted).then(res => {
|
|
|
+ row.deleted = deleted
|
|
|
+ ElMessage({
|
|
|
+ message: res,
|
|
|
+ type: 'success',
|
|
|
+ showClose: true,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|