|
@@ -0,0 +1,430 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="app-container">
|
|
|
|
|
+ <!-- 搜索表单 -->
|
|
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
+ <el-form-item label="医生名称" prop="doctorName">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.doctorName"
|
|
|
|
|
+ placeholder="请输入医生名称"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table border v-loading="loading" :data="memberSalesList" width="70%">
|
|
|
|
|
+ <el-table-column label="医生ID" align="center" prop="doctorId" width="100" />
|
|
|
|
|
+ <el-table-column label="医生姓名" align="left" prop="doctorName" width="150" />
|
|
|
|
|
+ <el-table-column label="待处理任务数" align="center" prop="pendingTaskNum" width="120" />
|
|
|
|
|
+ <el-table-column label="已完成任务数" align="center" prop="completedTaskNum" width="120" />
|
|
|
|
|
+ <el-table-column label="总计任务数" align="center" prop="totalTaskNum" width="120" />
|
|
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-more"
|
|
|
|
|
+ @click="viewPendingTasks(scope.row)"
|
|
|
|
|
+ >查看待处理</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-finished"
|
|
|
|
|
+ @click="viewCompletedTasks(scope.row)"
|
|
|
|
|
+ >查看已处理</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 分页组件 -->
|
|
|
|
|
+ <pagination
|
|
|
|
|
+ v-show="total>0"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
|
|
+ @pagination="getList"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 待处理任务弹窗 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="待处理任务详情"
|
|
|
|
|
+ :visible.sync="pendingDialogVisible"
|
|
|
|
|
+ width="70%"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="pending-dialog">
|
|
|
|
|
+ <!-- 搜索区域 -->
|
|
|
|
|
+ <el-form :inline="true" :model="pendingQueryParams" class="demo-form-inline">
|
|
|
|
|
+ <el-form-item label="销售姓名">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="pendingQueryParams.companyUserName"
|
|
|
|
|
+ placeholder="请输入销售姓名"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="客户昵称">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="pendingQueryParams.userName"
|
|
|
|
|
+ placeholder="请输入客户昵称"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="真实姓名">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="pendingQueryParams.realName"
|
|
|
|
|
+ placeholder="请输入客户真实姓名"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="会员ID">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="pendingQueryParams.exId"
|
|
|
|
|
+ placeholder="请输入企微会员ID"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" @click="loadPendingTasks">搜索</el-button>
|
|
|
|
|
+ <el-button @click="resetPendingQuery">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 待处理任务表格 -->
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ v-loading="pendingLoading"
|
|
|
|
|
+ :data="pendingList"
|
|
|
|
|
+ border
|
|
|
|
|
+ style="width: 100%; margin-top: 15px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column label="企微会员ID" align="center" prop="exId"/>
|
|
|
|
|
+ <el-table-column label="客户昵称" align="center" prop="userName"/>
|
|
|
|
|
+ <el-table-column label="真实姓名" align="center" prop="realName"/>
|
|
|
|
|
+ <el-table-column label="客户电话" align="center" prop="phone"/>
|
|
|
|
|
+ <el-table-column label="销售名称" align="center" prop="companyUserName"/>
|
|
|
|
|
+ <el-table-column label="待处理条数" align="center" prop="unprocessed"/>
|
|
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime"/>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 分页组件 -->
|
|
|
|
|
+ <pagination
|
|
|
|
|
+ v-show="pendingTotal>0"
|
|
|
|
|
+ :total="pendingTotal"
|
|
|
|
|
+ :page.sync="pendingQueryParams.pageNum"
|
|
|
|
|
+ :limit.sync="pendingQueryParams.pageSize"
|
|
|
|
|
+ @pagination="handlePendingPagination"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="pendingDialogVisible = false">关 闭</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 已处理任务弹窗 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="已处理任务详情"
|
|
|
|
|
+ :visible.sync="completedDialogVisible"
|
|
|
|
|
+ width="70%"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="completed-dialog">
|
|
|
|
|
+ <!-- 搜索区域 -->
|
|
|
|
|
+ <el-form :inline="true" :model="completedQueryParams" class="demo-form-inline">
|
|
|
|
|
+ <el-form-item label="处理方式">
|
|
|
|
|
+ <el-select v-model="completedQueryParams.handleType" placeholder="请选择处理方式" clearable>
|
|
|
|
|
+ <el-option label="签收时提醒" :value="1"/>
|
|
|
|
|
+ <el-option label="设置提醒时间" :value="2"/>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" @click="loadCompletedTasks">搜索</el-button>
|
|
|
|
|
+ <el-button @click="resetCompletedQuery">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 已处理任务表格 -->
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ v-loading="completedLoading"
|
|
|
|
|
+ :data="completedList"
|
|
|
|
|
+ border
|
|
|
|
|
+ style="width: 100%; margin-top: 15px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column label="用户昵称" align="center" prop="name"/>
|
|
|
|
|
+ <el-table-column label="处理方式" align="center" prop="handleType" width="120">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ formatHandleType(scope.row.handleType) }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="订单号" align="center" prop="orderCode" width="180">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ scope.row.orderCode || '--' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="提醒天数" align="center" prop="sendDays" width="100">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ scope.row.sendDays ? scope.row.sendDays + '天' : '--' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="处理结果" align="center" prop="remark"/>
|
|
|
|
|
+ <el-table-column label="处理时间" align="center" prop="createTime" width="180"/>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 分页组件 -->
|
|
|
|
|
+ <pagination
|
|
|
|
|
+ v-show="completedTotal>0"
|
|
|
|
|
+ :total="completedTotal"
|
|
|
|
|
+ :page.sync="completedQueryParams.pageNum"
|
|
|
|
|
+ :limit.sync="completedQueryParams.pageSize"
|
|
|
|
|
+ @pagination="handleCompletedPagination"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="completedDialogVisible = false">关 闭</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import { doctorFollowUpStats, selectPendingTaskList, selectCompletedTasksList } from "@/api/statistics/sopStatistics";
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: "DoctorTaskStats",
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ loading: true, // 主列表加载状态
|
|
|
|
|
+ total: 0, // 主列表总条数
|
|
|
|
|
+ memberSalesList: [], // 主列表数据
|
|
|
|
|
+ showSearch: true,
|
|
|
|
|
+
|
|
|
|
|
+ // 主列表查询参数
|
|
|
|
|
+ queryParams: {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ doctorName: null
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // --- 待处理任务弹窗相关 ---
|
|
|
|
|
+ pendingDialogVisible: false,
|
|
|
|
|
+ pendingLoading: false,
|
|
|
|
|
+ pendingList: [],
|
|
|
|
|
+ pendingTotal: 0,
|
|
|
|
|
+ pendingQueryParams: {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ doctorId: null, // 医生ID
|
|
|
|
|
+ companyUserName: null, // 销售姓名
|
|
|
|
|
+ userName: null, // 客户昵称
|
|
|
|
|
+ realName: null, // 真实姓名
|
|
|
|
|
+ exId: null // 企微会员ID
|
|
|
|
|
+ },
|
|
|
|
|
+ currentPendingDoctor: null, // 当前查看待处理任务的医生
|
|
|
|
|
+
|
|
|
|
|
+ // --- 已处理任务弹窗相关 ---
|
|
|
|
|
+ completedDialogVisible: false,
|
|
|
|
|
+ completedLoading: false,
|
|
|
|
|
+ completedList: [],
|
|
|
|
|
+ completedTotal: 0,
|
|
|
|
|
+ completedQueryParams: {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ doctorId: null, // 医生ID
|
|
|
|
|
+ handleType: null // 处理方式
|
|
|
|
|
+ },
|
|
|
|
|
+ currentCompletedDoctor: null, // 当前查看已处理任务的医生
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ /** 查询医生任务统计列表 */
|
|
|
|
|
+ getList() {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ doctorFollowUpStats(this.queryParams).then(response => {
|
|
|
|
|
+ this.memberSalesList = response.rows;
|
|
|
|
|
+ this.total = response.total;
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ console.error('获取医生任务统计失败:', error);
|
|
|
|
|
+ this.$message.error('获取医生任务统计失败');
|
|
|
|
|
+ this.memberSalesList = [];
|
|
|
|
|
+ this.total = 0;
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /** 搜索按钮操作 */
|
|
|
|
|
+ handleQuery() {
|
|
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /** 重置按钮操作 */
|
|
|
|
|
+ resetQuery() {
|
|
|
|
|
+ this.resetForm("queryForm");
|
|
|
|
|
+ this.handleQuery();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查看某个医生的待处理任务
|
|
|
|
|
+ */
|
|
|
|
|
+ viewPendingTasks(row) {
|
|
|
|
|
+ this.currentPendingDoctor = row;
|
|
|
|
|
+ this.pendingQueryParams = {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ doctorId: row.doctorId, // 设置医生ID
|
|
|
|
|
+ companyUserName: null,
|
|
|
|
|
+ userName: null,
|
|
|
|
|
+ realName: null,
|
|
|
|
|
+ exId: null
|
|
|
|
|
+ };
|
|
|
|
|
+ this.pendingDialogVisible = true;
|
|
|
|
|
+ this.loadPendingTasks();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查看某个医生的已处理任务
|
|
|
|
|
+ */
|
|
|
|
|
+ viewCompletedTasks(row) {
|
|
|
|
|
+ this.currentCompletedDoctor = row;
|
|
|
|
|
+ this.completedQueryParams = {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ doctorId: row.doctorId, // 设置医生ID
|
|
|
|
|
+ handleType: null
|
|
|
|
|
+ };
|
|
|
|
|
+ this.completedDialogVisible = true;
|
|
|
|
|
+ this.loadCompletedTasks();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 加载待处理任务列表
|
|
|
|
|
+ */
|
|
|
|
|
+ loadPendingTasks() {
|
|
|
|
|
+ this.pendingLoading = true;
|
|
|
|
|
+ selectPendingTaskList(this.pendingQueryParams)
|
|
|
|
|
+ .then(response => {
|
|
|
|
|
+ this.pendingList = response.rows || [];
|
|
|
|
|
+ this.pendingTotal = response.total || 0;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error('获取待处理任务失败:', error);
|
|
|
|
|
+ this.$message.error('获取待处理任务失败');
|
|
|
|
|
+ this.pendingList = [];
|
|
|
|
|
+ this.pendingTotal = 0;
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ this.pendingLoading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 加载已处理任务列表
|
|
|
|
|
+ */
|
|
|
|
|
+ loadCompletedTasks() {
|
|
|
|
|
+ this.completedLoading = true;
|
|
|
|
|
+ selectCompletedTasksList(this.completedQueryParams)
|
|
|
|
|
+ .then(response => {
|
|
|
|
|
+ this.completedList = response.rows || [];
|
|
|
|
|
+ this.completedTotal = response.total || 0;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error('获取已处理任务失败:', error);
|
|
|
|
|
+ this.$message.error('获取已处理任务失败');
|
|
|
|
|
+ this.completedList = [];
|
|
|
|
|
+ this.completedTotal = 0;
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ this.completedLoading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 待处理任务分页处理
|
|
|
|
|
+ */
|
|
|
|
|
+ handlePendingPagination() {
|
|
|
|
|
+ this.loadPendingTasks();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 已处理任务分页处理
|
|
|
|
|
+ */
|
|
|
|
|
+ handleCompletedPagination() {
|
|
|
|
|
+ this.loadCompletedTasks();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 重置待处理任务查询条件
|
|
|
|
|
+ */
|
|
|
|
|
+ resetPendingQuery() {
|
|
|
|
|
+ const doctorId = this.pendingQueryParams.doctorId;
|
|
|
|
|
+ this.pendingQueryParams = {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ doctorId: doctorId,
|
|
|
|
|
+ companyUserName: null,
|
|
|
|
|
+ userName: null,
|
|
|
|
|
+ realName: null,
|
|
|
|
|
+ exId: null
|
|
|
|
|
+ };
|
|
|
|
|
+ this.loadPendingTasks();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 重置已处理任务查询条件
|
|
|
|
|
+ */
|
|
|
|
|
+ resetCompletedQuery() {
|
|
|
|
|
+ const doctorId = this.completedQueryParams.doctorId;
|
|
|
|
|
+ this.completedQueryParams = {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ doctorId: doctorId,
|
|
|
|
|
+ handleType: null
|
|
|
|
|
+ };
|
|
|
|
|
+ this.loadCompletedTasks();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 格式化处理方式
|
|
|
|
|
+ */
|
|
|
|
|
+ formatHandleType(handleType) {
|
|
|
|
|
+ switch (handleType) {
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ return '签收时提醒';
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ return '设置提醒时间';
|
|
|
|
|
+ default:
|
|
|
|
|
+ return '未知';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+.app-container {
|
|
|
|
|
+ padding: 20px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* 待处理和已处理弹窗样式 */
|
|
|
|
|
+.pending-dialog,
|
|
|
|
|
+.completed-dialog {
|
|
|
|
|
+ min-height: 300px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* 表单内联样式 */
|
|
|
|
|
+.demo-form-inline {
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|