index.vue 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056
  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. &lt;!&ndash; <el-button&ndash;&gt;
  429. &lt;!&ndash; size="mini"&ndash;&gt;
  430. &lt;!&ndash; type="text"&ndash;&gt;
  431. &lt;!&ndash; icon="el-icon-edit-outline"&ndash;&gt;
  432. &lt;!&ndash; @click="handleUpdateCustomer(scope.row)"&ndash;&gt;
  433. &lt;!&ndash; >&ndash;&gt;
  434. &lt;!&ndash; <span v-if="scope.row.customerId">换绑CRM</span>&ndash;&gt;
  435. &lt;!&ndash; <span v-else>绑定CRM</span>&ndash;&gt;
  436. &lt;!&ndash; </el-button>&ndash;&gt;
  437. &lt;!&ndash; <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>&ndash;&gt;
  456. &lt;!&ndash; <el-button v-if="scope.row.customerId"&ndash;&gt;
  457. &lt;!&ndash; size="mini"&ndash;&gt;
  458. &lt;!&ndash; type="text"&ndash;&gt;
  459. &lt;!&ndash; icon="el-icon-paperclip"&ndash;&gt;
  460. &lt;!&ndash; @click="handleShow(scope.row)"&ndash;&gt;
  461. &lt;!&ndash; >CRM客户详情</el-button>&ndash;&gt;
  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 {getMyQwUserList, getMyQwCompanyList, updateUser} from "@/api/qw/user";
  741. import {listTag, getTag, searchTags,} from "@/api/qw/tag";
  742. import { allListTagGroup} from "@/api/qw/tagGroup";
  743. /*import mycustomer from '@/views/qw/externalContact/mycustomer'
  744. import customerDetails from '@/views/qw/externalContact/customerDetails'
  745. import SopDialog from '@/views/course/sop/SopDialog.vue'
  746. import selectUser from "@/views/qw/externalContact/selectUser.vue";
  747. import info from "@/views/qw/externalContact/info.vue";
  748. import { editTalk } from "@/api/qw/externalContactInfo";*/
  749. import PaginationMore from "../../../components/PaginationMore/index.vue";
  750. /*import userDetails from '@/views/store/components/userDetails.vue';*/
  751. export default {
  752. name: "ExternalContact",
  753. /*components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,userDetails},*/
  754. components:{PaginationMore},
  755. data() {
  756. return {
  757. notesOpen: {
  758. type: 1,
  759. nameType: 3,
  760. addType: 0,
  761. filter: false,
  762. open: false,
  763. notes: null,
  764. },
  765. user:{
  766. open:false,
  767. title:"修改客户"
  768. },
  769. userForm:{
  770. id:null,
  771. fsUserId:null,
  772. },
  773. info:{
  774. title:"用户信息",
  775. open:false,
  776. },
  777. // ...其他已有数据
  778. qwUserSuggestions: [], // 已展示的数据
  779. showQwUserDropdown: false, // 控制下拉框显示
  780. qwUserLoading: false, // 加载状态
  781. qwUserNoMore: false, // 是否还有更多数据
  782. qwUserPageNum: 1, // 当前页码
  783. qwUserPageSize: 10, // 每页数量
  784. qwUserTotal: 0, // 总数
  785. isBindMiniOptions:[
  786. {dictLabel:"已绑定",dictValue:'isBindMini'},
  787. {dictLabel:"未绑定",dictValue:'noBindMini'},
  788. ],
  789. //标签弹窗选择
  790. tagChange:{
  791. open:false,
  792. index:null,
  793. },
  794. sTime:null,
  795. eTime:null,
  796. createTime:null,
  797. // 遮罩层
  798. loading: false,
  799. // 导出遮罩层
  800. exportLoading: false,
  801. tagOpen:false,
  802. tagDelOpen:false,
  803. // 选中数组
  804. ids: [],
  805. isBindActiveName:"all",
  806. remarkMobiles: [],
  807. inputVisible: false,
  808. inputValue: '',
  809. // 非单个禁用
  810. single: true,
  811. tagGroupList: [],
  812. // 非多个禁用
  813. multiple: true,
  814. // 显示搜索条件
  815. showSearch: true,
  816. // 总条数
  817. total: 0,
  818. // 企业微信客户表格数据
  819. externalContactList: [],
  820. // 弹出层标题
  821. title: "",
  822. // 是否显示弹出层
  823. open: false,
  824. // 用户类别字典
  825. typeOptions: [],
  826. ratingType: [],
  827. ratingUpFall: [],
  828. // 性别字典
  829. genderOptions: [],
  830. addTagForm:{
  831. userIds:[],
  832. tagIds:[]
  833. },
  834. myQwCompanyList:[],
  835. show:{
  836. title:"客户详情",
  837. open:false,
  838. },
  839. //存储选择的客户
  840. chooseCustomerSOP:null,
  841. setSop:{
  842. title:"选择课节SOP",
  843. open:false,
  844. //区分单选1还是多选2
  845. type:null,
  846. },
  847. //合成的客户-课节SOP参数
  848. customerCourseForm:{},
  849. //查询是否已经设置过客户-某个课节的SOP
  850. customerCourseFormLogs:{},
  851. //绑定客户
  852. bindCustomer:{
  853. title:null,
  854. open:false,
  855. },
  856. callOpen:{
  857. open:false,
  858. title: '修改客户称呼',
  859. },
  860. callOpenFrom:{
  861. id:null,
  862. stageStatus:null,
  863. },
  864. callOpenRule:{
  865. stageStatus:[{required:true,message:"员工称呼不能为空",trigger:"blur"}]
  866. },
  867. //绑定的参数表
  868. qwFormCustomer:{
  869. externalContactId:null,
  870. customerId:null,
  871. },
  872. // 来源字典
  873. addWayOptions: [],
  874. //标签
  875. changeTagDialog:{
  876. title:"",
  877. open:false,
  878. },
  879. queryTagParams:{
  880. pageNum: 1,
  881. pageSize: 5,
  882. total:0,
  883. name:null,
  884. corpId:null,
  885. },
  886. tagTotal:0,
  887. // 查询参数
  888. queryParams: {
  889. pageNum: 1,
  890. pageSize: 10,
  891. userId: null,
  892. qwUserName:null,
  893. externalUserId: null,
  894. name: null,
  895. avatar: null,
  896. type: null,
  897. qwUserId:null,
  898. gender: null,
  899. description: null,
  900. tagIds: null,
  901. remark:null,
  902. remarkMobiles: null,
  903. remarkCorpName: null,
  904. addWay: null,
  905. operUserid: null,
  906. corpId: null,
  907. companyId: null,
  908. status:null,
  909. transferStatus:null,
  910. isBind:null,
  911. isBindMini:null,
  912. lossTime:null,
  913. sTime:null,
  914. eTime:null,
  915. createTime:null,
  916. level:null,
  917. wayId:null,
  918. levelType:null,
  919. companyUser:null
  920. },
  921. selectTags:[],
  922. // 表单参数
  923. form: {},
  924. tagList:[],
  925. transferStatusOptions:[],
  926. statusOptions:[],
  927. // 表单校验
  928. rules: {
  929. }
  930. };
  931. },
  932. created() {
  933. this.getDicts("sys_qw_externalContact_type").then(response => {
  934. this.typeOptions = response.data;
  935. });
  936. this.getDicts("sys_qw_sop_rating_type").then(response => {
  937. this.ratingType = response.data;
  938. });
  939. this.getDicts("sys_qw_sop_rating_upFall").then(response => {
  940. this.ratingUpFall = response.data;
  941. });
  942. getMyQwCompanyList().then(response => {
  943. this.myQwCompanyList = response.data;
  944. if(this.myQwCompanyList!=null){
  945. // this.queryParams.corpId=this.myQwCompanyList[0].dictValue
  946. //
  947. // var listTagFrom={corpId:this.queryParams.corpId}
  948. // listTag(listTagFrom).then(response => {
  949. // this.tagList = response.rows;
  950. // });
  951. this.getList();
  952. }
  953. });
  954. this.getDicts("sys_sex").then(response => {
  955. this.genderOptions = response.data;
  956. });
  957. this.getDicts("sys_qw_externalContact_addWay").then(response => {
  958. this.addWayOptions = response.data;
  959. });
  960. this.getDicts("sys_qw_external_contact_status").then(response => {
  961. this.statusOptions = response.data;
  962. });
  963. this.getDicts("sys_qw_transfer_status").then(response => {
  964. this.transferStatusOptions = response.data;
  965. });
  966. },
  967. methods: {
  968. handleMemberdetails(row){
  969. this.show.open=true;
  970. setTimeout(() => {
  971. this.$refs.userDetails.getDetails(row.fsUserId);
  972. }, 1);
  973. },
  974. onQwUserNameClear() {
  975. this.queryParams.qwUserId = null; // 同时清空 qwUserId
  976. },
  977. // 搜索企微用户
  978. searchQwUser(query) {
  979. if (!query.trim()) {
  980. this.qwUserSuggestions = [];
  981. this.showQwUserDropdown = false;
  982. this.qwUserNoMore = false;
  983. this.qwUserPageNum = 1;
  984. return;
  985. }
  986. this.queryParams.qwUserName = query;
  987. this.qwUserPageNum = 1;
  988. this.qwUserNoMore = false;
  989. this.qwUserSuggestions = [];
  990. this.fetchQwUsers(query);
  991. },
  992. fetchQwUsers(query) {
  993. const params = {
  994. qwUserName: query,
  995. pageNum: this.qwUserPageNum,
  996. pageSize: this.qwUserPageSize
  997. };
  998. this.qwUserLoading = true;
  999. getQwUserListLikeName(params).then(res => {
  1000. const list = res.data.list || [];
  1001. const total = res.data.total || 0;
  1002. this.qwUserSuggestions = [...this.qwUserSuggestions, ...list];
  1003. this.qwUserTotal = total;
  1004. // 判断是否还有更多数据
  1005. if (this.qwUserSuggestions.length >= total) {
  1006. this.qwUserNoMore = true;
  1007. }
  1008. this.showQwUserDropdown = true;
  1009. }).finally(() => {
  1010. this.qwUserLoading = false;
  1011. });
  1012. },
  1013. // 选择企微用户
  1014. selectQwUser(key,value) {
  1015. this.queryParams.qwUserName = value;
  1016. this.queryParams.qwUserId = key;
  1017. this.showQwUserDropdown = false;
  1018. this.handleQuery(); // 可选:自动触发查询
  1019. },
  1020. // 延迟隐藏下拉框,防止点击失效
  1021. hideDropdownWithDelay() {
  1022. setTimeout(() => {
  1023. this.showQwUserDropdown = false;
  1024. }, 200);
  1025. },
  1026. handleScroll(e) {
  1027. const container = e.target;
  1028. const scrollTop = container.scrollTop;
  1029. const scrollHeight = container.scrollHeight;
  1030. const clientHeight = container.clientHeight;
  1031. // 距离底部小于 20px 触发加载
  1032. if (scrollHeight - scrollTop - clientHeight < 20 && !this.qwUserLoading && !this.qwUserNoMore) {
  1033. this.qwUserPageNum += 1;
  1034. this.fetchQwUsers(this.queryParams.qwUserName);
  1035. }
  1036. },
  1037. change(){
  1038. if(this.createTime!=null){
  1039. this.queryParams.sTime=this.createTime[0];
  1040. this.queryParams.eTime=this.createTime[1];
  1041. }else{
  1042. this.queryParams.sTime=null;
  1043. this.queryParams.eTime=null;
  1044. }
  1045. },
  1046. updateCorpId(){
  1047. var listTagFrom={corpId:this.queryParams.corpId}
  1048. listTag(listTagFrom).then(response => {
  1049. this.tagList = response.rows;
  1050. });
  1051. this.getList();
  1052. },
  1053. /** 查询企业微信客户列表 */
  1054. getList() {
  1055. this.loading = true;
  1056. const { qwUserName, ...queryParams } = this.queryParams;
  1057. listExternalContact(queryParams).then(response => {
  1058. this.externalContactList = response.rows;
  1059. this.total = response.total;
  1060. this.loading = false;
  1061. });
  1062. },
  1063. bindMiniCustomerId(row){
  1064. console.log(row)
  1065. this.userForm.fsUserId=row;
  1066. bindUserId(this.userForm).then(res=>{
  1067. if (res.code==200){
  1068. this.$message.success('绑定成功')
  1069. }else {
  1070. this.$message.error('绑定失败:',res.msg)
  1071. }
  1072. this.getList()
  1073. this.user.open=false;
  1074. })
  1075. },
  1076. /** 查看客户详情 */
  1077. handleShow(row){
  1078. this.show.open=true;
  1079. var that=this;
  1080. const tab = "visit";
  1081. setTimeout(() => {
  1082. that.$refs.customerDetails.getDetails(row.customerId);
  1083. that.$refs.customerDetails.handleClick(tab);
  1084. }, 200);
  1085. },
  1086. handledetails(row){
  1087. this.info.open=true;
  1088. setTimeout(() => {
  1089. this.$refs.Details.getDetails(row.id);
  1090. }, 1);
  1091. },
  1092. closeInfo(){
  1093. this.info.open=false
  1094. },
  1095. handleClickX(tab, event) {
  1096. this.queryParams.isBind=tab.name;
  1097. this.handleQuery();
  1098. },
  1099. handleClose(tag) {
  1100. this.remarkMobiles.splice(this.remarkMobiles.indexOf(tag), 1);
  1101. },
  1102. showInput() {
  1103. this.inputVisible = true;
  1104. this.$nextTick(_ => {
  1105. this.$refs.saveTagInput.$refs.input.focus();
  1106. });
  1107. },
  1108. handleInputConfirm() {
  1109. let inputValue = this.inputValue;
  1110. if (inputValue) {
  1111. this.remarkMobiles.push(inputValue);
  1112. }
  1113. this.inputVisible = false;
  1114. this.inputValue = '';
  1115. },
  1116. addUserTag(){
  1117. if(this.ids==null||this.ids==""){
  1118. return this.$message('请选择需要添加标签的客户');
  1119. }
  1120. this.getPageListTagGroup();
  1121. setTimeout(() => {
  1122. for (let i = 0; i < this.tagGroupList.length; i++) {
  1123. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1124. this.tagGroupList[i].tag[x].isSelected=false;
  1125. }
  1126. }
  1127. }, 200);
  1128. this.tagOpen = true;
  1129. },
  1130. getPageListTagGroup(){
  1131. this.queryTagParams.corpId=this.queryParams.corpId
  1132. allListTagGroup(this.queryTagParams).then(response => {
  1133. this.tagGroupList = response.rows;
  1134. this.tagTotal = response.total;
  1135. });
  1136. },
  1137. delUserTag(){
  1138. if(this.ids==null||this.ids==""){
  1139. return this.$message('请选择需要移除标签的客户');
  1140. }
  1141. this.getPageListTagGroup();
  1142. setTimeout(() => {
  1143. for (let i = 0; i < this.tagGroupList.length; i++) {
  1144. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1145. this.tagGroupList[i].tag[x].isSelected=false;
  1146. }
  1147. }
  1148. }, 200);
  1149. this.tagDelOpen = true;
  1150. },
  1151. //搜索的标签
  1152. hangleChangeTags(){
  1153. this.changeTagDialog.title="搜索的标签"
  1154. this.changeTagDialog.open=true;
  1155. // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
  1156. const selectedTagIds = new Set(
  1157. (this.selectTags || []).map(tagItem => tagItem?.tagId)
  1158. );
  1159. this.queryTagParams.name=null;
  1160. this.getPageListTagGroup();
  1161. setTimeout(() => {
  1162. for (let i = 0; i < this.tagGroupList.length; i++) {
  1163. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1164. this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
  1165. }
  1166. }
  1167. }, 200);
  1168. },
  1169. //删除一些选择的标签
  1170. handleCloseTags(list){
  1171. const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);
  1172. if (ls !== -1) {
  1173. this.selectTags.splice(ls, 1);
  1174. this.selectTags = [...this.selectTags];
  1175. }
  1176. if (this.selectTags!=null && this.selectTags.length>0){
  1177. // 确保 this.form.tags 是数组
  1178. if (!this.queryParams.tagIds) {
  1179. this.queryParams.tagIds = []; // 如果未定义,初始化
  1180. } else {
  1181. this.queryParams.tagIds = []; // 清空已有数据
  1182. }
  1183. // 遍历并添加 tagId
  1184. this.selectTags.forEach(tag => {
  1185. if (tag.tagId) { // 确保 tagId 存在
  1186. this.queryParams.tagIds.push(tag.tagId);
  1187. }
  1188. });
  1189. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  1190. }else {
  1191. this.queryParams.tagIds=null;
  1192. }
  1193. },
  1194. //重新获取页面数据
  1195. refreshList(){
  1196. this.getList();
  1197. },
  1198. //批量设置课程sop
  1199. setUserCourseSop(){
  1200. if(this.ids==null||this.ids==""){
  1201. return this.$message('请选择需要设置课程SOP的客户');
  1202. }
  1203. this.$confirm('批量设置客户课节SOP可能会存在重复,确定要批量设置吗?', "警告", {
  1204. confirmButtonText: "确定",
  1205. cancelButtonText: "取消",
  1206. type: "warning"
  1207. }).then(() => {
  1208. this.setSop.open = true;
  1209. this.setSop.type = 2;
  1210. })
  1211. .catch(() => {
  1212. // 可以处理用户点击“取消”的逻辑
  1213. });
  1214. },
  1215. tagSelection(row){
  1216. row.isSelected= !row.isSelected;
  1217. this.$forceUpdate();
  1218. },
  1219. // 取消按钮
  1220. cancel() {
  1221. this.open = false;
  1222. this.reset();
  1223. },
  1224. addTagCancel() {
  1225. this.tagOpen = false;
  1226. this.addTagForm={
  1227. userIds:[],
  1228. tagIds:[]
  1229. };
  1230. },
  1231. DelTagCancel() {
  1232. this.tagDelOpen = false;
  1233. this.addTagForm={
  1234. userIds:[],
  1235. tagIds:[]
  1236. };
  1237. },
  1238. addTagSubmitForm(){
  1239. for (let i = 0; i < this.tagGroupList.length; i++) {
  1240. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1241. if(this.tagGroupList[i].tag[x].isSelected==true){
  1242. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1243. }
  1244. }
  1245. }
  1246. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  1247. return this.$message('请选择标签');
  1248. }
  1249. this.addTagForm.corpId=this.queryParams.corpId
  1250. this.addTagForm.userIds=this.ids;
  1251. let loadingRock = this.$loading({
  1252. lock: true,
  1253. text: '正在执行中请稍后~~请不要刷新页面!!',
  1254. spinner: 'el-icon-loading',
  1255. background: 'rgba(0, 0, 0, 0.7)'
  1256. });
  1257. addTag(this.addTagForm).then(response => {
  1258. this.msgSuccess(response.msg);
  1259. this.tagOpen = false;
  1260. loadingRock.close();
  1261. this.addTagForm={
  1262. userIds:[],
  1263. tagIds:[]
  1264. };
  1265. this.getList()
  1266. }).finally(res=>{
  1267. loadingRock.close();
  1268. });
  1269. },
  1270. tagDelSubmitForm(){
  1271. for (let i = 0; i < this.tagGroupList.length; i++) {
  1272. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1273. if(this.tagGroupList[i].tag[x].isSelected==true){
  1274. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1275. }
  1276. }
  1277. }
  1278. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  1279. return this.$message('请选择标签');
  1280. }
  1281. this.addTagForm.corpId=this.queryParams.corpId
  1282. this.addTagForm.userIds=this.ids;
  1283. let loadingRock = this.$loading({
  1284. lock: true,
  1285. text: '正在执行中请稍后~~请不要刷新页面!!',
  1286. spinner: 'el-icon-loading',
  1287. background: 'rgba(0, 0, 0, 0.7)'
  1288. });
  1289. delTag(this.addTagForm).then(response => {
  1290. this.msgSuccess(response.msg);
  1291. this.tagDelOpen = false;
  1292. loadingRock.close();
  1293. this.addTagForm={
  1294. userIds:[],
  1295. tagIds:[]
  1296. };
  1297. this.getList()
  1298. }).finally(res=>{
  1299. loadingRock.close();
  1300. });
  1301. },
  1302. // 表单重置
  1303. reset() {
  1304. this.form = {
  1305. id: null,
  1306. userId: null,
  1307. externalUserId: null,
  1308. name: null,
  1309. companyUserId:null,
  1310. customerId:null,
  1311. avatar: null,
  1312. type: null,
  1313. gender: null,
  1314. remark: null,
  1315. description: null,
  1316. tagIds: null,
  1317. remarkMobiles: null,
  1318. remarkCorpName: null,
  1319. addWay: null,
  1320. operUserid: null,
  1321. corpId: null,
  1322. companyId: null,
  1323. transferStatus:null,
  1324. status:null,
  1325. sTime:null,
  1326. eTime:null,
  1327. createTime:null,
  1328. transferTime:null,
  1329. transferNum:null,
  1330. lossTime:null,
  1331. delTime:null,
  1332. state:null,
  1333. wayId:null,
  1334. stageStatus:null,
  1335. customerName:null
  1336. };
  1337. this.resetForm("form");
  1338. },
  1339. /** 搜索按钮操作 */
  1340. handleQuery() {
  1341. if (this.selectTags!=null && this.selectTags.length>0){
  1342. // 确保 this.form.tags 是数组
  1343. if (!this.queryParams.tagIds) {
  1344. this.queryParams.tagIds = []; // 如果未定义,初始化
  1345. } else {
  1346. this.queryParams.tagIds = []; // 清空已有数据
  1347. }
  1348. // 遍历并添加 tagId
  1349. this.selectTags.forEach(tag => {
  1350. if (tag.tagId) { // 确保 tagId 存在
  1351. this.queryParams.tagIds.push(tag.tagId);
  1352. }
  1353. });
  1354. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  1355. }else {
  1356. this.queryParams.tagIds=null;
  1357. }
  1358. this.queryParams.pageNum = 1;
  1359. this.getList();
  1360. },
  1361. handleSearchTags(name){
  1362. if (!name){
  1363. return this.$message.error("请输入要搜索的标签")
  1364. }
  1365. this.queryTagParams.name=name;
  1366. this.queryTagParams.corpId=this.queryParams.corpId;
  1367. searchTags(this.queryTagParams).then(response => {
  1368. this.tagGroupList = response.rows;
  1369. this.total = response.total;
  1370. });
  1371. },
  1372. cancelSearchTags(){
  1373. this.resetSearchQueryTag()
  1374. this.getPageListTagGroup();
  1375. },
  1376. //确定选择标签
  1377. tagSubmitForm(){
  1378. for (let i = 0; i < this.tagGroupList.length; i++) {
  1379. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1380. if (this.tagGroupList[i].tag[x].isSelected === true) {
  1381. if (!this.selectTags) {
  1382. this.selectTags = [];
  1383. }
  1384. // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
  1385. let tagExists = this.selectTags.some(
  1386. tag => tag.id === this.tagGroupList[i].tag[x].id
  1387. );
  1388. // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
  1389. if (!tagExists) {
  1390. this.selectTags.push(this.tagGroupList[i].tag[x]);
  1391. }
  1392. }
  1393. }
  1394. }
  1395. if (!this.selectTags || this.selectTags.length === 0) {
  1396. return this.$message('请选择标签');
  1397. }
  1398. this.changeTagDialog.open = false;
  1399. },
  1400. //取消选择标签
  1401. tagCancel(){
  1402. this.changeTagDialog.open = false;
  1403. },
  1404. resetSearchQueryTag(){
  1405. this.queryTagParams= {
  1406. pageNum: 1,
  1407. pageSize: 10,
  1408. total:0,
  1409. name:null,
  1410. };
  1411. },
  1412. /** 重置按钮操作 */
  1413. resetQuery() {
  1414. this.resetForm("queryForm");
  1415. this.queryParams.corpId= this.myQwCompanyList[0].dictValue;
  1416. this.selectTags=[];
  1417. this.createTime=null;
  1418. this.queryParams.sTime=null;
  1419. this.queryParams.eTime=null;
  1420. this.handleQuery();
  1421. },
  1422. // 多选框选中数据
  1423. handleSelectionChange(selection) {
  1424. this.ids = selection.map(item => item.id)
  1425. this.single = selection.length!==1
  1426. this.multiple = !selection.length
  1427. },
  1428. /** 新增按钮操作 */
  1429. handleAdd() {
  1430. this.loading=true;
  1431. this.form.corpId=this.queryParams.corpId
  1432. addExternalContact(this.form).then(response => {
  1433. this.msgSuccess("同步成功");
  1434. this.getList();
  1435. }).finally(()=>{
  1436. this.loading=false;
  1437. });
  1438. },
  1439. /** 修改按钮操作 */
  1440. handleUpdate(row) {
  1441. this.reset();
  1442. const id = row.id || this.ids
  1443. getExternalContact(id).then(response => {
  1444. this.form = response.data;
  1445. if(this.form.remarkMobiles!=null){
  1446. this.remarkMobiles=JSON.parse(this.form.remarkMobiles)
  1447. }else{
  1448. this.remarkMobiles=[]
  1449. }
  1450. this.open = true;
  1451. this.title = "修改企业微信客户";
  1452. });
  1453. },
  1454. handleAppellation(val){
  1455. this.callOpen.open=true;
  1456. this.callOpenFrom.stageStatus=val.stageStatus;
  1457. this.callOpenFrom.id=val.id;
  1458. },
  1459. /** 绑定客户操作 */
  1460. handleUpdateCustomer(row){
  1461. this.bindCustomer.title="绑定客户"
  1462. this.bindCustomer.open=true;
  1463. this.form.id=row.id
  1464. this.form.externalUserId=row.externalUserId
  1465. this.form.name=row.name
  1466. },
  1467. handleUpdateUser(row){
  1468. this.user.title="绑定客户"
  1469. this.user.open=true;
  1470. this.userForm.id=row.id;
  1471. },
  1472. handleUnBindUserId(val){
  1473. this.$confirm(
  1474. '确认解绑客户:<span style="color: green;">' + val.name + '' +
  1475. '</span> 的小程序用户?<br><span style="color: red;">【ps:可能会导致客户无法看课】</span>',
  1476. {
  1477. confirmButtonText: "确定",
  1478. cancelButtonText: "取消",
  1479. type: "warning",
  1480. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  1481. }
  1482. ).then(() => {
  1483. return unBindUserId(val.id);
  1484. }).then(response => {
  1485. this.getList();
  1486. this.msgSuccess("解绑成功");
  1487. }).finally(res=>{
  1488. this.getList();
  1489. })
  1490. },
  1491. bindCustomerId(row){
  1492. console.log("row",row)
  1493. // this.qwFormCustomer.customerId=row;
  1494. this.form.customerId=row;
  1495. this.form.corpId=this.queryParams.corpId;
  1496. this.msgWarning("绑定中.....同步信息中.....");
  1497. editbindCustomer(this.form).then(res=>{
  1498. //清空表单
  1499. this.reset();
  1500. this.bindCustomer.open = false;
  1501. this.msgSuccess("绑定成功");
  1502. this.getList();
  1503. })
  1504. },
  1505. //设置一个SOP
  1506. setCourseSOP(row) {
  1507. // 检查 row.miniUserId 是否为 null
  1508. if (row.miniUserId === null || row.miniUserId === undefined) {
  1509. return this.$confirm('当前客户【CRM客户详情】中 未绑定小程序客户,请先绑定', "警告", {
  1510. confirmButtonText: "确定",
  1511. cancelButtonText: "取消",
  1512. type: "warning"
  1513. }).catch(error => {
  1514. this.msgWarning("操作取消:", error);
  1515. });
  1516. } else {
  1517. this.chooseCustomerSOP = row;
  1518. this.setSop.open = true;
  1519. this.setSop.type=1;
  1520. }
  1521. },
  1522. //选择课程SOP
  1523. // 用于设置 customerCourseForm 和 customerCourseFormLogs 的共同属性
  1524. setCommonProperties(form, row) {
  1525. form.qwUserid = this.chooseCustomerSOP.userId;
  1526. form.companyUserId = this.chooseCustomerSOP.companyUserId;
  1527. form.externalUserId = this.chooseCustomerSOP.externalUserId;
  1528. form.customerId = this.chooseCustomerSOP.customerId;
  1529. form.miniUserId = this.chooseCustomerSOP.miniUserId;
  1530. form.businessId = row.businessId;
  1531. },
  1532. bindCourseSop(row,days) {
  1533. if (this.setSop.type==2){
  1534. this.setSop.open = false;
  1535. this.loading=true;
  1536. this.msgWarning("设定中.....同步信息中.....");
  1537. setCustomerCourseSopList({ids:this.ids,fsCourseSopId:row.id,days:days}).then(res=>{
  1538. let msg=" 批量设置成功数【" + res.successNum + "】,<br>"
  1539. if (res.failCRM.length>0){
  1540. msg+="失败的客户【" + res.failCRM + "】,原因是未绑定CRM客户。<br>"
  1541. }
  1542. if (res.failMiNi.length>0){
  1543. msg+="失败的客户【" + res.failMiNi + "】,原因是CRM中未绑定小程序客户。<br>"
  1544. }
  1545. if (res.failCompany.length>0){
  1546. msg+="失败的客户【" + res.failCompany + "】,原因是客户没有所属成员。<br>"
  1547. }
  1548. return this.$confirm(msg, "提示", {
  1549. confirmButtonText: "确定",
  1550. cancelButtonText: "取消",
  1551. type: "warning",
  1552. dangerouslyUseHTMLString: true // 允许使用HTML标签
  1553. }).catch(error => {
  1554. this.msgSuccess("操作完成~");
  1555. });
  1556. }).finally(()=>{
  1557. this.loading = false;
  1558. this.getList();
  1559. })
  1560. }else if (this.setSop.type==1){
  1561. // 设置 customerCourseFormLogs 的属性
  1562. this.setCommonProperties(this.customerCourseFormLogs, row);
  1563. // 设置 customerCourseForm 的属性
  1564. this.setCommonProperties(this.customerCourseForm, row);
  1565. this.customerCourseForm.sopId = row.id;
  1566. this.customerCourseForm.sopType = row.sopType;
  1567. this.customerCourseForm.setting = row.setting;
  1568. this.customerCourseForm.days = days;
  1569. // 执行异步操作
  1570. getCustomerCourseSop(this.customerCourseFormLogs)
  1571. .then(res => {
  1572. if (res) {
  1573. return this.$confirm('当前客户已设置过相同课程课节SOP,确定还要再次设置吗?', "警告", {
  1574. confirmButtonText: "确定",
  1575. cancelButtonText: "取消",
  1576. type: "warning"
  1577. });
  1578. } else {
  1579. return Promise.resolve(); // 如果没有设置过,直接执行后续操作
  1580. }
  1581. })
  1582. .then(() => {
  1583. this.loading = true;
  1584. this.setSop.open = false;
  1585. this.msgSuccess("设定中.....同步信息中.....");
  1586. return setCustomerCourseSop(this.customerCourseForm);
  1587. })
  1588. .then(() => {
  1589. this.msgSuccess("设定成功");
  1590. })
  1591. .catch(error => {
  1592. this.msgWarning("操作取消:", error);
  1593. })
  1594. .finally(() => {
  1595. this.loading = false;
  1596. this.getList();
  1597. });
  1598. }
  1599. },
  1600. submitCallOpenFrom(){
  1601. this.$refs["callOpenFrom"].validate(valid => {
  1602. if (valid) {
  1603. if (this.callOpenFrom.id != null && this.callOpenFrom.stageStatus != null) {
  1604. updateExternalContactCall(this.callOpenFrom).then(res=>{
  1605. this.$message.success('修改成功');
  1606. this.callOpen.open=false;
  1607. this.getList();
  1608. });
  1609. }
  1610. }
  1611. });
  1612. },
  1613. /** 提交按钮 */
  1614. submitForm() {
  1615. this.$refs["form"].validate(valid => {
  1616. if (valid) {
  1617. if (this.form.id != null) {
  1618. this.form.remarkMobiles=JSON.stringify(this.remarkMobiles)
  1619. updateExternalContact(this.form).then(response => {
  1620. this.msgSuccess("修改成功");
  1621. this.open = false;
  1622. this.getList();
  1623. });
  1624. } else {
  1625. addExternalContact(this.form).then(response => {
  1626. this.msgSuccess("新增成功");
  1627. this.open = false;
  1628. this.getList();
  1629. });
  1630. }
  1631. }
  1632. });
  1633. },
  1634. /** 删除按钮操作 */
  1635. handleDelete(row) {
  1636. const ids = row.id || this.ids;
  1637. this.$confirm('是否确认删除企业微信客户编号为"' + ids + '"的数据项?', "警告", {
  1638. confirmButtonText: "确定",
  1639. cancelButtonText: "取消",
  1640. type: "warning"
  1641. }).then(function() {
  1642. return delExternalContact(ids);
  1643. }).then(() => {
  1644. this.getList();
  1645. this.msgSuccess("删除成功");
  1646. }).catch(() => {});
  1647. },
  1648. updateTalk(row){
  1649. const ids = row.id || this.ids;
  1650. this.$confirm('是否确认批量更改用户信息为非首次交流', "警告", {
  1651. confirmButtonText: "确定",
  1652. cancelButtonText: "取消",
  1653. type: "warning"
  1654. }).then(function() {
  1655. return editTalk(ids);
  1656. }).then(() => {
  1657. this.getList();
  1658. this.msgSuccess("成功");
  1659. }).catch(() => {});
  1660. },
  1661. /** 导出按钮操作 */
  1662. handleExport() {
  1663. const { qwUserName, ...queryParams } = this.queryParams;
  1664. this.$confirm('是否确认导出所有企业微信客户数据项?', "警告", {
  1665. confirmButtonText: "确定",
  1666. cancelButtonText: "取消",
  1667. type: "warning"
  1668. }).then(() => {
  1669. this.exportLoading = true;
  1670. return exportExternalContact(queryParams);
  1671. }).then(response => {
  1672. this.download(response.msg);
  1673. this.exportLoading = false;
  1674. }).catch(() => {});
  1675. },
  1676. handleBatchUpdateNotesFilter() {
  1677. this.notesOpen.open = true;
  1678. this.notesOpen.filter = true;
  1679. },
  1680. handleBatchUpdateNotes() {
  1681. if (this.ids == null || this.ids == "") {
  1682. return this.$message('请选择需要添加备注的客户');
  1683. }
  1684. this.notesOpen.open = true;
  1685. this.notesOpen.filter = false;
  1686. },
  1687. notesSubmitForm() {
  1688. if (this.notesOpen.notes == null || this.notesOpen.notes == "") {
  1689. return this.$message.error("请输入备注内容");
  1690. }
  1691. // let loadingRock = this.$loading({
  1692. // lock: true,
  1693. // text: '正在执行中请稍后~~请不要刷新页面!!',
  1694. // spinner: 'el-icon-loading',
  1695. // background: 'rgba(0, 0, 0, 0.7)'
  1696. // });
  1697. let obj = JSON.parse(JSON.stringify(this.queryParams))
  1698. console.log(obj);
  1699. if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
  1700. obj.tagIds = obj.tagIds.split(",");
  1701. }
  1702. batchUpdateExternalContactNotes({
  1703. addType: 0,
  1704. userIds: this.ids,
  1705. notes: this.notesOpen.notes,
  1706. type: this.notesOpen.type,
  1707. nameType: this.notesOpen.nameType,
  1708. filter: this.notesOpen.filter,
  1709. param: obj
  1710. }).then(res => {
  1711. this.resultMessage = res.msg;
  1712. this.$message.success("正在执行中...");
  1713. // this.resultDialogVisible = true; // 显示弹窗
  1714. // this.resultTitle = '批量修改备注结果';
  1715. }).finally(res => {
  1716. this.getList();
  1717. // loadingRock.close();
  1718. this.notesCancel();
  1719. })
  1720. },
  1721. }
  1722. };
  1723. </script>
  1724. <style scoped>
  1725. /* CSS 样式 */
  1726. .tag-container {
  1727. display: flex;
  1728. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1729. gap: 8px; /* 设置标签之间的间距 */
  1730. }
  1731. .name-background {
  1732. display: inline-block;
  1733. background-color: #abece6; /* 背景颜色 */
  1734. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1735. border-radius: 4px; /* 可选:设置圆角 */
  1736. }
  1737. /* CSS 样式 */
  1738. .tag-container {
  1739. display: flex;
  1740. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1741. gap: 8px; /* 设置标签之间的间距 */
  1742. }
  1743. .name-background {
  1744. display: inline-block;
  1745. background-color: #abece6; /* 背景颜色 */
  1746. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1747. border-radius: 4px; /* 可选:设置圆角 */
  1748. }
  1749. .tag-box {
  1750. padding: 8px 12px;
  1751. border: 1px solid #989797;
  1752. border-radius: 4px;
  1753. cursor: pointer;
  1754. display: inline-block;
  1755. }
  1756. .tag-selected {
  1757. background-color: #00bc98;
  1758. color: #fff;
  1759. border-color: #00bc98;
  1760. }
  1761. .el-tag + .el-tag {
  1762. margin-left: 10px;
  1763. }
  1764. .button-new-tag {
  1765. margin-left: 10px;
  1766. height: 32px;
  1767. line-height: 30px;
  1768. padding-top: 0;
  1769. padding-bottom: 0;
  1770. }
  1771. .input-new-tag {
  1772. width: 90px;
  1773. margin-left: 10px;
  1774. vertical-align: bottom;
  1775. }
  1776. .suggestion-box {
  1777. position: absolute;
  1778. z-index: 999;
  1779. background: #fff;
  1780. border: 1px solid #ddd;
  1781. max-height: 200px;
  1782. overflow-y: auto;
  1783. width: 100%;
  1784. }
  1785. .suggestion-item {
  1786. padding: 10px;
  1787. cursor: pointer;
  1788. }
  1789. .suggestion-item:hover {
  1790. background-color: #f5f7fa;
  1791. }
  1792. /* 新增的滚动容器样式(不影响原有样式) */
  1793. .scroll-wrapper {
  1794. max-height: 130px; /* 大约三行的高度 */
  1795. overflow-y: auto; /* 垂直滚动 */
  1796. padding-right: 5px; /* 为滚动条留出空间 */
  1797. }
  1798. /* 美化滚动条(可选) */
  1799. .scroll-wrapper::-webkit-scrollbar {
  1800. width: 6px;
  1801. }
  1802. .scroll-wrapper::-webkit-scrollbar-thumb {
  1803. background: rgba(0, 0, 0, 0.2);
  1804. border-radius: 3px;
  1805. }
  1806. .tag-container {
  1807. max-height: 200px;
  1808. overflow-y: auto;
  1809. padding: 1px;
  1810. border: 1px solid #ebeef5;
  1811. border-radius: 1px;
  1812. background-color: #fafafa;
  1813. }
  1814. .tag-list {
  1815. display: flex;
  1816. flex-wrap: wrap;
  1817. gap: 8px;
  1818. }
  1819. .scroll-hint {
  1820. text-align: center;
  1821. color: #909399;
  1822. font-size: 12px;
  1823. padding: 1px 0;
  1824. }
  1825. .container {
  1826. max-width: 800px;
  1827. margin: 0 auto;
  1828. padding: 10px;
  1829. }
  1830. .title {
  1831. text-align: center;
  1832. color: #303133;
  1833. margin-bottom: 30px;
  1834. }
  1835. .demo-table {
  1836. width: 100%;
  1837. margin-bottom: 30px;
  1838. }
  1839. .instructions {
  1840. background-color: #f5f7fa;
  1841. padding: 15px;
  1842. border-radius: 1px;
  1843. margin-bottom: 20px;
  1844. }
  1845. </style>