myExternalContact.vue 69 KB

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