index.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="看课方式" prop="sendType">
  5. <el-select v-model="queryParams.sendType" placeholder="选择看课方式" clearable size="small" @change="handleSendTypeChange">
  6. <el-option
  7. v-for="dict in sendTypeOptions"
  8. :key="dict.dictValue"
  9. :label="dict.dictLabel"
  10. :value="dict.dictValue"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="项目" prop="project">
  15. <el-select v-model="queryParams.project" placeholder="请选择项目" clearable size="small" >
  16. <el-option
  17. v-for="item in projectOptions"
  18. :key="item.dictValue"
  19. :label="item.dictLabel"
  20. :value="item.dictValue"
  21. />
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="会员昵称" prop="nickName" v-if="queryParams.sendType == 1">
  25. <el-input
  26. v-model="queryParams.nickName"
  27. placeholder="请输入会员昵称"
  28. clearable
  29. size="small"
  30. @keyup.enter.native="handleQuery"
  31. />
  32. </el-form-item>
  33. <el-form-item label="会员id" prop="userId" v-if="queryParams.sendType == 1">
  34. <el-input
  35. v-model="queryParams.userId"
  36. placeholder="请输入会员昵称"
  37. clearable
  38. size="small"
  39. @keyup.enter.native="handleQuery"
  40. />
  41. </el-form-item>
  42. <el-form-item label="企微客户昵称" prop="nickName" v-if="queryParams.sendType == 2">
  43. <el-input
  44. v-model="queryParams.externalUserName"
  45. placeholder="请输入企微客户昵称"
  46. clearable
  47. size="small"
  48. @keyup.enter.native="handleQuery"
  49. />
  50. </el-form-item>
  51. <el-form-item label="课程" prop="courseId">
  52. <el-select filterable v-model="queryParams.courseId" placeholder="请选择课程" clearable size="small" @change="courseChange(queryParams.courseId)">
  53. <el-option
  54. v-for="dict in courseLists"
  55. :key="dict.dictValue"
  56. :label="dict.dictLabel"
  57. :value="dict.dictValue"
  58. />
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="小节" prop="videoId">
  62. <el-select filterable v-model="queryParams.videoId" placeholder="请选择小节" clearable size="small">
  63. <el-option
  64. v-for="dict in videoList"
  65. :key="dict.dictValue"
  66. :label="dict.dictLabel"
  67. :value="dict.dictValue"
  68. />
  69. </el-select>
  70. </el-form-item>
  71. <el-form-item label="所属销售" prop="companyUserId">
  72. <el-select v-model="queryParams.companyUserId" clearable filterable remote
  73. placeholder="请输入关键词" :remote-method="loadCompanyUserOptions"
  74. v-select-load-more="loadMoreCompanyUserOptions"
  75. :loading="companyUserOptionsLoading">
  76. <el-option
  77. v-for="item in companyUserOptions"
  78. :key="item.dictValue"
  79. :label="item.dictLabel"
  80. :value="item.dictValue">
  81. </el-option>
  82. </el-select>
  83. </el-form-item>
  84. <!-- sop名称 -->
  85. <el-form-item label="SOP名称" prop="sopId" v-if="queryParams.sendType == 2">
  86. <el-autocomplete
  87. v-model="sopSearchText"
  88. :fetch-suggestions="querySopAsync"
  89. placeholder="请输入SOP名称"
  90. clearable
  91. size="small"
  92. style="width: 200px"
  93. @select="handleSopSelect"
  94. @clear="handleSopClear"
  95. :trigger-on-focus="false"
  96. >
  97. <template slot-scope="{ item }">
  98. <div class="sop-item">
  99. <span class="sop-name">{{ item.name }}</span>
  100. </div>
  101. </template>
  102. </el-autocomplete>
  103. </el-form-item>
  104. <!-- 营期时间 -->
  105. <el-form-item label="营期时间" prop="scheduleTime">
  106. <el-input
  107. v-model="scheduleTimeText"
  108. placeholder="请选择营期时间"
  109. readonly
  110. @click.native="showScheduleCalendar = true"
  111. />
  112. <calendar
  113. v-model="scheduleTime"
  114. mode="during"
  115. :show.sync="showScheduleCalendar"
  116. @change="handleScheduleTimeChange"
  117. :key="scheduleCalendarKey"
  118. />
  119. </el-form-item>
  120. <!-- 创建时间 -->
  121. <el-form-item label="创建时间" prop="createTime">
  122. <el-input
  123. v-model="createTimeText"
  124. placeholder="请选择创建时间"
  125. readonly
  126. @click.native="showCreateCalendar = true"
  127. />
  128. <calendar
  129. v-model="createTime"
  130. mode="during"
  131. :show.sync="showCreateCalendar"
  132. @change="createChange"
  133. :key="createCalendarKey"
  134. />
  135. </el-form-item>
  136. <!-- 最新更新时间 -->
  137. <el-form-item label="最新更新时间" prop="updateTime">
  138. <el-input
  139. v-model="updateTimeText"
  140. placeholder="请选择更新时间"
  141. readonly
  142. @click.native="showUpdateCalendar = true"
  143. />
  144. <calendar
  145. v-model="updateTime"
  146. mode="during"
  147. :show.sync="showUpdateCalendar"
  148. @change="updateChange"
  149. :key="updateCalendarKey"
  150. />
  151. </el-form-item>
  152. <!-- 进线时间 -->
  153. <el-form-item label="进线时间" prop="qecCreateTime">
  154. <el-input
  155. v-model="qecCreateTimeText"
  156. placeholder="请选择进线时间"
  157. readonly
  158. @click.native="showQecCalendar = true"
  159. />
  160. <calendar
  161. v-model="qecCreateTime"
  162. mode="during"
  163. :show.sync="showQecCalendar"
  164. @change="qecCreateTimeChange"
  165. :key="qecCalendarKey"
  166. />
  167. </el-form-item>
  168. <el-form-item label="是否为会员" prop="isVip">
  169. <el-select
  170. filterable
  171. v-model="queryParams.isVip"
  172. placeholder="请选择是否为会员"
  173. clearable size="small">
  174. <el-option
  175. v-for="dict in isVipList"
  176. :key="dict.dictValue"
  177. :label="dict.dictLabel"
  178. :value="dict.dictValue"
  179. />
  180. </el-select>
  181. </el-form-item>
  182. <el-form-item>
  183. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  184. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  185. </el-form-item>
  186. </el-form>
  187. <el-row :gutter="10" class="mb8">
  188. <el-col :span="1.5" v-if="queryParams.sendType == 2">
  189. <el-button
  190. type="warning"
  191. plain
  192. icon="el-icon-download"
  193. size="mini"
  194. :loading="exportLoading"
  195. @click="handleExport"
  196. v-hasPermi="['course:courseWatchLog:export']"
  197. >导出</el-button>
  198. <el-col :span="1.5" v-if="queryParams.sendType == 2">
  199. <el-button
  200. type="primary"
  201. plain
  202. size="mini"
  203. @click="addUserTag"
  204. v-hasPermi="['qw:externalContact:addTag']"
  205. >批量添加标签</el-button>
  206. </el-col>
  207. <el-col :span="1.5">
  208. <el-button
  209. type="primary"
  210. plain
  211. size="mini"
  212. @click="delUserTag"
  213. v-hasPermi="['qw:externalContact:delTag']"
  214. >批量移除标签</el-button>
  215. </el-col>
  216. </el-col>
  217. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  218. </el-row>
  219. <el-tabs type="card" v-model="activeName" @tab-click="handleClickX">
  220. <el-tab-pane label="全部" name="00"></el-tab-pane>
  221. <el-tab-pane v-for="(item,index) in logTypeOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  222. </el-tabs>
  223. <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange">
  224. <el-table-column type="selection" width="55" align="center" />
  225. <el-table-column label="记录编号" align="center" prop="logId" />
  226. <el-table-column label="用户昵称" align="center">
  227. <template slot-scope="scope">
  228. {{ queryParams.sendType=='1' ? scope.row.fsNickName : scope.row.externalUserName }}
  229. </template>
  230. </el-table-column>
  231. <el-table-column label="头像" align="center">
  232. <template slot-scope="scope">
  233. <img v-if="queryParams.sendType=='1'" :src="scope.row.fsAvatar" style="width:50px;height:50px" />
  234. <img v-else :src="scope.row.externalUserAvatar" style="width:50px;height:50px" />
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="会员ID" align="center" prop="userId" />
  238. <el-table-column label="会员昵称" align="center" prop="fsNickName">
  239. <template slot-scope="scope">
  240. <div style="display: flex;white-space: nowrap">
  241. <div style="margin: auto">
  242. {{scope.row.fsNickName}}
  243. </div>
  244. <el-popover
  245. placement="right"
  246. title=""
  247. trigger="hover">
  248. <img slot="reference" :src="scope.row.fsAvatar" style="width: 30px;height: 30px">
  249. <img :src="scope.row.fsAvatar" style="max-width: 200px;max-height: 200px">
  250. </el-popover>
  251. </div>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="课程名称" align="center" prop="courseName" />
  255. <el-table-column label="小节名称" align="center" prop="videoName" />
  256. <el-table-column label="记录类型" align="center" prop="logType">
  257. <template slot-scope="scope">
  258. <dict-tag :options="logTypeOptions" :value="scope.row.logType"/>
  259. </template>
  260. </el-table-column>
  261. <el-table-column label="播放时长" align="center" prop="duration" />
  262. <el-table-column label="所属销售" align="center" prop="companyUserName" />
  263. <!-- <el-table-column label="所属公司" align="center" prop="companyName" />-->
  264. <el-table-column label="所属企微" align="center" prop="qwUserName" v-if="queryParams.sendType==2" />
  265. <!-- <el-table-column label="所属发送方式" align="center" prop="sendType" />-->
  266. <el-table-column label="创建时间" align="center" prop="createTime" />
  267. <el-table-column label="更新时间" align="center" prop="updateTime" />
  268. <el-table-column label="完课时间" align="center" prop="finishTime" />
  269. <el-table-column label="营期时间" align="center" prop="campPeriodTime" />
  270. <el-table-column label="进线时间" align="center" prop="qecCreateTime" />
  271. <el-table-column
  272. fixed="right"
  273. label="操作"
  274. width="100">
  275. <template slot-scope="scope">
  276. <el-button @click="openAnswerLogFun(scope.row)" type="text" size="small">答题记录</el-button>
  277. <el-button @click="openRedLogFun(scope.row)" type="text" size="small">红包记录</el-button>
  278. </template>
  279. </el-table-column>
  280. </el-table>
  281. <pagination
  282. v-show="total>0"
  283. :total="total"
  284. :page.sync="queryParams.pageNum"
  285. :limit.sync="queryParams.pageSize"
  286. @pagination="getList"
  287. />
  288. <el-drawer title="答题记录" :visible.sync="openAnswerLog" size="70%" append-to-body>
  289. <el-table border v-loading="" :data="answerLogsList">
  290. <el-table-column label="会员用户" align="center" prop="userName">
  291. <template slot-scope="scope">
  292. <div style="display: flex;white-space: nowrap">
  293. <div style="margin: auto">
  294. {{ scope.row.userName }}
  295. </div>
  296. <el-popover
  297. placement="right"
  298. title=""
  299. trigger="hover">
  300. <img slot="reference" :src="scope.row.fsAvatar" style="width: 30px;height: 30px">
  301. <img :src="scope.row.fsAvatar" style="max-width: 200px;max-height: 200px">
  302. </el-popover>
  303. </div>
  304. </template>
  305. </el-table-column>
  306. <el-table-column label="课程名称" align="center" prop="courseName"/>
  307. <el-table-column label="小节名称" align="center" prop="videoName"/>
  308. <el-table-column label="是否全部正确" align="center" prop="isRight">
  309. <template slot-scope="scope">
  310. <dict-tag :options="sysCompanyOr" :value="scope.row.isRight"></dict-tag>
  311. </template>
  312. </el-table-column>
  313. <el-table-column label="销售名称" align="center" prop="companyUserName"/>
  314. <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>
  315. <el-table-column label="公司名称" align="center" prop="companyName"/>
  316. <el-table-column label="创建时间" align="center" prop="createTime"/>
  317. </el-table>
  318. <pagination
  319. v-show="answerLogTotal>0"
  320. :total="answerLogTotal"
  321. :page.sync="answerLogQueryParams.pageNum"
  322. :limit.sync="answerLogQueryParams.pageSize"
  323. @pagination="answerLogList"
  324. />
  325. </el-drawer>
  326. <el-drawer title="红包记录" :visible.sync="openRedLog" size="70%" append-to-body>
  327. <el-table border v-loading="" :data="redLogsList">
  328. <el-table-column type="selection" width="55" align="center" />
  329. <el-table-column label="记录编号" align="center" prop="logId" />
  330. <el-table-column label="批次单号" align="center" prop="outBatchNo" />
  331. <el-table-column label="课程名称" align="center" prop="courseId" >
  332. <template slot-scope="scope">
  333. <span prop="status" v-for="(item, index) in courseLists" v-if="scope.row.courseId==item.dictValue">{{item.dictLabel}}</span>
  334. </template>
  335. </el-table-column>
  336. <el-table-column label="小节名称" align="center" prop="title" />
  337. <!-- <el-table-column label="会员id" align="center" prop="userId" />-->
  338. <el-table-column label="会员用户" align="center" prop="fsNickName">
  339. <template slot-scope="scope">
  340. <div style="display: flex;white-space: nowrap">
  341. <div style="margin: auto">
  342. {{scope.row.fsNickName}}
  343. </div>
  344. <el-popover
  345. placement="right"
  346. title=""
  347. trigger="hover">
  348. <img slot="reference" :src="scope.row.fsAvatar" style="width: 30px;height: 30px">
  349. <img :src="scope.row.fsAvatar" style="max-width: 200px;max-height: 200px">
  350. </el-popover>
  351. </div>
  352. </template>
  353. </el-table-column>
  354. <!-- <el-table-column label="会员电话" align="center" prop="phone" />-->
  355. <!-- <el-table-column label="所属销售" align="center" prop="companyUserName" />-->
  356. <!-- <el-table-column label="所属公司" align="center" prop="companyName" />-->
  357. <el-table-column label="转帐金额" align="center" prop="amount" />
  358. <el-table-column label="状态" align="center" prop="status" >
  359. <template slot-scope="scope">
  360. <el-tag>
  361. {{
  362. scope.row.status === 0 ? "发送中" :
  363. scope.row.status === 2 ? "待补发" :
  364. "已完成"
  365. }}
  366. </el-tag>
  367. </template>
  368. </el-table-column>
  369. <el-table-column label="所属企微" align="center" prop="qwUserName" />
  370. <el-table-column label="创建时间" align="center" prop="createTime" />
  371. </el-table>
  372. <pagination
  373. v-show="redLogTotal>0"
  374. :total="redLogTotal"
  375. :page.sync="redLogQueryParams.pageNum"
  376. :limit.sync="redLogQueryParams.pageSize"
  377. @pagination="redLogList"
  378. />
  379. </el-drawer>
  380. <el-dialog title="批量添加标签" :visible.sync="tagOpen" width="800px" append-to-body>
  381. <div>搜索标签:
  382. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  383. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  384. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  385. </div>
  386. <el-form ref="form" :model="addTagFormByWatch" label-width="80px">
  387. <div v-for="item in tagGroupList" :key="item.id" >
  388. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  389. <span class="name-background">{{ item.name }}</span>
  390. </div>
  391. <!-- 添加外层滚动容器 -->
  392. <div class="scroll-wrapper">
  393. <div class="tag-container">
  394. <a
  395. v-for="tagItem in item.tag"
  396. class="tag-box"
  397. @click="tagSelection(tagItem)"
  398. :class="{ 'tag-selected': tagItem.isSelected }"
  399. >
  400. {{ tagItem.name }}
  401. </a>
  402. </div>
  403. </div>
  404. <!-- <div class="tag-container">-->
  405. <!-- <a-->
  406. <!-- v-for="tagItem in item.tag"-->
  407. <!-- class="tag-box"-->
  408. <!-- @click="tagSelection(tagItem)"-->
  409. <!-- :class="{ 'tag-selected': tagItem.isSelected }"-->
  410. <!-- >-->
  411. <!-- {{ tagItem.name }}-->
  412. <!-- </a>-->
  413. <!-- </div>-->
  414. </div>
  415. </el-form>
  416. <pagination
  417. v-show="tagTotal>0"
  418. :total="tagTotal"
  419. :page.sync="queryTagParams.pageNum"
  420. :limit.sync="queryTagParams.pageSize"
  421. @pagination="getPageListTagGroup"
  422. />
  423. <div slot="footer" class="dialog-footer">
  424. <el-button type="primary" @click="addTagSubmitForm()">确 定</el-button>
  425. <el-button @click="addTagCancel">取 消</el-button>
  426. </div>
  427. </el-dialog>
  428. <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
  429. <div>搜索标签:
  430. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  431. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  432. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  433. </div>
  434. <el-form ref="form" :model="addTagFormByWatch" label-width="80px">
  435. <div v-for="item in tagGroupList" :key="item.id" >
  436. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  437. <span class="name-background">{{ item.name }}</span>
  438. </div>
  439. <!-- 添加外层滚动容器 -->
  440. <div class="scroll-wrapper">
  441. <div class="tag-container">
  442. <a
  443. v-for="tagItem in item.tag"
  444. class="tag-box"
  445. @click="tagSelection(tagItem)"
  446. :class="{ 'tag-selected': tagItem.isSelected }"
  447. >
  448. {{ tagItem.name }}
  449. </a>
  450. </div>
  451. </div>
  452. </div>
  453. </el-form>
  454. <pagination
  455. v-show="tagTotal>0"
  456. :total="tagTotal"
  457. :page.sync="queryTagParams.pageNum"
  458. :limit.sync="queryTagParams.pageSize"
  459. @pagination="getPageListTagGroup"
  460. />
  461. <div slot="footer" class="dialog-footer">
  462. <el-button type="primary" @click="tagDelSubmitForm()">确 定</el-button>
  463. <el-button @click="DelTagCancel">取 消</el-button>
  464. </div>
  465. </el-dialog>
  466. <el-dialog
  467. :title="resultTitle"
  468. :visible.sync="resultDialogVisible"
  469. width="50%"
  470. custom-class="feedback-dialog"
  471. >
  472. <pre style="white-space: pre-wrap; font-family: inherit;">{{ resultMessage }}</pre>
  473. <span slot="footer" class="dialog-footer">
  474. <el-button @click="resultDialogVisible = false">关闭</el-button>
  475. </span>
  476. </el-dialog>
  477. </div>
  478. </template>
  479. <script>
  480. import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog } from "@/api/course/courseWatchLog";
  481. import {courseList, listCourseRedPacketLog, videoList} from '@/api/course/courseRedPacketLog'
  482. import {listLogs} from "@/api/course/courseAnswerlogs";
  483. import {allListTagGroup} from "../../../api/qw/tagGroup";
  484. import {searchTags} from "../../../api/qw/tag";
  485. import {addTagByWatch, delTagByWatch} from "../../../api/qw/externalContact";
  486. import Vue from 'vue'
  487. import Calendar from 'vue-mobile-calendar'
  488. import {infoSop} from "@/api/qw/sop";
  489. import {getCompanyUserListLikeName} from "../../../api/company/companyUser";
  490. Vue.use(Calendar)
  491. export default {
  492. name: "CourseWatchLog",
  493. data() {
  494. return {
  495. // 日历 key 控制刷新
  496. scheduleCalendarKey: 0,
  497. createCalendarKey: 0,
  498. updateCalendarKey: 0,
  499. qecCalendarKey: 0,
  500. createTimeText: '',
  501. scheduleTimeText: '', // 新增
  502. updateTimeText: '', // 新增
  503. qecCreateTimeText: '', // 新增
  504. scheduleTime: [], // 改为数组
  505. createTime: [], // 改为数组
  506. updateTime: [], // 改为数组
  507. qecCreateTime: [], // 改为数组
  508. // 控制日历显隐
  509. showScheduleCalendar: false,
  510. showCreateCalendar: false,
  511. showUpdateCalendar: false,
  512. showQecCalendar: false,
  513. resultDialogVisible: false,
  514. resultMessage: '',
  515. resultTitle:'',
  516. activeName:"2",
  517. pickerOptions: {
  518. disabledDate(time) {
  519. // 获取6天前的日期(加上今天就是7天)
  520. const sixDaysAgo = new Date();
  521. sixDaysAgo.setDate(sixDaysAgo.getDate() - 6);
  522. sixDaysAgo.setHours(0, 0, 0, 0);
  523. // 获取明天的日期(不包括今天)
  524. const tomorrow = new Date();
  525. tomorrow.setDate(tomorrow.getDate() + 1);
  526. tomorrow.setHours(0, 0, 0, 0);
  527. return time.getTime() < sixDaysAgo.getTime() || time.getTime() >= tomorrow.getTime();
  528. }
  529. },
  530. courseLists:[],
  531. videoList:[],
  532. logTypeOptions:[],
  533. projectOptions:[],
  534. sendTypeOptions:[{
  535. dictLabel:"会员",dictValue:'1'
  536. },
  537. {
  538. dictLabel:"企微",dictValue:'2'
  539. }
  540. ],
  541. // 遮罩层
  542. loading: true,
  543. // 导出遮罩层
  544. exportLoading: false,
  545. // 选中数组
  546. ids: [],
  547. // 非单个禁用
  548. single: true,
  549. // 非多个禁用
  550. multiple: true,
  551. // 显示搜索条件
  552. showSearch: true,
  553. // 总条数
  554. total: 0,
  555. // 短链课程看课记录表格数据
  556. courseWatchLogList: [],
  557. // 弹出层标题
  558. title: "",
  559. // 是否显示弹出层
  560. open: false,
  561. tagOpen:false,
  562. //标签弹窗选择
  563. tagChange:{
  564. open:false,
  565. index:null,
  566. },
  567. addTagFormByWatch:{
  568. logId:[],
  569. tagIds:[]
  570. },
  571. tagGroupList: [],
  572. tagTotal:0,
  573. tagDelOpen:false,
  574. queryTagParams:{
  575. pageNum: 1,
  576. pageSize: 5,
  577. total:0,
  578. name:null,
  579. corpId:null,
  580. },
  581. //答题记录
  582. openAnswerLog: false,
  583. loadingAnswerLog: true,
  584. answerLogsList: [],
  585. answerLogTotal: 0,
  586. answerLogQueryParams: {
  587. pageNum: 1,
  588. pageSize: 10,
  589. },
  590. //红包记录
  591. openRedLog: false,
  592. loadingRedLog: true,
  593. redLogsList: [],
  594. redLogTotal: 0,
  595. redLogQueryParams: {
  596. pageNum: 1,
  597. pageSize: 10,
  598. },
  599. isVipList: [
  600. { dictLabel: '是', dictValue: 1 },
  601. { dictLabel: '否', dictValue: 0 }
  602. ],
  603. // SOP搜索相关
  604. sopSearchText: '', // SOP搜索框显示的文本
  605. selectedSopId: null, // 选中的SOP ID
  606. // 查询参数
  607. queryParams: {
  608. pageNum: 1,
  609. pageSize: 10,
  610. project: null,
  611. userId: null,
  612. nickName: null,
  613. videoId: null,
  614. logType: 2,
  615. qwExternalContactId: null,
  616. externalUserName:null,
  617. duration: null,
  618. qwUserId: null,
  619. companyUserId: null,
  620. companyId: null,
  621. courseId: null,
  622. sTime:null,
  623. eTime:null,
  624. upSTime:null,
  625. upETime:null,
  626. qecSTime:null,
  627. qecETime:null,
  628. scheduleStartTime: null,
  629. scheduleEndTime: null,
  630. sendType:process.env.VUE_APP_COURSE_DEFAULT,
  631. isVip: null,
  632. sopId: null, // sopId
  633. },
  634. // 表单参数
  635. form: {},
  636. // 表单校验
  637. rules: {
  638. },
  639. // 员工选项列表
  640. companyUserOptionsParams: {
  641. name: undefined,
  642. hasNextPage: false,
  643. pageNum: 1,
  644. pageSize: 10
  645. },
  646. companyUserOptions: [],
  647. companyUserOptionsLoading: false,
  648. };
  649. },
  650. created() {
  651. courseList().then(response => {
  652. this.courseLists = response.list;
  653. });
  654. this.getList();
  655. this.getDicts("sys_course_watch_log_type").then(response => {
  656. this.logTypeOptions = response.data;
  657. });
  658. this.getDicts("sys_course_project").then(response => {
  659. this.projectOptions = response.data;
  660. });
  661. },
  662. methods: {
  663. /**
  664. * 根据名称模糊查询用户列表
  665. * @param query 参数
  666. */
  667. loadCompanyUserOptions(query) {
  668. this.companyUserOptions = [];
  669. if (query === '') {
  670. return;
  671. }
  672. this.companyUserOptionsParams.pageNum = 1
  673. this.companyUserOptionsParams.name = query
  674. this.companyUserOptionsLoading = true;
  675. this.getCompanyUserListLikeName()
  676. },
  677. /**
  678. * 加载更多员工选项
  679. */
  680. loadMoreCompanyUserOptions() {
  681. if (!this.companyUserOptionsParams.hasNextPage) {
  682. return;
  683. }
  684. this.companyUserOptionsParams.pageNum += 1
  685. this.getCompanyUserListLikeName()
  686. },
  687. /**
  688. * 获取员工列表
  689. */
  690. getCompanyUserListLikeName() {
  691. getCompanyUserListLikeName(this.companyUserOptionsParams).then(response => {
  692. this.companyUserOptions = [...this.companyUserOptions, ...response.data.list]
  693. this.companyUserOptionsParams.hasNextPage = response.data.hasNextPage
  694. this.companyUserOptionsLoading = false;
  695. });
  696. },
  697. // 重置日历组件
  698. resetCalendars() {
  699. this.scheduleTime = [];
  700. this.createTime = [];
  701. this.updateTime = [];
  702. this.qecCreateTime = [];
  703. this.scheduleTimeText = '';
  704. this.createTimeText = '';
  705. this.updateTimeText = '';
  706. this.qecCreateTimeText = '';
  707. // 强制刷新日历组件
  708. this.scheduleCalendarKey++;
  709. this.createCalendarKey++;
  710. this.updateCalendarKey++;
  711. this.qecCalendarKey++;
  712. },
  713. formatDateRange(dates) {
  714. if (!dates || dates.length < 2) return '';
  715. return dates.map(date => date.format('YYYY-MM-DD')).join(' ~ ');
  716. },
  717. courseChange(row){
  718. this.queryParams.videoId=null;
  719. if(row === ''){
  720. this.videoList=[];
  721. return
  722. }
  723. videoList(row).then(response => {
  724. this.videoList=response.list
  725. });
  726. },
  727. // 营期时间
  728. handleScheduleTimeChange(scheduleTime) {
  729. if (scheduleTime && scheduleTime.length >= 2) {
  730. this.scheduleTimeText = this.formatDateRange(scheduleTime);
  731. this.queryParams.scheduleStartTime = scheduleTime.map(date => date.format('YYYY-MM-DD'))[0] || null;
  732. this.queryParams.scheduleEndTime = scheduleTime.map(date => date.format('YYYY-MM-DD'))[1] || null;
  733. console.log(this.queryParams.scheduleStartTime)
  734. console.log(this.queryParams.scheduleEndTime)
  735. } else {
  736. this.scheduleTimeText = '';
  737. this.queryParams.scheduleStartTime = null;
  738. this.queryParams.scheduleEndTime = null;
  739. }
  740. },
  741. // 创建时间
  742. createChange(createTime) {
  743. if (createTime && createTime.length >= 2) {
  744. this.createTimeText = this.formatDateRange(createTime);
  745. this.queryParams.sTime = createTime.map(date => date.format('YYYY-MM-DD'))[0] || null;
  746. this.queryParams.eTime = createTime.map(date => date.format('YYYY-MM-DD'))[1] || null;
  747. } else {
  748. this.createTimeText = '';
  749. this.queryParams.sTime = null;
  750. this.queryParams.eTime = null;
  751. }
  752. },
  753. // 更新时间
  754. updateChange(updateTime) {
  755. if (updateTime && updateTime.length >= 2) {
  756. this.updateTimeText = this.formatDateRange(updateTime);
  757. this.queryParams.upSTime = updateTime.map(date => date.format('YYYY-MM-DD'))[0] || null;
  758. this.queryParams.upETime = updateTime.map(date => date.format('YYYY-MM-DD'))[1] || null;
  759. } else {
  760. this.updateTimeText = '';
  761. this.queryParams.upSTime = null;
  762. this.queryParams.upETime = null;
  763. }
  764. },
  765. // 进线时间
  766. qecCreateTimeChange(qecCreateTime) {
  767. if (qecCreateTime && qecCreateTime.length >= 2) {
  768. // 检查选择的日期范围是否超过7天(包括起始和结束日期)
  769. const startDate = new Date(qecCreateTime[0]);
  770. const endDate = new Date(qecCreateTime[1]);
  771. // 设置时间为当天开始,避免时间部分影响计算
  772. startDate.setHours(0, 0, 0, 0);
  773. endDate.setHours(0, 0, 0, 0);
  774. const timeDiff = Math.abs(endDate - startDate);
  775. const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
  776. // 如果超过6天的范围(总共7天,包括起始日)
  777. if (diffDays > 6) {
  778. this.$message.error('进线时间选择范围不能超过7天');
  779. // 清空选择
  780. this.qecCreateTime = [];
  781. this.qecCreateTimeText = '';
  782. this.queryParams.qecSTime = null;
  783. this.queryParams.qecETime = null;
  784. this.qecCalendarKey++;
  785. return;
  786. }
  787. this.qecCreateTimeText = this.formatDateRange(qecCreateTime);
  788. this.queryParams.qecSTime = qecCreateTime.map(date => date.format('YYYY-MM-DD'))[0] || null;
  789. this.queryParams.qecETime = qecCreateTime.map(date => date.format('YYYY-MM-DD'))[1] || null;
  790. } else {
  791. this.qecCreateTimeText = '';
  792. this.queryParams.qecSTime = null;
  793. this.queryParams.qecETime = null;
  794. }
  795. },
  796. handleClickX(tab,event){
  797. this.activeName=tab.name;
  798. if(tab.name=="00"){
  799. this.queryParams.logType=null;
  800. }else{
  801. this.queryParams.logType=tab.name;
  802. }
  803. this.getList()
  804. },
  805. /** 查询短链课程看课记录列表 */
  806. getList() {
  807. this.loading = true;
  808. if(this.queryParams.logType == "10"){
  809. this.queryParams.logType = null;
  810. }
  811. listCourseWatchLog(this.queryParams).then(response => {
  812. this.courseWatchLogList = response.rows;
  813. this.total = response.total;
  814. this.loading = false;
  815. });
  816. },
  817. // 取消按钮
  818. cancel() {
  819. this.open = false;
  820. this.reset();
  821. },
  822. // 表单重置
  823. reset() {
  824. this.form = {
  825. logId: null,
  826. userId: null,
  827. videoId: null,
  828. logType: null,
  829. createTime: null,
  830. updateTime: null,
  831. qwExternalContactId: null,
  832. externalUserName:null,
  833. duration: null,
  834. qwUserId: null,
  835. companyUserId: null,
  836. companyId: null,
  837. courseId: null,
  838. sTime:null,
  839. eTime:null,
  840. upSTime:null,
  841. upETime:null,
  842. qecSTime:null,
  843. qecETime:null,
  844. scheduleStartTime: null,
  845. scheduleEndTime: null,
  846. };
  847. // 统一重置日历组件
  848. this.resetCalendars();
  849. this.resetForm("form");
  850. },
  851. /** 搜索按钮操作 */
  852. handleQuery() {
  853. this.queryParams.pageNum = 1;
  854. this.getList();
  855. },
  856. /** 重置按钮操作 */
  857. resetQuery() {
  858. this.resetForm("queryForm");
  859. this.queryParams.sTime = null;
  860. this.queryParams.project = null;
  861. this.queryParams.eTime = null;
  862. this.queryParams.upSTime = null;
  863. this.queryParams.upETime = null;
  864. this.queryParams.qecSTime = null;
  865. this.queryParams.qecETime = null;
  866. this.queryParams.scheduleStartTime = null;
  867. this.queryParams.scheduleEndTime = null;
  868. this.queryParams.sopId = null; // 重置SOP ID
  869. // 重置SOP搜索
  870. this.handleSopClear();
  871. // 统一重置日历组件
  872. this.resetCalendars();
  873. this.handleQuery();
  874. },
  875. // 多选框选中数据
  876. handleSelectionChange(selection) {
  877. this.ids = selection.map(item => item.logId)
  878. this.single = selection.length!==1
  879. this.multiple = !selection.length
  880. },
  881. /** 新增按钮操作 */
  882. handleAdd() {
  883. this.reset();
  884. this.open = true;
  885. this.title = "添加短链课程看课记录";
  886. },
  887. /** 修改按钮操作 */
  888. handleUpdate(row) {
  889. this.reset();
  890. const logId = row.logId || this.ids
  891. getCourseWatchLog(logId).then(response => {
  892. this.form = response.data;
  893. this.open = true;
  894. this.title = "修改短链课程看课记录";
  895. });
  896. },
  897. /** 提交按钮 */
  898. submitForm() {
  899. this.$refs["form"].validate(valid => {
  900. if (valid) {
  901. if (this.form.logId != null) {
  902. updateCourseWatchLog(this.form).then(response => {
  903. this.msgSuccess("修改成功");
  904. this.open = false;
  905. this.getList();
  906. });
  907. } else {
  908. addCourseWatchLog(this.form).then(response => {
  909. this.msgSuccess("新增成功");
  910. this.open = false;
  911. this.getList();
  912. });
  913. }
  914. }
  915. });
  916. },
  917. /** 删除按钮操作 */
  918. handleDelete(row) {
  919. const logIds = row.logId || this.ids;
  920. this.$confirm('是否确认删除短链课程看课记录编号为"' + logIds + '"的数据项?', "警告", {
  921. confirmButtonText: "确定",
  922. cancelButtonText: "取消",
  923. type: "warning"
  924. }).then(function() {
  925. return delCourseWatchLog(logIds);
  926. }).then(() => {
  927. this.getList();
  928. this.msgSuccess("删除成功");
  929. }).catch(() => {});
  930. },
  931. /** 导出按钮操作 */
  932. handleExport() {
  933. const queryParams = this.queryParams;
  934. this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
  935. confirmButtonText: "确定",
  936. cancelButtonText: "取消",
  937. type: "warning"
  938. }).then(() => {
  939. this.exportLoading = true;
  940. return exportCourseWatchLog(queryParams);
  941. }).then(response => {
  942. this.download(response.msg);
  943. this.exportLoading = false;
  944. }).catch(() => {});
  945. },
  946. openAnswerLogFun(row) {
  947. this.openAnswerLog = true;
  948. this.answerLogQueryParams.watchLogId = row.logId;
  949. this.answerLogList();
  950. },
  951. answerLogList() {
  952. this.loadingAnswerLog = true;
  953. listLogs(this.answerLogQueryParams).then(e => {
  954. this.answerLogsList = e.rows;
  955. this.answerLogTotal = e.total;
  956. this.loadingAnswerLog = false;
  957. })
  958. },
  959. openRedLogFun(row) {
  960. this.openRedLog = true;
  961. this.redLogQueryParams.watchLogId = row.logId;
  962. this.redLogList();
  963. },
  964. redLogList() {
  965. this.loadingRedLog = true;
  966. console.info("-----index",this.redLogQueryParams)
  967. listCourseRedPacketLog(this.redLogQueryParams).then(e => {
  968. this.redLogsList = e.rows;
  969. this.redLogTotal = e.total;
  970. this.loadingRedLog = false;
  971. })
  972. },
  973. handleSendTypeChange() {
  974. this.handleQuery(); // 重新查询列表
  975. },
  976. addUserTag(){
  977. if(this.ids==null||this.ids==""){
  978. return this.$message('请选择需要添加标签的客户');
  979. }
  980. this.getPageListTagGroup();
  981. setTimeout(() => {
  982. for (let i = 0; i < this.tagGroupList.length; i++) {
  983. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  984. this.tagGroupList[i].tag[x].isSelected=false;
  985. }
  986. }
  987. }, 200);
  988. this.tagOpen = true;
  989. },
  990. delUserTag(){
  991. if(this.ids==null||this.ids==""){
  992. return this.$message('请选择需要移除标签的客户');
  993. }
  994. this.getPageListTagGroup();
  995. setTimeout(() => {
  996. for (let i = 0; i < this.tagGroupList.length; i++) {
  997. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  998. this.tagGroupList[i].tag[x].isSelected=false;
  999. }
  1000. }
  1001. }, 200);
  1002. this.tagDelOpen = true;
  1003. },
  1004. getPageListTagGroup(){
  1005. this.queryTagParams.corpId=this.queryParams.corpId
  1006. allListTagGroup(this.queryTagParams).then(response => {
  1007. this.tagGroupList = response.rows;
  1008. this.tagTotal = response.total;
  1009. });
  1010. },
  1011. tagSelection(row){
  1012. row.isSelected= !row.isSelected;
  1013. this.$forceUpdate();
  1014. },
  1015. handleSearchTags(name){
  1016. if (!name){
  1017. return this.$message.error("请输入要搜索的标签")
  1018. }
  1019. this.queryTagParams.name=name;
  1020. this.queryTagParams.corpId=this.queryParams.corpId;
  1021. searchTags(this.queryTagParams).then(response => {
  1022. this.tagGroupList = response.rows;
  1023. });
  1024. // searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  1025. // this.tagGroupList = response.rows;
  1026. // });
  1027. },
  1028. cancelSearchTags(){
  1029. this.resetSearchQueryTag()
  1030. this.getPageListTagGroup();
  1031. },
  1032. resetSearchQueryTag(){
  1033. this.queryTagParams= {
  1034. pageNum: 1,
  1035. pageSize: 5,
  1036. total:0,
  1037. name:null,
  1038. };
  1039. },
  1040. addTagSubmitForm(){
  1041. for (let i = 0; i < this.tagGroupList.length; i++) {
  1042. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1043. if(this.tagGroupList[i].tag[x].isSelected==true){
  1044. this.addTagFormByWatch.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1045. }
  1046. }
  1047. }
  1048. if(this.addTagFormByWatch.tagIds==[]||this.addTagFormByWatch.tagIds==null||this.addTagFormByWatch.tagIds==""){
  1049. return this.$message('请选择标签');
  1050. }
  1051. this.addTagFormByWatch.logIds=this.ids;
  1052. let loadingRock = this.$loading({
  1053. lock: true,
  1054. text: '正在执行中请稍后~~请不要刷新页面!!',
  1055. spinner: 'el-icon-loading',
  1056. background: 'rgba(0, 0, 0, 0.7)'
  1057. });
  1058. addTagByWatch(this.addTagFormByWatch).then(response => {
  1059. // this.msgSuccess(response.msg);
  1060. this.resultMessage = response.msg;
  1061. this.resultDialogVisible = true; // 显示弹窗
  1062. this.resultTitle = '批量添加标签结果';
  1063. this.tagOpen = false;
  1064. loadingRock.close();
  1065. this.addTagFormByWatch={
  1066. logIds:[],
  1067. tagIds:[]
  1068. };
  1069. this.getList()
  1070. }).finally(res=>{
  1071. loadingRock.close();
  1072. });
  1073. },
  1074. tagDelSubmitForm(){
  1075. for (let i = 0; i < this.tagGroupList.length; i++) {
  1076. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1077. if(this.tagGroupList[i].tag[x].isSelected==true){
  1078. this.addTagFormByWatch.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1079. }
  1080. }
  1081. }
  1082. if(this.addTagFormByWatch.tagIds==[]||this.addTagFormByWatch.tagIds==null||this.addTagFormByWatch.tagIds==""){
  1083. return this.$message('请选择标签');
  1084. }
  1085. this.addTagFormByWatch.corpId=this.queryParams.corpId
  1086. this.addTagFormByWatch.logIds=this.ids;
  1087. let loadingRock = this.$loading({
  1088. lock: true,
  1089. text: '正在执行中请稍后~~请不要刷新页面!!',
  1090. spinner: 'el-icon-loading',
  1091. background: 'rgba(0, 0, 0, 0.7)'
  1092. });
  1093. delTagByWatch(this.addTagFormByWatch).then(response => {
  1094. // this.msgSuccess(response.msg);
  1095. this.resultMessage = response.msg;
  1096. this.resultDialogVisible = true; // 显示弹窗
  1097. this.resultTitle = '批量移除标签结果';
  1098. this.tagDelOpen = false;
  1099. loadingRock.close();
  1100. this.addTagFormByWatch={
  1101. userIds:[],
  1102. tagIds:[]
  1103. };
  1104. this.getList()
  1105. }).finally(res=>{
  1106. loadingRock.close();
  1107. });
  1108. },
  1109. addTagCancel() {
  1110. this.tagOpen = false;
  1111. this.addTagFormByWatch={
  1112. logIds:[],
  1113. tagIds:[]
  1114. };
  1115. },
  1116. DelTagCancel() {
  1117. this.tagDelOpen = false;
  1118. this.addTagFormByWatch={
  1119. logIds:[],
  1120. tagIds:[]
  1121. };
  1122. },
  1123. /**
  1124. * 异步查询SOP列表
  1125. * @param {string} queryString - 查询字符串
  1126. * @param {function} callback - 回调函数
  1127. */
  1128. querySopAsync(queryString, callback) {
  1129. if (!queryString) {
  1130. callback([]);
  1131. return;
  1132. }
  1133. infoSop({ name: queryString }).then(response => {
  1134. if (response && response.rows) {
  1135. const suggestions = response.rows.map(item => ({
  1136. value: item.name,
  1137. id: item.id,
  1138. name: item.name
  1139. }));
  1140. callback(suggestions);
  1141. } else {
  1142. callback([]);
  1143. }
  1144. }).catch(error => {
  1145. console.error('通过sop查询失败:', error);
  1146. callback([]);
  1147. });
  1148. },
  1149. /**
  1150. * 选择SOP
  1151. * @param {object} item - 选中的SOP项
  1152. */
  1153. handleSopSelect(item) {
  1154. this.selectedSopId = item.id;
  1155. this.queryParams.sopId = item.id;
  1156. this.sopSearchText = item.name;
  1157. },
  1158. /**
  1159. * 清空SOP选择
  1160. */
  1161. handleSopClear() {
  1162. this.selectedSopId = null;
  1163. this.queryParams.sopId = null;
  1164. this.sopSearchText = '';
  1165. },
  1166. }
  1167. };
  1168. </script>
  1169. <style scoped>
  1170. /* CSS 样式 */
  1171. .tag-container {
  1172. display: flex;
  1173. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1174. gap: 8px; /* 设置标签之间的间距 */
  1175. }
  1176. .name-background {
  1177. display: inline-block;
  1178. background-color: #abece6; /* 背景颜色 */
  1179. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1180. border-radius: 4px; /* 可选:设置圆角 */
  1181. }
  1182. /* CSS 样式 */
  1183. .tag-container {
  1184. display: flex;
  1185. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1186. gap: 8px; /* 设置标签之间的间距 */
  1187. }
  1188. .name-background {
  1189. display: inline-block;
  1190. background-color: #abece6; /* 背景颜色 */
  1191. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1192. border-radius: 4px; /* 可选:设置圆角 */
  1193. }
  1194. .tag-box {
  1195. padding: 8px 12px;
  1196. border: 1px solid #989797;
  1197. border-radius: 4px;
  1198. cursor: pointer;
  1199. display: inline-block;
  1200. }
  1201. .tag-selected {
  1202. background-color: #00bc98;
  1203. color: #fff;
  1204. border-color: #00bc98;
  1205. }
  1206. .el-tag + .el-tag {
  1207. margin-left: 10px;
  1208. }
  1209. /* SOP搜索框样式 */
  1210. .sop-item {
  1211. display: flex;
  1212. align-items: center;
  1213. }
  1214. .sop-name {
  1215. font-size: 14px;
  1216. color: #606266;
  1217. }
  1218. .button-new-tag {
  1219. margin-left: 10px;
  1220. height: 32px;
  1221. line-height: 30px;
  1222. padding-top: 0;
  1223. padding-bottom: 0;
  1224. }
  1225. .input-new-tag {
  1226. width: 90px;
  1227. margin-left: 10px;
  1228. vertical-align: bottom;
  1229. }
  1230. /* 新增的滚动容器样式(不影响原有样式) */
  1231. .scroll-wrapper {
  1232. max-height: 130px; /* 大约三行的高度 */
  1233. overflow-y: auto; /* 垂直滚动 */
  1234. padding-right: 5px; /* 为滚动条留出空间 */
  1235. }
  1236. /* 美化滚动条(可选) */
  1237. .scroll-wrapper::-webkit-scrollbar {
  1238. width: 6px;
  1239. }
  1240. .scroll-wrapper::-webkit-scrollbar-thumb {
  1241. background: rgba(0, 0, 0, 0.2);
  1242. border-radius: 3px;
  1243. }
  1244. </style>