|
@@ -5,12 +5,13 @@
|
|
|
<el-option v-for="item in allMzDepts" :key="item.code" :value="item.code" :label="item.name"></el-option>
|
|
|
</el-select>
|
|
|
<el-input v-model="queryParam.doctorName" style="width: 120px" placeholder="医生姓名" clearable></el-input>
|
|
|
+ <el-checkbox v-model="queryParam.includeDeleted" style="margin-left: 4px">搜索已删除医生</el-checkbox>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<el-button type="primary" icon="Search" @click="fetchDoctors">查询</el-button>
|
|
|
<el-button type="primary" icon="Refresh" @click="resetSearch">重置</el-button>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<el-button icon="Top" @click="manageRecommendOrder">服务号推荐排序</el-button>
|
|
|
- <el-button icon="Warning" type="danger" @click="refreshWxDoctorCache">强制刷新服务号医生数据</el-button>
|
|
|
+ <el-button icon="Warning" type="danger" @click="refreshWxDoctorCache">刷新服务号医生数据</el-button>
|
|
|
</template>
|
|
|
<template #main>
|
|
|
<el-table :data="allDoctors" :height="tableHeight" stripe highlight-current-row>
|
|
@@ -33,7 +34,8 @@
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<el-button @click="editDoctor(scope.row)" text icon="Edit" type="primary">编辑</el-button>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
- <el-button @click="beforeDelete(scope.row)" text icon="Delete" type="danger">删除</el-button>
|
|
|
+ <el-button v-if="queryParam.includeDeleted" @click="undoDelete(scope.row)" text icon="Check" type="info">恢复</el-button>
|
|
|
+ <el-button v-else @click="beforeDelete(scope.row)" text icon="Delete" type="danger">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -172,7 +174,7 @@
|
|
|
<script setup name="DoctorInfoManagement">
|
|
|
import { onMounted, reactive, ref } from 'vue'
|
|
|
import {
|
|
|
- deleteDoctor,
|
|
|
+ updateDoctorStatus,
|
|
|
getAllDoctors,
|
|
|
getAllMzDept,
|
|
|
getAllRecommendDoctors,
|
|
@@ -207,6 +209,7 @@ const sexCodes = [
|
|
|
const queryParam = reactive({
|
|
|
deptCode: '',
|
|
|
doctorName: '',
|
|
|
+ includeDeleted: false,
|
|
|
currentPage: 1,
|
|
|
pageSize: 15,
|
|
|
})
|
|
@@ -347,6 +350,18 @@ const refreshWxDoctorCache = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const undoDelete = (row) => {
|
|
|
+ updateDoctorStatus(row.code, 1).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: res,
|
|
|
+ type: 'success',
|
|
|
+ duration: 2000,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ fetchDoctors()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
const beforeDelete = (row) => {
|
|
|
ElMessageBox.confirm('删除后将无法在服务号首页推荐,是否确认删除?', '提示', {
|
|
|
type: 'warning',
|
|
@@ -354,7 +369,7 @@ const beforeDelete = (row) => {
|
|
|
cancelButtonText: '取消',
|
|
|
})
|
|
|
.then(() => {
|
|
|
- deleteDoctor(row.code).then((res) => {
|
|
|
+ updateDoctorStatus(row.code, 0).then((res) => {
|
|
|
ElMessage({
|
|
|
message: res,
|
|
|
type: 'success',
|