sopUserLogsInfoDetails.vue 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472
  1. <template>
  2. <div class="app-container">
  3. <el-alert
  4. title="注意事项"
  5. type="warning"
  6. :closable="false"
  7. show-icon>
  8. <template #title>
  9. <span style="font-size: 20px; line-height: 1.5;">
  10. 搜索【客户备注】【标签】【进线时间】【客户等级】 只能搜索/筛选出 【当前页】的数据)【可以用客户id来搜(客户id来源-》企微/我的企微客户-》列表的企微客户ID)】
  11. </span>
  12. </template>
  13. </el-alert>
  14. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  15. <!-- <el-form-item label="企微员工账号" prop="qwUserId">-->
  16. <!-- <el-input-->
  17. <!-- v-model="queryParams.qwUserId"-->
  18. <!-- placeholder="请输入企微员工账号"-->
  19. <!-- clearable-->
  20. <!-- size="small"-->
  21. <!-- @keyup.enter.native="handleQuery"-->
  22. <!-- />-->
  23. <!-- </el-form-item>-->
  24. <el-form-item label="客户名称" prop="externalUserName">
  25. <el-input
  26. v-model="queryParams.externalUserName"
  27. placeholder="请输入客户名称"
  28. clearable
  29. size="small"
  30. @keyup.enter.native="handleQuery"
  31. />
  32. </el-form-item>
  33. <el-form-item label="客户备注" prop="remark">
  34. <el-input
  35. v-model="queryParams.remark"
  36. placeholder="请输入客户备注"
  37. clearable
  38. size="small"
  39. @keyup.enter.native="handleQuery"
  40. />
  41. </el-form-item>
  42. <el-form-item label="客户id" prop="externalId">
  43. <el-input
  44. v-model="queryParams.externalId"
  45. placeholder="请输入企微客户id"
  46. clearable
  47. size="small"
  48. @keyup.enter.native="handleQuery"
  49. />
  50. </el-form-item>
  51. <el-form-item label="客户等级" prop="level">
  52. <el-select v-model="queryParams.level" placeholder="客户等级" clearable size="small">
  53. <el-option
  54. v-for="dict in ratingType"
  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="entryTime" v-if="queryParams.filterMode == 1">
  62. <el-date-picker clearable size="small"
  63. v-model="queryParams.entryTime"
  64. type="date"
  65. value-format="yyyy-MM-dd"
  66. placeholder="选择营期时间">
  67. </el-date-picker>
  68. </el-form-item>
  69. <el-form-item label="官方群发需求" prop="fsUserIdStatus">
  70. <el-select style="width: 200px" v-model="queryParams.fsUserIdStatus" placeholder="请选择" clearable size="small" >
  71. <el-option
  72. v-for="item in statusOptions"
  73. :key="item.dictValue"
  74. :label="item.dictLabel"
  75. :value="item.dictValue"
  76. />
  77. </el-select>
  78. </el-form-item>
  79. <el-form-item label="标签" prop="tagIds">
  80. <!-- <el-select v-model="selectTags" remote multiple placeholder="请选择" filterable style="width: 100%;">-->
  81. <!-- <el-option-->
  82. <!-- v-for="dict in tagList"-->
  83. <!-- :label="dict.name"-->
  84. <!-- :value="dict.tagId">-->
  85. <!-- </el-option>-->
  86. <!-- </el-select>-->
  87. <div @click="hangleChangeTags()" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">
  88. <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
  89. <el-tag type="success"
  90. closable
  91. :disable-transitions="false"
  92. v-for="list in this.selectTags"
  93. :key="list.tagId"
  94. @close="handleCloseTags(list)"
  95. style="margin: 3px;"
  96. >{{list.name}}
  97. </el-tag>
  98. </div>
  99. </div>
  100. </el-form-item>
  101. <el-form-item>
  102. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  103. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  104. </el-form-item>
  105. </el-form>
  106. <el-row :gutter="10" class="mb8" v-if="queryParams.filterMode == 1">
  107. <el-col :span="1.5">
  108. <el-button
  109. type="warning"
  110. icon="el-icon-s-promotion"
  111. size="medium"
  112. :disabled="multiple"
  113. @click="handleSendMsg"
  114. v-hasPermi="['qw:sopUserLogsInfo:msg']"
  115. >一键群发</el-button>
  116. </el-col>
  117. <el-col :span="1.5">
  118. <el-button
  119. type="danger"
  120. plain
  121. icon="el-icon-delete"
  122. size="medium"
  123. :disabled="multiple"
  124. @click="handleUpdate"
  125. v-hasPermi="['qw:sopUserLogsInfo:edit']"
  126. >批量修改客户营期</el-button>
  127. </el-col>
  128. </el-row>
  129. <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="queryParams.filterMode == 1">
  130. <i class="el-icon-info"></i>
  131. 【一键群发】:用于给 选中的 客户 发送插件信息
  132. </div>
  133. <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="queryParams.filterMode == 1">
  134. <i class="el-icon-info"></i>
  135. 【批量修改客户营期】:选中 相应的客户 修改到 想进的相应的营期
  136. </div>
  137. <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="queryParams.filterMode == 1">
  138. <i class="el-icon-info"></i>
  139. 【官方群发许可】:只有这里显示为【是】的,才能通过模板中的 官方群发 来发送(允许条件是 客户点击过【非官方群发】发送的课程!)
  140. </div>
  141. <el-table border v-loading="loading" :data="sopUserLogsInfoList" @selection-change="handleSelectionChange" v-if="queryParams.filterMode == 1">
  142. <el-table-column type="selection" width="55" align="center" />
  143. <el-table-column label="编号" align="center" prop="id" width="100"/>
  144. <!-- <el-table-column label="企微员工账号" align="center" prop="qwUserId" width="100"/>-->
  145. <el-table-column label="客户ID" align="center" prop="externalId" width="100"/>
  146. <!-- <el-table-column label="客户小程序id" align="center" prop="fsUserId" width="100">-->
  147. <!-- <template slot-scope="scope">-->
  148. <!-- <el-tag type="success">-->
  149. <!-- {{ scope.row.fsUserId === 0 || scope.row.fsUserId === null ? '无' : scope.row.fsUserId }}-->
  150. <!-- </el-tag>-->
  151. <!-- </template>-->
  152. <!-- </el-table-column>-->
  153. <el-table-column label="客户名称" align="center" prop="externalUserName" />
  154. <el-table-column label="备注" align="center" prop="remark" />
  155. <el-table-column label="客户标签" align="center" prop="tagIdsName" width="250px">
  156. <template slot-scope="scope">
  157. <div v-for="name in scope.row.tagIdsName" style="display: inline;">
  158. <el-tag type="success">{{ name }}</el-tag>
  159. </div>
  160. </template>
  161. </el-table-column>
  162. <el-table-column label="官方群发许可" align="center" prop="fsUserId" width="70">
  163. <!-- 表头提示 -->
  164. <template slot="header">
  165. <el-tooltip effect="dark" content="即点过小程序链接的,通过插件助手发过一次课,且客户观看了的" placement="top">
  166. <span>官方群发许可</span>
  167. </el-tooltip>
  168. </template>
  169. <!-- 单元格提示 -->
  170. <template slot-scope="scope">
  171. <el-tooltip
  172. effect="dark"
  173. :content="`通过插件助手发过一次课,且客户观看了的`"
  174. placement="top"
  175. >
  176. <el-tag v-if="scope.row.fsUserId > 0" type="success">是</el-tag>
  177. <el-tag v-else type="danger">否</el-tag>
  178. </el-tooltip>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="客户等级" align="center" prop="levelName" width="180"/>
  182. <el-table-column label="进线时间" align="center" prop="inComTime" width="180"/>
  183. <el-table-column label="添加日期" align="center" prop="createTime" width="180"/>
  184. <el-table-column label="添加时间" align="center" prop="crtTime" width="180"/>
  185. <el-table-column label="修改时间" align="center" prop="updateTime" width="180"/>
  186. <!-- <el-table-column label="官方群发许可" align="center" prop="fsUserId" width="70">-->
  187. <!-- <template slot-scope="scope">-->
  188. <!-- <el-tag v-if="scope.row.fsUserId > 0" type="success">是</el-tag>-->
  189. <!-- <el-tag v-else type="danger">否</el-tag>-->
  190. <!-- </template>-->
  191. <!-- </el-table-column>-->
  192. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
  193. <template slot-scope="scope">
  194. <!-- <el-button-->
  195. <!-- size="mini"-->
  196. <!-- type="text"-->
  197. <!-- icon="el-icon-edit"-->
  198. <!-- @click="handleUpdate(scope.row)"-->
  199. <!-- v-hasPermi="['qw:sopUserLogsInfo:edit']"-->
  200. <!-- >修改客户营期</el-button>-->
  201. <el-button
  202. size="mini"
  203. type="text"
  204. icon="el-icon-delete"
  205. @click="handleDelete(scope.row)"
  206. v-hasPermi="['qw:sopUserLogsInfo:remove']"
  207. >删除客户营期</el-button>
  208. </template>
  209. </el-table-column>
  210. </el-table>
  211. <el-table border v-loading="loading" :data="sopUserLogsInfoList" @selection-change="handleSelectionChange" v-if="queryParams.filterMode == 2">
  212. <el-table-column type="selection" width="55" align="center" />
  213. <el-table-column label="编号" align="center" prop="id" width="100"/>
  214. <el-table-column label="客户名称" align="center" prop="name" />
  215. <el-table-column label="备注" align="center" prop="remark" />
  216. <el-table-column label="客户标签" align="center" prop="tagIdsName" width="250px">
  217. <template slot-scope="scope">
  218. <div v-for="name in scope.row.tagIdsName" style="display: inline;">
  219. <el-tag type="success">{{ name }}</el-tag>
  220. </div>
  221. </template>
  222. </el-table-column>
  223. <el-table-column label="加群时间" align="center" prop="joinTime" width="180"/>
  224. <!-- <el-table-column label="进线时间" align="center" prop="inComTime" width="180"/>-->
  225. </el-table>
  226. <pagination-more
  227. v-show="total>0"
  228. :total="total"
  229. :page.sync="queryParams.pageNum"
  230. :limit.sync="queryParams.pageSize"
  231. @pagination="getList"
  232. />
  233. <el-dialog :title="sendMsgOpen.title" :visible.sync="sendMsgOpen.open" width="1000px" append-to-body>
  234. <el-form ref="msgForm" :model="msgForm" :rules="msgRules" label-width="100px">
  235. <el-form-item label="选择课程">
  236. <el-select v-model="msgForm.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" remote filterable @change="courseChange()">
  237. <el-option
  238. v-for="dict in courseList"
  239. :key="dict.dictValue"
  240. :label="dict.dictLabel"
  241. :value="parseInt(dict.dictValue)"
  242. />
  243. </el-select>
  244. <el-select v-model="msgForm.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" remote filterable @change="videoIdChange()" >
  245. <el-option
  246. v-for="dict in videoList"
  247. :key="dict.dictValue"
  248. :label="dict.dictLabel"
  249. :value="parseInt(dict.dictValue)"
  250. />
  251. </el-select>
  252. <el-select v-model="msgForm.courseType" placeholder="请选择消息类型" size="mini" style=" margin-right: 10px;">
  253. <el-option
  254. v-for="dict in sysFsSopWatchStatus"
  255. :key="dict.dictValue"
  256. :label="dict.dictLabel"
  257. :value="parseInt(dict.dictValue)"
  258. />
  259. </el-select>
  260. </el-form-item>
  261. <el-form-item label="规则" prop="setting" >
  262. <div v-for="(item, index) in setting" :key="index" style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
  263. <el-row>
  264. <el-col :span="22">
  265. <el-form :model="item" label-width="70px">
  266. <el-form-item label="内容类别" style="margin: 2%">
  267. <el-radio-group v-model="item.contentType">
  268. <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType" @change="handleContentTypeChange()">{{item.dictLabel}}</el-radio>
  269. </el-radio-group>
  270. </el-form-item>
  271. <el-form-item label="内容" style="margin-bottom: 2%" >
  272. <el-input
  273. v-if="item.contentType == 1"
  274. v-model="item.value"
  275. type="textarea"
  276. :rows="3"
  277. placeholder="内容"
  278. style="width: 90%; margin-top: 10px;"
  279. @keydown.native="handleKeydown($event, index)"
  280. :ref="`textarea-${index}`"
  281. >
  282. </el-input>
  283. <el-link
  284. v-if="item.contentType == 1"
  285. type="primary"
  286. @click="toggleSalesCall(index)"
  287. style="margin-top: 10px;"
  288. >
  289. {{ item.isSalesCallAdded ? '移除#客服称呼#' : '添加#客服称呼#' }}
  290. </el-link>
  291. <el-link
  292. v-if="item.contentType == 1"
  293. type="primary"
  294. @click="toggleSalesCallCustomer(index)"
  295. style="margin-top: 10px;margin-left: 2%"
  296. >
  297. {{ item.isSalesCallCustomerAdded ? '移除#客户称呼#' : '添加#客户称呼#' }}
  298. </el-link>
  299. <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150" :height="150" />
  300. <div v-if="item.contentType == 3 || item.contentType ==9 ">
  301. <el-card class="box-card">
  302. <el-form-item label="链接标题:" label-width="100px">
  303. <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
  304. </el-form-item>
  305. <el-form-item label="链接描述:" label-width="100px" >
  306. <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述" style="width: 90%;margin-top: 1%;"/>
  307. </el-form-item>
  308. <el-form-item label="链接封面:" label-width="100px">
  309. <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150" :height="150" style="margin-top: 1%;" />
  310. </el-form-item>
  311. <el-form-item label="链接地址:" label-width="100px" >
  312. <el-tag type="warning" v-model="item.isBindUrl=1">选择的课程小节 即为卡片链接地址</el-tag>
  313. </el-form-item>
  314. </el-card>
  315. </div>
  316. <div v-if="item.contentType == 4">
  317. <el-card class="box-card">
  318. <el-form-item label="标题" prop="miniprogramTitle">
  319. <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
  320. </el-form-item>
  321. <el-form-item label="封面" prop="miniprogramPicUrl">
  322. <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
  323. </el-form-item>
  324. <el-form-item label="appid" prop="miniprogramAppid" v-show="false" >
  325. <el-input v-model="item.miniprogramAppid='wx73f85f8d62769119' " disabled />
  326. </el-form-item>
  327. <el-form-item label="page路径" prop="miniprogramPage" v-show="false" label-width="100px" style="margin-left: -30px" >
  328. <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径" disabled />
  329. </el-form-item>
  330. </el-card>
  331. </div>
  332. <div v-if="item.contentType == 5 ">
  333. <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
  334. <el-upload
  335. v-model="item.fileUrl"
  336. class="avatar-uploader"
  337. :action="uploadUrl"
  338. :show-file-list="false"
  339. :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
  340. :before-upload="beforeAvatarUploadFile">
  341. <i class="el-icon-plus avatar-uploader-icon"></i>
  342. </el-upload>
  343. <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
  344. {{item.fileUrl}}
  345. </el-link>
  346. </el-form-item>
  347. </div>
  348. <div v-if="item.contentType == 6 ">
  349. <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
  350. <el-upload
  351. v-model="item.videoUrl"
  352. class="avatar-uploader"
  353. :action="uploadUrl"
  354. :show-file-list="false"
  355. :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
  356. :before-upload="beforeAvatarUploadVideo">
  357. <i class="el-icon-plus avatar-uploader-icon"></i>
  358. </el-upload>
  359. <video v-if="item.videoUrl"
  360. :src="item.videoUrl"
  361. controls style="width: 200px;height: 100px">
  362. </video>
  363. </el-form-item>
  364. </div>
  365. <div v-if="item.contentType == 7 ">
  366. <el-input
  367. v-model="item.value"
  368. type="textarea" :rows="3" maxlength="66" show-word-limit
  369. placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
  370. @input="handleInputVideoText(item.value,item)"/>
  371. </div>
  372. <div v-if="item.contentType == 8">
  373. <el-button type="primary"
  374. style="margin-bottom: 1%"
  375. @click="hanldeSelectVideoNum(setting,index)">
  376. 选择视频号
  377. </el-button>
  378. <el-card class="box-card" v-if="item.coverUrl">
  379. <el-form-item label="封面标题:" label-width="100px">
  380. <el-input v-model="item.nickname"
  381. style="width: 90%;margin-bottom: 1%" disabled/>
  382. </el-form-item>
  383. <el-form-item label="头像:" label-width="100px">
  384. <el-image
  385. v-if="item.avatar != null"
  386. :src="item.avatar"
  387. :preview-src-list="[item.avatar]"
  388. :style="{ width: '50px', height: '50px' }"
  389. ></el-image>
  390. </el-form-item>
  391. <el-form-item label="封面:" label-width="100px">
  392. <el-image
  393. v-if="item.coverUrl != null"
  394. :src="item.coverUrl"
  395. :preview-src-list="[item.coverUrl]"
  396. :style="{ width: '200px', height: '200px' }"
  397. ></el-image>
  398. </el-form-item>
  399. <el-form-item label="简介:" label-width="100px">
  400. <el-input type="textarea" :rows="3"
  401. v-model="item.desc"
  402. style="width: 90%;margin-top: 1%;" disabled/>
  403. </el-form-item>
  404. <el-form-item label="视频地址:" label-width="100px"
  405. style="margin-top: 1%">
  406. <el-input v-model="item.url"
  407. style="width: 90%;" disabled/>
  408. </el-form-item>
  409. </el-card>
  410. </div>
  411. </el-form-item>
  412. <el-form-item label="添加短链" v-if="item.contentType == 1 " >
  413. <el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark" :disabled="!!msgForm.videoId">
  414. <el-switch
  415. v-model="item.isBindUrl"
  416. :disabled="!msgForm.videoId"
  417. active-color="#13ce66"
  418. inactive-color="#DCDFE6"
  419. active-value="1"
  420. inactive-value="2">
  421. </el-switch>
  422. </el-tooltip>
  423. <span v-if="item.isBindUrl == '1'" style="margin-left: 10px; color: #13ce66">添加URL</span>
  424. <span v-if="item.isBindUrl == '2'" style="margin-left: 10px; color: #b1b4ba">不加URL</span>
  425. </el-form-item>
  426. <el-form-item label="课节过期时间" v-if="item.isBindUrl == '1'
  427. && item.contentType != 2
  428. && item.contentType != 5
  429. && item.contentType != 6
  430. && item.contentType != 8"
  431. style="margin-top: 1%" label-width="100px">
  432. <el-row>
  433. <el-input-number v-model="item.expiresDays" :min="1" :max="100" ></el-input-number>
  434. (天)
  435. </el-row>
  436. <el-row>
  437. <span class="tip">填写0或不填时,默认为系统配置的默认时间</span>
  438. </el-row>
  439. </el-form-item>
  440. </el-form>
  441. </el-col>
  442. <el-col :span="1" :offset="1">
  443. <i class="el-icon-delete" @click="delSetList(index)" style="margin-top: 20px;" v-if="setting.length>1"></i>
  444. </el-col>
  445. </el-row>
  446. </div>
  447. <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList()' >添加内容</el-link>
  448. </el-form-item>
  449. </el-form>
  450. <div slot="footer" class="dialog-footer">
  451. <el-button type="primary" @click="submitMsgForm">确 定</el-button>
  452. <el-button @click="cancelMsgForm">取 消</el-button>
  453. </div>
  454. </el-dialog>
  455. <!-- 添加或修改sopUserLogsInfo对话框 -->
  456. <el-dialog title="批量修改客户营期" :visible.sync="updateOpen" width="500px" append-to-body>
  457. <el-form ref="updateLogsInfoFrom" :model="updateLogsInfoFrom" :rules="batchRules" label-width="120px">
  458. <el-form-item label="选择营期时间" prop="paramTime">
  459. <el-date-picker clearable size="small"
  460. v-model="updateLogsInfoFrom.paramTime"
  461. type="date"
  462. value-format="yyyy-MM-dd"
  463. placeholder="选择营期时间">
  464. </el-date-picker>
  465. </el-form-item>
  466. </el-form>
  467. <div slot="footer" class="dialog-footer">
  468. <el-button type="primary" @click="submitForm">确 定</el-button>
  469. <el-button @click="cancel">取 消</el-button>
  470. </div>
  471. </el-dialog>
  472. <!-- 搜索标签 -->
  473. <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" style="width:100%;height: 100%" append-to-body>
  474. <div>搜索标签:
  475. <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  476. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>
  477. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  478. </div>
  479. <div v-for="item in tagGroupList" :key="item.id" >
  480. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  481. <span class="name-background">{{ item.name }}</span>
  482. </div>
  483. <div class="tag-container">
  484. <a
  485. v-for="tagItem in item.tag"
  486. class="tag-box"
  487. @click="tagSelection(tagItem)"
  488. :class="{ 'tag-selected': tagItem.isSelected }"
  489. >
  490. {{ tagItem.name }}
  491. </a>
  492. </div>
  493. </div>
  494. <pagination
  495. v-show="tagTotal>0"
  496. :total="tagTotal"
  497. :page.sync="queryTagParams.pageNum"
  498. :limit.sync="queryTagParams.pageSize"
  499. @pagination="getPageListTagGroup"
  500. />
  501. <div slot="footer" class="dialog-footer">
  502. <el-button type="primary" @click="tagSubmitForm()">确 定</el-button>
  503. <el-button @click="tagCancel()">取消</el-button>
  504. </div>
  505. </el-dialog>
  506. <el-dialog :title="videoNumOptions.title" :visible.sync="videoNumOptions.open" width="1500px" append-to-body>
  507. <userVideo ref="QwUserVideo" @videoResult="qwUserVideoResult"></userVideo>
  508. </el-dialog>
  509. </div>
  510. </template>
  511. <script>
  512. import {
  513. listSopUserLogsInfo,
  514. delSopUserLogsInfo,
  515. addSopUserLogsInfo,
  516. updateSopUserLogsInfo,
  517. exportSopUserLogsInfo,
  518. sendMsgSop, batchUpdateSopUserLogsInfoToTime
  519. } from "@/api/qw/sopUserLogsInfo";
  520. import ImageUpload from "@/views/qw/sop/ImageUpload.vue";
  521. import {courseList, videoList} from "@/api/qw/sop";
  522. import {addCourseFinishTemp, updateCourseFinishTemp} from "@/api/course/courseFinishTemp";
  523. import {allListTagGroup} from "@/api/qw/tagGroup";
  524. import {listTag} from "@/api/qw/tag";
  525. import {searchTags} from "../../../api/qw/tag";
  526. import userVideo from "@/views/qw/userVideo/userVideo.vue";
  527. import PaginationMore from "../../../components/PaginationMore/index.vue";
  528. export default {
  529. name: "sopUserLogsInfoDetails",
  530. components: {PaginationMore, userVideo, ImageUpload},
  531. data() {
  532. return {
  533. statusOptions:[],
  534. //上传语音的遮罩层
  535. voiceLoading :false,
  536. uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS2",
  537. uploadUrlByVoice:process.env.VUE_APP_BASE_API+"/common/uploadOSSByHOOKVoice",
  538. // 遮罩层
  539. loading: true,
  540. // 导出遮罩层
  541. exportLoading: false,
  542. // 选中数组
  543. ids: [],
  544. // 非单个禁用
  545. single: true,
  546. // 非多个禁用
  547. multiple: true,
  548. // 显示搜索条件
  549. showSearch: true,
  550. // 总条数
  551. total: 0,
  552. videoNumOptions: {
  553. title: '选择视频号',
  554. open: false,
  555. content: null,
  556. contentIndex: null,
  557. },
  558. // sopUserLogsInfo表格数据
  559. sopUserLogsInfoList: [],
  560. sysFsSopWatchStatus: [],
  561. isSalesCallAdded:false,
  562. isSalesCallCustomerAdded:false,
  563. selectTags:[],
  564. // 弹出层标题
  565. title: "",
  566. // 是否显示弹出层
  567. open: false,
  568. updateOpen:false,
  569. // 查询参数
  570. queryParams: {
  571. pageNum: 1,
  572. pageSize: 10,
  573. tagIds:null,
  574. remark:null,
  575. sopId: null,
  576. userLogsId: null,
  577. userIdParam:null,
  578. startTimeParam:null,
  579. externalContactId: null,
  580. qwUserId: null,
  581. corpId: null,
  582. externalId: null,
  583. fsUserId: null,
  584. externalUserName: null,
  585. createTime: null,
  586. entryTime: null,
  587. fsUserIdStatus:null,
  588. level:null
  589. },
  590. ratingType: [],
  591. tagGroupList: [],
  592. tagTotal:0,
  593. //标签
  594. changeTagDialog:{
  595. title:"",
  596. open:false,
  597. },
  598. queryTagParams:{
  599. pageNum: 1,
  600. pageSize: 10,
  601. total:0,
  602. name:null,
  603. corpId:null,
  604. },
  605. courseList:[],
  606. videoList:[],
  607. //插件版
  608. sysQwSopAiContentType:[],
  609. sendMsgOpen:{
  610. title:'一键批量群发',
  611. open:false,
  612. ids:null,
  613. },
  614. // 表单参数
  615. form: {},
  616. updateLogsInfoFrom:{},
  617. setting:[{contentType:'1', value: '',}],
  618. msgForm:{
  619. videoId:null,
  620. courseId:null,
  621. courseType:null,
  622. userIdParam:null,
  623. setting:null,
  624. ids:null,
  625. sopId: null,
  626. startTime: null,
  627. },
  628. // 表单校验
  629. rules: {},
  630. batchRules:{
  631. paramTime: [
  632. { required: true, message: '选择的时间不能为空', trigger: 'blur' }
  633. ],
  634. },
  635. msgRules:{},
  636. };
  637. },
  638. created() {
  639. this.getDicts("sys_qw_allow_select").then((response) => {
  640. this.statusOptions = response.data;
  641. });
  642. this.getDicts("sys_qw_sop_rating_type").then(response => {
  643. this.ratingType = response.data;
  644. });
  645. this.getDicts("sys_qwSopAi_contentType").then(response => {
  646. this.sysQwSopAiContentType = response.data;
  647. });
  648. this.getDicts("sys_fs_sop_watch_status").then(response => {
  649. this.sysFsSopWatchStatus = response.data;
  650. });
  651. courseList().then(response => {
  652. this.courseList = response.list;
  653. });
  654. },
  655. methods: {
  656. selectSopUserLogsInfo(val,externalUserName){
  657. this.loading = true;
  658. this.queryParams.sopId=val.sopId;
  659. this.queryParams.filterMode=val.filterMode;
  660. this.queryParams.userLogsId=val.id;
  661. this.queryParams.chatId=val.chatId;
  662. if (externalUserName!=null){
  663. this.queryParams.externalUserName = externalUserName;
  664. }
  665. listSopUserLogsInfo(this.queryParams).then(response => {
  666. this.sopUserLogsInfoList = response.rows;
  667. this.total = response.total;
  668. this.loading = false;
  669. });
  670. this.queryParams.qwUserId=val.qwUserId;
  671. this.queryParams.corpId=val.corpId;
  672. //用于一键群发
  673. this.queryParams.userIdParam=val.userId;
  674. this.queryParams.startTimeParam=val.startTime;
  675. this.queryParams.corpIdParam=val.corpId;
  676. },
  677. //搜索的标签
  678. hangleChangeTags(){
  679. this.changeTagDialog.title="搜索的标签"
  680. this.changeTagDialog.open=true;
  681. // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
  682. const selectedTagIds = new Set(
  683. (this.selectTags || []).map(tagItem => tagItem?.tagId)
  684. );
  685. this.queryTagParams.name=null;
  686. this.getPageListTagGroup();
  687. setTimeout(() => {
  688. for (let i = 0; i < this.tagGroupList.length; i++) {
  689. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  690. this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
  691. }
  692. }
  693. }, 200);
  694. },
  695. tagSelection(row){
  696. row.isSelected= !row.isSelected;
  697. this.$forceUpdate();
  698. },
  699. //确定选择标签
  700. tagSubmitForm(){
  701. for (let i = 0; i < this.tagGroupList.length; i++) {
  702. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  703. if (this.tagGroupList[i].tag[x].isSelected === true) {
  704. if (!this.selectTags) {
  705. this.selectTags = [];
  706. }
  707. // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
  708. let tagExists = this.selectTags.some(
  709. tag => tag.id === this.tagGroupList[i].tag[x].id
  710. );
  711. // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
  712. if (!tagExists) {
  713. this.selectTags.push(this.tagGroupList[i].tag[x]);
  714. }
  715. }
  716. }
  717. }
  718. if (!this.selectTags || this.selectTags.length === 0) {
  719. return this.$message('请选择标签');
  720. }
  721. this.changeTagDialog.open = false;
  722. },
  723. //取消选择标签
  724. tagCancel(){
  725. this.changeTagDialog.open = false;
  726. },
  727. //删除一些选择的标签
  728. handleCloseTags(list){
  729. const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);
  730. if (ls !== -1) {
  731. this.selectTags.splice(ls, 1);
  732. this.selectTags = [...this.selectTags];
  733. }
  734. if (this.selectTags!=null && this.selectTags.length>0){
  735. // 确保 this.form.tags 是数组
  736. if (!this.queryParams.tagIds) {
  737. this.queryParams.tagIds = []; // 如果未定义,初始化
  738. } else {
  739. this.queryParams.tagIds = []; // 清空已有数据
  740. }
  741. // 遍历并添加 tagId
  742. this.selectTags.forEach(tag => {
  743. if (tag.tagId) { // 确保 tagId 存在
  744. this.queryParams.tagIds.push(tag.tagId);
  745. }
  746. });
  747. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  748. }else {
  749. this.queryParams.tagIds=null;
  750. }
  751. },
  752. handleSearchTags(name){
  753. searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  754. this.tagGroupList = response.rows;
  755. });
  756. },
  757. cancelSearchTags(){
  758. this.resetSearchQueryTag()
  759. this.getPageListTagGroup();
  760. },
  761. getPageListTagGroup(){
  762. this.queryTagParams.corpId=this.queryParams.corpId
  763. allListTagGroup(this.queryTagParams).then(response => {
  764. this.tagGroupList = response.rows;
  765. this.tagTotal = response.total;
  766. });
  767. },
  768. resetSearchQueryTag(){
  769. this.queryTagParams= {
  770. pageNum: 1,
  771. pageSize: 10,
  772. total:0,
  773. name:null,
  774. };
  775. },
  776. courseChange() {
  777. if (this.msgForm.courseId != null ) {
  778. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
  779. for (let i = 0; i < this.setting.length; i++) {
  780. //响应式直接给链接的标题/封面上值
  781. if (selectedCourse && this.msgForm.courseId != null) {
  782. if ( this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ){
  783. this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
  784. this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
  785. }
  786. if ( this.setting[i].contentType == 4 ){
  787. this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
  788. }
  789. }
  790. }
  791. }
  792. videoList(this.msgForm.courseId).then(response => {
  793. this.videoList=response.list;
  794. });
  795. },
  796. videoIdChange() {
  797. if (this.msgForm.videoId != null ) {
  798. // 查找选中的课节对应的 label
  799. const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
  800. for (let i = 0; i < this.setting.length; i++) {
  801. //响应式直接给链接的描述上值
  802. if (selectedVideo && this.msgForm.videoId != null) {
  803. if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ){
  804. this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
  805. }
  806. if (this.setting[i].contentType == 4){
  807. this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
  808. }
  809. }
  810. }
  811. }
  812. },
  813. handleAvatarSuccessFile(res, file, item) {
  814. if (res.code === 200) {
  815. // 使用 $set 确保响应式更新
  816. this.$set(item, 'fileUrl', res.url);
  817. } else {
  818. this.msgError(res.msg);
  819. }
  820. },
  821. beforeAvatarUploadFile(file){
  822. const isLt1M = file.size / 1024 / 1024 < 10;
  823. if (!isLt1M) {
  824. this.$message.error('上传大小不能超过 10MB!');
  825. }
  826. return isLt1M;
  827. },
  828. //下载文件
  829. downloadUrl(materialUrl) {
  830. // 直接返回文件 URL
  831. return materialUrl;
  832. },
  833. handleAvatarSuccessVideo(res, file, item) {
  834. if(res.code==200){
  835. // 使用 $set 确保响应式更新
  836. this.$set(item, 'videoUrl', res.url);
  837. }
  838. else{
  839. this.msgError(res.msg);
  840. }
  841. },
  842. beforeAvatarUploadVideo(file){
  843. const isLt30M = file.size / 1024 / 1024 < 10;
  844. const isMP4 = file.type === 'video/mp4';
  845. if (!isMP4) {
  846. this.$message.error('仅支持上传 MP4 格式的视频文件!');
  847. return false;
  848. }
  849. if (!isLt30M) {
  850. this.$message.error('上传大小不能超过 10MB!');
  851. return false;
  852. }
  853. return true;
  854. },
  855. handleInputVideoText(value,content){
  856. // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
  857. const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
  858. // 删除不符合条件的字符
  859. const filteredValue = value.split('').filter(char => regex.test(char)).join('');
  860. this.$set(content, 'value', filteredValue);
  861. },
  862. delSetList(index){
  863. this.setting.splice(index,1)
  864. },
  865. addSetList(){
  866. const newSetting = {
  867. contentType:'1',
  868. value: '',
  869. };
  870. // 将新设置项添加到 content.setting 数组中
  871. this.setting.push(newSetting);
  872. },
  873. handleKeydown(event, index) {
  874. const item = this.setting[index];
  875. const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
  876. const cursorPosition = textarea.selectionStart;
  877. // 检查是否按下了 Backspace 或 Delete 键
  878. if (event.key === 'Backspace' || event.key === 'Delete') {
  879. const tags = ['#客服称呼#', '#客户称呼#']; // 需要检查的标签
  880. const value = item.value;
  881. // 遍历标签,检查是否需要删除
  882. for (const tag of tags) {
  883. let start, end;
  884. if (event.key === 'Backspace') {
  885. // 检查光标前是否是当前标签的一部分
  886. start = cursorPosition - tag.length;
  887. if (start >= 0 && value.slice(start, cursorPosition) === tag) {
  888. // 删除整个标签
  889. item.value = value.slice(0, start) + value.slice(cursorPosition);
  890. // 更新光标位置
  891. this.$nextTick(() => {
  892. textarea.setSelectionRange(start, start);
  893. });
  894. // 更新状态
  895. if (tag === '#客服称呼#') item.isSalesCallAdded = false;
  896. if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
  897. event.preventDefault(); // 阻止默认删除行为
  898. break; // 找到匹配的标签后退出循环
  899. }
  900. } else if (event.key === 'Delete') {
  901. // 检查光标后是否是当前标签的一部分
  902. end = cursorPosition + tag.length;
  903. if (end <= value.length && value.slice(cursorPosition, end) === tag) {
  904. // 删除整个标签
  905. item.value = value.slice(0, cursorPosition) + value.slice(end);
  906. // 更新状态
  907. if (tag === '#客服称呼#') item.isSalesCallAdded = false;
  908. if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
  909. event.preventDefault(); // 阻止默认删除行为
  910. break; // 找到匹配的标签后退出循环
  911. }
  912. }
  913. // 检查光标是否位于标签的中间
  914. for (let i = 0; i <= tag.length; i++) {
  915. const tagStart = cursorPosition - i;
  916. const tagEnd = tagStart + tag.length;
  917. if (
  918. tagStart >= 0 &&
  919. tagEnd <= value.length &&
  920. value.slice(tagStart, tagEnd) === tag
  921. ) {
  922. // 删除整个标签
  923. item.value = value.slice(0, tagStart) + value.slice(tagEnd);
  924. // 更新光标位置
  925. this.$nextTick(() => {
  926. textarea.setSelectionRange(tagStart, tagStart);
  927. });
  928. // 更新状态
  929. if (tag === '#客服称呼#') item.isSalesCallAdded = false;
  930. if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
  931. event.preventDefault(); // 阻止默认删除行为
  932. break; // 找到匹配的标签后退出循环
  933. }
  934. }
  935. }
  936. }
  937. },
  938. // 切换添加客服称呼按钮点击事件
  939. toggleSalesCall(index) {
  940. const item = this.setting[index];
  941. const salesCall = '#客服称呼#';
  942. const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
  943. // 获取当前光标位置
  944. const cursorPosition = textarea.selectionStart;
  945. if (item.isSalesCallAdded) {
  946. // 移除所有的 #客服称呼#
  947. item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
  948. } else {
  949. // 添加 #客服称呼#
  950. item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
  951. }
  952. // 切换状态
  953. item.isSalesCallAdded = !item.isSalesCallAdded;
  954. // 保持光标位置
  955. this.$nextTick(() => {
  956. textarea.setSelectionRange(cursorPosition, cursorPosition);
  957. });
  958. },
  959. toggleSalesCallCustomer(index) {
  960. const item = this.setting[index];
  961. const salesCall = '#客户称呼#';
  962. const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
  963. // 获取当前光标位置
  964. const cursorPosition = textarea.selectionStart;
  965. if (item.isSalesCallCustomerAdded) {
  966. // 移除所有的 #客服称呼#
  967. item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
  968. } else {
  969. // 添加 #客户称呼#
  970. item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
  971. }
  972. // 切换状态
  973. item.isSalesCallCustomerAdded = !item.isSalesCallCustomerAdded;
  974. // 保持光标位置
  975. this.$nextTick(() => {
  976. textarea.setSelectionRange(cursorPosition, cursorPosition);
  977. });
  978. },
  979. handleContentTypeChange() {
  980. //如果是链接的才上
  981. if (this.msgForm.courseId != null ) {
  982. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
  983. for (let i = 0; i < this.setting.length; i++) {
  984. //响应式直接给链接的标题/封面上值
  985. if (selectedCourse && this.msgForm.courseId != null) {
  986. if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
  987. this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
  988. this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
  989. }
  990. if (this.setting[i].contentType == 4){
  991. this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
  992. }
  993. }
  994. }
  995. }
  996. if (this.msgForm.videoId != null ) {
  997. // 查找选中的课节对应的 label
  998. const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
  999. for (let i = 0; i < this.setting.length; i++) {
  1000. //响应式直接给链接的描述上值
  1001. if (selectedVideo && this.msgForm.videoId != null) {
  1002. if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
  1003. this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
  1004. }
  1005. if (this.setting[i].contentType == 4){
  1006. this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
  1007. }
  1008. }
  1009. }
  1010. }
  1011. },
  1012. /** 查询sopUserLogsInfo列表 */
  1013. getList() {
  1014. this.loading = true;
  1015. listSopUserLogsInfo(this.queryParams).then(response => {
  1016. this.sopUserLogsInfoList = response.rows;
  1017. this.total = response.total;
  1018. this.loading = false;
  1019. });
  1020. },
  1021. // 取消按钮
  1022. cancel() {
  1023. this.updateOpen = false;
  1024. this.reset();
  1025. },
  1026. // 表单重置
  1027. reset() {
  1028. this.form = {
  1029. id: null,
  1030. sopId: null,
  1031. userLogsId: null,
  1032. externalContactId: null,
  1033. qwUserId: null,
  1034. corpId: null,
  1035. externalId: null,
  1036. fsUserId: null,
  1037. externalUserName: null,
  1038. createTime: null,
  1039. crtTime: null,
  1040. updateTime: null
  1041. };
  1042. this.resetForm("form");
  1043. },
  1044. resetSendMsgSop() {
  1045. this.msgForm = {
  1046. videoId:null,
  1047. courseId:null,
  1048. courseType:null,
  1049. setting:null,
  1050. ids:null,
  1051. };
  1052. this.resetForm("msgForm");
  1053. },
  1054. /** 搜索按钮操作 */
  1055. handleQuery() {
  1056. if (this.selectTags!=null && this.selectTags.length>0){
  1057. // 确保 this.form.tags 是数组
  1058. if (!this.queryParams.tagIds) {
  1059. this.queryParams.tagIds = []; // 如果未定义,初始化
  1060. } else {
  1061. this.queryParams.tagIds = []; // 清空已有数据
  1062. }
  1063. // 遍历并添加 tagId
  1064. this.selectTags.forEach(tag => {
  1065. if (tag.tagId) { // 确保 tagId 存在
  1066. this.queryParams.tagIds.push(tag.tagId);
  1067. }
  1068. });
  1069. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  1070. }else {
  1071. this.queryParams.tagIds=null;
  1072. }
  1073. this.getList();
  1074. },
  1075. /** 重置按钮操作 */
  1076. resetQuery() {
  1077. this.selectTags=[];
  1078. this.resetForm("queryForm");
  1079. this.handleQuery();
  1080. },
  1081. // 多选框选中数据
  1082. handleSelectionChange(selection) {
  1083. this.ids = selection.map(item => item.id)
  1084. this.single = selection.length!==1
  1085. this.multiple = !selection.length
  1086. },
  1087. /** 新增按钮操作 */
  1088. handleAdd() {
  1089. this.reset();
  1090. this.open = true;
  1091. this.title = "添加客户营期";
  1092. },
  1093. /**
  1094. * 一键群发
  1095. */
  1096. handleSendMsg(){
  1097. this.sendMsgOpen.open=true;
  1098. this.sendMsgOpen.ids=this.ids;
  1099. },
  1100. /** 修改按钮操作 */
  1101. handleUpdate() {
  1102. this.updateOpen= true;
  1103. },
  1104. submitMsgForm(){
  1105. this.$refs["msgForm"].validate(valid => {
  1106. if (valid) {
  1107. this.msgForm.setting=JSON.stringify(this.setting)
  1108. this.msgForm.ids=this.ids;
  1109. this.msgForm.sopId=this.queryParams.sopId;
  1110. this.msgForm.userIdParam=this.queryParams.userIdParam;
  1111. this.msgForm.startTime=this.queryParams.startTimeParam;
  1112. this.msgForm.corpId=this.queryParams.corpIdParam;
  1113. this.msgForm.filterMode=this.queryParams.filterMode;
  1114. if (this.setting.length <= 0) {
  1115. return this.$message.error("请添加规则")
  1116. }
  1117. if (this.msgForm.courseId===null || this.msgForm.courseId===''){
  1118. return this.$message.error("课程不能为空")
  1119. }
  1120. if (this.msgForm.videoId===null || this.msgForm.videoId===''){
  1121. return this.$message.error("课节不能为空")
  1122. }
  1123. if (this.msgForm.courseType===null || this.msgForm.courseType===''){
  1124. return this.$message.error("消息类型不能为空")
  1125. }
  1126. for (let i = 0; i < this.setting.length; i++) {
  1127. if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
  1128. return this.$message.error("内容不能为空")
  1129. }
  1130. if (this.setting[i].contentType == 2 && (this.setting[i].imgUrl == null || this.setting[i].imgUrl == "")) {
  1131. return this.$message.error("图片不能为空")
  1132. }
  1133. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
  1134. return this.$message.error("链接标题不能为空")
  1135. }
  1136. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
  1137. return this.$message.error("链接描述不能为空")
  1138. }
  1139. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
  1140. return this.$message.error("链接图片不能为空")
  1141. }
  1142. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 )&& this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
  1143. return this.$message.error("链接地址不能为空")
  1144. }
  1145. if (this.setting[i].contentType == 4 && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
  1146. return this.$message.error("小程序消息标题不能为空")
  1147. }
  1148. if (this.setting[i].contentType == 4 && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
  1149. return this.$message.error("小程序封面地址不能为空")
  1150. }
  1151. if (this.setting[i].contentType == 5 && (this.setting[i].fileUrl == null || this.setting[i].fileUrl == "")) {
  1152. return this.$message.error("文件不能为空")
  1153. }
  1154. if (this.setting[i].contentType == 6 && (this.setting[i].videoUrl == null || this.setting[i].videoUrl == "")) {
  1155. return this.$message.error("视频不能为空")
  1156. }
  1157. if (this.setting[i].contentType == 7 && (this.setting[i].value == null || this.setting[i].value == "")) {
  1158. return this.$message.error("语音不能为空")
  1159. }
  1160. }
  1161. this.sendMsgOpen.open = false;
  1162. const loading = this.$loading({
  1163. lock: true,
  1164. text: '正在执行中请稍后~~请不要刷新页面!!',
  1165. spinner: 'el-icon-loading',
  1166. background: 'rgba(0, 0, 0, 0.7)'
  1167. });
  1168. sendMsgSop(this.msgForm).then(response => {
  1169. this.msgSuccess("一键群发成功");
  1170. loading.close();
  1171. this.setting=[];
  1172. this.msgForm = {
  1173. videoId:null,
  1174. courseId:null,
  1175. courseType:null,
  1176. setting:null,
  1177. }
  1178. this.getList();
  1179. }).finally(()=>{
  1180. loading.close();
  1181. });
  1182. }
  1183. });
  1184. },
  1185. cancelMsgForm(){
  1186. this.sendMsgOpen.open = false;
  1187. this.resetSendMsgSop();
  1188. },
  1189. /** 提交按钮 */
  1190. submitForm() {
  1191. this.$refs["updateLogsInfoFrom"].validate(valid => {
  1192. if (valid) {
  1193. this.updateLogsInfoFrom.ids=this.ids;
  1194. this.updateLogsInfoFrom.sopId= this.queryParams.sopId
  1195. this.updateLogsInfoFrom.qwUserId=this.queryParams.qwUserId
  1196. this.updateLogsInfoFrom.corpId= this.queryParams.corpId
  1197. let loadingRock = this.$loading({
  1198. lock: true,
  1199. text: '正在执行中请稍后~~请不要刷新页面!!',
  1200. spinner: 'el-icon-loading',
  1201. background: 'rgba(0, 0, 0, 0.7)'
  1202. });
  1203. batchUpdateSopUserLogsInfoToTime(this.updateLogsInfoFrom).then(response => {
  1204. this.msgSuccess("修改成功");
  1205. this.open = false;
  1206. this.updateOpen=false;
  1207. this.getList();
  1208. this.$emit('flashNotify')
  1209. loadingRock.close();
  1210. }).finally(res=>{
  1211. loadingRock.close();
  1212. })
  1213. }
  1214. });
  1215. },
  1216. /** 删除按钮操作 */
  1217. handleDelete(row) {
  1218. const ids = row.id || this.ids;
  1219. this.$confirm('是否确认删除sopUserLogsInfo编号为"' + ids + '"的数据项?', "警告", {
  1220. confirmButtonText: "确定",
  1221. cancelButtonText: "取消",
  1222. type: "warning"
  1223. }).then(function() {
  1224. return delSopUserLogsInfo(ids);
  1225. }).then(() => {
  1226. this.getList();
  1227. this.msgSuccess("删除成功");
  1228. }).catch(() => {});
  1229. },
  1230. /** 导出按钮操作 */
  1231. handleExport() {
  1232. const queryParams = this.queryParams;
  1233. this.$confirm('是否确认导出所有营期数据项?', "警告", {
  1234. confirmButtonText: "确定",
  1235. cancelButtonText: "取消",
  1236. type: "warning"
  1237. }).then(() => {
  1238. this.exportLoading = true;
  1239. return exportSopUserLogsInfo(queryParams);
  1240. }).then(response => {
  1241. this.download(response.msg);
  1242. this.exportLoading = false;
  1243. }).catch(() => {});
  1244. },
  1245. //选择视频号
  1246. hanldeSelectVideoNum(content, index) {
  1247. this.videoNumOptions.content = content;
  1248. this.videoNumOptions.contentIndex = index;
  1249. this.videoNumOptions.open = true;
  1250. },
  1251. qwUserVideoResult(val) {
  1252. // 根据选中的内容,将返回的数据更新到相应的表单项
  1253. const content = this.videoNumOptions.content;
  1254. const setList = content[this.videoNumOptions.contentIndex];
  1255. setList.nickname = val.nickname;
  1256. setList.avatar = val.avatar;
  1257. setList.coverUrl = val.coverUrl;
  1258. setList.thumbUrl = val.thumbUrl;
  1259. setList.desc = val.desc;
  1260. setList.url = val.url;
  1261. setList.extras = val.extras;
  1262. setList.videoId = val.id;
  1263. console.info(setList)
  1264. this.videoNumOptions.open = false;
  1265. },
  1266. }
  1267. };
  1268. </script>
  1269. <style scoped>
  1270. /* CSS 样式 */
  1271. .tag-container {
  1272. display: flex;
  1273. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1274. gap: 8px; /* 设置标签之间的间距 */
  1275. }
  1276. .name-background {
  1277. display: inline-block;
  1278. background-color: #abece6; /* 背景颜色 */
  1279. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1280. border-radius: 4px; /* 可选:设置圆角 */
  1281. }
  1282. .tag-box {
  1283. padding: 8px 12px;
  1284. border: 1px solid #989797;
  1285. border-radius: 4px;
  1286. cursor: pointer;
  1287. display: inline-block;
  1288. }
  1289. .tag-selected {
  1290. background-color: #00bc98;
  1291. color: #fff;
  1292. border-color: #00bc98;
  1293. }
  1294. .el-tag + .el-tag {
  1295. margin-left: 10px;
  1296. }
  1297. .button-new-tag {
  1298. margin-left: 10px;
  1299. height: 32px;
  1300. line-height: 30px;
  1301. padding-top: 0;
  1302. padding-bottom: 0;
  1303. }
  1304. .input-new-tag {
  1305. width: 90px;
  1306. margin-left: 10px;
  1307. vertical-align: bottom;
  1308. }
  1309. </style>