sopLogsList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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. <el-col :span="1.5">
  60. <el-button
  61. type="danger"
  62. plain
  63. icon="el-icon-delete"
  64. size="mini"
  65. :disabled="multiple"
  66. @click="handleDelete"
  67. v-hasPermi="['qw:autoTagsLogs:remove']"
  68. >删除</el-button>
  69. </el-col>
  70. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  71. </el-row>
  72. <el-tabs type="card" v-model="defaultWatchStatus" @tab-click="handleClickX">
  73. <el-tab-pane v-for="(item,index) in sysFsSopWatchStatus" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  74. </el-tabs>
  75. <el-table v-loading="loading" :data="qwSopLogsList" @selection-change="handleSelectionChange">
  76. <el-table-column type="selection" width="55" align="center" />
  77. <el-table-column label="企微成员昵称" align="center" prop="qwUserName" />
  78. <el-table-column label="系统后台昵称" align="center" prop="userName" />
  79. <el-table-column label="客户昵称" align="center" prop="externalUserName" />
  80. <el-table-column label="观看状态" align="center" prop="watchStatus">
  81. <template slot-scope="scope">
  82. <dict-tag :options="sysFsSopWatchStatus" :value="scope.row.watchStatus"/>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="发送的消息" align="center" prop="contentJson" >
  86. <template slot-scope="scope">
  87. <el-button type="text" @click="showContentDialog(scope.row.contentJson)">
  88. 查看详情
  89. </el-button>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="成员状态" align="center" prop="sendStatus" >
  93. <template slot-scope="scope">
  94. <dict-tag :options="sysQwSopLogsStatus" :value="scope.row.sendStatus"/>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="预计发送时间" align="center" prop="sendTime" width="180"/>
  98. <el-table-column label="客户接收" align="center" prop="receivingStatus" >
  99. <template slot-scope="scope">
  100. <dict-tag :options="groupMsgSendStatusOptions" :value="scope.row.receivingStatus"/>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. <el-dialog :visible.sync="contentDialog.isDialogVisible" title="消息详情" width="30%" append-to-body>
  105. <el-card v-for="(item, index) in contentDialog.selectedContentJson" :key="index" class="box-card" style="margin-top: 2%">
  106. <div slot="header" class="clearfix">
  107. <span>消息{{index}}:</span>
  108. </div>
  109. <div v-html="item.value"></div>
  110. <el-link v-if="item.isBindUrl == 1" :href="item.url" target="_blank">{{ item.url }}</el-link>
  111. </el-card>
  112. <span slot="footer" class="dialog-footer">
  113. <el-button @click="contentDialog.isDialogVisible = false">关闭</el-button>
  114. </span>
  115. </el-dialog>
  116. <!-- 大图预览对话框 -->
  117. <el-dialog
  118. :visible.sync="dialogVisible"
  119. :modal="false"
  120. width="500"
  121. append-to-body>
  122. <img
  123. :src="this.dialogImageUrl"
  124. style="display: block; max-width: 100%; margin: 0 auto"
  125. />
  126. </el-dialog>
  127. <pagination
  128. v-show="total>0"
  129. :total="total"
  130. :page.sync="queryParams.pageNum"
  131. :limit.sync="queryParams.pageSize"
  132. @pagination="getList"
  133. />
  134. </div>
  135. </template>
  136. <script>
  137. import { exportSopLogs, listSopLogsCVOList } from '@/api/course/sopLogs'
  138. import { delAutoTagsLogs } from '@/api/qw/autoTagsLogs'
  139. export default {
  140. name: "sopLogsList",
  141. data() {
  142. return {
  143. //图片放大
  144. dialogVisible: false,
  145. dialogImageUrl:null,
  146. //默认规则
  147. defaultWatchStatus:"0",
  148. // 遮罩层
  149. loading: true,
  150. // 导出遮罩层
  151. exportLoading: false,
  152. // 选中数组
  153. ids: [],
  154. // 非单个禁用
  155. single: true,
  156. // 非多个禁用
  157. multiple: true,
  158. // 显示搜索条件
  159. showSearch: true,
  160. // 总条数
  161. total: 0,
  162. // 企业微信SOP 定时任务表格数据
  163. qwSopLogsList: [],
  164. //成员状态
  165. sysQwSopLogsStatus:[],
  166. //客户接收状态
  167. groupMsgSendStatusOptions:[],
  168. //SOP课程观看状态
  169. sysFsSopWatchStatus:[],
  170. //发送的消息
  171. contentDialog:{
  172. isDialogVisible:false,
  173. selectedContentJson: [],
  174. },
  175. // 弹出层标题
  176. title: "",
  177. // 是否显示弹出层
  178. open: false,
  179. // 查询参数
  180. queryParams: {
  181. pageNum: 1,
  182. pageSize: 10,
  183. qwUserName: null,
  184. externalUserName: null,
  185. sendStatus: null,
  186. sendTime: null,
  187. receivingStatus: null,
  188. watchStatus:0,
  189. },
  190. // 表单参数
  191. form: {},
  192. // 表单校验
  193. rules: {
  194. }
  195. };
  196. },
  197. created() {
  198. this.getList();
  199. //成员状态
  200. this.getDicts("sys_qw_sopLogs_status").then(response => {
  201. this.sysQwSopLogsStatus = response.data;
  202. });
  203. //客户接收状态
  204. this.getDicts("sys_qw_groupMsg_SendStatus").then(response => {
  205. this.groupMsgSendStatusOptions = response.data;
  206. });
  207. //客户观看状态
  208. this.getDicts("sys_fs_sop_watch_status").then(response => {
  209. this.sysFsSopWatchStatus = response.data;
  210. });
  211. },
  212. methods: {
  213. /** 查询企业微信SOP 定时任务列表 */
  214. getList() {
  215. this.loading = true;
  216. listSopLogsCVOList(this.queryParams).then(response => {
  217. this.qwSopLogsList = response.rows;
  218. this.total = response.total;
  219. this.loading = false;
  220. });
  221. },
  222. /**
  223. * 查看规则下的规则详情
  224. */
  225. selectSopLogsDetails(val){
  226. this.queryParams.sopId= val;
  227. this.getList();
  228. },
  229. handleClickX(tab, event) {
  230. this.queryParams.watchStatus=tab.name;
  231. this.handleQuery();
  232. },
  233. // 取消按钮
  234. cancel() {
  235. this.open = false;
  236. this.reset();
  237. },
  238. // 表单重置
  239. reset() {
  240. this.form = {
  241. id: null,
  242. qwUserName: null,
  243. externalUserName: null,
  244. contentJson: null,
  245. watchStatus:null,
  246. sendStatus: null,
  247. sendTime: null,
  248. companyId: null,
  249. receivingStatus: null,
  250. msgId: null,
  251. sopId: null
  252. };
  253. this.resetForm("form");
  254. },
  255. openImageViewer(url) {
  256. // 打开大图预览对话框
  257. this.dialogImageUrl=url
  258. this.dialogVisible = true;
  259. },
  260. //查看发送的消息体
  261. showContentDialog(contentJson) {
  262. this.contentDialog.selectedContentJson = JSON.parse(contentJson);
  263. this.contentDialog.isDialogVisible = true;
  264. },
  265. /** 搜索按钮操作 */
  266. handleQuery() {
  267. this.queryParams.pageNum = 1;
  268. this.getList();
  269. },
  270. /** 重置按钮操作 */
  271. resetQuery() {
  272. this.resetForm("queryForm");
  273. this.handleQuery();
  274. },
  275. // 多选框选中数据
  276. handleSelectionChange(selection) {
  277. this.ids = selection.map(item => item.id)
  278. this.single = selection.length!==1
  279. this.multiple = !selection.length
  280. },
  281. /** 删除按钮操作 */
  282. handleDelete(row) {
  283. const ids = row.id || this.ids;
  284. this.$confirm('是否确认删除自动打标签的日志编号为"' + ids + '"的数据项?', "警告", {
  285. confirmButtonText: "确定",
  286. cancelButtonText: "取消",
  287. type: "warning"
  288. }).then(function() {
  289. return delAutoTagsLogs(ids);
  290. }).then(() => {
  291. this.getList();
  292. this.msgSuccess("删除成功");
  293. }).catch(() => {});
  294. },
  295. /** 导出按钮操作 */
  296. handleExport() {
  297. const queryParams = this.queryParams;
  298. this.$confirm('是否确认导出所有企业微信SOP 定时任务数据项?', "警告", {
  299. confirmButtonText: "确定",
  300. cancelButtonText: "取消",
  301. type: "warning"
  302. }).then(() => {
  303. this.exportLoading = true;
  304. return exportSopLogs(queryParams);
  305. }).then(response => {
  306. this.download(response.msg);
  307. this.exportLoading = false;
  308. }).catch(() => {});
  309. }
  310. }
  311. };
  312. </script>