index.vue 62 KB

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