index.vue 63 KB

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