sopUserLogsInfoDetailsOld.vue 51 KB

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