sopUserLogsInfoDetails.vue 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320
  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-more
  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. import PaginationMore from "../../../components/PaginationMore/index.vue";
  424. export default {
  425. name: "sopUserLogsInfoDetails",
  426. components: {PaginationMore, Tip, ImageUpload},
  427. data() {
  428. return {
  429. //上传语音的遮罩层
  430. voiceLoading :false,
  431. uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
  432. uploadUrlByVoice:process.env.VUE_APP_BASE_API+"/common/uploadOSSByHOOKVoice",
  433. // 遮罩层
  434. loading: true,
  435. // 导出遮罩层
  436. exportLoading: false,
  437. // 选中数组
  438. ids: [],
  439. // 非单个禁用
  440. single: true,
  441. // 非多个禁用
  442. multiple: true,
  443. // 显示搜索条件
  444. showSearch: true,
  445. // 总条数
  446. total: 0,
  447. // sopUserLogsInfo表格数据
  448. sopUserLogsInfoList: [],
  449. sysFsSopWatchStatus: [],
  450. isSalesCallAdded:false,
  451. isSalesCallCustomerAdded:false,
  452. selectTags:[],
  453. // 弹出层标题
  454. title: "",
  455. // 是否显示弹出层
  456. open: false,
  457. updateOpen:false,
  458. // 查询参数
  459. queryParams: {
  460. pageNum: 1,
  461. pageSize: 10,
  462. tagIds:null,
  463. remark:null,
  464. sopId: null,
  465. userLogsId: null,
  466. userIdParam:null,
  467. startTimeParam:null,
  468. externalContactId: null,
  469. qwUserId: null,
  470. corpId: null,
  471. externalId: null,
  472. fsUserId: null,
  473. externalUserName: null,
  474. createTime: null,
  475. },
  476. tagGroupList: [],
  477. tagTotal:0,
  478. //标签
  479. changeTagDialog:{
  480. title:"",
  481. open:false,
  482. },
  483. queryTagParams:{
  484. pageNum: 1,
  485. pageSize: 10,
  486. total:0,
  487. name:null,
  488. corpId:null,
  489. },
  490. courseList:[],
  491. videoList:[],
  492. //插件版
  493. sysQwSopAiContentType:[],
  494. sendMsgOpen:{
  495. title:'一键批量群发',
  496. open:false,
  497. ids:null,
  498. },
  499. // 表单参数
  500. form: {},
  501. updateLogsInfoFrom:{},
  502. setting:[{contentType:'1', value: '',}],
  503. msgForm:{
  504. videoId:null,
  505. courseId:null,
  506. courseType:null,
  507. userIdParam:null,
  508. setting:null,
  509. ids:null,
  510. sopId: null,
  511. startTime: null,
  512. },
  513. // 表单校验
  514. rules: {},
  515. batchRules:{
  516. paramTime: [
  517. { required: true, message: '选择的时间不能为空', trigger: 'blur' }
  518. ],
  519. },
  520. msgRules:{},
  521. };
  522. },
  523. created() {
  524. this.getDicts("sys_qwSopAi_contentType").then(response => {
  525. this.sysQwSopAiContentType = response.data;
  526. });
  527. this.getDicts("sys_fs_sop_watch_status").then(response => {
  528. this.sysFsSopWatchStatus = response.data;
  529. });
  530. courseList().then(response => {
  531. this.courseList = response.list;
  532. });
  533. },
  534. methods: {
  535. selectSopUserLogsInfo(val,externalUserName){
  536. this.loading = true;
  537. this.queryParams.sopId=val.sopId;
  538. this.queryParams.filterMode=val.filterMode;
  539. this.queryParams.userLogsId=val.id;
  540. this.queryParams.chatId=val.chatId;
  541. if (externalUserName!=null){
  542. this.queryParams.externalUserName = externalUserName;
  543. }
  544. listSopUserLogsInfo(this.queryParams).then(response => {
  545. this.sopUserLogsInfoList = response.rows;
  546. this.total = response.total;
  547. this.loading = false;
  548. });
  549. this.queryParams.qwUserId=val.qwUserId;
  550. this.queryParams.corpId=val.corpId;
  551. //用于一键群发
  552. this.queryParams.userIdParam=val.userId;
  553. this.queryParams.startTimeParam=val.startTime;
  554. this.queryParams.corpIdParam=val.corpId;
  555. },
  556. //搜索的标签
  557. hangleChangeTags(){
  558. this.changeTagDialog.title="搜索的标签"
  559. this.changeTagDialog.open=true;
  560. // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
  561. const selectedTagIds = new Set(
  562. (this.selectTags || []).map(tagItem => tagItem?.tagId)
  563. );
  564. this.queryTagParams.name=null;
  565. this.getPageListTagGroup();
  566. setTimeout(() => {
  567. for (let i = 0; i < this.tagGroupList.length; i++) {
  568. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  569. this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
  570. }
  571. }
  572. }, 200);
  573. },
  574. tagSelection(row){
  575. row.isSelected= !row.isSelected;
  576. this.$forceUpdate();
  577. },
  578. //确定选择标签
  579. tagSubmitForm(){
  580. for (let i = 0; i < this.tagGroupList.length; i++) {
  581. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  582. if (this.tagGroupList[i].tag[x].isSelected === true) {
  583. if (!this.selectTags) {
  584. this.selectTags = [];
  585. }
  586. // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
  587. let tagExists = this.selectTags.some(
  588. tag => tag.id === this.tagGroupList[i].tag[x].id
  589. );
  590. // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
  591. if (!tagExists) {
  592. this.selectTags.push(this.tagGroupList[i].tag[x]);
  593. }
  594. }
  595. }
  596. }
  597. if (!this.selectTags || this.selectTags.length === 0) {
  598. return this.$message('请选择标签');
  599. }
  600. this.changeTagDialog.open = false;
  601. },
  602. //取消选择标签
  603. tagCancel(){
  604. this.changeTagDialog.open = false;
  605. },
  606. //删除一些选择的标签
  607. handleCloseTags(list){
  608. const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);
  609. if (ls !== -1) {
  610. this.selectTags.splice(ls, 1);
  611. this.selectTags = [...this.selectTags];
  612. }
  613. if (this.selectTags!=null && this.selectTags.length>0){
  614. // 确保 this.form.tags 是数组
  615. if (!this.queryParams.tagIds) {
  616. this.queryParams.tagIds = []; // 如果未定义,初始化
  617. } else {
  618. this.queryParams.tagIds = []; // 清空已有数据
  619. }
  620. // 遍历并添加 tagId
  621. this.selectTags.forEach(tag => {
  622. if (tag.tagId) { // 确保 tagId 存在
  623. this.queryParams.tagIds.push(tag.tagId);
  624. }
  625. });
  626. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  627. }else {
  628. this.queryParams.tagIds=null;
  629. }
  630. },
  631. handleSearchTags(name){
  632. searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  633. this.tagGroupList = response.rows;
  634. });
  635. },
  636. cancelSearchTags(){
  637. this.resetSearchQueryTag()
  638. this.getPageListTagGroup();
  639. },
  640. getPageListTagGroup(){
  641. this.queryTagParams.corpId=this.queryParams.corpId
  642. allListTagGroup(this.queryTagParams).then(response => {
  643. this.tagGroupList = response.rows;
  644. this.tagTotal = response.total;
  645. });
  646. },
  647. resetSearchQueryTag(){
  648. this.queryTagParams= {
  649. pageNum: 1,
  650. pageSize: 10,
  651. total:0,
  652. name:null,
  653. };
  654. },
  655. courseChange() {
  656. if (this.msgForm.courseId != null ) {
  657. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
  658. for (let i = 0; i < this.setting.length; i++) {
  659. //响应式直接给链接的标题/封面上值
  660. if (selectedCourse && this.msgForm.courseId != null) {
  661. if ( this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ){
  662. this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
  663. this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
  664. }
  665. if ( this.setting[i].contentType == 4 ){
  666. this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
  667. }
  668. }
  669. }
  670. }
  671. videoList(this.msgForm.courseId).then(response => {
  672. this.videoList=response.list;
  673. });
  674. },
  675. videoIdChange() {
  676. if (this.msgForm.videoId != null ) {
  677. // 查找选中的课节对应的 label
  678. const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
  679. for (let i = 0; i < this.setting.length; i++) {
  680. //响应式直接给链接的描述上值
  681. if (selectedVideo && this.msgForm.videoId != null) {
  682. if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ){
  683. this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
  684. }
  685. if (this.setting[i].contentType == 4){
  686. this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
  687. }
  688. }
  689. }
  690. }
  691. },
  692. handleAvatarSuccessFile(res, file, item) {
  693. if (res.code === 200) {
  694. // 使用 $set 确保响应式更新
  695. this.$set(item, 'fileUrl', res.url);
  696. } else {
  697. this.msgError(res.msg);
  698. }
  699. },
  700. beforeAvatarUploadFile(file){
  701. const isLt1M = file.size / 1024 / 1024 < 10;
  702. if (!isLt1M) {
  703. this.$message.error('上传大小不能超过 10MB!');
  704. }
  705. return isLt1M;
  706. },
  707. //下载文件
  708. downloadUrl(materialUrl) {
  709. // 直接返回文件 URL
  710. return materialUrl;
  711. },
  712. handleAvatarSuccessVideo(res, file, item) {
  713. if(res.code==200){
  714. // 使用 $set 确保响应式更新
  715. this.$set(item, 'videoUrl', res.url);
  716. }
  717. else{
  718. this.msgError(res.msg);
  719. }
  720. },
  721. beforeAvatarUploadVideo(file){
  722. const isLt30M = file.size / 1024 / 1024 < 10;
  723. const isMP4 = file.type === 'video/mp4';
  724. if (!isMP4) {
  725. this.$message.error('仅支持上传 MP4 格式的视频文件!');
  726. return false;
  727. }
  728. if (!isLt30M) {
  729. this.$message.error('上传大小不能超过 10MB!');
  730. return false;
  731. }
  732. return true;
  733. },
  734. handleInputVideoText(value,content){
  735. // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
  736. const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
  737. // 删除不符合条件的字符
  738. const filteredValue = value.split('').filter(char => regex.test(char)).join('');
  739. this.$set(content, 'value', filteredValue);
  740. },
  741. delSetList(index){
  742. this.setting.splice(index,1)
  743. },
  744. addSetList(){
  745. const newSetting = {
  746. contentType:'1',
  747. value: '',
  748. };
  749. // 将新设置项添加到 content.setting 数组中
  750. this.setting.push(newSetting);
  751. },
  752. handleKeydown(event, index) {
  753. const item = this.setting[index];
  754. const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
  755. const cursorPosition = textarea.selectionStart;
  756. // 检查是否按下了 Backspace 或 Delete 键
  757. if (event.key === 'Backspace' || event.key === 'Delete') {
  758. const tags = ['#销售称呼#', '#客户称呼#']; // 需要检查的标签
  759. const value = item.value;
  760. // 遍历标签,检查是否需要删除
  761. for (const tag of tags) {
  762. let start, end;
  763. if (event.key === 'Backspace') {
  764. // 检查光标前是否是当前标签的一部分
  765. start = cursorPosition - tag.length;
  766. if (start >= 0 && value.slice(start, cursorPosition) === tag) {
  767. // 删除整个标签
  768. item.value = value.slice(0, start) + value.slice(cursorPosition);
  769. // 更新光标位置
  770. this.$nextTick(() => {
  771. textarea.setSelectionRange(start, start);
  772. });
  773. // 更新状态
  774. if (tag === '#销售称呼#') item.isSalesCallAdded = false;
  775. if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
  776. event.preventDefault(); // 阻止默认删除行为
  777. break; // 找到匹配的标签后退出循环
  778. }
  779. } else if (event.key === 'Delete') {
  780. // 检查光标后是否是当前标签的一部分
  781. end = cursorPosition + tag.length;
  782. if (end <= value.length && value.slice(cursorPosition, end) === tag) {
  783. // 删除整个标签
  784. item.value = value.slice(0, cursorPosition) + value.slice(end);
  785. // 更新状态
  786. if (tag === '#销售称呼#') item.isSalesCallAdded = false;
  787. if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
  788. event.preventDefault(); // 阻止默认删除行为
  789. break; // 找到匹配的标签后退出循环
  790. }
  791. }
  792. // 检查光标是否位于标签的中间
  793. for (let i = 0; i <= tag.length; i++) {
  794. const tagStart = cursorPosition - i;
  795. const tagEnd = tagStart + tag.length;
  796. if (
  797. tagStart >= 0 &&
  798. tagEnd <= value.length &&
  799. value.slice(tagStart, tagEnd) === tag
  800. ) {
  801. // 删除整个标签
  802. item.value = value.slice(0, tagStart) + value.slice(tagEnd);
  803. // 更新光标位置
  804. this.$nextTick(() => {
  805. textarea.setSelectionRange(tagStart, tagStart);
  806. });
  807. // 更新状态
  808. if (tag === '#销售称呼#') item.isSalesCallAdded = false;
  809. if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
  810. event.preventDefault(); // 阻止默认删除行为
  811. break; // 找到匹配的标签后退出循环
  812. }
  813. }
  814. }
  815. }
  816. },
  817. // 切换添加销售称呼按钮点击事件
  818. toggleSalesCall(index) {
  819. const item = this.setting[index];
  820. const salesCall = '#销售称呼#';
  821. const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
  822. // 获取当前光标位置
  823. const cursorPosition = textarea.selectionStart;
  824. if (item.isSalesCallAdded) {
  825. // 移除所有的 #销售称呼#
  826. item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
  827. } else {
  828. // 添加 #销售称呼#
  829. item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
  830. }
  831. // 切换状态
  832. item.isSalesCallAdded = !item.isSalesCallAdded;
  833. // 保持光标位置
  834. this.$nextTick(() => {
  835. textarea.setSelectionRange(cursorPosition, cursorPosition);
  836. });
  837. },
  838. toggleSalesCallCustomer(index) {
  839. const item = this.setting[index];
  840. const salesCall = '#客户称呼#';
  841. const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
  842. // 获取当前光标位置
  843. const cursorPosition = textarea.selectionStart;
  844. if (item.isSalesCallCustomerAdded) {
  845. // 移除所有的 #销售称呼#
  846. item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
  847. } else {
  848. // 添加 #客户称呼#
  849. item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
  850. }
  851. // 切换状态
  852. item.isSalesCallCustomerAdded = !item.isSalesCallCustomerAdded;
  853. // 保持光标位置
  854. this.$nextTick(() => {
  855. textarea.setSelectionRange(cursorPosition, cursorPosition);
  856. });
  857. },
  858. handleContentTypeChange() {
  859. //如果是链接的才上
  860. if (this.msgForm.courseId != null ) {
  861. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
  862. for (let i = 0; i < this.setting.length; i++) {
  863. //响应式直接给链接的标题/封面上值
  864. if (selectedCourse && this.msgForm.courseId != null) {
  865. if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
  866. this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
  867. this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
  868. }
  869. if (this.setting[i].contentType == 4){
  870. this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
  871. }
  872. }
  873. }
  874. }
  875. if (this.msgForm.videoId != null ) {
  876. // 查找选中的课节对应的 label
  877. const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
  878. for (let i = 0; i < this.setting.length; i++) {
  879. //响应式直接给链接的描述上值
  880. if (selectedVideo && this.msgForm.videoId != null) {
  881. if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
  882. this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
  883. }
  884. if (this.setting[i].contentType == 4){
  885. this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
  886. }
  887. }
  888. }
  889. }
  890. },
  891. /** 查询sopUserLogsInfo列表 */
  892. getList() {
  893. this.loading = true;
  894. listSopUserLogsInfo(this.queryParams).then(response => {
  895. this.sopUserLogsInfoList = response.rows;
  896. this.total = response.total;
  897. this.loading = false;
  898. });
  899. },
  900. // 取消按钮
  901. cancel() {
  902. this.updateOpen = false;
  903. this.reset();
  904. },
  905. // 表单重置
  906. reset() {
  907. this.form = {
  908. id: null,
  909. sopId: null,
  910. userLogsId: null,
  911. externalContactId: null,
  912. qwUserId: null,
  913. corpId: null,
  914. externalId: null,
  915. fsUserId: null,
  916. externalUserName: null,
  917. createTime: null,
  918. crtTime: null,
  919. updateTime: null
  920. };
  921. this.resetForm("form");
  922. },
  923. resetSendMsgSop() {
  924. this.msgForm = {
  925. videoId:null,
  926. courseId:null,
  927. courseType:null,
  928. setting:null,
  929. ids:null,
  930. };
  931. this.resetForm("msgForm");
  932. },
  933. /** 搜索按钮操作 */
  934. handleQuery() {
  935. if (this.selectTags!=null && this.selectTags.length>0){
  936. // 确保 this.form.tags 是数组
  937. if (!this.queryParams.tagIds) {
  938. this.queryParams.tagIds = []; // 如果未定义,初始化
  939. } else {
  940. this.queryParams.tagIds = []; // 清空已有数据
  941. }
  942. // 遍历并添加 tagId
  943. this.selectTags.forEach(tag => {
  944. if (tag.tagId) { // 确保 tagId 存在
  945. this.queryParams.tagIds.push(tag.tagId);
  946. }
  947. });
  948. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  949. }else {
  950. this.queryParams.tagIds=null;
  951. }
  952. this.getList();
  953. },
  954. /** 重置按钮操作 */
  955. resetQuery() {
  956. this.selectTags=[];
  957. this.resetForm("queryForm");
  958. this.handleQuery();
  959. },
  960. // 多选框选中数据
  961. handleSelectionChange(selection) {
  962. this.ids = selection.map(item => item.id)
  963. this.single = selection.length!==1
  964. this.multiple = !selection.length
  965. },
  966. /** 新增按钮操作 */
  967. handleAdd() {
  968. this.reset();
  969. this.open = true;
  970. this.title = "添加客户营期";
  971. },
  972. /**
  973. * 一键群发
  974. */
  975. handleSendMsg(){
  976. this.sendMsgOpen.open=true;
  977. this.sendMsgOpen.ids=this.ids;
  978. },
  979. /** 修改按钮操作 */
  980. handleUpdate() {
  981. this.updateOpen= true;
  982. },
  983. submitMsgForm(){
  984. this.$refs["msgForm"].validate(valid => {
  985. if (valid) {
  986. this.msgForm.setting=JSON.stringify(this.setting)
  987. this.msgForm.ids=this.ids;
  988. this.msgForm.sopId=this.queryParams.sopId;
  989. this.msgForm.userIdParam=this.queryParams.userIdParam;
  990. this.msgForm.startTime=this.queryParams.startTimeParam;
  991. this.msgForm.corpId=this.queryParams.corpIdParam;
  992. this.msgForm.filterMode=this.queryParams.filterMode;
  993. if (this.setting.length <= 0) {
  994. return this.$message.error("请添加规则")
  995. }
  996. if (this.msgForm.courseId===null || this.msgForm.courseId===''){
  997. return this.$message.error("课程不能为空")
  998. }
  999. if (this.msgForm.videoId===null || this.msgForm.videoId===''){
  1000. return this.$message.error("课节不能为空")
  1001. }
  1002. if (this.msgForm.courseType===null || this.msgForm.courseType===''){
  1003. return this.$message.error("消息类型不能为空")
  1004. }
  1005. for (let i = 0; i < this.setting.length; i++) {
  1006. if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
  1007. return this.$message.error("内容不能为空")
  1008. }
  1009. if (this.setting[i].contentType == 2 && (this.setting[i].imgUrl == null || this.setting[i].imgUrl == "")) {
  1010. return this.$message.error("图片不能为空")
  1011. }
  1012. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
  1013. return this.$message.error("链接标题不能为空")
  1014. }
  1015. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
  1016. return this.$message.error("链接描述不能为空")
  1017. }
  1018. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
  1019. return this.$message.error("链接图片不能为空")
  1020. }
  1021. 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 == "")) {
  1022. return this.$message.error("链接地址不能为空")
  1023. }
  1024. if (this.setting[i].contentType == 4 && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
  1025. return this.$message.error("小程序消息标题不能为空")
  1026. }
  1027. if (this.setting[i].contentType == 4 && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
  1028. return this.$message.error("小程序封面地址不能为空")
  1029. }
  1030. if (this.setting[i].contentType == 5 && (this.setting[i].fileUrl == null || this.setting[i].fileUrl == "")) {
  1031. return this.$message.error("文件不能为空")
  1032. }
  1033. if (this.setting[i].contentType == 6 && (this.setting[i].videoUrl == null || this.setting[i].videoUrl == "")) {
  1034. return this.$message.error("视频不能为空")
  1035. }
  1036. if (this.setting[i].contentType == 7 && (this.setting[i].value == null || this.setting[i].value == "")) {
  1037. return this.$message.error("语音不能为空")
  1038. }
  1039. }
  1040. this.sendMsgOpen.open = false;
  1041. const loading = this.$loading({
  1042. lock: true,
  1043. text: '正在执行中请稍后~~请不要刷新页面!!',
  1044. spinner: 'el-icon-loading',
  1045. background: 'rgba(0, 0, 0, 0.7)'
  1046. });
  1047. sendMsgSop(this.msgForm).then(response => {
  1048. this.msgSuccess("一键群发成功");
  1049. loading.close();
  1050. this.setting=[];
  1051. this.msgForm = {
  1052. videoId:null,
  1053. courseId:null,
  1054. courseType:null,
  1055. setting:null,
  1056. }
  1057. this.getList();
  1058. }).finally(()=>{
  1059. loading.close();
  1060. });
  1061. }
  1062. });
  1063. },
  1064. cancelMsgForm(){
  1065. this.sendMsgOpen.open = false;
  1066. this.resetSendMsgSop();
  1067. },
  1068. /** 提交按钮 */
  1069. submitForm() {
  1070. this.$refs["updateLogsInfoFrom"].validate(valid => {
  1071. if (valid) {
  1072. this.updateLogsInfoFrom.ids=this.ids;
  1073. this.updateLogsInfoFrom.sopId= this.queryParams.sopId
  1074. this.updateLogsInfoFrom.qwUserId=this.queryParams.qwUserId
  1075. this.updateLogsInfoFrom.corpId= this.queryParams.corpId
  1076. let loadingRock = this.$loading({
  1077. lock: true,
  1078. text: '正在执行中请稍后~~请不要刷新页面!!',
  1079. spinner: 'el-icon-loading',
  1080. background: 'rgba(0, 0, 0, 0.7)'
  1081. });
  1082. batchUpdateSopUserLogsInfoToTime(this.updateLogsInfoFrom).then(response => {
  1083. this.msgSuccess("修改成功");
  1084. this.open = false;
  1085. this.updateOpen=false;
  1086. this.getList();
  1087. this.$emit('flashNotify')
  1088. loadingRock.close();
  1089. }).finally(res=>{
  1090. loadingRock.close();
  1091. })
  1092. }
  1093. });
  1094. },
  1095. /** 删除按钮操作 */
  1096. handleDelete(row) {
  1097. const ids = row.id || this.ids;
  1098. this.$confirm('是否确认删除sopUserLogsInfo编号为"' + ids + '"的数据项?', "警告", {
  1099. confirmButtonText: "确定",
  1100. cancelButtonText: "取消",
  1101. type: "warning"
  1102. }).then(function() {
  1103. return delSopUserLogsInfo(ids);
  1104. }).then(() => {
  1105. this.getList();
  1106. this.msgSuccess("删除成功");
  1107. }).catch(() => {});
  1108. },
  1109. /** 导出按钮操作 */
  1110. handleExport() {
  1111. const queryParams = this.queryParams;
  1112. this.$confirm('是否确认导出所有营期数据项?', "警告", {
  1113. confirmButtonText: "确定",
  1114. cancelButtonText: "取消",
  1115. type: "warning"
  1116. }).then(() => {
  1117. this.exportLoading = true;
  1118. return exportSopUserLogsInfo(queryParams);
  1119. }).then(response => {
  1120. this.download(response.msg);
  1121. this.exportLoading = false;
  1122. }).catch(() => {});
  1123. }
  1124. }
  1125. };
  1126. </script>
  1127. <style scoped>
  1128. /* CSS 样式 */
  1129. .tag-container {
  1130. display: flex;
  1131. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1132. gap: 8px; /* 设置标签之间的间距 */
  1133. }
  1134. .name-background {
  1135. display: inline-block;
  1136. background-color: #abece6; /* 背景颜色 */
  1137. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1138. border-radius: 4px; /* 可选:设置圆角 */
  1139. }
  1140. .tag-box {
  1141. padding: 8px 12px;
  1142. border: 1px solid #989797;
  1143. border-radius: 4px;
  1144. cursor: pointer;
  1145. display: inline-block;
  1146. }
  1147. .tag-selected {
  1148. background-color: #00bc98;
  1149. color: #fff;
  1150. border-color: #00bc98;
  1151. }
  1152. .el-tag + .el-tag {
  1153. margin-left: 10px;
  1154. }
  1155. .button-new-tag {
  1156. margin-left: 10px;
  1157. height: 32px;
  1158. line-height: 30px;
  1159. padding-top: 0;
  1160. padding-bottom: 0;
  1161. }
  1162. .input-new-tag {
  1163. width: 90px;
  1164. margin-left: 10px;
  1165. vertical-align: bottom;
  1166. }
  1167. </style>