deptIndex.vue 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="企微公司" prop="corpId">
  5. <el-select v-model="queryParams.corpId" placeholder="企微公司" size="small" @change="updateCorpId()">
  6. <el-option
  7. v-for="dict in myQwCompanyList"
  8. :key="dict.dictValue"
  9. :label="dict.dictLabel"
  10. :value="dict.dictValue"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="客户名称" prop="name">
  15. <el-input
  16. v-model="queryParams.name"
  17. placeholder="请输入客户名称"
  18. clearable
  19. size="small"
  20. @keyup.enter.native="handleQuery"
  21. />
  22. </el-form-item>
  23. <el-form-item label="销售企微昵称" prop="qwUserName">
  24. <el-input
  25. v-model="queryParams.qwUserName"
  26. placeholder="请输入销售企微昵称"
  27. clearable
  28. size="small"
  29. @keyup.enter.native="handleQuery"
  30. @input="searchQwUser"
  31. @focus="showQwUserDropdown = true"
  32. @blur="hideDropdownWithDelay"
  33. @clear="onQwUserNameClear"
  34. />
  35. <!-- 下拉建议 -->
  36. <div v-if="showQwUserDropdown && qwUserSuggestions.length > 0" class="suggestion-box" @scroll="handleScroll">
  37. <div
  38. v-for="item in qwUserSuggestions"
  39. :key="item.dictValue"
  40. class="suggestion-item"
  41. @click="selectQwUser(item.dictValue,item.dictLabel)"
  42. >
  43. {{ item.dictLabel }}
  44. </div>
  45. </div>
  46. </el-form-item>
  47. <el-form-item label="用户类别" prop="type">
  48. <el-select v-model="queryParams.type" placeholder="请选择用户类别" clearable size="small">
  49. <el-option
  50. v-for="dict in typeOptions"
  51. :key="dict.dictValue"
  52. :label="dict.dictLabel"
  53. :value="dict.dictValue"
  54. />
  55. </el-select>
  56. </el-form-item>
  57. <el-form-item label="性别" prop="gender">
  58. <el-select v-model="queryParams.gender" placeholder="状态" clearable size="small">
  59. <el-option
  60. v-for="dict in genderOptions"
  61. :key="dict.dictValue"
  62. :label="dict.dictLabel"
  63. :value="dict.dictValue"
  64. />
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item label="客户等级" prop="level">
  68. <el-select v-model="queryParams.level" placeholder="客户等级" clearable size="small">
  69. <el-option
  70. v-for="dict in ratingType"
  71. :key="dict.dictValue"
  72. :label="dict.dictLabel"
  73. :value="dict.dictValue"
  74. />
  75. </el-select>
  76. </el-form-item>
  77. <el-form-item label="等级升降" prop="levelType">
  78. <el-select v-model="queryParams.levelType" placeholder="等级升降" clearable size="small">
  79. <el-option
  80. v-for="dict in ratingUpFall"
  81. :key="dict.dictValue"
  82. :label="dict.dictLabel"
  83. :value="dict.dictValue"
  84. />
  85. </el-select>
  86. </el-form-item>
  87. <el-form-item label="电话号码" prop="remarkMobiles">
  88. <el-input
  89. v-model="queryParams.remarkMobiles"
  90. placeholder="请输入备注电话号码"
  91. clearable
  92. size="small"
  93. @keyup.enter.native="handleQuery"
  94. />
  95. </el-form-item>
  96. <el-form-item label="来源" prop="addWay">
  97. <el-select v-model="queryParams.addWay" placeholder="来源" clearable size="small">
  98. <el-option
  99. v-for="dict in addWayOptions"
  100. :key="dict.dictValue"
  101. :label="dict.dictLabel"
  102. :value="dict.dictValue"
  103. />
  104. </el-select>
  105. </el-form-item>
  106. <el-form-item label="状态" prop="status">
  107. <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">
  108. <el-option
  109. v-for="dict in statusOptions"
  110. :key="dict.dictValue"
  111. :label="dict.dictLabel"
  112. :value="dict.dictValue"
  113. />
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item label="转接状态" prop="addWay">
  117. <el-select v-model="queryParams.transferStatus" placeholder="转接状态" clearable size="small">
  118. <el-option
  119. v-for="dict in transferStatusOptions"
  120. :key="dict.dictValue"
  121. :label="dict.dictLabel"
  122. :value="dict.dictValue"
  123. />
  124. </el-select>
  125. </el-form-item>
  126. <el-form-item label="是否绑小程序" prop="isBindMini">
  127. <el-select v-model="queryParams.isBindMini" placeholder="是否绑定小程序" clearable size="small" @change="handleQuery" >
  128. <el-option
  129. v-for="dict in isBindMiniOptions"
  130. :key="dict.dictValue"
  131. :label="dict.dictLabel"
  132. :value="dict.dictValue"
  133. />
  134. </el-select>
  135. </el-form-item>
  136. <el-form-item label="标签" prop="tagIds">
  137. <!-- <el-select v-model="selectTags" remote multiple placeholder="请选择" filterable style="width: 100%;">-->
  138. <!-- <el-option-->
  139. <!-- v-for="dict in tagList"-->
  140. <!-- :label="dict.name"-->
  141. <!-- :value="dict.tagId">-->
  142. <!-- </el-option>-->
  143. <!-- </el-select>-->
  144. <div @click="hangleChangeTags()" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">
  145. <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
  146. <el-tag type="success"
  147. closable
  148. :disable-transitions="false"
  149. v-for="list in this.selectTags"
  150. :key="list.tagId"
  151. @close="handleCloseTags(list)"
  152. style="margin: 3px;"
  153. >{{list.name}}
  154. </el-tag>
  155. </div>
  156. </div>
  157. </el-form-item>
  158. <el-form-item label="备注" prop="remark">
  159. <el-input
  160. v-model="queryParams.remark"
  161. placeholder="请输入备注"
  162. clearable
  163. size="small"
  164. @keyup.enter.native="handleQuery"
  165. />
  166. </el-form-item>
  167. <el-form-item label="绑定员工" prop="companyUserName">
  168. <el-input
  169. v-model="queryParams.companyUserName"
  170. placeholder="请输入员工名称"
  171. clearable
  172. size="small"
  173. @keyup.enter.native="handleQuery"
  174. />
  175. </el-form-item>
  176. <el-form-item label="添加时间" prop="createTime">
  177. <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
  178. </el-form-item>
  179. <el-form-item label="流失时间" prop="lossTime">
  180. <el-date-picker clearable size="small"
  181. v-model="queryParams.lossTime"
  182. type="date"
  183. value-format="yyyy-MM-dd"
  184. placeholder="选择流失时间">
  185. </el-date-picker>
  186. </el-form-item>
  187. <el-form-item label="删除时间" prop="delTime">
  188. <el-date-picker clearable size="small"
  189. v-model="queryParams.delTime"
  190. type="date"
  191. value-format="yyyy-MM-dd"
  192. placeholder="选择删除时间">
  193. </el-date-picker>
  194. </el-form-item>
  195. <el-form-item>
  196. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  197. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  198. </el-form-item>
  199. </el-form>
  200. <el-row :gutter="10" class="mb8">
  201. <!-- <el-col :span="1.5">
  202. <el-button
  203. type="primary"
  204. plain
  205. icon="el-icon-plus"
  206. size="mini"
  207. @click="handleAdd"
  208. v-hasPermi="['qw:externalContact:add']"
  209. >同步</el-button>
  210. </el-col> -->
  211. <el-col :span="1.5">
  212. <el-button
  213. type="success"
  214. plain
  215. icon="el-icon-edit"
  216. size="mini"
  217. @click="handleBatchUpdateNotes"
  218. v-hasPermi="['qw:externalContact:deptEdit']"
  219. >批量修改备注</el-button>
  220. </el-col>
  221. <!-- <el-col :span="1.5">
  222. <el-button
  223. type="warning"
  224. plain
  225. icon="el-icon-download"
  226. size="mini"
  227. :loading="exportLoading"
  228. @click="handleExport"
  229. v-hasPermi="['qw:externalContact:export']"
  230. >导出</el-button>
  231. </el-col> -->
  232. <el-col :span="1.5">
  233. <el-button
  234. type="primary"
  235. plain
  236. size="mini"
  237. @click="addUserTag"
  238. v-hasPermi="['qw:externalContact:deptAddTag']"
  239. >批量添加标签</el-button>
  240. </el-col>
  241. <el-col :span="1.5">
  242. <el-button
  243. type="primary"
  244. plain
  245. size="mini"
  246. @click="delUserTag"
  247. v-hasPermi="['qw:externalContact:deptDelTag']"
  248. >批量移除标签</el-button>
  249. </el-col>
  250. <el-col :span="1.5">
  251. <el-button
  252. type="primary"
  253. plain
  254. size="mini"
  255. @click="updateTalk"
  256. v-hasPermi="['qw:externalContactInfo:deptUpdateTalk']"
  257. >批量更改交流状态</el-button>
  258. </el-col>
  259. <!-- <el-col :span="1.5">-->
  260. <!-- <el-button-->
  261. <!-- type="primary"-->
  262. <!-- plain-->
  263. <!-- size="mini"-->
  264. <!-- @click="setUserCourseSop"-->
  265. <!-- v-hasPermi="['qw:externalContact:setCourseSop']"-->
  266. <!-- >批量设置课程SOP</el-button>-->
  267. <!-- </el-col>-->
  268. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  269. </el-row>
  270. <el-tabs type="card" v-model="isBindActiveName" @tab-click="handleClickX">
  271. <el-tab-pane label="全部" name="all"></el-tab-pane>
  272. <!-- <el-tab-pane label="已绑定CRM" name="isBind"></el-tab-pane>-->
  273. <!-- <el-tab-pane label="未绑定CRM" name="noBind"></el-tab-pane>-->
  274. </el-tabs>
  275. <el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
  276. <el-table-column type="selection" width="55" align="center" />
  277. <el-table-column label="企微客户ID" align="center" prop="id" />
  278. <el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">
  279. <template slot-scope="scope">
  280. <el-popover
  281. placement="right"
  282. title=""
  283. trigger="hover">
  284. <img slot="reference" :src="scope.row.avatar" width="60px">
  285. <img :src="scope.row.avatar" style="max-width: 200px;">
  286. </el-popover>
  287. </template>
  288. </el-table-column>
  289. <el-table-column label="企微客户名称" prop="name" width="110px"/>
  290. <el-table-column label="客户称呼" prop="stageStatus" width="110px"/>
  291. <el-table-column label="销售企微昵称" align="center" prop="qwUserName" width="120px"/>
  292. <el-table-column label="企微部门" align="center" prop="departmentName" width="120px"/>
  293. <el-table-column label="用户类别" align="center" prop="type">
  294. <template slot-scope="scope">
  295. <dict-tag :options="typeOptions" :value="scope.row.type"/>
  296. </template>
  297. </el-table-column>
  298. <el-table-column label="性别" align="center" prop="gender">
  299. <template slot-scope="scope">
  300. <dict-tag :options="genderOptions" :value="scope.row.gender"/>
  301. </template>
  302. </el-table-column>
  303. <el-table-column label="备注" align="center" prop="remark" />
  304. <el-table-column label="描述信息" align="center" prop="description" />
  305. <el-table-column label="标签" align="center" prop="tagIdsName" width="250px">
  306. <template slot-scope="scope">
  307. <div v-for="name in scope.row.tagIdsName" style="display: inline;">
  308. <el-tag type="success">{{ name }}</el-tag>
  309. </div>
  310. </template>
  311. </el-table-column>
  312. <el-table-column label="状态" align="center" prop="status" width="120px" >
  313. <template slot-scope="scope">
  314. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  315. </template>
  316. </el-table-column>
  317. <el-table-column label="客户等级" align="center" prop="level" width="120px" >
  318. <template slot-scope="scope">
  319. <dict-tag :options="ratingType" :value="scope.row.level"/>
  320. </template>
  321. </el-table-column>
  322. <el-table-column label="等级状态" align="center" prop="levelType" width="120px" >
  323. <template slot-scope="scope">
  324. <dict-tag :options="ratingUpFall" :value="scope.row.levelType"/>
  325. </template>
  326. </el-table-column>
  327. <el-table-column label="绑定员工" align="center" prop="companyUserName" />
  328. <el-table-column label="添加时间" align="center" prop="createTime" width="100px" />
  329. <el-table-column label="流失时间" align="center" prop="lossTime" width="100px" />
  330. <el-table-column label="删除时间" align="center" prop="delTime" width="100px" />
  331. <el-table-column label="备注电话号码" align="center" prop="remarkMobiles" width="150px">
  332. <template slot-scope="scope">
  333. <div v-for="i in JSON.parse(scope.row.remarkMobiles)" :key="i">{{i}}</div>
  334. </template>
  335. </el-table-column>
  336. <el-table-column label="备注企业名称" align="center" prop="remarkCorpName" />
  337. <el-table-column label="来源" align="center" prop="addWay" width="100px">
  338. <template slot-scope="scope">
  339. <dict-tag :options="addWayOptions" :value="scope.row.addWay"/>
  340. </template>
  341. </el-table-column>
  342. <el-table-column label="转接状态" align="center" prop="transferStatus" width="100px" >
  343. <template slot-scope="scope">
  344. <dict-tag :options="transferStatusOptions" :value="scope.row.transferStatus"/>
  345. </template>
  346. </el-table-column>
  347. <el-table-column label="企业id" align="center" prop="corpId" />
  348. <el-table-column label="是否重粉" align="center" prop="isRepeat" fixed="right">
  349. <template slot-scope="scope">
  350. <el-tag type="success" v-if="scope.row.isRepeat == 0">否</el-tag>
  351. <el-tag type="danger" v-if="scope.row.isRepeat == 1">是</el-tag>
  352. <el-button
  353. v-show="scope.row.isRepeat == 1"
  354. size="mini"
  355. type="text"
  356. @click="openRepeat(scope.row)"
  357. >查看</el-button>
  358. </template>
  359. </el-table-column>
  360. <el-table-column label="是否绑小程序" width="100px" align="center" fixed="right">
  361. <template slot-scope="scope">
  362. <el-tag v-if="scope.row.fsUserId" >已绑定</el-tag>
  363. <el-tag v-else type="info"> 未绑定</el-tag>
  364. </template>
  365. </el-table-column>
  366. <el-table-column label="修改" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
  367. <template slot-scope="scope">
  368. <el-button
  369. v-show="scope.row.status==0||scope.row.status==2"
  370. size="mini"
  371. type="text"
  372. icon="el-icon-edit"
  373. @click="handleUpdate(scope.row)"
  374. v-hasPermi="['qw:externalContact:edit']"
  375. >修改备注</el-button>
  376. <el-button
  377. size="mini"
  378. type="text"
  379. icon="el-icon-user-solid"
  380. @click="handleAppellation(scope.row)"
  381. >修改客户称呼</el-button>
  382. </template>
  383. </el-table-column>
  384. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
  385. <template slot-scope="scope">
  386. <!-- <el-button-->
  387. <!-- size="mini"-->
  388. <!-- type="text"-->
  389. <!-- icon="el-icon-edit-outline"-->
  390. <!-- @click="handleUpdateCustomer(scope.row)"-->
  391. <!-- >-->
  392. <!-- <span v-if="scope.row.customerId">换绑CRM</span>-->
  393. <!-- <span v-else>绑定CRM</span>-->
  394. <!-- </el-button>-->
  395. <el-button
  396. size="mini"
  397. type="text"
  398. icon="el-icon-edit-outline"
  399. @click="handleUpdateUser(scope.row)"
  400. >
  401. <span v-if="scope.row.fsUserId">换绑会员</span>
  402. <span v-else>绑定会员</span>
  403. </el-button>
  404. <el-button
  405. v-show="scope.row.fsUserId"
  406. size="mini"
  407. type="text"
  408. icon="el-icon-thumb"
  409. @click="handleUnBindUserId(scope.row)"
  410. v-hasPermi="['qw:externalContact:unBindUserId']"
  411. >
  412. <span>解除会员绑定</span>
  413. </el-button>
  414. <el-button v-show="scope.row.customerId"
  415. size="mini"
  416. type="text"
  417. icon="el-icon-paperclip"
  418. @click="handleShow(scope.row)"
  419. >CRM客户详情</el-button>
  420. <el-button
  421. size="mini"
  422. type="text"
  423. @click="handledetails(scope.row)"
  424. >AI获取用户信息
  425. </el-button>
  426. <el-button
  427. size="mini"
  428. type="text"
  429. v-show="scope.row.fsUserId"
  430. @click="handleUserdetails(scope.row)"
  431. >会员详情
  432. </el-button>
  433. <el-button
  434. size="mini"
  435. type="text"
  436. v-show="scope.row.fsUserId"
  437. @click="healthHandledetails(scope.row)"
  438. >健康档案
  439. </el-button>
  440. </template>
  441. </el-table-column>
  442. </el-table>
  443. <pagination-more
  444. v-show="total>0"
  445. :total="total"
  446. :page.sync="queryParams.pageNum"
  447. :limit.sync="queryParams.pageSize"
  448. @pagination="getList"
  449. />
  450. <el-drawer size="75%" :title="show.title" :visible.sync="show.open">
  451. <customer-details ref="customerDetails" @refreshList="refreshList"/>
  452. </el-drawer>
  453. <!-- 搜索标签 -->
  454. <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" width="1000px" append-to-body>
  455. <div>搜索标签:
  456. <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  457. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>
  458. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  459. </div>
  460. <div v-for="item in tagGroupList" :key="item.id" >
  461. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  462. <span class="name-background">{{ item.name }}</span>
  463. </div>
  464. <!-- 添加外层滚动容器 -->
  465. <div class="scroll-wrapper">
  466. <div class="tag-container">
  467. <a
  468. v-for="tagItem in item.tag"
  469. class="tag-box"
  470. @click="tagSelection(tagItem)"
  471. :class="{ 'tag-selected': tagItem.isSelected }"
  472. >
  473. {{ tagItem.name }}
  474. </a>
  475. </div>
  476. </div>
  477. </div>
  478. <pagination
  479. v-show="tagTotal>0"
  480. :total="tagTotal"
  481. :page.sync="queryTagParams.pageNum"
  482. :limit.sync="queryTagParams.pageSize"
  483. @pagination="getPageListTagGroup"
  484. />
  485. <div slot="footer" class="dialog-footer">
  486. <el-button type="primary" @click="tagSubmitForm()">确 定</el-button>
  487. <el-button @click="tagCancel()">取消</el-button>
  488. </div>
  489. </el-dialog>
  490. <el-dialog title="批量添加客户备注" :visible.sync="notesOpen.open" width="800px" append-to-body>
  491. <el-card>
  492. <el-row>
  493. <el-col>
  494. <el-radio-group v-model="notesOpen.nameType" style="margin-bottom: 2%">
  495. <el-radio :label="1">
  496. 客户名称添加在【新备注】【前】
  497. </el-radio>
  498. <el-radio :label="2">
  499. 客户名称添加在【新备注】【后】
  500. </el-radio>
  501. <el-radio :label="3">
  502. 不添加客户名称
  503. </el-radio>
  504. </el-radio-group>
  505. </el-col>
  506. <el-col >
  507. <el-radio-group v-model="notesOpen.type">
  508. <el-radio
  509. :label="1"
  510. >添加【新备注】在最【前】面</el-radio>
  511. <el-radio
  512. :label="2"
  513. >添加【新备注】在最【后】面</el-radio>
  514. <el-radio
  515. :label="3"
  516. >替换所有备注</el-radio>
  517. </el-radio-group>
  518. </el-col>
  519. <el-col>
  520. <el-input v-model="notesOpen.notes" placeholder="请输入客户备注(最多20个字,含已有的)" clearable size="small"
  521. maxlength="20" show-word-limit style="width: 500px;margin-top: 3%" />
  522. <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
  523. <i class="el-icon-info"></i>
  524. 由于企业微信官方限制,备注最多20个字,且自动会去除末尾超出的字
  525. </div>
  526. </el-col>
  527. </el-row>
  528. </el-card>
  529. <div slot="footer" class="dialog-footer">
  530. <el-button type="primary" @click="notesSubmitForm()">确 定</el-button>
  531. <el-button @click="notesCancel()">取消</el-button>
  532. </div>
  533. </el-dialog>
  534. <el-dialog title="批量添加标签" :visible.sync="tagOpen" width="800px" append-to-body>
  535. <div>搜索标签:
  536. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  537. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  538. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  539. </div>
  540. <el-form ref="form" :model="addTagForm" label-width="80px">
  541. <div v-for="item in tagGroupList" :key="item.id" >
  542. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  543. <span class="name-background">{{ item.name }}</span>
  544. </div>
  545. <!-- 添加外层滚动容器 -->
  546. <div class="scroll-wrapper">
  547. <div class="tag-container">
  548. <a
  549. v-for="tagItem in item.tag"
  550. class="tag-box"
  551. @click="tagSelection(tagItem)"
  552. :class="{ 'tag-selected': tagItem.isSelected }"
  553. >
  554. {{ tagItem.name }}
  555. </a>
  556. </div>
  557. </div>
  558. </div>
  559. </el-form>
  560. <pagination
  561. v-show="tagTotal>0"
  562. :total="tagTotal"
  563. :page.sync="queryTagParams.pageNum"
  564. :limit.sync="queryTagParams.pageSize"
  565. @pagination="getPageListTagGroup"
  566. />
  567. <div slot="footer" class="dialog-footer">
  568. <el-button type="primary" @click="addTagSubmitForm()">确 定</el-button>
  569. <el-button @click="addTagCancel">取 消</el-button>
  570. </div>
  571. </el-dialog>
  572. <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
  573. <div>搜索标签:
  574. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  575. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  576. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  577. </div>
  578. <el-form ref="form" :model="addTagForm" label-width="80px">
  579. <div v-for="item in tagGroupList" :key="item.id" >
  580. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  581. <span class="name-background">{{ item.name }}</span>
  582. </div>
  583. <!-- 添加外层滚动容器 -->
  584. <div class="scroll-wrapper">
  585. <div class="tag-container">
  586. <a
  587. v-for="tagItem in item.tag"
  588. class="tag-box"
  589. @click="tagSelection(tagItem)"
  590. :class="{ 'tag-selected': tagItem.isSelected }"
  591. >
  592. {{ tagItem.name }}
  593. </a>
  594. </div>
  595. </div>
  596. </div>
  597. </el-form>
  598. <pagination
  599. v-show="tagTotal>0"
  600. :total="tagTotal"
  601. :page.sync="queryTagParams.pageNum"
  602. :limit.sync="queryTagParams.pageSize"
  603. @pagination="getPageListTagGroup"
  604. />
  605. <div slot="footer" class="dialog-footer">
  606. <el-button type="primary" @click="tagDelSubmitForm()">确 定</el-button>
  607. <el-button @click="DelTagCancel">取 消</el-button>
  608. </div>
  609. </el-dialog>
  610. <!-- 添加或修改企业微信客户对话框 -->
  611. <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
  612. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  613. <el-form-item label="备注" prop="remark">
  614. <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
  615. </el-form-item>
  616. <el-form-item label="描述信息" prop="description">
  617. <el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述信息" />
  618. </el-form-item>
  619. <el-form-item label="备注电话号码" prop="remarkMobiles">
  620. <el-tag
  621. :key="tag"
  622. v-for="tag in remarkMobiles"
  623. closable
  624. :disable-transitions="false"
  625. @close="handleClose(tag)">
  626. {{tag}}
  627. </el-tag>
  628. <el-input
  629. style="width:110px"
  630. class="input-new-tag"
  631. v-if="inputVisible"
  632. v-model="inputValue"
  633. ref="saveTagInput"
  634. size="small"
  635. @keyup.enter.native="handleInputConfirm"
  636. @blur="handleInputConfirm"
  637. >
  638. </el-input>
  639. <el-button v-else class="button-new-tag" size="small" style="width: 110px" @click="showInput">新增电话</el-button>
  640. </el-form-item>
  641. <el-form-item label="备注企业名称" prop="remarkCorpName">
  642. <el-input v-model="form.remarkCorpName" placeholder="请输入备注企业名称" />
  643. </el-form-item>
  644. </el-form>
  645. <div slot="footer" class="dialog-footer">
  646. <el-button type="primary" @click="submitForm">确 定</el-button>
  647. <el-button @click="cancel">取 消</el-button>
  648. </div>
  649. </el-dialog>
  650. <el-dialog :title="callOpen.title" :visible.sync="callOpen.open" width="500px" append-to-body>
  651. <el-form ref="callOpenFrom" :model="callOpenFrom" :rules="callOpenRule" label-width="110px">
  652. <el-form-item label="客户称呼" prop="stageStatus">
  653. <el-input v-model="callOpenFrom.stageStatus" placeholder="请输入客户称呼" />
  654. </el-form-item>
  655. </el-form>
  656. <div slot="footer" class="dialog-footer" >
  657. <el-button type="primary" @click="submitCallOpenFrom">确 定</el-button>
  658. </div>
  659. </el-dialog>
  660. <!-- 绑定客户 -->
  661. <el-dialog :title="bindCustomer.title" :visible.sync="bindCustomer.open" width="1200px" append-to-body>
  662. <mycustomer ref="mycustomer" @bindCustomerId="bindCustomerId"></mycustomer>
  663. </el-dialog>
  664. <!-- 设置一个课程sop-->
  665. <el-dialog :title="setSop.title" :visible.sync="setSop.open" width="1200px" append-to-body>
  666. <SopDialog ref="SopDialog" @bindCourseSop="bindCourseSop"></SopDialog>
  667. </el-dialog>
  668. <el-dialog :title="user.title" :visible.sync="user.open" width="800px" append-to-body>
  669. <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>
  670. </el-dialog>
  671. <el-dialog :title="info.title" :visible.sync="info.open" width="1100px" append-to-body>
  672. <info ref="Details" />
  673. </el-dialog>
  674. <el-dialog
  675. :title="resultTitle"
  676. :visible.sync="resultDialogVisible"
  677. width="50%"
  678. custom-class="feedback-dialog"
  679. >
  680. <pre style="white-space: pre-wrap; font-family: inherit;">{{ resultMessage }}</pre>
  681. <span slot="footer" class="dialog-footer">
  682. <el-button @click="resultDialogVisible = false">关闭</el-button>
  683. </span>
  684. </el-dialog>
  685. <el-dialog
  686. title="企微账号"
  687. :visible.sync="repeat.open"
  688. width="50%"
  689. custom-class="feedback-dialog"
  690. >
  691. <el-row style="padding: 20px 10px">
  692. <el-tag v-for="item in repeat.list">{{item.qwUserName}}</el-tag>
  693. </el-row>
  694. </el-dialog>
  695. <el-drawer
  696. :with-header="false"
  697. size="75%"
  698. :title="showHealth.title" :visible.sync="showHealth.open">
  699. <healthRecordDetails ref="Details" />
  700. </el-drawer>
  701. <el-drawer
  702. :with-header="false"
  703. size="75%"
  704. :title="showUser.title"
  705. :visible.sync="showUser.open">
  706. <userDetails ref="userDetails" />
  707. </el-drawer>
  708. </div>
  709. </template>
  710. <script>
  711. import {
  712. addExternalContact,
  713. addTag,
  714. batchUpdateExternalContactNotes,
  715. bindUserId,
  716. delExternalContact,
  717. delTag,
  718. editbindCustomer,
  719. exportExternalContact,
  720. getCustomerCourseSop,
  721. getExternalContact,
  722. listExternalContact,
  723. setCustomerCourseSop,
  724. setCustomerCourseSopList,
  725. unBindUserId,
  726. updateExternalContact,
  727. getRepeat,
  728. updateExternalContactCall, myDeptExtList
  729. } from '../../../api/qw/externalContact'
  730. import {getMyQwCompanyList,getQwUserListLikeName} from "@/api/qw/user";
  731. import {getId} from "@/api/store/healthRecord";
  732. import {listTag, searchTags,} from "@/api/qw/tag";
  733. import {allListTagGroup} from "@/api/qw/tagGroup";
  734. import mycustomer from '@/views/qw/externalContact/mycustomer'
  735. import customerDetails from '@/views/qw/externalContact/customerDetails'
  736. import SopDialog from '@/views/course/sop/SopDialog.vue'
  737. import selectUser from "@/views/qw/externalContact/selectUser.vue";
  738. import info from "@/views/qw/externalContact/info.vue";
  739. import {editTalk} from "@/api/qw/externalContactInfo";
  740. import healthRecordDetails from '@/views/store/components/healthRecordDetails.vue'
  741. import userDetails from '@/views/store/components/userDetails.vue';
  742. import PaginationMore from "../../../components/PaginationMore/index.vue";
  743. export default {
  744. name: "deptExternalContact",
  745. components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,healthRecordDetails,userDetails},
  746. data() {
  747. return {
  748. resultDialogVisible: false,
  749. resultMessage: '',
  750. resultTitle:'',
  751. repeat: {
  752. open: false,
  753. loading: true,
  754. param:{},
  755. list:[]
  756. },
  757. user:{
  758. open:false,
  759. title:"修改客户"
  760. },
  761. userForm:{
  762. id:null,
  763. fsUserId:null,
  764. },
  765. info:{
  766. title:"用户信息",
  767. open:false,
  768. },
  769. // ...其他已有数据
  770. qwUserSuggestions: [], // 已展示的数据
  771. showQwUserDropdown: false, // 控制下拉框显示
  772. qwUserLoading: false, // 加载状态
  773. qwUserNoMore: false, // 是否还有更多数据
  774. qwUserPageNum: 1, // 当前页码
  775. qwUserPageSize: 10, // 每页数量
  776. qwUserTotal: 0, // 总数
  777. isBindMiniOptions:[
  778. {dictLabel:"已绑定",dictValue:'isBindMini'},
  779. {dictLabel:"未绑定",dictValue:'noBindMini'},
  780. ],
  781. //标签弹窗选择
  782. tagChange:{
  783. open:false,
  784. index:null,
  785. },
  786. sTime:null,
  787. eTime:null,
  788. createTime:null,
  789. // 遮罩层
  790. loading: false,
  791. // 导出遮罩层
  792. exportLoading: false,
  793. tagOpen:false,
  794. notesOpen: {
  795. type:1,
  796. nameType:3,
  797. open:false,
  798. notes:null,
  799. },
  800. tagDelOpen:false,
  801. // 选中数组
  802. ids: [],
  803. isBindActiveName:"all",
  804. remarkMobiles: [],
  805. inputVisible: false,
  806. inputValue: '',
  807. // 非单个禁用
  808. single: true,
  809. tagGroupList: [],
  810. // 非多个禁用
  811. multiple: true,
  812. // 显示搜索条件
  813. showSearch: true,
  814. // 总条数
  815. total: 0,
  816. // 企业微信客户表格数据
  817. externalContactList: [],
  818. // 弹出层标题
  819. title: "",
  820. // 是否显示弹出层
  821. open: false,
  822. // 用户类别字典
  823. typeOptions: [],
  824. ratingType: [],
  825. ratingUpFall: [],
  826. // 性别字典
  827. genderOptions: [],
  828. addTagForm:{
  829. userIds:[],
  830. tagIds:[]
  831. },
  832. myQwCompanyList:[],
  833. show:{
  834. title:"客户详情",
  835. open:false,
  836. },
  837. showHealth:{
  838. title:"健康档案",
  839. open:false,
  840. },
  841. showTongue:{
  842. title:"舌苔报告",
  843. open:false,
  844. },
  845. showUser:{
  846. title:"会员详情",
  847. open:false,
  848. },
  849. //存储选择的客户
  850. chooseCustomerSOP:null,
  851. setSop:{
  852. title:"选择课节SOP",
  853. open:false,
  854. //区分单选1还是多选2
  855. type:null,
  856. },
  857. //合成的客户-课节SOP参数
  858. customerCourseForm:{},
  859. //查询是否已经设置过客户-某个课节的SOP
  860. customerCourseFormLogs:{},
  861. //绑定客户
  862. bindCustomer:{
  863. title:null,
  864. open:false,
  865. },
  866. callOpen:{
  867. open:false,
  868. title: '修改客户称呼',
  869. },
  870. callOpenFrom:{
  871. id:null,
  872. stageStatus:null,
  873. },
  874. callOpenRule:{
  875. stageStatus:[{required:true,message:"员工称呼不能为空",trigger:"blur"}]
  876. },
  877. //绑定的参数表
  878. qwFormCustomer:{
  879. externalContactId:null,
  880. customerId:null,
  881. },
  882. // 来源字典
  883. addWayOptions: [],
  884. //标签
  885. changeTagDialog:{
  886. title:"",
  887. open:false,
  888. },
  889. queryTagParams:{
  890. pageNum: 1,
  891. pageSize: 5,
  892. total:0,
  893. name:null,
  894. corpId:null,
  895. },
  896. tagTotal:0,
  897. // 查询参数
  898. queryParams: {
  899. pageNum: 1,
  900. pageSize: 10,
  901. userId: null,
  902. qwUserName:null,
  903. externalUserId: null,
  904. name: null,
  905. avatar: null,
  906. type: null,
  907. qwUserId:null,
  908. gender: null,
  909. description: null,
  910. tagIds: null,
  911. remark:null,
  912. remarkMobiles: null,
  913. remarkCorpName: null,
  914. addWay: null,
  915. operUserid: null,
  916. corpId: null,
  917. companyId: null,
  918. status:null,
  919. transferStatus:null,
  920. isBind:null,
  921. isBindMini:null,
  922. lossTime:null,
  923. sTime:null,
  924. eTime:null,
  925. createTime:null,
  926. level:null,
  927. levelType:null
  928. },
  929. selectTags:[],
  930. // 表单参数
  931. form: {},
  932. tagList:[],
  933. transferStatusOptions:[],
  934. statusOptions:[],
  935. // 表单校验
  936. rules: {
  937. },
  938. tongueReportParams: {
  939. userId: null,
  940. }
  941. };
  942. },
  943. created() {
  944. this.getDicts("sys_qw_externalContact_type").then(response => {
  945. this.typeOptions = response.data;
  946. });
  947. this.getDicts("sys_qw_sop_rating_type").then(response => {
  948. this.ratingType = response.data;
  949. });
  950. this.getDicts("sys_qw_sop_rating_upFall").then(response => {
  951. this.ratingUpFall = response.data;
  952. });
  953. getMyQwCompanyList().then(response => {
  954. this.myQwCompanyList = response.data;
  955. if(this.myQwCompanyList!=null){
  956. this.queryParams.corpId=this.myQwCompanyList[0].dictValue
  957. var listTagFrom={corpId:this.queryParams.corpId}
  958. listTag(listTagFrom).then(response => {
  959. this.tagList = response.rows;
  960. });
  961. this.getList();
  962. }
  963. });
  964. this.getDicts("sys_sex").then(response => {
  965. this.genderOptions = response.data;
  966. });
  967. this.getDicts("sys_qw_externalContact_addWay").then(response => {
  968. this.addWayOptions = response.data;
  969. });
  970. this.getDicts("sys_qw_external_contact_status").then(response => {
  971. this.statusOptions = response.data;
  972. });
  973. this.getDicts("sys_qw_transfer_status").then(response => {
  974. this.transferStatusOptions = response.data;
  975. });
  976. },
  977. methods: {
  978. onQwUserNameClear() {
  979. this.queryParams.qwUserId = null; // 同时清空 qwUserId
  980. },
  981. // 搜索企微用户
  982. searchQwUser(query) {
  983. if (!query.trim()) {
  984. this.qwUserSuggestions = [];
  985. this.showQwUserDropdown = false;
  986. this.qwUserNoMore = false;
  987. this.qwUserPageNum = 1;
  988. return;
  989. }
  990. this.queryParams.qwUserName = query;
  991. this.qwUserPageNum = 1;
  992. this.qwUserNoMore = false;
  993. this.qwUserSuggestions = [];
  994. this.fetchQwUsers(query);
  995. },
  996. fetchQwUsers(query) {
  997. const params = {
  998. qwUserName: query,
  999. pageNum: this.qwUserPageNum,
  1000. pageSize: this.qwUserPageSize
  1001. };
  1002. this.qwUserLoading = true;
  1003. getQwUserListLikeName(params).then(res => {
  1004. const list = res.data.list || [];
  1005. const total = res.data.total || 0;
  1006. this.qwUserSuggestions = [...this.qwUserSuggestions, ...list];
  1007. this.qwUserTotal = total;
  1008. // 判断是否还有更多数据
  1009. if (this.qwUserSuggestions.length >= total) {
  1010. this.qwUserNoMore = true;
  1011. }
  1012. this.showQwUserDropdown = true;
  1013. }).finally(() => {
  1014. this.qwUserLoading = false;
  1015. });
  1016. },
  1017. // 选择企微用户
  1018. selectQwUser(key,value) {
  1019. this.queryParams.qwUserName = value;
  1020. this.queryParams.qwUserId = key;
  1021. this.showQwUserDropdown = false;
  1022. this.handleQuery(); // 可选:自动触发查询
  1023. },
  1024. // 延迟隐藏下拉框,防止点击失效
  1025. hideDropdownWithDelay() {
  1026. setTimeout(() => {
  1027. this.showQwUserDropdown = false;
  1028. }, 200);
  1029. },
  1030. handleScroll(e) {
  1031. const container = e.target;
  1032. const scrollTop = container.scrollTop;
  1033. const scrollHeight = container.scrollHeight;
  1034. const clientHeight = container.clientHeight;
  1035. // 距离底部小于 20px 触发加载
  1036. if (scrollHeight - scrollTop - clientHeight < 20 && !this.qwUserLoading && !this.qwUserNoMore) {
  1037. this.qwUserPageNum += 1;
  1038. this.fetchQwUsers(this.queryParams.qwUserName);
  1039. }
  1040. },
  1041. async healthHandledetails(row) {
  1042. try {
  1043. console.log(row.fsUserId);
  1044. console.log(row);
  1045. // 先尝试获取健康记录数据
  1046. const res = await getId(row.fsUserId);
  1047. console.log(res);
  1048. // 只有获取数据成功后才打开对话框
  1049. this.showHealth.open = true;
  1050. // 确保对话框DOM已更新
  1051. await this.$nextTick();
  1052. this.$refs.Details.getDetails(res.data);
  1053. } catch (error) {
  1054. console.error('获取健康档案失败:', error);
  1055. //this.$message.error('获取健康档案失败: ' + (error.message || '该用户还未填写健康档案'));
  1056. }
  1057. },
  1058. async handleUserdetails(row){
  1059. this.showUser.open = true;
  1060. try {
  1061. await this.$nextTick();
  1062. this.$refs.userDetails.getDetails(row.fsUserId);
  1063. } catch (error) {
  1064. console.error('获取会员详情失败:', error);
  1065. }
  1066. },
  1067. change(){
  1068. if(this.createTime!=null){
  1069. this.queryParams.sTime=this.createTime[0];
  1070. this.queryParams.eTime=this.createTime[1];
  1071. }else{
  1072. this.queryParams.sTime=null;
  1073. this.queryParams.eTime=null;
  1074. }
  1075. },
  1076. updateCorpId(){
  1077. var listTagFrom={corpId:this.queryParams.corpId}
  1078. listTag(listTagFrom).then(response => {
  1079. this.tagList = response.rows;
  1080. });
  1081. this.getList();
  1082. },
  1083. /** 查询企业微信客户列表 */
  1084. getList() {
  1085. this.loading = true;
  1086. const { qwUserName, ...queryParams } = this.queryParams;
  1087. myDeptExtList(queryParams).then(response => {
  1088. this.externalContactList = response.rows;
  1089. this.total = response.total;
  1090. this.loading = false;
  1091. });
  1092. },
  1093. bindMiniCustomerId(row){
  1094. console.log(row)
  1095. this.userForm.fsUserId=row;
  1096. bindUserId(this.userForm).then(res=>{
  1097. if (res.code==200){
  1098. this.$message.success('绑定成功')
  1099. }else {
  1100. this.$message.error('绑定失败:',res.msg)
  1101. }
  1102. this.getList()
  1103. this.user.open=false;
  1104. })
  1105. },
  1106. /** 查看客户详情 */
  1107. handleShow(row){
  1108. this.show.open=true;
  1109. var that=this;
  1110. const tab = "visit";
  1111. setTimeout(() => {
  1112. that.$refs.customerDetails.getDetails(row.customerId);
  1113. that.$refs.customerDetails.handleClick(tab);
  1114. }, 200);
  1115. },
  1116. handledetails(row){
  1117. this.info.open=true;
  1118. setTimeout(() => {
  1119. this.$refs.Details.getDetails(row.id);
  1120. }, 1);
  1121. },
  1122. closeInfo(){
  1123. this.info.open=false
  1124. },
  1125. handleClickX(tab, event) {
  1126. this.queryParams.isBind=tab.name;
  1127. this.handleQuery();
  1128. },
  1129. handleClose(tag) {
  1130. this.remarkMobiles.splice(this.remarkMobiles.indexOf(tag), 1);
  1131. },
  1132. showInput() {
  1133. this.inputVisible = true;
  1134. this.$nextTick(_ => {
  1135. this.$refs.saveTagInput.$refs.input.focus();
  1136. });
  1137. },
  1138. handleInputConfirm() {
  1139. let inputValue = this.inputValue;
  1140. if (inputValue) {
  1141. this.remarkMobiles.push(inputValue);
  1142. }
  1143. this.inputVisible = false;
  1144. this.inputValue = '';
  1145. },
  1146. handleBatchUpdateNotes(){
  1147. if(this.ids==null||this.ids==""){
  1148. return this.$message('请选择需要添加备注的客户');
  1149. }
  1150. this.notesOpen.open=true;
  1151. },
  1152. addUserTag(){
  1153. if(this.ids==null||this.ids==""){
  1154. return this.$message('请选择需要添加标签的客户');
  1155. }
  1156. this.getPageListTagGroup();
  1157. setTimeout(() => {
  1158. for (let i = 0; i < this.tagGroupList.length; i++) {
  1159. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1160. this.tagGroupList[i].tag[x].isSelected=false;
  1161. }
  1162. }
  1163. }, 200);
  1164. this.tagOpen = true;
  1165. },
  1166. getPageListTagGroup(){
  1167. this.queryTagParams.corpId=this.queryParams.corpId
  1168. allListTagGroup(this.queryTagParams).then(response => {
  1169. this.tagGroupList = response.rows;
  1170. this.tagTotal = response.total;
  1171. });
  1172. },
  1173. delUserTag(){
  1174. if(this.ids==null||this.ids==""){
  1175. return this.$message('请选择需要移除标签的客户');
  1176. }
  1177. this.getPageListTagGroup();
  1178. setTimeout(() => {
  1179. for (let i = 0; i < this.tagGroupList.length; i++) {
  1180. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1181. this.tagGroupList[i].tag[x].isSelected=false;
  1182. }
  1183. }
  1184. }, 200);
  1185. this.tagDelOpen = true;
  1186. },
  1187. //搜索的标签
  1188. hangleChangeTags(){
  1189. this.changeTagDialog.title="搜索的标签"
  1190. this.changeTagDialog.open=true;
  1191. // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
  1192. const selectedTagIds = new Set(
  1193. (this.selectTags || []).map(tagItem => tagItem?.tagId)
  1194. );
  1195. this.queryTagParams.name=null;
  1196. this.getPageListTagGroup();
  1197. setTimeout(() => {
  1198. for (let i = 0; i < this.tagGroupList.length; i++) {
  1199. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1200. this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
  1201. }
  1202. }
  1203. }, 200);
  1204. },
  1205. //删除一些选择的标签
  1206. handleCloseTags(list){
  1207. const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);
  1208. if (ls !== -1) {
  1209. this.selectTags.splice(ls, 1);
  1210. this.selectTags = [...this.selectTags];
  1211. }
  1212. if (this.selectTags!=null && this.selectTags.length>0){
  1213. // 确保 this.form.tags 是数组
  1214. if (!this.queryParams.tagIds) {
  1215. this.queryParams.tagIds = []; // 如果未定义,初始化
  1216. } else {
  1217. this.queryParams.tagIds = []; // 清空已有数据
  1218. }
  1219. // 遍历并添加 tagId
  1220. this.selectTags.forEach(tag => {
  1221. if (tag.tagId) { // 确保 tagId 存在
  1222. this.queryParams.tagIds.push(tag.tagId);
  1223. }
  1224. });
  1225. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  1226. }else {
  1227. this.queryParams.tagIds=null;
  1228. }
  1229. },
  1230. //重新获取页面数据
  1231. refreshList(){
  1232. this.getList();
  1233. },
  1234. //批量设置课程sop
  1235. setUserCourseSop(){
  1236. if(this.ids==null||this.ids==""){
  1237. return this.$message('请选择需要设置课程SOP的客户');
  1238. }
  1239. this.$confirm('批量设置客户课节SOP可能会存在重复,确定要批量设置吗?', "警告", {
  1240. confirmButtonText: "确定",
  1241. cancelButtonText: "取消",
  1242. type: "warning"
  1243. }).then(() => {
  1244. this.setSop.open = true;
  1245. this.setSop.type = 2;
  1246. })
  1247. .catch(() => {
  1248. // 可以处理用户点击“取消”的逻辑
  1249. });
  1250. },
  1251. tagSelection(row){
  1252. row.isSelected= !row.isSelected;
  1253. this.$forceUpdate();
  1254. },
  1255. // 取消按钮
  1256. cancel() {
  1257. this.open = false;
  1258. this.reset();
  1259. },
  1260. addTagCancel() {
  1261. this.tagOpen = false;
  1262. this.addTagForm={
  1263. userIds:[],
  1264. tagIds:[]
  1265. };
  1266. },
  1267. DelTagCancel() {
  1268. this.tagDelOpen = false;
  1269. this.addTagForm={
  1270. userIds:[],
  1271. tagIds:[]
  1272. };
  1273. },
  1274. addTagSubmitForm(){
  1275. for (let i = 0; i < this.tagGroupList.length; i++) {
  1276. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1277. if(this.tagGroupList[i].tag[x].isSelected==true){
  1278. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1279. }
  1280. }
  1281. }
  1282. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  1283. return this.$message('请选择标签');
  1284. }
  1285. this.addTagForm.corpId=this.queryParams.corpId
  1286. this.addTagForm.userIds=this.ids;
  1287. let loadingRock = this.$loading({
  1288. lock: true,
  1289. text: '正在执行中请稍后~~请不要刷新页面!!',
  1290. spinner: 'el-icon-loading',
  1291. background: 'rgba(0, 0, 0, 0.7)'
  1292. });
  1293. addTag(this.addTagForm).then(response => {
  1294. this.tagOpen = false;
  1295. loadingRock.close();
  1296. this.addTagForm={
  1297. userIds:[],
  1298. tagIds:[]
  1299. };
  1300. this.resultMessage = response.msg;
  1301. this.resultDialogVisible = true; // 显示弹窗
  1302. this.resultTitle = '批量添加标签结果';
  1303. }).finally(res=>{
  1304. this.getList()
  1305. loadingRock.close();
  1306. });
  1307. },
  1308. tagDelSubmitForm(){
  1309. for (let i = 0; i < this.tagGroupList.length; i++) {
  1310. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1311. if(this.tagGroupList[i].tag[x].isSelected==true){
  1312. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1313. }
  1314. }
  1315. }
  1316. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  1317. return this.$message('请选择标签');
  1318. }
  1319. this.addTagForm.corpId=this.queryParams.corpId
  1320. this.addTagForm.userIds=this.ids;
  1321. let loadingRock = this.$loading({
  1322. lock: true,
  1323. text: '正在执行中请稍后~~请不要刷新页面!!',
  1324. spinner: 'el-icon-loading',
  1325. background: 'rgba(0, 0, 0, 0.7)'
  1326. });
  1327. delTag(this.addTagForm).then(response => {
  1328. this.tagDelOpen = false;
  1329. loadingRock.close();
  1330. this.addTagForm={
  1331. userIds:[],
  1332. tagIds:[]
  1333. };
  1334. this.resultMessage = response.msg;
  1335. this.resultDialogVisible = true; // 显示弹窗
  1336. this.resultTitle = '批量删除标签结果';
  1337. }).finally(res=>{
  1338. this.getList()
  1339. loadingRock.close();
  1340. });
  1341. },
  1342. // 表单重置
  1343. reset() {
  1344. this.form = {
  1345. id: null,
  1346. userId: null,
  1347. externalUserId: null,
  1348. name: null,
  1349. companyUserId:null,
  1350. customerId:null,
  1351. avatar: null,
  1352. type: null,
  1353. gender: null,
  1354. remark: null,
  1355. description: null,
  1356. tagIds: null,
  1357. remarkMobiles: null,
  1358. remarkCorpName: null,
  1359. addWay: null,
  1360. operUserid: null,
  1361. corpId: null,
  1362. companyId: null,
  1363. transferStatus:null,
  1364. status:null,
  1365. sTime:null,
  1366. eTime:null,
  1367. createTime:null,
  1368. transferTime:null,
  1369. transferNum:null,
  1370. lossTime:null,
  1371. delTime:null,
  1372. state:null,
  1373. wayId:null,
  1374. stageStatus:null,
  1375. customerName:null
  1376. };
  1377. this.resetForm("form");
  1378. },
  1379. /** 搜索按钮操作 */
  1380. handleQuery() {
  1381. if (this.selectTags!=null && this.selectTags.length>0){
  1382. // 确保 this.form.tags 是数组
  1383. if (!this.queryParams.tagIds) {
  1384. this.queryParams.tagIds = []; // 如果未定义,初始化
  1385. } else {
  1386. this.queryParams.tagIds = []; // 清空已有数据
  1387. }
  1388. // 遍历并添加 tagId
  1389. this.selectTags.forEach(tag => {
  1390. if (tag.tagId) { // 确保 tagId 存在
  1391. this.queryParams.tagIds.push(tag.tagId);
  1392. }
  1393. });
  1394. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  1395. }else {
  1396. this.queryParams.tagIds=null;
  1397. }
  1398. this.queryParams.pageNum = 1;
  1399. this.getList();
  1400. },
  1401. handleSearchTags(name){
  1402. if (!name){
  1403. return this.$message.error("请输入要搜索的标签")
  1404. }
  1405. this.queryTagParams.name=name;
  1406. this.queryTagParams.corpId=this.queryParams.corpId;
  1407. searchTags(this.queryTagParams).then(response => {
  1408. this.tagGroupList = response.rows;
  1409. });
  1410. // searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  1411. // this.tagGroupList = response.rows;
  1412. // });
  1413. },
  1414. cancelSearchTags(){
  1415. this.resetSearchQueryTag()
  1416. this.getPageListTagGroup();
  1417. },
  1418. notesSubmitForm(){
  1419. if (this.notesOpen.notes==null || this.notesOpen.notes==""){
  1420. return this.$message.error("请输入备注内容");
  1421. }
  1422. let loadingRock = this.$loading({
  1423. lock: true,
  1424. text: '正在执行中请稍后~~请不要刷新页面!!',
  1425. spinner: 'el-icon-loading',
  1426. background: 'rgba(0, 0, 0, 0.7)'
  1427. });
  1428. batchUpdateExternalContactNotes({userIds:this.ids,notes:this.notesOpen.notes,type:this.notesOpen.type,nameType:this.notesOpen.nameType}).then(res => {
  1429. this.resultMessage = res.msg;
  1430. this.resultDialogVisible = true; // 显示弹窗
  1431. this.resultTitle = '批量修改备注结果';
  1432. }).finally(res=>{
  1433. this.getList();
  1434. loadingRock.close();
  1435. this.notesCancel();
  1436. })
  1437. },
  1438. //确定选择标签
  1439. tagSubmitForm(){
  1440. for (let i = 0; i < this.tagGroupList.length; i++) {
  1441. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1442. if (this.tagGroupList[i].tag[x].isSelected === true) {
  1443. if (!this.selectTags) {
  1444. this.selectTags = [];
  1445. }
  1446. // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
  1447. let tagExists = this.selectTags.some(
  1448. tag => tag.id === this.tagGroupList[i].tag[x].id
  1449. );
  1450. // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
  1451. if (!tagExists) {
  1452. this.selectTags.push(this.tagGroupList[i].tag[x]);
  1453. }
  1454. }
  1455. }
  1456. }
  1457. if (!this.selectTags || this.selectTags.length === 0) {
  1458. return this.$message('请选择标签');
  1459. }
  1460. this.changeTagDialog.open = false;
  1461. },
  1462. //取消选择标签
  1463. tagCancel(){
  1464. this.changeTagDialog.open = false;
  1465. },
  1466. //取消备注
  1467. notesCancel(){
  1468. this.notesOpen={
  1469. open: false,
  1470. notes: null,
  1471. type: 1,
  1472. nameType:3,
  1473. }
  1474. },
  1475. resetSearchQueryTag(){
  1476. this.queryTagParams= {
  1477. pageNum: 1,
  1478. pageSize: 10,
  1479. total:0,
  1480. name:null,
  1481. };
  1482. },
  1483. /** 重置按钮操作 */
  1484. resetQuery() {
  1485. this.resetForm("queryForm");
  1486. this.queryParams.corpId= this.myQwCompanyList[0].dictValue;
  1487. this.selectTags=[];
  1488. this.createTime=null;
  1489. this.queryParams.sTime=null;
  1490. this.queryParams.eTime=null;
  1491. this.handleQuery();
  1492. },
  1493. // 多选框选中数据
  1494. handleSelectionChange(selection) {
  1495. this.ids = selection.map(item => item.id)
  1496. this.single = selection.length!==1
  1497. this.multiple = !selection.length
  1498. },
  1499. /** 新增按钮操作 */
  1500. handleAdd() {
  1501. this.loading=true;
  1502. this.form.corpId=this.queryParams.corpId
  1503. addExternalContact(this.form).then(response => {
  1504. this.msgSuccess("同步成功");
  1505. this.getList();
  1506. }).finally(()=>{
  1507. this.loading=false;
  1508. });
  1509. },
  1510. /** 修改按钮操作 */
  1511. handleUpdate(row) {
  1512. this.reset();
  1513. const id = row.id || this.ids
  1514. getExternalContact(id).then(response => {
  1515. this.form = response.data;
  1516. if(this.form.remarkMobiles!=null){
  1517. this.remarkMobiles=JSON.parse(this.form.remarkMobiles)
  1518. }else{
  1519. this.remarkMobiles=[]
  1520. }
  1521. this.open = true;
  1522. this.title = "修改企业微信客户";
  1523. });
  1524. },
  1525. handleAppellation(val){
  1526. this.callOpen.open=true;
  1527. this.callOpenFrom.stageStatus=val.stageStatus;
  1528. this.callOpenFrom.id=val.id;
  1529. },
  1530. /** 绑定客户操作 */
  1531. handleUpdateCustomer(row){
  1532. this.bindCustomer.title="绑定客户"
  1533. this.bindCustomer.open=true;
  1534. this.form.id=row.id
  1535. this.form.externalUserId=row.externalUserId
  1536. this.form.name=row.name
  1537. },
  1538. handleUpdateUser(row){
  1539. this.user.title="绑定客户"
  1540. this.user.open=true;
  1541. this.userForm.id=row.id;
  1542. },
  1543. handleUnBindUserId(val){
  1544. this.$confirm(
  1545. '确认解绑客户:<span style="color: green;">' + val.name + '' +
  1546. '</span> 的小程序用户?<br><span style="color: red;">【ps:可能会导致客户无法看课】</span>',
  1547. {
  1548. confirmButtonText: "确定",
  1549. cancelButtonText: "取消",
  1550. type: "warning",
  1551. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  1552. }
  1553. ).then(() => {
  1554. return unBindUserId(val.id);
  1555. }).then(response => {
  1556. this.getList();
  1557. this.msgSuccess("解绑成功");
  1558. }).finally(res=>{
  1559. this.getList();
  1560. })
  1561. },
  1562. bindCustomerId(row){
  1563. console.log("row",row)
  1564. // this.qwFormCustomer.customerId=row;
  1565. this.form.customerId=row;
  1566. this.form.corpId=this.queryParams.corpId;
  1567. this.msgWarning("绑定中.....同步信息中.....");
  1568. editbindCustomer(this.form).then(res=>{
  1569. //清空表单
  1570. this.reset();
  1571. this.bindCustomer.open = false;
  1572. this.msgSuccess("绑定成功");
  1573. this.getList();
  1574. })
  1575. },
  1576. //设置一个SOP
  1577. setCourseSOP(row) {
  1578. // 检查 row.miniUserId 是否为 null
  1579. if (row.miniUserId === null || row.miniUserId === undefined) {
  1580. return this.$confirm('当前客户【CRM客户详情】中 未绑定小程序客户,请先绑定', "警告", {
  1581. confirmButtonText: "确定",
  1582. cancelButtonText: "取消",
  1583. type: "warning"
  1584. }).catch(error => {
  1585. this.msgWarning("操作取消:", error);
  1586. });
  1587. } else {
  1588. this.chooseCustomerSOP = row;
  1589. this.setSop.open = true;
  1590. this.setSop.type=1;
  1591. }
  1592. },
  1593. //选择课程SOP
  1594. // 用于设置 customerCourseForm 和 customerCourseFormLogs 的共同属性
  1595. setCommonProperties(form, row) {
  1596. form.qwUserid = this.chooseCustomerSOP.userId;
  1597. form.companyUserId = this.chooseCustomerSOP.companyUserId;
  1598. form.externalUserId = this.chooseCustomerSOP.externalUserId;
  1599. form.customerId = this.chooseCustomerSOP.customerId;
  1600. form.miniUserId = this.chooseCustomerSOP.miniUserId;
  1601. form.businessId = row.businessId;
  1602. },
  1603. bindCourseSop(row,days) {
  1604. if (this.setSop.type==2){
  1605. this.setSop.open = false;
  1606. this.loading=true;
  1607. this.msgWarning("设定中.....同步信息中.....");
  1608. setCustomerCourseSopList({ids:this.ids,fsCourseSopId:row.id,days:days}).then(res=>{
  1609. let msg=" 批量设置成功数【" + res.successNum + "】,<br>"
  1610. if (res.failCRM.length>0){
  1611. msg+="失败的客户【" + res.failCRM + "】,原因是未绑定CRM客户。<br>"
  1612. }
  1613. if (res.failMiNi.length>0){
  1614. msg+="失败的客户【" + res.failMiNi + "】,原因是CRM中未绑定小程序客户。<br>"
  1615. }
  1616. if (res.failCompany.length>0){
  1617. msg+="失败的客户【" + res.failCompany + "】,原因是客户没有所属成员。<br>"
  1618. }
  1619. return this.$confirm(msg, "提示", {
  1620. confirmButtonText: "确定",
  1621. cancelButtonText: "取消",
  1622. type: "warning",
  1623. dangerouslyUseHTMLString: true // 允许使用HTML标签
  1624. }).catch(error => {
  1625. this.msgSuccess("操作完成~");
  1626. });
  1627. }).finally(()=>{
  1628. this.loading = false;
  1629. this.getList();
  1630. })
  1631. }else if (this.setSop.type==1){
  1632. // 设置 customerCourseFormLogs 的属性
  1633. this.setCommonProperties(this.customerCourseFormLogs, row);
  1634. // 设置 customerCourseForm 的属性
  1635. this.setCommonProperties(this.customerCourseForm, row);
  1636. this.customerCourseForm.sopId = row.id;
  1637. this.customerCourseForm.sopType = row.sopType;
  1638. this.customerCourseForm.setting = row.setting;
  1639. this.customerCourseForm.days = days;
  1640. // 执行异步操作
  1641. getCustomerCourseSop(this.customerCourseFormLogs)
  1642. .then(res => {
  1643. if (res) {
  1644. return this.$confirm('当前客户已设置过相同课程课节SOP,确定还要再次设置吗?', "警告", {
  1645. confirmButtonText: "确定",
  1646. cancelButtonText: "取消",
  1647. type: "warning"
  1648. });
  1649. } else {
  1650. return Promise.resolve(); // 如果没有设置过,直接执行后续操作
  1651. }
  1652. })
  1653. .then(() => {
  1654. this.loading = true;
  1655. this.setSop.open = false;
  1656. this.msgSuccess("设定中.....同步信息中.....");
  1657. return setCustomerCourseSop(this.customerCourseForm);
  1658. })
  1659. .then(() => {
  1660. this.msgSuccess("设定成功");
  1661. })
  1662. .catch(error => {
  1663. this.msgWarning("操作取消:", error);
  1664. })
  1665. .finally(() => {
  1666. this.loading = false;
  1667. this.getList();
  1668. });
  1669. }
  1670. },
  1671. submitCallOpenFrom(){
  1672. this.$refs["callOpenFrom"].validate(valid => {
  1673. if (valid) {
  1674. if (this.callOpenFrom.id != null && this.callOpenFrom.stageStatus != null) {
  1675. updateExternalContactCall(this.callOpenFrom).then(res=>{
  1676. this.$message.success('修改成功');
  1677. this.callOpen.open=false;
  1678. this.getList();
  1679. });
  1680. }
  1681. }
  1682. });
  1683. },
  1684. /** 提交按钮 */
  1685. submitForm() {
  1686. this.$refs["form"].validate(valid => {
  1687. if (valid) {
  1688. if (this.form.id != null) {
  1689. this.form.remarkMobiles=JSON.stringify(this.remarkMobiles)
  1690. updateExternalContact(this.form).then(response => {
  1691. this.msgSuccess("修改成功");
  1692. this.open = false;
  1693. this.getList();
  1694. });
  1695. } else {
  1696. addExternalContact(this.form).then(response => {
  1697. this.msgSuccess("新增成功");
  1698. this.open = false;
  1699. this.getList();
  1700. });
  1701. }
  1702. }
  1703. });
  1704. },
  1705. /** 删除按钮操作 */
  1706. handleDelete(row) {
  1707. const ids = row.id || this.ids;
  1708. this.$confirm('是否确认删除企业微信客户编号为"' + ids + '"的数据项?', "警告", {
  1709. confirmButtonText: "确定",
  1710. cancelButtonText: "取消",
  1711. type: "warning"
  1712. }).then(function() {
  1713. return delExternalContact(ids);
  1714. }).then(() => {
  1715. this.getList();
  1716. this.msgSuccess("删除成功");
  1717. }).catch(() => {});
  1718. },
  1719. updateTalk(row){
  1720. const ids = row.id || this.ids;
  1721. this.$confirm('是否确认批量更改用户信息为非首次交流', "警告", {
  1722. confirmButtonText: "确定",
  1723. cancelButtonText: "取消",
  1724. type: "warning"
  1725. }).then(function() {
  1726. return editTalk(ids);
  1727. }).then(() => {
  1728. this.getList();
  1729. this.msgSuccess("成功");
  1730. }).catch(() => {});
  1731. },
  1732. /** 导出按钮操作 */
  1733. handleExport() {
  1734. const queryParams = this.queryParams;
  1735. this.$confirm('是否确认导出所有企业微信客户数据项?', "警告", {
  1736. confirmButtonText: "确定",
  1737. cancelButtonText: "取消",
  1738. type: "warning"
  1739. }).then(() => {
  1740. this.exportLoading = true;
  1741. return exportExternalContact(queryParams);
  1742. }).then(response => {
  1743. this.download(response.msg);
  1744. this.exportLoading = false;
  1745. }).catch(() => {});
  1746. },
  1747. openRepeat(row){
  1748. this.repeat.param = {
  1749. externalUserId: row.externalUserId,
  1750. corpId: row.corpId,
  1751. userId: row.userId,
  1752. };
  1753. getRepeat(this.repeat.param).then(e => {
  1754. this.repeat.open = true;
  1755. this.repeat.loading = false;
  1756. this.repeat.list = e.data;
  1757. })
  1758. },
  1759. }
  1760. };
  1761. </script>
  1762. <style scoped>
  1763. /* CSS 样式 */
  1764. .tag-container {
  1765. display: flex;
  1766. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1767. gap: 8px; /* 设置标签之间的间距 */
  1768. }
  1769. .name-background {
  1770. display: inline-block;
  1771. background-color: #abece6; /* 背景颜色 */
  1772. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1773. border-radius: 4px; /* 可选:设置圆角 */
  1774. }
  1775. /* CSS 样式 */
  1776. .tag-container {
  1777. display: flex;
  1778. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1779. gap: 8px; /* 设置标签之间的间距 */
  1780. }
  1781. .name-background {
  1782. display: inline-block;
  1783. background-color: #abece6; /* 背景颜色 */
  1784. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1785. border-radius: 4px; /* 可选:设置圆角 */
  1786. }
  1787. .tag-box {
  1788. padding: 8px 12px;
  1789. border: 1px solid #989797;
  1790. border-radius: 4px;
  1791. cursor: pointer;
  1792. display: inline-block;
  1793. }
  1794. .tag-selected {
  1795. background-color: #00bc98;
  1796. color: #fff;
  1797. border-color: #00bc98;
  1798. }
  1799. .el-tag + .el-tag {
  1800. margin-left: 10px;
  1801. }
  1802. .suggestion-box {
  1803. position: absolute;
  1804. z-index: 999;
  1805. background: #fff;
  1806. border: 1px solid #ddd;
  1807. max-height: 200px;
  1808. overflow-y: auto;
  1809. width: 100%;
  1810. }
  1811. .suggestion-item {
  1812. padding: 10px;
  1813. cursor: pointer;
  1814. }
  1815. .suggestion-item:hover {
  1816. background-color: #f5f7fa;
  1817. }
  1818. .button-new-tag {
  1819. margin-left: 10px;
  1820. height: 32px;
  1821. line-height: 30px;
  1822. padding-top: 0;
  1823. padding-bottom: 0;
  1824. }
  1825. .input-new-tag {
  1826. width: 90px;
  1827. margin-left: 10px;
  1828. vertical-align: bottom;
  1829. }
  1830. .feedback-dialog {
  1831. width: 100%;
  1832. max-width: 1000px;
  1833. max-height: 80vh; /* 限制最大高度为视窗高度的 80% */
  1834. overflow-y: auto; /* 超出时显示垂直滚动条 */
  1835. padding: 20px;
  1836. box-sizing: border-box; /* 确保 padding 不影响总宽度 */
  1837. }
  1838. /* 新增的滚动容器样式(不影响原有样式) */
  1839. .scroll-wrapper {
  1840. max-height: 130px; /* 大约三行的高度 */
  1841. overflow-y: auto; /* 垂直滚动 */
  1842. padding-right: 5px; /* 为滚动条留出空间 */
  1843. }
  1844. /* 美化滚动条(可选) */
  1845. .scroll-wrapper::-webkit-scrollbar {
  1846. width: 6px;
  1847. }
  1848. .scroll-wrapper::-webkit-scrollbar-thumb {
  1849. background: rgba(0, 0, 0, 0.2);
  1850. border-radius: 3px;
  1851. }
  1852. </style>