myExternalContact.vue 65 KB

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