index.vue 64 KB

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