myExternalContact.vue 68 KB

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