watchLog.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="看课方式" prop="sendType">
  5. <el-select v-model="queryParams.sendType" placeholder="选择看课方式" clearable size="small" @change="handleSendTypeChange">
  6. <el-option
  7. v-for="dict in sendTypeOptions"
  8. :key="dict.dictValue"
  9. :label="dict.dictLabel"
  10. :value="dict.dictValue"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <!-- <el-form-item label="项目" prop="project">-->
  15. <!-- <el-select v-model="queryParams.project" placeholder="请选择项目" clearable size="small" >-->
  16. <!-- <el-option-->
  17. <!-- v-for="item in projectOptions"-->
  18. <!-- :key="item.dictValue"-->
  19. <!-- :label="item.dictLabel"-->
  20. <!-- :value="item.dictValue"-->
  21. <!-- />-->
  22. <!-- </el-select>-->
  23. <!-- </el-form-item>-->
  24. <el-form-item label="企微账号" prop="qwUserId" v-if="queryParams.sendType == 2">
  25. <el-select v-model="queryParams.qwUserId" placeholder="企微账号" clearable size="small"
  26. @change="updateQwuser()">
  27. <el-option
  28. v-for="dict in myQwUserList"
  29. :key="dict.dictValue"
  30. :label="dict.dictLabel + '('+dict.corpName+')'"
  31. :value="dict.dictValue"
  32. />
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item label="客户ID" prop="qwExternalContactId" v-if="queryParams.sendType == 2">
  36. <el-input
  37. v-model="queryParams.qwExternalContactId"
  38. placeholder="请输入客户ID"
  39. clearable
  40. size="small"
  41. @keyup.enter.native="handleQuery"
  42. />
  43. </el-form-item>
  44. <el-form-item label="会员ID" prop="userId" v-if="queryParams.sendType == 1">
  45. <el-input
  46. v-model="queryParams.userId"
  47. placeholder="请输入会员ID"
  48. clearable
  49. size="small"
  50. @keyup.enter.native="handleQuery"
  51. />
  52. </el-form-item>
  53. <el-form-item label="会员昵称" prop="nickName" v-if="queryParams.sendType == 1">
  54. <el-input
  55. v-model="queryParams.nickName"
  56. placeholder="请输入会员昵称"
  57. clearable
  58. size="small"
  59. @keyup.enter.native="handleQuery"
  60. />
  61. </el-form-item>
  62. <el-form-item label="企微客户昵称" prop="nickName" v-if="queryParams.sendType == 2">
  63. <el-input
  64. v-model="queryParams.externalUserName"
  65. placeholder="请输入企微客户昵称"
  66. clearable
  67. size="small"
  68. @keyup.enter.native="handleQuery"
  69. />
  70. </el-form-item>
  71. <el-form-item label="课程" prop="courseId">
  72. <el-select filterable v-model="queryParams.courseId" placeholder="请选择课程" clearable size="small"
  73. @change="courseChange(queryParams.courseId)">
  74. <el-option
  75. v-for="dict in courseLists"
  76. :key="dict.dictValue"
  77. :label="dict.dictLabel"
  78. :value="dict.dictValue"
  79. />
  80. </el-select>
  81. </el-form-item>
  82. <el-form-item label="小节" prop="videoId">
  83. <el-select filterable v-model="queryParams.videoId" placeholder="请选择小节" clearable size="small">
  84. <el-option
  85. v-for="dict in videoList"
  86. :key="dict.dictValue"
  87. :label="dict.dictLabel"
  88. :value="dict.dictValue"
  89. />
  90. </el-select>
  91. </el-form-item>
  92. <!-- sop名称 -->
  93. <el-form-item label="SOP名称" prop="sopId" v-if="queryParams.sendType == 2">
  94. <el-autocomplete
  95. v-model="sopSearchText"
  96. :fetch-suggestions="querySopAsync"
  97. placeholder="请输入SOP名称"
  98. clearable
  99. size="small"
  100. style="width: 200px"
  101. @select="handleSopSelect"
  102. @clear="handleSopClear"
  103. :trigger-on-focus="false"
  104. >
  105. <template slot-scope="{ item }">
  106. <div class="sop-item">
  107. <span class="sop-name">{{ item.name }}</span>
  108. </div>
  109. </template>
  110. </el-autocomplete>
  111. </el-form-item>
  112. <!-- 营期时间 -->
  113. <!-- <el-form-item label="营期时间" prop="scheduleTime">
  114. <el-input
  115. v-model="scheduleTimeText"
  116. placeholder="请选择营期时间"
  117. readonly
  118. @click.native="showScheduleCalendar = true"
  119. />
  120. <calendar
  121. v-model="scheduleTime"
  122. mode="during"
  123. :show.sync="showScheduleCalendar"
  124. @change="handleScheduleTimeChange"
  125. :key="scheduleCalendarKey"
  126. />
  127. </el-form-item> -->
  128. <el-form-item label="营期时间" prop="scheduleTime">
  129. <el-date-picker
  130. v-model="scheduleTimeText"
  131. type="daterange"
  132. range-separator="至"
  133. start-placeholder="开始日期"
  134. end-placeholder="结束日期"
  135. value-format="yyyy-MM-dd"
  136. style="width: 240px"
  137. @change="handleScheduleTimeChange"
  138. />
  139. </el-form-item>
  140. <!-- 创建时间 -->
  141. <!-- <el-form-item label="创建时间" prop="createTime">
  142. <el-input
  143. v-model="createTimeText"
  144. placeholder="请选择创建时间"
  145. readonly
  146. @click.native="showCreateCalendar = true"
  147. />
  148. <calendar
  149. v-model="createTime"
  150. mode="during"
  151. :show.sync="showCreateCalendar"
  152. @change="createChange"
  153. :key="createCalendarKey"
  154. />
  155. </el-form-item> -->
  156. <el-form-item label="创建时间" prop="createTime">
  157. <el-date-picker
  158. v-model="createTimeText"
  159. type="datetimerange"
  160. range-separator="至"
  161. start-placeholder="开始日期"
  162. end-placeholder="结束日期"
  163. value-format="yyyy-MM-dd HH:mm:ss"
  164. @change="createChange"
  165. :default-time="['00:00:00', '23:59:59']"
  166. />
  167. </el-form-item>
  168. <!-- 最新更新时间 -->
  169. <!-- <el-form-item label="最新更新时间" prop="updateTime">
  170. <el-input
  171. v-model="updateTimeText"
  172. placeholder="请选择更新时间"
  173. readonly
  174. @click.native="showUpdateCalendar = true"
  175. />
  176. <calendar
  177. v-model="updateTime"
  178. mode="during"
  179. :show.sync="showUpdateCalendar"
  180. @change="updateChange"
  181. :key="updateCalendarKey"
  182. />
  183. </el-form-item> -->
  184. <el-form-item label="最新更新时间" prop="updateTime">
  185. <el-date-picker
  186. v-model="updateTimeText"
  187. type="daterange"
  188. range-separator="至"
  189. start-placeholder="开始日期"
  190. end-placeholder="结束日期"
  191. value-format="yyyy-MM-dd"
  192. style="width: 240px"
  193. @change="updateChange"
  194. />
  195. </el-form-item>
  196. <!-- 进线时间 -->
  197. <!-- <el-form-item label="进线时间" prop="qecCreateTime">
  198. <el-input
  199. v-model="qecCreateTimeText"
  200. placeholder="请选择进线时间"
  201. readonly
  202. @click.native="showQecCalendar = true"
  203. />
  204. <calendar
  205. v-model="qecCreateTime"
  206. mode="during"
  207. :show.sync="showQecCalendar"
  208. @change="qecCreateTimeChange"
  209. :key="qecCalendarKey"
  210. />
  211. </el-form-item> -->
  212. <el-form-item label="进线时间" prop="qecCreateTime">
  213. <el-date-picker
  214. v-model="qecCreateTimeText"
  215. type="daterange"
  216. range-separator="至"
  217. start-placeholder="开始日期"
  218. end-placeholder="结束日期"
  219. value-format="yyyy-MM-dd"
  220. style="width: 240px"
  221. @change="qecCreateTimeChange"
  222. />
  223. </el-form-item>
  224. <el-form-item label="营期课程时间" prop="periodTime" v-if="queryParams.sendType==1">
  225. <el-date-picker
  226. v-model="periodTimeText"
  227. type="datetimerange"
  228. align="right"
  229. unlink-panels
  230. value-format="yyyy-MM-dd HH:mm:ss"
  231. range-separator="至"
  232. start-placeholder="开始日期"
  233. end-placeholder="结束日期"
  234. :picker-options="pickerOptions"
  235. @change="qecPeriodTimeChange"
  236. :default-time="['00:00:00', '23:59:59']">
  237. </el-date-picker>
  238. </el-form-item>
  239. <!-- <el-form-item label="是否注册" prop="isVip">-->
  240. <!-- <el-select-->
  241. <!-- filterable-->
  242. <!-- v-model="queryParams.isVip"-->
  243. <!-- placeholder="请选择是否注册"-->
  244. <!-- clearable size="small">-->
  245. <!-- <el-option-->
  246. <!-- v-for="dict in isVipList"-->
  247. <!-- :key="dict.dictValue"-->
  248. <!-- :label="dict.dictLabel"-->
  249. <!-- :value="dict.dictValue"-->
  250. <!-- />-->
  251. <!-- </el-select>-->
  252. <!-- </el-form-item>-->
  253. <el-form-item>
  254. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  255. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  256. </el-form-item>
  257. </el-form>
  258. <el-row :gutter="10" class="mb8">
  259. <el-col :span="1.5">
  260. <el-button
  261. type="warning"
  262. plain
  263. icon="el-icon-download"
  264. size="mini"
  265. :loading="exportLoading"
  266. @click="handleExport"
  267. v-hasPermi="['course:courseWatchLog:myExport']"
  268. >导出
  269. </el-button>
  270. <el-col :span="1.5" v-if="queryParams.sendType == 2">
  271. <el-button
  272. type="primary"
  273. plain
  274. size="mini"
  275. @click="addUserTag"
  276. v-hasPermi="['qw:externalContact:addTag']"
  277. >批量添加标签</el-button>
  278. </el-col>
  279. <el-col :span="1.5" v-if="queryParams.sendType == 2">
  280. <el-button
  281. type="primary"
  282. plain
  283. size="mini"
  284. @click="delUserTag"
  285. v-hasPermi="['qw:externalContact:delTag']"
  286. >批量移除标签</el-button>
  287. </el-col>
  288. </el-col>
  289. <el-col :span="1.5">
  290. <el-button
  291. type="success"
  292. plain
  293. icon="el-icon-edit"
  294. size="mini"
  295. @click="handleBatchUpdateNotes"
  296. v-hasPermi="['qw:externalContact:edit']"
  297. >批量修改备注
  298. </el-button>
  299. </el-col>
  300. <el-col :span="1.5">
  301. <el-button
  302. type="success"
  303. plain
  304. icon="el-icon-edit"
  305. size="mini"
  306. @click="handleBatchUpdateNotesFilter"
  307. v-hasPermi="['qw:externalContact:edit']"
  308. >批量修改备注(筛选条件)
  309. </el-button>
  310. </el-col>
  311. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  312. </el-row>
  313. <el-tabs type="card" v-model="activeName" @tab-click="handleClickX">
  314. <el-tab-pane label="全部" name="00"></el-tab-pane>
  315. <el-tab-pane v-for="(item,index) in logTypeOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  316. </el-tabs>
  317. <!-- <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange">-->
  318. <el-table
  319. border
  320. v-loading="loading"
  321. :data="courseWatchLogList"
  322. @selection-change="handleSelectionChange"
  323. :key="tableKey">
  324. <el-table-column type="selection" width="55" align="center"/>
  325. <el-table-column label="记录编号" align="center" prop="logId"/>
  326. <el-table-column label="客户昵称" align="center" prop="externalUserName" v-if="queryParams.sendType == 2"/>
  327. &lt;!&ndash;
  328. <el-table-column label="会员ID" align="center" prop="userId" v-if="queryParams.sendType == 1"/>
  329. &ndash;&gt;
  330. <!-- <el-table-column label="客户头像" align="center" prop="externalUserAvatar" v-if="queryParams.sendType == 2">-->
  331. <!-- <template slot-scope="scope">-->
  332. <!-- <el-popover-->
  333. <!-- placement="right"-->
  334. <!-- title=""-->
  335. <!-- trigger="hover">-->
  336. <!-- <img slot="reference" :src="scope.row.externalUserAvatar" style="width: 50px;height: 50px">-->
  337. <!-- <img :src="scope.row.externalUserAvatar" style="max-width: 200px;max-height: 200px">-->
  338. <!-- </el-popover>-->
  339. <!-- </template>-->
  340. <!-- </el-table-column>-->
  341. <el-table-column label="头像" align="center">
  342. <template slot-scope="scope">
  343. <img
  344. v-if="queryParams.sendType == 1"
  345. :src="scope.row.fsAvatar"
  346. style="width:50px;height:50px"
  347. />
  348. <img
  349. v-else-if="queryParams.sendType == 2"
  350. :src="scope.row.externalUserAvatar"
  351. style="width:50px;height:50px"
  352. />
  353. </template>
  354. </el-table-column>
  355. <el-table-column label="用户昵称" align="center" v-if="queryParams.sendType == 1">
  356. <template slot-scope="scope">
  357. {{ queryParams.sendType=='1' ? scope.row.fsNickName : scope.row.externalUserName }}
  358. </template>
  359. </el-table-column>
  360. <el-table-column label="头像" align="center" v-if="queryParams.sendType == 1">
  361. <template slot-scope="scope">
  362. <img v-if="queryParams.sendType=='1'" :src="scope.row.fsAvatar" style="width:50px;height:50px" />
  363. <img v-else :src="scope.row.externalUserAvatar" style="width:50px;height:50px" />
  364. </template>
  365. </el-table-column>
  366. <el-table-column label="课程名称" align="center" prop="courseName"/>
  367. <el-table-column label="小节名称" align="center" prop="videoName"/>
  368. <el-table-column label="记录类型" align="center" prop="logType">
  369. <template slot-scope="scope">
  370. <dict-tag :options="logTypeOptions" :value="scope.row.logType"/>
  371. </template>
  372. </el-table-column>
  373. <el-table-column label="播放时长" align="center" prop="duration"/>
  374. <!-- <el-table-column label="所属销售" align="center" prop="companyUserName"/>-->
  375. <!-- <el-table-column label="所属公司" align="center" prop="companyName"/>-->
  376. <!-- <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>-->
  377. <!-- 所属企微列 -->
  378. <el-table-column
  379. label="所属企微"
  380. align="center"
  381. prop="qwUserName"
  382. v-if="queryParams.sendType == 2"
  383. />
  384. <!-- <el-table-column label="所属发送方式" align="center" prop="sendType"/>-->
  385. <el-table-column label="创建时间" align="center" prop="createTime" width="100px"/>
  386. <el-table-column label="更新时间" align="center" prop="updateTime" width="100px" />
  387. <el-table-column label="完课时间" align="center" prop="finishTime" width="100px" />
  388. <el-table-column label="营期时间" align="center" prop="campPeriodTime" />
  389. <el-table-column label="是否领奖" align="center" prop="rewardType" >
  390. <template slot-scope="scope">
  391. <el-tag
  392. :type="scope.row.rewardType ? 'success' : 'info'"
  393. effect="plain"
  394. >
  395. {{ scope.row.rewardType ? '已领取' : '未领取' }}
  396. </el-tag>
  397. </template>
  398. </el-table-column>
  399. <el-table-column
  400. fixed="right"
  401. label="操作"
  402. width="100">
  403. <template slot-scope="scope">
  404. <el-button @click="openAnswerLogFun(scope.row)" type="text" size="small">答题记录</el-button>
  405. <el-button @click="openRedLogFun(scope.row)" type="text" size="small">红包记录</el-button>
  406. </template>
  407. </el-table-column>
  408. </el-table>
  409. <pagination
  410. v-show="total>0"
  411. :total="total"
  412. :page.sync="queryParams.pageNum"
  413. :limit.sync="queryParams.pageSize"
  414. @pagination="getList"
  415. />
  416. <el-drawer title="答题记录" :visible.sync="openAnswerLog" size="70%" append-to-body>
  417. <el-table border v-loading="" :data="answerLogsList">
  418. <el-table-column label="会员用户" align="center" prop="userName">
  419. <template slot-scope="scope">
  420. <div style="display: flex;white-space: nowrap">
  421. <div style="margin: auto">
  422. {{ scope.row.userName }}
  423. </div>
  424. <el-popover
  425. placement="right"
  426. title=""
  427. trigger="hover">
  428. <img slot="reference" :src="scope.row.fsAvatar" style="width: 30px;height: 30px">
  429. <img :src="scope.row.fsAvatar" style="max-width: 200px;max-height: 200px">
  430. </el-popover>
  431. </div>
  432. </template>
  433. </el-table-column>
  434. <el-table-column label="课程名称" align="center" prop="courseName"/>
  435. <el-table-column label="小节名称" align="center" prop="videoName"/>
  436. <el-table-column label="是否全部正确" align="center" prop="isRight">
  437. <template slot-scope="scope">
  438. <dict-tag :options="sysCompanyOr" :value="scope.row.isRight"></dict-tag>
  439. </template>
  440. </el-table-column>
  441. <el-table-column label="销售名称" align="center" prop="companyUserName"/>
  442. <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>
  443. <el-table-column label="公司名称" align="center" prop="companyName"/>
  444. <el-table-column label="创建时间" align="center" prop="createTime"/>
  445. </el-table>
  446. <pagination
  447. v-show="answerLogTotal>0"
  448. :total="answerLogTotal"
  449. :page.sync="answerLogQueryParams.pageNum"
  450. :limit.sync="answerLogQueryParams.pageSize"
  451. @pagination="answerLogList"
  452. />
  453. </el-drawer>
  454. <el-drawer title="红包记录" :visible.sync="openRedLog" size="70%" append-to-body>
  455. <el-table border v-loading="" :data="redLogsList">
  456. <el-table-column type="selection" width="55" align="center" />
  457. <el-table-column label="记录编号" align="center" prop="logId" />
  458. <el-table-column label="批次单号" align="center" prop="outBatchNo" />
  459. <el-table-column label="课程名称" align="center" prop="courseId" >
  460. <template slot-scope="scope">
  461. <span prop="status" v-for="(item, index) in courseLists" v-if="scope.row.courseId==item.dictValue">{{item.dictLabel}}</span>
  462. </template>
  463. </el-table-column>
  464. <el-table-column label="小节名称" align="center" prop="title" />
  465. <!-- <el-table-column label="会员id" align="center" prop="userId" />-->
  466. <el-table-column label="会员用户" align="center" prop="fsNickName">
  467. <template slot-scope="scope">
  468. <div style="display: flex;white-space: nowrap">
  469. <div style="margin: auto">
  470. {{scope.row.fsNickName}}
  471. </div>
  472. <el-popover
  473. placement="right"
  474. title=""
  475. trigger="hover">
  476. <img slot="reference" :src="scope.row.fsAvatar" style="width: 30px;height: 30px">
  477. <img :src="scope.row.fsAvatar" style="max-width: 200px;max-height: 200px">
  478. </el-popover>
  479. </div>
  480. </template>
  481. </el-table-column>
  482. <!-- <el-table-column label="会员电话" align="center" prop="phone" />-->
  483. <!-- <el-table-column label="所属销售" align="center" prop="companyUserName" />-->
  484. <!-- <el-table-column label="所属公司" align="center" prop="companyName" />-->
  485. <el-table-column label="转账金额" align="center" prop="amount" />
  486. <el-table-column label="状态" align="center" prop="status" >
  487. <template slot-scope="scope">
  488. <el-tag>
  489. {{
  490. scope.row.status === 0 ? "发送中" :
  491. scope.row.status === 2 ? "待补发" :
  492. "已完成"
  493. }}
  494. </el-tag>
  495. </template>
  496. </el-table-column>
  497. <el-table-column label="所属企微" align="center" prop="qwUserName" />
  498. <el-table-column label="创建时间" align="center" prop="createTime" />
  499. </el-table>
  500. <pagination
  501. v-show="redLogTotal>0"
  502. :total="redLogTotal"
  503. :page.sync="redLogQueryParams.pageNum"
  504. :limit.sync="redLogQueryParams.pageSize"
  505. @pagination="redLogList"
  506. />
  507. </el-drawer>
  508. <el-dialog title="批量添加标签" :visible.sync="tagOpen" width="800px" append-to-body>
  509. <div>搜索标签:
  510. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  511. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  512. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  513. </div>
  514. <el-form ref="form" :model="addTagFormByWatch" label-width="80px">
  515. <div v-for="item in tagGroupList" :key="item.id" >
  516. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  517. <span class="name-background">{{ item.name }}</span>
  518. </div>
  519. <!-- 添加外层滚动容器 -->
  520. <div class="scroll-wrapper">
  521. <div class="tag-container">
  522. <a
  523. v-for="tagItem in item.tag"
  524. class="tag-box"
  525. @click="tagSelection(tagItem)"
  526. :class="{ 'tag-selected': tagItem.isSelected }"
  527. >
  528. {{ tagItem.name }}
  529. </a>
  530. </div>
  531. </div>
  532. </div>
  533. </el-form>
  534. <pagination
  535. v-show="tagTotal>0"
  536. :total="tagTotal"
  537. :page.sync="queryTagParams.pageNum"
  538. :limit.sync="queryTagParams.pageSize"
  539. @pagination="getPageListTagGroup"
  540. />
  541. <div slot="footer" class="dialog-footer">
  542. <el-button type="primary" @click="addTagSubmitForm()">确 定</el-button>
  543. <el-button @click="addTagCancel">取 消</el-button>
  544. </div>
  545. </el-dialog>
  546. <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
  547. <div>搜索标签:
  548. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  549. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  550. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  551. </div>
  552. <el-form ref="form" :model="addTagFormByWatch" label-width="80px">
  553. <div v-for="item in tagGroupList" :key="item.id" >
  554. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  555. <span class="name-background">{{ item.name }}</span>
  556. </div>
  557. <!-- 添加外层滚动容器 -->
  558. <div class="scroll-wrapper">
  559. <div class="tag-container">
  560. <a
  561. v-for="tagItem in item.tag"
  562. class="tag-box"
  563. @click="tagSelection(tagItem)"
  564. :class="{ 'tag-selected': tagItem.isSelected }"
  565. >
  566. {{ tagItem.name }}
  567. </a>
  568. </div>
  569. </div>
  570. </div>
  571. </el-form>
  572. <pagination
  573. v-show="tagTotal>0"
  574. :total="tagTotal"
  575. :page.sync="queryTagParams.pageNum"
  576. :limit.sync="queryTagParams.pageSize"
  577. @pagination="getPageListTagGroup"
  578. />
  579. <div slot="footer" class="dialog-footer">
  580. <el-button type="primary" @click="tagDelSubmitForm()">确 定</el-button>
  581. <el-button @click="DelTagCancel">取 消</el-button>
  582. </div>
  583. </el-dialog>
  584. <el-dialog
  585. :title="resultTitle"
  586. :visible.sync="resultDialogVisible"
  587. width="50%"
  588. custom-class="feedback-dialog"
  589. >
  590. <pre style="white-space: pre-wrap; font-family: inherit;">{{ resultMessage }}</pre>
  591. <span slot="footer" class="dialog-footer">
  592. <el-button @click="resultDialogVisible = false">关闭</el-button>
  593. </span>
  594. </el-dialog>
  595. <el-dialog title="批量添加客户备注" :visible.sync="notesOpen.open" width="800px" append-to-body>
  596. <el-card>
  597. <el-row>
  598. <el-col>
  599. <el-radio-group v-model="notesOpen.nameType" style="margin-bottom: 2%">
  600. <el-radio :label="1">
  601. 客户名称添加在【新备注】【前】
  602. </el-radio>
  603. <el-radio :label="2">
  604. 客户名称添加在【新备注】【后】
  605. </el-radio>
  606. <el-radio :label="3">
  607. 不添加客户名称
  608. </el-radio>
  609. </el-radio-group>
  610. </el-col>
  611. <el-col>
  612. <el-radio-group v-model="notesOpen.type">
  613. <el-radio
  614. :label="1"
  615. >添加【新备注】在最【前】面
  616. </el-radio>
  617. <el-radio
  618. :label="2"
  619. >添加【新备注】在最【后】面
  620. </el-radio>
  621. <el-radio
  622. :label="3"
  623. >替换所有备注
  624. </el-radio>
  625. </el-radio-group>
  626. </el-col>
  627. <el-col>
  628. <el-input v-model="notesOpen.notes" placeholder="请输入客户备注(最多20个字,含已有的)" clearable size="small"
  629. maxlength="20" show-word-limit style="width: 500px;margin-top: 3%"/>
  630. <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
  631. <i class="el-icon-info"></i>
  632. 由于企业微信官方限制,备注最多20个字,且自动会去除末尾超出的字
  633. </div>
  634. </el-col>
  635. </el-row>
  636. </el-card>
  637. <div slot="footer" class="dialog-footer">
  638. <el-button type="primary" @click="notesSubmitForm()">确 定</el-button>
  639. <el-button @click="notesCancel()">取消</el-button>
  640. </div>
  641. </el-dialog>
  642. </div>
  643. </template>
  644. <script>
  645. import {
  646. addCourseWatchLog,
  647. delCourseWatchLog,
  648. exportCourseWatchLog,
  649. getCourseWatchLog, myExportCourseWatchLog,
  650. myListCourseWatchLog,
  651. updateCourseWatchLog
  652. } from "@/api/course/courseWatchLog";
  653. import {courseList, myListCourseRedPacketLog, videoList} from '@/api/course/courseRedPacketLog'
  654. import {myListLogs} from "@/api/course/courseAnswerlogs";
  655. import {getMyQwUserList} from "@/api/qw/user";
  656. import {searchTags} from "../../../api/qw/tag";
  657. import {addTagByWatch, delTagByWatch,batchUpdateExternalContactNotes,batchUpdateExternalContactNotesByWatchLog} from "../../../api/qw/externalContact";
  658. import {allListTagGroup} from "../../../api/qw/tagGroup";
  659. import Vue from 'vue'
  660. import Calendar from 'vue-mobile-calendar'
  661. import {infoSop} from "@/api/qw/sop";
  662. Vue.use(Calendar)
  663. export default {
  664. name: "CourseWatchLog",
  665. data() {
  666. return {
  667. tableKey: 0,
  668. // 日历 key 控制刷新
  669. scheduleCalendarKey: 0,
  670. createCalendarKey: 0,
  671. updateCalendarKey: 0,
  672. qecCalendarKey: 0,
  673. periodTimeKey: 0,
  674. createTimeText: '',
  675. scheduleTimeText: '', // 新增
  676. updateTimeText: '', // 新增
  677. qecCreateTimeText: '', // 新增
  678. periodTimeText: '', // 营期课程时间
  679. scheduleTime: [], // 改为数组
  680. createTime: [], // 改为数组
  681. updateTime: [], // 改为数组
  682. qecCreateTime: [], // 改为数组
  683. periodTime: [], // 改为数组
  684. // 控制日历显隐
  685. showScheduleCalendar: false,
  686. showCreateCalendar: false,
  687. showUpdateCalendar: false,
  688. showQecCalendar: false,
  689. resultDialogVisible: false,
  690. resultMessage: '',
  691. resultTitle:'',
  692. activeName:"2",
  693. pickerOptions: {
  694. disabledDate(time) {
  695. // 获取13天前的日期(加上今天就是14天)
  696. const sixDaysAgo = new Date();
  697. sixDaysAgo.setDate(sixDaysAgo.getDate() - 13);
  698. sixDaysAgo.setHours(0, 0, 0, 0);
  699. // 获取明天的日期(不包括今天)
  700. const tomorrow = new Date();
  701. tomorrow.setDate(tomorrow.getDate() + 1);
  702. tomorrow.setHours(0, 0, 0, 0);
  703. return time.getTime() < sixDaysAgo.getTime() || time.getTime() >= tomorrow.getTime();
  704. }
  705. },
  706. courseLists: [],
  707. videoList: [],
  708. myQwUserList: [],
  709. logTypeOptions: [],
  710. // 遮罩层
  711. loading: true,
  712. // 导出遮罩层
  713. exportLoading: false,
  714. // 选中数组
  715. ids: [],
  716. // 非单个禁用
  717. single: true,
  718. // 非多个禁用
  719. multiple: true,
  720. // 显示搜索条件
  721. showSearch: true,
  722. sysCompanyOr: [],
  723. // 总条数
  724. total: 0,
  725. // 短链课程看课记录表格数据
  726. courseWatchLogList: [],
  727. openAnswerLog: false,
  728. loadingAnswerLog: true,
  729. answerLogsList: [],
  730. answerLogTotal: 0,
  731. answerLogQueryParams: {
  732. pageNum: 1,
  733. pageSize: 10,
  734. },
  735. projectOptions:[],
  736. sendTypeOptions:[{
  737. dictLabel:'会员',dictValue:'1'
  738. },
  739. {
  740. dictLabel:'企微',dictValue:'2'
  741. }
  742. ],
  743. openRedLog: false,
  744. loadingRedLog: true,
  745. redLogsList: [],
  746. redLogTotal: 0,
  747. redLogQueryParams: {
  748. pageNum: 1,
  749. pageSize: 10,
  750. },
  751. // 弹出层标题
  752. title: "",
  753. // 是否显示弹出层
  754. open: false,
  755. tagOpen:false,
  756. //标签弹窗选择
  757. tagChange:{
  758. open:false,
  759. index:null,
  760. },
  761. addTagFormByWatch:{
  762. logId:[],
  763. tagIds:[]
  764. },
  765. tagGroupList: [],
  766. tagTotal:0,
  767. tagDelOpen:false,
  768. queryTagParams:{
  769. pageNum: 1,
  770. pageSize: 5,
  771. total:0,
  772. name:null,
  773. corpId:null,
  774. },
  775. isVipList: [
  776. { dictLabel: '是', dictValue: 1 },
  777. { dictLabel: '否', dictValue: 0 }
  778. ],
  779. // SOP搜索相关
  780. sopSearchText: '', // SOP搜索框显示的文本
  781. selectedSopId: null, // 选中的SOP ID
  782. // 查询参数
  783. queryParams: {
  784. pageNum: 1,
  785. project: null,
  786. pageSize: 10,
  787. userId: null,
  788. videoId: null,
  789. nickName: null,
  790. logType: 2,
  791. qwExternalContactId: null,
  792. externalUserName:null,
  793. duration: null,
  794. qwUserId: null,
  795. companyUserId: null,
  796. companyId: null,
  797. courseId: null,
  798. sTime: null,
  799. eTime: null,
  800. upSTime:null,
  801. upETime:null,
  802. qecSTime:null,
  803. qecETime:null,
  804. periodSTime:null,
  805. periodETime:null,
  806. scheduleStartTime: null,
  807. scheduleEndTime: null,
  808. sendType:process.env.VUE_APP_COURSE_DEFAULT,
  809. isVip: null,
  810. sopId: null, // sopId
  811. },
  812. // 表单参数
  813. form: {},
  814. // 表单校验
  815. rules: {},
  816. notesOpen: {
  817. type: 1,
  818. nameType: 3,
  819. addType: 0,
  820. filter: false,
  821. open: false,
  822. notes: null,
  823. },
  824. };
  825. },
  826. created() {
  827. courseList().then(response => {
  828. this.courseLists = response.list;
  829. });
  830. this.getDicts("sys_course_watch_log_type_new").then(response => {
  831. this.logTypeOptions = response.data;
  832. });
  833. this.getDicts("sys_company_or").then(response => {
  834. this.sysCompanyOr = response.data;
  835. });
  836. this.getDicts("sys_course_project").then(response => {
  837. this.projectOptions = response.data;
  838. });
  839. // 设置默认当天时间 xgb 防止频繁查询大量数据
  840. this.setToday();
  841. this.getList();
  842. getMyQwUserList().then(response => {
  843. this.myQwUserList = response.data;
  844. });
  845. },
  846. methods: {
  847. setToday(){
  848. const today = new Date();
  849. const todayStart = new Date(today);
  850. todayStart.setHours(0, 0, 0, 0);
  851. const todayEnd = new Date(today);
  852. todayEnd.setHours(23, 59, 59, 999);
  853. this.createTimeText = [this.formatDate(todayStart), this.formatDate(todayEnd)];
  854. this.queryParams.sTime = this.formatDate(todayStart);
  855. this.queryParams.eTime = this.formatDate(todayEnd);
  856. },
  857. handleSendTypeChange() {
  858. // 重置相关参数
  859. this.queryParams.qwUserId = null;
  860. this.queryParams.qwExternalContactId = null;
  861. this.queryParams.userId = null;
  862. this.queryParams.nickName = null;
  863. this.queryParams.externalUserName = null;
  864. this.queryParams.corpId = null;
  865. this.queryParams.project = null;
  866. this.queryParams.courseId = null;
  867. this.queryParams.videoId = null;
  868. // 重置选择
  869. this.ids = [];
  870. this.courseWatchLogList = []; // 清空表格数据
  871. // 重置分页
  872. this.queryParams.pageNum = 1;
  873. // 强制重新渲染表格
  874. this.tableKey += 1;
  875. this.getList();
  876. },
  877. // 重置日历组件
  878. resetCalendars() {
  879. this.scheduleTime = [];
  880. this.createTime = [];
  881. this.updateTime = [];
  882. this.qecCreateTime = [];
  883. this.periodTime = [];
  884. this.scheduleTimeText = '';
  885. this.createTimeText = '';
  886. this.updateTimeText = '';
  887. this.qecCreateTimeText = '';
  888. this.periodTimeText = [];
  889. // 强制刷新日历组件
  890. this.scheduleCalendarKey++;
  891. this.createCalendarKey++;
  892. this.updateCalendarKey++;
  893. this.qecCalendarKey++;
  894. this.periodTimeKey++;
  895. },
  896. formatDateRange(dates) {
  897. if (!dates || dates.length < 2) return '';
  898. return dates.map(date => date.format('YYYY-MM-DD')).join(' ~ ');
  899. },
  900. courseChange(row) {
  901. this.queryParams.videoId = null;
  902. if (row === '') {
  903. this.videoList = [];
  904. return
  905. }
  906. videoList(row).then(response => {
  907. this.videoList = response.list
  908. });
  909. },
  910. updateQwuser() {
  911. for (const user of this.myQwUserList) {
  912. if (user.dictValue == this.queryParams.qwUserId) {
  913. this.queryParams.corpId = user.corpId;
  914. break;
  915. }
  916. }
  917. this.getList();
  918. },
  919. handleClickX(tab) {
  920. this.activeName=tab.name;
  921. if(tab.name=="00"){
  922. this.queryParams.logType=null;
  923. }else{
  924. this.queryParams.logType=tab.name;
  925. }
  926. this.getList()
  927. },
  928. // 营期时间
  929. handleScheduleTimeChange(scheduleTime) {
  930. if (scheduleTime && scheduleTime.length >= 2) {
  931. // this.scheduleTimeText = this.formatDateRange(scheduleTime);
  932. this.queryParams.scheduleStartTime = scheduleTime[0] || null;
  933. this.queryParams.scheduleEndTime = scheduleTime[1] || null;
  934. console.log(this.queryParams.scheduleStartTime)
  935. console.log(this.queryParams.scheduleEndTime)
  936. } else {
  937. this.scheduleTimeText = [];
  938. this.queryParams.scheduleStartTime = null;
  939. this.queryParams.scheduleEndTime = null;
  940. }
  941. },
  942. // 创建时间
  943. createChange(createTime) {
  944. if (createTime && createTime.length >= 2) {
  945. const startDate = new Date(createTime[0]);
  946. const endDate = new Date(createTime[1]);
  947. const timeDiff = Math.abs(endDate.getTime() - startDate.getTime());
  948. const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
  949. // 限制时间区间为一个月
  950. if (diffDays > 31) {
  951. this.$message.warning('创建时间区间不能超过一个月');
  952. this.createTimeText = null;
  953. this.queryParams.sTime = null;
  954. this.queryParams.eTime = null;
  955. return;
  956. }
  957. // this.createTimeText = this.formatDateRange(createTime);
  958. this.queryParams.sTime = this.formatDate(createTime[0]) || null;
  959. this.queryParams.eTime = this.formatDate(createTime[1]) || null;
  960. } else {
  961. this.createTimeText = [];
  962. this.queryParams.sTime = null;
  963. this.queryParams.eTime = null;
  964. }
  965. },
  966. // 更新时间
  967. updateChange(updateTime) {
  968. if (updateTime && updateTime.length >= 2) {
  969. // this.updateTimeText = this.formatDateRange(updateTime);
  970. this.queryParams.upSTime = updateTime[0] || null;
  971. this.queryParams.upETime = updateTime[1] || null;
  972. } else {
  973. this.updateTimeText = [];
  974. this.queryParams.upSTime = null;
  975. this.queryParams.upETime = null;
  976. }
  977. },
  978. // 进线时间
  979. qecCreateTimeChange(qecCreateTime) {
  980. if (qecCreateTime && qecCreateTime.length >= 2) {
  981. // 检查选择的日期范围是否超过7天(包括起始和结束日期)
  982. const startDate = new Date(qecCreateTime[0]);
  983. const endDate = new Date(qecCreateTime[1]);
  984. // 设置时间为当天开始,避免时间部分影响计算
  985. startDate.setHours(0, 0, 0, 0);
  986. endDate.setHours(0, 0, 0, 0);
  987. const timeDiff = Math.abs(endDate - startDate);
  988. const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
  989. // 如果超过6天的范围(总共7天,包括起始日)
  990. if (diffDays > 6) {
  991. this.$message.error('进线时间选择范围不能超过7天');
  992. // 清空选择
  993. this.qecCreateTime = [];
  994. this.qecCreateTimeText = [];
  995. this.queryParams.qecSTime = null;
  996. this.queryParams.qecETime = null;
  997. this.qecCalendarKey++;
  998. return;
  999. }
  1000. this.qecCreateTimeText = this.formatDateRange(qecCreateTime);
  1001. this.queryParams.qecSTime = qecCreateTime[0] || null;
  1002. this.queryParams.qecETime = qecCreateTime[1] || null;
  1003. } else {
  1004. this.qecCreateTimeText = [];
  1005. this.queryParams.qecSTime = null;
  1006. this.queryParams.qecETime = null;
  1007. }
  1008. },
  1009. //营期课程时间
  1010. qecPeriodTimeChange(periodTime){
  1011. if (periodTime && periodTime.length >= 2) {
  1012. // 检查选择的日期范围是否超过7天(包括起始和结束日期)
  1013. const startDate = new Date(periodTime[0]);
  1014. const endDate = new Date(periodTime[1]);
  1015. // 设置时间为当天开始,避免时间部分影响计算
  1016. startDate.setHours(0, 0, 0, 0);
  1017. endDate.setHours(0, 0, 0, 0);
  1018. const timeDiff = Math.abs(endDate - startDate);
  1019. const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
  1020. // 如果超过6天的范围(总共7天,包括起始日)
  1021. if (diffDays > 13) {
  1022. this.$message.error('时间选择范围不能超过14天');
  1023. // 清空选择
  1024. this.periodTime = [];
  1025. this.periodTimeText = [];
  1026. this.queryParams.periodSTime = null;
  1027. this.queryParams.periodETime = null;
  1028. this.periodTimeKey++;
  1029. return;
  1030. }
  1031. this.queryParams.periodSTime = this.formatDate(periodTime[0]) || null;
  1032. this.queryParams.periodETime = this.formatDate(periodTime[1]) || null;
  1033. } else {
  1034. this.periodTimeText = '';
  1035. this.queryParams.periodSTime = null;
  1036. this.queryParams.periodETime = null;
  1037. }
  1038. },
  1039. formatDate(date) {
  1040. if (!date) return ''
  1041. // 确保 date 是 Date 对象
  1042. let dateObj = date
  1043. if (typeof date === 'string') {
  1044. dateObj = new Date(date)
  1045. }
  1046. // 如果转换失败,返回空字符串
  1047. if (!(dateObj instanceof Date) || isNaN(dateObj.getTime())) {
  1048. return ''
  1049. }
  1050. // 使用更安全的格式化方法
  1051. const year = dateObj.getFullYear()
  1052. const month = String(dateObj.getMonth() + 1).padStart(2, '0')
  1053. const day = String(dateObj.getDate()).padStart(2, '0')
  1054. const hours = String(dateObj.getHours()).padStart(2, '0')
  1055. const minutes = String(dateObj.getMinutes()).padStart(2, '0')
  1056. const seconds = String(dateObj.getSeconds()).padStart(2, '0')
  1057. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
  1058. },
  1059. /** 查询短链课程看课记录列表 */
  1060. getList() {
  1061. // xgb 看课数据量太大必须限制时间
  1062. if (!this.createTimeText) {
  1063. this.$message.warning('请选择创建时间');
  1064. return;
  1065. }
  1066. this.loading = true;
  1067. let param = JSON.parse(JSON.stringify(this.queryParams));
  1068. if (param.logType == "10") {
  1069. param.logType = null;
  1070. }
  1071. myListCourseWatchLog(param).then(response => {
  1072. this.courseWatchLogList = response.rows;
  1073. this.total = response.total;
  1074. this.loading = false;
  1075. });
  1076. },
  1077. // 取消按钮
  1078. cancel() {
  1079. this.open = false;
  1080. this.reset();
  1081. },
  1082. // 表单重置
  1083. reset() {
  1084. this.form = {
  1085. logId: null,
  1086. userId: null,
  1087. videoId: null,
  1088. logType: null,
  1089. createTime: null,
  1090. updateTime: null,
  1091. qwExternalContactId: null,
  1092. externalUserName:null,
  1093. duration: null,
  1094. qwUserId: null,
  1095. companyUserId: null,
  1096. companyId: null,
  1097. courseId: null,
  1098. sTime:null,
  1099. eTime:null,
  1100. upSTime:null,
  1101. upETime:null,
  1102. qecSTime:null,
  1103. qecETime:null,
  1104. scheduleStartTime: null,
  1105. scheduleEndTime: null,
  1106. };
  1107. // 统一重置日历组件
  1108. this.resetCalendars();
  1109. this.resetForm("form");
  1110. },
  1111. /** 搜索按钮操作 */
  1112. handleQuery() {
  1113. this.queryParams.pageNum = 1;
  1114. this.getList();
  1115. },
  1116. /** 重置按钮操作 */
  1117. resetQuery() {
  1118. this.resetForm("queryForm");
  1119. this.queryParams.sTime = null;
  1120. this.queryParams.eTime = null;
  1121. this.queryParams.project = null;
  1122. this.queryParams.upSTime = null;
  1123. this.queryParams.upETime = null;
  1124. this.queryParams.qecSTime = null;
  1125. this.queryParams.qecETime = null;
  1126. this.queryParams.periodSTime = null;
  1127. this.queryParams.periodDTime = null;
  1128. this.queryParams.scheduleStartTime = null;
  1129. this.queryParams.scheduleEndTime = null;
  1130. this.queryParams.sopId = null; // 重置SOP ID
  1131. this.queryParams.isVip = null; // 重置 isVip 状态
  1132. this.queryParams.qwUserId = null; // 重置 qwUserId
  1133. this.queryParams.externalUserName=null;
  1134. // 重置SOP搜索
  1135. this.handleSopClear();
  1136. // 统一重置日历组件
  1137. this.resetCalendars();
  1138. this.setToday();
  1139. this.handleQuery();
  1140. },
  1141. // 多选框选中数据
  1142. handleSelectionChange(selection) {
  1143. this.ids = selection.map(item => item.logId)
  1144. this.single = selection.length !== 1
  1145. this.multiple = !selection.length
  1146. },
  1147. /** 新增按钮操作 */
  1148. handleAdd() {
  1149. this.reset();
  1150. this.open = true;
  1151. this.title = "添加短链课程看课记录";
  1152. },
  1153. /** 修改按钮操作 */
  1154. handleUpdate(row) {
  1155. this.reset();
  1156. const logId = row.logId || this.ids
  1157. getCourseWatchLog(logId).then(response => {
  1158. this.form = response.data;
  1159. this.open = true;
  1160. this.title = "修改短链课程看课记录";
  1161. });
  1162. },
  1163. /** 提交按钮 */
  1164. submitForm() {
  1165. this.$refs["form"].validate(valid => {
  1166. if (valid) {
  1167. if (this.form.logId != null) {
  1168. updateCourseWatchLog(this.form).then(response => {
  1169. this.msgSuccess("修改成功");
  1170. this.open = false;
  1171. this.getList();
  1172. });
  1173. } else {
  1174. addCourseWatchLog(this.form).then(response => {
  1175. this.msgSuccess("新增成功");
  1176. this.open = false;
  1177. this.getList();
  1178. });
  1179. }
  1180. }
  1181. });
  1182. },
  1183. /** 删除按钮操作 */
  1184. handleDelete(row) {
  1185. const logIds = row.logId || this.ids;
  1186. this.$confirm('是否确认删除短链课程看课记录编号为"' + logIds + '"的数据项?', "警告", {
  1187. confirmButtonText: "确定",
  1188. cancelButtonText: "取消",
  1189. type: "warning"
  1190. }).then(function () {
  1191. return delCourseWatchLog(logIds);
  1192. }).then(() => {
  1193. this.getList();
  1194. this.msgSuccess("删除成功");
  1195. }).catch(() => {
  1196. });
  1197. },
  1198. /** 导出按钮操作 */
  1199. handleExport() {
  1200. if (!this.createTimeText) {
  1201. this.$message.warning('请选择创建时间');
  1202. return;
  1203. }
  1204. const queryParams = this.queryParams;
  1205. this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
  1206. confirmButtonText: "确定",
  1207. cancelButtonText: "取消",
  1208. type: "warning"
  1209. }).then(() => {
  1210. this.exportLoading = true;
  1211. return myExportCourseWatchLog(queryParams);
  1212. }).then(response => {
  1213. this.download(response.msg);
  1214. this.exportLoading = false;
  1215. }).catch(() => {
  1216. });
  1217. },
  1218. openAnswerLogFun(row) {
  1219. this.openAnswerLog = true;
  1220. this.answerLogQueryParams.watchLogId = row.logId;
  1221. this.answerLogList();
  1222. },
  1223. answerLogList() {
  1224. this.loadingAnswerLog = true;
  1225. myListLogs(this.answerLogQueryParams).then(e => {
  1226. this.answerLogsList = e.rows;
  1227. this.answerLogTotal = e.total;
  1228. this.loadingAnswerLog = false;
  1229. })
  1230. },
  1231. openRedLogFun(row) {
  1232. this.openRedLog = true;
  1233. this.redLogQueryParams.watchLogId = row.logId;
  1234. this.redLogList();
  1235. },
  1236. redLogList() {
  1237. this.loadingRedLog = true;
  1238. console.info("-----watch",this.redLogQueryParams)
  1239. myListCourseRedPacketLog(this.redLogQueryParams).then(e => {
  1240. this.redLogsList = e.rows;
  1241. this.redLogTotal = e.total;
  1242. this.loadingRedLog = false;
  1243. })
  1244. },
  1245. addUserTag(){
  1246. if(this.ids==null||this.ids==""){
  1247. return this.$message('请选择需要添加标签的客户');
  1248. }
  1249. this.getPageListTagGroup();
  1250. setTimeout(() => {
  1251. for (let i = 0; i < this.tagGroupList.length; i++) {
  1252. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1253. this.tagGroupList[i].tag[x].isSelected=false;
  1254. }
  1255. }
  1256. }, 200);
  1257. this.tagOpen = true;
  1258. },
  1259. delUserTag(){
  1260. if(this.ids==null||this.ids==""){
  1261. return this.$message('请选择需要移除标签的客户');
  1262. }
  1263. this.getPageListTagGroup();
  1264. setTimeout(() => {
  1265. for (let i = 0; i < this.tagGroupList.length; i++) {
  1266. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1267. this.tagGroupList[i].tag[x].isSelected=false;
  1268. }
  1269. }
  1270. }, 200);
  1271. this.tagDelOpen = true;
  1272. },
  1273. getPageListTagGroup(){
  1274. this.queryTagParams.corpId=this.queryParams.corpId
  1275. allListTagGroup(this.queryTagParams).then(response => {
  1276. this.tagGroupList = response.rows;
  1277. this.tagTotal = response.total;
  1278. });
  1279. },
  1280. tagSelection(row){
  1281. row.isSelected= !row.isSelected;
  1282. this.$forceUpdate();
  1283. },
  1284. handleSearchTags(name){
  1285. if (!name){
  1286. return this.$message.error("请输入要搜索的标签")
  1287. }
  1288. this.queryTagParams.name=name;
  1289. this.queryTagParams.corpId=this.queryParams.corpId;
  1290. searchTags(this.queryTagParams).then(response => {
  1291. this.tagGroupList = response.rows;
  1292. this.tagTotal = response.total;
  1293. });
  1294. // searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  1295. // this.tagGroupList = response.rows;
  1296. // });
  1297. },
  1298. cancelSearchTags(){
  1299. this.resetSearchQueryTag()
  1300. this.getPageListTagGroup();
  1301. },
  1302. resetSearchQueryTag(){
  1303. this.queryTagParams= {
  1304. pageNum: 1,
  1305. pageSize: 5,
  1306. total:0,
  1307. name:null,
  1308. };
  1309. },
  1310. addTagSubmitForm(){
  1311. for (let i = 0; i < this.tagGroupList.length; i++) {
  1312. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1313. if(this.tagGroupList[i].tag[x].isSelected==true){
  1314. this.addTagFormByWatch.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1315. }
  1316. }
  1317. }
  1318. if(this.addTagFormByWatch.tagIds==[]||this.addTagFormByWatch.tagIds==null||this.addTagFormByWatch.tagIds==""){
  1319. return this.$message('请选择标签');
  1320. }
  1321. this.addTagFormByWatch.logIds=this.ids;
  1322. let loadingRock = this.$loading({
  1323. lock: true,
  1324. text: '正在执行中请稍后~~请不要刷新页面!!',
  1325. spinner: 'el-icon-loading',
  1326. background: 'rgba(0, 0, 0, 0.7)'
  1327. });
  1328. addTagByWatch(this.addTagFormByWatch).then(response => {
  1329. // this.msgSuccess(response.msg);
  1330. this.resultMessage = response.msg;
  1331. this.resultDialogVisible = true; // 显示弹窗
  1332. this.resultTitle = '批量添加标签结果';
  1333. this.tagOpen = false;
  1334. loadingRock.close();
  1335. this.addTagFormByWatch={
  1336. logIds:[],
  1337. tagIds:[]
  1338. };
  1339. this.getList()
  1340. }).finally(res=>{
  1341. loadingRock.close();
  1342. });
  1343. },
  1344. tagDelSubmitForm(){
  1345. for (let i = 0; i < this.tagGroupList.length; i++) {
  1346. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1347. if(this.tagGroupList[i].tag[x].isSelected==true){
  1348. this.addTagFormByWatch.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1349. }
  1350. }
  1351. }
  1352. if(this.addTagFormByWatch.tagIds==[]||this.addTagFormByWatch.tagIds==null||this.addTagFormByWatch.tagIds==""){
  1353. return this.$message('请选择标签');
  1354. }
  1355. this.addTagFormByWatch.corpId=this.queryParams.corpId
  1356. this.addTagFormByWatch.logIds=this.ids;
  1357. let loadingRock = this.$loading({
  1358. lock: true,
  1359. text: '正在执行中请稍后~~请不要刷新页面!!',
  1360. spinner: 'el-icon-loading',
  1361. background: 'rgba(0, 0, 0, 0.7)'
  1362. });
  1363. delTagByWatch(this.addTagFormByWatch).then(response => {
  1364. // this.msgSuccess(response.msg);
  1365. this.resultMessage = response.msg;
  1366. this.resultDialogVisible = true; // 显示弹窗
  1367. this.resultTitle = '批量移除标签结果';
  1368. this.tagDelOpen = false;
  1369. loadingRock.close();
  1370. this.addTagFormByWatch={
  1371. userIds:[],
  1372. tagIds:[]
  1373. };
  1374. this.getList()
  1375. }).finally(res=>{
  1376. loadingRock.close();
  1377. });
  1378. },
  1379. addTagCancel() {
  1380. this.tagOpen = false;
  1381. this.addTagFormByWatch={
  1382. logIds:[],
  1383. tagIds:[]
  1384. };
  1385. },
  1386. DelTagCancel() {
  1387. this.tagDelOpen = false;
  1388. this.addTagFormByWatch={
  1389. logIds:[],
  1390. tagIds:[]
  1391. };
  1392. },
  1393. /**
  1394. * 异步查询SOP列表
  1395. * @param {string} queryString - 查询字符串
  1396. * @param {function} callback - 回调函数
  1397. */
  1398. querySopAsync(queryString, callback) {
  1399. if (!queryString) {
  1400. callback([]);
  1401. return;
  1402. }
  1403. infoSop({ name: queryString }).then(response => {
  1404. if (response && response.rows) {
  1405. const suggestions = response.rows.map(item => ({
  1406. value: item.name,
  1407. id: item.id,
  1408. name: item.name
  1409. }));
  1410. callback(suggestions);
  1411. } else {
  1412. callback([]);
  1413. }
  1414. }).catch(error => {
  1415. console.error('通过sop查询失败:', error);
  1416. callback([]);
  1417. });
  1418. },
  1419. /**
  1420. * 选择SOP
  1421. * @param {object} item - 选中的SOP项
  1422. */
  1423. handleSopSelect(item) {
  1424. this.selectedSopId = item.id;
  1425. this.queryParams.sopId = item.id;
  1426. this.sopSearchText = item.name;
  1427. },
  1428. /**
  1429. * 清空SOP选择
  1430. */
  1431. handleSopClear() {
  1432. this.selectedSopId = null;
  1433. this.queryParams.sopId = null;
  1434. this.sopSearchText = '';
  1435. },
  1436. handleBatchUpdateNotesFilter() {
  1437. this.notesOpen.open = true;
  1438. this.notesOpen.filter = true;
  1439. },
  1440. handleBatchUpdateNotes() {
  1441. if (this.ids == null || this.ids == "") {
  1442. return this.$message('请选择需要添加备注的客户');
  1443. }
  1444. this.notesOpen.open = true;
  1445. this.notesOpen.filter = false;
  1446. },
  1447. notesCancel(){
  1448. this.notesOpen={
  1449. open: false,
  1450. notes: null,
  1451. type: 1,
  1452. nameType:3,
  1453. }
  1454. },
  1455. notesSubmitForm() {
  1456. if (this.notesOpen.notes == null || this.notesOpen.notes == "") {
  1457. return this.$message.error("请输入备注内容");
  1458. }
  1459. // let loadingRock = this.$loading({
  1460. // lock: true,
  1461. // text: '正在执行中请稍后~~请不要刷新页面!!',
  1462. // spinner: 'el-icon-loading',
  1463. // background: 'rgba(0, 0, 0, 0.7)'
  1464. // });
  1465. let obj = JSON.parse(JSON.stringify(this.queryParams))
  1466. console.log(obj);
  1467. if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
  1468. obj.tagIds = obj.tagIds.split(",");
  1469. }
  1470. batchUpdateExternalContactNotesByWatchLog({
  1471. // addType: 0,
  1472. watchLogIds: this.ids,
  1473. notes: this.notesOpen.notes,
  1474. type: this.notesOpen.type,
  1475. nameType: this.notesOpen.nameType,
  1476. filter: this.notesOpen.filter,
  1477. watchLogParam: obj,
  1478. fromMyList:1
  1479. }).then(res => {
  1480. this.resultMessage = res.msg;
  1481. this.$message.success("正在执行中...");
  1482. // this.resultDialogVisible = true; // 显示弹窗
  1483. // this.resultTitle = '批量修改备注结果';
  1484. }).finally(res => {
  1485. this.getList();
  1486. // loadingRock.close();
  1487. this.notesCancel();
  1488. })
  1489. },
  1490. }
  1491. };
  1492. </script>
  1493. <style scoped>
  1494. /* CSS 样式 */
  1495. .tag-container {
  1496. display: flex;
  1497. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1498. gap: 8px; /* 设置标签之间的间距 */
  1499. }
  1500. .name-background {
  1501. display: inline-block;
  1502. background-color: #abece6; /* 背景颜色 */
  1503. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1504. border-radius: 4px; /* 可选:设置圆角 */
  1505. }
  1506. /* CSS 样式 */
  1507. .tag-container {
  1508. display: flex;
  1509. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1510. gap: 8px; /* 设置标签之间的间距 */
  1511. }
  1512. .name-background {
  1513. display: inline-block;
  1514. background-color: #abece6; /* 背景颜色 */
  1515. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1516. border-radius: 4px; /* 可选:设置圆角 */
  1517. }
  1518. .tag-box {
  1519. padding: 8px 12px;
  1520. border: 1px solid #989797;
  1521. border-radius: 4px;
  1522. cursor: pointer;
  1523. display: inline-block;
  1524. }
  1525. .tag-selected {
  1526. background-color: #00bc98;
  1527. color: #fff;
  1528. border-color: #00bc98;
  1529. }
  1530. .el-tag + .el-tag {
  1531. margin-left: 10px;
  1532. }
  1533. .button-new-tag {
  1534. margin-left: 10px;
  1535. height: 32px;
  1536. line-height: 30px;
  1537. padding-top: 0;
  1538. padding-bottom: 0;
  1539. }
  1540. .input-new-tag {
  1541. width: 90px;
  1542. margin-left: 10px;
  1543. vertical-align: bottom;
  1544. }
  1545. /* 新增的滚动容器样式(不影响原有样式) */
  1546. .scroll-wrapper {
  1547. max-height: 130px; /* 大约三行的高度 */
  1548. overflow-y: auto; /* 垂直滚动 */
  1549. padding-right: 5px; /* 为滚动条留出空间 */
  1550. }
  1551. /* 美化滚动条(可选) */
  1552. .scroll-wrapper::-webkit-scrollbar {
  1553. width: 6px;
  1554. }
  1555. .scroll-wrapper::-webkit-scrollbar-thumb {
  1556. background: rgba(0, 0, 0, 0.2);
  1557. border-radius: 3px;
  1558. }
  1559. /* SOP搜索框样式 */
  1560. .sop-item {
  1561. display: flex;
  1562. align-items: center;
  1563. }
  1564. .sop-name {
  1565. font-size: 14px;
  1566. color: #606266;
  1567. }
  1568. </style>