|
|
@@ -0,0 +1,339 @@
|
|
|
+<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 label="客户姓名" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.name"
|
|
|
+ placeholder="请输入客户姓名"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="处理状态" prop="status">
|
|
|
+ <el-select v-model="queryParams.status" placeholder="请选择处理状态" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in statusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </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>
|
|
|
+
|
|
|
+ <div class="tab-status-filter mb10">
|
|
|
+ <el-radio-group v-model="queryParams.status" @change="handleStatusChange" size="small">
|
|
|
+ <el-radio-button label="">全部</el-radio-button>
|
|
|
+ <el-radio-button label="0">待处理</el-radio-button>
|
|
|
+ <el-radio-button label="1">已处理</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <el-table border v-loading="loading" :data="companyUserTaskList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="医生姓名" align="center" prop="doctorName"/>
|
|
|
+ <el-table-column label="客户姓名" align="center" prop="name"/>
|
|
|
+ <el-table-column label="客户头像" align="center" prop="avatar" width="100px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-popover
|
|
|
+ placement="right"
|
|
|
+ title=""
|
|
|
+ trigger="hover">
|
|
|
+ <img slot="reference" :src="scope.row.avatar" width="60px">
|
|
|
+ <img :src="scope.row.avatar" style="max-width: 200px;">
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="处理状态" align="center" prop="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="statusOptions" :value="scope.row.status"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="备注" align="center" prop="remark"/>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-view"
|
|
|
+ @click="handleView(scope.row)"
|
|
|
+ >详情
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['companyUserTask:companyUserTask:remove']"
|
|
|
+ >删除
|
|
|
+ </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"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 销售处理sop任务详情对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
|
+ <el-form :model="form" label-width="100px" size="small">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="医生姓名">
|
|
|
+ <span class="detail-value">{{ form.doctorName || '—' }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="客户姓名">
|
|
|
+ <span class="detail-value">{{ form.name || '—' }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="客户电话">
|
|
|
+ <div style="display: flex; align-items: center; gap: 8px;">
|
|
|
+ <span class="detail-value">
|
|
|
+ {{ decryptedPhone || (form.phone ? '******' : '—') }}
|
|
|
+ </span>
|
|
|
+ <el-button
|
|
|
+ v-if="form.id"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="mini"
|
|
|
+ @click="fetchDecryptedPhone(form.id)"
|
|
|
+ :loading="phoneLoading"
|
|
|
+ title="点击查看真实号码"
|
|
|
+ style="padding: 0; margin-left: 0;"
|
|
|
+ ></el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="处理状态">
|
|
|
+ <dict-tag :options="statusOptions" :value="form.status"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <span class="detail-value">{{ form.remark || '—' }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancel">关 闭</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ listCompanyUserTask,
|
|
|
+ getCompanyUserTask,
|
|
|
+ getUserPhone,
|
|
|
+ delCompanyUserTask,
|
|
|
+ updateCompanyUserTask,
|
|
|
+} from "@/api/qw/companyUserTask";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "CompanyUserTask",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 导出遮罩层
|
|
|
+ exportLoading: false,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 销售处理sop任务表格数据
|
|
|
+ companyUserTaskList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 处理状态字典
|
|
|
+ statusOptions: [],
|
|
|
+ // 用于存储解密后的电话
|
|
|
+ decryptedPhone: '',
|
|
|
+ // 电话加载状态
|
|
|
+ phoneLoading: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ externalId: null,
|
|
|
+ doctorId: null,
|
|
|
+ doctorName: null,
|
|
|
+ userId: null,
|
|
|
+ name: null,
|
|
|
+ status: null,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {},
|
|
|
+
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ this.getDicts("sop_task_status").then(response => {
|
|
|
+ this.statusOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询销售处理sop任务列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listCompanyUserTask(this.queryParams).then(response => {
|
|
|
+ this.companyUserTaskList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ externalId: null,
|
|
|
+ doctorId: null,
|
|
|
+ userId: null,
|
|
|
+ status: null,
|
|
|
+ remark: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length !== 1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 详情按钮操作 */
|
|
|
+ handleView(row) {
|
|
|
+ const id = row.id || this.ids;
|
|
|
+ getCompanyUserTask(id).then(response => {
|
|
|
+ this.form = response.data || {}; // 安全兜底
|
|
|
+ this.decryptedPhone = ''; // 清空上次解密的电话
|
|
|
+ this.open = true;
|
|
|
+ this.title = "销售处理SOP任务详情";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updateCompanyUserTask(this.form).then(response => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addCompanyUserTask(this.form).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$confirm('是否确认删除销售处理sop任务编号为"' + ids + '"的数据项?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function () {
|
|
|
+ return delCompanyUserTask(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 切换状态Tab */
|
|
|
+ handleStatusChange() {
|
|
|
+ this.queryParams.pageNum = 1; // 切换时重置页码
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 获取并显示解密后的电话 */
|
|
|
+ async fetchDecryptedPhone(id) {
|
|
|
+ if (!id) return;
|
|
|
+ this.phoneLoading = true;
|
|
|
+ try {
|
|
|
+ const response = await getUserPhone(id);
|
|
|
+ this.decryptedPhone = response.userPhone || '—';
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error('获取电话失败');
|
|
|
+ this.decryptedPhone = '获取失败';
|
|
|
+ } finally {
|
|
|
+ this.phoneLoading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.mb10 {
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.tab-status-filter {
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.detail-value {
|
|
|
+ font-weight: 500;
|
|
|
+ color: #606266;
|
|
|
+}
|
|
|
+</style>
|