sopUserLogsSchedule.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <div class="app-container">
  3. <div style="margin-bottom: 10px">
  4. <el-card>
  5. <span class="custom-style" style="display: block; margin-bottom: 10px">SOP规则名称:{{sopName}}</span>
  6. <span class="custom-style" style="display: block; margin-bottom: 10px">SOP规则编号:{{queryParams.sopId}}</span>
  7. <span class="custom-style" style="display: block;">模板编号:{{tempId}}</span>
  8. </el-card>
  9. </div>
  10. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  11. <el-form-item label="企微员工账号" prop="qwUserId">
  12. <el-input
  13. v-model="queryParams.qwUserId"
  14. placeholder="请输入企微员工账号"
  15. clearable
  16. size="small"
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="营期时间" prop="startTime">
  21. <el-date-picker clearable size="small"
  22. v-model="queryParams.startTime"
  23. type="date"
  24. value-format="yyyy-MM-dd"
  25. placeholder="选择营期时间">
  26. </el-date-picker>
  27. </el-form-item>
  28. <el-form-item label="状态" prop="status">
  29. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
  30. <el-option
  31. v-for="dict in sopUserLogsDelStatus"
  32. :key="dict.dictValue"
  33. :label="dict.dictLabel"
  34. :value="dict.dictValue"
  35. />
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="客户名称" prop="externalUserName">
  39. <el-input
  40. v-model="queryParams.externalUserName"
  41. placeholder="请输入客户名称"
  42. clearable
  43. size="small"
  44. @keyup.enter.native="handleQuery"
  45. />
  46. </el-form-item>
  47. <el-form-item>
  48. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  49. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  50. </el-form-item>
  51. </el-form>
  52. <el-row :gutter="10" class="mb8">
  53. <el-col :span="1.5">
  54. <el-button
  55. type="warning"
  56. icon="el-icon-s-promotion"
  57. size="medium"
  58. :disabled="multiple"
  59. @click="handleCampSendMsg"
  60. v-if="filterMode == 1"
  61. v-hasPermi="['qw:sopUserLogsInfo:msg']"
  62. >营期一键群发</el-button>
  63. </el-col>
  64. </el-row>
  65. <el-table border v-loading="loading" :data="sopUserLogsList" @selection-change="handleSelectionChange">
  66. <el-table-column type="selection" width="55" align="center" />
  67. <el-table-column label="营期编号" align="center" prop="id" />
  68. <!-- <el-table-column label="模板编号" align="center" prop="sopTempId" />-->
  69. <el-table-column label="企微员工账号" align="center" prop="qwUserId" />
  70. <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
  71. <el-table-column label="群聊" align="center" prop="chatName" v-if="filterMode == 2" />
  72. <el-table-column label="营期时间" align="center" prop="startTime" width="180">
  73. <template slot-scope="scope">
  74. <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="天数" align="center" prop="countDays" />
  78. <el-table-column label="状态" align="center" prop="status" >
  79. <template slot-scope="scope">
  80. <div v-if="scope.row.userId && scope.row.userId.includes('null')">
  81. <span style="color: orange;">营期异常</span>
  82. </div>
  83. <div v-else>
  84. <dict-tag :options="sopUserLogsDelStatus" :value="scope.row.status"/>
  85. </div>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  89. <template slot-scope="scope">
  90. <el-button
  91. v-if="scope.row.status ==1"
  92. size="mini"
  93. type="text"
  94. icon="el-icon-edit"
  95. @click="handleSelect(scope.row)"
  96. v-hasPermi="['qw:sop:list']"
  97. >营期详情</el-button>
  98. <el-button
  99. v-if="scope.row.userId && scope.row.userId.includes('null')"
  100. size="mini"
  101. type="text"
  102. icon="el-icon-s-check"
  103. @click="handleRepairLogs(scope.row)"
  104. v-hasPermi="['qw:sop:list']"
  105. >修复营期</el-button>
  106. <!-- <el-button-->
  107. <!-- size="mini"-->
  108. <!-- type="text"-->
  109. <!-- icon="el-icon-edit"-->
  110. <!-- @click="handleTemp(scope.row)"-->
  111. <!-- >新建群发任务</el-button>-->
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. <pagination
  116. v-show="total>0"
  117. :total="total"
  118. :page.sync="queryParams.pageNum"
  119. :limit.sync="queryParams.pageSize"
  120. @pagination="getList"
  121. />
  122. <!-- 执行详情 -->
  123. <el-drawer :title="logsInfoDetailsOpen.title" :visible.sync="logsInfoDetailsOpen.open" size="70%" style="font-weight: bolder">
  124. <sop-user-logs-info-details ref="SopUserLogsInfoDetails" :rowDetailFrom="logsInfoDetailsOpen.item" @flashNotify="flashNotify"></sop-user-logs-info-details>
  125. </el-drawer>
  126. <send-msg-open-tool ref="sendMsgOpenTool" ></send-msg-open-tool>
  127. </div>
  128. </template>
  129. <script>
  130. import {
  131. listSopUserLogs,
  132. getSopUserLogs,
  133. delSopUserLogs,
  134. addSopUserLogs,
  135. updateSopUserLogs,
  136. exportSopUserLogs,
  137. repairSopUserLogs
  138. } from "@/api/qw/sopUserLogs";
  139. import sopLogsDetails from "@/views/qw/sopLogs/sopLogsList.vue";
  140. import SopUserLogsInfoDetails from "@/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue";
  141. import {syncMyExternalContact} from "@/api/qw/externalContact";
  142. import SendMsgOpenTool from "@/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue";
  143. export default {
  144. name: "sopUserLogsSchedule",
  145. components: {SendMsgOpenTool, SopUserLogsInfoDetails, sopLogsDetails},
  146. props:{
  147. rowDetailFrom:{},
  148. },
  149. data() {
  150. return {
  151. sopUserLogId:null,
  152. sopName:'',
  153. tempId:'',
  154. // 遮罩层
  155. loading: true,
  156. // 导出遮罩层
  157. exportLoading: false,
  158. // 选中数组
  159. ids: [],
  160. statusOptions: [],
  161. // 非单个禁用
  162. single: true,
  163. // 非多个禁用
  164. multiple: true,
  165. // 显示搜索条件
  166. showSearch: true,
  167. // 总条数
  168. total: 0,
  169. logsInfoDetailsOpen:{
  170. title:"",
  171. open:false,
  172. },
  173. sysQwSopAiContentType:[],
  174. // sopUserLogs表格数据
  175. sopUserLogsList: [],
  176. sopUserLogsDelStatus:[],
  177. // 弹出层标题
  178. title: "",
  179. filterMode: 1,
  180. // 是否显示弹出层
  181. open: false,
  182. // 查询参数
  183. queryParams: {
  184. pageNum: 1,
  185. pageSize: 10,
  186. sopId: null,
  187. userLogsId:null,
  188. externalUserName:null,
  189. sopTempId: null,
  190. qwUserId: null,
  191. corpId: null,
  192. startTime: null,
  193. status: null,
  194. userId: null
  195. },
  196. setting:[],
  197. // 表单参数
  198. form: {},
  199. tempForm: {
  200. setting:null,
  201. videoIdSet:null,
  202. courseIdSet:null,
  203. },
  204. // 表单校验
  205. rules: {
  206. }
  207. };
  208. },
  209. created() {
  210. this.getDicts("sys_company_status").then(response => {
  211. this.statusOptions = response.data;
  212. });
  213. this.getDicts("sop_user_logs_del_status").then(response => {
  214. this.sopUserLogsDelStatus = response.data;
  215. });
  216. this.getDicts("sys_qwSopAi_contentType").then(response => {
  217. this.sysQwSopAiContentType = response.data;
  218. });
  219. this.queryParams.sopId = this.$route.params.id;
  220. this.filterMode = this.$route.query.filterMode;
  221. this.sopName = this.$route.query.name;
  222. this.tempId = this.$route.query.tempId;
  223. this.queryParams.corpId= this.$route.query.corpId;
  224. this.getList()
  225. },
  226. methods: {
  227. /** 查询sopUserLogs列表 */
  228. getList() {
  229. this.loading = true;
  230. listSopUserLogs(this.queryParams).then(response => {
  231. this.sopUserLogsList = response.rows;
  232. this.total = response.total;
  233. this.loading = false;
  234. });
  235. },
  236. /**
  237. * 营期一键群发
  238. */
  239. handleCampSendMsg(){
  240. setTimeout(() => {
  241. this.$refs.sendMsgOpenTool.oneClickGroupSending(this.ids,2,this.queryParams.corpId);
  242. }, 500);
  243. },
  244. // 取消按钮
  245. cancel() {
  246. this.open = false;
  247. this.reset();
  248. },
  249. addSetList(){
  250. const newSetting = {
  251. contentType:'1',
  252. value: '',
  253. };
  254. // 将新设置项添加到 content.setting 数组中
  255. this.setting.push(newSetting);
  256. },
  257. // 表单重置
  258. reset() {
  259. this.form = {
  260. id: null,
  261. sopId: null,
  262. sopTempId: null,
  263. qwUserId: null,
  264. corpId: null,
  265. startTime: null,
  266. status: 0,
  267. userId: null
  268. };
  269. this.resetForm("form");
  270. },
  271. /** 搜索按钮操作 */
  272. handleQuery() {
  273. this.queryParams.pageNum = 1;
  274. this.getList();
  275. },
  276. /** 重置按钮操作 */
  277. resetQuery() {
  278. this.resetForm("queryForm");
  279. this.handleQuery();
  280. },
  281. flashNotify(){
  282. this.getList();
  283. },
  284. // 多选框选中数据
  285. handleSelectionChange(selection) {
  286. this.ids = selection.map(item => item.id)
  287. this.single = selection.length!==1
  288. this.multiple = !selection.length
  289. },
  290. handleSelect(val){
  291. val.filterMode = this.filterMode;
  292. this.logsInfoDetailsOpen.title='企微账号:'+val.qwUserId+' '+'营期时间:'+val.startTime+' '+'天数:' + val.countDays;
  293. this.logsInfoDetailsOpen.open=true;
  294. const externalUserName = this.queryParams.externalUserName;
  295. setTimeout(() => {
  296. this.$refs.SopUserLogsInfoDetails.selectSopUserLogsInfo(val,externalUserName);
  297. }, 500);
  298. },
  299. handleRepairLogs(val){
  300. this.loading=true;
  301. let loadingRock = this.$loading({
  302. lock: true,
  303. text: '正在修复中请稍后~~!!',
  304. spinner: 'el-icon-loading',
  305. background: 'rgba(0, 0, 0, 0.7)'
  306. });
  307. repairSopUserLogs(val).then(res => {
  308. this.msgSuccess("修复成功成功");
  309. }).catch(res=>{
  310. }).finally(res=>{
  311. loadingRock.close();
  312. this.loading=false;
  313. this.getList();
  314. })
  315. },
  316. /** 导出按钮操作 */
  317. handleExport() {
  318. const queryParams = this.queryParams;
  319. this.$confirm('是否确认导出所有sopUserLogs数据项?', "警告", {
  320. confirmButtonText: "确定",
  321. cancelButtonText: "取消",
  322. type: "warning"
  323. }).then(() => {
  324. this.exportLoading = true;
  325. return exportSopUserLogs(queryParams);
  326. }).then(response => {
  327. this.download(response.msg);
  328. this.exportLoading = false;
  329. }).catch(() => {});
  330. }
  331. }
  332. };
  333. </script>
  334. <style>
  335. .custom-style {
  336. font-weight: bold; /* 加粗 */
  337. }
  338. </style>