index.vue 43 KB

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