sopUserLogsInfoDetails.vue 50 KB

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