index.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="企微公司" prop="corpId">
  5. <el-select v-model="queryParams.corpId" placeholder="企微公司" size="small" @change="updateCorpId()">
  6. <el-option
  7. v-for="dict in myQwCompanyList"
  8. :key="dict.dictValue"
  9. :label="dict.dictLabel"
  10. :value="dict.dictValue"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="客户名称" prop="name">
  15. <el-input
  16. v-model="queryParams.name"
  17. placeholder="请输入客户名称"
  18. clearable
  19. size="small"
  20. @keyup.enter.native="handleQuery"
  21. />
  22. </el-form-item>
  23. <el-form-item label="所属名称" prop="qwUserName">
  24. <el-input
  25. v-model="queryParams.qwUserName"
  26. placeholder="请输入所属员工名称"
  27. clearable
  28. size="small"
  29. @keyup.enter.native="handleQuery"
  30. />
  31. </el-form-item>
  32. <el-form-item label="用户类别" prop="type">
  33. <el-select v-model="queryParams.type" placeholder="请选择用户类别" clearable size="small">
  34. <el-option
  35. v-for="dict in typeOptions"
  36. :key="dict.dictValue"
  37. :label="dict.dictLabel"
  38. :value="dict.dictValue"
  39. />
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="性别" prop="gender">
  43. <el-select v-model="queryParams.gender" placeholder="状态" clearable size="small">
  44. <el-option
  45. v-for="dict in genderOptions"
  46. :key="dict.dictValue"
  47. :label="dict.dictLabel"
  48. :value="dict.dictValue"
  49. />
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item label="电话号码" prop="remarkMobiles">
  53. <el-input
  54. v-model="queryParams.remarkMobiles"
  55. placeholder="请输入备注电话号码"
  56. clearable
  57. size="small"
  58. @keyup.enter.native="handleQuery"
  59. />
  60. </el-form-item>
  61. <el-form-item label="来源" prop="addWay">
  62. <el-select v-model="queryParams.addWay" placeholder="来源" clearable size="small">
  63. <el-option
  64. v-for="dict in addWayOptions"
  65. :key="dict.dictValue"
  66. :label="dict.dictLabel"
  67. :value="dict.dictValue"
  68. />
  69. </el-select>
  70. </el-form-item>
  71. <el-form-item label="状态" prop="status">
  72. <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">
  73. <el-option
  74. v-for="dict in statusOptions"
  75. :key="dict.dictValue"
  76. :label="dict.dictLabel"
  77. :value="dict.dictValue"
  78. />
  79. </el-select>
  80. </el-form-item>
  81. <el-form-item label="转接状态" prop="addWay">
  82. <el-select v-model="queryParams.transferStatus" placeholder="转接状态" clearable size="small">
  83. <el-option
  84. v-for="dict in transferStatusOptions"
  85. :key="dict.dictValue"
  86. :label="dict.dictLabel"
  87. :value="dict.dictValue"
  88. />
  89. </el-select>
  90. </el-form-item>
  91. <el-form-item label="是否绑小程序" prop="isBindMini">
  92. <el-select v-model="queryParams.isBindMini" placeholder="是否绑定小程序" clearable size="small" @change="handleQuery" >
  93. <el-option
  94. v-for="dict in isBindMiniOptions"
  95. :key="dict.dictValue"
  96. :label="dict.dictLabel"
  97. :value="dict.dictValue"
  98. />
  99. </el-select>
  100. </el-form-item>
  101. <el-form-item label="标签" prop="tagIds">
  102. <el-select v-model="selectTags" remote multiple placeholder="请选择" filterable style="width: 100%;">
  103. <el-option
  104. v-for="dict in tagList"
  105. :label="dict.name"
  106. :value="dict.tagId">
  107. </el-option>
  108. </el-select>
  109. </el-form-item>
  110. <el-form-item label="备注" prop="remark">
  111. <el-input
  112. v-model="queryParams.remark"
  113. placeholder="请输入备注"
  114. clearable
  115. size="small"
  116. @keyup.enter.native="handleQuery"
  117. />
  118. </el-form-item>
  119. <el-form-item label="添加时间" prop="createTime">
  120. <el-date-picker clearable size="small"
  121. v-model="queryParams.createTime"
  122. type="date"
  123. value-format="yyyy-MM-dd"
  124. placeholder="选择添加时间">
  125. </el-date-picker>
  126. </el-form-item>
  127. <el-form-item label="流失时间" prop="lossTime">
  128. <el-date-picker clearable size="small"
  129. v-model="queryParams.lossTime"
  130. type="date"
  131. value-format="yyyy-MM-dd"
  132. placeholder="选择流失时间">
  133. </el-date-picker>
  134. </el-form-item>
  135. <el-form-item label="删除时间" prop="delTime">
  136. <el-date-picker clearable size="small"
  137. v-model="queryParams.delTime"
  138. type="date"
  139. value-format="yyyy-MM-dd"
  140. placeholder="选择删除时间">
  141. </el-date-picker>
  142. </el-form-item>
  143. <el-form-item>
  144. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  145. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  146. </el-form-item>
  147. </el-form>
  148. <el-row :gutter="10" class="mb8">
  149. <!-- <el-col :span="1.5">
  150. <el-button
  151. type="primary"
  152. plain
  153. icon="el-icon-plus"
  154. size="mini"
  155. @click="handleAdd"
  156. v-hasPermi="['qw:externalContact:add']"
  157. >同步</el-button>
  158. </el-col> -->
  159. <el-col :span="1.5">
  160. <el-button
  161. type="success"
  162. plain
  163. icon="el-icon-edit"
  164. size="mini"
  165. :disabled="single"
  166. @click="handleUpdate"
  167. v-hasPermi="['qw:externalContact:edit']"
  168. >修改备注</el-button>
  169. </el-col>
  170. <el-col :span="1.5">
  171. <el-button
  172. type="warning"
  173. plain
  174. icon="el-icon-download"
  175. size="mini"
  176. :loading="exportLoading"
  177. @click="handleExport"
  178. v-hasPermi="['qw:externalContact:export']"
  179. >导出</el-button>
  180. </el-col>
  181. <el-col :span="1.5">
  182. <el-button
  183. type="primary"
  184. plain
  185. size="mini"
  186. @click="addUserTag"
  187. v-hasPermi="['qw:externalContact:addTag']"
  188. >批量添加标签</el-button>
  189. </el-col>
  190. <el-col :span="1.5">
  191. <el-button
  192. type="primary"
  193. plain
  194. size="mini"
  195. @click="delUserTag"
  196. v-hasPermi="['qw:externalContact:delTag']"
  197. >批量移除标签</el-button>
  198. </el-col>
  199. <el-col :span="1.5">
  200. <el-button
  201. type="primary"
  202. plain
  203. size="mini"
  204. @click="updateTalk"
  205. >批量更改交流状态</el-button>
  206. </el-col>
  207. <!-- <el-col :span="1.5">-->
  208. <!-- <el-button-->
  209. <!-- type="primary"-->
  210. <!-- plain-->
  211. <!-- size="mini"-->
  212. <!-- @click="setUserCourseSop"-->
  213. <!-- v-hasPermi="['qw:externalContact:setCourseSop']"-->
  214. <!-- >批量设置课程SOP</el-button>-->
  215. <!-- </el-col>-->
  216. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  217. </el-row>
  218. <el-tabs type="card" v-model="isBindActiveName" @tab-click="handleClickX">
  219. <el-tab-pane label="全部" name="all"></el-tab-pane>
  220. <el-tab-pane label="已绑定CRM" name="isBind"></el-tab-pane>
  221. <el-tab-pane label="未绑定CRM" name="noBind"></el-tab-pane>
  222. </el-tabs>
  223. <el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
  224. <el-table-column type="selection" width="55" align="center" />
  225. <el-table-column label="企微客户ID" align="center" prop="id" />
  226. <el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">
  227. <template slot-scope="scope">
  228. <el-popover
  229. placement="right"
  230. title=""
  231. trigger="hover">
  232. <img slot="reference" :src="scope.row.avatar" width="60px">
  233. <img :src="scope.row.avatar" style="max-width: 200px;">
  234. </el-popover>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="企微客户名称" prop="name" width="110px"/>
  238. <el-table-column label="所属员工" align="center" prop="qwUserName" width="120px"/>
  239. <el-table-column label="员工部门" align="center" prop="departmentName" width="120px"/>
  240. <el-table-column label="用户类别" align="center" prop="type">
  241. <template slot-scope="scope">
  242. <dict-tag :options="typeOptions" :value="scope.row.type"/>
  243. </template>
  244. </el-table-column>
  245. <el-table-column label="性别" align="center" prop="gender">
  246. <template slot-scope="scope">
  247. <dict-tag :options="genderOptions" :value="scope.row.gender"/>
  248. </template>
  249. </el-table-column>
  250. <el-table-column label="备注" align="center" prop="remark" />
  251. <el-table-column label="描述信息" align="center" prop="description" />
  252. <el-table-column label="是否重粉" align="center" prop="isRepeat" >
  253. <template slot-scope="scope">
  254. <el-tag :type="scope.row.isRepeat === 1 ? 'success' : 'info'">
  255. {{ scope.row.isRepeat === 1 ? '是' : '否' }}
  256. </el-tag>
  257. </template>
  258. </el-table-column>
  259. <el-table-column label="标签" align="center" prop="tagIds" width="250px">
  260. <template slot-scope="scope">
  261. <div v-for="i in JSON.parse(scope.row.tagIds)" :key="i" style="display: inline;">
  262. <el-tag type="success" v-for="ii in tagList" :key="ii.id" style="margin: 3px;" v-if="ii.tagId==i">{{ii.name}}</el-tag>
  263. </div>
  264. </template>
  265. </el-table-column>
  266. <el-table-column label="状态" align="center" prop="status" width="120px" >
  267. <template slot-scope="scope">
  268. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  269. </template>
  270. </el-table-column>
  271. <el-table-column label="添加时间" align="center" prop="createTime" width="100px" />
  272. <el-table-column label="流失时间" align="center" prop="lossTime" width="100px" />
  273. <el-table-column label="删除时间" align="center" prop="delTime" width="100px" />
  274. <el-table-column label="备注电话号码" align="center" prop="remarkMobiles" width="150px">
  275. <template slot-scope="scope">
  276. <div v-for="i in JSON.parse(scope.row.remarkMobiles)" :key="i">{{i}}</div>
  277. </template>
  278. </el-table-column>
  279. <el-table-column label="备注企业名称" align="center" prop="remarkCorpName" />
  280. <el-table-column label="来源" align="center" prop="addWay" width="100px">
  281. <template slot-scope="scope">
  282. <dict-tag :options="addWayOptions" :value="scope.row.addWay"/>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="转接状态" align="center" prop="transferStatus" width="100px" >
  286. <template slot-scope="scope">
  287. <dict-tag :options="transferStatusOptions" :value="scope.row.transferStatus"/>
  288. </template>
  289. </el-table-column>
  290. <el-table-column label="企业id" align="center" prop="corpId" />
  291. <el-table-column label="是否绑小程序" width="100px" align="center" fixed="right">
  292. <template slot-scope="scope">
  293. <el-tag v-if="scope.row.fsUserId" >已绑定</el-tag>
  294. <el-tag v-else type="info"> 未绑定</el-tag>
  295. </template>
  296. </el-table-column>
  297. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
  298. <template slot-scope="scope">
  299. <el-button
  300. v-if="scope.row.status==0||scope.row.status==2"
  301. size="mini"
  302. type="text"
  303. icon="el-icon-edit"
  304. @click="handleUpdate(scope.row)"
  305. v-hasPermi="['qw:externalContact:edit']"
  306. >修改备注</el-button>
  307. <el-button
  308. size="mini"
  309. type="text"
  310. icon="el-icon-edit-outline"
  311. @click="handleUpdateCustomer(scope.row)"
  312. >
  313. <span v-if="scope.row.customerId">换绑CRM</span>
  314. <span v-else>绑定CRM</span>
  315. </el-button>
  316. <el-button
  317. size="mini"
  318. type="text"
  319. icon="el-icon-edit-outline"
  320. @click="handleUpdateUser(scope.row)"
  321. >
  322. <span v-if="scope.row.fsUserId">换绑小程序用户</span>
  323. <span v-else>绑定小程序用户</span>
  324. </el-button>
  325. <el-button
  326. size="mini"
  327. type="text"
  328. icon="el-icon-thumb"
  329. @click="handleUnBindUserId(scope.row)"
  330. v-hasPermi="['qw:externalContact:unBindUserId']"
  331. >
  332. <span v-if="scope.row.fsUserId">解除小程序用户绑定</span>
  333. </el-button>
  334. <el-button v-if="scope.row.customerId"
  335. size="mini"
  336. type="text"
  337. icon="el-icon-paperclip"
  338. @click="handleShow(scope.row)"
  339. >CRM客户详情</el-button>
  340. <el-button
  341. size="mini"
  342. type="text"
  343. @click="handledetails(scope.row)"
  344. >用户信息
  345. </el-button>
  346. <el-button
  347. size="mini"
  348. type="text"
  349. @click="handleViewRepeat(scope.row)"
  350. v-if="scope.row.isRepeat===1"
  351. >查看重粉</el-button>
  352. </template>
  353. </el-table-column>
  354. </el-table>
  355. <pagination
  356. v-show="total>0"
  357. :total="total"
  358. :page.sync="queryParams.pageNum"
  359. :limit.sync="queryParams.pageSize"
  360. @pagination="getList"
  361. />
  362. <el-drawer size="75%" :title="show.title" :visible.sync="show.open">
  363. <customer-details ref="customerDetails" @refreshList="refreshList"/>
  364. </el-drawer>
  365. <el-dialog visible.sync="true" width="800px">
  366. </el-dialog>
  367. <el-dialog title="批量添加标签" :visible.sync="tagOpen" width="800px" append-to-body>
  368. <div>搜索标签:
  369. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  370. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  371. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  372. </div>
  373. <el-form ref="form" :model="addTagForm" label-width="80px">
  374. <div v-for="item in tagGroupList" :key="item.id" >
  375. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  376. <span class="name-background">{{ item.name }}</span>
  377. </div>
  378. <div class="tag-container">
  379. <a
  380. v-for="tagItem in item.tag"
  381. class="tag-box"
  382. @click="tagSelection(tagItem)"
  383. :class="{ 'tag-selected': tagItem.isSelected }"
  384. >
  385. {{ tagItem.name }}
  386. </a>
  387. </div>
  388. </div>
  389. </el-form>
  390. <div slot="footer" class="dialog-footer">
  391. <el-button type="primary" @click="addTagSubmitForm()">确 定</el-button>
  392. <el-button @click="addTagCancel">取 消</el-button>
  393. </div>
  394. </el-dialog>
  395. <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
  396. <div>搜索标签:
  397. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  398. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  399. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  400. </div>
  401. <el-form ref="form" :model="addTagForm" label-width="80px">
  402. <div v-for="item in tagGroupList" :key="item.id" >
  403. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  404. <span class="name-background">{{ item.name }}</span>
  405. </div>
  406. <div class="tag-container">
  407. <a
  408. v-for="tagItem in item.tag"
  409. class="tag-box"
  410. @click="tagSelection(tagItem)"
  411. :class="{ 'tag-selected': tagItem.isSelected }"
  412. >
  413. {{ tagItem.name }}
  414. </a>
  415. </div>
  416. </div>
  417. </el-form>
  418. <div slot="footer" class="dialog-footer">
  419. <el-button type="primary" @click="tagDelSubmitForm()">确 定</el-button>
  420. <el-button @click="DelTagCancel">取 消</el-button>
  421. </div>
  422. </el-dialog>
  423. <!-- 添加或修改企业微信客户对话框 -->
  424. <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
  425. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  426. <el-form-item label="备注" prop="remark">
  427. <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
  428. </el-form-item>
  429. <el-form-item label="描述信息" prop="description">
  430. <el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述信息" />
  431. </el-form-item>
  432. <el-form-item label="备注电话号码" prop="remarkMobiles">
  433. <el-tag
  434. :key="tag"
  435. v-for="tag in remarkMobiles"
  436. closable
  437. :disable-transitions="false"
  438. @close="handleClose(tag)">
  439. {{tag}}
  440. </el-tag>
  441. <el-input
  442. style="width:110px"
  443. class="input-new-tag"
  444. v-if="inputVisible"
  445. v-model="inputValue"
  446. ref="saveTagInput"
  447. size="small"
  448. @keyup.enter.native="handleInputConfirm"
  449. @blur="handleInputConfirm"
  450. >
  451. </el-input>
  452. <el-button v-else class="button-new-tag" size="small" style="width: 110px" @click="showInput">新增电话</el-button>
  453. </el-form-item>
  454. <el-form-item label="备注企业名称" prop="remarkCorpName">
  455. <el-input v-model="form.remarkCorpName" placeholder="请输入备注企业名称" />
  456. </el-form-item>
  457. </el-form>
  458. <div slot="footer" class="dialog-footer">
  459. <el-button type="primary" @click="submitForm">确 定</el-button>
  460. <el-button @click="cancel">取 消</el-button>
  461. </div>
  462. </el-dialog>
  463. <!-- 绑定客户 -->
  464. <el-dialog :title="bindCustomer.title" :visible.sync="bindCustomer.open" width="1200px" append-to-body>
  465. <mycustomer ref="mycustomer" @bindCustomerId="bindCustomerId"></mycustomer>
  466. </el-dialog>
  467. <!-- 设置一个课程sop-->
  468. <el-dialog :title="setSop.title" :visible.sync="setSop.open" width="1200px" append-to-body>
  469. <SopDialog ref="SopDialog" @bindCourseSop="bindCourseSop"></SopDialog>
  470. </el-dialog>
  471. <el-dialog :title="user.title" :visible.sync="user.open" width="800px" append-to-body>
  472. <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>
  473. </el-dialog>
  474. <el-dialog :title="info.title" :visible.sync="info.open" width="1100px" append-to-body>
  475. <info ref="Details" />
  476. </el-dialog>
  477. <el-dialog :title="repeatDialog.title" :visible.sync="repeatDialog.visible" width="70%" append-to-body>
  478. <el-table v-loading="repeatDialog.loading" :data="repeatDialog.data" border>
  479. <el-table-column label="所属公司ID" prop="companyId" align="center" />
  480. <el-table-column label="公司名称" prop="companyName" align="center" />
  481. <el-table-column label="销售ID" prop="companyUserId" align="center" />
  482. <el-table-column label="销售名称" prop="companyUserName" align="center" />
  483. <el-table-column label="销售微信号" prop="saleerWx" align="center" />
  484. <el-table-column label="创建时间" prop="createDate" align="center" />
  485. </el-table>
  486. <div slot="footer" class="dialog-footer">
  487. <el-button @click="repeatDialog.visible = false">关 闭</el-button>
  488. </div>
  489. </el-dialog>
  490. </div>
  491. </template>
  492. <script>
  493. import {
  494. bindUserId,
  495. addTag,
  496. delTag,
  497. listExternalContact,
  498. getExternalContact,
  499. delExternalContact,
  500. addExternalContact,
  501. updateExternalContact,
  502. exportExternalContact,
  503. editbindCustomer,
  504. setCustomerCourseSop,
  505. getCustomerCourseSop,
  506. setCustomerCourseSopList,
  507. unBindUserId
  508. } from '@/api/qw/externalContact'
  509. import { getMyQwUserList,getMyQwCompanyList } from "@/api/qw/user";
  510. import {listTag, getTag, searchTags,} from "@/api/qw/tag";
  511. import { allListTagGroup} from "@/api/qw/tagGroup";
  512. import mycustomer from '@/views/qw/externalContact/mycustomer'
  513. import customerDetails from '@/views/qw/externalContact/customerDetails'
  514. import SopDialog from '@/views/course/sop/SopDialog.vue'
  515. import selectUser from "@/views/qw/externalContact/selectUser.vue";
  516. import info from "@/views/qw/externalContact/info.vue";
  517. import { editTalk } from "@/api/qw/externalContactInfo";
  518. import {getQwRepeatData} from "@/api/user/fsUser";
  519. export default {
  520. name: "ExternalContact",
  521. components:{mycustomer,customerDetails,SopDialog,selectUser,info},
  522. data() {
  523. return {
  524. user:{
  525. open:false,
  526. title:"修改客户"
  527. },
  528. userForm:{
  529. id:null,
  530. fsUserId:null,
  531. },
  532. info:{
  533. title:"用户信息",
  534. open:false,
  535. },
  536. isBindMiniOptions:[
  537. {dictLabel:"已绑定",dictValue:'isBindMini'},
  538. {dictLabel:"未绑定",dictValue:'noBindMini'},
  539. ],
  540. //标签弹窗选择
  541. tagChange:{
  542. open:false,
  543. index:null,
  544. },
  545. // 遮罩层
  546. loading: false,
  547. // 导出遮罩层
  548. exportLoading: false,
  549. tagOpen:false,
  550. tagDelOpen:false,
  551. // 选中数组
  552. ids: [],
  553. isBindActiveName:"all",
  554. remarkMobiles: [],
  555. inputVisible: false,
  556. inputValue: '',
  557. // 非单个禁用
  558. single: true,
  559. tagGroupList: [],
  560. // 非多个禁用
  561. multiple: true,
  562. // 显示搜索条件
  563. showSearch: true,
  564. // 总条数
  565. total: 0,
  566. // 企业微信客户表格数据
  567. externalContactList: [],
  568. // 弹出层标题
  569. title: "",
  570. // 是否显示弹出层
  571. open: false,
  572. // 用户类别字典
  573. typeOptions: [],
  574. // 性别字典
  575. genderOptions: [],
  576. addTagForm:{
  577. userIds:[],
  578. tagIds:[]
  579. },
  580. myQwCompanyList:[],
  581. show:{
  582. title:"客户详情",
  583. open:false,
  584. },
  585. //存储选择的客户
  586. chooseCustomerSOP:null,
  587. setSop:{
  588. title:"选择课节SOP",
  589. open:false,
  590. //区分单选1还是多选2
  591. type:null,
  592. },
  593. //合成的客户-课节SOP参数
  594. customerCourseForm:{},
  595. //查询是否已经设置过客户-某个课节的SOP
  596. customerCourseFormLogs:{},
  597. //绑定客户
  598. bindCustomer:{
  599. title:null,
  600. open:false,
  601. },
  602. //绑定的参数表
  603. qwFormCustomer:{
  604. externalContactId:null,
  605. customerId:null,
  606. },
  607. // 来源字典
  608. addWayOptions: [],
  609. // 查询参数
  610. queryParams: {
  611. pageNum: 1,
  612. pageSize: 10,
  613. userId: null,
  614. qwUserName:null,
  615. externalUserId: null,
  616. name: null,
  617. avatar: null,
  618. type: null,
  619. qwUserId:null,
  620. gender: null,
  621. description: null,
  622. tagIds: null,
  623. remark:null,
  624. remarkMobiles: null,
  625. remarkCorpName: null,
  626. addWay: null,
  627. operUserid: null,
  628. corpId: null,
  629. companyId: null,
  630. status:null,
  631. transferStatus:null,
  632. isBind:null,
  633. isBindMini:null,
  634. lossTime:null,
  635. createTime:null,
  636. },
  637. selectTags:[],
  638. // 表单参数
  639. form: {},
  640. tagList:[],
  641. transferStatusOptions:[],
  642. statusOptions:[],
  643. // 表单校验
  644. rules: {
  645. },
  646. repeatDialog: {
  647. visible: false,
  648. loading: false,
  649. title: "查看重粉数据",
  650. data: []
  651. }
  652. };
  653. },
  654. created() {
  655. this.getDicts("sys_qw_externalContact_type").then(response => {
  656. this.typeOptions = response.data;
  657. });
  658. getMyQwCompanyList().then(response => {
  659. this.myQwCompanyList = response.data;
  660. if(this.myQwCompanyList!=null){
  661. this.queryParams.corpId=this.myQwCompanyList[0].dictValue
  662. var listTagFrom={corpId:this.queryParams.corpId}
  663. allListTagGroup(listTagFrom).then(response => {
  664. this.tagGroupList = response.rows;
  665. });
  666. listTag(listTagFrom).then(response => {
  667. this.tagList = response.rows;
  668. });
  669. this.getList();
  670. }
  671. });
  672. this.getDicts("sys_sex").then(response => {
  673. this.genderOptions = response.data;
  674. });
  675. this.getDicts("sys_qw_externalContact_addWay").then(response => {
  676. this.addWayOptions = response.data;
  677. });
  678. this.getDicts("sys_qw_external_contact_status").then(response => {
  679. this.statusOptions = response.data;
  680. });
  681. this.getDicts("sys_qw_transfer_status").then(response => {
  682. this.transferStatusOptions = response.data;
  683. });
  684. },
  685. methods: {
  686. // 查看重粉
  687. handleViewRepeat(row){
  688. this.repeatDialog.data = [];
  689. this.repeatDialog.visible = true;
  690. this.repeatDialog.loading = true;
  691. const params = {
  692. externalUserID: row.externalUserId,
  693. corpId: row.corpId
  694. };
  695. getQwRepeatData(params).then(response => {
  696. if (response.code === 200) {
  697. this.repeatDialog.data = response.data || [];
  698. } else {
  699. this.msgError(response.msg || "获取重粉数据失败");
  700. }
  701. this.repeatDialog.loading = false;
  702. }).catch(error => {
  703. console.error("Error fetching repeat follower data:", error);
  704. this.msgError("请求重粉数据接口失败");
  705. this.repeatDialog.loading = false;
  706. });
  707. },
  708. updateCorpId(){
  709. var listTagFrom={corpId:this.queryParams.corpId}
  710. allListTagGroup(listTagFrom).then(response => {
  711. this.tagGroupList = response.rows;
  712. });
  713. listTag(listTagFrom).then(response => {
  714. this.tagList = response.rows;
  715. });
  716. this.getList();
  717. },
  718. /** 查询企业微信客户列表 */
  719. getList() {
  720. this.loading = true;
  721. listExternalContact(this.queryParams).then(response => {
  722. this.externalContactList = response.rows;
  723. this.total = response.total;
  724. this.loading = false;
  725. });
  726. },
  727. bindMiniCustomerId(row){
  728. console.log(row)
  729. this.userForm.fsUserId=row;
  730. bindUserId(this.userForm).then(res=>{
  731. if (res.code==200){
  732. this.$message.success('绑定成功')
  733. }else {
  734. this.$message.error('绑定失败:',res.msg)
  735. }
  736. this.getList()
  737. this.user.open=false;
  738. })
  739. },
  740. /** 查看客户详情 */
  741. handleShow(row){
  742. this.show.open=true;
  743. var that=this;
  744. const tab = "visit";
  745. setTimeout(() => {
  746. that.$refs.customerDetails.getDetails(row.customerId);
  747. that.$refs.customerDetails.handleClick(tab);
  748. }, 200);
  749. },
  750. handledetails(row){
  751. this.info.open=true;
  752. setTimeout(() => {
  753. this.$refs.Details.getDetails(row.id);
  754. }, 1);
  755. },
  756. closeInfo(){
  757. this.info.open=false
  758. },
  759. handleClickX(tab, event) {
  760. this.queryParams.isBind=tab.name;
  761. this.handleQuery();
  762. },
  763. handleClose(tag) {
  764. this.remarkMobiles.splice(this.remarkMobiles.indexOf(tag), 1);
  765. },
  766. showInput() {
  767. this.inputVisible = true;
  768. this.$nextTick(_ => {
  769. this.$refs.saveTagInput.$refs.input.focus();
  770. });
  771. },
  772. handleInputConfirm() {
  773. let inputValue = this.inputValue;
  774. if (inputValue) {
  775. this.remarkMobiles.push(inputValue);
  776. }
  777. this.inputVisible = false;
  778. this.inputValue = '';
  779. },
  780. addUserTag(){
  781. if(this.ids==null||this.ids==""){
  782. return this.$message('请选择需要添加标签的客户');
  783. }
  784. for (let i = 0; i < this.tagGroupList.length; i++) {
  785. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  786. this.tagGroupList[i].tag[x].isSelected=false;
  787. }
  788. }
  789. this.tagOpen = true;
  790. },
  791. delUserTag(){
  792. if(this.ids==null||this.ids==""){
  793. return this.$message('请选择需要移除标签的客户');
  794. }
  795. for (let i = 0; i < this.tagGroupList.length; i++) {
  796. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  797. this.tagGroupList[i].tag[x].isSelected=false;
  798. }
  799. }
  800. this.tagDelOpen = true;
  801. },
  802. //重新获取页面数据
  803. refreshList(){
  804. this.getList();
  805. },
  806. //批量设置课程sop
  807. setUserCourseSop(){
  808. if(this.ids==null||this.ids==""){
  809. return this.$message('请选择需要设置课程SOP的客户');
  810. }
  811. this.$confirm('批量设置客户课节SOP可能会存在重复,确定要批量设置吗?', "警告", {
  812. confirmButtonText: "确定",
  813. cancelButtonText: "取消",
  814. type: "warning"
  815. }).then(() => {
  816. this.setSop.open = true;
  817. this.setSop.type = 2;
  818. })
  819. .catch(() => {
  820. // 可以处理用户点击“取消”的逻辑
  821. });
  822. },
  823. tagSelection(row){
  824. row.isSelected= !row.isSelected;
  825. this.$forceUpdate();
  826. },
  827. // 取消按钮
  828. cancel() {
  829. this.open = false;
  830. this.reset();
  831. },
  832. addTagCancel() {
  833. this.tagOpen = false;
  834. this.addTagForm={
  835. userIds:[],
  836. tagIds:[]
  837. };
  838. },
  839. DelTagCancel() {
  840. this.tagDelOpen = false;
  841. this.addTagForm={
  842. userIds:[],
  843. tagIds:[]
  844. };
  845. },
  846. addTagSubmitForm(){
  847. for (let i = 0; i < this.tagGroupList.length; i++) {
  848. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  849. if(this.tagGroupList[i].tag[x].isSelected==true){
  850. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  851. }
  852. }
  853. }
  854. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  855. return this.$message('请选择标签');
  856. }
  857. this.addTagForm.corpId=this.queryParams.corpId
  858. this.addTagForm.userIds=this.ids;
  859. let loadingRock = this.$loading({
  860. lock: true,
  861. text: '正在执行中请稍后~~请不要刷新页面!!',
  862. spinner: 'el-icon-loading',
  863. background: 'rgba(0, 0, 0, 0.7)'
  864. });
  865. addTag(this.addTagForm).then(response => {
  866. this.msgSuccess(response.msg);
  867. this.tagOpen = false;
  868. loadingRock.close();
  869. this.addTagForm={
  870. userIds:[],
  871. tagIds:[]
  872. };
  873. this.getList()
  874. }).finally(res=>{
  875. loadingRock.close();
  876. });
  877. },
  878. tagDelSubmitForm(){
  879. for (let i = 0; i < this.tagGroupList.length; i++) {
  880. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  881. if(this.tagGroupList[i].tag[x].isSelected==true){
  882. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  883. }
  884. }
  885. }
  886. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  887. return this.$message('请选择标签');
  888. }
  889. this.addTagForm.corpId=this.queryParams.corpId
  890. this.addTagForm.userIds=this.ids;
  891. let loadingRock = this.$loading({
  892. lock: true,
  893. text: '正在执行中请稍后~~请不要刷新页面!!',
  894. spinner: 'el-icon-loading',
  895. background: 'rgba(0, 0, 0, 0.7)'
  896. });
  897. delTag(this.addTagForm).then(response => {
  898. this.msgSuccess(response.msg);
  899. this.tagDelOpen = false;
  900. loadingRock.close();
  901. this.addTagForm={
  902. userIds:[],
  903. tagIds:[]
  904. };
  905. this.getList()
  906. }).finally(res=>{
  907. loadingRock.close();
  908. });
  909. },
  910. // 表单重置
  911. reset() {
  912. this.form = {
  913. id: null,
  914. userId: null,
  915. externalUserId: null,
  916. name: null,
  917. companyUserId:null,
  918. customerId:null,
  919. avatar: null,
  920. type: null,
  921. gender: null,
  922. remark: null,
  923. description: null,
  924. tagIds: null,
  925. remarkMobiles: null,
  926. remarkCorpName: null,
  927. addWay: null,
  928. operUserid: null,
  929. corpId: null,
  930. companyId: null,
  931. transferStatus:null,
  932. status:null,
  933. createTime:null,
  934. transferTime:null,
  935. transferNum:null,
  936. lossTime:null,
  937. delTime:null,
  938. state:null,
  939. wayId:null,
  940. stageStatus:null,
  941. customerName:null
  942. };
  943. this.resetForm("form");
  944. },
  945. /** 搜索按钮操作 */
  946. handleQuery() {
  947. this.queryParams.tagIds=this.selectTags.join(',')
  948. this.queryParams.pageNum = 1;
  949. this.getList();
  950. },
  951. handleSearchTags(name){
  952. searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  953. this.tagGroupList = response.rows;
  954. });
  955. },
  956. cancelSearchTags(){
  957. this.updateCorpId()
  958. },
  959. /** 重置按钮操作 */
  960. resetQuery() {
  961. this.resetForm("queryForm");
  962. this.queryParams.corpId= this.myQwCompanyList[0].dictValue;
  963. this.selectTags=[];
  964. this.handleQuery();
  965. },
  966. // 多选框选中数据
  967. handleSelectionChange(selection) {
  968. this.ids = selection.map(item => item.id)
  969. this.single = selection.length!==1
  970. this.multiple = !selection.length
  971. },
  972. /** 新增按钮操作 */
  973. handleAdd() {
  974. this.loading=true;
  975. this.form.corpId=this.queryParams.corpId
  976. addExternalContact(this.form).then(response => {
  977. this.msgSuccess("同步成功");
  978. this.getList();
  979. }).finally(()=>{
  980. this.loading=false;
  981. });
  982. },
  983. /** 修改按钮操作 */
  984. handleUpdate(row) {
  985. this.reset();
  986. const id = row.id || this.ids
  987. getExternalContact(id).then(response => {
  988. this.form = response.data;
  989. if(this.form.remarkMobiles!=null){
  990. this.remarkMobiles=JSON.parse(this.form.remarkMobiles)
  991. }else{
  992. this.remarkMobiles=[]
  993. }
  994. this.open = true;
  995. this.title = "修改企业微信客户";
  996. });
  997. },
  998. /** 绑定客户操作 */
  999. handleUpdateCustomer(row){
  1000. this.bindCustomer.title="绑定客户"
  1001. this.bindCustomer.open=true;
  1002. this.form.id=row.id
  1003. this.form.externalUserId=row.externalUserId
  1004. this.form.name=row.name
  1005. },
  1006. handleUpdateUser(row){
  1007. this.user.title="绑定客户"
  1008. this.user.open=true;
  1009. this.userForm.id=row.id;
  1010. },
  1011. handleUnBindUserId(val){
  1012. this.$confirm(
  1013. '确认解绑客户:<span style="color: green;">' + val.name + '' +
  1014. '</span> 的小程序用户?<br><span style="color: red;">【ps:可能会导致客户无法看课】</span>',
  1015. {
  1016. confirmButtonText: "确定",
  1017. cancelButtonText: "取消",
  1018. type: "warning",
  1019. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  1020. }
  1021. ).then(() => {
  1022. return unBindUserId(val.id);
  1023. }).then(response => {
  1024. this.getList();
  1025. this.msgSuccess("解绑成功");
  1026. }).finally(res=>{
  1027. this.getList();
  1028. })
  1029. },
  1030. bindCustomerId(row){
  1031. console.log("row",row)
  1032. // this.qwFormCustomer.customerId=row;
  1033. this.form.customerId=row;
  1034. this.form.corpId=this.queryParams.corpId;
  1035. this.msgWarning("绑定中.....同步信息中.....");
  1036. editbindCustomer(this.form).then(res=>{
  1037. //清空表单
  1038. this.reset();
  1039. this.bindCustomer.open = false;
  1040. this.msgSuccess("绑定成功");
  1041. this.getList();
  1042. })
  1043. },
  1044. //设置一个SOP
  1045. setCourseSOP(row) {
  1046. // 检查 row.miniUserId 是否为 null
  1047. if (row.miniUserId === null || row.miniUserId === undefined) {
  1048. return this.$confirm('当前客户【CRM客户详情】中 未绑定小程序客户,请先绑定', "警告", {
  1049. confirmButtonText: "确定",
  1050. cancelButtonText: "取消",
  1051. type: "warning"
  1052. }).catch(error => {
  1053. this.msgWarning("操作取消:", error);
  1054. });
  1055. } else {
  1056. this.chooseCustomerSOP = row;
  1057. this.setSop.open = true;
  1058. this.setSop.type=1;
  1059. }
  1060. },
  1061. //选择课程SOP
  1062. // 用于设置 customerCourseForm 和 customerCourseFormLogs 的共同属性
  1063. setCommonProperties(form, row) {
  1064. form.qwUserid = this.chooseCustomerSOP.userId;
  1065. form.companyUserId = this.chooseCustomerSOP.companyUserId;
  1066. form.externalUserId = this.chooseCustomerSOP.externalUserId;
  1067. form.customerId = this.chooseCustomerSOP.customerId;
  1068. form.miniUserId = this.chooseCustomerSOP.miniUserId;
  1069. form.businessId = row.businessId;
  1070. },
  1071. bindCourseSop(row,days) {
  1072. if (this.setSop.type==2){
  1073. this.setSop.open = false;
  1074. this.loading=true;
  1075. this.msgWarning("设定中.....同步信息中.....");
  1076. setCustomerCourseSopList({ids:this.ids,fsCourseSopId:row.id,days:days}).then(res=>{
  1077. let msg=" 批量设置成功数【" + res.successNum + "】,<br>"
  1078. if (res.failCRM.length>0){
  1079. msg+="失败的客户【" + res.failCRM + "】,原因是未绑定CRM客户。<br>"
  1080. }
  1081. if (res.failMiNi.length>0){
  1082. msg+="失败的客户【" + res.failMiNi + "】,原因是CRM中未绑定小程序客户。<br>"
  1083. }
  1084. if (res.failCompany.length>0){
  1085. msg+="失败的客户【" + res.failCompany + "】,原因是客户没有所属成员。<br>"
  1086. }
  1087. return this.$confirm(msg, "提示", {
  1088. confirmButtonText: "确定",
  1089. cancelButtonText: "取消",
  1090. type: "warning",
  1091. dangerouslyUseHTMLString: true // 允许使用HTML标签
  1092. }).catch(error => {
  1093. this.msgSuccess("操作完成~");
  1094. });
  1095. }).finally(()=>{
  1096. this.loading = false;
  1097. this.getList();
  1098. })
  1099. }else if (this.setSop.type==1){
  1100. // 设置 customerCourseFormLogs 的属性
  1101. this.setCommonProperties(this.customerCourseFormLogs, row);
  1102. // 设置 customerCourseForm 的属性
  1103. this.setCommonProperties(this.customerCourseForm, row);
  1104. this.customerCourseForm.sopId = row.id;
  1105. this.customerCourseForm.sopType = row.sopType;
  1106. this.customerCourseForm.setting = row.setting;
  1107. this.customerCourseForm.days = days;
  1108. // 执行异步操作
  1109. getCustomerCourseSop(this.customerCourseFormLogs)
  1110. .then(res => {
  1111. if (res) {
  1112. return this.$confirm('当前客户已设置过相同课程课节SOP,确定还要再次设置吗?', "警告", {
  1113. confirmButtonText: "确定",
  1114. cancelButtonText: "取消",
  1115. type: "warning"
  1116. });
  1117. } else {
  1118. return Promise.resolve(); // 如果没有设置过,直接执行后续操作
  1119. }
  1120. })
  1121. .then(() => {
  1122. this.loading = true;
  1123. this.setSop.open = false;
  1124. this.msgSuccess("设定中.....同步信息中.....");
  1125. return setCustomerCourseSop(this.customerCourseForm);
  1126. })
  1127. .then(() => {
  1128. this.msgSuccess("设定成功");
  1129. })
  1130. .catch(error => {
  1131. this.msgWarning("操作取消:", error);
  1132. })
  1133. .finally(() => {
  1134. this.loading = false;
  1135. this.getList();
  1136. });
  1137. }
  1138. },
  1139. /** 提交按钮 */
  1140. submitForm() {
  1141. this.$refs["form"].validate(valid => {
  1142. if (valid) {
  1143. if (this.form.id != null) {
  1144. this.form.remarkMobiles=JSON.stringify(this.remarkMobiles)
  1145. updateExternalContact(this.form).then(response => {
  1146. this.msgSuccess("修改成功");
  1147. this.open = false;
  1148. this.getList();
  1149. });
  1150. } else {
  1151. addExternalContact(this.form).then(response => {
  1152. this.msgSuccess("新增成功");
  1153. this.open = false;
  1154. this.getList();
  1155. });
  1156. }
  1157. }
  1158. });
  1159. },
  1160. /** 删除按钮操作 */
  1161. handleDelete(row) {
  1162. const ids = row.id || this.ids;
  1163. this.$confirm('是否确认删除企业微信客户编号为"' + ids + '"的数据项?', "警告", {
  1164. confirmButtonText: "确定",
  1165. cancelButtonText: "取消",
  1166. type: "warning"
  1167. }).then(function() {
  1168. return delExternalContact(ids);
  1169. }).then(() => {
  1170. this.getList();
  1171. this.msgSuccess("删除成功");
  1172. }).catch(() => {});
  1173. },
  1174. updateTalk(row){
  1175. const ids = row.id || this.ids;
  1176. this.$confirm('是否确认批量更改用户信息为非首次交流', "警告", {
  1177. confirmButtonText: "确定",
  1178. cancelButtonText: "取消",
  1179. type: "warning"
  1180. }).then(function() {
  1181. return editTalk(ids);
  1182. }).then(() => {
  1183. this.getList();
  1184. this.msgSuccess("成功");
  1185. }).catch(() => {});
  1186. },
  1187. /** 导出按钮操作 */
  1188. handleExport() {
  1189. const queryParams = this.queryParams;
  1190. this.$confirm('是否确认导出所有企业微信客户数据项?', "警告", {
  1191. confirmButtonText: "确定",
  1192. cancelButtonText: "取消",
  1193. type: "warning"
  1194. }).then(() => {
  1195. this.exportLoading = true;
  1196. return exportExternalContact(queryParams);
  1197. }).then(response => {
  1198. this.download(response.msg);
  1199. this.exportLoading = false;
  1200. }).catch(() => {});
  1201. }
  1202. }
  1203. };
  1204. </script>
  1205. <style scoped>
  1206. /* CSS 样式 */
  1207. .tag-container {
  1208. display: flex;
  1209. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1210. gap: 8px; /* 设置标签之间的间距 */
  1211. }
  1212. .name-background {
  1213. display: inline-block;
  1214. background-color: #abece6; /* 背景颜色 */
  1215. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1216. border-radius: 4px; /* 可选:设置圆角 */
  1217. }
  1218. /* CSS 样式 */
  1219. .tag-container {
  1220. display: flex;
  1221. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1222. gap: 8px; /* 设置标签之间的间距 */
  1223. }
  1224. .name-background {
  1225. display: inline-block;
  1226. background-color: #abece6; /* 背景颜色 */
  1227. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1228. border-radius: 4px; /* 可选:设置圆角 */
  1229. }
  1230. .tag-box {
  1231. padding: 8px 12px;
  1232. border: 1px solid #989797;
  1233. border-radius: 4px;
  1234. cursor: pointer;
  1235. display: inline-block;
  1236. }
  1237. .tag-selected {
  1238. background-color: #00bc98;
  1239. color: #fff;
  1240. border-color: #00bc98;
  1241. }
  1242. .el-tag + .el-tag {
  1243. margin-left: 10px;
  1244. }
  1245. .button-new-tag {
  1246. margin-left: 10px;
  1247. height: 32px;
  1248. line-height: 30px;
  1249. padding-top: 0;
  1250. padding-bottom: 0;
  1251. }
  1252. .input-new-tag {
  1253. width: 90px;
  1254. margin-left: 10px;
  1255. vertical-align: bottom;
  1256. }
  1257. </style>