index.vue 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="企微公司" prop="corpId">
  5. <el-select v-model="queryParams.corpId" placeholder="企微公司" size="small" @change="updateCorpId()">
  6. <el-option
  7. v-for="dict in myQwCompanyList"
  8. :key="dict.dictValue"
  9. :label="dict.dictLabel"
  10. :value="dict.dictValue"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="客户名称" prop="name">
  15. <el-input
  16. v-model="queryParams.name"
  17. placeholder="请输入客户名称"
  18. clearable
  19. size="small"
  20. @keyup.enter.native="handleQuery"
  21. />
  22. </el-form-item>
  23. <el-form-item label="活码id" prop="wayId">
  24. <el-input
  25. v-model="queryParams.wayId"
  26. placeholder="请输入活码id"
  27. clearable
  28. size="small"
  29. @keyup.enter.native="handleQuery"
  30. />
  31. </el-form-item>
  32. <el-form-item label="销售企微昵称" prop="qwUserName">
  33. <el-input
  34. v-model="queryParams.qwUserName"
  35. placeholder="请输入销售企微昵称"
  36. clearable
  37. size="small"
  38. @keyup.enter.native="handleQuery"
  39. @input="searchQwUser"
  40. @focus="showQwUserDropdown = true"
  41. @blur="hideDropdownWithDelay"
  42. @clear="onQwUserNameClear"
  43. />
  44. <!-- 下拉建议 -->
  45. <div v-if="showQwUserDropdown && qwUserSuggestions.length > 0" class="suggestion-box" @scroll="handleScroll">
  46. <div
  47. v-for="item in qwUserSuggestions"
  48. :key="item.dictValue"
  49. class="suggestion-item"
  50. @click="selectQwUser(item.dictValue,item.dictLabel)"
  51. >
  52. {{ item.dictLabel }} ({{(item.dictValue)}})
  53. </div>
  54. </div>
  55. </el-form-item>
  56. <el-form-item label="用户类别" prop="type">
  57. <el-select v-model="queryParams.type" placeholder="请选择用户类别" clearable size="small">
  58. <el-option
  59. v-for="dict in typeOptions"
  60. :key="dict.dictValue"
  61. :label="dict.dictLabel"
  62. :value="dict.dictValue"
  63. />
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item label="所属销售" prop="companyUser">
  67. <el-input
  68. v-model="queryParams.companyUser"
  69. placeholder="请输入昵称或者手机号"
  70. clearable
  71. size="small"
  72. @keyup.enter.native="handleQuery"
  73. />
  74. </el-form-item>
  75. <el-form-item label="性别" prop="gender">
  76. <el-select v-model="queryParams.gender" placeholder="性别" clearable size="small">
  77. <el-option
  78. v-for="dict in genderOptions"
  79. :key="dict.dictValue"
  80. :label="dict.dictLabel"
  81. :value="dict.dictValue"
  82. />
  83. </el-select>
  84. </el-form-item>
  85. <el-form-item label="是否重粉" prop="userRepeat">
  86. <el-select v-model="queryParams.userRepeat" placeholder="重粉" clearable size="small">
  87. <el-option label="否" :value="0"/>
  88. <el-option label="是" :value="1"/>
  89. </el-select>
  90. </el-form-item>
  91. <el-form-item label="客户等级" prop="level">
  92. <el-select v-model="queryParams.level" placeholder="客户等级" clearable size="small">
  93. <el-option
  94. v-for="dict in ratingType"
  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="levelType">
  102. <el-select v-model="queryParams.levelType" placeholder="等级升降" clearable size="small">
  103. <el-option
  104. v-for="dict in ratingUpFall"
  105. :key="dict.dictValue"
  106. :label="dict.dictLabel"
  107. :value="dict.dictValue"
  108. />
  109. </el-select>
  110. </el-form-item>
  111. <el-form-item label="电话号码" prop="remarkMobiles">
  112. <el-input
  113. v-model="queryParams.remarkMobiles"
  114. placeholder="请输入备注电话号码"
  115. clearable
  116. size="small"
  117. @keyup.enter.native="handleQuery"
  118. />
  119. </el-form-item>
  120. <el-form-item label="来源" prop="addWay">
  121. <el-select v-model="queryParams.addWay" placeholder="来源" clearable size="small">
  122. <el-option
  123. v-for="dict in addWayOptions"
  124. :key="dict.dictValue"
  125. :label="dict.dictLabel"
  126. :value="dict.dictValue"
  127. />
  128. </el-select>
  129. </el-form-item>
  130. <el-form-item label="状态" prop="status">
  131. <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">
  132. <el-option
  133. v-for="dict in statusOptions"
  134. :key="dict.dictValue"
  135. :label="dict.dictLabel"
  136. :value="dict.dictValue"
  137. />
  138. </el-select>
  139. </el-form-item>
  140. <el-form-item label="转接状态" prop="addWay">
  141. <el-select v-model="queryParams.transferStatus" placeholder="转接状态" clearable size="small">
  142. <el-option
  143. v-for="dict in transferStatusOptions"
  144. :key="dict.dictValue"
  145. :label="dict.dictLabel"
  146. :value="dict.dictValue"
  147. />
  148. </el-select>
  149. </el-form-item>
  150. <el-form-item label="是否绑定会员" prop="isBindMini">
  151. <el-select v-model="queryParams.isBindMini" placeholder="是否绑定会员" clearable size="small" @change="handleQuery" >
  152. <el-option
  153. v-for="dict in isBindMiniOptions"
  154. :key="dict.dictValue"
  155. :label="dict.dictLabel"
  156. :value="dict.dictValue"
  157. />
  158. </el-select>
  159. </el-form-item>
  160. <el-form-item label="标签" prop="tagIds">
  161. <div @click="hangleChangeTags()" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">
  162. <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
  163. <el-tag type="success"
  164. closable
  165. :disable-transitions="false"
  166. v-for="list in this.selectTags"
  167. :key="list.tagId"
  168. @close="handleCloseTags(list)"
  169. style="margin: 3px;"
  170. >{{list.name}}
  171. </el-tag>
  172. </div>
  173. </div>
  174. </el-form-item>
  175. <el-form-item label="排除标签" prop="outTagIds">
  176. <div @click="hangleChangeOutTags()"
  177. style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">
  178. <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
  179. <el-tag type="success"
  180. closable
  181. :disable-transitions="false"
  182. v-for="list in this.outSelectTags"
  183. :key="list.tagId"
  184. @close="handleCloseOutTags(list)"
  185. style="margin: 3px;"
  186. >{{ list.name }}
  187. </el-tag>
  188. </div>
  189. </div>
  190. </el-form-item>
  191. <el-form-item label="备注" prop="remark">
  192. <el-input
  193. v-model="queryParams.remark"
  194. placeholder="请输入备注"
  195. clearable
  196. size="small"
  197. @keyup.enter.native="handleQuery"
  198. />
  199. </el-form-item>
  200. <el-form-item label="添加时间" prop="createTime">
  201. <el-date-picker
  202. v-model="createTime"
  203. size="small"
  204. style="width: 240px"
  205. value-format="yyyy-MM-dd HH:mm:ss"
  206. type="datetimerange"
  207. range-separator="-"
  208. start-placeholder="开始日期"
  209. end-placeholder="结束日期"
  210. @change="change"
  211. ></el-date-picker>
  212. </el-form-item>
  213. <el-form-item label="流失时间" prop="lossTime">
  214. <el-date-picker clearable size="small"
  215. v-model="queryParams.lossTime"
  216. type="date"
  217. value-format="yyyy-MM-dd"
  218. placeholder="选择流失时间">
  219. </el-date-picker>
  220. </el-form-item>
  221. <el-form-item label="删除时间" prop="delTime">
  222. <el-date-picker clearable size="small"
  223. v-model="queryParams.delTime"
  224. type="date"
  225. value-format="yyyy-MM-dd"
  226. placeholder="选择删除时间">
  227. </el-date-picker>
  228. </el-form-item>
  229. <el-form-item label="是否下载APP" prop="isDownloadApp">
  230. <el-select v-model="queryParams.isDownloadApp" placeholder="请选择是否下载app" clearable size="small">
  231. <el-option label="是" :value="1" />
  232. <el-option label="否" :value="0" />
  233. </el-select>
  234. </el-form-item>
  235. <el-form-item>
  236. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  237. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  238. </el-form-item>
  239. </el-form>
  240. <el-row :gutter="10" class="mb8">
  241. <!-- <el-col :span="1.5">
  242. <el-button
  243. type="primary"
  244. plain
  245. icon="el-icon-plus"
  246. size="mini"
  247. @click="handleAdd"
  248. v-hasPermi="['qw:externalContact:add']"
  249. >同步</el-button>
  250. </el-col> -->
  251. <el-col :span="1.5">
  252. <el-button
  253. type="success"
  254. plain
  255. icon="el-icon-edit"
  256. size="mini"
  257. @click="handleBatchUpdateNotes"
  258. v-hasPermi="['qw:externalContact:edit']"
  259. >批量修改备注
  260. </el-button>
  261. </el-col>
  262. <el-col :span="1.5">
  263. <el-button
  264. type="success"
  265. plain
  266. icon="el-icon-edit"
  267. size="mini"
  268. @click="handleBatchUpdateNotesFilter"
  269. v-hasPermi="['qw:externalContact:edit']"
  270. >批量修改备注(筛选条件)
  271. </el-button>
  272. </el-col>
  273. <el-col :span="1.5">
  274. <el-button
  275. type="success"
  276. plain
  277. icon="el-icon-edit"
  278. size="mini"
  279. :disabled="single"
  280. @click="handleUpdate"
  281. v-hasPermi="['qw:externalContact:edit']"
  282. >修改备注</el-button>
  283. </el-col>
  284. <el-col :span="1.5">
  285. <el-button
  286. type="warning"
  287. plain
  288. icon="el-icon-download"
  289. size="mini"
  290. :loading="exportLoading"
  291. @click="handleExport"
  292. v-hasPermi="['qw:externalContact:export']"
  293. >导出</el-button>
  294. </el-col>
  295. <el-col :span="1.5">
  296. <el-button
  297. type="primary"
  298. plain
  299. size="mini"
  300. @click="addUserTag"
  301. v-hasPermi="['qw:externalContact:addTag']"
  302. >批量添加标签</el-button>
  303. </el-col>
  304. <el-col :span="1.5">
  305. <el-button
  306. type="primary"
  307. plain
  308. size="mini"
  309. @click="addUserTagFilter"
  310. v-hasPermi="['qw:externalContact:addTag']"
  311. >批量添加标签(筛选条件)</el-button>
  312. </el-col>
  313. <el-col :span="1.5">
  314. <el-button
  315. type="primary"
  316. plain
  317. size="mini"
  318. @click="delUserTag"
  319. v-hasPermi="['qw:externalContact:delTag']"
  320. >批量移除标签</el-button>
  321. </el-col>
  322. <el-col :span="1.5">
  323. <el-button
  324. type="primary"
  325. plain
  326. size="mini"
  327. @click="updateTalk"
  328. v-hasPermi="['qw:externalContactInfo:updateTalk']"
  329. >批量更改交流状态</el-button>
  330. </el-col>
  331. <!-- <el-col :span="1.5">-->
  332. <!-- <el-button-->
  333. <!-- type="primary"-->
  334. <!-- plain-->
  335. <!-- size="mini"-->
  336. <!-- @click="setUserCourseSop"-->
  337. <!-- v-hasPermi="['qw:externalContact:setCourseSop']"-->
  338. <!-- >批量设置课程SOP</el-button>-->
  339. <!-- </el-col>-->
  340. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  341. </el-row>
  342. <!-- <el-tabs type="card" v-model="isBindActiveName" @tab-click="handleClickX">-->
  343. <!-- <el-tab-pane label="全部" name="all"></el-tab-pane>-->
  344. <!-- <el-tab-pane label="已绑定CRM" name="isBind"></el-tab-pane>-->
  345. <!-- <el-tab-pane label="未绑定CRM" name="noBind"></el-tab-pane>-->
  346. <!-- </el-tabs>-->
  347. <el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
  348. <el-table-column type="selection" width="55" align="center" />
  349. <el-table-column label="企微客户ID" align="center" prop="id" />
  350. <el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">
  351. <template slot-scope="scope">
  352. <el-popover
  353. placement="right"
  354. title=""
  355. trigger="hover">
  356. <img slot="reference" :src="scope.row.avatar" width="60px">
  357. <img :src="scope.row.avatar" style="max-width: 200px;">
  358. </el-popover>
  359. </template>
  360. </el-table-column>
  361. <el-table-column label="企微客户名称" prop="name" width="110px"/>
  362. <el-table-column label="客户称呼" prop="stageStatus" width="110px"/>
  363. <el-table-column label="销售企微昵称" align="center" prop="qwUserName" width="120px"/>
  364. <el-table-column label="企微部门" align="center" prop="departmentName" width="120px"/>
  365. <el-table-column label="用户类别" align="center" prop="type">
  366. <template slot-scope="scope">
  367. <dict-tag :options="typeOptions" :value="scope.row.type"/>
  368. </template>
  369. </el-table-column>
  370. <el-table-column label="性别" align="center" prop="gender">
  371. <template slot-scope="scope">
  372. <dict-tag :options="genderOptions" :value="scope.row.gender"/>
  373. </template>
  374. </el-table-column>
  375. <el-table-column label="备注" align="center" prop="remark" />
  376. <el-table-column label="描述信息" align="center" prop="description" />
  377. <el-table-column label="标签" align="center" prop="tagIdsName" width="300px">
  378. <template slot-scope="scope">
  379. <div class="tag-container">
  380. <div class="tag-list">
  381. <el-tag
  382. v-for="name in scope.row.tagIdsName"
  383. :key="name"
  384. type="success"
  385. size="small"
  386. >
  387. {{ name }}
  388. </el-tag>
  389. </div>
  390. </div>
  391. </template>
  392. </el-table-column>
  393. <el-table-column label="流失风险" align="center" prop="attritionLevel">
  394. <template slot-scope="scope">
  395. <el-tag v-if="scope.row.attritionLevel == null" type="info">未分析</el-tag>
  396. <el-tag v-if="scope.row.attritionLevel === 0" type="info">未知</el-tag>
  397. <el-tag v-else-if="scope.row.attritionLevel === 1" type="success">无风险</el-tag>
  398. <el-tag v-else-if="scope.row.attritionLevel === 2" type="info">低风险</el-tag>
  399. <el-tag v-else-if="scope.row.attritionLevel === 3" type="warning">中风险</el-tag>
  400. <el-tag v-else-if="scope.row.attritionLevel === 4" type="danger">高风险</el-tag>
  401. </template>
  402. </el-table-column>
  403. <el-table-column label="意向度" align="center" prop="intentionDegree">
  404. <template slot-scope="scope">
  405. <el-tag v-if="scope.row.intentionDegree !== null && scope.row.intentionDegree !== undefined && scope.row.intentionDegree !== ''">
  406. {{ scope.row.intentionDegree }}
  407. </el-tag>
  408. <span v-else>-</span>
  409. </template>
  410. </el-table-column>
  411. <el-table-column label="关注点" align="center" prop="customerFocusJson" width="220">
  412. <template slot-scope="scope">
  413. <div v-if="parseFocusPoints(scope.row.customerFocusJson).length" style="text-align: left;">
  414. <el-tooltip
  415. v-for="(item, index) in parseFocusPoints(scope.row.customerFocusJson).slice(0, 2)"
  416. :key="index"
  417. placement="top"
  418. effect="light"
  419. >
  420. <div slot="content" style="max-width: 420px; word-break: break-word;">
  421. {{ item }}
  422. </div>
  423. <el-tag style="margin: 0 6px 6px 0; max-width: 100%; background: #fff; border: 1px solid #dcdfe6; color: #606266;">
  424. {{ shortenText(item, 14) }}
  425. </el-tag>
  426. </el-tooltip>
  427. <el-tooltip
  428. v-if="parseFocusPoints(scope.row.customerFocusJson).length > 2"
  429. placement="top"
  430. effect="light"
  431. >
  432. <div slot="content" style="max-width: 420px;">
  433. <div
  434. v-for="(item, idx) in parseFocusPoints(scope.row.customerFocusJson).slice(2)"
  435. :key="'focus-more-' + idx"
  436. style="margin-bottom: 4px;"
  437. >
  438. {{ item }}
  439. </div>
  440. </div>
  441. <el-tag style="margin: 0 6px 6px 0; background: #fff; border: 1px solid #dcdfe6; color: #606266;">
  442. +{{ parseFocusPoints(scope.row.customerFocusJson).length - 2 }}
  443. </el-tag>
  444. </el-tooltip>
  445. </div>
  446. <span v-else>-</span>
  447. </template>
  448. </el-table-column>
  449. <el-table-column label="是否回复" align="center" prop="isReply" width="120px" >
  450. <template slot-scope="scope">
  451. <span v-if="scope.row.isReply === 1"><el-tag type="success">已回复</el-tag></span>
  452. <span v-else-if="scope.row.isReply === 0"><el-tag type="info">未回复</el-tag></span>
  453. <span v-else>{{ scope.row.isReply }}</span>
  454. </template>
  455. </el-table-column>
  456. <el-table-column label="状态" align="center" prop="status" width="120px" >
  457. <template slot-scope="scope">
  458. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  459. </template>
  460. </el-table-column>
  461. <el-table-column label="客户等级" align="center" prop="level" width="120px" >
  462. <template slot-scope="scope">
  463. <dict-tag :options="ratingType" :value="scope.row.level"/>
  464. </template>
  465. </el-table-column>
  466. <el-table-column label="state参数" align="center" prop="state" width="100px" />
  467. <el-table-column label="等级状态" align="center" prop="levelType" width="120px" >
  468. <template slot-scope="scope">
  469. <dict-tag :options="ratingUpFall" :value="scope.row.levelType"/>
  470. </template>
  471. </el-table-column>
  472. <el-table-column label="添加时间" align="center" prop="createTime" width="100px" />
  473. <el-table-column label="流失时间" align="center" prop="lossTime" width="100px" />
  474. <el-table-column label="删除时间" align="center" prop="delTime" width="100px" />
  475. <el-table-column label="注册时间" align="center" prop="registerTime" width="100px" />
  476. <el-table-column label="备注电话号码" align="center" prop="remarkMobiles" width="150px">
  477. <template slot-scope="scope">
  478. <div v-for="i in JSON.parse(scope.row.remarkMobiles)" :key="i">{{i}}</div>
  479. </template>
  480. </el-table-column>
  481. <el-table-column label="备注企业名称" align="center" prop="remarkCorpName" />
  482. <el-table-column label="来源" align="center" prop="addWay" width="100px">
  483. <template slot-scope="scope">
  484. <dict-tag :options="addWayOptions" :value="scope.row.addWay"/>
  485. </template>
  486. </el-table-column>
  487. <el-table-column label="转接状态" align="center" prop="transferStatus" width="100px" >
  488. <template slot-scope="scope">
  489. <dict-tag :options="transferStatusOptions" :value="scope.row.transferStatus"/>
  490. </template>
  491. </el-table-column>
  492. <el-table-column label="企业id" align="center" prop="corpId" />
  493. <el-table-column label="广告业务ID" align="center" prop="traceId" />
  494. <el-table-column label="重粉看课历史" width="100px" align="center" fixed="right">
  495. <template slot-scope="scope">
  496. <div v-if="scope.row.fsUserId">
  497. <el-tag type="success" v-if="scope.row.userRepeat == 0">正常</el-tag>
  498. <el-tag type="danger" v-if="scope.row.userRepeat == 1">重粉</el-tag>
  499. <el-button
  500. size="mini"
  501. type="text"
  502. @click="showLog(scope.row)"
  503. >重粉看课历史
  504. </el-button>
  505. </div>
  506. </template>
  507. </el-table-column>
  508. <el-table-column label="是否绑定会员" width="100px" align="center" fixed="right">
  509. <template slot-scope="scope">
  510. <el-tag v-if="scope.row.fsUserId" >已绑定<br/>{{scope.row.fsUserId}}</el-tag>
  511. <el-tag v-else type="info"> 未绑定</el-tag>
  512. </template>
  513. </el-table-column>
  514. <el-table-column label="是否下载APP" width="100px" align="center" fixed="right">
  515. <template slot-scope="scope">
  516. <el-tag :type="scope.row.isDownloadApp === 1 ? 'success' : 'info'">
  517. {{ scope.row.isDownloadApp === 1 ? '已下载' : '未下载' }}
  518. </el-tag>
  519. </template>
  520. </el-table-column>
  521. <el-table-column label="重粉记录" align="center" width="100px" fixed="right">
  522. <template slot-scope="scope">
  523. <el-button
  524. size="mini"
  525. type="text"
  526. @click="showRepeatRecord(scope.row)"
  527. >重粉记录</el-button>
  528. </template>
  529. </el-table-column>
  530. <el-table-column label="修改" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
  531. <template slot-scope="scope">
  532. <el-button
  533. size="mini"
  534. type="text"
  535. icon="el-icon-edit"
  536. :disabled="!scope.row.fsUserId"
  537. @click="handleCreateOrder(scope.row)"
  538. v-hasPermi="['qw:externalContact:edit']"
  539. >制单</el-button>
  540. <el-button
  541. v-if="scope.row.status==0||scope.row.status==2"
  542. size="mini"
  543. type="text"
  544. icon="el-icon-edit"
  545. @click="handleUpdate(scope.row)"
  546. v-hasPermi="['qw:externalContact:edit']"
  547. >修改备注</el-button>
  548. <el-button
  549. size="mini"
  550. type="text"
  551. icon="el-icon-user-solid"
  552. @click="handleAppellation(scope.row)"
  553. >修改客户称呼</el-button>
  554. </template>
  555. </el-table-column>
  556. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
  557. <template slot-scope="scope">
  558. <!-- <el-button-->
  559. <!-- size="mini"-->
  560. <!-- type="text"-->
  561. <!-- icon="el-icon-edit-outline"-->
  562. <!-- @click="handleUpdateCustomer(scope.row)"-->
  563. <!-- >-->
  564. <!-- <span v-if="scope.row.customerId">换绑CRM</span>-->
  565. <!-- <span v-else>绑定CRM</span>-->
  566. <!-- </el-button>-->
  567. <el-button
  568. size="mini"
  569. type="text"
  570. icon="el-icon-edit-outline"
  571. @click="handleUpdateUser(scope.row)"
  572. >
  573. <span v-if="scope.row.fsUserId">换绑会员</span>
  574. <span v-else>绑定会员</span>
  575. </el-button>
  576. <el-button
  577. v-if="scope.row.fsUserId"
  578. size="mini"
  579. type="text"
  580. icon="el-icon-thumb"
  581. @click="handleUnBindUserId(scope.row)"
  582. v-hasPermi="['qw:externalContact:unBindUserId']"
  583. >
  584. <span>解除会员绑定</span>
  585. </el-button>
  586. <!-- <el-button v-if="scope.row.customerId"-->
  587. <!-- size="mini"-->
  588. <!-- type="text"-->
  589. <!-- icon="el-icon-paperclip"-->
  590. <!-- @click="handleShow(scope.row)"-->
  591. <!-- >CRM客户详情</el-button>-->
  592. <el-button
  593. size="mini"
  594. type="text"
  595. @click="handledetails(scope.row)"
  596. >AI获取用户信息
  597. </el-button>
  598. <el-button
  599. size="mini"
  600. type="text"
  601. @click="handleMemberdetails(scope.row)"
  602. v-if="scope.row.fsUserId"
  603. >
  604. <span>会员详情</span>
  605. </el-button>
  606. <el-button
  607. size="mini"
  608. type="text"
  609. @click="handleInfoCollection(scope.row)"
  610. v-if="false"
  611. >
  612. <span>信息采集</span>
  613. </el-button>
  614. <el-button
  615. size="mini"
  616. type="text"
  617. icon="el-icon-edit"
  618. @click="handleChangeStatus(scope.row)"
  619. v-hasPermi="['qw:externalContact:changeStatus']"
  620. >
  621. 修改状态
  622. </el-button>
  623. <el-button
  624. v-if="scope.row.attritionLevel !== null && scope.row.attritionLevel !== undefined"
  625. size="mini"
  626. type="text"
  627. @click="openAiDrawer(scope.row)"
  628. v-hasPermi="['qw:externalContact:analyze:list']"
  629. >AI 分析</el-button>
  630. </template>
  631. </el-table-column>
  632. </el-table>
  633. <pagination
  634. v-show="total>0"
  635. :total="total"
  636. :page.sync="queryParams.pageNum"
  637. :limit.sync="queryParams.pageSize"
  638. @pagination="getList"
  639. />
  640. <el-drawer
  641. size="75%"
  642. :title="aiAnalyze.title"
  643. :visible.sync="aiAnalyze.open"
  644. append-to-body
  645. >
  646. <customer-detail
  647. ref="customerAiDetail"
  648. :analyze-user-id="aiAnalyze.userId"
  649. :analyze-external-user-id="aiAnalyze.externalUserId"
  650. :analyze-corp-id="aiAnalyze.corpId"
  651. :customer-row="aiAnalyze.customerRow"
  652. />
  653. </el-drawer>
  654. <el-drawer size="75%" :title="show.title" :visible.sync="show.open">
  655. <customer-details ref="customerDetails" @refreshList="refreshList"/>
  656. </el-drawer>
  657. <el-drawer
  658. :with-header="false"
  659. size="75%"
  660. :title="show.title" :visible.sync="show.open">
  661. <userDetails ref="userDetails" />
  662. </el-drawer>
  663. <!-- 搜索标签 -->
  664. <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" style="width:100%;height: 100%" append-to-body>
  665. <div>搜索标签:
  666. <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  667. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>
  668. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  669. </div>
  670. <div v-for="item in tagGroupList" :key="item.id" >
  671. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  672. <span class="name-background">{{ item.name }}</span>
  673. </div>
  674. <!-- 添加外层滚动容器 -->
  675. <div class="scroll-wrapper">
  676. <div class="tag-container">
  677. <a
  678. v-for="tagItem in item.tag"
  679. class="tag-box"
  680. @click="tagSelection(tagItem)"
  681. :class="{ 'tag-selected': tagItem.isSelected }"
  682. >
  683. {{ tagItem.name }}
  684. </a>
  685. </div>
  686. </div>
  687. </div>
  688. <pagination
  689. v-show="tagTotal>0"
  690. :total="tagTotal"
  691. :page.sync="queryTagParams.pageNum"
  692. :limit.sync="queryTagParams.pageSize"
  693. @pagination="getPageListTagGroup"
  694. />
  695. <div slot="footer" class="dialog-footer">
  696. <el-button type="primary" @click="tagSubmitForm(changeTagDialog.type)">确 定</el-button>
  697. <el-button @click="tagCancel(changeTagDialog.type)">取消</el-button>
  698. </div>
  699. </el-dialog>
  700. <el-dialog title="批量添加标签" :visible.sync="tagOpen" width="800px" append-to-body>
  701. <div>搜索标签:
  702. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  703. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  704. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  705. </div>
  706. <el-form ref="form" :model="addTagForm" label-width="80px">
  707. <div v-for="item in tagGroupList" :key="item.id" >
  708. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  709. <span class="name-background">{{ item.name }}</span>
  710. </div>
  711. <!-- 添加外层滚动容器 -->
  712. <div class="scroll-wrapper">
  713. <div class="tag-container">
  714. <a
  715. v-for="tagItem in item.tag"
  716. class="tag-box"
  717. @click="tagSelection(tagItem)"
  718. :class="{ 'tag-selected': tagItem.isSelected }"
  719. >
  720. {{ tagItem.name }}
  721. </a>
  722. </div>
  723. </div>
  724. </div>
  725. </el-form>
  726. <pagination
  727. v-show="tagTotal>0"
  728. :total="tagTotal"
  729. :page.sync="queryTagParams.pageNum"
  730. :limit.sync="queryTagParams.pageSize"
  731. @pagination="getPageListTagGroup"
  732. />
  733. <div slot="footer" class="dialog-footer">
  734. <el-button type="primary" @click="addTagSubmitForm()">确 定</el-button>
  735. <el-button @click="addTagCancel">取 消</el-button>
  736. </div>
  737. </el-dialog>
  738. <el-dialog title="批量添加客户备注" :visible.sync="notesOpen.open" width="800px" append-to-body>
  739. <el-card>
  740. <el-row>
  741. <el-col>
  742. <el-radio-group v-model="notesOpen.nameType" style="margin-bottom: 2%">
  743. <el-radio :label="1">
  744. 客户名称添加在【新备注】【前】
  745. </el-radio>
  746. <el-radio :label="2">
  747. 客户名称添加在【新备注】【后】
  748. </el-radio>
  749. <el-radio :label="3">
  750. 不添加客户名称
  751. </el-radio>
  752. </el-radio-group>
  753. </el-col>
  754. <el-col>
  755. <el-radio-group v-model="notesOpen.type">
  756. <el-radio
  757. :label="1"
  758. >添加【新备注】在最【前】面
  759. </el-radio>
  760. <el-radio
  761. :label="2"
  762. >添加【新备注】在最【后】面
  763. </el-radio>
  764. <el-radio
  765. :label="3"
  766. >替换所有备注
  767. </el-radio>
  768. </el-radio-group>
  769. </el-col>
  770. <el-col>
  771. <el-input v-model="notesOpen.notes" placeholder="请输入客户备注(最多20个字,含已有的)" clearable size="small"
  772. maxlength="20" show-word-limit style="width: 500px;margin-top: 3%"/>
  773. <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
  774. <i class="el-icon-info"></i>
  775. 由于企业微信官方限制,备注最多20个字,且自动会去除末尾超出的字
  776. </div>
  777. </el-col>
  778. </el-row>
  779. </el-card>
  780. <div slot="footer" class="dialog-footer">
  781. <el-button type="primary" @click="notesSubmitForm()">确 定</el-button>
  782. <el-button @click="notesCancel()">取消</el-button>
  783. </div>
  784. </el-dialog>
  785. <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
  786. <div>搜索标签:
  787. <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  788. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>
  789. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  790. </div>
  791. <el-form ref="form" :model="addTagForm" label-width="80px">
  792. <div v-for="item in tagGroupList" :key="item.id" >
  793. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  794. <span class="name-background">{{ item.name }}</span>
  795. </div>
  796. <!-- 添加外层滚动容器 -->
  797. <div class="scroll-wrapper">
  798. <div class="tag-container">
  799. <a
  800. v-for="tagItem in item.tag"
  801. class="tag-box"
  802. @click="tagSelection(tagItem)"
  803. :class="{ 'tag-selected': tagItem.isSelected }"
  804. >
  805. {{ tagItem.name }}
  806. </a>
  807. </div>
  808. </div>
  809. </div>
  810. </el-form>
  811. <pagination
  812. v-show="tagTotal>0"
  813. :total="tagTotal"
  814. :page.sync="queryTagParams.pageNum"
  815. :limit.sync="queryTagParams.pageSize"
  816. @pagination="getPageListTagGroup"
  817. />
  818. <div slot="footer" class="dialog-footer">
  819. <el-button type="primary" @click="tagDelSubmitForm()">确 定</el-button>
  820. <el-button @click="DelTagCancel">取 消</el-button>
  821. </div>
  822. </el-dialog>
  823. <!-- 添加或修改企业微信客户对话框 -->
  824. <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
  825. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  826. <el-form-item label="备注" prop="remark">
  827. <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
  828. </el-form-item>
  829. <el-form-item label="描述信息" prop="description">
  830. <el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述信息" />
  831. </el-form-item>
  832. <el-form-item label="备注电话号码" prop="remarkMobiles">
  833. <el-tag
  834. :key="tag"
  835. v-for="tag in remarkMobiles"
  836. closable
  837. :disable-transitions="false"
  838. @close="handleClose(tag)">
  839. {{tag}}
  840. </el-tag>
  841. <el-input
  842. style="width:110px"
  843. class="input-new-tag"
  844. v-if="inputVisible"
  845. v-model="inputValue"
  846. ref="saveTagInput"
  847. size="small"
  848. @keyup.enter.native="handleInputConfirm"
  849. @blur="handleInputConfirm"
  850. >
  851. </el-input>
  852. <el-button v-else class="button-new-tag" size="small" style="width: 110px" @click="showInput">新增电话</el-button>
  853. </el-form-item>
  854. <el-form-item label="备注企业名称" prop="remarkCorpName">
  855. <el-input v-model="form.remarkCorpName" placeholder="请输入备注企业名称" />
  856. </el-form-item>
  857. </el-form>
  858. <div slot="footer" class="dialog-footer">
  859. <el-button type="primary" @click="submitForm">确 定</el-button>
  860. <el-button @click="cancel">取 消</el-button>
  861. </div>
  862. </el-dialog>
  863. <el-dialog :title="callOpen.title" :visible.sync="callOpen.open" width="500px" append-to-body>
  864. <el-form ref="callOpenFrom" :model="callOpenFrom" :rules="callOpenRule" label-width="110px">
  865. <el-form-item label="客户称呼" prop="stageStatus">
  866. <el-input v-model="callOpenFrom.stageStatus" placeholder="请输入客户称呼" />
  867. </el-form-item>
  868. </el-form>
  869. <div slot="footer" class="dialog-footer" >
  870. <el-button type="primary" @click="submitCallOpenFrom">确 定</el-button>
  871. </div>
  872. </el-dialog>
  873. <!-- 绑定客户 -->
  874. <el-dialog :title="bindCustomer.title" :visible.sync="bindCustomer.open" width="1200px" append-to-body>
  875. <mycustomer ref="mycustomer" @bindCustomerId="bindCustomerId"></mycustomer>
  876. </el-dialog>
  877. <!-- 重粉看课记录 -->
  878. <el-drawer title="重粉看课历史" :visible.sync="log.open" size="75%" append-to-body>
  879. <div style="padding: 10px">
  880. <el-form :model="log.queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  881. <el-form-item label="所属项目" prop="project">
  882. <el-select v-model="log.queryParams.project" placeholder="请选择项目" filterable clearable size="small">
  883. <el-option
  884. v-for="dict in projectOptions"
  885. :key="dict.dictValue"
  886. :label="dict.dictLabel"
  887. :value="dict.dictValue"
  888. />
  889. </el-select>
  890. </el-form-item>
  891. <el-form-item label="课程" prop="courseId">
  892. <el-select filterable v-model="log.queryParams.courseId" placeholder="请选择课程" clearable size="small"
  893. @change="courseChange(log.queryParams.courseId)">
  894. <el-option
  895. v-for="dict in courseLists"
  896. :key="dict.dictValue"
  897. :label="dict.dictLabel"
  898. :value="dict.dictValue"
  899. />
  900. </el-select>
  901. </el-form-item>
  902. <el-form-item label="小节" prop="videoId">
  903. <el-select filterable v-model="log.queryParams.videoId" placeholder="请选择小节" clearable size="small">
  904. <el-option
  905. v-for="dict in videoList"
  906. :key="dict.dictValue"
  907. :label="dict.dictLabel"
  908. :value="dict.dictValue"
  909. />
  910. </el-select>
  911. </el-form-item>
  912. <el-form-item>
  913. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryWatchLog">搜索</el-button>
  914. </el-form-item>
  915. </el-form>
  916. <el-table v-loading="log.loading" :data="log.list">
  917. <el-table-column label="编号" align="center" prop="id"/>
  918. <el-table-column label="所属企微主体" align="center" prop="corpName"/>
  919. <el-table-column label="所属企微" align="center" prop="qwUserName"/>
  920. <!-- <el-table-column label="企微" align="center" prop="qwUserName"/>-->
  921. <el-table-column label="项目" align="center" prop="projectName"/>
  922. <el-table-column label="课程" align="center" prop="courseName"/>
  923. <el-table-column label="小节" align="aligner" prop="videoName"/>
  924. <el-table-column label="记录时间" align="center" prop="createTime"/>
  925. <el-table-column label="是否完课" align="center" prop="logType">
  926. <template slot-scope="scope">
  927. <el-tag v-if="scope.row.logType == 2" type="success">已完课</el-tag>
  928. <el-tag v-else type="success">未完课</el-tag>
  929. </template>
  930. </el-table-column>
  931. <el-table-column label="完课时间" align="center" prop="finishTime"/>
  932. </el-table>
  933. <pagination
  934. v-show="log.total>0"
  935. :total="log.total"
  936. :page.sync="log.queryParams.pageNum"
  937. :limit.sync="log.queryParams.pageSize"
  938. @pagination="logList"
  939. />
  940. </div>
  941. </el-drawer>
  942. <!-- 重粉记录 -->
  943. <el-drawer title="重粉记录" :visible.sync="repeatRecord.open" size="75%" append-to-body>
  944. <div style="padding: 10px">
  945. <el-form :model="repeatRecord.queryParams" ref="repeatRecordQueryForm" :inline="true" label-width="110px">
  946. <el-form-item label="销售企微ID" prop="qwUserId">
  947. <el-input
  948. v-model="repeatRecord.queryParams.qwUserId"
  949. placeholder="请输入销售企微ID"
  950. clearable
  951. size="small"
  952. @keyup.enter.native="handleQueryRepeatRecord"
  953. />
  954. </el-form-item>
  955. <el-form-item label="销售企微昵称" prop="qwUserName">
  956. <el-input
  957. v-model="repeatRecord.queryParams.qwUserName"
  958. placeholder="请输入销售企微昵称"
  959. clearable
  960. size="small"
  961. @keyup.enter.native="handleQueryRepeatRecord"
  962. />
  963. </el-form-item>
  964. <el-form-item>
  965. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryRepeatRecord">搜索</el-button>
  966. <el-button icon="el-icon-refresh" size="mini" @click="resetRepeatRecordQuery">重置</el-button>
  967. </el-form-item>
  968. </el-form>
  969. <el-table v-loading="repeatRecord.loading" :data="repeatRecord.list" border>
  970. <el-table-column label="企微客户ID" align="center" prop="externalUserId" min-width="140" />
  971. <el-table-column label="企微客户昵称" align="center" prop="externalUserName" min-width="120" />
  972. <el-table-column label="销售企微ID" align="center" prop="qwUserId" min-width="120" />
  973. <el-table-column label="销售企微昵称" align="center" prop="qwUserName" min-width="120" />
  974. <el-table-column label="企微部门" align="center" prop="deptName" min-width="120" />
  975. <el-table-column label="添加时间" align="center" prop="createTime" width="170" />
  976. <el-table-column label="注册时间" align="center" prop="registerTime" width="170" />
  977. </el-table>
  978. <pagination
  979. v-show="repeatRecord.total > 0"
  980. :total="repeatRecord.total"
  981. :page.sync="repeatRecord.queryParams.pageNum"
  982. :limit.sync="repeatRecord.queryParams.pageSize"
  983. @pagination="repeatRecordList"
  984. />
  985. </div>
  986. </el-drawer>
  987. <!-- 设置一个课程sop-->
  988. <el-dialog :title="setSop.title" :visible.sync="setSop.open" width="1200px" append-to-body>
  989. <SopDialog ref="SopDialog" @bindCourseSop="bindCourseSop"></SopDialog>
  990. </el-dialog>
  991. <el-dialog :title="user.title" :visible.sync="user.open" width="800px" append-to-body>
  992. <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>
  993. </el-dialog>
  994. <el-dialog :title="info.title" :visible.sync="info.open" width="1100px" append-to-body>
  995. <info ref="Details" />
  996. </el-dialog>
  997. <el-dialog :title="collection.title" :visible.sync="collection.open" width="1100px" append-to-body>
  998. <collection ref="collection" />
  999. </el-dialog>
  1000. <!-- 制单页面组件 -->
  1001. <create-oder ref="createOder" />
  1002. <el-dialog title="修改客户状态" :visible.sync="statusDialog.open" width="500px" append-to-body>
  1003. <el-form ref="statusForm" :model="statusForm" :rules="statusRules" label-width="100px">
  1004. <el-form-item label="状态" prop="status">
  1005. <el-select v-model="statusForm.status" placeholder="请选择状态" size="small">
  1006. <el-option
  1007. v-for="dict in statusOptions"
  1008. :key="dict.dictValue"
  1009. :label="dict.dictLabel"
  1010. :value="dict.dictValue"
  1011. />
  1012. </el-select>
  1013. </el-form-item>
  1014. </el-form>
  1015. <div slot="footer" class="dialog-footer">
  1016. <el-button @click="statusDialog.open = false">取 消</el-button>
  1017. <el-button type="primary" @click="submitStatusForm">提 交</el-button>
  1018. </div>
  1019. </el-dialog>
  1020. </div>
  1021. </template>
  1022. <script>
  1023. import {
  1024. bindUserId,
  1025. addTag,
  1026. delTag,
  1027. batchUpdateExternalContactNotes,
  1028. listExternalContact,
  1029. getExternalContact,
  1030. delExternalContact,
  1031. addExternalContact,
  1032. updateExternalContact,
  1033. exportExternalContact,
  1034. editbindCustomer,
  1035. setCustomerCourseSop,
  1036. getCustomerCourseSop,
  1037. setCustomerCourseSopList,
  1038. unBindUserId, updateExternalContactCall,updateExternalContactStatus,getWatchLogList,getRepeatRecordList
  1039. } from '@/api/qw/externalContact'
  1040. import {getMyQwUserList, getMyQwCompanyList, updateUser,getQwUserListLikeName} from "@/api/qw/user";
  1041. import {listTag, getTag, searchTags} from "@/api/qw/tag";
  1042. import { allListTagGroup,allListTagGroupPage} from "@/api/qw/tagGroup";
  1043. import mycustomer from '@/views/qw/externalContact/mycustomer'
  1044. import customerDetails from '@/views/qw/externalContact/customerDetails'
  1045. import SopDialog from '@/views/course/sop/SopDialog.vue'
  1046. import selectUser from "@/views/qw/externalContact/selectUser.vue";
  1047. import collection from "@/views/qw/externalContact/collection.vue";
  1048. import info from "@/views/qw/externalContact/info.vue";
  1049. import { editTalk } from "@/api/qw/externalContactInfo";
  1050. import PaginationMore from "../../../components/PaginationMore/index.vue";
  1051. import userDetails from '@/views/store/components/userDetails.vue';
  1052. import {courseList, videoList} from "@/api/course/courseRedPacketLog";
  1053. import Collection from './collection.vue';
  1054. import customerDetail from './customerDetail.vue';
  1055. import createOder from '@/views/components/order/createOder.vue';
  1056. export default {
  1057. name: "ExternalContact",
  1058. components:{PaginationMore, mycustomer,customerDetails,customerDetail,SopDialog,selectUser,info,userDetails,collection,createOder},
  1059. data() {
  1060. return {
  1061. projectOptions: [],
  1062. courseLists: [],
  1063. videoList: [],
  1064. //重粉记录的参数
  1065. log: {
  1066. open: false,
  1067. loading: true,
  1068. list: [],
  1069. total: 0,
  1070. queryParams: {
  1071. pageNum: 1,
  1072. pageSize: 10,
  1073. externalUserId: null,
  1074. fsUserId: null,
  1075. projectId: null,
  1076. courseId: null,
  1077. videoId: null,
  1078. },
  1079. },
  1080. repeatRecord: {
  1081. open: false,
  1082. loading: false,
  1083. list: [],
  1084. total: 0,
  1085. queryParams: {
  1086. pageNum: 1,
  1087. pageSize: 10,
  1088. corpId: null,
  1089. externalUserId: null,
  1090. qwUserId: null,
  1091. qwUserName: null
  1092. }
  1093. },
  1094. statusDialog: {
  1095. open: false,
  1096. title: "修改客户状态"
  1097. },
  1098. statusForm: {
  1099. id: null,
  1100. status: null
  1101. },
  1102. statusRules: {
  1103. status: [
  1104. {required: true, message: '状态不能为空', trigger: 'change'}
  1105. ]
  1106. },
  1107. notesOpen: {
  1108. type: 1,
  1109. nameType: 3,
  1110. addType: 0,
  1111. filter: false,
  1112. open: false,
  1113. notes: null,
  1114. },
  1115. user:{
  1116. open:false,
  1117. title:"修改客户"
  1118. },
  1119. userForm:{
  1120. id:null,
  1121. fsUserId:null,
  1122. },
  1123. info:{
  1124. title:"用户信息",
  1125. open:false,
  1126. },
  1127. collection:{
  1128. titile:"信息采集",
  1129. open:false,
  1130. },
  1131. // ...其他已有数据
  1132. qwUserSuggestions: [], // 已展示的数据
  1133. showQwUserDropdown: false, // 控制下拉框显示
  1134. qwUserLoading: false, // 加载状态
  1135. qwUserNoMore: false, // 是否还有更多数据
  1136. qwUserPageNum: 1, // 当前页码
  1137. qwUserPageSize: 10, // 每页数量
  1138. qwUserTotal: 0, // 总数
  1139. isBindMiniOptions:[
  1140. {dictLabel:"已绑定",dictValue:'isBindMini'},
  1141. {dictLabel:"未绑定",dictValue:'noBindMini'},
  1142. ],
  1143. //标签弹窗选择
  1144. tagChange:{
  1145. open:false,
  1146. index:null,
  1147. },
  1148. sTime:null,
  1149. eTime:null,
  1150. createTime:null,
  1151. // 遮罩层
  1152. loading: false,
  1153. // 导出遮罩层
  1154. exportLoading: false,
  1155. tagOpen:false,
  1156. tagDelOpen:false,
  1157. // 选中数组
  1158. ids: [],
  1159. isBindActiveName:"all",
  1160. remarkMobiles: [],
  1161. inputVisible: false,
  1162. inputValue: '',
  1163. // 非单个禁用
  1164. single: true,
  1165. tagGroupList: [],
  1166. // 非多个禁用
  1167. multiple: true,
  1168. // 显示搜索条件
  1169. showSearch: true,
  1170. // 总条数
  1171. total: 0,
  1172. // 企业微信客户表格数据
  1173. externalContactList: [],
  1174. // 弹出层标题
  1175. title: "",
  1176. // 是否显示弹出层
  1177. open: false,
  1178. // 用户类别字典
  1179. typeOptions: [],
  1180. ratingType: [],
  1181. ratingUpFall: [],
  1182. // 性别字典
  1183. genderOptions: [],
  1184. addTagForm:{
  1185. userIds:[],
  1186. tagIds:[],
  1187. filter: false,
  1188. addType: 0,
  1189. },
  1190. myQwCompanyList:[],
  1191. show:{
  1192. title:"客户详情",
  1193. open:false,
  1194. },
  1195. //存储选择的客户
  1196. chooseCustomerSOP:null,
  1197. setSop:{
  1198. title:"选择课节SOP",
  1199. open:false,
  1200. //区分单选1还是多选2
  1201. type:null,
  1202. },
  1203. //合成的客户-课节SOP参数
  1204. customerCourseForm:{},
  1205. //查询是否已经设置过客户-某个课节的SOP
  1206. customerCourseFormLogs:{},
  1207. //绑定客户
  1208. bindCustomer:{
  1209. title:null,
  1210. open:false,
  1211. },
  1212. callOpen:{
  1213. open:false,
  1214. title: '修改客户称呼',
  1215. },
  1216. callOpenFrom:{
  1217. id:null,
  1218. stageStatus:null,
  1219. },
  1220. callOpenRule:{
  1221. stageStatus:[{required:true,message:"员工称呼不能为空",trigger:"blur"}]
  1222. },
  1223. //绑定的参数表
  1224. qwFormCustomer:{
  1225. externalContactId:null,
  1226. customerId:null,
  1227. },
  1228. // 来源字典
  1229. addWayOptions: [],
  1230. //标签
  1231. changeTagDialog:{
  1232. title:"",
  1233. open:false,
  1234. type: null,
  1235. },
  1236. queryTagParams:{
  1237. pageNum: 1,
  1238. pageSize: 5,
  1239. total:0,
  1240. name:null,
  1241. corpId:null,
  1242. },
  1243. tagTotal:0,
  1244. tagFilter:false,
  1245. // 查询参数
  1246. queryParams: {
  1247. pageNum: 1,
  1248. pageSize: 10,
  1249. userId: null,
  1250. qwUserName:null,
  1251. externalUserId: null,
  1252. name: null,
  1253. avatar: null,
  1254. type: null,
  1255. qwUserId:null,
  1256. gender: null,
  1257. description: null,
  1258. tagIds: null,
  1259. outTagIds: null,
  1260. remark:null,
  1261. remarkMobiles: null,
  1262. remarkCorpName: null,
  1263. addWay: null,
  1264. operUserid: null,
  1265. corpId: null,
  1266. companyId: null,
  1267. status:null,
  1268. transferStatus:null,
  1269. isBind:null,
  1270. isBindMini:null,
  1271. lossTime:null,
  1272. sTime:null,
  1273. eTime:null,
  1274. createTime:null,
  1275. level:null,
  1276. wayId:null,
  1277. levelType:null,
  1278. companyUser:null,
  1279. userRepeat: null,
  1280. delTime: null,
  1281. isDownloadApp: null
  1282. },
  1283. //选择的标签
  1284. selectTags:[],
  1285. //排除的标签
  1286. outSelectTags:[],
  1287. // 表单参数
  1288. form: {},
  1289. tagList:[],
  1290. transferStatusOptions:[],
  1291. statusOptions:[],
  1292. // 表单校验
  1293. rules: {
  1294. },
  1295. userId:null,
  1296. aiAnalyze: {
  1297. title: "AI 分析",
  1298. open: false,
  1299. userId: null,
  1300. externalUserId: null,
  1301. corpId: null,
  1302. customerRow: null,
  1303. },
  1304. };
  1305. },
  1306. created() {
  1307. this.getDicts("sys_course_project").then(response => {
  1308. this.projectOptions = response.data;
  1309. });
  1310. this.getDicts("sys_qw_externalContact_type").then(response => {
  1311. this.typeOptions = response.data;
  1312. });
  1313. this.getDicts("sys_qw_sop_rating_type").then(response => {
  1314. this.ratingType = response.data;
  1315. });
  1316. this.getDicts("sys_qw_sop_rating_upFall").then(response => {
  1317. this.ratingUpFall = response.data;
  1318. });
  1319. getMyQwCompanyList().then(response => {
  1320. this.myQwCompanyList = response.data;
  1321. if(this.myQwCompanyList!=null){
  1322. this.queryParams.corpId=this.myQwCompanyList[0].dictValue
  1323. var listTagFrom={corpId:this.queryParams.corpId}
  1324. listTag(listTagFrom).then(response => {
  1325. this.tagList = response.rows;
  1326. });
  1327. this.getList();
  1328. }
  1329. });
  1330. this.getDicts("sys_sex").then(response => {
  1331. this.genderOptions = response.data;
  1332. });
  1333. this.getDicts("sys_qw_externalContact_addWay").then(response => {
  1334. this.addWayOptions = response.data;
  1335. });
  1336. this.getDicts("sys_qw_external_contact_status").then(response => {
  1337. this.statusOptions = response.data;
  1338. });
  1339. this.getDicts("sys_qw_transfer_status").then(response => {
  1340. this.transferStatusOptions = response.data;
  1341. });
  1342. },
  1343. methods: {
  1344. handleCreateOrder(row) {
  1345. this.$refs.createOder.show(row);
  1346. },
  1347. shortenText(text, maxLen = 16) {
  1348. const str = text == null ? '' : String(text);
  1349. if (str.length <= maxLen) return str;
  1350. return str.slice(0, maxLen) + '...';
  1351. },
  1352. parseFocusPoints(value) {
  1353. if (!value) return [];
  1354. if (Array.isArray(value)) {
  1355. return value.map(item => String(item).trim()).filter(Boolean);
  1356. }
  1357. if (typeof value === 'string') {
  1358. const raw = value.trim();
  1359. if (!raw) return [];
  1360. try {
  1361. const parsed = JSON.parse(raw);
  1362. if (Array.isArray(parsed)) {
  1363. return parsed.map(item => String(item).trim()).filter(Boolean);
  1364. }
  1365. if (typeof parsed === 'string') {
  1366. return [parsed.trim()].filter(Boolean);
  1367. }
  1368. } catch (e) {
  1369. // ignore parse error and use raw fallback
  1370. }
  1371. return [raw.replace(/^\[|\]$/g, '').replace(/["']/g, '').trim()].filter(Boolean);
  1372. }
  1373. return [String(value).trim()].filter(Boolean);
  1374. },
  1375. openAiDrawer(row) {
  1376. this.aiAnalyze.userId = row.userId;
  1377. this.aiAnalyze.externalUserId = row.operUserid ;
  1378. this.aiAnalyze.corpId = row.corpId ;
  1379. this.aiAnalyze.customerRow = row;
  1380. this.aiAnalyze.open = true;
  1381. },
  1382. /** 重粉查看操作 */
  1383. showLog(row) {
  1384. this.log.queryParams.fsUserId = row.fsUserId;
  1385. this.log.open = true;
  1386. this.log.loading = true;
  1387. courseList().then(response => {
  1388. this.courseLists = response.list;
  1389. this.logList();
  1390. })
  1391. },
  1392. handleQueryWatchLog() {
  1393. this.log.queryParams.pageNum = 1;
  1394. this.log.queryParams.pageSize = 10;
  1395. this.logList();
  1396. },
  1397. logList() {
  1398. getWatchLogList(this.log.queryParams).then(e => {
  1399. this.log.loading = false;
  1400. this.log.list = e.rows;
  1401. this.log.total = e.total;
  1402. });
  1403. },
  1404. /** 重粉记录 */
  1405. showRepeatRecord(row) {
  1406. this.repeatRecord.queryParams.corpId = row.corpId;
  1407. this.repeatRecord.queryParams.externalUserId = row.externalUserId;
  1408. this.repeatRecord.queryParams.qwUserId = null;
  1409. this.repeatRecord.queryParams.qwUserName = null;
  1410. this.repeatRecord.queryParams.pageNum = 1;
  1411. this.repeatRecord.queryParams.pageSize = 10;
  1412. this.repeatRecord.open = true;
  1413. this.repeatRecordList();
  1414. },
  1415. handleQueryRepeatRecord() {
  1416. this.repeatRecord.queryParams.pageNum = 1;
  1417. this.repeatRecordList();
  1418. },
  1419. resetRepeatRecordQuery() {
  1420. this.repeatRecord.queryParams.qwUserId = null;
  1421. this.repeatRecord.queryParams.qwUserName = null;
  1422. this.repeatRecord.queryParams.pageNum = 1;
  1423. this.repeatRecordList();
  1424. },
  1425. repeatRecordList() {
  1426. this.repeatRecord.loading = true;
  1427. getRepeatRecordList(this.repeatRecord.queryParams).then(res => {
  1428. this.repeatRecord.list = res.rows || [];
  1429. this.repeatRecord.total = res.total || 0;
  1430. }).finally(() => {
  1431. this.repeatRecord.loading = false;
  1432. });
  1433. },
  1434. courseChange(row) {
  1435. this.log.queryParams.videoId = null;
  1436. if (row === '') {
  1437. this.videoList = [];
  1438. return
  1439. }
  1440. videoList(row).then(response => {
  1441. this.videoList = response.list
  1442. });
  1443. },
  1444. handleMemberdetails(row){
  1445. this.show.open=true;
  1446. setTimeout(() => {
  1447. this.$refs.userDetails.getDetails(row.fsUserId);
  1448. }, 1);
  1449. },
  1450. handleInfoCollection(row){
  1451. this.collection.title = "信息采集";
  1452. this.collection.open = true;
  1453. this.userId = row.fsUserId;
  1454. setTimeout(() => {
  1455. this.$refs.collection.getCollectionInfo(row.fsUserId);
  1456. }, 1);
  1457. },
  1458. closeCollection(){
  1459. this.collection.open = false;
  1460. },
  1461. onQwUserNameClear() {
  1462. this.queryParams.qwUserId = null; // 同时清空 qwUserId
  1463. },
  1464. // 搜索企微用户
  1465. searchQwUser(query) {
  1466. if (!query.trim()) {
  1467. this.qwUserSuggestions = [];
  1468. this.showQwUserDropdown = false;
  1469. this.qwUserNoMore = false;
  1470. this.qwUserPageNum = 1;
  1471. return;
  1472. }
  1473. this.queryParams.qwUserName = query;
  1474. this.qwUserPageNum = 1;
  1475. this.qwUserNoMore = false;
  1476. this.qwUserSuggestions = [];
  1477. this.fetchQwUsers(query);
  1478. },
  1479. fetchQwUsers(query) {
  1480. const params = {
  1481. qwUserName: query,
  1482. pageNum: this.qwUserPageNum,
  1483. pageSize: this.qwUserPageSize
  1484. };
  1485. this.qwUserLoading = true;
  1486. getQwUserListLikeName(params).then(res => {
  1487. const list = res.data.list || [];
  1488. const total = res.data.total || 0;
  1489. this.qwUserSuggestions = [...this.qwUserSuggestions, ...list];
  1490. this.qwUserTotal = total;
  1491. // 判断是否还有更多数据
  1492. if (this.qwUserSuggestions.length >= total) {
  1493. this.qwUserNoMore = true;
  1494. }
  1495. this.showQwUserDropdown = true;
  1496. }).finally(() => {
  1497. this.qwUserLoading = false;
  1498. });
  1499. },
  1500. // 选择企微用户
  1501. selectQwUser(key,value) {
  1502. this.queryParams.qwUserName = value;
  1503. this.queryParams.qwUserId = key;
  1504. this.showQwUserDropdown = false;
  1505. this.handleQuery(); // 可选:自动触发查询
  1506. },
  1507. // 延迟隐藏下拉框,防止点击失效
  1508. hideDropdownWithDelay() {
  1509. setTimeout(() => {
  1510. this.showQwUserDropdown = false;
  1511. }, 200);
  1512. },
  1513. handleScroll(e) {
  1514. const container = e.target;
  1515. const scrollTop = container.scrollTop;
  1516. const scrollHeight = container.scrollHeight;
  1517. const clientHeight = container.clientHeight;
  1518. // 距离底部小于 20px 触发加载
  1519. if (scrollHeight - scrollTop - clientHeight < 20 && !this.qwUserLoading && !this.qwUserNoMore) {
  1520. this.qwUserPageNum += 1;
  1521. this.fetchQwUsers(this.queryParams.qwUserName);
  1522. }
  1523. },
  1524. change(){
  1525. if(this.createTime!=null){
  1526. this.queryParams.sTime=this.createTime[0];
  1527. this.queryParams.eTime=this.createTime[1];
  1528. }else{
  1529. this.queryParams.sTime=null;
  1530. this.queryParams.eTime=null;
  1531. }
  1532. },
  1533. updateCorpId(){
  1534. var listTagFrom={corpId:this.queryParams.corpId}
  1535. listTag(listTagFrom).then(response => {
  1536. this.tagList = response.rows;
  1537. });
  1538. this.getList();
  1539. },
  1540. handleChangeStatus(row) {
  1541. this.statusForm = {
  1542. id: row.id,
  1543. status: String(row.status) // 保证与 dictValue 类型一致
  1544. };
  1545. this.statusDialog.open = true;
  1546. },
  1547. submitStatusForm() {
  1548. this.$refs["statusForm"].validate(valid => {
  1549. if (valid) {
  1550. const params = {
  1551. id: this.statusForm.id,
  1552. status: this.statusForm.status
  1553. };
  1554. // 调用接口更新状态
  1555. updateExternalContactStatus(params).then(response => {
  1556. this.msgSuccess("状态修改成功");
  1557. this.statusDialog.open = false;
  1558. this.getList(); // 刷新列表
  1559. }).catch(error => {
  1560. console.error('状态修改失败:', error);
  1561. this.$message.error('状态修改失败');
  1562. });
  1563. }
  1564. });
  1565. },
  1566. /** 查询企业微信客户列表 */
  1567. getList() {
  1568. this.loading = true;
  1569. const { qwUserName, ...queryParams } = this.queryParams;
  1570. listExternalContact(queryParams).then(response => {
  1571. this.externalContactList = response.rows;
  1572. this.total = response.total;
  1573. this.loading = false;
  1574. });
  1575. },
  1576. bindMiniCustomerId(row){
  1577. console.log(row)
  1578. this.userForm.fsUserId=row;
  1579. bindUserId(this.userForm).then(res=>{
  1580. if (res.code==200){
  1581. this.$message.success('绑定成功')
  1582. }else {
  1583. this.$message.error('绑定失败:',res.msg)
  1584. }
  1585. this.getList()
  1586. this.user.open=false;
  1587. })
  1588. },
  1589. /** 查看客户详情 */
  1590. handleShow(row){
  1591. this.show.open=true;
  1592. var that=this;
  1593. const tab = "visit";
  1594. setTimeout(() => {
  1595. that.$refs.customerDetails.getDetails(row.customerId);
  1596. that.$refs.customerDetails.handleClick(tab);
  1597. }, 200);
  1598. },
  1599. handledetails(row){
  1600. this.info.open=true;
  1601. setTimeout(() => {
  1602. this.$refs.Details.getDetails(row.id);
  1603. }, 1);
  1604. },
  1605. closeInfo(){
  1606. this.info.open=false
  1607. },
  1608. handleClickX(tab, event) {
  1609. this.queryParams.isBind=tab.name;
  1610. this.handleQuery();
  1611. },
  1612. handleClose(tag) {
  1613. this.remarkMobiles.splice(this.remarkMobiles.indexOf(tag), 1);
  1614. },
  1615. showInput() {
  1616. this.inputVisible = true;
  1617. this.$nextTick(_ => {
  1618. this.$refs.saveTagInput.$refs.input.focus();
  1619. });
  1620. },
  1621. handleInputConfirm() {
  1622. let inputValue = this.inputValue;
  1623. if (inputValue) {
  1624. this.remarkMobiles.push(inputValue);
  1625. }
  1626. this.inputVisible = false;
  1627. this.inputValue = '';
  1628. },
  1629. addUserTag(){
  1630. if(this.ids==null||this.ids==""){
  1631. return this.$message('请选择需要添加标签的客户');
  1632. }
  1633. this.getPageListTagGroup();
  1634. setTimeout(() => {
  1635. for (let i = 0; i < this.tagGroupList.length; i++) {
  1636. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1637. this.tagGroupList[i].tag[x].isSelected=false;
  1638. }
  1639. }
  1640. }, 200);
  1641. this.tagOpen = true;
  1642. this.tagFilter = false;
  1643. },
  1644. addUserTagFilter(){
  1645. if(this.externalContactList.length == 0){
  1646. return this.$message('无可添加标签客户');
  1647. }
  1648. this.getPageListTagGroup();
  1649. setTimeout(() => {
  1650. for (let i = 0; i < this.tagGroupList.length; i++) {
  1651. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1652. this.tagGroupList[i].tag[x].isSelected=false;
  1653. }
  1654. }
  1655. }, 200);
  1656. this.tagOpen = true;
  1657. this.tagFilter = true;
  1658. },
  1659. getPageListTagGroup(){
  1660. this.queryTagParams.corpId=this.queryParams.corpId
  1661. allListTagGroupPage(this.queryTagParams).then(response => {
  1662. this.tagGroupList = response.rows;
  1663. this.tagTotal = response.total;
  1664. });
  1665. },
  1666. delUserTag(){
  1667. if(this.ids==null||this.ids==""){
  1668. return this.$message('请选择需要移除标签的客户');
  1669. }
  1670. this.getPageListTagGroup();
  1671. setTimeout(() => {
  1672. for (let i = 0; i < this.tagGroupList.length; i++) {
  1673. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1674. this.tagGroupList[i].tag[x].isSelected=false;
  1675. }
  1676. }
  1677. }, 200);
  1678. this.tagDelOpen = true;
  1679. },
  1680. //搜索的标签
  1681. hangleChangeTags(){
  1682. this.changeTagDialog.title="搜索的标签"
  1683. this.changeTagDialog.open=true;
  1684. this.changeTagDialog.type = 1;
  1685. // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
  1686. const selectedTagIds = new Set(
  1687. (this.selectTags || []).map(tagItem => tagItem?.tagId)
  1688. );
  1689. this.queryTagParams.name=null;
  1690. this.getPageListTagGroup();
  1691. setTimeout(() => {
  1692. for (let i = 0; i < this.tagGroupList.length; i++) {
  1693. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1694. this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
  1695. }
  1696. }
  1697. }, 200);
  1698. },
  1699. //选择排除标签
  1700. hangleChangeOutTags() {
  1701. this.changeTagDialog.title="搜索的标签"
  1702. this.changeTagDialog.open=true;
  1703. this.changeTagDialog.type = 2;
  1704. // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
  1705. const selectedTagIds = new Set(
  1706. (this.outSelectTags || []).map(tagItem => tagItem?.tagId)
  1707. );
  1708. this.queryTagParams.name=null;
  1709. this.getPageListTagGroup();
  1710. setTimeout(() => {
  1711. for (let i = 0; i < this.tagGroupList.length; i++) {
  1712. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1713. this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
  1714. }
  1715. }
  1716. }, 200);
  1717. },
  1718. //删除一些选择的标签
  1719. handleCloseTags(list){
  1720. const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);
  1721. if (ls !== -1) {
  1722. this.selectTags.splice(ls, 1);
  1723. this.selectTags = [...this.selectTags];
  1724. }
  1725. if (this.selectTags!=null && this.selectTags.length>0){
  1726. // 确保 this.form.tags 是数组
  1727. if (!this.queryParams.tagIds) {
  1728. this.queryParams.tagIds = []; // 如果未定义,初始化
  1729. } else {
  1730. this.queryParams.tagIds = []; // 清空已有数据
  1731. }
  1732. // 遍历并添加 tagId
  1733. this.selectTags.forEach(tag => {
  1734. if (tag.tagId) { // 确保 tagId 存在
  1735. this.queryParams.tagIds.push(tag.tagId);
  1736. }
  1737. });
  1738. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  1739. }else {
  1740. this.queryParams.tagIds=null;
  1741. }
  1742. },
  1743. //删除一些排除的标签
  1744. handleCloseOutTags(list){
  1745. const ls = this.outSelectTags.findIndex(t => t.tagId === list.tagId);
  1746. if (ls !== -1) {
  1747. this.outSelectTags.splice(ls, 1);
  1748. this.outSelectTags = [...this.selectTags];
  1749. }
  1750. if (this.outSelectTags!=null && this.outSelectTags.length>0){
  1751. // 确保 this.form.tags 是数组
  1752. if (!this.queryParams.outTagIds) {
  1753. this.queryParams.outTagIds = []; // 如果未定义,初始化
  1754. } else {
  1755. this.queryParams.outTagIds = []; // 清空已有数据
  1756. }
  1757. // 遍历并添加 tagId
  1758. this.outSelectTags.forEach(tag => {
  1759. if (tag.tagId) { // 确保 tagId 存在
  1760. this.queryParams.outTagIds.push(tag.tagId);
  1761. }
  1762. });
  1763. this.queryParams.outTagIds=this.queryParams.outTagIds.join(",");
  1764. }else {
  1765. this.queryParams.outTagIds=null;
  1766. }
  1767. },
  1768. //重新获取页面数据
  1769. refreshList(){
  1770. this.getList();
  1771. },
  1772. //批量设置课程sop
  1773. setUserCourseSop(){
  1774. if(this.ids==null||this.ids==""){
  1775. return this.$message('请选择需要设置课程SOP的客户');
  1776. }
  1777. this.$confirm('批量设置客户课节SOP可能会存在重复,确定要批量设置吗?', "警告", {
  1778. confirmButtonText: "确定",
  1779. cancelButtonText: "取消",
  1780. type: "warning"
  1781. }).then(() => {
  1782. this.setSop.open = true;
  1783. this.setSop.type = 2;
  1784. })
  1785. .catch(() => {
  1786. // 可以处理用户点击“取消”的逻辑
  1787. });
  1788. },
  1789. tagSelection(row){
  1790. row.isSelected= !row.isSelected;
  1791. this.$forceUpdate();
  1792. },
  1793. // 取消按钮
  1794. cancel() {
  1795. this.open = false;
  1796. this.reset();
  1797. },
  1798. addTagCancel() {
  1799. this.tagOpen = false;
  1800. this.addTagForm={
  1801. userIds:[],
  1802. tagIds:[]
  1803. };
  1804. },
  1805. DelTagCancel() {
  1806. this.tagDelOpen = false;
  1807. this.addTagForm={
  1808. userIds:[],
  1809. tagIds:[]
  1810. };
  1811. },
  1812. addTagSubmitForm(){
  1813. for (let i = 0; i < this.tagGroupList.length; i++) {
  1814. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1815. if(this.tagGroupList[i].tag[x].isSelected==true){
  1816. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1817. }
  1818. }
  1819. }
  1820. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  1821. return this.$message('请选择标签');
  1822. }
  1823. this.addTagForm.corpId=this.queryParams.corpId
  1824. this.addTagForm.userIds=this.ids;
  1825. this.addTagForm.filter = this.tagFilter;
  1826. // 修改这里:正确处理参数对象
  1827. let obj = JSON.parse(JSON.stringify(this.queryParams));
  1828. // 将逗号分隔的字符串转换为数组
  1829. if(obj.tagIds && typeof obj.tagIds === 'string') {
  1830. obj.tagIds = obj.tagIds.split(",");
  1831. }
  1832. if(obj.outTagIds && typeof obj.outTagIds === 'string') {
  1833. obj.outTagIds = obj.outTagIds.split(",");
  1834. }
  1835. this.addTagForm.param = obj;
  1836. let loadingRock = this.$loading({
  1837. lock: true,
  1838. text: '正在执行中请稍后~~请不要刷新页面!!',
  1839. spinner: 'el-icon-loading',
  1840. background: 'rgba(0, 0, 0, 0.7)'
  1841. });
  1842. addTag(this.addTagForm).then(response => {
  1843. this.msgSuccess(response.msg);
  1844. this.tagOpen = false;
  1845. loadingRock.close();
  1846. this.addTagForm={
  1847. filter: false,
  1848. addType: 0,
  1849. userIds:[],
  1850. tagIds:[]
  1851. };
  1852. this.getList()
  1853. }).finally(res=>{
  1854. loadingRock.close();
  1855. });
  1856. },
  1857. tagDelSubmitForm(){
  1858. for (let i = 0; i < this.tagGroupList.length; i++) {
  1859. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1860. if(this.tagGroupList[i].tag[x].isSelected==true){
  1861. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  1862. }
  1863. }
  1864. }
  1865. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  1866. return this.$message('请选择标签');
  1867. }
  1868. this.addTagForm.corpId=this.queryParams.corpId
  1869. this.addTagForm.userIds=this.ids;
  1870. let loadingRock = this.$loading({
  1871. lock: true,
  1872. text: '正在执行中请稍后~~请不要刷新页面!!',
  1873. spinner: 'el-icon-loading',
  1874. background: 'rgba(0, 0, 0, 0.7)'
  1875. });
  1876. delTag(this.addTagForm).then(response => {
  1877. this.msgSuccess(response.msg);
  1878. this.tagDelOpen = false;
  1879. loadingRock.close();
  1880. this.addTagForm={
  1881. userIds:[],
  1882. tagIds:[]
  1883. };
  1884. this.getList()
  1885. }).finally(res=>{
  1886. loadingRock.close();
  1887. });
  1888. },
  1889. // 表单重置
  1890. reset() {
  1891. this.form = {
  1892. id: null,
  1893. userId: null,
  1894. externalUserId: null,
  1895. name: null,
  1896. companyUserId:null,
  1897. customerId:null,
  1898. avatar: null,
  1899. type: null,
  1900. gender: null,
  1901. remark: null,
  1902. description: null,
  1903. tagIds: null,
  1904. remarkMobiles: null,
  1905. remarkCorpName: null,
  1906. addWay: null,
  1907. operUserid: null,
  1908. corpId: null,
  1909. companyId: null,
  1910. transferStatus:null,
  1911. status:null,
  1912. sTime:null,
  1913. eTime:null,
  1914. createTime:null,
  1915. transferTime:null,
  1916. transferNum:null,
  1917. lossTime:null,
  1918. delTime:null,
  1919. state:null,
  1920. wayId:null,
  1921. stageStatus:null,
  1922. customerName:null
  1923. };
  1924. this.resetForm("form");
  1925. },
  1926. /** 搜索按钮操作 */
  1927. handleQuery() {
  1928. if (this.selectTags!=null && this.selectTags.length>0){
  1929. // 确保 this.form.tags 是数组
  1930. if (!this.queryParams.tagIds) {
  1931. this.queryParams.tagIds = []; // 如果未定义,初始化
  1932. } else {
  1933. this.queryParams.tagIds = []; // 清空已有数据
  1934. }
  1935. // 遍历并添加 tagId
  1936. this.selectTags.forEach(tag => {
  1937. if (tag.tagId) { // 确保 tagId 存在
  1938. this.queryParams.tagIds.push(tag.tagId);
  1939. }
  1940. });
  1941. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  1942. }else {
  1943. this.queryParams.tagIds=null;
  1944. }
  1945. if (this.outSelectTags!=null && this.outSelectTags.length>0){
  1946. // 确保 this.form.tags 是数组
  1947. if (!this.queryParams.outTagIds) {
  1948. this.queryParams.outTagIds = []; // 如果未定义,初始化
  1949. } else {
  1950. this.queryParams.outTagIds = []; // 清空已有数据
  1951. }
  1952. // 遍历并添加 tagId
  1953. this.outSelectTags.forEach(tag => {
  1954. if (tag.tagId) { // 确保 tagId 存在
  1955. this.queryParams.outTagIds.push(tag.tagId);
  1956. }
  1957. });
  1958. this.queryParams.outTagIds=this.queryParams.outTagIds.join(",");
  1959. }else {
  1960. this.queryParams.outTagIds=null;
  1961. }
  1962. this.queryParams.pageNum = 1;
  1963. this.getList();
  1964. },
  1965. handleSearchTags(name){
  1966. if (!name){
  1967. return this.$message.error("请输入要搜索的标签")
  1968. }
  1969. this.queryTagParams.name=name;
  1970. this.queryTagParams.corpId=this.queryParams.corpId;
  1971. searchTags(this.queryTagParams).then(response => {
  1972. this.tagGroupList = response.rows;
  1973. this.tagTotal = response.total;
  1974. });
  1975. },
  1976. cancelSearchTags(){
  1977. this.resetSearchQueryTag()
  1978. this.getPageListTagGroup();
  1979. },
  1980. //确定选择标签
  1981. tagSubmitForm(type){
  1982. if (type==1){
  1983. for (let i = 0; i < this.tagGroupList.length; i++) {
  1984. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  1985. if (this.tagGroupList[i].tag[x].isSelected === true) {
  1986. if (!this.selectTags) {
  1987. this.selectTags = [];
  1988. }
  1989. // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
  1990. let tagExists = this.selectTags.some(
  1991. tag => tag.id === this.tagGroupList[i].tag[x].id
  1992. );
  1993. // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
  1994. if (!tagExists) {
  1995. this.selectTags.push(this.tagGroupList[i].tag[x]);
  1996. }
  1997. }
  1998. }
  1999. }
  2000. if (!this.selectTags || this.selectTags.length === 0) {
  2001. return this.$message('请选择标签');
  2002. }
  2003. }else if (type == 2) {
  2004. for (let i = 0; i < this.tagGroupList.length; i++) {
  2005. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  2006. if (this.tagGroupList[i].tag[x].isSelected === true) {
  2007. if (!this.outSelectTags) {
  2008. this.outSelectTags = [];
  2009. }
  2010. // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
  2011. let tagExists = this.outSelectTags.some(
  2012. tag => tag.id === this.tagGroupList[i].tag[x].id
  2013. );
  2014. // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
  2015. if (!tagExists) {
  2016. this.outSelectTags.push(this.tagGroupList[i].tag[x]);
  2017. }
  2018. }
  2019. }
  2020. }
  2021. if (!this.outSelectTags || this.outSelectTags.length === 0) {
  2022. return this.$message('请选择标签');
  2023. }
  2024. }
  2025. this.changeTagDialog.open = false;
  2026. },
  2027. //取消选择标签
  2028. tagCancel(){
  2029. this.changeTagDialog.open = false;
  2030. },
  2031. resetSearchQueryTag(){
  2032. this.queryTagParams= {
  2033. pageNum: 1,
  2034. pageSize: 10,
  2035. total:0,
  2036. name:null,
  2037. };
  2038. },
  2039. /** 重置按钮操作 */
  2040. resetQuery() {
  2041. this.resetForm("queryForm");
  2042. this.queryParams.transferStatus=null;
  2043. this.queryParams.corpId= this.myQwCompanyList[0].dictValue;
  2044. this.selectTags=[];
  2045. this.outSelectTags=[];
  2046. this.createTime=null;
  2047. this.queryParams.sTime=null;
  2048. this.queryParams.eTime=null;
  2049. this.handleQuery();
  2050. },
  2051. // 多选框选中数据
  2052. handleSelectionChange(selection) {
  2053. this.ids = selection.map(item => item.id)
  2054. this.single = selection.length!==1
  2055. this.multiple = !selection.length
  2056. },
  2057. /** 新增按钮操作 */
  2058. handleAdd() {
  2059. this.loading=true;
  2060. this.form.corpId=this.queryParams.corpId
  2061. addExternalContact(this.form).then(response => {
  2062. this.msgSuccess("同步成功");
  2063. this.getList();
  2064. }).finally(()=>{
  2065. this.loading=false;
  2066. });
  2067. },
  2068. /** 修改按钮操作 */
  2069. handleUpdate(row) {
  2070. this.reset();
  2071. const id = row.id || this.ids
  2072. getExternalContact(id).then(response => {
  2073. this.form = response.data;
  2074. if(this.form.remarkMobiles!=null){
  2075. this.remarkMobiles=JSON.parse(this.form.remarkMobiles)
  2076. }else{
  2077. this.remarkMobiles=[]
  2078. }
  2079. this.open = true;
  2080. this.title = "修改企业微信客户";
  2081. });
  2082. },
  2083. handleAppellation(val){
  2084. this.callOpen.open=true;
  2085. this.callOpenFrom.stageStatus=val.stageStatus;
  2086. this.callOpenFrom.id=val.id;
  2087. },
  2088. /** 绑定客户操作 */
  2089. handleUpdateCustomer(row){
  2090. this.bindCustomer.title="绑定客户"
  2091. this.bindCustomer.open=true;
  2092. this.form.id=row.id
  2093. this.form.externalUserId=row.externalUserId
  2094. this.form.name=row.name
  2095. },
  2096. handleUpdateUser(row){
  2097. this.user.title="绑定客户"
  2098. this.user.open=true;
  2099. this.userForm.id=row.id;
  2100. },
  2101. handleUnBindUserId(val){
  2102. this.$confirm(
  2103. '确认解绑客户:<span style="color: green;">' + val.name + '' +
  2104. '</span> 的小程序用户?<br><span style="color: red;">【ps:可能会导致客户无法看课】</span>',
  2105. {
  2106. confirmButtonText: "确定",
  2107. cancelButtonText: "取消",
  2108. type: "warning",
  2109. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  2110. }
  2111. ).then(() => {
  2112. return unBindUserId(val.id);
  2113. }).then(response => {
  2114. this.getList();
  2115. this.msgSuccess("解绑成功");
  2116. }).finally(res=>{
  2117. this.getList();
  2118. })
  2119. },
  2120. bindCustomerId(row){
  2121. console.log("row",row)
  2122. // this.qwFormCustomer.customerId=row;
  2123. this.form.customerId=row;
  2124. this.form.corpId=this.queryParams.corpId;
  2125. this.msgWarning("绑定中.....同步信息中.....");
  2126. editbindCustomer(this.form).then(res=>{
  2127. //清空表单
  2128. this.reset();
  2129. this.bindCustomer.open = false;
  2130. this.msgSuccess("绑定成功");
  2131. this.getList();
  2132. })
  2133. },
  2134. //设置一个SOP
  2135. setCourseSOP(row) {
  2136. // 检查 row.miniUserId 是否为 null
  2137. if (row.miniUserId === null || row.miniUserId === undefined) {
  2138. return this.$confirm('当前客户【CRM客户详情】中 未绑定小程序客户,请先绑定', "警告", {
  2139. confirmButtonText: "确定",
  2140. cancelButtonText: "取消",
  2141. type: "warning"
  2142. }).catch(error => {
  2143. this.msgWarning("操作取消:", error);
  2144. });
  2145. } else {
  2146. this.chooseCustomerSOP = row;
  2147. this.setSop.open = true;
  2148. this.setSop.type=1;
  2149. }
  2150. },
  2151. //选择课程SOP
  2152. // 用于设置 customerCourseForm 和 customerCourseFormLogs 的共同属性
  2153. setCommonProperties(form, row) {
  2154. form.qwUserid = this.chooseCustomerSOP.userId;
  2155. form.companyUserId = this.chooseCustomerSOP.companyUserId;
  2156. form.externalUserId = this.chooseCustomerSOP.externalUserId;
  2157. form.customerId = this.chooseCustomerSOP.customerId;
  2158. form.miniUserId = this.chooseCustomerSOP.miniUserId;
  2159. form.businessId = row.businessId;
  2160. },
  2161. bindCourseSop(row,days) {
  2162. if (this.setSop.type==2){
  2163. this.setSop.open = false;
  2164. this.loading=true;
  2165. this.msgWarning("设定中.....同步信息中.....");
  2166. setCustomerCourseSopList({ids:this.ids,fsCourseSopId:row.id,days:days}).then(res=>{
  2167. let msg=" 批量设置成功数【" + res.successNum + "】,<br>"
  2168. if (res.failCRM.length>0){
  2169. msg+="失败的客户【" + res.failCRM + "】,原因是未绑定CRM客户。<br>"
  2170. }
  2171. if (res.failMiNi.length>0){
  2172. msg+="失败的客户【" + res.failMiNi + "】,原因是CRM中未绑定小程序客户。<br>"
  2173. }
  2174. if (res.failCompany.length>0){
  2175. msg+="失败的客户【" + res.failCompany + "】,原因是客户没有所属成员。<br>"
  2176. }
  2177. return this.$confirm(msg, "提示", {
  2178. confirmButtonText: "确定",
  2179. cancelButtonText: "取消",
  2180. type: "warning",
  2181. dangerouslyUseHTMLString: true // 允许使用HTML标签
  2182. }).catch(error => {
  2183. this.msgSuccess("操作完成~");
  2184. });
  2185. }).finally(()=>{
  2186. this.loading = false;
  2187. this.getList();
  2188. })
  2189. }else if (this.setSop.type==1){
  2190. // 设置 customerCourseFormLogs 的属性
  2191. this.setCommonProperties(this.customerCourseFormLogs, row);
  2192. // 设置 customerCourseForm 的属性
  2193. this.setCommonProperties(this.customerCourseForm, row);
  2194. this.customerCourseForm.sopId = row.id;
  2195. this.customerCourseForm.sopType = row.sopType;
  2196. this.customerCourseForm.setting = row.setting;
  2197. this.customerCourseForm.days = days;
  2198. // 执行异步操作
  2199. getCustomerCourseSop(this.customerCourseFormLogs)
  2200. .then(res => {
  2201. if (res) {
  2202. return this.$confirm('当前客户已设置过相同课程课节SOP,确定还要再次设置吗?', "警告", {
  2203. confirmButtonText: "确定",
  2204. cancelButtonText: "取消",
  2205. type: "warning"
  2206. });
  2207. } else {
  2208. return Promise.resolve(); // 如果没有设置过,直接执行后续操作
  2209. }
  2210. })
  2211. .then(() => {
  2212. this.loading = true;
  2213. this.setSop.open = false;
  2214. this.msgSuccess("设定中.....同步信息中.....");
  2215. return setCustomerCourseSop(this.customerCourseForm);
  2216. })
  2217. .then(() => {
  2218. this.msgSuccess("设定成功");
  2219. })
  2220. .catch(error => {
  2221. this.msgWarning("操作取消:", error);
  2222. })
  2223. .finally(() => {
  2224. this.loading = false;
  2225. this.getList();
  2226. });
  2227. }
  2228. },
  2229. submitCallOpenFrom(){
  2230. this.$refs["callOpenFrom"].validate(valid => {
  2231. if (valid) {
  2232. if (this.callOpenFrom.id != null && this.callOpenFrom.stageStatus != null) {
  2233. updateExternalContactCall(this.callOpenFrom).then(res=>{
  2234. this.$message.success('修改成功');
  2235. this.callOpen.open=false;
  2236. this.getList();
  2237. });
  2238. }
  2239. }
  2240. });
  2241. },
  2242. /** 提交按钮 */
  2243. submitForm() {
  2244. this.$refs["form"].validate(valid => {
  2245. if (valid) {
  2246. if (this.form.id != null) {
  2247. this.form.remarkMobiles=JSON.stringify(this.remarkMobiles)
  2248. updateExternalContact(this.form).then(response => {
  2249. this.msgSuccess("修改成功");
  2250. this.open = false;
  2251. this.getList();
  2252. });
  2253. } else {
  2254. addExternalContact(this.form).then(response => {
  2255. this.msgSuccess("新增成功");
  2256. this.open = false;
  2257. this.getList();
  2258. });
  2259. }
  2260. }
  2261. });
  2262. },
  2263. /** 删除按钮操作 */
  2264. handleDelete(row) {
  2265. const ids = row.id || this.ids;
  2266. this.$confirm('是否确认删除企业微信客户编号为"' + ids + '"的数据项?', "警告", {
  2267. confirmButtonText: "确定",
  2268. cancelButtonText: "取消",
  2269. type: "warning"
  2270. }).then(function() {
  2271. return delExternalContact(ids);
  2272. }).then(() => {
  2273. this.getList();
  2274. this.msgSuccess("删除成功");
  2275. }).catch(() => {});
  2276. },
  2277. updateTalk(row){
  2278. const ids = row.id || this.ids;
  2279. this.$confirm('是否确认批量更改用户信息为非首次交流', "警告", {
  2280. confirmButtonText: "确定",
  2281. cancelButtonText: "取消",
  2282. type: "warning"
  2283. }).then(function() {
  2284. return editTalk(ids);
  2285. }).then(() => {
  2286. this.getList();
  2287. this.msgSuccess("成功");
  2288. }).catch(() => {});
  2289. },
  2290. /** 导出按钮操作 */
  2291. handleExport() {
  2292. const { qwUserName, ...queryParams } = this.queryParams;
  2293. this.$confirm('是否确认导出所有企业微信客户数据项?', "警告", {
  2294. confirmButtonText: "确定",
  2295. cancelButtonText: "取消",
  2296. type: "warning"
  2297. }).then(() => {
  2298. this.exportLoading = true;
  2299. return exportExternalContact(queryParams);
  2300. }).then(response => {
  2301. this.download(response.msg);
  2302. this.exportLoading = false;
  2303. }).catch(() => {});
  2304. },
  2305. handleBatchUpdateNotesFilter() {
  2306. this.notesOpen.open = true;
  2307. this.notesOpen.filter = true;
  2308. },
  2309. handleBatchUpdateNotes() {
  2310. if (this.ids == null || this.ids == "") {
  2311. return this.$message('请选择需要添加备注的客户');
  2312. }
  2313. this.notesOpen.open = true;
  2314. this.notesOpen.filter = false;
  2315. },
  2316. notesCancel(){
  2317. this.notesOpen={
  2318. open: false,
  2319. notes: null,
  2320. type: 1,
  2321. nameType:3,
  2322. }
  2323. },
  2324. notesSubmitForm() {
  2325. if (this.notesOpen.notes == null || this.notesOpen.notes == "") {
  2326. return this.$message.error("请输入备注内容");
  2327. }
  2328. // let loadingRock = this.$loading({
  2329. // lock: true,
  2330. // text: '正在执行中请稍后~~请不要刷新页面!!',
  2331. // spinner: 'el-icon-loading',
  2332. // background: 'rgba(0, 0, 0, 0.7)'
  2333. // });
  2334. let obj = JSON.parse(JSON.stringify(this.queryParams))
  2335. console.log(obj);
  2336. if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
  2337. obj.tagIds = obj.tagIds.split(",");
  2338. }
  2339. batchUpdateExternalContactNotes({
  2340. addType: 0,
  2341. userIds: this.ids,
  2342. notes: this.notesOpen.notes,
  2343. type: this.notesOpen.type,
  2344. nameType: this.notesOpen.nameType,
  2345. filter: this.notesOpen.filter,
  2346. param: obj
  2347. }).then(res => {
  2348. this.resultMessage = res.msg;
  2349. this.$message.success("正在执行中...");
  2350. // this.resultDialogVisible = true; // 显示弹窗
  2351. // this.resultTitle = '批量修改备注结果';
  2352. }).finally(res => {
  2353. this.getList();
  2354. // loadingRock.close();
  2355. this.notesCancel();
  2356. })
  2357. },
  2358. }
  2359. };
  2360. </script>
  2361. <style scoped>
  2362. /* CSS 样式 */
  2363. .tag-container {
  2364. display: flex;
  2365. flex-wrap: wrap; /* 超出宽度时自动换行 */
  2366. gap: 8px; /* 设置标签之间的间距 */
  2367. }
  2368. .name-background {
  2369. display: inline-block;
  2370. background-color: #abece6; /* 背景颜色 */
  2371. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  2372. border-radius: 4px; /* 可选:设置圆角 */
  2373. }
  2374. /* CSS 样式 */
  2375. .tag-container {
  2376. display: flex;
  2377. flex-wrap: wrap; /* 超出宽度时自动换行 */
  2378. gap: 8px; /* 设置标签之间的间距 */
  2379. }
  2380. .name-background {
  2381. display: inline-block;
  2382. background-color: #abece6; /* 背景颜色 */
  2383. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  2384. border-radius: 4px; /* 可选:设置圆角 */
  2385. }
  2386. .tag-box {
  2387. padding: 8px 12px;
  2388. border: 1px solid #989797;
  2389. border-radius: 4px;
  2390. cursor: pointer;
  2391. display: inline-block;
  2392. }
  2393. .tag-selected {
  2394. background-color: #00bc98;
  2395. color: #fff;
  2396. border-color: #00bc98;
  2397. }
  2398. .el-tag + .el-tag {
  2399. margin-left: 10px;
  2400. }
  2401. .button-new-tag {
  2402. margin-left: 10px;
  2403. height: 32px;
  2404. line-height: 30px;
  2405. padding-top: 0;
  2406. padding-bottom: 0;
  2407. }
  2408. .input-new-tag {
  2409. width: 90px;
  2410. margin-left: 10px;
  2411. vertical-align: bottom;
  2412. }
  2413. .suggestion-box {
  2414. position: absolute;
  2415. z-index: 999;
  2416. background: #fff;
  2417. border: 1px solid #ddd;
  2418. max-height: 200px;
  2419. overflow-y: auto;
  2420. width: 100%;
  2421. }
  2422. .suggestion-item {
  2423. padding: 10px;
  2424. cursor: pointer;
  2425. }
  2426. .suggestion-item:hover {
  2427. background-color: #f5f7fa;
  2428. }
  2429. /* 新增的滚动容器样式(不影响原有样式) */
  2430. .scroll-wrapper {
  2431. max-height: 130px; /* 大约三行的高度 */
  2432. overflow-y: auto; /* 垂直滚动 */
  2433. padding-right: 5px; /* 为滚动条留出空间 */
  2434. }
  2435. /* 美化滚动条(可选) */
  2436. .scroll-wrapper::-webkit-scrollbar {
  2437. width: 6px;
  2438. }
  2439. .scroll-wrapper::-webkit-scrollbar-thumb {
  2440. background: rgba(0, 0, 0, 0.2);
  2441. border-radius: 3px;
  2442. }
  2443. .tag-container {
  2444. max-height: 200px;
  2445. overflow-y: auto;
  2446. padding: 1px;
  2447. border: 1px solid #ebeef5;
  2448. border-radius: 1px;
  2449. background-color: #fafafa;
  2450. }
  2451. .tag-list {
  2452. display: flex;
  2453. flex-wrap: wrap;
  2454. gap: 8px;
  2455. }
  2456. .scroll-hint {
  2457. text-align: center;
  2458. color: #909399;
  2459. font-size: 12px;
  2460. padding: 1px 0;
  2461. }
  2462. .container {
  2463. max-width: 800px;
  2464. margin: 0 auto;
  2465. padding: 10px;
  2466. }
  2467. .title {
  2468. text-align: center;
  2469. color: #303133;
  2470. margin-bottom: 30px;
  2471. }
  2472. .demo-table {
  2473. width: 100%;
  2474. margin-bottom: 30px;
  2475. }
  2476. .instructions {
  2477. background-color: #f5f7fa;
  2478. padding: 15px;
  2479. border-radius: 1px;
  2480. margin-bottom: 20px;
  2481. }
  2482. </style>