sopLogsList.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
  4. <el-form-item label="企微员工昵称" prop="qwUserName">
  5. <el-input
  6. v-model="queryParams.qwUserName"
  7. placeholder="请输入企微员工昵称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="客户昵称" prop="externalUserName">
  14. <el-input
  15. v-model="queryParams.externalUserName"
  16. placeholder="请输入企微客户昵称"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="发送(成员)状态" prop="sendStatus">
  23. <el-select v-model="queryParams.sendStatus" placeholder="请选择发送(成员)状态" clearable size="small">
  24. <el-option
  25. v-for="dict in sysQwSopLogsStatus"
  26. :key="dict.dictValue"
  27. :label="dict.dictLabel"
  28. :value="dict.dictValue"
  29. />
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="接收(客户)状态" prop="receivingStatus">
  33. <el-select v-model="queryParams.receivingStatus" placeholder="请选择接收(客户)状态" clearable size="small">
  34. <el-option
  35. v-for="dict in groupMsgSendStatusOptions"
  36. :key="dict.dictValue"
  37. :label="dict.dictLabel"
  38. :value="dict.dictValue"
  39. />
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item>
  43. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  44. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  45. </el-form-item>
  46. </el-form>
  47. <el-row :gutter="10" class="mb8">
  48. <el-col :span="1.5">
  49. <el-button
  50. type="warning"
  51. plain
  52. icon="el-icon-download"
  53. size="mini"
  54. :loading="exportLoading"
  55. @click="handleExport"
  56. v-hasPermi="['course:sopLogs:export']"
  57. >导出</el-button>
  58. </el-col>
  59. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  60. </el-row>
  61. <el-tabs type="card" v-model="defaultWatchStatus" @tab-click="handleClickX">
  62. <el-tab-pane v-for="(item,index) in sysFsSopWatchStatus" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  63. </el-tabs>
  64. <el-table v-loading="loading" :data="qwSopLogsList">
  65. <el-table-column label="企微成员昵称" align="center" prop="qwUserName" />
  66. <el-table-column label="系统后台昵称" align="center" prop="userName" />
  67. <el-table-column label="客户昵称" align="center" prop="externalUserName" />
  68. <el-table-column label="观看状态" align="center" prop="watchStatus">
  69. <template slot-scope="scope">
  70. <dict-tag :options="sysFsSopWatchStatus" :value="scope.row.watchStatus"/>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="发送的消息" align="center" prop="contentJson" >
  74. <template slot-scope="scope">
  75. <el-button type="text" @click="showContentDialog(scope.row.contentJson)">
  76. 查看详情
  77. </el-button>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="成员状态" align="center" prop="sendStatus" >
  81. <template slot-scope="scope">
  82. <dict-tag :options="sysQwSopLogsStatus" :value="scope.row.sendStatus"/>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="预计发送时间" align="center" prop="sendTime" width="180"/>
  86. <el-table-column label="客户接收" align="center" prop="receivingStatus" >
  87. <template slot-scope="scope">
  88. <dict-tag :options="groupMsgSendStatusOptions" :value="scope.row.receivingStatus"/>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <el-dialog :visible.sync="contentDialog.isDialogVisible" title="消息详情" width="30%" append-to-body>
  93. <el-card v-for="(item, index) in contentDialog.selectedContentJson" :key="index" class="box-card" style="margin-top: 2%">
  94. <div slot="header" class="clearfix">
  95. <span>消息{{index}}:</span>
  96. </div>
  97. <div v-html="$safeHtml(item.value)"></div>
  98. </el-card>
  99. <span slot="footer" class="dialog-footer">
  100. <el-button @click="contentDialog.isDialogVisible = false">关闭</el-button>
  101. </span>
  102. </el-dialog>
  103. <!-- 大图预览对话框 -->
  104. <el-dialog
  105. :visible.sync="dialogVisible"
  106. :modal="false"
  107. width="500"
  108. append-to-body>
  109. <img
  110. :src="this.dialogImageUrl"
  111. style="display: block; max-width: 100%; margin: 0 auto"
  112. />
  113. </el-dialog>
  114. <pagination
  115. v-show="total>0"
  116. :total="total"
  117. :page.sync="queryParams.pageNum"
  118. :limit.sync="queryParams.pageSize"
  119. @pagination="getList"
  120. />
  121. </div>
  122. </template>
  123. <script>
  124. import { listSopLogs } from '@/api/course/sopLogs'
  125. export default {
  126. name: "sopLogsList",
  127. data() {
  128. return {
  129. //图片放大
  130. dialogVisible: false,
  131. dialogImageUrl:null,
  132. //默认规则
  133. defaultWatchStatus:"0",
  134. // 遮罩层
  135. loading: true,
  136. // 导出遮罩层
  137. exportLoading: false,
  138. // 选中数组
  139. ids: [],
  140. // 非单个禁用
  141. single: true,
  142. // 非多个禁用
  143. multiple: true,
  144. // 显示搜索条件
  145. showSearch: true,
  146. // 总条数
  147. total: 0,
  148. // 企业微信SOP 定时任务表格数据
  149. qwSopLogsList: [],
  150. //成员状态
  151. sysQwSopLogsStatus:[],
  152. //客户接收状态
  153. groupMsgSendStatusOptions:[],
  154. //SOP课程观看状态
  155. sysFsSopWatchStatus:[],
  156. //发送的消息
  157. contentDialog:{
  158. isDialogVisible:false,
  159. selectedContentJson: [],
  160. },
  161. // 弹出层标题
  162. title: "",
  163. // 是否显示弹出层
  164. open: false,
  165. // 查询参数
  166. queryParams: {
  167. pageNum: 1,
  168. pageSize: 10,
  169. qwUserName: null,
  170. externalUserName: null,
  171. sendStatus: null,
  172. sendTime: null,
  173. receivingStatus: null,
  174. watchStatus:null,
  175. },
  176. // 表单参数
  177. form: {},
  178. // 表单校验
  179. rules: {
  180. }
  181. };
  182. },
  183. created() {
  184. this.getList();
  185. //成员状态
  186. this.getDicts("sys_qw_sopLogs_status").then(response => {
  187. this.sysQwSopLogsStatus = response.data;
  188. });
  189. //客户接收状态
  190. this.getDicts("sys_qw_groupMsg_SendStatus").then(response => {
  191. this.groupMsgSendStatusOptions = response.data;
  192. });
  193. //客户观看状态
  194. this.getDicts("sys_fs_sop_watch_status").then(response => {
  195. this.sysFsSopWatchStatus = response.data;
  196. });
  197. },
  198. methods: {
  199. /** 查询企业微信SOP 定时任务列表 */
  200. getList() {
  201. this.loading = true;
  202. listSopLogs(this.queryParams).then(response => {
  203. this.qwSopLogsList = response.rows;
  204. this.total = response.total;
  205. this.loading = false;
  206. });
  207. },
  208. /**
  209. * 查看规则下的规则详情
  210. */
  211. selectSopLogsDetails(val){
  212. this.queryParams.sopId= val;
  213. this.getList();
  214. },
  215. handleClickX(tab, event) {
  216. this.queryParams.watchStatus=tab.name;
  217. this.handleQuery();
  218. },
  219. // 取消按钮
  220. cancel() {
  221. this.open = false;
  222. this.reset();
  223. },
  224. // 表单重置
  225. reset() {
  226. this.form = {
  227. id: null,
  228. qwUserName: null,
  229. externalUserName: null,
  230. contentJson: null,
  231. watchStatus:null,
  232. sendStatus: null,
  233. sendTime: null,
  234. companyId: null,
  235. receivingStatus: null,
  236. msgId: null,
  237. sopId: null
  238. };
  239. this.resetForm("form");
  240. },
  241. openImageViewer(url) {
  242. // 打开大图预览对话框
  243. this.dialogImageUrl=url
  244. this.dialogVisible = true;
  245. },
  246. //查看发送的消息体
  247. showContentDialog(contentJson) {
  248. this.contentDialog.selectedContentJson = JSON.parse(contentJson);
  249. this.contentDialog.isDialogVisible = true;
  250. },
  251. /** 搜索按钮操作 */
  252. handleQuery() {
  253. this.queryParams.pageNum = 1;
  254. this.getList();
  255. },
  256. /** 重置按钮操作 */
  257. resetQuery() {
  258. this.resetForm("queryForm");
  259. this.handleQuery();
  260. },
  261. /** 导出按钮操作 */
  262. handleExport() {
  263. const queryParams = this.queryParams;
  264. this.$confirm('是否确认导出所有企业微信SOP 定时任务数据项?', "警告", {
  265. confirmButtonText: "确定",
  266. cancelButtonText: "取消",
  267. type: "warning"
  268. }).then(() => {
  269. this.exportLoading = true;
  270. return exportQwSopLogs(queryParams);
  271. }).then(response => {
  272. this.download(response.msg);
  273. this.exportLoading = false;
  274. }).catch(() => {});
  275. }
  276. }
  277. };
  278. </script>