myExternalContact.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433
  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="addWay">
  73. <el-select v-model="queryParams.transferStatus" placeholder="转接状态" clearable size="small">
  74. <el-option
  75. v-for="dict in transferStatusOptions"
  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="isBindMini">
  83. <el-select v-model="queryParams.isBindMini" placeholder="是否绑定小程序" clearable size="small" @change="handleQuery" >
  84. <el-option
  85. v-for="dict in isBindMiniOptions"
  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="tagIds">
  93. <el-select v-model="selectTags" remote multiple placeholder="请选择" filterable style="width: 100%;">
  94. <el-option
  95. v-for="dict in tagList"
  96. :label="dict.name"
  97. :value="dict.tagId">
  98. </el-option>
  99. </el-select>
  100. </el-form-item>
  101. <el-form-item label="备注" prop="remark">
  102. <el-input
  103. v-model="queryParams.remark"
  104. placeholder="请输入备注"
  105. clearable
  106. size="small"
  107. @keyup.enter.native="handleQuery"
  108. />
  109. </el-form-item>
  110. <el-form-item label="添加时间" prop="createTime">
  111. <el-date-picker clearable size="small"
  112. v-model="queryParams.createTime"
  113. type="date"
  114. value-format="yyyy-MM-dd"
  115. placeholder="选择添加时间">
  116. </el-date-picker>
  117. </el-form-item>
  118. <el-form-item label="流失时间" prop="lossTime">
  119. <el-date-picker clearable size="small"
  120. v-model="queryParams.lossTime"
  121. type="date"
  122. value-format="yyyy-MM-dd"
  123. placeholder="选择流失时间">
  124. </el-date-picker>
  125. </el-form-item>
  126. <el-form-item label="删除时间" prop="delTime">
  127. <el-date-picker clearable size="small"
  128. v-model="queryParams.delTime"
  129. type="date"
  130. value-format="yyyy-MM-dd"
  131. placeholder="选择删除时间">
  132. </el-date-picker>
  133. </el-form-item>
  134. <el-form-item>
  135. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  136. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  137. </el-form-item>
  138. </el-form>
  139. <el-row :gutter="10" class="mb8">
  140. <!-- <el-col :span="1.5">
  141. <el-button
  142. type="primary"
  143. plain
  144. icon="el-icon-plus"
  145. size="mini"
  146. @click="handleAdd"
  147. v-hasPermi="['qw:externalContact:add']"
  148. >同步</el-button>
  149. </el-col> -->
  150. <el-col :span="1.5">
  151. <el-button
  152. type="success"
  153. plain
  154. icon="el-icon-edit"
  155. size="mini"
  156. :disabled="single"
  157. @click="handleUpdate"
  158. v-hasPermi="['qw:externalContact:edit']"
  159. >修改备注</el-button>
  160. </el-col>
  161. <el-col :span="1.5">
  162. <el-button
  163. type="warning"
  164. plain
  165. icon="el-icon-download"
  166. size="mini"
  167. :loading="exportLoading"
  168. @click="handleSyncMyExternalContact"
  169. v-hasPermi="['qw:externalContact:export']"
  170. >同步我的客户</el-button>
  171. <el-button
  172. type="warning"
  173. plain
  174. icon="el-icon-download"
  175. size="mini"
  176. :loading="exportLoading"
  177. @click="handleSyncAddMyExternalContact"
  178. v-hasPermi="['qw:externalContact:export']"
  179. >新客同步</el-button>
  180. </el-col>
  181. <el-col :span="1.5">
  182. <el-button
  183. type="warning"
  184. plain
  185. icon="el-icon-download"
  186. size="mini"
  187. :loading="exportLoading"
  188. @click="handleExport"
  189. v-hasPermi="['qw:externalContact:export']"
  190. >导出</el-button>
  191. </el-col>
  192. <el-col :span="1.5">
  193. <el-button
  194. type="primary"
  195. plain
  196. size="mini"
  197. @click="addUserTag"
  198. v-hasPermi="['qw:externalContact:addTag']"
  199. >批量添加标签</el-button>
  200. </el-col>
  201. <el-col :span="1.5">
  202. <el-button
  203. type="primary"
  204. plain
  205. size="mini"
  206. @click="delUserTag"
  207. v-hasPermi="['qw:externalContact:delTag']"
  208. >批量移除标签</el-button>
  209. </el-col>
  210. <el-col :span="1.5">
  211. <el-button
  212. type="primary"
  213. plain
  214. size="mini"
  215. @click="updateTalk"
  216. >批量更改交流状态</el-button>
  217. </el-col>
  218. <el-col :span="1.5">
  219. <el-button
  220. type="primary"
  221. plain
  222. size="mini"
  223. @click="updateAllTalk"
  224. >更改全部交流状态</el-button>
  225. </el-col>
  226. <!-- <el-col :span="1.5">-->
  227. <!-- <el-button-->
  228. <!-- type="primary"-->
  229. <!-- plain-->
  230. <!-- size="mini"-->
  231. <!-- @click="setUserCourseSop"-->
  232. <!-- v-hasPermi="['qw:externalContact:setCourseSop']"-->
  233. <!-- >批量设置SOP</el-button>-->
  234. <!-- </el-col>-->
  235. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  236. </el-row>
  237. <el-tabs type="card" v-model="isBindActiveName" @tab-click="handleClickX">
  238. <el-tab-pane label="全部" name="all"></el-tab-pane>
  239. <el-tab-pane label="已绑定CRM" name="isBind"></el-tab-pane>
  240. <el-tab-pane label="未绑定CRM" name="noBind"></el-tab-pane>
  241. </el-tabs>
  242. <el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
  243. <el-table-column type="selection" width="55" align="center" />
  244. <el-table-column label="企微客户ID" align="center" prop="id"/>
  245. <el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">
  246. <template slot-scope="scope">
  247. <el-popover
  248. placement="right"
  249. title=""
  250. trigger="hover">
  251. <img slot="reference" :src="scope.row.avatar" width="60px">
  252. <img :src="scope.row.avatar" style="max-width: 200px;">
  253. </el-popover>
  254. </template>
  255. </el-table-column>
  256. <el-table-column label="企微客户名称" prop="name" width="110px"/>
  257. <el-table-column label="所属员工" align="center" prop="qwUserName" width="120px"/>
  258. <el-table-column label="员工部门" align="center" prop="departmentName" width="120px"/>
  259. <el-table-column label="用户类别" align="center" prop="type">
  260. <template slot-scope="scope">
  261. <dict-tag :options="typeOptions" :value="scope.row.type"/>
  262. </template>
  263. </el-table-column>
  264. <el-table-column label="性别" align="center" prop="gender">
  265. <template slot-scope="scope">
  266. <dict-tag :options="genderOptions" :value="scope.row.gender"/>
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="备注" align="center" prop="remark" />
  270. <el-table-column label="描述信息" align="center" prop="description" />
  271. <el-table-column label="标签" align="center" prop="tagIds" width="250px">
  272. <template slot-scope="scope">
  273. <div v-for="i in JSON.parse(scope.row.tagIds)" :key="i" style="display: inline;">
  274. <el-tag type="success" v-for="ii in tagList" :key="ii.id" style="margin: 3px;" v-if="ii.tagId==i">{{ii.name}}</el-tag>
  275. </div>
  276. </template>
  277. </el-table-column>
  278. <el-table-column label="状态" align="center" prop="status" width="120px" >
  279. <template slot-scope="scope">
  280. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  281. </template>
  282. </el-table-column>
  283. <el-table-column label="添加时间" align="center" prop="createTime" width="100px" />
  284. <el-table-column label="流失时间" align="center" prop="lossTime" width="100px" />
  285. <el-table-column label="删除时间" align="center" prop="delTime" width="100px" />
  286. <el-table-column label="备注电话号码" align="center" prop="remarkMobiles" width="150px">
  287. <template slot-scope="scope">
  288. <div v-for="i in JSON.parse(scope.row.remarkMobiles)" :key="i">{{i}}</div>
  289. </template>
  290. </el-table-column>
  291. <el-table-column label="备注企业名称" align="center" prop="remarkCorpName" />
  292. <el-table-column label="来源" align="center" prop="addWay" width="100px">
  293. <template slot-scope="scope">
  294. <dict-tag :options="addWayOptions" :value="scope.row.addWay"/>
  295. </template>
  296. </el-table-column>
  297. <el-table-column label="转接状态" align="center" prop="transferStatus" width="100px" >
  298. <template slot-scope="scope">
  299. <dict-tag :options="transferStatusOptions" :value="scope.row.transferStatus"/>
  300. </template>
  301. </el-table-column>
  302. <el-table-column label="企业id" align="center" prop="corpId" />
  303. <el-table-column label="是否绑小程序" width="100px" align="center" fixed="right">
  304. <template slot-scope="scope">
  305. <el-tag v-if="scope.row.fsUserId" >已绑定</el-tag>
  306. <el-tag v-else type="info"> 未绑定</el-tag>
  307. </template>
  308. </el-table-column>
  309. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
  310. <template slot-scope="scope">
  311. <el-button
  312. v-if="scope.row.status==0||scope.row.status==2"
  313. size="mini"
  314. type="text"
  315. icon="el-icon-edit"
  316. @click="handleUpdate(scope.row)"
  317. v-hasPermi="['qw:externalContact:edit']"
  318. >修改备注</el-button>
  319. <el-button
  320. size="mini"
  321. type="text"
  322. icon="el-icon-edit-outline"
  323. @click="handleUpdateCustomer(scope.row)"
  324. >
  325. <span v-if="scope.row.customerId">换绑CRM</span>
  326. <span v-else>绑定CRM</span>
  327. </el-button>
  328. <el-button
  329. size="mini"
  330. type="text"
  331. icon="el-icon-edit-outline"
  332. @click="handleUpdateUser(scope.row)"
  333. >
  334. <span v-if="scope.row.fsUserId">换绑小程序用户</span>
  335. <span v-else>绑定小程序用户</span>
  336. </el-button>
  337. <el-button v-if="scope.row.fsUserId"
  338. size="mini"
  339. type="text"
  340. icon="el-icon-thumb"
  341. @click="handleUnBindUserId(scope.row)"
  342. v-hasPermi="['qw:externalContact:unBindUserId']"
  343. >
  344. <span>解除小程序用户绑定</span>
  345. </el-button>
  346. <el-button v-if="scope.row.customerId"
  347. size="mini"
  348. type="text"
  349. icon="el-icon-paperclip"
  350. @click="handleShow(scope.row)"
  351. >CRM客户详情</el-button>
  352. <el-button
  353. size="mini"
  354. type="text"
  355. @click="handledetails(scope.row)"
  356. >用户信息
  357. </el-button>
  358. <!-- <el-button v-if="scope.row.customerId"
  359. size="mini"
  360. type="text"
  361. icon="el-icon-setting"
  362. @click="setCourseSOP(scope.row)"
  363. >设置课程SOP</el-button> -->
  364. <el-button
  365. v-if="scope.row.fsUserId"
  366. size="mini"
  367. type="text"
  368. @click="addPackageOrder(scope.row)"
  369. >创建订单
  370. </el-button>
  371. </template>
  372. </el-table-column>
  373. </el-table>
  374. <pagination
  375. v-show="total>0"
  376. :total="total"
  377. :page.sync="queryParams.pageNum"
  378. :limit.sync="queryParams.pageSize"
  379. @pagination="getList"
  380. />
  381. <el-drawer size="75%" :title="show.title" :visible.sync="show.open">
  382. <customer-details ref="customerDetails" @refreshList="refreshList"/>
  383. </el-drawer>
  384. <el-dialog title="批量添加标签" :visible.sync="tagOpen" width="800px" append-to-body>
  385. <div>搜索标签:
  386. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  387. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  388. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  389. </div>
  390. <el-form ref="form" :model="addTagForm" label-width="80px">
  391. <div v-for="item in tagGroupList" :key="item.id" >
  392. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  393. <span class="name-background">{{ item.name }}</span>
  394. </div>
  395. <div class="tag-container">
  396. <a
  397. v-for="tagItem in item.tag"
  398. class="tag-box"
  399. @click="tagSelection(tagItem)"
  400. :class="{ 'tag-selected': tagItem.isSelected }"
  401. >
  402. {{ tagItem.name }}
  403. </a>
  404. </div>
  405. </div>
  406. </el-form>
  407. <div slot="footer" class="dialog-footer">
  408. <el-button type="primary" @click="addTagSubmitForm()">确 定</el-button>
  409. <el-button @click="addTagCancel">取 消</el-button>
  410. </div>
  411. </el-dialog>
  412. <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
  413. <div>搜索标签:
  414. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  415. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  416. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  417. </div>
  418. <el-form ref="form" :model="addTagForm" label-width="80px">
  419. <div v-for="item in tagGroupList" :key="item.id" >
  420. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  421. <span class="name-background">{{ item.name }}</span>
  422. </div>
  423. <div class="tag-container">
  424. <a
  425. v-for="tagItem in item.tag"
  426. class="tag-box"
  427. @click="tagSelection(tagItem)"
  428. :class="{ 'tag-selected': tagItem.isSelected }"
  429. >
  430. {{ tagItem.name }}
  431. </a>
  432. </div>
  433. </div>
  434. </el-form>
  435. <div slot="footer" class="dialog-footer">
  436. <el-button type="primary" @click="tagDelSubmitForm()">确 定</el-button>
  437. <el-button @click="DelTagCancel">取 消</el-button>
  438. </div>
  439. </el-dialog>
  440. <!-- 添加或修改企业微信客户对话框 -->
  441. <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
  442. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  443. <el-form-item label="备注" prop="remark">
  444. <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
  445. </el-form-item>
  446. <el-form-item label="描述信息" prop="description">
  447. <el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述信息" />
  448. </el-form-item>
  449. <el-form-item label="备注电话号码" prop="remarkMobiles">
  450. <el-tag
  451. :key="tag"
  452. v-for="tag in remarkMobiles"
  453. closable
  454. :disable-transitions="false"
  455. @close="handleClose(tag)">
  456. {{tag}}
  457. </el-tag>
  458. <el-input
  459. style="width:110px"
  460. class="input-new-tag"
  461. v-if="inputVisible"
  462. v-model="inputValue"
  463. ref="saveTagInput"
  464. size="small"
  465. @keyup.enter.native="handleInputConfirm"
  466. @blur="handleInputConfirm"
  467. >
  468. </el-input>
  469. <el-button v-else class="button-new-tag" size="small" style="width: 110px" @click="showInput">新增电话</el-button>
  470. </el-form-item>
  471. <el-form-item label="备注企业名称" prop="remarkCorpName">
  472. <el-input v-model="form.remarkCorpName" placeholder="请输入备注企业名称" />
  473. </el-form-item>
  474. </el-form>
  475. <div slot="footer" class="dialog-footer">
  476. <el-button type="primary" @click="submitForm">确 定</el-button>
  477. <el-button @click="cancel">取 消</el-button>
  478. </div>
  479. </el-dialog>
  480. <!-- 绑定客户 -->
  481. <el-dialog :title="bindCustomer.title" :visible.sync="bindCustomer.open" width="1200px" append-to-body>
  482. <mycustomer ref="mycustomer" @bindCustomerId="bindCustomerId"></mycustomer>
  483. </el-dialog>
  484. <!-- 设置一个课程sop-->
  485. <el-dialog :title="setSop.title" :visible.sync="setSop.open" width="1200px" append-to-body>
  486. <SopDialog ref="SopDialog" @bindCourseSop="bindCourseSop"></SopDialog>
  487. </el-dialog>
  488. <el-drawer
  489. :with-header="false"
  490. size="75%"
  491. :title="show.title" :visible.sync="show.open">
  492. <info ref="Details" />
  493. </el-drawer>
  494. <el-dialog :title="user.title" :visible.sync="user.open" width="800px" append-to-body>
  495. <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>
  496. </el-dialog>
  497. <el-dialog title="创建订单" :visible.sync="addPackageOpen" width="1000px" append-to-body>
  498. <addPackage @closePackage="closePackage" ref="addPackageVisit" :userId="fsUserId"/>
  499. </el-dialog>
  500. </div>
  501. </template>
  502. <script>
  503. import {
  504. myList,
  505. bindUserId,
  506. addTag,
  507. delTag,
  508. listExternalContact,
  509. getExternalContact,
  510. delExternalContact,
  511. addExternalContact,
  512. updateExternalContact,
  513. exportExternalContact,
  514. editbindCustomer,
  515. syncMyAddExternalContact,
  516. setCustomerCourseSop,
  517. getCustomerCourseSop,
  518. setCustomerCourseSopList,
  519. syncMyExternalContact, unBindUserId
  520. } from '@/api/qw/externalContact'
  521. import info from "@/views/qw/externalContact/info.vue";
  522. import {getMyQwUserList, getMyQwCompanyList, handleInputAuthAppKey} from "@/api/qw/user";
  523. import {listTag, getTag, searchTags,} from "@/api/qw/tag";
  524. import { allListTagGroup} from "@/api/qw/tagGroup";
  525. import mycustomer from '@/views/qw/externalContact/mycustomer'
  526. import customerDetails from '@/views/qw/externalContact/customerDetails'
  527. import SopDialog from '@/views/course/sop/SopDialog.vue'
  528. import selectUser from "@/views/qw/externalContact/selectUser.vue";
  529. import { editTalk,editAllTalk } from "@/api/qw/externalContactInfo";
  530. import {createLinkUrl} from "@/api/course/sopCourseLink";
  531. import addPackage from "@/views/store/components/addOrder";
  532. export default {
  533. name: "ExternalContact",
  534. components:{mycustomer,customerDetails,SopDialog,selectUser,info,addPackage},
  535. data() {
  536. return {
  537. fsUserId:null,
  538. addPackageOpen:false,
  539. user:{
  540. open:false,
  541. title:"修改客户"
  542. },
  543. userForm:{
  544. id:null,
  545. fsUserId:null,
  546. },
  547. myQwUserList:[],
  548. // 遮罩层
  549. loading: false,
  550. // 导出遮罩层
  551. exportLoading: false,
  552. tagOpen:false,
  553. tagDelOpen:false,
  554. // 选中数组
  555. ids: [],
  556. isBindMiniOptions:[
  557. {dictLabel:"已绑定",dictValue:'isBindMini'},
  558. {dictLabel:"未绑定",dictValue:'noBindMini'},
  559. ],
  560. isBindActiveName:"all",
  561. remarkMobiles: [],
  562. inputVisible: false,
  563. inputValue: '',
  564. // 非单个禁用
  565. single: true,
  566. tagGroupList: [],
  567. //标签弹窗选择
  568. tagChange:{
  569. open:false,
  570. index:null,
  571. },
  572. // 非多个禁用
  573. multiple: true,
  574. // 显示搜索条件
  575. showSearch: true,
  576. // 总条数
  577. total: 0,
  578. // 企业微信客户表格数据
  579. externalContactList: [],
  580. // 弹出层标题
  581. title: "",
  582. // 是否显示弹出层
  583. open: false,
  584. // 用户类别字典
  585. typeOptions: [],
  586. // 性别字典
  587. genderOptions: [],
  588. addTagForm:{
  589. userIds:[],
  590. tagIds:[]
  591. },
  592. myQwCompanyList:[],
  593. show:{
  594. title:"客户详情",
  595. open:false,
  596. },
  597. //存储选择的客户
  598. chooseCustomerSOP:null,
  599. setSop:{
  600. title:"选择课节SOP",
  601. open:false,
  602. //区分单选1还是多选2
  603. type:null,
  604. },
  605. //合成的客户-课节SOP参数
  606. customerCourseForm:{},
  607. //查询是否已经设置过客户-某个课节的SOP
  608. customerCourseFormLogs:{},
  609. //绑定客户
  610. bindCustomer:{
  611. title:null,
  612. open:false,
  613. },
  614. //绑定的参数表
  615. qwFormCustomer:{
  616. externalContactId:null,
  617. customerId:null,
  618. },
  619. show:{
  620. title:"用户信息",
  621. open:false,
  622. },
  623. // 来源字典
  624. addWayOptions: [],
  625. // 查询参数
  626. queryParams: {
  627. pageNum: 1,
  628. pageSize: 10,
  629. userId: null,
  630. qwUserName:null,
  631. externalUserId: null,
  632. name: null,
  633. avatar: null,
  634. type: null,
  635. qwUserId:null,
  636. gender: null,
  637. description: null,
  638. tagIds: null,
  639. remark:null,
  640. remarkMobiles: null,
  641. remarkCorpName: null,
  642. addWay: null,
  643. operUserid: null,
  644. corpId: null,
  645. companyId: null,
  646. status:null,
  647. transferStatus:null,
  648. isBind:null,
  649. isBindMini:null,
  650. lossTime:null,
  651. createTime:null,
  652. },
  653. selectTags:[],
  654. // 表单参数
  655. form: {},
  656. tagList:[],
  657. transferStatusOptions:[],
  658. statusOptions:[],
  659. // 表单校验
  660. rules: {
  661. }
  662. };
  663. },
  664. created() {
  665. this.getDicts("sys_qw_externalContact_type").then(response => {
  666. this.typeOptions = response.data;
  667. });
  668. this.handleGetMyQwUserList();
  669. this.getDicts("sys_sex").then(response => {
  670. this.genderOptions = response.data;
  671. });
  672. this.getDicts("sys_qw_externalContact_addWay").then(response => {
  673. this.addWayOptions = response.data;
  674. });
  675. this.getDicts("sys_qw_external_contact_status").then(response => {
  676. this.statusOptions = response.data;
  677. });
  678. this.getDicts("sys_qw_transfer_status").then(response => {
  679. this.transferStatusOptions = response.data;
  680. });
  681. },
  682. methods: {
  683. addPackageOrder(row){
  684. this.fsUserId = row.fsUserId;
  685. this.addPackageOpen=true;
  686. },
  687. closePackage(){
  688. this.addPackageOpen=false;
  689. },
  690. handledetails(row){
  691. this.show.open=true;
  692. setTimeout(() => {
  693. this.$refs.Details.getDetails(row.id);
  694. }, 1);
  695. },
  696. updateQwuser(){
  697. for (const user of this.myQwUserList) {
  698. if (user.dictValue == this.queryParams.qwUserId) {
  699. this.queryParams.corpId=user.corpId;
  700. break;
  701. }
  702. }
  703. var listTagFrom={corpId:this.queryParams.corpId}
  704. allListTagGroup(listTagFrom).then(response => {
  705. this.tagGroupList = response.rows;
  706. });
  707. listTag(listTagFrom).then(response => {
  708. this.tagList = response.rows;
  709. });
  710. this.getList();
  711. },
  712. /** 查询企业微信客户列表 */
  713. getList() {
  714. this.loading = true;
  715. myList(this.queryParams).then(response => {
  716. this.externalContactList = response.rows;
  717. this.total = response.total;
  718. this.loading = false;
  719. });
  720. },
  721. handleSearchTags(name){
  722. searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  723. this.tagGroupList = response.rows;
  724. });
  725. },
  726. handleGetMyQwUserList(){
  727. getMyQwUserList().then(response => {
  728. this.myQwUserList = response.data;
  729. if(this.myQwUserList!=null){
  730. this.queryParams.qwUserId=this.myQwUserList[0].dictValue
  731. this.queryParams.corpId=this.myQwUserList[0].corpId
  732. this.handleGetTagsList();
  733. this.getList();
  734. }
  735. });
  736. },
  737. cancelSearchTags(){
  738. this.handleGetTagsList()
  739. },
  740. handleGetTagsList(){
  741. var listTagFrom={corpId:this.queryParams.corpId}
  742. allListTagGroup(listTagFrom).then(response => {
  743. this.tagGroupList = response.rows;
  744. });
  745. listTag(listTagFrom).then(response => {
  746. this.tagList = response.rows;
  747. });
  748. },
  749. bindMiniCustomerId(row){
  750. this.userForm.fsUserId=row;
  751. bindUserId(this.userForm).then(res=>{
  752. if (res.code==200){
  753. this.$message.success('绑定成功')
  754. }else {
  755. this.$message.error('绑定失败:',res.msg)
  756. }
  757. this.getList()
  758. this.user.open=false;
  759. })
  760. },
  761. /** 查看客户详情 */
  762. handleShow(row){
  763. this.show.open=true;
  764. var that=this;
  765. const tab = "visit";
  766. setTimeout(() => {
  767. that.$refs.customerDetails.getDetails(row.customerId);
  768. that.$refs.customerDetails.handleClick(tab);
  769. }, 200);
  770. },
  771. handleClickX(tab, event) {
  772. this.queryParams.isBind=tab.name;
  773. this.handleQuery();
  774. },
  775. handleClose(tag) {
  776. this.remarkMobiles.splice(this.remarkMobiles.indexOf(tag), 1);
  777. },
  778. showInput() {
  779. this.inputVisible = true;
  780. this.$nextTick(_ => {
  781. this.$refs.saveTagInput.$refs.input.focus();
  782. });
  783. },
  784. handleInputConfirm() {
  785. let inputValue = this.inputValue;
  786. if (inputValue) {
  787. this.remarkMobiles.push(inputValue);
  788. }
  789. this.inputVisible = false;
  790. this.inputValue = '';
  791. },
  792. addUserTag(){
  793. if(this.ids==null||this.ids==""){
  794. return this.$message('请选择需要添加标签的客户');
  795. }
  796. for (let i = 0; i < this.tagGroupList.length; i++) {
  797. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  798. this.tagGroupList[i].tag[x].isSelected=false;
  799. }
  800. }
  801. this.tagOpen = true;
  802. },
  803. delUserTag(){
  804. if(this.ids==null||this.ids==""){
  805. return this.$message('请选择需要移除标签的客户');
  806. }
  807. for (let i = 0; i < this.tagGroupList.length; i++) {
  808. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  809. this.tagGroupList[i].tag[x].isSelected=false;
  810. }
  811. }
  812. this.tagDelOpen = true;
  813. },
  814. //重新获取页面数据
  815. refreshList(){
  816. this.getList();
  817. },
  818. //批量设置课程sop
  819. setUserCourseSop(){
  820. if(this.ids==null||this.ids==""){
  821. return this.$message('请选择需要设置课程SOP的客户');
  822. }
  823. this.$confirm('批量设置客户课节SOP可能会存在重复,确定要批量设置吗?', "警告", {
  824. confirmButtonText: "确定",
  825. cancelButtonText: "取消",
  826. type: "warning"
  827. }).then(() => {
  828. this.setSop.open = true;
  829. this.setSop.type = 2;
  830. })
  831. .catch(() => {
  832. // 可以处理用户点击“取消”的逻辑
  833. });
  834. },
  835. tagSelection(row){
  836. row.isSelected= !row.isSelected;
  837. this.$forceUpdate();
  838. },
  839. // 取消按钮
  840. cancel() {
  841. this.open = false;
  842. this.reset();
  843. },
  844. addTagCancel() {
  845. this.tagOpen = false;
  846. this.addTagForm={
  847. userIds:[],
  848. tagIds:[]
  849. };
  850. },
  851. DelTagCancel() {
  852. this.tagDelOpen = false;
  853. this.addTagForm={
  854. userIds:[],
  855. tagIds:[]
  856. };
  857. },
  858. addTagSubmitForm(){
  859. for (let i = 0; i < this.tagGroupList.length; i++) {
  860. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  861. if(this.tagGroupList[i].tag[x].isSelected==true){
  862. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  863. }
  864. }
  865. }
  866. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  867. return this.$message('请选择标签');
  868. }
  869. this.addTagForm.corpId=this.queryParams.corpId
  870. this.addTagForm.userIds=this.ids;
  871. let loadingRock = this.$loading({
  872. lock: true,
  873. text: '正在执行中请稍后~~请不要刷新页面!!',
  874. spinner: 'el-icon-loading',
  875. background: 'rgba(0, 0, 0, 0.7)'
  876. });
  877. addTag(this.addTagForm).then(response => {
  878. this.msgSuccess(response.msg);
  879. this.tagOpen = false;
  880. loadingRock.close();
  881. this.addTagForm={
  882. userIds:[],
  883. tagIds:[]
  884. };
  885. this.getList()
  886. }).finally(res=>{
  887. loadingRock.close();
  888. });
  889. },
  890. tagDelSubmitForm(){
  891. for (let i = 0; i < this.tagGroupList.length; i++) {
  892. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  893. if(this.tagGroupList[i].tag[x].isSelected==true){
  894. this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  895. }
  896. }
  897. }
  898. if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
  899. return this.$message('请选择标签');
  900. }
  901. this.addTagForm.corpId=this.queryParams.corpId
  902. this.addTagForm.userIds=this.ids;
  903. let loadingRock = this.$loading({
  904. lock: true,
  905. text: '正在执行中请稍后~~请不要刷新页面!!',
  906. spinner: 'el-icon-loading',
  907. background: 'rgba(0, 0, 0, 0.7)'
  908. });
  909. delTag(this.addTagForm).then(response => {
  910. this.msgSuccess(response.msg);
  911. this.tagDelOpen = false;
  912. loadingRock.close();
  913. this.addTagForm={
  914. userIds:[],
  915. tagIds:[]
  916. };
  917. this.getList()
  918. }).finally(res=>{
  919. loadingRock.close();
  920. });
  921. },
  922. // 表单重置
  923. reset() {
  924. this.form = {
  925. id: null,
  926. userId: null,
  927. externalUserId: null,
  928. name: null,
  929. companyUserId:null,
  930. customerId:null,
  931. avatar: null,
  932. type: null,
  933. gender: null,
  934. remark: null,
  935. description: null,
  936. tagIds: null,
  937. remarkMobiles: null,
  938. remarkCorpName: null,
  939. addWay: null,
  940. operUserid: null,
  941. corpId: null,
  942. companyId: null,
  943. transferStatus:null,
  944. status:null,
  945. createTime:null,
  946. transferTime:null,
  947. transferNum:null,
  948. lossTime:null,
  949. delTime:null,
  950. state:null,
  951. wayId:null,
  952. stageStatus:null,
  953. customerName:null
  954. };
  955. this.resetForm("form");
  956. },
  957. /** 搜索按钮操作 */
  958. handleQuery() {
  959. this.queryParams.tagIds=this.selectTags.join(',')
  960. this.queryParams.pageNum = 1;
  961. this.getList();
  962. },
  963. /** 重置按钮操作 */
  964. resetQuery() {
  965. this.resetForm("queryForm");
  966. this.queryParams.qwUserId=this.myQwUserList[0].dictValue;
  967. this.queryParams.corpId=this.myQwUserList[0].corpId;
  968. this.selectTags=[];
  969. this.handleQuery();
  970. },
  971. // 多选框选中数据
  972. handleSelectionChange(selection) {
  973. this.ids = selection.map(item => item.id)
  974. this.single = selection.length!==1
  975. this.multiple = !selection.length
  976. },
  977. /** 新增按钮操作 */
  978. handleAdd() {
  979. this.loading=true;
  980. this.form.corpId=this.queryParams.corpId
  981. addExternalContact(this.form).then(response => {
  982. this.msgSuccess("同步成功");
  983. this.getList();
  984. }).finally(()=>{
  985. this.loading=false;
  986. });
  987. },
  988. /** 修改按钮操作 */
  989. handleUpdate(row) {
  990. this.reset();
  991. const id = row.id || this.ids
  992. getExternalContact(id).then(response => {
  993. this.form = response.data;
  994. if(this.form.remarkMobiles!=null){
  995. this.remarkMobiles=JSON.parse(this.form.remarkMobiles)
  996. }else{
  997. this.remarkMobiles=[]
  998. }
  999. this.open = true;
  1000. this.title = "修改企业微信客户";
  1001. });
  1002. },
  1003. /** 绑定客户操作 */
  1004. handleUpdateCustomer(row){
  1005. this.bindCustomer.title="绑定客户"
  1006. this.bindCustomer.open=true;
  1007. this.form.id=row.id
  1008. this.form.externalUserId=row.externalUserId
  1009. this.form.name=row.name
  1010. },
  1011. handleUpdateUser(row){
  1012. this.user.title="绑定客户"
  1013. this.user.open=true;
  1014. this.userForm.id=row.id;
  1015. },
  1016. handleUnBindUserId(val){
  1017. this.$confirm(
  1018. '确认解绑客户:<span style="color: green;">' + val.name + '' +
  1019. '</span> 的小程序用户?<br><span style="color: red;">【ps:可能会导致客户无法看课】</span>',
  1020. {
  1021. confirmButtonText: "确定",
  1022. cancelButtonText: "取消",
  1023. type: "warning",
  1024. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  1025. }
  1026. ).then(() => {
  1027. return unBindUserId(val.id);
  1028. }).then(response => {
  1029. this.getList();
  1030. this.msgSuccess("解绑成功");
  1031. }).finally(res=>{
  1032. this.getList();
  1033. })
  1034. },
  1035. bindCustomerId(row){
  1036. console.log("row",row)
  1037. // this.qwFormCustomer.customerId=row;
  1038. this.form.customerId=row;
  1039. this.form.corpId=this.queryParams.corpId;
  1040. this.msgWarning("绑定中.....同步信息中.....");
  1041. editbindCustomer(this.form).then(res=>{
  1042. //清空表单
  1043. this.reset();
  1044. this.bindCustomer.open = false;
  1045. this.msgSuccess("绑定成功");
  1046. this.getList();
  1047. })
  1048. },
  1049. //设置一个SOP
  1050. setCourseSOP(row) {
  1051. // 检查 row.miniUserId 是否为 null
  1052. if (row.miniUserId === null || row.miniUserId === undefined) {
  1053. return this.$confirm('当前客户【CRM客户详情】中 未绑定小程序客户,请先绑定', "警告", {
  1054. confirmButtonText: "确定",
  1055. cancelButtonText: "取消",
  1056. type: "warning"
  1057. }).catch(error => {
  1058. this.msgWarning("操作取消:", error);
  1059. });
  1060. } else {
  1061. this.chooseCustomerSOP = row;
  1062. this.setSop.open = true;
  1063. this.setSop.type=1;
  1064. }
  1065. },
  1066. //选择课程SOP
  1067. // 用于设置 customerCourseForm 和 customerCourseFormLogs 的共同属性
  1068. setCommonProperties(form, row) {
  1069. form.qwUserid = this.chooseCustomerSOP.userId;
  1070. form.companyUserId = this.chooseCustomerSOP.companyUserId;
  1071. form.externalUserId = this.chooseCustomerSOP.externalUserId;
  1072. form.customerId = this.chooseCustomerSOP.customerId;
  1073. form.miniUserId = this.chooseCustomerSOP.miniUserId;
  1074. form.businessId = row.businessId;
  1075. },
  1076. bindCourseSop(row,days) {
  1077. if (this.setSop.type==2){
  1078. this.setSop.open = false;
  1079. this.loading=true;
  1080. this.msgWarning("设定中.....同步信息中.....");
  1081. setCustomerCourseSopList({ids:this.ids,fsCourseSopId:row.id,days:days}).then(res=>{
  1082. let msg=" 批量设置成功数【" + res.successNum + "】,<br>"
  1083. if (res.failCRM.length>0){
  1084. msg+="失败的客户【" + res.failCRM + "】,原因是未绑定CRM客户。<br>"
  1085. }
  1086. if (res.failMiNi.length>0){
  1087. msg+="失败的客户【" + res.failMiNi + "】,原因是CRM中未绑定小程序客户。<br>"
  1088. }
  1089. if (res.failCompany.length>0){
  1090. msg+="失败的客户【" + res.failCompany + "】,原因是客户没有所属成员。<br>"
  1091. }
  1092. return this.$confirm(msg, "提示", {
  1093. confirmButtonText: "确定",
  1094. cancelButtonText: "取消",
  1095. type: "warning",
  1096. dangerouslyUseHTMLString: true // 允许使用HTML标签
  1097. }).catch(error => {
  1098. this.msgSuccess("操作完成~");
  1099. });
  1100. }).finally(()=>{
  1101. this.loading = false;
  1102. this.getList();
  1103. })
  1104. }else if (this.setSop.type==1){
  1105. // 设置 customerCourseFormLogs 的属性
  1106. this.setCommonProperties(this.customerCourseFormLogs, row);
  1107. // 设置 customerCourseForm 的属性
  1108. this.setCommonProperties(this.customerCourseForm, row);
  1109. this.customerCourseForm.sopId = row.id;
  1110. this.customerCourseForm.sopType = row.sopType;
  1111. this.customerCourseForm.setting = row.setting;
  1112. this.customerCourseForm.days = days;
  1113. // 执行异步操作
  1114. getCustomerCourseSop(this.customerCourseFormLogs)
  1115. .then(res => {
  1116. if (res) {
  1117. return this.$confirm('当前客户已设置过相同课程课节SOP,确定还要再次设置吗?', "警告", {
  1118. confirmButtonText: "确定",
  1119. cancelButtonText: "取消",
  1120. type: "warning"
  1121. });
  1122. } else {
  1123. return Promise.resolve(); // 如果没有设置过,直接执行后续操作
  1124. }
  1125. })
  1126. .then(() => {
  1127. this.loading = true;
  1128. this.setSop.open = false;
  1129. this.msgSuccess("设定中.....同步信息中.....");
  1130. return setCustomerCourseSop(this.customerCourseForm);
  1131. })
  1132. .then(() => {
  1133. this.msgSuccess("设定成功");
  1134. })
  1135. .catch(error => {
  1136. this.msgWarning("操作取消:", error);
  1137. })
  1138. .finally(() => {
  1139. this.loading = false;
  1140. this.getList();
  1141. });
  1142. }
  1143. },
  1144. /** 提交按钮 */
  1145. submitForm() {
  1146. this.$refs["form"].validate(valid => {
  1147. if (valid) {
  1148. if (this.form.id != null) {
  1149. this.form.remarkMobiles=JSON.stringify(this.remarkMobiles)
  1150. updateExternalContact(this.form).then(response => {
  1151. this.msgSuccess("修改成功");
  1152. this.open = false;
  1153. this.getList();
  1154. });
  1155. } else {
  1156. addExternalContact(this.form).then(response => {
  1157. this.msgSuccess("新增成功");
  1158. this.open = false;
  1159. this.getList();
  1160. });
  1161. }
  1162. }
  1163. });
  1164. },
  1165. /** 删除按钮操作 */
  1166. handleDelete(row) {
  1167. const ids = row.id || this.ids;
  1168. this.$confirm('是否确认删除企业微信客户编号为"' + ids + '"的数据项?', "警告", {
  1169. confirmButtonText: "确定",
  1170. cancelButtonText: "取消",
  1171. type: "warning"
  1172. }).then(function() {
  1173. return delExternalContact(ids);
  1174. }).then(() => {
  1175. this.getList();
  1176. this.msgSuccess("删除成功");
  1177. }).catch(() => {});
  1178. },
  1179. handleSyncMyExternalContact(){
  1180. this.loading=true;
  1181. let loadingRock = this.$loading({
  1182. lock: true,
  1183. text: '正在执行中请稍后~~请不要刷新页面!!',
  1184. spinner: 'el-icon-loading',
  1185. background: 'rgba(0, 0, 0, 0.7)'
  1186. });
  1187. syncMyExternalContact(this.queryParams.qwUserId).then(res => {
  1188. this.msgSuccess("同步成功");
  1189. this.loading=false;
  1190. loadingRock.close();
  1191. this.getList();
  1192. }).catch(res=>{
  1193. console.log("asdasdwaaw ")
  1194. loadingRock.close();
  1195. }).finally(res=>{
  1196. loadingRock.close();
  1197. this.loading=false;
  1198. })
  1199. },
  1200. handleSyncAddMyExternalContact(){
  1201. this.loading=true;
  1202. let loadingRock = this.$loading({
  1203. lock: true,
  1204. text: '正在执行中请稍后~~请不要刷新页面!!',
  1205. spinner: 'el-icon-loading',
  1206. background: 'rgba(0, 0, 0, 0.7)'
  1207. });
  1208. syncMyAddExternalContact(this.queryParams.qwUserId).then(res => {
  1209. this.msgSuccess("同步成功");
  1210. this.loading=false;
  1211. loadingRock.close();
  1212. this.getList();
  1213. }).finally(()=>{
  1214. loadingRock.close();
  1215. this.loading=false;
  1216. })
  1217. },
  1218. updateTalk(row){
  1219. const ids = row.id || this.ids;
  1220. this.$confirm('是否确认批量更改用户信息为非首次交流', "警告", {
  1221. confirmButtonText: "确定",
  1222. cancelButtonText: "取消",
  1223. type: "warning"
  1224. }).then(function() {
  1225. return editTalk(ids);
  1226. }).then(() => {
  1227. this.getList();
  1228. this.msgSuccess("成功");
  1229. }).catch(() => {});
  1230. },
  1231. updateAllTalk(row){
  1232. const id = this.queryParams.qwUserId
  1233. this.$confirm('是否确认更改全部用户信息为非首次交流', "警告", {
  1234. confirmButtonText: "确定",
  1235. cancelButtonText: "取消",
  1236. type: "warning"
  1237. }).then(function() {
  1238. return editAllTalk(id);
  1239. }).then(() => {
  1240. this.getList();
  1241. this.msgSuccess("成功");
  1242. }).catch(() => {});
  1243. },
  1244. /** 导出按钮操作 */
  1245. handleExport() {
  1246. const queryParams = this.queryParams;
  1247. this.$confirm('是否确认导出所有企业微信客户数据项?', "警告", {
  1248. confirmButtonText: "确定",
  1249. cancelButtonText: "取消",
  1250. type: "warning"
  1251. }).then(() => {
  1252. this.exportLoading = true;
  1253. return exportExternalContact(queryParams);
  1254. }).then(response => {
  1255. this.download(response.msg);
  1256. this.exportLoading = false;
  1257. }).catch(() => {});
  1258. }
  1259. }
  1260. };
  1261. </script>
  1262. <style scoped>
  1263. /* CSS 样式 */
  1264. .tag-container {
  1265. display: flex;
  1266. flex-wrap: wrap; /* 超出宽度时自动换行 */
  1267. gap: 8px; /* 设置标签之间的间距 */
  1268. }
  1269. .name-background {
  1270. display: inline-block;
  1271. background-color: #abece6; /* 背景颜色 */
  1272. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  1273. border-radius: 4px; /* 可选:设置圆角 */
  1274. }
  1275. .tag-box {
  1276. padding: 8px 12px;
  1277. border: 1px solid #989797;
  1278. border-radius: 4px;
  1279. cursor: pointer;
  1280. display: inline-block;
  1281. }
  1282. .tag-selected {
  1283. background-color: #00bc98;
  1284. color: #fff;
  1285. border-color: #00bc98;
  1286. }
  1287. .el-tag + .el-tag {
  1288. margin-left: 10px;
  1289. }
  1290. .button-new-tag {
  1291. margin-left: 10px;
  1292. height: 32px;
  1293. line-height: 30px;
  1294. padding-top: 0;
  1295. padding-bottom: 0;
  1296. }
  1297. .input-new-tag {
  1298. width: 90px;
  1299. margin-left: 10px;
  1300. vertical-align: bottom;
  1301. }
  1302. </style>