sopUserLogsInfoDetails.vue 49 KB

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