deptIndex.vue 62 KB

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