updateSopTemp.vue 81 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757
  1. <template>
  2. <div class="app-container">
  3. <div style="margin: 30px;" v-if="this.form.sendType == 1 && formType==1 "> sop规则【修改企微接口】模板</div>
  4. <div style="margin: 30px;" v-if="this.form.sendType == 1 && formType==2 "> sop规则【复制企微接口】模板</div>
  5. <div style="margin: 30px;" v-if="this.form.sendType == 1 && formType==3 "> sop规则【查看企微接口】模板</div>
  6. <div style="margin: 30px;" v-if="this.form.sendType == 2 && formType==1 "> sop规则【修改群发助手】模板</div>
  7. <div style="margin: 30px;" v-if="this.form.sendType == 2 && formType==2 "> sop规则【复制群发助手】模板</div>
  8. <div style="margin: 30px;" v-if="this.form.sendType == 2 && formType==3 "> sop规则【查看群发助手】模板</div>
  9. <div style="margin: 30px;">模板编号:【{{ this.form.id }}】</div>
  10. <div style="margin-top: 10px;margin-left: 50px;margin-right: 100px;margin-bottom: 60px;">
  11. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  12. <el-form-item label="名称" prop="name">
  13. {{ form.name }}
  14. </el-form-item>
  15. <el-form-item label="状态">
  16. <el-tag v-for="dict in statusOptions" v-if="dict.dictValue == form.status">{{ dict.dictLabel }}</el-tag>
  17. </el-form-item>
  18. <el-form-item label="间隔天数" prop="gap">
  19. {{ form.gap }}天
  20. </el-form-item>
  21. <el-form-item label="规则" prop="setting">
  22. <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetting()'
  23. v-if="form.sendType != 4 && formType != 3">添加天数
  24. </el-link>
  25. <el-link type="primary" class="el-icon-sort" :underline="false" @click='openUpdateDaySorts()'
  26. style="margin-left: 20px"
  27. v-if="form.sendType != 4 && formType != 3">修改天数排序
  28. </el-link>
  29. <el-link type="primary" class="el-icon-sort" :underline="false" @click='openUpdateSorts()'
  30. style="margin-left: 20px"
  31. v-if="form.sendType != 4 && formType != 3">修改规则排序
  32. </el-link>
  33. <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetting()'
  34. v-if="form.sendType == 4 && (formType != 3 && setting.length < 1)">添加天数
  35. </el-link>
  36. <el-tabs v-model="tabIndex" type="card" @tab-remove="delSetting" v-if="setting && setting.length > 0"
  37. :before-leave="leave" @tab-click="tabClick">
  38. <el-tab-pane v-for="(item, index) in setting" :closable="formType != 3" :key="index" :name="index + ''">
  39. <el-badge slot="label" :is-dot="!item.id" class="item" style="display: inline-block">
  40. <span>{{ '第' + item.dayNum + '天' }}</span>
  41. </el-badge>
  42. <el-row v-loading="loading">
  43. <el-col :span="22">
  44. <div
  45. style="background-color: #fbfbfb;padding: 15px; border: 1px solid #e6e6e6; margin-bottom: 20px;">
  46. <el-form :model="item" label-width="80px">
  47. <el-form-item v-if="form.sendType != 4" label="内容名称" style="height: 50px;">
  48. <el-input :disabled="formType == 3" v-model="item.name"
  49. placeholder="内容名称,仅内部可见"/>
  50. </el-form-item>
  51. <el-form-item label="课程" v-if="form.sendType == 11 && item.content && item.content.length > 0" required>
  52. <el-select :disabled="(formType == 3 || form.sendType == 11) && item.id != null" v-model="item.content[0].courseId"
  53. placeholder="请选择课程" style=" margin-right: 10px;" size="mini" remote
  54. filterable
  55. @change="courseChangeUpdate(item.content[0], index, 0)">
  56. <el-option
  57. v-for="dict in courseList"
  58. :key="dict.dictValue"
  59. :label="dict.dictLabel"
  60. :value="parseInt(dict.dictValue)"
  61. />
  62. </el-select>
  63. <el-select :disabled="(formType == 3 || form.sendType == 11) && item.id != null" v-model="item.content[0].videoId"
  64. placeholder="请选择小节" size="mini" style=" margin-right: 10px;" remote
  65. filterable
  66. @change="videoIdChange(item.content[0],index,0)">
  67. <el-option
  68. v-for="dict in videoList[0]"
  69. :key="dict.dictValue"
  70. :label="dict.dictLabel"
  71. :value="parseInt(dict.dictValue)"
  72. />
  73. </el-select>
  74. </el-form-item>
  75. <el-form-item label="规则">
  76. <div v-for="(content, contentIndex) in item.content" :key="contentIndex"
  77. style="background-color: #fdfdfd;padding: 15px; border: 1px solid #e6e6e6; margin-bottom: 20px;">
  78. <el-row>
  79. <el-col el-col :span="22">
  80. <el-form :model="content" label-width="70px">
  81. <div v-if="item.dayNum==1">
  82. <el-form-item label="时间" v-if="form.sendType != 4">
  83. <el-time-picker
  84. :disabled="formType == 3"
  85. class="custom-input"
  86. v-model="content.time"
  87. value-format="HH:mm"
  88. format="HH:mm"
  89. :picker-options="{ selectableRange: startTimeRange }"
  90. placeholder="时间"
  91. style="width: 100px;height: 20px;">
  92. </el-time-picker>
  93. </el-form-item>
  94. </div>
  95. <div v-else>
  96. <el-form-item label="时间" v-if="form.sendType != 4">
  97. <el-time-picker
  98. :disabled="formType == 3"
  99. class="custom-input"
  100. v-model="content.time"
  101. value-format="HH:mm"
  102. format="HH:mm"
  103. placeholder="时间"
  104. style="width: 100px;height: 20px;">
  105. </el-time-picker>
  106. </el-form-item>
  107. </div>
  108. <el-form-item label="官方群发" v-if="contentIndex==0 && content.type==2">
  109. <el-switch
  110. v-model="content.isOfficial"
  111. active-color="#13ce66"
  112. inactive-color="#DCDFE6"
  113. active-value="1"
  114. inactive-value="0">
  115. </el-switch>
  116. </el-form-item>
  117. <el-form-item label="消息类型" v-if="form.sendType != 4">
  118. <el-select :disabled="formType == 3" v-model="content.courseType"
  119. placeholder="请选择消息类型" size="mini"
  120. style=" margin-right: 10px;" v-if="content.type != 4 ">
  121. <el-option
  122. v-for="dict in sysFsSopWatchStatus"
  123. :key="dict.dictValue"
  124. :label="dict.dictLabel"
  125. :value="Number(dict.dictValue)"
  126. />
  127. </el-select>
  128. </el-form-item>
  129. <el-form-item label="消息类别" v-if="form.sendType != 4 && form.sendType != 5">
  130. <el-radio-group v-model="content.type"
  131. :disabled="formType == 3 || content.isOfficial === '1'"
  132. @change="updateHtml(() => content.contentType = '1')">
  133. <el-radio :label="1">普通</el-radio>
  134. <el-radio :label="2">课程</el-radio>
  135. <el-radio :label="4">AI触达</el-radio>
  136. <el-radio :label="5">打标签</el-radio>
  137. </el-radio-group>
  138. </el-form-item>
  139. <el-form-item label="课程" v-if="content.type == 2 && form.sendType != 5" required>
  140. <el-select :disabled="formType == 3 || form.sendType == 11" v-model="content.courseId"
  141. placeholder="请选择课程" style=" margin-right: 10px;" size="mini" remote
  142. filterable
  143. @change="courseChangeUpdate(content,index,contentIndex)">
  144. <el-option
  145. v-for="dict in courseList"
  146. :key="dict.dictValue"
  147. :label="dict.dictLabel"
  148. :value="parseInt(dict.dictValue)"
  149. />
  150. </el-select>
  151. <el-select :disabled="formType == 3 || form.sendType == 11" v-model="content.videoId"
  152. placeholder="请选择小节" size="mini" style=" margin-right: 10px;" remote
  153. filterable
  154. @change="videoIdChange(content,index,contentIndex)">
  155. <el-option
  156. v-for="dict in videoList[contentIndex]"
  157. :key="dict.dictValue"
  158. :label="dict.dictLabel"
  159. :value="parseInt(dict.dictValue)"
  160. />
  161. </el-select>
  162. <el-select :disabled="formType == 3" v-model="content.courseType"
  163. placeholder="请选择消息类型" size="mini"
  164. style=" margin-right: 10px;" v-if="content.type != 4 ">
  165. <el-option
  166. v-for="dict in sysFsSopWatchStatus"
  167. :key="dict.dictValue"
  168. :label="dict.dictLabel"
  169. :value="Number(dict.dictValue)"
  170. />
  171. </el-select>
  172. </el-form-item>
  173. <el-form-item label="Ai触达" v-if="content.type == 4 ">
  174. <el-select :disabled="formType == 3" v-model="content.aiTouch"
  175. placeholder="请选择Ai触达类型" size="mini"
  176. style=" margin-right: 10px;" v-if="content.type == 4 ">
  177. <el-option label="非首次交流" value="非首次交流"></el-option>
  178. <el-option label="首次交流1" value="首次交流1"></el-option>
  179. <el-option label="首次交流2" value="首次交流2"></el-option>
  180. <el-option label="交流状态1" value="交流状态1"></el-option>
  181. <el-option label="交流状态2" value="交流状态2"></el-option>
  182. <el-option label="交流状态3" value="交流状态3"></el-option>
  183. </el-select>
  184. </el-form-item>
  185. <el-form-item label="添加标签" prop="addTag" v-if="content.type == 5 "
  186. v-model="content.addTag">
  187. <el-tag
  188. :key="tag"
  189. v-for="tag in content.addTag"
  190. closable
  191. :disable-transitions="false"
  192. @close="handleClose(contentIndex,tag,content)">
  193. {{ tag }}
  194. </el-tag>
  195. <el-input
  196. style="width:110px"
  197. class="input-new-tag"
  198. v-if="addTag[contentIndex].inputVisible"
  199. v-model="addTag[contentIndex].inputValue"
  200. ref="saveTagInput"
  201. size="small"
  202. @keyup.enter.native="handleInputConfirm(contentIndex,content)"
  203. @blur="handleInputConfirm(contentIndex,content)"
  204. >
  205. </el-input>
  206. <el-button v-else class="button-new-tag" size="small" style="width: 110px"
  207. @click="showInput(contentIndex)">新增标签
  208. </el-button>
  209. </el-form-item>
  210. <el-form-item label="移除标签" prop="remarkMobiles" v-if="content.type == 5 ">
  211. <el-tag
  212. :key="tag"
  213. v-for="tag in content.delTag"
  214. closable
  215. :disable-transitions="false"
  216. @close="handleCloseDel(contentIndex,tag,content)">
  217. {{ tag }}
  218. </el-tag>
  219. <el-input
  220. style="width:110px"
  221. class="input-new-tag"
  222. v-if="addTag[contentIndex].delTagVisible"
  223. v-model="addTag[contentIndex].delTagValue"
  224. ref="saveTagInputDel"
  225. size="small"
  226. @keyup.enter.native="handleInputConfirmDel(contentIndex,content)"
  227. @blur="handleInputConfirmDel(contentIndex,content)"
  228. >
  229. </el-input>
  230. <el-button v-else class="button-new-tag" size="small" style="width: 110px"
  231. @click="showInputDel(contentIndex)">新增标签
  232. </el-button>
  233. </el-form-item>
  234. <div v-for="(setList, setIndex) in content.setting" :key="setIndex"
  235. style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;"
  236. v-if="content.type != 4 && content.type != 5">
  237. <el-row style="padding-bottom: 20px">
  238. <el-col :span="22">
  239. <el-form v-if="form.sendType != 4" :model="setList" label-width="70px">
  240. <el-form-item label="内容类别" style="margin: 2%">
  241. <div v-if="form.sendType == 1 ">
  242. <el-radio-group v-model="setList.contentType" :disabled="formType == 3">
  243. <!-- <el-radio :label="item.dictValue" v-for="item in sysQwSopContentType">{{item.dictLabel}}</el-radio>-->
  244. <el-radio
  245. v-for="item in sysQwSopContentType"
  246. :key="item.dictValue"
  247. :label="item.dictValue"
  248. :disabled="item.dictValue === '1' && content.setting.some(s => s.contentType == '1') ">
  249. {{ item.dictLabel }}
  250. </el-radio>
  251. </el-radio-group>
  252. </div>
  253. <div v-if="form.sendType == 2">
  254. <el-radio-group v-model="setList.contentType"
  255. :disabled="formType == 3"
  256. @change="handleContentTypeChange(content,index,contentIndex,setIndex, item, 'contentType', $event)">
  257. <el-radio
  258. :key="item.dictValue"
  259. :label="item.dictValue"
  260. :disabled="(content.type!=2 && item.dictValue === '9') || (content.isOfficial==1 && ['5','6','7','8','9'].includes(item.dictValue))"
  261. v-for="item in sysQwSopAiContentType">{{ item.dictLabel }}
  262. </el-radio>
  263. </el-radio-group>
  264. </div>
  265. <div v-if="form.sendType == 11">
  266. <el-radio-group v-model="setList.contentType"
  267. :disabled="formType == 3 || (form.sendType == 11 && contentIndex != 0 && setIndex == 0)"
  268. @change="handleContentTypeChange(content,index,contentIndex,setIndex, item, 'contentType', $event)">
  269. <el-radio
  270. :key="item.dictValue"
  271. :label="item.dictValue"
  272. :disabled="(content.type!=2 && item.dictValue === '9') || (content.isOfficial==1 && ['5','6','7','8','9'].includes(item.dictValue))"
  273. v-for="item in sysQwSopAiContentType" v-if="setIndex == 0 ? courseTypeList.includes(item.dictValue) : !courseTypeList.includes(item.dictValue)">{{ item.dictLabel }}
  274. </el-radio>
  275. </el-radio-group>
  276. </div>
  277. </el-form-item>
  278. <el-form-item label="内容">
  279. <el-input :disabled="formType == 3" v-if="setList.contentType == 1 "
  280. v-model="setList.value"
  281. type="textarea" :rows="3" placeholder="内容"
  282. style="width: 90%;margin-top: 10px;"
  283. @keydown.native="handleKeydown($event, index, contentIndex, setIndex)"
  284. :ref="`textarea-${index}-${contentIndex}-${setIndex}`"
  285. />
  286. <!-- 修改按钮部分 -->
  287. <el-link
  288. v-if="setList.contentType == 1"
  289. type="primary"
  290. @click="toggleSalesCall(index, contentIndex, setIndex)"
  291. style="margin-top: 10px;"
  292. >
  293. {{ setList.isSalesCallAdded ? '移除#销售称呼#' : '添加#销售称呼#' }}
  294. </el-link>
  295. <ImageUpload :disabled="formType == 3" v-if="setList.contentType == 2 "
  296. v-model="setList.imgUrl"
  297. type="image" :num="1" :width="150" :height="150"/>
  298. <div
  299. v-if="setList.contentType == 3 || (setList.contentType == 9 && content.type==2 )">
  300. <el-card class="box-card">
  301. <el-form-item label="链接标题:" label-width="100px" required>
  302. <el-input :disabled="formType == 3 || (form.sendType == 11 && contentIndex != 0 && setIndex == 0)" v-model="setList.linkTitle"
  303. @change="updateAll(setIndex, item, 'linkTitle', $event)"
  304. placeholder="请输入链接标题"
  305. style="width: 90%;"/>
  306. </el-form-item>
  307. <el-form-item label="链接描述:" label-width="100px" required>
  308. <el-input :disabled="formType == 3 || (form.sendType == 11 && contentIndex != 0 && setIndex == 0)" type="textarea" :rows="3"
  309. v-model="setList.linkDescribe"
  310. @change="updateAll(setIndex, item, 'linkDescribe', $event)"
  311. placeholder="请输入链接描述"
  312. style="width: 90%;margin-top: 1%;"/>
  313. </el-form-item>
  314. <el-form-item label="链接封面:" label-width="100px" required>
  315. <ImageUpload :disabled="formType == 3 || (form.sendType == 11 && contentIndex != 0 && setIndex == 0)" v-model="setList.linkImageUrl"
  316. type="image" :num="1"
  317. @input="updateAll(setIndex, item, 'linkImageUrl', $event)"
  318. :file-size="2" :width="150" :height="150"
  319. style="margin-top: 1%;"/>
  320. </el-form-item>
  321. <div v-if="content.type != 2 " style="margin-top: 1%">
  322. <el-form-item label="链接地址:" label-width="100px" required>
  323. <el-input :disabled="formType == 3" v-model="setList.linkUrl"
  324. placeholder="请输入链接地址"
  325. style="width: 90%;"/>
  326. </el-form-item>
  327. </div>
  328. <div v-if="content.type == 2 ">
  329. <el-form-item label="链接地址:" label-width="100px">
  330. <el-tag type="warning" v-model="setList.isBindUrl = 1 ">选择的课程小节
  331. 即为卡片链接地址
  332. </el-tag>
  333. </el-form-item>
  334. </div>
  335. </el-card>
  336. </div>
  337. <div v-if="setList.contentType == 4">
  338. <el-card class="box-card">
  339. <el-form-item label="标题" prop="miniprogramTitle">
  340. <el-input v-model="setList.miniprogramTitle"
  341. :disabled="formType == 3 || (form.sendType == 11 && contentIndex != 0 && setIndex == 0)"
  342. @change="updateAll(setIndex, item, 'miniprogramTitle', $event)"
  343. placeholder="请输入小程序消息标题,最长为64字节" :rows="2"
  344. maxlength="64" type="textarea"
  345. @input="checkByteLength(content,setList.contentType,content.isOfficial)"/>
  346. </el-form-item>
  347. <el-form-item label="封面" prop="miniprogramPicUrl">
  348. <ImageUpload v-if="content.isOfficial !== '1'"
  349. @change="updateAll(setIndex, item, 'miniprogramPicUrl', $event)"
  350. :disabled="formType == 3 || (form.sendType == 11 && contentIndex != 0 && setIndex == 0)"
  351. v-model="setList.miniprogramPicUrl" type="image" :num="10"
  352. :width="150" :height="150"/>
  353. </el-form-item>
  354. <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
  355. <el-input v-model="setList.miniprogramAppid='wx73f85f8d62769119' "
  356. disabled/>
  357. </el-form-item>
  358. <el-form-item label="page路径" prop="miniprogramPage" v-show="false"
  359. label-width="100px" style="margin-left: -30px">
  360. <el-input v-model="setList.miniprogramPage"
  361. placeholder="小程序消息打开后的路径" disabled/>
  362. </el-form-item>
  363. </el-card>
  364. </div>
  365. <div v-if="setList.contentType == 5 ">
  366. <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
  367. <el-upload
  368. :disabled="formType == 3"
  369. v-model="setList.fileUrl"
  370. class="avatar-uploader"
  371. :action="uploadUrl"
  372. :show-file-list="false"
  373. :on-success="(res, file) => handleAvatarSuccessFile(res, file, setList)"
  374. :before-upload="beforeAvatarUploadFile">
  375. <i class="el-icon-plus avatar-uploader-icon"></i>
  376. </el-upload>
  377. <el-link v-if="setList.fileUrl" type="primary"
  378. :href="downloadUrl(setList.fileUrl)" download>
  379. {{ setList.fileUrl }}
  380. </el-link>
  381. </el-form-item>
  382. </div>
  383. <div v-if="setList.contentType == 6 ">
  384. <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
  385. <el-upload
  386. :disabled="formType == 3"
  387. v-model="setList.videoUrl"
  388. class="avatar-uploader"
  389. :action="uploadUrl"
  390. :show-file-list="false"
  391. :on-success="(res, file) => handleAvatarSuccessVideo(res, file, setList)"
  392. :before-upload="beforeAvatarUploadVideo">
  393. <i class="el-icon-plus avatar-uploader-icon"></i>
  394. </el-upload>
  395. <video v-if="setList.videoUrl"
  396. :src="setList.videoUrl"
  397. controls style="width: 200px;height: 100px">
  398. </video>
  399. </el-form-item>
  400. </div>
  401. <div v-if="setList.contentType == 7 ">
  402. <el-input
  403. :disabled="formType == 3"
  404. v-model="setList.value"
  405. type="textarea" :rows="3" maxlength="66" show-word-limit
  406. placeholder="输入要转为语音的内容"
  407. style="width: 90%;margin-top: 10px;"
  408. @input="handleInputVideoText(setList.value,setList)"/>
  409. </div>
  410. <div v-if="setList.contentType == 8 ">
  411. <el-button :disabled="formType == 3" type="primary"
  412. style="margin-bottom: 1%"
  413. @click="hanldeSelectVideoNum(content,index,contentIndex,setIndex)">
  414. 选择视频号
  415. </el-button>
  416. <el-card class="box-card" v-if="setList.coverUrl">
  417. <el-form-item label="封面标题:" label-width="100px">
  418. <el-input :disabled="formType == 3" v-model="setList.nickname"
  419. style="width: 90%;margin-bottom: 1%" disabled/>
  420. </el-form-item>
  421. <el-form-item label="头像:" label-width="100px">
  422. <el-image
  423. v-if="setList.avatar != null"
  424. :src="setList.avatar"
  425. :preview-src-list="[setList.avatar]"
  426. :style="{ width: '50px', height: '50px' }"
  427. ></el-image>
  428. </el-form-item>
  429. <el-form-item label="封面:" label-width="100px">
  430. <el-image
  431. v-if="setList.coverUrl != null"
  432. :src="setList.coverUrl"
  433. :preview-src-list="[setList.coverUrl]"
  434. :style="{ width: '200px', height: '200px' }"
  435. ></el-image>
  436. </el-form-item>
  437. <el-form-item label="简介:" label-width="100px">
  438. <el-input :disabled="formType == 3" type="textarea" :rows="3"
  439. v-model="setList.desc"
  440. style="width: 90%;margin-top: 1%;" disabled/>
  441. </el-form-item>
  442. <el-form-item label="视频地址:" label-width="100px"
  443. style="margin-top: 1%">
  444. <el-input :disabled="formType == 3" v-model="setList.url"
  445. style="width: 90%;" disabled/>
  446. </el-form-item>
  447. </el-card>
  448. </div>
  449. <div v-if="setList.contentType == 10 ">
  450. <el-card class="box-card">
  451. <el-form-item label="链接标题:" label-width="100px" required>
  452. <el-input :disabled="formType == 3" v-model="setList.linkTitle"
  453. placeholder="请输入链接标题"
  454. style="width: 90%;"/>
  455. </el-form-item>
  456. <el-form-item label="链接描述:" label-width="100px" required>
  457. <el-input :disabled="formType == 3" type="textarea" :rows="3"
  458. v-model="setList.linkDescribe"
  459. placeholder="请输入链接描述"
  460. style="width: 90%;margin-top: 1%;"/>
  461. </el-form-item>
  462. <el-form-item label="链接封面:" label-width="100px" required>
  463. <ImageUpload :disabled="formType == 3" v-model="setList.linkImageUrl"
  464. type="image" :num="1"
  465. :file-size="2" :width="150" :height="150"
  466. style="margin-top: 1%;"/>
  467. </el-form-item>
  468. <el-form-item label="链接地址:" label-width="100px">
  469. <el-tag type="warning"> 链接地址自动生成
  470. </el-tag>
  471. </el-form-item>
  472. </el-card>
  473. </div>
  474. </el-form-item>
  475. <el-form-item label="添加短链"
  476. v-if="content.type == 2 && setList.contentType == 1 ">
  477. <el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark"
  478. :disabled="!content.videoId">
  479. <el-switch
  480. @change="updateHtml"
  481. v-model="setList.isBindUrl"
  482. :disabled="!content.videoId && formType == 3"
  483. active-color="#13ce66"
  484. inactive-color="#DCDFE6"
  485. active-value="1"
  486. inactive-value="2">
  487. </el-switch>
  488. </el-tooltip>
  489. <span v-if="setList.isBindUrl == '1'"
  490. style="margin-left: 10px; color: #13ce66">添加URL</span>
  491. <span v-if="setList.isBindUrl == '2'"
  492. style="margin-left: 10px; color: #b1b4ba">不加URL</span>
  493. </el-form-item>
  494. <el-form-item label="课节过期时间"
  495. v-if="content.type == 2 && setList.isBindUrl == '1' && setList.contentType != 2 && setList.contentType != 5 && setList.contentType != 6 && setList.contentType != 8 && setList.contentType != 9 && setList.contentType != 10 ">
  496. <el-row>
  497. <el-input type="number" v-model="setList.expiresDays"
  498. :disabled="formType == 3 || (form.sendType == 11 && contentIndex != 0 && setIndex == 0)"
  499. @change="updateAll(setIndex, item, 'expiresDays', $event)"
  500. style="width: 200px">
  501. <template slot="append">天</template>
  502. </el-input>
  503. </el-row>
  504. <el-row>
  505. <span class="tip">填写0或不填时,默认为系统配置的默认时间</span>
  506. </el-row>
  507. </el-form-item>
  508. </el-form>
  509. <el-form v-if="form.sendType == 4" :model="setList" label-width="70px">
  510. <el-form-item label="添加客服" prop="intervalTime" style="margin: 2%">
  511. <el-input-number
  512. v-model="setList.intervalTime"
  513. :min="1"
  514. :max="1440"
  515. style="width:100px;margin-top: 10px;"
  516. >
  517. </el-input-number>
  518. <span class="tip">单位:分钟,最大1440分钟(24小时)</span>
  519. </el-form-item>
  520. <el-form-item label="内容" style="margin: 2%">
  521. <el-input
  522. v-model="setList.value"
  523. type="textarea"
  524. :rows="3"
  525. placeholder="内容"
  526. style="width: 90%;margin-top: 10px;"/>
  527. </el-form-item>
  528. <el-form-item label="交流状态" style="margin: 2%">
  529. <el-select v-model="setList.talkType" placeholder="更改交流状态" size="mini"
  530. style=" margin-right: 10px;" clearable>
  531. <el-option label="非首次交流" value="非首次交流"></el-option>
  532. <el-option label="首次交流1" value="首次交流1"></el-option>
  533. <el-option label="首次交流2" value="首次交流2"></el-option>
  534. <el-option label="交流状态1" value="交流状态1"></el-option>
  535. <el-option label="交流状态2" value="交流状态2"></el-option>
  536. <el-option label="交流状态3" value="交流状态3"></el-option>
  537. </el-select>
  538. </el-form-item>
  539. </el-form>
  540. </el-col>
  541. <el-col :span="1" :offset="1">
  542. <i class="el-icon-delete" @click="delSetList(index,contentIndex,setIndex)"
  543. style="margin-top: 20px;"
  544. v-if="content.setting.length>1 && formType != 3 && !(form.sendType == 11 && setIndex == 0)"></i>
  545. </el-col>
  546. </el-row>
  547. </div>
  548. <el-link type="primary" class="el-icon-plus" :underline="false"
  549. @click='addSetList(contentIndex,item.content)'
  550. v-if="content.type != 4 && formType != 3">添加内容
  551. </el-link>
  552. </el-form>
  553. </el-col>
  554. <el-col :span="1" :offset="1">
  555. <i class="el-icon-delete" @click="delContent(index,contentIndex)"
  556. style="margin-top: 20px;"
  557. v-if="item.content.length>1 && formType != 3"></i>
  558. </el-col>
  559. </el-row>
  560. </div>
  561. <el-link type="primary" class="el-icon-plus" :underline="false" @click='addContent(index)'
  562. v-if="formType != 3 && form.sendType != 4">添加规则
  563. </el-link>
  564. </el-form-item>
  565. </el-form>
  566. </div>
  567. <div style="float: right;" v-if="formType != 3">
  568. <el-button type="primary" @click="save" v-if="!item.voice || item.voice == 0">
  569. 保存({{ '第' + (1 + (form.gap * index)) + '天' }})
  570. </el-button>
  571. <el-button type="primary" disabled v-if="item.voice == 1">语言生成中</el-button>
  572. <el-button type="primary" @click="leave(tabIndex)" v-if="item.voice == 1">刷新状态</el-button>
  573. </div>
  574. </el-col>
  575. </el-row>
  576. </el-tab-pane>
  577. </el-tabs>
  578. </el-form-item>
  579. </el-form>
  580. </div>
  581. <el-dialog :title="videoNumOptions.title" :visible.sync="videoNumOptions.open" style="width: 1500px;height: 100%"
  582. append-to-body>
  583. <userVideo ref="QwUserVideo" @videoResult="qwUserVideoResult"></userVideo>
  584. </el-dialog>
  585. <el-dialog title="修改天数排序" :visible.sync="openSort" style="width: 1500px" append-to-body>
  586. <draggable v-model="dayList" @end="onDragEndDay" style="padding: 20px">
  587. <el-button v-for="(item, index) in dayList" :class="item.newDay != item.dayNum ? 'red':''">第{{
  588. item.newDay
  589. }}天(第{{ item.dayNum }}天)
  590. </el-button>
  591. </draggable>
  592. <div style="float: right;">
  593. <el-button type="primary" @click="saveSorts">保存</el-button>
  594. </div>
  595. </el-dialog>
  596. <el-dialog title="修改规则排序" :visible.sync="openSort2" style="width: 1500px" append-to-body>
  597. <draggable v-model="ruleList" @end="onDragEnd" style="padding: 20px">
  598. <el-button v-for="(item, index) in ruleList">{{ item.time }}</el-button>
  599. </draggable>
  600. <div style="float: right;">
  601. <el-button @click="autoSortsRules">自动排序</el-button>
  602. <el-button type="primary" @click="saveSortsRules">保存</el-button>
  603. </div>
  604. </el-dialog>
  605. </div>
  606. </template>
  607. <style scoped>
  608. .el-button {
  609. margin-left: 10px;
  610. }
  611. .red:hover {
  612. color: #dbdbdb !important;
  613. }
  614. .red {
  615. background-color: #F56C6C !important;
  616. color: #fff !important;
  617. }
  618. .custom-input /deep/ .el-input__inner {
  619. height: 20px;
  620. text-align: center;
  621. }
  622. .custom-input /deep/ .el-input__icon {
  623. line-height: 10px;
  624. }
  625. .el-icon-delete {
  626. cursor: pointer;
  627. }
  628. /deep/ .el-badge__content.is-fixed {
  629. top: 10px !important;
  630. right: 0 !important;
  631. width: 8px;
  632. }
  633. .tip {
  634. color: #909399;
  635. font-size: 12px;
  636. margin-left: 10px;
  637. }
  638. .sortable-ghost {
  639. background: rgb(26, 164, 255) !important;
  640. color: #FFF !important;
  641. }
  642. </style>
  643. <script>
  644. import draggable from 'vuedraggable';
  645. import {
  646. listSopTemp,
  647. getSopTemp,
  648. delSopTemp,
  649. addSopTemp,
  650. sortDay,
  651. dayListFun,
  652. updateSopTemp,
  653. getSelectableRange,
  654. exportSopTemp,
  655. addOrUpdateSetting,
  656. selectRulesInfo,
  657. delRules
  658. } from "@/api/qw/sopTemp";
  659. import {courseList, videoList} from "@/api/qw/sop";
  660. import ImageUpload from "@/views/qw/sop/ImageUpload";
  661. import userVideo from "@/views/qw/userVideo/userVideo.vue";
  662. export default {
  663. name: "updateSopTemp",
  664. components: {ImageUpload, userVideo, draggable},
  665. data() {
  666. return {
  667. addTag: [{
  668. addTag: [],
  669. inputVisible: false,
  670. inputValue: '',
  671. delTag: [],
  672. delTagVisible: false,
  673. delTagValue: ''
  674. }],
  675. uploadUrl: process.env.VUE_APP_BASE_API + "/common/uploadOSS",
  676. uploadUrlByVoice: process.env.VUE_APP_BASE_API + "/common/uploadOSSByHOOKVoice",
  677. //上传语音的遮罩层
  678. voiceLoading: false,
  679. openSort: false,
  680. openSort2: false,
  681. // 遮罩层
  682. loading: false,
  683. loading2: false,
  684. loading3: false,
  685. // 导出遮罩层
  686. exportLoading: false,
  687. // 选中数组
  688. dayList: [],
  689. ruleList: [],
  690. ids: [],
  691. courseTypeList: ['3', '4', '9'],
  692. sysFsSopWatchStatus: [],
  693. //消息内容类型 企微版
  694. sysQwSopContentType: [],
  695. //插件版
  696. sysQwSopAiContentType: [],
  697. //类别
  698. sysQwSopSettingType: [],
  699. courseList: [],
  700. videoList: [],
  701. // 非单个禁用
  702. single: true,
  703. // 非多个禁用
  704. multiple: true,
  705. defaultContentType: 1,
  706. // 显示搜索条件
  707. showSearch: true,
  708. // 总条数
  709. id: "",
  710. total: 0,
  711. tabIndex: null,
  712. // sop模板表格数据
  713. setting: [],
  714. data: [],
  715. // 弹出层标题
  716. title: "",
  717. // 是否显示弹出层
  718. open: false,
  719. // 状态字典
  720. statusOptions: [],
  721. startTimeRange: [],
  722. videoNumOptions: {
  723. title: '选择视频号',
  724. open: false,
  725. content: null,
  726. contentIndex: null,
  727. setIndex: null,
  728. },
  729. //1 修改 2 复制 3 查看
  730. formType: null,
  731. // 查询参数
  732. form: {
  733. name: null,
  734. setting: null,
  735. status: "1",
  736. sort: 1,
  737. companyId: null,
  738. gap: 1,
  739. },
  740. // 表单校验
  741. rules: {
  742. name: [
  743. {required: true, message: '名称不能为空', trigger: 'blur'}
  744. ],
  745. status: [
  746. {required: true, message: '状态不能为空', trigger: 'blur'}
  747. ],
  748. sort: [
  749. {required: true, message: '排序不能为空', trigger: 'blur'}
  750. ],
  751. gap: [
  752. {required: true, message: '间隔天数不能为空', trigger: 'blur'}
  753. ],
  754. }
  755. };
  756. },
  757. created() {
  758. this.getDicts("sys_qwSopAi_contentType").then(response => {
  759. this.sysQwSopAiContentType = response.data;
  760. });
  761. this.getDicts("sys_fs_sop_watch_status").then(response => {
  762. this.sysFsSopWatchStatus = response.data;
  763. });
  764. this.getDicts("sys_qwSop_contentType").then(response => {
  765. this.sysQwSopContentType = response.data;
  766. });
  767. this.getDicts("sys_company_status").then(response => {
  768. this.statusOptions = response.data;
  769. });
  770. this.getDicts("sys_qwSop_settingType").then(response => {
  771. this.sysQwSopSettingType = response.data;
  772. });
  773. courseList().then(response => {
  774. this.courseList = response.list;
  775. });
  776. getSelectableRange().then(e => {
  777. this.startTimeRange = e.data;
  778. })
  779. const id = this.$route.params && this.$route.params.id;
  780. this.id = id;
  781. this.formType = this.$route.params && this.$route.params.type;
  782. this.handleUpdate(id);
  783. },
  784. methods: {
  785. handleClose(index, tag, content) {
  786. content.addTag.splice(content.addTag.indexOf(tag), 1);
  787. },
  788. showInput(index) {
  789. this.addTag[index].inputVisible = true;
  790. },
  791. handleInputConfirm(index, content) {
  792. let inputValue = this.addTag[index].inputValue;
  793. if (inputValue) {
  794. if (!content.hasOwnProperty('addTag')) {
  795. this.$set(content, 'addTag', []);
  796. }
  797. content.addTag.push(inputValue);
  798. }
  799. this.addTag[index].inputVisible = false;
  800. this.addTag[index].inputValue = '';
  801. },
  802. // 检查字节长度
  803. checkByteLength(content, type, isOfficial) {
  804. if (type == 4 && isOfficial == '1')
  805. for (let i = 0; i < content.setting.length; i++) {
  806. const text = content.setting[i].miniprogramTitle;
  807. const byteLength = this.getByteLength(text); // 获取当前字节数
  808. // 如果字节数超过64,截断输入内容
  809. if (byteLength > 64) {
  810. this.$set(content.setting[i], 'miniprogramTitle', this.truncateTextByByteLength(text, 60));
  811. }
  812. }
  813. },
  814. // 计算字符串的字节数
  815. getByteLength(text) {
  816. return new Blob([text]).size; // 使用 Blob 计算字节数
  817. },
  818. // 根据字节数截断字符串
  819. truncateTextByByteLength(text, maxByteLength) {
  820. let byteLength = 0;
  821. let result = "";
  822. for (let i = 0; i < text.length; i++) {
  823. const char = text[i];
  824. const charByteLength = this.getByteLength(char); // 获取当前字符的字节数
  825. // 如果加上当前字符的字节数后不超过限制,则添加到结果中
  826. if (byteLength + charByteLength <= maxByteLength) {
  827. result += char;
  828. byteLength += charByteLength;
  829. } else {
  830. break; // 超过限制时停止
  831. }
  832. }
  833. return result;
  834. },
  835. handleCloseDel(index, tag, content) {
  836. content.delTag.splice(content.delTag.indexOf(tag), 1);
  837. },
  838. showInputDel(index) {
  839. this.addTag[index].delTagVisible = true;
  840. },
  841. handleInputConfirmDel(index, content) {
  842. let delTagValue = this.addTag[index].delTagValue;
  843. if (delTagValue) {
  844. if (!content.hasOwnProperty('delTag')) {
  845. this.$set(content, 'delTag', []);
  846. }
  847. content.delTag.push(delTagValue);
  848. }
  849. this.addTag[index].delTagVisible = false;
  850. this.addTag[index].delTagValue = '';
  851. },
  852. saveSorts() {
  853. let list = this.dayList.filter(e => e.dayNum != e.newDay).map(e => {
  854. return {dayNum: e.newDay, id: e.id}
  855. })
  856. this.loading3 = true;
  857. sortDay(list).then(e => {
  858. window.location.reload();
  859. })
  860. },
  861. saveSortsRules() {
  862. this.$set(this.setting[this.tabIndex], 'content', this.ruleList);
  863. this.openSort2 = false;
  864. },
  865. autoSortsRules() {
  866. this.ruleList = this.ruleList.sort((a, b) => {
  867. // 将 time 字段转换为 Date 对象进行比较
  868. const timeA = new Date(`1970-01-01T${a.time}Z`);
  869. const timeB = new Date(`1970-01-01T${b.time}Z`);
  870. // 比较时间顺序
  871. return timeA - timeB; // 升序排序
  872. });
  873. },
  874. openUpdateDaySorts() {
  875. dayListFun(this.id).then(response => {
  876. response.data.forEach((item) => item.newDay = item.dayNum);
  877. this.dayList = response.data;
  878. if (this.dayList == null || this.dayList.length == 0) {
  879. this.$message.error("暂无天数")
  880. } else {
  881. this.openSort = true;
  882. }
  883. })
  884. },
  885. openUpdateSorts() {
  886. this.ruleList = JSON.parse(JSON.stringify(this.setting[this.tabIndex].content));
  887. if (this.ruleList == null || this.ruleList.length == 0) {
  888. this.$message.error("暂无规则")
  889. } else {
  890. this.openSort2 = true;
  891. }
  892. },
  893. onDragEndDay() {
  894. this.dayList.forEach((item, index) => {
  895. item.newDay = (this.form.gap * index) + 1;
  896. })
  897. this.$forceUpdate()
  898. },
  899. onDragEnd() {
  900. // 更新排序值
  901. // this.setting[this.tabIndex].content.forEach((item, index) => {
  902. // item.sorts = index;
  903. // });
  904. },
  905. // 切换标签保存数据
  906. leave(index, oldIndex) {
  907. const newData = this.setting[index]
  908. if (newData.dayNum && newData.id) {
  909. this.loading = true;
  910. selectRulesInfo(newData.id).then(res => {
  911. this.$nextTick(() => {
  912. this.loading = false;
  913. this.videoList = [];
  914. this.addTag = [];
  915. this.$set(this.setting, index, {
  916. ...newData,
  917. voice: res.data.voice,
  918. content: res.data.list || [{type: this.defaultContentType, contentType: '1', setting: [{contentType: '1', value: ""}]}]
  919. });
  920. for (let j = 0; j < this.setting[index].content.length; j++) {
  921. if (this.setting[index].content[j].addTag != null) {
  922. this.setting[index].content[j].addTag = JSON.parse(this.setting[index].content[j].addTag)
  923. }
  924. if (this.setting[index].content[j].delTag != null) {
  925. this.setting[index].content[j].delTag = JSON.parse(this.setting[index].content[j].delTag)
  926. }
  927. this.videoList.push([])
  928. this.addTag.push({
  929. addTag: [],
  930. inputVisible: false,
  931. inputValue: '',
  932. delTag: [],
  933. delTagVisible: false,
  934. delTagValue: ''
  935. })
  936. if (this.setting[index].content[j].type == 2) {
  937. if (this.setting[index].content[j].hasOwnProperty('courseId')) {
  938. this.courseChange(this.setting[index].content[j], index, j);
  939. }
  940. }
  941. }
  942. })
  943. });
  944. }
  945. },
  946. save() {
  947. let data = this.setting[this.tabIndex];
  948. let check = this.checkData(data);
  949. if (!check) {
  950. return;
  951. }
  952. for (let j = 0; j < data.content.length; j++) {
  953. if (data.content[j].type != 4 && data.content[j].type != 5) {
  954. for (let k = 0; k < data.content[j].setting.length; k++) {
  955. if (data.content[j].setting[k].contentType == 4 && (data.content[j].setting[k].miniprogramTitle != null || data.content[j].setting[k].miniprogramTitle != "")) {
  956. data.content[j].setting[k].miniprogramTitle = this.truncateTextByByteLength(data.content[j].setting[k].miniprogramTitle, 60)
  957. }
  958. }
  959. }
  960. }
  961. let index = 0;
  962. const dataList = data.content.map(e => {
  963. e.name = data.name;
  964. e.tempId = this.id;
  965. e.sorts = Number(this.tabIndex);
  966. e.dayNum = (this.form.gap * e.sorts) + 1;
  967. e.sorts = index++;
  968. data.dayNum = e.dayNum;
  969. e.contentType = e.type;
  970. e.settingList = e.setting;
  971. e.settingList.forEach(e => e.content = JSON.stringify(e));
  972. if (e.addTag != null) {
  973. e.addTag = JSON.stringify(e.addTag);
  974. }
  975. if (e.delTag != null) {
  976. e.delTag = JSON.stringify(e.delTag);
  977. }
  978. return e;
  979. })
  980. data.tempId = this.id;
  981. data.list = dataList;
  982. this.loading = true;
  983. addOrUpdateSetting(data).then(e => {
  984. this.$message.success(e.msg)
  985. let content = this.setting[this.tabIndex].content;
  986. for (let j = 0; j < content.length; j++) {
  987. if (content[j].addTag != null) {
  988. content[j].addTag = JSON.parse(content[j].addTag);
  989. }
  990. if (content[j].delTag != null) {
  991. content[j].delTag = JSON.parse(content[j].delTag);
  992. }
  993. }
  994. this.loading = false;
  995. // 使用Vue.set确保响应式更新
  996. this.$set(this.setting, this.tabIndex, {
  997. ...this.setting[this.tabIndex],
  998. id: e.data.id,
  999. });
  1000. }).catch(() => {
  1001. this.loading = false;
  1002. });
  1003. },
  1004. checkData(data) {
  1005. if (this.form.sendType != 4) {
  1006. for (let j = 0; j < data.content.length; j++) {
  1007. if (data.name == null || data.name == "") {
  1008. this.$message.error("内容名称不能为空")
  1009. return false;
  1010. }
  1011. if (data.content[j].time == null || data.content[j].time == "") {
  1012. this.$message.error("时间不能为空")
  1013. return false;
  1014. }
  1015. if (data.content[j].type == 2) {
  1016. if (data.content[j].courseId == null || data.content[j].courseId == "") {
  1017. this.$message.error("请选择课程")
  1018. return false;
  1019. }
  1020. if (data.content[j].videoId == null || data.content[j].videoId == "") {
  1021. this.$message.error("请选择课节")
  1022. return false;
  1023. }
  1024. if (data.content[j].courseType == null || data.content[j].courseType === "") {
  1025. this.$message.error("请选择消息类型")
  1026. return false;
  1027. }
  1028. }
  1029. if (data.content[j].type != 4 && data.content[j].type != 5) {
  1030. for (let k = 0; k < data.content[j].setting.length; k++) {
  1031. if (data.content[j].setting[k].contentType == 1 && (data.content[j].setting[k].value == null || data.content[j].setting[k].value == "")) {
  1032. this.$message.error("内容不能为空")
  1033. return false;
  1034. }
  1035. if (data.content[j].setting[k].contentType == 2 && (data.content[j].setting[k].imgUrl == null || data.content[j].setting[k].imgUrl == "")) {
  1036. this.$message.error("图片不能为空")
  1037. return false;
  1038. }
  1039. if ((data.content[j].setting[k].contentType == 3 || data.content[j].setting[k].contentType == 9 || data.content[j].setting[k].contentType == 10) && (data.content[j].setting[k].linkTitle == null || data.content[j].setting[k].linkTitle == "")) {
  1040. this.$message.error("链接标题不能为空")
  1041. return false;
  1042. }
  1043. if ((data.content[j].setting[k].contentType == 3 || data.content[j].setting[k].contentType == 9 || data.content[j].setting[k].contentType == 10) && (data.content[j].setting[k].linkDescribe == null || data.content[j].setting[k].linkDescribe == "")) {
  1044. this.$message.error("链接描述不能为空")
  1045. return false;
  1046. }
  1047. if ((data.content[j].setting[k].contentType == 3 || data.content[j].setting[k].contentType == 9 || data.content[j].setting[k].contentType == 10) && (data.content[j].setting[k].linkImageUrl == null || data.content[j].setting[k].linkImageUrl == "")) {
  1048. this.$message.error("链接图片不能为空")
  1049. return false;
  1050. }
  1051. if (data.content[j].setting[k].contentType == 3 && data.content[j].setting[k].type == 1 && (data.content[j].setting[k].linkUrl == null || data.content[j].setting[k].linkUrl == "")) {
  1052. this.$message.error("链接地址不能为空")
  1053. return false;
  1054. }
  1055. if (data.content[j].setting[k].contentType == 4 && (data.content[j].setting[k].miniprogramTitle == null || data.content[j].setting[k].miniprogramTitle == "")) {
  1056. this.$message.error("小程序消息标题不能为空")
  1057. return false;
  1058. }
  1059. if (data.content[j].setting[k].contentType == 4 && data.content[j].isOfficial !== '1' && (data.content[j].setting[k].miniprogramPicUrl == null || data.content[j].setting[k].miniprogramPicUrl == "")) {
  1060. this.$message.error("小程序封面地址不能为空")
  1061. return false;
  1062. }
  1063. if (data.content[j].setting[k].contentType == 5 && (data.content[j].setting[k].fileUrl == null || data.content[j].setting[k].fileUrl == "")) {
  1064. this.$message.error("文件不能为空")
  1065. return false;
  1066. }
  1067. if (data.content[j].setting[k].contentType == 6 && (data.content[j].setting[k].videoUrl == null || data.content[j].setting[k].videoUrl == "")) {
  1068. this.$message.error("视频不能为空")
  1069. return false;
  1070. }
  1071. if (data.content[j].setting[k].contentType == 7 && (data.content[j].setting[k].value == null || data.content[j].setting[k].value == "")) {
  1072. this.$message.error("语音文本不能为空")
  1073. return false;
  1074. }
  1075. if (data.content[j].setting[k].contentType == 8 && (data.content[j].setting[k].url == null || data.content[j].setting[k].url == "")) {
  1076. this.$message.error("视频号信息不能为空")
  1077. return false;
  1078. }
  1079. }
  1080. } else if (data.content[j].type == 4) {
  1081. if (data.content[j].aiTouch == null || data.content[j].aiTouch == '') {
  1082. this.$message.error("AI触达不能为空")
  1083. return false;
  1084. }
  1085. }
  1086. }
  1087. } else {
  1088. for (let day of this.setting) {
  1089. for (let content of day.content) {
  1090. for (let set of content.setting) {
  1091. if (!set.intervalTime) {
  1092. this.$message.error("客服数量不能为空");
  1093. return false;
  1094. }
  1095. if (!set.value) {
  1096. this.$message.error("内容不能为空");
  1097. return false;
  1098. }
  1099. }
  1100. }
  1101. }
  1102. }
  1103. return true;
  1104. },
  1105. tabClick(obj) {
  1106. },
  1107. addSetList(contentIndex, content) {
  1108. if (this.form.sendType == 1) {
  1109. for (let i = 0; i < content.length; i++) {
  1110. if (content[i].setting.length > 9) {
  1111. return this.$message.error("因为企微接口限制,企微模板一条消息只能设置最多~9个内容!!")
  1112. } else {
  1113. // 动态生成新的设置项
  1114. const newSetting = content[i].setting.some(item => item.contentType === '1')
  1115. ? {contentType: '2', imgUrl: ''} // 如果存在 contentType = '1',添加 contentType = '2'
  1116. : {contentType: '1', value: ''}; // 如果不存在 contentType = '1',添加 contentType = '1'
  1117. // 将新设置项添加到 content[i].setting 数组中
  1118. content[i].setting.push(newSetting);
  1119. }
  1120. }
  1121. } else {
  1122. const newSetting = {
  1123. contentType: '1',
  1124. value: '',
  1125. };
  1126. if (this.form.sendType == 4) {
  1127. newSetting.intervalTime = 5;
  1128. }
  1129. // 将新设置项添加到 content.setting 数组中
  1130. content[contentIndex].setting.push(newSetting);
  1131. }
  1132. },
  1133. delSetList(index, contentIndex, setIndex) {
  1134. this.setting[index].content[contentIndex].setting.splice(setIndex, 1)
  1135. },
  1136. addContent(index) {
  1137. if (this.setting[index].content.length > 0 && this.form.sendType == 1) {
  1138. return this.$message.error("因为企微接口限制,企微模板一天只能设置一条消息~")
  1139. } else {
  1140. const sourceContent = this.setting[index].content[0];
  1141. const newContent = {
  1142. type: this.defaultContentType,
  1143. contentType: 1,
  1144. setting: [{contentType: '1', value: ""}],
  1145. // 复制课程相关字段,如 courseId、videoId,根据实际数据结构补充
  1146. courseId: sourceContent.courseId,
  1147. videoId: sourceContent.videoId,
  1148. courseType: sourceContent.courseType
  1149. };
  1150. this.setting[index].content.push(newContent);
  1151. this.videoList.push([]);
  1152. this.addTag.push({
  1153. addTag: [],
  1154. inputVisible: false,
  1155. inputValue: '',
  1156. delTag: [],
  1157. delTagVisible: false,
  1158. delTagValue: ''
  1159. });
  1160. // 如果有视频列表关联,也可同步处理 videoList,根据 courseId 重新请求或复制已有视频数据
  1161. if (sourceContent.courseId) {
  1162. this.courseUpdate(newContent, index, this.setting[index].content.length - 1);
  1163. }
  1164. }
  1165. },
  1166. delContent(index, contentIndex) {
  1167. this.setting[index].content.splice(contentIndex, 1)
  1168. this.videoList.splice(contentIndex, 1)
  1169. this.addTag.splice(contentIndex, 1)
  1170. },
  1171. addSetting() {
  1172. let content = [{type: this.defaultContentType, contentType: '1', setting: [{contentType: '1', value: "",}]}];
  1173. if (this.form.sendType == 4) {
  1174. content[0].setting[0].intervalTime = 5;
  1175. }
  1176. this.setting.push({
  1177. name: null,
  1178. dayNum: (this.form.gap * this.setting.length) + 1,
  1179. content
  1180. })
  1181. },
  1182. delSetting(index) {
  1183. const newData = this.setting[index]
  1184. if (newData.id && newData.dayNum) {
  1185. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  1186. confirmButtonText: '确定',
  1187. cancelButtonText: '取消',
  1188. type: 'warning'
  1189. }).then(() => {
  1190. delRules(newData.id, newData.name, newData.dayNum).then(res => {
  1191. this.del(index);
  1192. });
  1193. });
  1194. } else {
  1195. this.del(index);
  1196. }
  1197. },
  1198. del(index) {
  1199. if (index == 0) {
  1200. this.tabIndex = "0";
  1201. } else {
  1202. this.tabIndex = (index - 1) + "";
  1203. }
  1204. this.setting.splice(index, 1)
  1205. },
  1206. handleClosegroupUser(list) {
  1207. const index = this.userSelectList.findIndex(t => t === list);
  1208. if (index !== -1) {
  1209. this.userSelectList.splice(index, 1);
  1210. }
  1211. },
  1212. //选择视频号
  1213. hanldeSelectVideoNum(content, index, contentIndex, setIndex) {
  1214. this.videoNumOptions.content = content;
  1215. this.videoNumOptions.contentIndex = contentIndex;
  1216. this.videoNumOptions.setIndex = setIndex;
  1217. this.videoNumOptions.open = true;
  1218. },
  1219. qwUserVideoResult(val) {
  1220. // 根据选中的内容,将返回的数据更新到相应的表单项
  1221. const content = this.videoNumOptions.content;
  1222. const setList = content.setting[this.videoNumOptions.setIndex];
  1223. setList.nickname = val.nickname;
  1224. setList.avatar = val.avatar;
  1225. setList.coverUrl = val.coverUrl;
  1226. setList.thumbUrl = val.thumbUrl;
  1227. setList.desc = val.desc;
  1228. setList.url = val.url;
  1229. setList.extras = val.extras;
  1230. this.videoNumOptions.open = false;
  1231. },
  1232. //首次刷新
  1233. courseChange(content, index, countIndex) {
  1234. this.courseUpdate(content, index, countIndex);
  1235. },
  1236. //修改
  1237. courseChangeUpdate(content, index, countIndex) {
  1238. this.$set(content, 'videoId', null);
  1239. // 查找选中的课程对应的 label
  1240. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === content.courseId);
  1241. for (let i = 0; i < content.setting.length; i++) {
  1242. this.$set(content.setting[i], 'linkTitle', null);
  1243. this.$set(content.setting[i], 'linkDescribe', null);
  1244. this.$set(content.setting[i], 'linkImageUrl', null);
  1245. //如果是链接的才上
  1246. if (selectedCourse && content.type == 2 && content.courseId != null) {
  1247. //响应式直接给链接的标题/封面上值
  1248. if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
  1249. this.$set(content.setting[i], 'linkTitle', selectedCourse.dictLabel);
  1250. this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
  1251. }
  1252. if (content.setting[i].contentType == 4) {
  1253. this.$set(content.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
  1254. }
  1255. }
  1256. }
  1257. this.courseUpdate(content, index, countIndex);
  1258. },
  1259. handleInputVideoText(value, content) {
  1260. // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
  1261. const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
  1262. // 删除不符合条件的字符
  1263. const filteredValue = value.split('').filter(char => regex.test(char)).join('');
  1264. this.$set(content, 'value', filteredValue);
  1265. },
  1266. courseUpdate(content, index, countIndex) {
  1267. videoList(content.courseId).then(response => {
  1268. // this.$set(this.videoList, countIndex, response.list); // 响应式设置videoList
  1269. this.videoList.splice(countIndex, 1, response.list);
  1270. });
  1271. },
  1272. toggleSalesCall(itemIndex, contentIndex, setIndex) {
  1273. // 获取目标对象
  1274. const setItem = this.setting[itemIndex].content[contentIndex].setting[setIndex];
  1275. const salesCall = '#销售称呼#';
  1276. const refKey = `textarea-${itemIndex}-${contentIndex}-${setIndex}`;
  1277. const textarea = this.$refs[refKey][0]?.$refs?.textarea;
  1278. if (!textarea) return;
  1279. // 获取光标位置
  1280. const cursorPosition = textarea.selectionStart;
  1281. if (setItem.isSalesCallAdded) {
  1282. // 移除所有标签
  1283. setItem.value = setItem.value.replace(new RegExp(salesCall, 'g'), '');
  1284. } else {
  1285. // 插入到光标位置
  1286. setItem.value =
  1287. setItem.value.slice(0, cursorPosition) +
  1288. salesCall +
  1289. setItem.value.slice(cursorPosition);
  1290. }
  1291. // 切换状态
  1292. setItem.isSalesCallAdded = !setItem.isSalesCallAdded;
  1293. // 保持光标位置
  1294. this.$nextTick(() => {
  1295. const newCursorPos = cursorPosition + (setItem.isSalesCallAdded ? salesCall.length : 0);
  1296. textarea.setSelectionRange(newCursorPos, newCursorPos);
  1297. });
  1298. },
  1299. handleKeydown(event, itemIndex, contentIndex, setIndex) {
  1300. const setItem = this.setting[itemIndex].content[contentIndex].setting[setIndex];
  1301. const refKey = `textarea-${itemIndex}-${contentIndex}-${setIndex}`;
  1302. const textarea = this.$refs[refKey][0]?.$refs?.textarea;
  1303. if (!textarea) return;
  1304. const tags = ['#销售称呼#', '#客户称呼#'];
  1305. const key = event.key;
  1306. const value = setItem.value;
  1307. const cursorPosition = textarea.selectionStart;
  1308. if (key === 'Backspace' || key === 'Delete') {
  1309. tags.forEach(tag => {
  1310. let start, end;
  1311. // Backspace 处理
  1312. if (key === 'Backspace' && cursorPosition >= tag.length) {
  1313. start = cursorPosition - tag.length;
  1314. if (value.slice(start, cursorPosition) === tag) {
  1315. event.preventDefault();
  1316. setItem.value = value.slice(0, start) + value.slice(cursorPosition);
  1317. if (tag === '#销售称呼#') setItem.isSalesCallAdded = false;
  1318. this.$nextTick(() => textarea.setSelectionRange(start, start));
  1319. }
  1320. }
  1321. // Delete 处理
  1322. if (key === 'Delete') {
  1323. end = cursorPosition + tag.length;
  1324. if (value.slice(cursorPosition, end) === tag) {
  1325. event.preventDefault();
  1326. setItem.value = value.slice(0, cursorPosition) + value.slice(end);
  1327. if (tag === '#销售称呼#') setItem.isSalesCallAdded = false;
  1328. }
  1329. }
  1330. });
  1331. }
  1332. },
  1333. handleContentTypeChange(content, index, countIndex, setIndex, item, fieldName, val) {
  1334. //如果是链接的才上
  1335. if (content.courseId != null && content.type == 2) {
  1336. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === content.courseId);
  1337. for (let i = 0; i < content.setting.length; i++) {
  1338. //响应式直接给链接的标题/封面上值
  1339. if (selectedCourse && content.type == 2 && content.courseId != null) {
  1340. if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
  1341. this.$set(content.setting[i], 'linkTitle', selectedCourse.dictLabel);
  1342. this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
  1343. }
  1344. if (content.setting[i].contentType == 4 && (content.isOfficial == '0' || content.isOfficial == null)) {
  1345. console.log(content.isOfficial);
  1346. this.$set(content.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
  1347. }
  1348. }
  1349. }
  1350. }
  1351. if (content.videoId != null && content.type == 2) {
  1352. // 查找选中的课节对应的 label
  1353. const selectedVideo = this.videoList[countIndex].find(course => parseInt(course.dictValue) === content.videoId);
  1354. for (let i = 0; i < content.setting.length; i++) {
  1355. //响应式直接给链接的描述上值
  1356. if (selectedVideo && content.type == 2 && content.videoId != null) {
  1357. if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
  1358. this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
  1359. }
  1360. if (content.setting[i].contentType == 4) {
  1361. this.$set(content.setting[i], 'miniprogramTitle', this.truncateTextByByteLength(selectedVideo.dictLabel, 60));
  1362. }
  1363. }
  1364. }
  1365. }
  1366. if(countIndex == 0 && setIndex == 0){
  1367. this.updateAll(setIndex, item, fieldName, val);
  1368. for (let index in item.content) {
  1369. if(index != 0){
  1370. this.handleContentTypeChange(item.content[index], 0, index, 0, item, fieldName, val);
  1371. }
  1372. }
  1373. }
  1374. },
  1375. videoIdChange(content, index, countIndex) {
  1376. //选择了课程小节则 默认绑上
  1377. let selectedVideo;
  1378. // 查找选中的课程对应的 label
  1379. if (content.videoId != null) {
  1380. selectedVideo = this.videoList[countIndex].find(course => parseInt(course.dictValue) === content.videoId);
  1381. }
  1382. for (let i = 0; i < content.setting.length; i++) {
  1383. //课程消息-文本内容
  1384. if (content.setting[i].contentType == 1 && content.type == 2) {
  1385. this.$set(content.setting[i], 'isBindUrl', '1');
  1386. }
  1387. //如果是链接的才上
  1388. if (selectedVideo && content.type == 2 && content.videoId != null) {
  1389. if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
  1390. this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
  1391. }
  1392. if (content.setting[i].contentType == 4) {
  1393. this.$set(content.setting[i], 'miniprogramTitle', this.truncateTextByByteLength(selectedVideo.dictLabel, 60));
  1394. }
  1395. }
  1396. }
  1397. },
  1398. //上传文件
  1399. handleAvatarSuccessFile(res, file, content) {
  1400. if (res.code === 200) {
  1401. // 使用 $set 确保响应式更新
  1402. this.$set(content, 'fileUrl', res.url);
  1403. } else {
  1404. this.msgError(res.msg);
  1405. }
  1406. },
  1407. beforeAvatarUploadFile(file) {
  1408. const isLt1M = file.size / 1024 / 1024 < 10;
  1409. if (!isLt1M) {
  1410. this.$message.error('上传大小不能超过 10MB!');
  1411. }
  1412. return isLt1M;
  1413. },
  1414. //下载文件
  1415. downloadUrl(materialUrl) {
  1416. // 直接返回文件 URL
  1417. return materialUrl;
  1418. },
  1419. handleAvatarSuccessVideo(res, file, content) {
  1420. if (res.code == 200) {
  1421. // 使用 $set 确保响应式更新
  1422. this.$set(content, 'videoUrl', res.url);
  1423. } else {
  1424. this.msgError(res.msg);
  1425. }
  1426. },
  1427. beforeAvatarUploadVideo(file) {
  1428. const isLt30M = file.size / 1024 / 1024 < 10;
  1429. const isMP4 = file.type === 'video/mp4';
  1430. if (!isMP4) {
  1431. this.$message.error('仅支持上传 MP4 格式的视频文件!');
  1432. return false;
  1433. }
  1434. if (!isLt30M) {
  1435. this.$message.error('上传大小不能超过 10MB!');
  1436. return false;
  1437. }
  1438. return true;
  1439. },
  1440. handleAvatarSuccessVoice(res, file, content) {
  1441. if (res.code == 200) {
  1442. // 创建 Audio 对象加载音频
  1443. const audio = new Audio(res.mp3Url);
  1444. audio.addEventListener('loadedmetadata', () => {
  1445. // 获取音频时长
  1446. this.$set(content, 'voiceDuration', Math.ceil(audio.duration));
  1447. });
  1448. // 使用 $set 确保响应式更新
  1449. this.$set(content, 'voiceUrl', res.silkUrl);
  1450. this.$set(content, 'mp3Url', res.mp3Url);
  1451. } else {
  1452. this.msgError(res.msg);
  1453. }
  1454. this.voiceLoading = false;
  1455. },
  1456. beforeAvatarUploadVoice(file) {
  1457. return new Promise((resolve, reject) => {
  1458. const isLt10M = file.size / 1024 / 1024 < 10; // 假设语音文件大小限制为10MB
  1459. const isVoiceType = ['audio/mp3', 'audio/mpeg', 'audio/wav', 'audio/x-wav'].includes(file.type);
  1460. if (!isVoiceType) {
  1461. this.$message.error('仅支持上传 MP3, WAV, X-WAV 格式的语音文件!');
  1462. return reject(false); // 不允许继续上传
  1463. }
  1464. if (!isLt10M) {
  1465. this.$message.error('上传大小不能超过 10MB!');
  1466. return reject(false); // 不允许继续上传
  1467. }
  1468. // 使用 FileReader 读取文件
  1469. const reader = new FileReader();
  1470. reader.onload = (event) => {
  1471. const audio = new Audio(event.target.result);
  1472. audio.addEventListener('loadedmetadata', () => {
  1473. // 获取时长并保存
  1474. if (Math.ceil(audio.duration) > 30) {
  1475. this.$message.error('音频时长不能超过30秒!');
  1476. this.voiceLoading = false;
  1477. return reject(false); // 不允许继续上传
  1478. }
  1479. resolve(true); // 允许上传
  1480. });
  1481. };
  1482. reader.onerror = () => {
  1483. this.$message.error('无法读取音频文件!请上传正确的音频文件');
  1484. reject(false); // 不允许继续上传
  1485. };
  1486. this.voiceLoading = true;
  1487. reader.readAsDataURL(file); // 开始读取文件
  1488. });
  1489. },
  1490. /** 查询sop模板列表 */
  1491. getList() {
  1492. this.loading = true;
  1493. listSopTemp(this.queryParams).then(response => {
  1494. this.sopTempList = response.rows;
  1495. this.total = response.total;
  1496. this.loading = false;
  1497. });
  1498. },
  1499. // 取消按钮
  1500. cancel() {
  1501. this.$store.dispatch("tagsView/delView", this.$route);
  1502. this.$router.replace('/qw/conversion/sopTemp')
  1503. // this.reset();
  1504. },
  1505. // 表单重置
  1506. reset() {
  1507. this.form = {
  1508. id: null,
  1509. name: null,
  1510. setting: null,
  1511. status: "0",
  1512. sort: null,
  1513. createTime: null,
  1514. createBy: null,
  1515. companyId: null
  1516. };
  1517. this.resetForm("form");
  1518. },
  1519. /** 修改按钮操作 */
  1520. handleUpdate(id) {
  1521. getSopTemp(id).then(response => {
  1522. this.videoList = []
  1523. this.form = response.data;
  1524. this.setting = this.form.list || [];
  1525. if (Array.isArray(this.setting)) {
  1526. this.setting.forEach(item => {
  1527. if (item && Array.isArray(item.content)) {
  1528. item.content.forEach(content => {
  1529. if (content && Array.isArray(content.setting)) {
  1530. content.setting.forEach(setList => {
  1531. if (setList && !Object.hasOwn(setList, 'isSalesCallAdded')) {
  1532. this.$set(setList, 'isSalesCallAdded', false);
  1533. }
  1534. });
  1535. }
  1536. });
  1537. }
  1538. });
  1539. }
  1540. this.form.list.forEach(e => e.newDay = e.dayNum)
  1541. this.dayList = JSON.parse(JSON.stringify(this.form.list));
  1542. this.videoList.push([]);
  1543. this.addTag.push({
  1544. addTag: [],
  1545. inputVisible: false,
  1546. inputValue: '',
  1547. delTag: [],
  1548. delTagVisible: false,
  1549. delTagValue: ''
  1550. })
  1551. });
  1552. },
  1553. /** 提交按钮 */
  1554. submitForm() {
  1555. },
  1556. /** 删除按钮操作 */
  1557. handleDelete(row) {
  1558. const ids = row.id || this.ids;
  1559. this.$confirm('是否确认删除sop模板编号为"' + ids + '"的数据项?', "警告", {
  1560. confirmButtonText: "确定",
  1561. cancelButtonText: "取消",
  1562. type: "warning"
  1563. }).then(function () {
  1564. return delSopTemp(ids);
  1565. }).then(() => {
  1566. this.getList();
  1567. this.msgSuccess("删除成功");
  1568. }).catch(() => {
  1569. });
  1570. },
  1571. /** 导出按钮操作 */
  1572. handleExport() {
  1573. const queryParams = this.queryParams;
  1574. this.$confirm('是否确认导出所有sop模板数据项?', "警告", {
  1575. confirmButtonText: "确定",
  1576. cancelButtonText: "取消",
  1577. type: "warning"
  1578. }).then(() => {
  1579. this.exportLoading = true;
  1580. return exportSopTemp(queryParams);
  1581. }).then(response => {
  1582. this.download(response.msg);
  1583. this.exportLoading = false;
  1584. }).catch(() => {
  1585. });
  1586. },
  1587. updateHtml(val) {
  1588. val || val();
  1589. },
  1590. updateAll(setIndex, list, fieldName, newVal) {
  1591. if(this.form.sendType == 11 && setIndex == 0) {
  1592. console.info("更新数据", newVal)
  1593. for (let index in list.content) {
  1594. this.$set(list.content[index].setting[0], fieldName, newVal);
  1595. }
  1596. }
  1597. }
  1598. }
  1599. };
  1600. </script>