myExternalContact.vue 64 KB

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