watchLog.vue 65 KB

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