myExternalContact.vue 64 KB

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