watchLog.vue 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144
  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. myListCourseRedPacketLog(this.redLogQueryParams).then(e => {
  1479. this.redLogsList = e.rows;
  1480. this.redLogTotal = e.total;
  1481. this.loadingRedLog = false;
  1482. })
  1483. },
  1484. addUserTag(tagFilter){
  1485. if (this.queryParams.sendType == 2 && !this.queryParams.qwUserId){
  1486. return this.$message.warning('请先选择要打标签的 企微账号');
  1487. }
  1488. if(!tagFilter && (this.ids==null||this.ids=="")){
  1489. return this.$message('请选择需要添加标签的客户');
  1490. }
  1491. this.getPageListTagGroup();
  1492. setTimeout(() => {
  1493. for (let i = 0; i < this.tagGroupList.length; i++) {
  1494. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1495. this.tagGroupList[i].tag[x].isSelected=false;
  1496. }
  1497. }
  1498. }, 200);
  1499. this.tagOpen = true;
  1500. this.tagFilter = tagFilter;
  1501. },
  1502. delUserTag(tagFilter){
  1503. if (this.queryParams.sendType == 2 && !this.queryParams.qwUserId){
  1504. return this.$message.warning('请先选择要打标签的 企微账号');
  1505. }
  1506. if(!tagFilter && (this.ids==null||this.ids=="")){
  1507. return this.$message('请选择需要移除标签的客户');
  1508. }
  1509. this.getPageListTagGroup();
  1510. setTimeout(() => {
  1511. for (let i = 0; i < this.tagGroupList.length; i++) {
  1512. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1513. this.tagGroupList[i].tag[x].isSelected=false;
  1514. }
  1515. }
  1516. }, 200);
  1517. this.tagDelOpen = true;
  1518. this.tagFilter = tagFilter;
  1519. },
  1520. getPageListTagGroup(){
  1521. this.queryTagParams.corpId=this.queryParams.corpId
  1522. allListTagGroup(this.queryTagParams).then(response => {
  1523. this.tagGroupList = response.rows;
  1524. this.tagTotal = response.total;
  1525. });
  1526. },
  1527. tagSelection(row){
  1528. row.isSelected= !row.isSelected;
  1529. this.$forceUpdate();
  1530. },
  1531. handleSearchTags(name){
  1532. if (!name){
  1533. return this.$message.error("请输入要搜索的标签")
  1534. }
  1535. this.queryTagParams.name=name;
  1536. this.queryTagParams.corpId=this.queryParams.corpId;
  1537. searchTags(this.queryTagParams).then(response => {
  1538. this.tagGroupList = response.rows;
  1539. this.tagTotal = response.total;
  1540. });
  1541. // searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  1542. // this.tagGroupList = response.rows;
  1543. // });
  1544. },
  1545. cancelSearchTags(){
  1546. this.resetSearchQueryTag()
  1547. this.getPageListTagGroup();
  1548. },
  1549. resetSearchQueryTag(){
  1550. this.queryTagParams= {
  1551. pageNum: 1,
  1552. pageSize: 5,
  1553. total:0,
  1554. name:null,
  1555. };
  1556. },
  1557. addTagSubmitForm(){
  1558. for (let i = 0; i < this.tagGroupList.length; i++) {
  1559. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1560. if(this.tagGroupList[i].tag[x].isSelected==true){
  1561. this.addTagFormByWatch.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1562. }
  1563. }
  1564. }
  1565. if(this.addTagFormByWatch.tagIds==[]||this.addTagFormByWatch.tagIds==null||this.addTagFormByWatch.tagIds==""){
  1566. return this.$message('请选择标签');
  1567. }
  1568. this.addTagFormByWatch.logIds=this.ids;
  1569. this.addTagFormByWatch.filter = this.tagFilter;
  1570. // 修改这里:正确处理参数对象
  1571. this.addTagFormByWatch.param = JSON.parse(JSON.stringify(this.queryParams));
  1572. let loadingRock = this.$loading({
  1573. lock: true,
  1574. text: '正在执行中请稍后~~请不要刷新页面!!',
  1575. spinner: 'el-icon-loading',
  1576. background: 'rgba(0, 0, 0, 0.7)'
  1577. });
  1578. addTagByWatch(this.addTagFormByWatch).then(response => {
  1579. // this.msgSuccess(response.msg);
  1580. this.resultMessage = response.msg;
  1581. this.resultDialogVisible = true; // 显示弹窗
  1582. this.resultTitle = '批量添加标签结果';
  1583. this.tagOpen = false;
  1584. loadingRock.close();
  1585. this.addTagFormByWatch={
  1586. logIds:[],
  1587. tagIds:[]
  1588. };
  1589. this.getList()
  1590. }).finally(res=>{
  1591. loadingRock.close();
  1592. });
  1593. },
  1594. tagDelSubmitForm(){
  1595. for (let i = 0; i < this.tagGroupList.length; i++) {
  1596. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1597. if(this.tagGroupList[i].tag[x].isSelected==true){
  1598. this.addTagFormByWatch.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1599. }
  1600. }
  1601. }
  1602. if(this.addTagFormByWatch.tagIds==[]||this.addTagFormByWatch.tagIds==null||this.addTagFormByWatch.tagIds==""){
  1603. return this.$message('请选择标签');
  1604. }
  1605. this.addTagFormByWatch.logIds=this.ids;
  1606. this.addTagFormByWatch.filter = this.tagFilter;
  1607. // 修改这里:正确处理参数对象
  1608. this.addTagFormByWatch.param = JSON.parse(JSON.stringify(this.queryParams));
  1609. let loadingRock = this.$loading({
  1610. lock: true,
  1611. text: '正在执行中请稍后~~请不要刷新页面!!',
  1612. spinner: 'el-icon-loading',
  1613. background: 'rgba(0, 0, 0, 0.7)'
  1614. });
  1615. delTagByWatch(this.addTagFormByWatch).then(response => {
  1616. // this.msgSuccess(response.msg);
  1617. this.resultMessage = response.msg;
  1618. this.resultDialogVisible = true; // 显示弹窗
  1619. this.resultTitle = '批量移除标签结果';
  1620. this.tagDelOpen = false;
  1621. loadingRock.close();
  1622. this.addTagFormByWatch={
  1623. userIds:[],
  1624. tagIds:[]
  1625. };
  1626. this.getList()
  1627. }).finally(res=>{
  1628. loadingRock.close();
  1629. });
  1630. },
  1631. addTagCancel() {
  1632. this.tagOpen = false;
  1633. this.addTagFormByWatch={
  1634. logIds:[],
  1635. tagIds:[]
  1636. };
  1637. },
  1638. DelTagCancel() {
  1639. this.tagDelOpen = false;
  1640. this.addTagFormByWatch={
  1641. logIds:[],
  1642. tagIds:[]
  1643. };
  1644. },
  1645. /**
  1646. * 异步查询SOP列表
  1647. * @param {string} queryString - 查询字符串
  1648. * @param {function} callback - 回调函数
  1649. */
  1650. querySopAsync(queryString, callback) {
  1651. if (!queryString) {
  1652. callback([]);
  1653. return;
  1654. }
  1655. infoSop({ name: queryString }).then(response => {
  1656. if (response && response.rows) {
  1657. const suggestions = response.rows.map(item => ({
  1658. value: item.name,
  1659. id: item.id,
  1660. name: item.name
  1661. }));
  1662. callback(suggestions);
  1663. } else {
  1664. callback([]);
  1665. }
  1666. }).catch(error => {
  1667. console.error('通过sop查询失败:', error);
  1668. callback([]);
  1669. });
  1670. },
  1671. /**
  1672. * 选择SOP
  1673. * @param {object} item - 选中的SOP项
  1674. */
  1675. handleSopSelect(item) {
  1676. this.selectedSopId = item.id;
  1677. this.queryParams.sopId = item.id;
  1678. this.sopSearchText = item.name;
  1679. },
  1680. /**
  1681. * 清空SOP选择
  1682. */
  1683. handleSopClear() {
  1684. this.selectedSopId = null;
  1685. this.queryParams.sopId = null;
  1686. this.sopSearchText = '';
  1687. },
  1688. handleBatchUpdateNotesFilter() {
  1689. this.notesOpen.open = true;
  1690. this.notesOpen.filter = true;
  1691. },
  1692. handleBatchUpdateNotes() {
  1693. if (this.ids == null || this.ids == "") {
  1694. return this.$message('请选择需要添加备注的客户');
  1695. }
  1696. this.notesOpen.open = true;
  1697. this.notesOpen.filter = false;
  1698. },
  1699. notesCancel(){
  1700. this.notesOpen={
  1701. open: false,
  1702. notes: null,
  1703. type: 1,
  1704. nameType:3,
  1705. }
  1706. },
  1707. notesSubmitForm() {
  1708. if (this.notesOpen.notes == null || this.notesOpen.notes == "") {
  1709. return this.$message.error("请输入备注内容");
  1710. }
  1711. // let loadingRock = this.$loading({
  1712. // lock: true,
  1713. // text: '正在执行中请稍后~~请不要刷新页面!!',
  1714. // spinner: 'el-icon-loading',
  1715. // background: 'rgba(0, 0, 0, 0.7)'
  1716. // });
  1717. let obj = JSON.parse(JSON.stringify(this.queryParams))
  1718. if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
  1719. obj.tagIds = obj.tagIds.split(",");
  1720. }
  1721. batchUpdateExternalContactNotesByWatchLog({
  1722. // addType: 0,
  1723. watchLogIds: this.ids,
  1724. notes: this.notesOpen.notes,
  1725. type: this.notesOpen.type,
  1726. nameType: this.notesOpen.nameType,
  1727. filter: this.notesOpen.filter,
  1728. watchLogParam: obj,
  1729. fromMyList:1
  1730. }).then(res => {
  1731. this.resultMessage = res.msg;
  1732. this.$message.success("正在执行中...");
  1733. // this.resultDialogVisible = true; // 显示弹窗
  1734. // this.resultTitle = '批量修改备注结果';
  1735. }).finally(res => {
  1736. this.getList();
  1737. // loadingRock.close();
  1738. this.notesCancel();
  1739. })
  1740. },
  1741. }
  1742. };
  1743. </script>
  1744. <style scoped>
  1745. /* CSS 样式 */
  1746. .tag-container {
  1747. display: flex;
  1748. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1749. gap: 8px; /* 设置标签之间的间距 */
  1750. }
  1751. .name-background {
  1752. display: inline-block;
  1753. background-color: #abece6; /* 背景颜色 */
  1754. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1755. border-radius: 4px; /* 可选:设置圆角 */
  1756. }
  1757. /* CSS 样式 */
  1758. .tag-container {
  1759. display: flex;
  1760. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1761. gap: 8px; /* 设置标签之间的间距 */
  1762. }
  1763. .name-background {
  1764. display: inline-block;
  1765. background-color: #abece6; /* 背景颜色 */
  1766. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1767. border-radius: 4px; /* 可选:设置圆角 */
  1768. }
  1769. .tag-box {
  1770. padding: 8px 12px;
  1771. border: 1px solid #989797;
  1772. border-radius: 4px;
  1773. cursor: pointer;
  1774. display: inline-block;
  1775. }
  1776. .tag-selected {
  1777. background-color: #00bc98;
  1778. color: #fff;
  1779. border-color: #00bc98;
  1780. }
  1781. .el-tag + .el-tag {
  1782. margin-left: 10px;
  1783. }
  1784. .button-new-tag {
  1785. margin-left: 10px;
  1786. height: 32px;
  1787. line-height: 30px;
  1788. padding-top: 0;
  1789. padding-bottom: 0;
  1790. }
  1791. .input-new-tag {
  1792. width: 90px;
  1793. margin-left: 10px;
  1794. vertical-align: bottom;
  1795. }
  1796. /* 新增的滚动容器样式(不影响原有样式) */
  1797. .scroll-wrapper {
  1798. max-height: 130px; /* 大约三行的高度 */
  1799. overflow-y: auto; /* 垂直滚动 */
  1800. padding-right: 5px; /* 为滚动条留出空间 */
  1801. }
  1802. /* 美化滚动条(可选) */
  1803. .scroll-wrapper::-webkit-scrollbar {
  1804. width: 6px;
  1805. }
  1806. .scroll-wrapper::-webkit-scrollbar-thumb {
  1807. background: rgba(0, 0, 0, 0.2);
  1808. border-radius: 3px;
  1809. }
  1810. /* SOP搜索框样式 */
  1811. .sop-item {
  1812. display: flex;
  1813. align-items: center;
  1814. }
  1815. .sop-name {
  1816. font-size: 14px;
  1817. color: #606266;
  1818. }
  1819. </style>
  1820. <style scoped>
  1821. .el-icon-document-copy:hover {
  1822. color: #66b1ff; /* 悬停时的颜色 */
  1823. }
  1824. </style>
  1825. <style>
  1826. /** 移动端展示 **/
  1827. @media screen and (max-width: 500px) {
  1828. .el-picker-panel__sidebar {
  1829. width: 100%;
  1830. }
  1831. .el-picker-panel {
  1832. width: 400px!important;
  1833. }
  1834. .el-picker-panel__content {
  1835. width: 100%;
  1836. }
  1837. .el-picker-panel__body{
  1838. margin-left: 0!important;
  1839. display: flex;
  1840. flex-direction: column;
  1841. min-width: auto!important;
  1842. }
  1843. .el-picker-panel__sidebar {
  1844. position: relative;
  1845. }
  1846. .el-picker-panel__body-wrapper {
  1847. display: flex;
  1848. flex-direction: column;
  1849. align-items: center;
  1850. }
  1851. }
  1852. /* CSS 样式 */
  1853. .tag-container {
  1854. display: flex;
  1855. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1856. gap: 8px; /* 设置标签之间的间距 */
  1857. }
  1858. .name-background {
  1859. display: inline-block;
  1860. background-color: #abece6; /* 背景颜色 */
  1861. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1862. border-radius: 4px; /* 可选:设置圆角 */
  1863. }
  1864. /* CSS 样式 */
  1865. .tag-container {
  1866. display: flex;
  1867. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1868. gap: 8px; /* 设置标签之间的间距 */
  1869. }
  1870. .name-background {
  1871. display: inline-block;
  1872. background-color: #abece6; /* 背景颜色 */
  1873. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1874. border-radius: 4px; /* 可选:设置圆角 */
  1875. }
  1876. .tag-box {
  1877. padding: 8px 12px;
  1878. border: 1px solid #989797;
  1879. border-radius: 4px;
  1880. cursor: pointer;
  1881. display: inline-block;
  1882. }
  1883. .tag-selected {
  1884. background-color: #00bc98;
  1885. color: #fff;
  1886. border-color: #00bc98;
  1887. }
  1888. .el-tag + .el-tag {
  1889. margin-left: 10px;
  1890. }
  1891. .button-new-tag {
  1892. margin-left: 10px;
  1893. height: 32px;
  1894. line-height: 30px;
  1895. padding-top: 0;
  1896. padding-bottom: 0;
  1897. }
  1898. .input-new-tag {
  1899. width: 90px;
  1900. margin-left: 10px;
  1901. vertical-align: bottom;
  1902. }
  1903. .suggestion-box {
  1904. position: absolute;
  1905. z-index: 999;
  1906. background: #fff;
  1907. border: 1px solid #ddd;
  1908. max-height: 200px;
  1909. overflow-y: auto;
  1910. width: 100%;
  1911. }
  1912. .suggestion-item {
  1913. padding: 10px;
  1914. cursor: pointer;
  1915. }
  1916. .suggestion-item:hover {
  1917. background-color: #f5f7fa;
  1918. }
  1919. /* 新增的滚动容器样式(不影响原有样式) */
  1920. .scroll-wrapper {
  1921. max-height: 130px; /* 大约三行的高度 */
  1922. overflow-y: auto; /* 垂直滚动 */
  1923. padding-right: 5px; /* 为滚动条留出空间 */
  1924. }
  1925. /* 美化滚动条(可选) */
  1926. .scroll-wrapper::-webkit-scrollbar {
  1927. width: 6px;
  1928. }
  1929. .scroll-wrapper::-webkit-scrollbar-thumb {
  1930. background: rgba(0, 0, 0, 0.2);
  1931. border-radius: 3px;
  1932. }
  1933. .tag-container {
  1934. max-height: 200px;
  1935. overflow-y: auto;
  1936. padding: 1px;
  1937. border: 1px solid #ebeef5;
  1938. border-radius: 1px;
  1939. background-color: #fafafa;
  1940. }
  1941. .tag-list {
  1942. display: flex;
  1943. flex-wrap: wrap;
  1944. gap: 8px;
  1945. }
  1946. .scroll-hint {
  1947. text-align: center;
  1948. color: #909399;
  1949. font-size: 12px;
  1950. padding: 1px 0;
  1951. }
  1952. .container {
  1953. max-width: 800px;
  1954. margin: 0 auto;
  1955. padding: 10px;
  1956. }
  1957. .title {
  1958. text-align: center;
  1959. color: #303133;
  1960. margin-bottom: 30px;
  1961. }
  1962. .demo-table {
  1963. width: 100%;
  1964. margin-bottom: 30px;
  1965. }
  1966. .instructions {
  1967. background-color: #f5f7fa;
  1968. padding: 15px;
  1969. border-radius: 1px;
  1970. margin-bottom: 20px;
  1971. }
  1972. </style>