watchLog.vue 67 KB

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