CustomerList.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531
  1. <template>
  2. <ContainerQuery>
  3. <div slot="tip" class="page-tip-div" style="margin-top: 0">
  4. <i class="el-icon-info"></i>
  5. 温馨提示:
  6. <span>1、已审核客户只有在禁用后才能编辑!</span>
  7. <span>2、后台手动新增的客户自动审核!</span>
  8. </div>
  9. <div v-if="systemType === 1" slot="left">
  10. <el-dropdown
  11. v-if="$accessCheck($Access.CustomerListAddCustomer)"
  12. split-button
  13. type="primary"
  14. @click="$router.push('/Customer/CustomerAdmin/AddCustomer')"
  15. >
  16. 新增客户
  17. <el-dropdown-menu slot="dropdown">
  18. <el-dropdown-item>
  19. <div
  20. v-if="$accessCheck($Access.CustomerListExport)"
  21. class="dropdown-div"
  22. @click="exportData"
  23. >
  24. 导出
  25. </div>
  26. </el-dropdown-item>
  27. <el-dropdown-item>
  28. <div
  29. class="dropdown-div"
  30. @click="$router.push('/Customer/CustomerAdmin/CustomerImport')"
  31. >
  32. 导入
  33. </div>
  34. </el-dropdown-item>
  35. </el-dropdown-menu>
  36. </el-dropdown>
  37. <el-button v-else size="small" type="primary" @click="exportData">
  38. 导出
  39. </el-button>
  40. <el-dialog
  41. :close-on-press-escape="false"
  42. :close-on-click-modal="false"
  43. title="批量设置业务员"
  44. :visible.sync="batchSettingVisible"
  45. >
  46. <el-form :model="batchSetting" :inline="true">
  47. <el-form-item label="部门:" :label-width="batchSettingWidth">
  48. <DepartmentSel
  49. v-model="departmentPidPath"
  50. clearable
  51. size="small"
  52. @change="departmentChange"
  53. />
  54. </el-form-item>
  55. <el-form-item label="业务员:" :label-width="batchSettingWidth">
  56. <el-select v-model="saleman" placeholder="请选择业务员">
  57. <el-option
  58. v-for="item in options"
  59. :key="item.id"
  60. :label="item.staffName"
  61. :value="item.id"
  62. ></el-option>
  63. </el-select>
  64. </el-form-item>
  65. </el-form>
  66. <div slot="footer" class="dialog-footer">
  67. <el-button @click="batchSettingVisible = false">取 消</el-button>
  68. <el-button type="primary" @click="batchSettingCon">确 定</el-button>
  69. </div>
  70. </el-dialog>
  71. <el-dialog
  72. :close-on-press-escape="false"
  73. :close-on-click-modal="false"
  74. title="批量客户类型"
  75. :visible.sync="batchSettingType"
  76. width="30%"
  77. @close="closeSettingType"
  78. >
  79. <el-form :model="batchSetting" :inline="true" label-width="100px">
  80. <el-form-item label="客户类型:">
  81. <el-select v-model="batchSetting.type" placeholder="请选择业务员">
  82. <el-option
  83. v-for="item in customerType"
  84. :key="item.id"
  85. :label="item.name"
  86. :value="item.id"
  87. ></el-option>
  88. </el-select>
  89. </el-form-item>
  90. </el-form>
  91. <div slot="footer" class="dialog-footer">
  92. <el-button @click="closeSettingType">取 消</el-button>
  93. <el-button type="primary" @click="setCustomerType">确 定</el-button>
  94. </div>
  95. </el-dialog>
  96. </div>
  97. <div v-if="$accessCheck($Access.CustomerListSearch)" slot="more">
  98. <el-form :inline="true" size="small">
  99. <el-form-item>
  100. <el-input
  101. v-model="search_form.keyword"
  102. placeholder="客户名称/联系人电话"
  103. style="width: 220px"
  104. clearable
  105. @keyup.enter.native="getUserList()"
  106. @clear="getUserList()"
  107. >
  108. <el-button
  109. slot="append"
  110. icon="el-icon-search"
  111. @click="getUserList()"
  112. ></el-button>
  113. </el-input>
  114. </el-form-item>
  115. <!-- <el-form-item>-->
  116. <!-- <el-input-->
  117. <!-- v-model="search_form.phone"-->
  118. <!-- placeholder="请输入客户手机号"-->
  119. <!-- style="width: 220px"-->
  120. <!-- clearable-->
  121. <!-- @keyup.enter.native="getUserList()"-->
  122. <!-- @clear="getUserList()"-->
  123. <!-- >-->
  124. <!-- <el-button-->
  125. <!-- slot="append"-->
  126. <!-- icon="el-icon-search"-->
  127. <!-- @click="getUserList()"-->
  128. <!-- ></el-button>-->
  129. <!-- </el-input>-->
  130. <!-- </el-form-item>-->
  131. <el-form-item>
  132. <el-select
  133. v-model="search_form.salesManId"
  134. clearable
  135. placeholder="选择业务员"
  136. style="width: 150px"
  137. @change="pageChange(1)"
  138. >
  139. <el-option
  140. v-for="(item, index) in options"
  141. :key="index"
  142. :label="item.staffName"
  143. :value="item.id"
  144. ></el-option>
  145. </el-select>
  146. </el-form-item>
  147. <el-form-item v-if="false">
  148. <el-select v-model="search_form.type" placeholder="客户类型">
  149. <el-option
  150. v-for="item in UserType"
  151. :key="item.value"
  152. :label="item.label"
  153. :value="item.value"
  154. ></el-option>
  155. </el-select>
  156. </el-form-item>
  157. <el-form-item>
  158. <RegionSelect
  159. v-model="region"
  160. size="small"
  161. clearable
  162. check-strictly
  163. placeholder="所属区域"
  164. style="width: 150px"
  165. @change="regionChange"
  166. />
  167. </el-form-item>
  168. <el-form-item v-if="systemType === 1">
  169. <SelectShop
  170. v-model="search_form.shopId"
  171. :clearable="true"
  172. placeholder="所属商铺"
  173. width="150"
  174. @clear="shopClear"
  175. @change="selShop"
  176. />
  177. </el-form-item>
  178. <el-form-item>
  179. <el-select
  180. v-model="search_form.enableStatus"
  181. style="width: 150px"
  182. placeholder="客户状态"
  183. @change="customerChange"
  184. >
  185. <el-option
  186. v-for="item in customerStatus"
  187. :key="item.value"
  188. :label="item.label"
  189. :value="item.value"
  190. ></el-option>
  191. </el-select>
  192. </el-form-item>
  193. <!-- <el-form-item v-if="systemType === 1">-->
  194. <!-- <SelMembership-->
  195. <!-- v-model="search_form.membershipId"-->
  196. <!-- :clearable="true"-->
  197. <!-- placeholder="选择会员卡"-->
  198. <!-- width="150"-->
  199. <!-- @clear="membershipClear"-->
  200. <!-- @change="selMembershipId"-->
  201. <!-- />-->
  202. <!-- </el-form-item>-->
  203. <!-- <el-form-item>-->
  204. <!-- <DepartmentSel-->
  205. <!-- v-model="department"-->
  206. <!-- clearable-->
  207. <!-- placeholder="所属部门"-->
  208. <!-- width="150"-->
  209. <!-- @change="selBranch"-->
  210. <!-- />-->
  211. <!-- </el-form-item>-->
  212. <!--<el-form-item>
  213. <el-select
  214. v-model="search_form.source"
  215. clearable
  216. placeholder="注册来源"
  217. style="width: 150px"
  218. @change="pageChange(1)"
  219. >
  220. <el-option
  221. v-for="(item, index) in source_list"
  222. :key="index"
  223. :label="item.label"
  224. :value="item.value"
  225. ></el-option>
  226. </el-select>
  227. </el-form-item>-->
  228. <!--<el-form-item>
  229. <el-input
  230. v-model="search_form.tag"
  231. clearable
  232. placeholder="客户标签"
  233. style="width: 155px"
  234. @keyup.enter.native="pageChange(1)"
  235. @clear="pageChange(1)"
  236. >
  237. <el-button
  238. slot="append"
  239. icon="el-icon-search"
  240. @click="pageChange(1)"
  241. ></el-button>
  242. </el-input>
  243. </el-form-item>-->
  244. </el-form>
  245. </div>
  246. <el-table
  247. ref="customerTable"
  248. :data="tableData"
  249. @selection-change="handleSelectionChange"
  250. >
  251. <el-table-column
  252. align="center"
  253. type="selection"
  254. width="55"
  255. ></el-table-column>
  256. <el-table-column
  257. prop="id"
  258. label="ID"
  259. fixed="left"
  260. width="80"
  261. ></el-table-column>
  262. <el-table-column prop="name" label="客户" fixed="left" min-width="280">
  263. <template slot-scope="scope">
  264. <div class="clearfix">
  265. <div class="float_left customer-img-view">
  266. <img
  267. v-if="scope.row.avatar"
  268. class="customer-img"
  269. :src="scope.row.avatar"
  270. />
  271. </div>
  272. <div class="float_left customer-name-view">
  273. <p class="customer-name">
  274. {{ scope.row.name }}
  275. </p>
  276. <p>{{ scope.row.code }}</p>
  277. </div>
  278. </div>
  279. </template>
  280. </el-table-column>
  281. <el-table-column label="联系信息" min-width="180" prop="contact">
  282. <template slot-scope="scope">
  283. <div>
  284. <p v-if="scope.row.contact[0]">
  285. <span class="table-label">联系人:</span>
  286. <span class="table-val">
  287. {{ scope.row.contact[0].name || "无" }}
  288. </span>
  289. </p>
  290. <p>
  291. <span class="table-label">账号/电话:</span>
  292. <span class="table-val">{{ scope.row.mobile }}</span>
  293. </p>
  294. </div>
  295. </template>
  296. </el-table-column>
  297. <el-table-column
  298. v-if="typeFlag"
  299. prop="customerType"
  300. label="客户类型"
  301. min-width="100"
  302. ></el-table-column>
  303. <el-table-column
  304. v-if="systemType === 1"
  305. prop="memberBalance"
  306. label="余额"
  307. min-width="180"
  308. >
  309. <!-- <template slot-scope="scope">-->
  310. <!-- <div-->
  311. <!-- v-if="-->
  312. <!-- scope.row.balance_false_visible &&-->
  313. <!-- $accessCheck($Access.CustomerListupdateBalance)-->
  314. <!-- "-->
  315. <!-- >-->
  316. <!-- &lt;!&ndash; <el-select&ndash;&gt;-->
  317. <!-- &lt;!&ndash; v-model="balance_type"&ndash;&gt;-->
  318. <!-- &lt;!&ndash; style="width: 60px"&ndash;&gt;-->
  319. <!-- &lt;!&ndash; placeholder="请选择"&ndash;&gt;-->
  320. <!-- &lt;!&ndash; size="mini"&ndash;&gt;-->
  321. <!-- &lt;!&ndash; >&ndash;&gt;-->
  322. <!-- &lt;!&ndash; <el-option&ndash;&gt;-->
  323. <!-- &lt;!&ndash; v-for="item in type_options"&ndash;&gt;-->
  324. <!-- &lt;!&ndash; :key="item.type"&ndash;&gt;-->
  325. <!-- &lt;!&ndash; :label="item.label"&ndash;&gt;-->
  326. <!-- &lt;!&ndash; :value="item.type"&ndash;&gt;-->
  327. <!-- &lt;!&ndash; ></el-option>&ndash;&gt;-->
  328. <!-- &lt;!&ndash; </el-select>&ndash;&gt;-->
  329. <!-- <el-input-number-->
  330. <!-- v-model="member_balance"-->
  331. <!-- style="width: calc(100% - 88px)"-->
  332. <!-- :controls="false"-->
  333. <!-- size="mini"-->
  334. <!-- @keyup.enter.native="rechargeMemberBalance(scope.$index)"-->
  335. <!-- ></el-input-number>-->
  336. <!-- <div-->
  337. <!-- class="virtualSalesNum-btn"-->
  338. <!-- @click="rechargeMemberBalance(scope.$index)"-->
  339. <!-- >-->
  340. <!-- <i class="el-icon-check"></i>-->
  341. <!-- </div>-->
  342. <!-- </div>-->
  343. <!-- <div v-else @click="showSetBalance(scope.$index)">-->
  344. <!-- {{ scope.row.memberBalance }}-->
  345. <!-- <el-button-->
  346. <!-- v-if="$accessCheck($Access.CustomerListupdateBalance)"-->
  347. <!-- type="text"-->
  348. <!-- icon="el-icon-edit"-->
  349. <!-- ></el-button>-->
  350. <!-- </div>-->
  351. <!-- </template>-->
  352. </el-table-column>
  353. <el-table-column
  354. v-if="systemType === 1"
  355. prop="integral"
  356. label="积分"
  357. min-width="180"
  358. >
  359. <template slot-scope="scope">
  360. <div
  361. v-if="
  362. scope.row.integral_false_visible &&
  363. $accessCheck($Access.CustomerListupdateIntegral)
  364. "
  365. >
  366. <el-select
  367. v-model="integral_type"
  368. style="width: 60px"
  369. placeholder="请选择"
  370. size="mini"
  371. >
  372. <el-option
  373. v-for="item in type_options"
  374. :key="item.type"
  375. :label="item.label"
  376. :value="item.type"
  377. ></el-option>
  378. </el-select>
  379. <el-input-number
  380. v-model="integral_num"
  381. style="width: calc(100% - 88px)"
  382. :controls="false"
  383. size="mini"
  384. @keyup.enter.native="updateCustomerIntegral(scope.$index)"
  385. ></el-input-number>
  386. <div
  387. class="virtualSalesNum-btn"
  388. @click="updateCustomerIntegral(scope.$index)"
  389. >
  390. <i class="el-icon-check"></i>
  391. </div>
  392. </div>
  393. <div v-else @click="showSetIntegral(scope.$index)">
  394. {{ scope.row.integral }}
  395. <el-button
  396. v-if="$accessCheck($Access.CustomerListupdateIntegral)"
  397. type="text"
  398. icon="el-icon-edit"
  399. ></el-button>
  400. </div>
  401. </template>
  402. </el-table-column>
  403. <el-table-column
  404. v-if="shopFlag && systemType === 1"
  405. prop="shopName"
  406. label="商铺"
  407. min-width="120"
  408. :show-overflow-tooltip="true"
  409. >
  410. <template slot-scope="scope">
  411. {{ scope.row.shopName || "平台" }}
  412. </template>
  413. </el-table-column>
  414. <el-table-column
  415. v-if="salesmanFlag"
  416. prop="salesManName"
  417. label="业务员"
  418. min-width="140"
  419. >
  420. <template slot-scope="scope">
  421. <div>
  422. <p>
  423. <span class="table-label">业务员:</span>
  424. <span class="table-val">
  425. {{ scope.row.salesManName || "--" }}
  426. </span>
  427. </p>
  428. <p>
  429. <span class="table-label">部门:</span>
  430. <span class="table-val">
  431. {{ scope.row.departmentName || "--" }}
  432. </span>
  433. </p>
  434. </div>
  435. </template>
  436. </el-table-column>
  437. <el-table-column
  438. v-if="auditStatusFlag && systemType === 1"
  439. prop="status"
  440. label="审核状态"
  441. min-width="100"
  442. >
  443. <template slot-scope="scope">
  444. <span v-if="scope.row.status === 2" class="success-status">
  445. 已审核
  446. </span>
  447. <span v-if="scope.row.status === 1" class="warning-status">
  448. 待审核
  449. </span>
  450. <span v-if="scope.row.status === 0" class="info-status">
  451. 待完善资料
  452. </span>
  453. <span v-if="scope.row.status === 3" class="success-status">
  454. 已驳回
  455. </span>
  456. </template>
  457. </el-table-column>
  458. <el-table-column
  459. v-if="timeFlag"
  460. prop="createTime"
  461. label="注册时间"
  462. min-width="160"
  463. >
  464. <template slot-scope="scope">
  465. {{ $_common.formatDate(scope.row.createTime) }}
  466. </template>
  467. </el-table-column>
  468. <el-table-column
  469. v-if="accountStatusFlag && systemType === 1"
  470. prop="enableStatus"
  471. label="账号状态"
  472. min-width="100"
  473. >
  474. <template slot-scope="scope">
  475. <el-switch
  476. v-if="$accessCheck($Access.CustomerListUpdateCustomerStatus)"
  477. v-model="scope.row.enableStatus"
  478. class="switchStyle"
  479. active-color="#36B365"
  480. :active-value="5"
  481. :inactive-value="4"
  482. active-text="启用"
  483. inactive-text="禁用"
  484. @change="updateEnableStatus($event, scope.row)"
  485. ></el-switch>
  486. <div v-else>
  487. <span v-if="scope.row.enableStatus === 5" class="success-status">
  488. 启用
  489. </span>
  490. <span v-else class="danger-status">禁用</span>
  491. </div>
  492. </template>
  493. </el-table-column>
  494. <el-table-column
  495. v-if="systemType === 1"
  496. label="操作"
  497. header-
  498. fixed="right"
  499. width="170"
  500. >
  501. <template slot="header" slot-scope="scope">
  502. <span v-if="false">{{ scope.$index }}</span>
  503. <span class="operation">操作</span>
  504. <el-popover popper-class="custom-table-checkbox" trigger="click">
  505. <el-checkbox-group v-model="checkList">
  506. <el-checkbox
  507. v-for="(item, index) in columns"
  508. :key="index"
  509. :label="item.label"
  510. @change="change"
  511. ></el-checkbox>
  512. </el-checkbox-group>
  513. <el-button
  514. slot="reference"
  515. icon="el-icon-setting"
  516. type="text"
  517. ></el-button>
  518. </el-popover>
  519. </template>
  520. <template slot-scope="scope">
  521. <el-button
  522. v-if="$accessCheck($Access.CustomerListGetCustomerInfo)"
  523. type="text"
  524. @click="
  525. $router.push(
  526. `/Customer/CustomerAdmin/CustomerDetail/${scope.row.id}`
  527. )
  528. "
  529. >
  530. 查看
  531. </el-button>
  532. <el-button
  533. v-if="$accessCheck($Access.CustomerListEditCustomer)"
  534. type="text"
  535. :disabled="scope.row.shopId !== storeData.id && systemType !== 1"
  536. @click="editData(scope.row)"
  537. >
  538. 编辑
  539. </el-button>
  540. <el-dropdown>
  541. <span class="el-dropdown-link">
  542. 更多
  543. <i class="el-icon-arrow-down el-icon--right"></i>
  544. </span>
  545. <el-dropdown-menu slot="dropdown">
  546. <el-dropdown-item
  547. v-if="$accessCheck($Access.CustomerListvisitedLogs)"
  548. >
  549. <div
  550. class="dropdown-div"
  551. @click="openFollowUpRecords(scope.row.id)"
  552. >
  553. 跟进记录
  554. </div>
  555. </el-dropdown-item>
  556. <el-dropdown-item
  557. v-if="$accessCheck($Access.CustomerListIntegralDetail)"
  558. >
  559. <div
  560. class="dropdown-div"
  561. @click="
  562. $router.push(
  563. `/Customer/CustomerAdmin/IntegralDetail/${scope.row.id}`
  564. )
  565. "
  566. >
  567. 积分明细
  568. </div>
  569. </el-dropdown-item>
  570. <el-dropdown-item
  571. v-if="$accessCheck($Access.CustomerListSaldoDetail)"
  572. >
  573. <div
  574. class="dropdown-div"
  575. @click="
  576. $router.push(
  577. '/Customer/CustomerAdmin/SaldoDetail?id=' +
  578. scope.row.id +
  579. '&name=' +
  580. scope.row.name +
  581. '&money=' +
  582. scope.row.memberBalance
  583. )
  584. "
  585. >
  586. 余额明细
  587. </div>
  588. </el-dropdown-item>
  589. <el-dropdown-item>
  590. <div
  591. class="dropdown-div"
  592. @click="delCustomer(scope.row.userCenterId)"
  593. >
  594. 删除
  595. </div>
  596. </el-dropdown-item>
  597. </el-dropdown-menu>
  598. </el-dropdown>
  599. </template>
  600. </el-table-column>
  601. <el-table-column v-else label="操作" header- fixed="right" width="100">
  602. <template slot-scope="scope">
  603. <el-button
  604. v-if="$accessCheck($Access.CustomerListGetCustomerInfo)"
  605. type="text"
  606. @click="
  607. $router.push(
  608. `/Customer/CustomerAdmin/CustomerDetail/${scope.row.id}`
  609. )
  610. "
  611. >
  612. 查看
  613. </el-button>
  614. </template>
  615. </el-table-column>
  616. </el-table>
  617. <FooterPage
  618. :page-size="pageSize"
  619. :total-page.sync="total"
  620. :current-page.sync="page"
  621. @pageChange="pageChange"
  622. @sizeChange="sizeChange"
  623. >
  624. <div slot="btn-div" class="foot-btn-div">
  625. <span class="batch-checkbox">
  626. <el-checkbox
  627. v-model="checkedAll"
  628. @change="checkAllChange"
  629. ></el-checkbox>
  630. </span>
  631. <el-button
  632. v-if="$accessCheck($Access.CustomerListExport)"
  633. size="mini"
  634. @click="clickBatchSetting"
  635. >
  636. 批量设置业务员
  637. </el-button>
  638. <el-button size="mini" @click="clickSettingType">
  639. 批量设置客户类型
  640. </el-button>
  641. <el-button size="mini" @click="batchDelCustomer">
  642. 批量删除客户
  643. </el-button>
  644. </div>
  645. </FooterPage>
  646. <el-drawer
  647. class="edit-drawer"
  648. size="50%"
  649. :title="drawer_tit"
  650. :visible.sync="drawer"
  651. >
  652. <EditCustomer
  653. v-if="drawer"
  654. :customer-id="customer_id"
  655. @subSuccess="subSuccess"
  656. @goShop="drawer = false"
  657. />
  658. </el-drawer>
  659. <!-- 跟进记录弹出框-->
  660. <el-dialog
  661. title="跟进记录"
  662. :visible.sync="followUpRecordsFlag"
  663. width="40%"
  664. :close-on-press-escape="false"
  665. :close-on-click-modal="false"
  666. >
  667. <div style="margin-bottom: 10px">
  668. <el-input
  669. v-model="search_form.content"
  670. type="textarea"
  671. :rows="3"
  672. placeholder="请填写跟进内容(最多500字)"
  673. style="width: 250px"
  674. size="mini"
  675. ></el-input>
  676. <span style="margin: 0 20px 0 20px">
  677. 跟进人
  678. <el-input
  679. v-model="search_form.staff"
  680. clearable
  681. placeholder="请选择业务员"
  682. style="width: 130px"
  683. size="mini"
  684. @clear="staffClear"
  685. @blur="search_form.staff = ''"
  686. >
  687. <i
  688. slot="suffix"
  689. class="el-input__icon el-icon-search"
  690. @click="saleFn(true)"
  691. ></i>
  692. </el-input>
  693. </span>
  694. <span>
  695. 时间
  696. <el-date-picker
  697. v-model="search_form.time"
  698. type="datetime"
  699. placeholder="选择日期时间"
  700. size="mini"
  701. style="width: 130px; margin-bottom: 18px"
  702. ></el-date-picker>
  703. </span>
  704. <span style="margin-left: 20px">
  705. <el-button
  706. type="primary"
  707. size="mini"
  708. @click="addCustomerCommunication"
  709. >
  710. 添加
  711. </el-button>
  712. </span>
  713. </div>
  714. <el-divider></el-divider>
  715. <el-table :data="followList" style="width: 100%">
  716. <el-table-column type="index" label="序号"></el-table-column>
  717. <el-table-column prop="content" label="内容"></el-table-column>
  718. <el-table-column prop="staffName" label="跟进人"></el-table-column>
  719. <el-table-column prop="time" label="时间">
  720. <template slot-scope="scope">
  721. {{ $_common.formatDate(scope.row.time) }}
  722. </template>
  723. </el-table-column>
  724. <el-table-column label="操作">
  725. <template slot-scope="scope">
  726. <el-button type="text" @click="updateFollow(scope.row)">
  727. 修改
  728. </el-button>
  729. <el-button
  730. type="text"
  731. @click="delCustomerCommunication(scope.row.id)"
  732. >
  733. 删除
  734. </el-button>
  735. </template>
  736. </el-table-column>
  737. </el-table>
  738. <div class="clearfix">
  739. <FooterPage
  740. :page-size="followPageSize"
  741. :total-page.sync="followTotal"
  742. :current-page.sync="followPage"
  743. layout="prev, pager, next"
  744. @pageChange="handleCurrentChange"
  745. ></FooterPage>
  746. </div>
  747. <el-dialog
  748. width="20%"
  749. title="修改"
  750. :visible.sync="coreFlag"
  751. append-to-body
  752. center
  753. :close-on-press-escape="false"
  754. :close-on-click-modal="false"
  755. >
  756. <el-input
  757. v-model="updateFollowList"
  758. type="textarea"
  759. :rows="7"
  760. ></el-input>
  761. <div class="clearfix" style="margin-top: 10px">
  762. <el-button size="mini" class="float_right" @click="coreFlag = false">
  763. 取消
  764. </el-button>
  765. <el-button
  766. type="primary"
  767. size="mini"
  768. class="float_right"
  769. style="margin-right: 10px"
  770. @click="putUpdateFollow"
  771. >
  772. 确定
  773. </el-button>
  774. </div>
  775. </el-dialog>
  776. </el-dialog>
  777. <staffListModal
  778. v-if="staff_show"
  779. :is-show="staff_show"
  780. :is-check="false"
  781. :isserch="isserch"
  782. @cancel="staff_show = false"
  783. @confirm="staffSel"
  784. />
  785. </ContainerQuery>
  786. </template>
  787. <script>
  788. import staffListModal from "@/component/common/staffListModal";
  789. import DepartmentSel from "@/component/common/DepartmentSel";
  790. import RegionSelect from "@/component/common/RegionSelectJSON";
  791. import EditCustomer from "./AddCustomer";
  792. import SelectShop from "@/component/goods/SelectShop.vue";
  793. // import SelMembership from "@/component/goods/SelMembership.vue";
  794. import { getAllStaff } from "@/api/Department";
  795. import {
  796. batchEditCustomer,
  797. updateCustomerStatus,
  798. updateCustomerCheckStatus,
  799. getAllCustomer,
  800. customerExport,
  801. // searchCustomer,
  802. delCustomer,
  803. getAllCustomerCommunication,
  804. addCustomerCommunication,
  805. delCustomerCommunication,
  806. updateCustomerCommunication,
  807. updateCustomerIntegral,
  808. rechargeMemberBalance,
  809. setCustomerType,
  810. } from "@/api/Customer";
  811. import { getCustomerSourceList } from "@/api/System";
  812. import { mapGetters } from "vuex";
  813. export default {
  814. name: "CustomerList",
  815. components: {
  816. DepartmentSel,
  817. RegionSelect,
  818. EditCustomer,
  819. SelectShop,
  820. staffListModal,
  821. // SelMembership,
  822. },
  823. data() {
  824. return {
  825. type_options: [
  826. {
  827. type: 5,
  828. label: "加",
  829. },
  830. {
  831. type: 4,
  832. label: "减",
  833. },
  834. ],
  835. balance_type: 5, // 积分
  836. integral_type: 5, // 余额
  837. integral_num: 0, // 积分
  838. member_balance: 0, //余额
  839. followList: [],
  840. order_id: "",
  841. staff_show: false,
  842. checkedAll: false,
  843. customer_id: 0,
  844. drawer_tit: "",
  845. drawer: false,
  846. contact: [],
  847. department: [],
  848. region: [],
  849. search_form: {
  850. phone: "",
  851. page: this.page,
  852. pageSize: this.pageSize,
  853. keyword: "",
  854. type: "",
  855. provinceCode: "",
  856. cityCode: "",
  857. districtCode: "",
  858. enableStatus: "",
  859. departmentId: "",
  860. shopId: "", // 商铺Id
  861. // membershipId: "", //会员卡id
  862. time: "",
  863. content: "",
  864. salesManId: "",
  865. source: "",
  866. tag: "",
  867. },
  868. UserType: [
  869. {
  870. value: "1",
  871. label: "客户类型",
  872. },
  873. ],
  874. customerLabel: [
  875. {
  876. value: "选项1",
  877. label: "客户标签",
  878. },
  879. ],
  880. customerStatus: [
  881. {
  882. value: "5",
  883. label: "已启用",
  884. },
  885. {
  886. value: "4",
  887. label: "已停用",
  888. },
  889. ],
  890. value: "",
  891. formLabelWidth: "100px",
  892. checked: false,
  893. form: {
  894. key: "",
  895. type: "",
  896. classify: [],
  897. brand: "",
  898. },
  899. total: 0,
  900. page: 1,
  901. pageSize: 10,
  902. roleId: "",
  903. search_key: "",
  904. departmentPidPath: [],
  905. tableData: [],
  906. total_count: 0,
  907. batchSettingVisible: false, // 批量设置业务员显示控制
  908. batchSettingType: false, // 批量设置客户类型显示控制
  909. batchSetting: {
  910. region: "",
  911. type: "",
  912. },
  913. batchSettingWidth: "80px", // 批量设置业务员中"部门:"的长度
  914. options: [], // 业务员列表数组
  915. ids: [], // 客户id数组
  916. userCenterIds: [], // 客户id数组
  917. departmentId: "", // 部门id
  918. saleman: "", // 业务员id
  919. selection: [], // 客户列表选中数组
  920. checkList: [
  921. "客户类型",
  922. "商铺",
  923. "业务员",
  924. "审核状态",
  925. "注册时间",
  926. "帐号状态",
  927. ],
  928. columns: [
  929. {
  930. label: "客户类型",
  931. },
  932. {
  933. label: "商铺",
  934. },
  935. {
  936. label: "业务员",
  937. },
  938. {
  939. label: "审核状态",
  940. },
  941. {
  942. label: "注册时间",
  943. },
  944. {
  945. label: "帐号状态",
  946. },
  947. ],
  948. typeFlag: true,
  949. shopFlag: true,
  950. salesmanFlag: true,
  951. auditStatusFlag: true,
  952. timeFlag: true,
  953. accountStatusFlag: true,
  954. followUpRecordsFlag: false,
  955. coreFlag: false,
  956. isserch: true,
  957. searchDate: {},
  958. customerId: "",
  959. followPage: 1,
  960. followPageSize: 10,
  961. followTotal: 0,
  962. updateFollowValue: {},
  963. updateFollowList: "",
  964. source_list: [
  965. {
  966. label: "ios",
  967. tag: "ios",
  968. value: 1,
  969. },
  970. {
  971. label: "安卓APP",
  972. tag: "android",
  973. value: 2,
  974. },
  975. {
  976. label: "小程序",
  977. tag: "miniProgram",
  978. value: 3,
  979. },
  980. {
  981. label: "后台创建",
  982. tag: "manage",
  983. value: 4,
  984. },
  985. {
  986. label: "H5页面",
  987. tag: "H5",
  988. value: 5,
  989. },
  990. {
  991. label: "Pc页面",
  992. tag: "Pc",
  993. value: 6,
  994. },
  995. ],
  996. customerType: [],
  997. };
  998. },
  999. computed: {
  1000. ...mapGetters({
  1001. storeData: "MUser/storeData",
  1002. }),
  1003. },
  1004. async mounted() {
  1005. if ([2, 3].includes(this.systemType)) {
  1006. // this.search_form.shopId = this.storeData.id;
  1007. }
  1008. // 到期提示
  1009. await this.enterExpireTime();
  1010. await this.getUserList();
  1011. },
  1012. activated() {
  1013. if (this.$_isInit()) return;
  1014. this.getUserList();
  1015. },
  1016. created() {
  1017. this.getAllStaff();
  1018. this.getCustomerSourceList();
  1019. },
  1020. methods: {
  1021. showSetIntegral(index) {
  1022. this.tableData.forEach((item) => (item.integral_false_visible = false));
  1023. this.integral_num = this.tableData[index].integral;
  1024. this.tableData[index].integral_false_visible = true;
  1025. },
  1026. showSetBalance(index) {
  1027. this.tableData.forEach((item) => (item.balance_false_visible = false));
  1028. this.member_balance = this.tableData[index].memberBalance;
  1029. this.tableData[index].balance_false_visible = true;
  1030. },
  1031. // 修改积分
  1032. async updateCustomerIntegral(index) {
  1033. if (this.integral_num <= 0) {
  1034. this.$message.warning("请输入大于0的值");
  1035. return;
  1036. }
  1037. const data = await updateCustomerIntegral({
  1038. customerId: this.tableData[index].id,
  1039. integral: this.integral_num,
  1040. type: this.integral_type,
  1041. desc: "系统充值",
  1042. });
  1043. this.$message.success("修改成功");
  1044. this.tableData[index].integral_false_visible = false;
  1045. this.getUserList();
  1046. },
  1047. // 修改余额
  1048. async rechargeMemberBalance(index) {
  1049. if (this.member_balance <= 0) {
  1050. this.$message.warning("请输入大于0的值");
  1051. return;
  1052. }
  1053. const data = await rechargeMemberBalance({
  1054. customerId: this.tableData[index].id,
  1055. money: this.member_balance,
  1056. type: this.balance_type,
  1057. purpose: "系统充值",
  1058. });
  1059. this.$message.success("修改成功");
  1060. this.tableData[index].balance_false_visible = false;
  1061. this.getUserList();
  1062. },
  1063. // 批量设置业务员确定
  1064. departmentChange(val) {
  1065. if (val.length) {
  1066. this.departmentId = val;
  1067. this.getAllStaff(val[val.length - 1]);
  1068. }
  1069. },
  1070. // 获取列表
  1071. async getAllStaff(departmentId) {
  1072. const data = await getAllStaff({
  1073. page: 1,
  1074. pageSize: 50,
  1075. departmentId: departmentId,
  1076. });
  1077. this.options = data.data;
  1078. },
  1079. // 列表双击事件
  1080. // goDetail(row) {
  1081. // if (!this.$accessCheck(this.$Access.CustomerListGetCustomerInfo)) {
  1082. // return;
  1083. // }
  1084. // this.$router.push(`/Customer/CustomerAdmin/CustomerDetail/${row.id}`);
  1085. // },
  1086. // 导出时事件
  1087. async exportData() {
  1088. const params = {
  1089. page: this.page,
  1090. pageSize: this.pageSize,
  1091. keyword: this.search_form.keyword,
  1092. type: this.search_form.type,
  1093. provinceCode: this.search_form.provinceCode,
  1094. cityCode: this.search_form.cityCode,
  1095. districtCode: this.search_form.districtCode,
  1096. status: 2,
  1097. enableStatus: this.search_form.enableStatus, // 禁用启用
  1098. departmentId: this.search_form.departmentId,
  1099. shopId: this.search_form.shopId,
  1100. salesManId: "",
  1101. start: "",
  1102. end: "",
  1103. };
  1104. const target = await customerExport(params);
  1105. },
  1106. // 没有用到事件
  1107. async updateAuditStatus(row) {
  1108. this.$confirm("确定要审核此用户吗?", "提示", {
  1109. confirmButtonText: "确定",
  1110. cancelButtonText: "取消",
  1111. type: "warning",
  1112. }).then(async () => {
  1113. const data = await updateCustomerCheckStatus({
  1114. id: row.id,
  1115. status: 2,
  1116. });
  1117. this.getUserList();
  1118. this.$message({
  1119. type: "success",
  1120. message: "审核成功",
  1121. });
  1122. });
  1123. },
  1124. // 查看组件子传父
  1125. subSuccess() {
  1126. this.drawer = false;
  1127. this.pageChange(1);
  1128. },
  1129. // 查看事件
  1130. editData(row) {
  1131. this.customer_id = row.id;
  1132. this.drawer_tit = row.name;
  1133. this.drawer = true;
  1134. },
  1135. // 选择商铺
  1136. selShop(val, row) {
  1137. this.pageChange(1);
  1138. },
  1139. //选择会员卡
  1140. // selMembershipId() {
  1141. // this.pageChange(1);
  1142. // },
  1143. shopClear() {
  1144. this.search_form.shopId = "";
  1145. this.pageChange(1);
  1146. },
  1147. // membershipClear() {
  1148. // this.search_form.membershipId = "";
  1149. // this.pageChange(1);
  1150. // },
  1151. // 选择部门
  1152. selBranch(val) {
  1153. this.search_form.departmentId = val[val.length - 1];
  1154. this.pageChange(1);
  1155. },
  1156. // 选择区域
  1157. regionChange(val) {
  1158. this.search_form.provinceCode = val[0];
  1159. this.search_form.cityCode = val[1];
  1160. this.search_form.districtCode = val[2];
  1161. this.pageChange(1);
  1162. },
  1163. // 客户状态
  1164. customerChange(val) {
  1165. this.search_form.enableStatus = val;
  1166. this.pageChange(1);
  1167. },
  1168. // 获取客户列表 getAllCustomer
  1169. async getAllCustomer() {
  1170. const data = await getAllCustomer({
  1171. page: this.page,
  1172. pageSize: this.pageSize,
  1173. status: 2,
  1174. shopId: this.search_form.shopId,
  1175. keyword: this.search_form.keyword,
  1176. enableStatus: this.search_form.enableStatus, // 禁用启用
  1177. salesManId: this.search_form.salesManId,
  1178. source: this.search_form.source,
  1179. tag: this.search_form.tag,
  1180. provinceCode: this.search_form.provinceCode,
  1181. cityCode: this.search_form.cityCode,
  1182. districtCode: this.search_form.districtCode,
  1183. });
  1184. this.tableData = data.data.map((item) => {
  1185. return {
  1186. ...item,
  1187. integral_false_visible: false,
  1188. balance_false_visible: false,
  1189. };
  1190. });
  1191. this.contact = data.data.contact;
  1192. this.total = data.pageTotal;
  1193. },
  1194. // 判断
  1195. getUserList() {
  1196. this.getAllCustomer();
  1197. },
  1198. // 删除接口
  1199. // delCustomer(id) {
  1200. // this.$confirm("你确定删除该用户", {
  1201. // confirmButtonText: "确定",
  1202. // cancelButtonText: "取消",
  1203. // type: "warning",
  1204. // }).then(async () => {
  1205. // const data = await delCustomer(id);
  1206. //
  1207. // this.getUserList();
  1208. // this.$message({
  1209. // type: "success",
  1210. // message: "删除成功!",
  1211. // });
  1212. // });
  1213. // },
  1214. // 禁用启用
  1215. async updateEnableStatus(val, row) {
  1216. try {
  1217. const data = await updateCustomerStatus({
  1218. id: row.id,
  1219. enableStatus: val,
  1220. });
  1221. this.$message({
  1222. type: "success",
  1223. message: "操作成功!",
  1224. });
  1225. } catch (e) {
  1226. this.getUserList();
  1227. }
  1228. },
  1229. // 切页
  1230. pageChange(val) {
  1231. this.page = val;
  1232. this.getUserList();
  1233. },
  1234. // 每页数据大小改变
  1235. sizeChange(val) {
  1236. this.pageSize = val;
  1237. this.pageChange(1);
  1238. },
  1239. // 点击-批量设置业务员
  1240. clickBatchSetting() {
  1241. if (this.selection.length > 0) {
  1242. this.batchSettingVisible = true;
  1243. } else {
  1244. this.$message({
  1245. type: "warning",
  1246. message: "请选择要操作的客户",
  1247. });
  1248. }
  1249. },
  1250. //批量设置客户类型
  1251. clickSettingType() {
  1252. if (this.selection.length > 0) {
  1253. this.batchSettingType = true;
  1254. } else {
  1255. this.$message({
  1256. type: "warning",
  1257. message: "请选择要操作的客户",
  1258. });
  1259. }
  1260. },
  1261. // 批量删除客户
  1262. batchDelCustomer() {
  1263. if (this.selection.length > 0) {
  1264. this.$confirm("确定要删除这些客户吗?", "提示", {
  1265. confirmButtonText: "确定",
  1266. cancelButtonText: "取消",
  1267. type: "warning",
  1268. }).then(async () => {
  1269. this.userCenterIds = this.selection.map(
  1270. (item) => item.userCenterId
  1271. );
  1272. const { data } = await delCustomer(this.userCenterIds);
  1273. this.$message({
  1274. type: "success",
  1275. message: "删除成功!",
  1276. });
  1277. this.pageChange(1);
  1278. });
  1279. } else {
  1280. this.$message({
  1281. type: "warning",
  1282. message: "请选择要操作的客户",
  1283. });
  1284. }
  1285. },
  1286. // 删除客户
  1287. delCustomer(id) {
  1288. this.$confirm("确定要删除该客户吗?", "提示", {
  1289. confirmButtonText: "确定",
  1290. cancelButtonText: "取消",
  1291. type: "warning",
  1292. }).then(async () => {
  1293. const { data } = await delCustomer([id]);
  1294. this.$message({
  1295. type: "success",
  1296. message: "删除成功!",
  1297. });
  1298. this.pageChange(1);
  1299. });
  1300. },
  1301. //批量设置客户类型关闭
  1302. closeSettingType() {
  1303. this.batchSetting.type = "";
  1304. this.batchSettingType = false;
  1305. },
  1306. // 请求-批量设置业务员
  1307. async batchEditCustomer() {
  1308. this.ids = this.selection.map((item) => item.id);
  1309. const params = {
  1310. ids: this.ids,
  1311. departmentId: this.departmentId[0],
  1312. salesManId: this.saleman,
  1313. };
  1314. const data = await batchEditCustomer(params);
  1315. this.getUserList();
  1316. },
  1317. // 确认-批量修改业务员
  1318. batchSettingCon() {
  1319. if (this.departmentId === "" || this.saleman === "") {
  1320. this.$message.error("请填写完整信息");
  1321. } else {
  1322. this.batchSettingVisible = false;
  1323. this.batchEditCustomer();
  1324. }
  1325. },
  1326. // 确认-批量修改客户类型
  1327. async setCustomerType() {
  1328. this.ids = this.selection.map((item) => item.id);
  1329. const params = {
  1330. customerIds: this.ids,
  1331. type: this.batchSetting.type,
  1332. };
  1333. const { data } = await setCustomerType(params);
  1334. this.$message.success("修改成功");
  1335. await this.closeSettingType();
  1336. this.getUserList();
  1337. },
  1338. handleSelectionChange(val) {
  1339. this.checkedAll = val.length === this.tableData.length;
  1340. this.selection = val;
  1341. },
  1342. checkAllChange() {
  1343. this.$refs.customerTable.toggleAllSelection();
  1344. },
  1345. change() {
  1346. this.typeFlag = this.checkList.some((item) => item === "客户类型");
  1347. this.shopFlag = this.checkList.some((item) => item === "商铺");
  1348. this.salesmanFlag = this.checkList.some((item) => item === "业务员");
  1349. this.auditStatusFlag = this.checkList.some(
  1350. (item) => item === "审核状态"
  1351. );
  1352. this.timeFlag = this.checkList.some((item) => item === "注册时间");
  1353. this.accountStatusFlag = this.checkList.some(
  1354. (item) => item === "帐号状态"
  1355. );
  1356. },
  1357. // 跟进记录第一次渲染列表
  1358. openFollowUpRecords(id) {
  1359. this.followPage = 1;
  1360. this.followUpRecordsFlag = true;
  1361. this.customerId = id;
  1362. this.followUpRecords();
  1363. },
  1364. // 跟进记录列表
  1365. async followUpRecords() {
  1366. const { data, pageTotal } = await getAllCustomerCommunication({
  1367. // staffId: "",
  1368. customerId: this.customerId,
  1369. // star: "",
  1370. // end: "",
  1371. page: this.followPage,
  1372. pageSize: this.followPageSize,
  1373. });
  1374. this.followList = data;
  1375. this.followTotal = pageTotal;
  1376. },
  1377. // 清除员工输入框
  1378. staffClear() {
  1379. this.searchDate.salesManId = "";
  1380. this.search_form.staff = "";
  1381. this.pageChange(1);
  1382. },
  1383. // 选择员工
  1384. staffSel(val) {
  1385. const row = val[0];
  1386. this.searchDate.salesManId = row.id;
  1387. this.search_form.staff = row.staffName;
  1388. this.handleCurrentChange(1);
  1389. },
  1390. async saleFn(isserch, id) {
  1391. this.staff_show = true;
  1392. this.isserch = isserch;
  1393. if (id) {
  1394. this.order_id = id;
  1395. }
  1396. },
  1397. // 跟进记录列表切页
  1398. async handleCurrentChange(val) {
  1399. this.followPage = val;
  1400. await this.followUpRecords();
  1401. },
  1402. // 跟进记录列表添加
  1403. async addCustomerCommunication() {
  1404. if (!this.search_form.content.trim()) {
  1405. this.$message.warning("跟进内容不能为空");
  1406. return;
  1407. }
  1408. const time = new Date(this.search_form.time).getTime() / 1000;
  1409. if (this.searchDate.salesManId && time && this.search_form.content) {
  1410. const data = await addCustomerCommunication({
  1411. customerId: this.customerId,
  1412. staffId: this.searchDate.salesManId,
  1413. content: this.search_form.content,
  1414. time: time,
  1415. });
  1416. await this.followUpRecords();
  1417. } else {
  1418. this.$message.warning("必须填写内容跟进人和时间");
  1419. }
  1420. },
  1421. // 跟进记录删除
  1422. delCustomerCommunication(id) {
  1423. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  1424. confirmButtonText: "确定",
  1425. cancelButtonText: "取消",
  1426. type: "warning",
  1427. })
  1428. .then(async () => {
  1429. const { data } = await delCustomerCommunication(id);
  1430. await this.followUpRecords();
  1431. this.$message({
  1432. type: "success",
  1433. message: "删除成功!",
  1434. });
  1435. })
  1436. .catch(() => {
  1437. this.$message({
  1438. type: "info",
  1439. message: "已取消删除",
  1440. });
  1441. });
  1442. },
  1443. // 跟进记录修改获取
  1444. updateFollow(value) {
  1445. this.coreFlag = true;
  1446. this.updateFollowValue = value;
  1447. this.updateFollowList = value.content;
  1448. },
  1449. // 跟进记录修改确认
  1450. async putUpdateFollow() {
  1451. this.coreFlag = false;
  1452. const { data } = await updateCustomerCommunication(
  1453. this.updateFollowValue.id,
  1454. {
  1455. customerId: this.updateFollowValue.customerId,
  1456. staffId: this.updateFollowValue.staffId,
  1457. content: this.updateFollowList,
  1458. time: this.updateFollowValue.time,
  1459. }
  1460. );
  1461. this.$message.success("修改成功");
  1462. await this.followUpRecords();
  1463. },
  1464. async getCustomerSourceList() {
  1465. const data = await getCustomerSourceList();
  1466. if (data.data.length) {
  1467. this.customerType = data.data;
  1468. } else {
  1469. this.customerType = [];
  1470. }
  1471. },
  1472. },
  1473. };
  1474. </script>
  1475. <style scoped lang="scss">
  1476. .customer-img-view {
  1477. width: 50px;
  1478. height: 50px;
  1479. background-color: #f4f4f4;
  1480. margin-right: 10px;
  1481. border-radius: 4px;
  1482. }
  1483. .customer-img {
  1484. width: 50px;
  1485. height: 50px;
  1486. border-radius: 4px;
  1487. }
  1488. .customer-name-view {
  1489. width: calc(100% - 86px);
  1490. }
  1491. .customer-name {
  1492. width: 100%;
  1493. overflow: hidden;
  1494. text-overflow: ellipsis;
  1495. display: -webkit-box;
  1496. -webkit-box-orient: vertical;
  1497. -webkit-line-clamp: 2;
  1498. }
  1499. .custom-table-checkbox {
  1500. .el-checkbox {
  1501. display: block !important;
  1502. margin: 0 05px 0;
  1503. }
  1504. }
  1505. .virtualSalesNum-btn {
  1506. width: 26px;
  1507. text-align: center;
  1508. line-height: 28px;
  1509. height: 28px;
  1510. vertical-align: middle;
  1511. font-size: 12px;
  1512. background: #f5f5f5;
  1513. border: 1px solid #cad0d7;
  1514. display: inline-block;
  1515. cursor: pointer;
  1516. border-left: 0;
  1517. }
  1518. .el-dropdown-link {
  1519. cursor: pointer;
  1520. color: #409eff;
  1521. }
  1522. .el-icon-arrow-down {
  1523. font-size: 12px;
  1524. }
  1525. </style>