| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
- <el-form-item label="企微员工昵称" prop="qwUserName">
- <el-input
- v-model="queryParams.qwUserName"
- placeholder="请输入企微员工昵称"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="客户昵称" prop="externalUserName">
- <el-input
- v-model="queryParams.externalUserName"
- placeholder="请输入企微客户昵称"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="发送(成员)状态" prop="sendStatus">
- <el-select v-model="queryParams.sendStatus" placeholder="请选择发送(成员)状态" clearable size="small">
- <el-option
- v-for="dict in sysQwSopLogsStatus"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="接收(客户)状态" prop="receivingStatus">
- <el-select v-model="queryParams.receivingStatus" placeholder="请选择接收(客户)状态" clearable size="small">
- <el-option
- v-for="dict in groupMsgSendStatusOptions"
- :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>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- :loading="exportLoading"
- @click="handleExport"
- v-hasPermi="['course:sopLogs:export']"
- >导出</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['qw:autoTagsLogs:remove']"
- >删除</el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-tabs type="card" v-model="defaultWatchStatus" @tab-click="handleClickX">
- <el-tab-pane v-for="(item,index) in sysFsSopWatchStatus" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
- </el-tabs>
- <el-table v-loading="loading" :data="qwSopLogsList" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="企微成员昵称" align="center" prop="qwUserName" />
- <el-table-column label="系统后台昵称" align="center" prop="userName" />
- <el-table-column label="客户昵称" align="center" prop="externalUserName" />
- <el-table-column label="观看状态" align="center" prop="watchStatus">
- <template slot-scope="scope">
- <dict-tag :options="sysFsSopWatchStatus" :value="scope.row.watchStatus"/>
- </template>
- </el-table-column>
- <el-table-column label="发送的消息" align="center" prop="contentJson" >
- <template slot-scope="scope">
- <el-button type="text" @click="showContentDialog(scope.row.contentJson)">
- 查看详情
- </el-button>
- </template>
- </el-table-column>
- <el-table-column label="成员状态" align="center" prop="sendStatus" >
- <template slot-scope="scope">
- <dict-tag :options="sysQwSopLogsStatus" :value="scope.row.sendStatus"/>
- </template>
- </el-table-column>
- <el-table-column label="预计发送时间" align="center" prop="sendTime" width="180"/>
- <el-table-column label="客户接收" align="center" prop="receivingStatus" >
- <template slot-scope="scope">
- <dict-tag :options="groupMsgSendStatusOptions" :value="scope.row.receivingStatus"/>
- </template>
- </el-table-column>
- </el-table>
- <el-dialog :visible.sync="contentDialog.isDialogVisible" title="消息详情" width="30%" append-to-body>
- <el-card v-for="(item, index) in contentDialog.selectedContentJson" :key="index" class="box-card" style="margin-top: 2%">
- <div slot="header" class="clearfix">
- <span>消息{{index}}:</span>
- </div>
- <div v-html="item.value"></div>
- <el-link v-if="item.isBindUrl == 1" :href="item.url" target="_blank">{{ item.url }}</el-link>
- </el-card>
- <span slot="footer" class="dialog-footer">
- <el-button @click="contentDialog.isDialogVisible = false">关闭</el-button>
- </span>
- </el-dialog>
- <!-- 大图预览对话框 -->
- <el-dialog
- :visible.sync="dialogVisible"
- :modal="false"
- width="500"
- append-to-body>
- <img
- :src="this.dialogImageUrl"
- style="display: block; max-width: 100%; margin: 0 auto"
- />
- </el-dialog>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- </template>
- <script>
- import { exportSopLogs, listSopLogsCVOList } from '@/api/course/sopLogs'
- import { delAutoTagsLogs } from '@/api/qw/autoTagsLogs'
- export default {
- name: "sopLogsList",
- data() {
- return {
- //图片放大
- dialogVisible: false,
- dialogImageUrl:null,
- //默认规则
- defaultWatchStatus:"0",
- // 遮罩层
- loading: true,
- // 导出遮罩层
- exportLoading: false,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 企业微信SOP 定时任务表格数据
- qwSopLogsList: [],
- //成员状态
- sysQwSopLogsStatus:[],
- //客户接收状态
- groupMsgSendStatusOptions:[],
- //SOP课程观看状态
- sysFsSopWatchStatus:[],
- //发送的消息
- contentDialog:{
- isDialogVisible:false,
- selectedContentJson: [],
- },
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- qwUserName: null,
- externalUserName: null,
- sendStatus: null,
- sendTime: null,
- receivingStatus: null,
- watchStatus:0,
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- }
- };
- },
- created() {
- this.getList();
- //成员状态
- this.getDicts("sys_qw_sopLogs_status").then(response => {
- this.sysQwSopLogsStatus = response.data;
- });
- //客户接收状态
- this.getDicts("sys_qw_groupMsg_SendStatus").then(response => {
- this.groupMsgSendStatusOptions = response.data;
- });
- //客户观看状态
- this.getDicts("sys_fs_sop_watch_status").then(response => {
- this.sysFsSopWatchStatus = response.data;
- });
- },
- methods: {
- /** 查询企业微信SOP 定时任务列表 */
- getList() {
- this.loading = true;
- listSopLogsCVOList(this.queryParams).then(response => {
- this.qwSopLogsList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- /**
- * 查看规则下的规则详情
- */
- selectSopLogsDetails(val){
- this.queryParams.sopId= val;
- this.getList();
- },
- handleClickX(tab, event) {
- this.queryParams.watchStatus=tab.name;
- this.handleQuery();
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- qwUserName: null,
- externalUserName: null,
- contentJson: null,
- watchStatus:null,
- sendStatus: null,
- sendTime: null,
- companyId: null,
- receivingStatus: null,
- msgId: null,
- sopId: null
- };
- this.resetForm("form");
- },
- openImageViewer(url) {
- // 打开大图预览对话框
- this.dialogImageUrl=url
- this.dialogVisible = true;
- },
- //查看发送的消息体
- showContentDialog(contentJson) {
- this.contentDialog.selectedContentJson = JSON.parse(contentJson);
- this.contentDialog.isDialogVisible = true;
- },
- /** 搜索按钮操作 */
- 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
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$confirm('是否确认删除自动打标签的日志编号为"' + ids + '"的数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return delAutoTagsLogs(ids);
- }).then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- }).catch(() => {});
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$confirm('是否确认导出所有企业微信SOP 定时任务数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.exportLoading = true;
- return exportSopLogs(queryParams);
- }).then(response => {
- this.download(response.msg);
- this.exportLoading = false;
- }).catch(() => {});
- }
- }
- };
- </script>
|