deptIndex.vue 65 KB

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