index.vue 62 KB

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