sendMsgOpenTool.vue 50 KB

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