myExternalContact.vue 75 KB

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