PersonList.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390
  1. <template>
  2. <div class="manage-root organize-manage person-list conversion-code">
  3. <Header />
  4. <div class="manage-root-contain">
  5. <nav-menu
  6. class="manage-root-contain-left"
  7. :activeMenuIndex="activeMenuIndex"
  8. ></nav-menu>
  9. <div class="manage-root-contain-right personnel-manage-right">
  10. <breadcrumb
  11. :breadcrumbList="breadcrumbList"
  12. class="breadcrumb-box"
  13. ></breadcrumb>
  14. <div class="personal-inner" v-if="info">
  15. <div class="common-title-box">
  16. <h3>
  17. {{ info.name
  18. }}<span class="total-number"
  19. >共{{ info.person_count_audited }}人</span
  20. >
  21. </h3>
  22. <div class="btn-box">
  23. <el-button
  24. type="primary"
  25. size="small"
  26. @click="handleExportFile"
  27. :loading="exportFileLoading"
  28. >导出用户数据</el-button
  29. >
  30. <el-button
  31. type="primary"
  32. size="small"
  33. @click="handleBatchImport('white')"
  34. >上传白名单</el-button
  35. >
  36. <el-button
  37. type="primary"
  38. size="small"
  39. @click="handleBatchImport('')"
  40. >批量导入</el-button
  41. >
  42. </div>
  43. </div>
  44. <div class="tabs">
  45. <a
  46. :class="[tabsIndex === 0 ? 'active' : '']"
  47. @click="handleChangeTabs(0)"
  48. >人员列表</a
  49. >
  50. <a
  51. :class="[tabsIndex === 1 ? 'active' : '']"
  52. @click="handleChangeTabs(1)"
  53. >人员审核 {{ info.person_count_wait_audit }}</a
  54. >
  55. <a
  56. :class="[tabsIndex === 2 ? 'active' : '']"
  57. @click="handleChangeTabs(2)"
  58. >兑换码
  59. </a>
  60. <a
  61. :class="[tabsIndex === 3 ? 'active' : '']"
  62. @click="handleChangeTabs(3)"
  63. >白名单</a
  64. >
  65. </div>
  66. <div class="search">
  67. <div class="search-box" v-if="tabsIndex !== 2">
  68. <div class="search-item">
  69. <label>搜索</label>
  70. <el-input
  71. placeholder="输入搜索内容"
  72. v-model="searchInput"
  73. maxlength="200"
  74. >
  75. <i
  76. slot="suffix"
  77. class="el-input__icon el-icon-search"
  78. @click="getList(1)"
  79. style="cursor: pointer"
  80. ></i>
  81. </el-input>
  82. </div>
  83. <div
  84. class="search-item"
  85. v-if="tabsIndex === 0 || tabsIndex === 1"
  86. >
  87. <label>权限</label>
  88. <el-select
  89. v-model="searchType"
  90. @change="getList(1)"
  91. placeholder="请选择"
  92. >
  93. <el-option
  94. v-for="item in typeList"
  95. :key="item.account_type"
  96. :label="item.account_type_name"
  97. :value="item.account_type"
  98. >
  99. </el-option>
  100. </el-select>
  101. </div>
  102. <div class="search-item" v-if="tabsIndex === 0">
  103. <label>状态</label>
  104. <el-select
  105. v-model="searchStatus"
  106. @change="getList(1)"
  107. placeholder="请选择"
  108. >
  109. <el-option
  110. v-for="item in $searchStatusList"
  111. :key="item.status"
  112. :label="item.status_name"
  113. :value="item.status"
  114. >
  115. </el-option>
  116. </el-select>
  117. </div>
  118. <div class="search-item" v-if="tabsIndex === 1">
  119. <label>状态</label>
  120. <el-select
  121. v-model="searchAuditStatus"
  122. @change="getList(1)"
  123. placeholder="请选择"
  124. >
  125. <el-option
  126. v-for="item in searchAuditStatusList"
  127. :key="item.value"
  128. :label="item.label"
  129. :value="item.value"
  130. >
  131. </el-option>
  132. </el-select>
  133. </div>
  134. </div>
  135. <div class="search-right" v-if="tabsIndex === 0">
  136. <el-button
  137. class="gray-btn"
  138. size="small"
  139. @click="handleUp('', 'up', multipleSelection)"
  140. >开启选中用户</el-button
  141. >
  142. <el-button
  143. class="pink-btn"
  144. size="small"
  145. @click="handleUp('', 'down', multipleSelection)"
  146. >停用选中用户</el-button
  147. >
  148. <el-button
  149. class="red-btn"
  150. size="small"
  151. @click="handleDelete('', multipleSelection)"
  152. >删除选中用户</el-button
  153. >
  154. </div>
  155. <div class="search-right" v-if="tabsIndex === 1">
  156. <el-button
  157. class="gray-btn"
  158. size="small"
  159. @click="handleAudit('', 'up', multipleSelection)"
  160. >同意选中用户</el-button
  161. >
  162. <el-button
  163. class="pink-btn"
  164. size="small"
  165. @click="handleAudit('', 'down', multipleSelection)"
  166. >拒绝选中用户</el-button
  167. >
  168. </div>
  169. <div class="search-right" v-if="tabsIndex === 2">
  170. <el-input
  171. placeholder="输入兑换码"
  172. v-model="inputValue"
  173. class="input-with-btn"
  174. maxlength="20"
  175. >
  176. <el-button
  177. slot="append"
  178. @click="handleExchange"
  179. :loading="loading"
  180. >兑换</el-button
  181. >
  182. </el-input>
  183. </div>
  184. </div>
  185. <template v-if="tabsIndex === 0">
  186. <el-table
  187. class="search-table"
  188. :data="tableData"
  189. style="width: 100%"
  190. key="table"
  191. @sort-change="handleSort"
  192. :default-sort="dataSort"
  193. :max-height="tableHeight"
  194. @selection-change="handleSelectionChange"
  195. v-loading="tableLoading"
  196. >
  197. <el-table-column type="selection" width="40" fixed>
  198. </el-table-column>
  199. <el-table-column
  200. prop="user_name"
  201. label="用户名"
  202. sortable="custom"
  203. min-width="132"
  204. class-name="user-info"
  205. >
  206. <template slot-scope="scope">
  207. <el-image
  208. class="touxiang"
  209. :src="
  210. scope.row.image_url
  211. ? scope.row.image_url
  212. : require('../../assets/avatar.png')
  213. "
  214. fit="cover"
  215. style="width: 24px; height: 24px; margin-right: 8px"
  216. >
  217. </el-image>
  218. <!-- <img class="touxiang" :src="scope.row.image_url?scope.row.image_url:require('../../assets/avatar.png')" /> -->
  219. <span class="name">{{ scope.row.user_name }}</span>
  220. </template>
  221. </el-table-column>
  222. <el-table-column prop="real_name" label="真实姓名" width="103">
  223. </el-table-column>
  224. <el-table-column prop="sex_name" label="性别" width="56">
  225. </el-table-column>
  226. <el-table-column prop="type" label="权限" width="88">
  227. <template slot-scope="scope">
  228. {{ scope.row.is_manager === "true" ? "管理员" : "普通用户" }}
  229. </template>
  230. </el-table-column>
  231. <el-table-column
  232. prop="email"
  233. label="邮箱"
  234. sortable="custom"
  235. min-width="180"
  236. >
  237. </el-table-column>
  238. <el-table-column
  239. prop="phone"
  240. label="手机号"
  241. sortable="custom"
  242. width="160"
  243. >
  244. </el-table-column>
  245. <el-table-column
  246. prop="register_time"
  247. label="注册时间"
  248. sortable="custom"
  249. width="144"
  250. >
  251. <template slot-scope="scope">
  252. {{
  253. scope.row.register_time
  254. ? scope.row.register_time.substring(0, 16)
  255. : "-"
  256. }}
  257. </template>
  258. </el-table-column>
  259. <el-table-column prop="status" label="状态" width="116">
  260. <template slot-scope="scope">
  261. <div class="status-box">
  262. <span
  263. :style="{ background: statusList[scope.row.status].bg }"
  264. ></span>
  265. <b :style="{ color: statusList[scope.row.status].color }">{{
  266. statusList[scope.row.status].text
  267. }}</b>
  268. </div>
  269. </template>
  270. </el-table-column>
  271. <el-table-column fixed="right" label="操作" width="140">
  272. <template slot-scope="scope">
  273. <el-button
  274. @click.native.prevent="handleEdit(scope.row)"
  275. type="text"
  276. size="small"
  277. class="primary-btn"
  278. >
  279. 编辑
  280. </el-button>
  281. <el-button
  282. @click.native.prevent="handleUp(scope.row, 'up')"
  283. type="text"
  284. size="small"
  285. class="primary-btn"
  286. v-if="scope.row.status === 0"
  287. >
  288. 开启
  289. </el-button>
  290. <el-button
  291. @click.native.prevent="handleUp(scope.row, 'down')"
  292. type="text"
  293. size="small"
  294. class="red-btn"
  295. v-else-if="scope.row.status === 1"
  296. >
  297. 停用
  298. </el-button>
  299. <el-button
  300. @click.native.prevent="handleDelete(scope.row)"
  301. type="text"
  302. size="small"
  303. class="red-btn"
  304. v-if="scope.row.status === 0"
  305. >
  306. 删除
  307. </el-button>
  308. </template>
  309. </el-table-column>
  310. </el-table>
  311. <el-pagination
  312. key="pagination"
  313. background
  314. @size-change="
  315. (val) => handleSizeChange(val, 'pageSize', 'pageNumber')
  316. "
  317. @current-change="(val) => handleCurrentChange(val, 'pageNumber')"
  318. :current-page="pageNumber"
  319. :page-sizes="[10, 20, 30, 40]"
  320. :page-size="pageSize"
  321. layout="total, prev, pager, next, sizes, jumper"
  322. :total="total_count"
  323. >
  324. </el-pagination>
  325. </template>
  326. <template v-if="tabsIndex === 1">
  327. <el-table
  328. class="search-table"
  329. :data="tableData"
  330. style="width: 100%"
  331. :max-height="tableHeight"
  332. key="auditTable"
  333. @sort-change="handleSort"
  334. :default-sort="dataSorts"
  335. @selection-change="handleSelectionChange"
  336. v-loading="tableLoading"
  337. >
  338. <el-table-column type="selection" width="40" fixed>
  339. </el-table-column>
  340. <el-table-column
  341. prop="user_name"
  342. label="用户名"
  343. sortable="custom"
  344. min-width="132"
  345. class-name="user-info"
  346. >
  347. <template slot-scope="scope">
  348. <el-image
  349. class="touxiang"
  350. :src="
  351. scope.row.image_url
  352. ? scope.row.image_url
  353. : require('../../assets/avatar.png')
  354. "
  355. fit="cover"
  356. style="width: 24px; height: 24px; margin-right: 8px"
  357. >
  358. </el-image>
  359. <!-- <img class="touxiang" :src="scope.row.image_url?scope.row.image_url:require('../../assets/avatar.png')" /> -->
  360. <span class="name">{{ scope.row.user_name }}</span>
  361. </template>
  362. </el-table-column>
  363. <el-table-column prop="real_name" label="真实姓名" width="103">
  364. </el-table-column>
  365. <el-table-column prop="sex_name" label="性别" width="56">
  366. </el-table-column>
  367. <el-table-column
  368. prop="email"
  369. label="邮箱"
  370. sortable="custom"
  371. min-width="180"
  372. >
  373. </el-table-column>
  374. <el-table-column
  375. prop="phone"
  376. label="手机号"
  377. sortable="custom"
  378. width="160"
  379. >
  380. </el-table-column>
  381. <el-table-column
  382. prop="apply_time"
  383. label="申请时间"
  384. sortable="custom"
  385. width="144"
  386. >
  387. <template slot-scope="scope">
  388. {{
  389. scope.row.apply_time
  390. ? scope.row.apply_time.substring(0, 16)
  391. : "-"
  392. }}
  393. </template>
  394. </el-table-column>
  395. <el-table-column
  396. prop="audit_time"
  397. label="审核时间"
  398. sortable="custom"
  399. width="144"
  400. >
  401. <template slot-scope="scope">
  402. {{
  403. scope.row.audit_time
  404. ? scope.row.audit_time.substring(0, 16)
  405. : "-"
  406. }}
  407. </template>
  408. </el-table-column>
  409. <el-table-column prop="status" label="状态" width="116">
  410. <template slot-scope="scope">
  411. <div
  412. class="status-box"
  413. v-if="auditStatusList[scope.row.audit_status]"
  414. >
  415. <span
  416. :style="{
  417. background: auditStatusList[scope.row.audit_status].bg,
  418. }"
  419. ></span>
  420. <b
  421. :style="{
  422. color: auditStatusList[scope.row.audit_status].color,
  423. }"
  424. >{{ auditStatusList[scope.row.audit_status].text }}</b
  425. >
  426. </div>
  427. </template>
  428. </el-table-column>
  429. <el-table-column fixed="right" label="操作" width="140">
  430. <template slot-scope="scope">
  431. <el-button
  432. @click.native.prevent="handleLook(scope.row)"
  433. type="text"
  434. size="small"
  435. class="primary-btn"
  436. >
  437. 查看
  438. </el-button>
  439. <el-button
  440. @click.native.prevent="handleAudit(scope.row, 'up')"
  441. type="text"
  442. size="small"
  443. class="primary-btn"
  444. >
  445. 同意
  446. </el-button>
  447. <el-button
  448. @click.native.prevent="handleAudit(scope.row, 'down')"
  449. type="text"
  450. size="small"
  451. class="red-btn"
  452. v-if="scope.row.audit_status === 0"
  453. >
  454. 拒绝
  455. </el-button>
  456. </template>
  457. </el-table-column>
  458. </el-table>
  459. <el-pagination
  460. background
  461. key="auditpagination"
  462. @size-change="
  463. (val) => handleSizeChange(val, 'pageSizes', 'pageNumbers')
  464. "
  465. @current-change="(val) => handleCurrentChange(val, 'pageNumbers')"
  466. :current-page="pageNumbers"
  467. :page-sizes="[10, 20, 30, 40]"
  468. :page-size="pageSizes"
  469. layout="total, prev, pager, next, sizes, jumper"
  470. :total="total_count"
  471. >
  472. </el-pagination>
  473. </template>
  474. <template v-if="tabsIndex === 2">
  475. <el-table
  476. :data="tableData"
  477. v-loading="tableLoading"
  478. :max-height="tableHeight"
  479. style="width: 100%"
  480. key="2"
  481. >
  482. <el-table-column type="expand">
  483. <template slot-scope="props">
  484. <el-form
  485. label-position="left"
  486. inline
  487. class="demo-table-expand"
  488. >
  489. <el-form-item>
  490. <h3 class="content-title">兑换内容</h3>
  491. <div
  492. class="content-list"
  493. v-for="(itemC, indexC) in props.row.goods_list"
  494. :key="indexC"
  495. >
  496. <span>{{ indexC + 1 + "." }}</span>
  497. <b>{{ itemC.goods_name }}</b>
  498. </div>
  499. </el-form-item>
  500. </el-form>
  501. </template>
  502. </el-table-column>
  503. <el-table-column
  504. type="index"
  505. label="#"
  506. sortable
  507. width="54"
  508. :index="(pageNumber - 1) * pageSize + 1"
  509. >
  510. </el-table-column>
  511. <el-table-column
  512. label="名称"
  513. prop="discount_code_name"
  514. width="300"
  515. >
  516. </el-table-column>
  517. <el-table-column label="兑换码" prop="discount_code" width="300">
  518. </el-table-column>
  519. <el-table-column label="绑定时间" prop="bind_time">
  520. </el-table-column>
  521. <el-table-column prop="use_status" label="状态" width="116">
  522. <template slot-scope="scope">
  523. <div
  524. class="status-box"
  525. v-if="codeStatusList[scope.row.use_status]"
  526. >
  527. <span
  528. :style="{
  529. background: codeStatusList[scope.row.use_status].color,
  530. }"
  531. ></span>
  532. <b
  533. :style="{
  534. color: codeStatusList[scope.row.use_status].color,
  535. }"
  536. >{{ codeStatusList[scope.row.use_status].text }}</b
  537. >
  538. </div>
  539. </template>
  540. </el-table-column>
  541. </el-table>
  542. <el-pagination
  543. background
  544. key="2"
  545. @size-change="
  546. (val) => handleSizeChange(val, 'pageSizeD', 'pageNumberD')
  547. "
  548. @current-change="(val) => handleCurrentChange(val, 'pageNumberD')"
  549. :current-page="pageNumberD"
  550. :page-sizes="[10, 20, 30, 40]"
  551. :page-size="pageSizes"
  552. layout="total, prev, pager, next, sizes, jumper"
  553. :total="total_count"
  554. >
  555. </el-pagination>
  556. </template>
  557. <template v-if="tabsIndex === 3">
  558. <el-table
  559. class="search-table"
  560. :data="tableData"
  561. style="width: 100%"
  562. :max-height="tableHeight"
  563. key="3"
  564. @sort-change="handleSort"
  565. :default-sort="dataSorts"
  566. v-loading="tableLoading"
  567. >
  568. <el-table-column
  569. prop="real_name"
  570. label="真实姓名"
  571. sortable="custom"
  572. >
  573. </el-table-column>
  574. <el-table-column prop="phone" label="手机号"> </el-table-column>
  575. </el-table>
  576. <el-pagination
  577. background
  578. key="3"
  579. @size-change="
  580. (val) => handleSizeChange(val, 'pageSizeW', 'pageNumberW')
  581. "
  582. @current-change="(val) => handleCurrentChange(val, 'pageNumberW')"
  583. :current-page="pageNumberW"
  584. :page-sizes="[10, 20, 30, 40]"
  585. :page-size="pageSizes"
  586. layout="total, prev, pager, next, sizes, jumper"
  587. :total="total_count"
  588. >
  589. </el-pagination>
  590. </template>
  591. </div>
  592. </div>
  593. </div>
  594. <el-dialog
  595. :visible.sync="importFlag"
  596. :show-close="false"
  597. :close-on-click-modal="false"
  598. :modal-append-to-body="false"
  599. width="398px"
  600. class="login-dialog person-dialog"
  601. v-if="importFlag"
  602. >
  603. <batch-import
  604. @closeDialog="closeDialog"
  605. :exportUrl="exportUrl"
  606. :type="type"
  607. ></batch-import>
  608. </el-dialog>
  609. </div>
  610. </template>
  611. <script>
  612. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  613. //例如:import 《组件名称》from ‘《组件路径》';
  614. import Header from "../../components/Header.vue";
  615. import NavMenu from "../../components/NavMenu.vue";
  616. import Breadcrumb from "../../components/Breadcrumb.vue";
  617. import BatchImport from "./BatchImport.vue";
  618. import { getLogin } from "@/api/ajax";
  619. import { mapState } from "vuex";
  620. export default {
  621. //import引入的组件需要注入到对象中才能使用
  622. components: { Header, NavMenu, Breadcrumb, BatchImport },
  623. props: {},
  624. data() {
  625. //这里存放数据
  626. return {
  627. activeMenuIndex: "organize_manage",
  628. breadcrumbList: [
  629. {
  630. icon: "school-line",
  631. url: "",
  632. text: "",
  633. },
  634. {
  635. icon: "",
  636. url: "",
  637. text: "机构管理",
  638. },
  639. ],
  640. searchInput: "",
  641. searchType: -1,
  642. searchStatus: -1,
  643. searchAuditStatus: -1,
  644. typeList: [
  645. {
  646. account_type: -1,
  647. account_type_name: "全部",
  648. },
  649. {
  650. account_type: 1,
  651. account_type_name: "管理员",
  652. },
  653. {
  654. account_type: 0,
  655. account_type_name: "普通用户",
  656. },
  657. ],
  658. searchAuditStatusList: [
  659. {
  660. value: -1,
  661. label: "全部",
  662. },
  663. {
  664. value: 0,
  665. label: "待审核",
  666. },
  667. {
  668. value: 2,
  669. label: "已拒绝",
  670. },
  671. ],
  672. statusList: {
  673. 1: {
  674. text: "正常",
  675. bg: "#165DFF",
  676. color: "",
  677. },
  678. 0: {
  679. text: "停用",
  680. bg: "#F53F3F",
  681. color: "#F53F3F",
  682. },
  683. },
  684. auditStatusList: {
  685. 0: {
  686. text: "待审核",
  687. bg: "#165DFF",
  688. color: "",
  689. },
  690. 2: {
  691. text: "已拒绝",
  692. bg: "#F53F3F",
  693. color: "#F53F3F",
  694. },
  695. },
  696. codeStatusList: {
  697. 0: {
  698. text: "未使用",
  699. color: "#FF7D00",
  700. },
  701. 1: {
  702. text: "已使用",
  703. color: "#165DFF",
  704. },
  705. 2: {
  706. text: "已撤回",
  707. color: "rgb(245, 63, 63)",
  708. },
  709. },
  710. tableData: [],
  711. pageSize: window.localStorage.getItem("pageSizec")
  712. ? Number(window.localStorage.getItem("pageSize-people"))
  713. : 10,
  714. pageNumber: window.localStorage.getItem("pageNumber-people")
  715. ? Number(window.localStorage.getItem("pageNumber-people"))
  716. : 1,
  717. tableHeight: "", // 表格高度
  718. orgName: "", // 机构名称
  719. id: this.$route.query.id ? this.$route.query.id : "",
  720. multipleSelection: [],
  721. tabsIndex: 0,
  722. pageSizes: window.localStorage.getItem("pageSize-check")
  723. ? Number(window.localStorage.getItem("pageSize-check"))
  724. : 10,
  725. pageNumbers: window.localStorage.getItem("pageNumber-check")
  726. ? Number(window.localStorage.getItem("pageNumber-check"))
  727. : 1,
  728. pageSizeW: 10,
  729. pageNumberW: 1,
  730. pageSizeD: 10,
  731. pageNumberD: 1,
  732. importFlag: false, // 批量导入flag
  733. info: null,
  734. total_count: 0,
  735. dataSort: {},
  736. dataSorts: {},
  737. exportUrl: "", // 下载模板链接
  738. tableLoading: false,
  739. exportFileLoading: false,
  740. timer: null,
  741. type: "",
  742. inputValue: "",
  743. loading: false,
  744. };
  745. },
  746. //计算属性 类似于data概念
  747. computed: {
  748. ...mapState(["$searchStatusList"]),
  749. },
  750. //监控data中数据变化
  751. watch: {},
  752. //方法集合
  753. methods: {
  754. handleSort(value) {
  755. let dataSort = {
  756. prop: value.prop,
  757. order: value.order,
  758. };
  759. if (this.tabsIndex === 0) {
  760. this.dataSort = dataSort;
  761. } else {
  762. this.dataSorts = dataSort;
  763. }
  764. this.getList();
  765. },
  766. // 查询列表
  767. getList(page) {
  768. this.tableLoading = true;
  769. if (page) {
  770. if (this.tabsIndex === 0) {
  771. this.pageNumber = page;
  772. } else if (this.tabsIndex === 1) {
  773. this.pageNumbers = page;
  774. } else if (this.tabsIndex === 2) {
  775. this.pageNumberD = page;
  776. } else if (this.tabsIndex === 3) {
  777. this.pageNumberW = page;
  778. }
  779. }
  780. this.getInfo();
  781. if (this.tabsIndex === 2) {
  782. this.getListDis(page);
  783. return;
  784. }
  785. let MethodName = "/OrgServer/Manager/PageQuery/PageQueryPersonList";
  786. let order_column_list = [];
  787. if (this.tabsIndex === 0) {
  788. if (this.dataSort != {}) {
  789. if (this.dataSort.order == "descending") {
  790. order_column_list = [this.dataSort.prop + ":desc"];
  791. } else if (this.dataSort.order == "ascending") {
  792. // 升序不传值
  793. order_column_list = [this.dataSort.prop];
  794. } else {
  795. order_column_list = ["register_time:desc"];
  796. }
  797. } else {
  798. order_column_list = ["register_time:desc"];
  799. }
  800. } else {
  801. if (this.dataSorts != {}) {
  802. if (this.dataSorts.order == "descending") {
  803. order_column_list = [this.dataSorts.prop + ":desc"];
  804. } else if (this.dataSorts.order == "ascending") {
  805. // 升序不传值
  806. order_column_list = [this.dataSorts.prop];
  807. } else {
  808. order_column_list = ["apply_time:desc"];
  809. }
  810. } else {
  811. order_column_list = ["apply_time:desc"];
  812. }
  813. }
  814. let data = {
  815. org_id: this.id,
  816. search_content: this.searchInput.trim(),
  817. role_type: this.searchType,
  818. status: this.tabsIndex === 0 ? this.searchStatus : -1,
  819. audit_status: this.tabsIndex === 1 ? this.searchAuditStatus : -1,
  820. page_capacity: this.tabsIndex === 0 ? this.pageSize : this.pageSizes,
  821. cur_page: this.tabsIndex === 0 ? this.pageNumber : this.pageNumbers,
  822. list_type: this.tabsIndex * 1,
  823. order_column_list: order_column_list,
  824. };
  825. if (this.tabsIndex === 3) {
  826. MethodName = "/OrgServer/Manager/PageQuery/PageQueryPersonWhiteList";
  827. data = {
  828. org_id: this.id,
  829. search_content: this.searchInput.trim(),
  830. page_capacity: this.pageSizeW,
  831. cur_page: this.pageNumberW,
  832. order_column_list: order_column_list,
  833. };
  834. }
  835. getLogin(MethodName, data)
  836. .then((res) => {
  837. this.tableLoading = false;
  838. if (res.status === 1) {
  839. this.tableData = res.person_list;
  840. this.total_count = res.total_count;
  841. }
  842. })
  843. .catch(() => {
  844. this.tableLoading = false;
  845. });
  846. },
  847. // 创建机构或者编辑信息
  848. handleEdit(row) {
  849. // 根据登录用户判断当前用户是不是超管 在table里加上disabled
  850. // 点击时记录页码和每页条数
  851. window.localStorage.setItem("pageSize-people", this.pageSize);
  852. window.localStorage.setItem("pageNumber-people", this.pageNumber);
  853. this.$router.push({
  854. path: "/editOrgPerson",
  855. query: {
  856. id: row ? row.id : "",
  857. },
  858. });
  859. },
  860. // 人员管理
  861. handleLook(row) {
  862. window.localStorage.setItem("pageSize-check", this.pageSizes);
  863. window.localStorage.setItem("pageNumber-check", this.pageNumbers);
  864. this.$router.push({
  865. path: "/editOrgPerson",
  866. query: {
  867. id: row ? row.id : "",
  868. page: "personCheck",
  869. },
  870. });
  871. },
  872. // 停用 启用
  873. handleUp(row, type, arr) {
  874. if (!row && arr.length === 0) {
  875. return false;
  876. }
  877. let Mname = "/OrgServer/Manager/PersonManager/EnablePerson";
  878. let data = {
  879. id_list: arr ? arr : [row.id],
  880. };
  881. if (type === "up") {
  882. // 下架状态
  883. data.is_enable = "true";
  884. } else if (type === "down") {
  885. data.is_enable = "false";
  886. }
  887. getLogin(Mname, data).then((res) => {
  888. this.getList();
  889. this.$message({
  890. message: "操作成功",
  891. type: "success",
  892. duration: 3000,
  893. });
  894. });
  895. },
  896. // 通过 拒绝
  897. handleAudit(row, type, arr) {
  898. if (!row && arr.length === 0) {
  899. return false;
  900. }
  901. let Mname = "/OrgServer/Manager/PersonManager/AuditPerson";
  902. let data = {
  903. id_list: arr ? arr : [row.id],
  904. };
  905. if (type === "up") {
  906. // 下架状态
  907. data.is_pass = "true";
  908. } else if (type === "down") {
  909. data.is_pass = "false";
  910. }
  911. getLogin(Mname, data).then((res) => {
  912. this.getList();
  913. this.$message({
  914. message: "操作成功",
  915. type: "success",
  916. duration: 3000,
  917. });
  918. });
  919. },
  920. handleSizeChange(val, type, page) {
  921. this[type] = val;
  922. this[page] = 1;
  923. this.getList();
  924. },
  925. handleCurrentChange(val, type) {
  926. this[type] = val;
  927. this.getList();
  928. },
  929. //计算table高度(动态设置table高度)
  930. getTableHeight() {
  931. let tableH = 434; //距离页面下方的高度
  932. let tableHeightDetil = window.innerHeight - tableH;
  933. if (tableHeightDetil <= 300) {
  934. this.tableHeight = 300;
  935. } else {
  936. this.tableHeight = window.innerHeight - tableH;
  937. }
  938. },
  939. // 删除
  940. handleDelete(row, arr) {
  941. if (!row && arr.length === 0) {
  942. return false;
  943. }
  944. this.$confirm("确定删除吗?", "提示", {
  945. confirmButtonText: "确定",
  946. cancelButtonText: "取消",
  947. type: "warning",
  948. })
  949. .then(() => {
  950. let Mname = "/OrgServer/Manager/PersonManager/BatchDeleteOrgPerson";
  951. let data = {
  952. org_id: this.id,
  953. person_id_list: arr ? arr : [row.id],
  954. };
  955. getLogin(Mname, data).then((res) => {
  956. this.$message.success("删除成功");
  957. this.getList();
  958. });
  959. })
  960. .catch(() => {});
  961. },
  962. // 复选框
  963. handleSelectionChange(val) {
  964. this.multipleSelection = [];
  965. val.forEach((item) => {
  966. this.multipleSelection.push(item.id);
  967. });
  968. },
  969. handleChangeTabs(value) {
  970. this.tabsIndex = value;
  971. // this.pageNumber = 1
  972. this.getList();
  973. },
  974. // 批量导入
  975. handleBatchImport(type) {
  976. this.type = type;
  977. this.importFlag = true;
  978. },
  979. // 关闭批量导入
  980. closeDialog() {
  981. this.importFlag = false;
  982. this.getList();
  983. },
  984. // 获取机构信息
  985. getInfo() {
  986. let MethodName = "/OrgServer/Manager/OrgManager/GetOrgTitleInfo";
  987. let data = {
  988. id: this.id,
  989. };
  990. getLogin(MethodName, data)
  991. .then((res) => {
  992. if (res.status === 1) {
  993. this.info = res;
  994. let obj = {
  995. icon: "",
  996. url: "",
  997. text: res.name,
  998. };
  999. this.breadcrumbList = [
  1000. {
  1001. icon: "school-line",
  1002. url: "",
  1003. text: "",
  1004. },
  1005. {
  1006. icon: "",
  1007. url: "",
  1008. text: "机构管理",
  1009. },
  1010. ];
  1011. this.breadcrumbList.push(obj);
  1012. let _this = this;
  1013. setTimeout(() => {
  1014. let input = document.querySelector("input");
  1015. input.addEventListener("keyup", function (event) {
  1016. // 判断是否按下回车键
  1017. if (event.keyCode === 13) {
  1018. // 回车键被按下,执行你想要的操作
  1019. _this.getList(1);
  1020. }
  1021. });
  1022. }, 500);
  1023. }
  1024. })
  1025. .catch(() => {});
  1026. getLogin(
  1027. "/OrgServer/Manager/SysConfigManager/GetSysConfig_DataImport",
  1028. {}
  1029. )
  1030. .then((res) => {
  1031. if (res.status === 1) {
  1032. this.exportUrl = res.person_data_import_template_file_url;
  1033. }
  1034. })
  1035. .catch((res) => {});
  1036. },
  1037. // 导出用户数据
  1038. handleExportFile() {
  1039. this.exportFileLoading = true;
  1040. let MethodName =
  1041. "/ShopServer/Manager/FileExport/StartCreatePersonStatDataExportFile";
  1042. let order_column_list = [];
  1043. if (this.tabsIndex === 1) {
  1044. if (this.dataSorts != {}) {
  1045. if (this.dataSorts.order == "descending") {
  1046. order_column_list = [this.dataSorts.prop + ":desc"];
  1047. } else if (this.dataSorts.order == "ascending") {
  1048. // 升序不传值
  1049. order_column_list = [this.dataSorts.prop];
  1050. } else {
  1051. order_column_list = ["apply_time:desc"];
  1052. }
  1053. } else {
  1054. order_column_list = ["apply_time:desc"];
  1055. }
  1056. } else {
  1057. if (this.dataSort != {}) {
  1058. if (this.dataSort.order == "descending") {
  1059. order_column_list = [this.dataSort.prop + ":desc"];
  1060. } else if (this.dataSort.order == "ascending") {
  1061. // 升序不传值
  1062. order_column_list = [this.dataSort.prop];
  1063. } else {
  1064. order_column_list = ["register_time:desc"];
  1065. }
  1066. } else {
  1067. order_column_list = ["register_time:desc"];
  1068. }
  1069. }
  1070. let data = {
  1071. org_id: this.id,
  1072. search_content: this.searchInput.trim(),
  1073. status: this.tabsIndex === 0 ? this.searchStatus : -1,
  1074. audit_status: this.tabsIndex === 1 ? this.searchAuditStatus : -1,
  1075. page_capacity: this.tabsIndex === 0 ? this.pageSize : this.pageSizes,
  1076. cur_page: this.tabsIndex === 0 ? this.pageNumber : this.pageNumbers,
  1077. list_type: this.tabsIndex * 1,
  1078. order_column_list: order_column_list,
  1079. };
  1080. getLogin(MethodName, data)
  1081. .then((res) => {
  1082. if (res.status === 1) {
  1083. this.timer = setInterval(() => {
  1084. getLogin(
  1085. "/ShopServer/Manager/FileExport/GetPersonStatDataExportFileTaskProgress",
  1086. {
  1087. export_file_task_id: res.export_file_task_id,
  1088. }
  1089. ).then((res) => {
  1090. if (res.status === 1) {
  1091. if (
  1092. res.is_exist_task === "true" &&
  1093. res.is_interrupt === "false"
  1094. ) {
  1095. if (res.is_finish === "true") {
  1096. this.exportFileLoading = false;
  1097. clearInterval(this.timer);
  1098. window.open(res.export_file_url);
  1099. }
  1100. } else {
  1101. this.exportFileLoading = false;
  1102. clearInterval(this.timer);
  1103. this.$message.warning("导出任务不存在,请重新导出");
  1104. }
  1105. }
  1106. });
  1107. }, 2000);
  1108. }
  1109. })
  1110. .catch(() => {});
  1111. },
  1112. // 兑换
  1113. handleExchange() {
  1114. this.loading = true;
  1115. let MethodName =
  1116. "/ShopServer/Manager/DiscountCodeManager/BindDiscountCodeToOrg";
  1117. let data = {
  1118. discount_code: this.inputValue.trim(),
  1119. org_id: this.id,
  1120. };
  1121. getLogin(MethodName, data)
  1122. .then((res) => {
  1123. this.loading = false;
  1124. if (res.status === 1) {
  1125. this.$message.success("兑换成功");
  1126. this.getList(1);
  1127. }
  1128. })
  1129. .catch(() => {
  1130. this.loading = false;
  1131. });
  1132. },
  1133. getListDis(val) {
  1134. this.tableLoading = true;
  1135. if (val) {
  1136. this.pageNumberD = val;
  1137. }
  1138. let MethodName =
  1139. "/ShopServer/Manager/DiscountCodeManager/PageQueryOrgBindDiscountCodeList";
  1140. let data = {
  1141. page_capacity: this.pageSizeD,
  1142. cur_page: this.pageNumberD,
  1143. org_id: this.id,
  1144. };
  1145. getLogin(MethodName, data)
  1146. .then((res) => {
  1147. this.tableLoading = false;
  1148. if (res.status === 1) {
  1149. this.tableData = res.order_list;
  1150. this.total_count = res.total_count;
  1151. }
  1152. })
  1153. .catch(() => {
  1154. this.tableLoading = false;
  1155. });
  1156. },
  1157. },
  1158. //生命周期 - 创建完成(可以访问当前this实例)
  1159. created() {
  1160. this.getTableHeight();
  1161. if (this.id) {
  1162. this.getList();
  1163. }
  1164. },
  1165. //生命周期 - 挂载完成(可以访问DOM元素)
  1166. mounted() {},
  1167. //生命周期-创建之前
  1168. beforeCreated() {},
  1169. //生命周期-挂载之前
  1170. beforeMount() {},
  1171. //生命周期-更新之前
  1172. beforUpdate() {},
  1173. //生命周期-更新之后
  1174. updated() {},
  1175. //生命周期-销毁之前
  1176. beforeDestory() {},
  1177. //生命周期-销毁完成
  1178. destoryed() {},
  1179. //如果页面有keep-alive缓存功能,这个函数会触发
  1180. activated() {},
  1181. };
  1182. </script>
  1183. <style lang="scss" scoped>
  1184. /* @import url(); 引入css类 */
  1185. .total-number {
  1186. color: #86909c;
  1187. font-weight: 400;
  1188. font-size: 14px;
  1189. line-height: 22px;
  1190. margin-left: 4px;
  1191. }
  1192. .tabs {
  1193. display: flex;
  1194. padding: 16px 0;
  1195. a {
  1196. font-size: 14px;
  1197. line-height: 22px;
  1198. color: #4e5969;
  1199. border-radius: 100px;
  1200. padding: 5px 16px;
  1201. margin-right: 12px;
  1202. &:hover {
  1203. background: #f2f3f5;
  1204. }
  1205. &.active {
  1206. background: #f2f3f5;
  1207. font-weight: 500;
  1208. color: #165dff;
  1209. }
  1210. }
  1211. }
  1212. .search {
  1213. display: flex;
  1214. justify-content: space-between;
  1215. align-items: flex-end;
  1216. }
  1217. .search-box {
  1218. padding-top: 0;
  1219. }
  1220. .search-right {
  1221. height: 34px;
  1222. button {
  1223. font-size: 14px;
  1224. }
  1225. .gray-btn {
  1226. cursor: pointer;
  1227. }
  1228. .pink-btn {
  1229. background: #ffece8;
  1230. color: #f53f3f;
  1231. border-color: #ffece8;
  1232. &:hover {
  1233. background: #fde0da;
  1234. border-color: #fde0da;
  1235. }
  1236. &:focus {
  1237. background: #f8cfc6;
  1238. border-color: #f8cfc6;
  1239. }
  1240. }
  1241. .red-btn {
  1242. background: #f53f3f;
  1243. color: #fff;
  1244. border-color: #f53f3f;
  1245. &:hover {
  1246. background: #ed3b3b;
  1247. }
  1248. &:focus {
  1249. background: #ec1111;
  1250. }
  1251. }
  1252. }
  1253. .conversion-code {
  1254. background: #ffffff;
  1255. border-radius: 4px;
  1256. // padding: 24px;
  1257. h2 {
  1258. font-weight: 500;
  1259. font-size: 20px;
  1260. line-height: 28px;
  1261. color: #1d2129;
  1262. margin: 0;
  1263. }
  1264. .el-table {
  1265. margin: 24px 0;
  1266. }
  1267. .el-pagination {
  1268. text-align: right;
  1269. }
  1270. .input-with-btn {
  1271. margin-top: 16px;
  1272. width: 290px;
  1273. }
  1274. .content-title {
  1275. font-weight: 500;
  1276. font-size: 14px;
  1277. line-height: 22px;
  1278. color: #000000;
  1279. margin: 4px 24px;
  1280. }
  1281. .content-list {
  1282. padding: 4px 24px;
  1283. font-weight: 400;
  1284. font-size: 12px;
  1285. line-height: 20px;
  1286. color: #2f3742;
  1287. display: flex;
  1288. span {
  1289. width: 22px;
  1290. display: block;
  1291. flex-shrink: 0;
  1292. }
  1293. b {
  1294. flex: 1;
  1295. font-weight: 400;
  1296. }
  1297. }
  1298. }
  1299. </style>
  1300. <style lang="scss">
  1301. .organize-manage {
  1302. .el-cascader {
  1303. width: 160px;
  1304. height: 32px;
  1305. line-height: 32px;
  1306. .el-input {
  1307. width: 100%;
  1308. height: 32px;
  1309. }
  1310. }
  1311. }
  1312. .person-dialog {
  1313. .el-dialog {
  1314. border-radius: 8px;
  1315. }
  1316. }
  1317. .person-list {
  1318. .user-info {
  1319. .cell {
  1320. display: flex;
  1321. align-items: center;
  1322. .touxiang {
  1323. width: 24px;
  1324. height: 24px;
  1325. border-radius: 50%;
  1326. margin-right: 8px;
  1327. }
  1328. }
  1329. }
  1330. }
  1331. .conversion-code {
  1332. .el-table__expanded-cell:hover {
  1333. background: #f7f8fa !important;
  1334. }
  1335. .el-form-item {
  1336. margin-bottom: 0;
  1337. }
  1338. .el-table__expand-column {
  1339. .el-icon-arrow-right:before {
  1340. content: "";
  1341. background: url("../../assets/icon-right.png") center no-repeat;
  1342. background-size: cover;
  1343. width: 16px;
  1344. height: 16px;
  1345. display: block;
  1346. }
  1347. .el-table__expand-icon > .el-icon {
  1348. margin-left: -4px;
  1349. margin-top: -7px;
  1350. }
  1351. }
  1352. .el-table__expand-icon--expanded {
  1353. transform: none;
  1354. .el-icon-arrow-right:before {
  1355. content: "";
  1356. background: url("../../assets/icon-down.png") center no-repeat;
  1357. background-size: cover;
  1358. width: 16px;
  1359. height: 16px;
  1360. display: block;
  1361. }
  1362. }
  1363. .input-with-btn {
  1364. .el-input__inner {
  1365. height: 32px;
  1366. color: #1d2129;
  1367. background: #f2f3f5;
  1368. border: none;
  1369. }
  1370. .el-input-group__append {
  1371. border: none;
  1372. width: 52px;
  1373. background: #f2f3f5;
  1374. border-left: 1px solid #e5e6eb;
  1375. padding: 0;
  1376. text-align: center;
  1377. }
  1378. }
  1379. .el-table th.el-table__cell {
  1380. background: #f2f3f5;
  1381. color: #1d2129;
  1382. }
  1383. }
  1384. </style>