sopUserLogsInfoDetails.vue 47 KB

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