sopUserLogsInfoDetails.vue 48 KB

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