index.vue 63 KB

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