sendMsgSopOpenTool.vue 49 KB

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