partnerDetail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. <template>
  2. <div class="detail">
  3. <div class="state" v-if="dataDetail?.status == 5">
  4. <el-icon :size="20" style="color: red; margin: 3px 10px 0 0;">
  5. <CircleClose />
  6. </el-icon>
  7. <div>
  8. <h3>审核不通过</h3>
  9. <p>{{ dataDetail?.approvalOpinion }}如有问题,请联系审核人员或者拨打客服电话400-400-400。</p>
  10. <el-button link type="primary" @click="editDetail">修改并重提交</el-button>
  11. </div>
  12. </div>
  13. <div class="info">
  14. <el-descriptions>
  15. <template #title>
  16. <el-row :gutter="20" flex justify="space-between">
  17. <el-col :span="12" style="display: flex; align-items: center;">
  18. <span class="firstName">{{ initName(dataDetail?.name) }}</span>
  19. <span class="allName">{{ dataDetail?.name }}</span>
  20. </el-col>
  21. </el-row>
  22. </template>
  23. <el-descriptions-item label="工号:" width="33%">{{ dataDetail?.userId }}</el-descriptions-item>
  24. <el-descriptions-item label="所属机构:" width="33%">{{ dataDetail?.deptName }}</el-descriptions-item>
  25. <el-descriptions-item label="状态:" width="33%">{{ statusMap(dataDetail?.status)}}</el-descriptions-item>
  26. <el-descriptions-item label="合伙人等级" width="33%">{{ gradeMap(dataDetail?.gradeList) }}</el-descriptions-item>
  27. <el-descriptions-item label="类型:" width="33%">{{ typeAttrMap(dataDetail?.partnerTypeAttr) }}</el-descriptions-item>
  28. <el-descriptions-item label="创建人:" width="33%">{{ dataDetail?.updateBy }}</el-descriptions-item>
  29. <el-descriptions-item label="创建时间:" width="33%">{{ dataDetail?.createTime }}</el-descriptions-item>
  30. </el-descriptions>
  31. </div>
  32. <div class="message">
  33. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="(tab) => { activeName = tab }">
  34. <el-tab-pane label="基本信息" name="msg" style="padding: 0 24px">
  35. <div class="other">
  36. <el-descriptions title="个人信息">
  37. <el-descriptions-item label="姓名:" width="33%">{{ dataDetail?.name }}</el-descriptions-item>
  38. <el-descriptions-item label="手机号:" width="33%">{{ dataDetail?.mobile }}</el-descriptions-item>
  39. <el-descriptions-item label="证件号:" width="33%">{{ dataDetail?.identity }}</el-descriptions-item>
  40. <el-descriptions-item label="证件有效期始:" width="33%">{{ dataDetail?.identityTimeStart }}</el-descriptions-item>
  41. <el-descriptions-item label="证件有效期止:" width="33%">{{ dataDetail?.identityTimeEnd }}</el-descriptions-item>
  42. </el-descriptions>
  43. <el-descriptions title="其他信息">
  44. <el-descriptions-item>
  45. <template #default>
  46. <el-row :gutter="20">
  47. <el-col :span="12" class="mb-5">
  48. 管理人:{{ dataDetail?.leaderName }}
  49. </el-col>
  50. <el-col :span="12" class="mb-5">
  51. 管理人工号:{{ dataDetail?.leaderId }}
  52. </el-col>
  53. <el-col :span="12" class="mb-5">
  54. 推荐人:{{ dataDetail?.referrerName }}
  55. </el-col>
  56. <el-col :span="12" class="mb-5">
  57. 推荐人工号:{{ dataDetail?.referrerId }}
  58. </el-col>
  59. </el-row>
  60. </template>
  61. </el-descriptions-item>
  62. </el-descriptions>
  63. <el-descriptions title="银行卡信息">
  64. <el-descriptions-item>
  65. <template #default>
  66. <el-table
  67. :data="dataDetail?.bankCardList"
  68. height="200"
  69. >
  70. <el-table-column prop="name" label="姓名"></el-table-column>
  71. <el-table-column prop="bankName" label="开户行">
  72. <template #default="scope">
  73. {{ bankCardChange(bankOption, scope.row.bankName) }}
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="bankCardNumber" label="卡号"></el-table-column>
  77. <el-table-column prop="bankAddress" label="开户支行"></el-table-column>
  78. <el-table-column prop="auditStatus" label="审核状态">
  79. <template #default="scope">
  80. {{ scope.row.auditStatus == '0'?'未审核':scope.row.auditStatus == '1'?'审核通过':scope.row.auditStatus == '2'?'审核驳回':''}}
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="" label="身份证件照片">
  84. <template #default="scope">
  85. <!-- <img class="cardImage" :src="dataDetail?.fileList.length>0?dataDetail?.fileList?.[0].fileUrl:''">-->
  86. {{ dataDetail?.fileList.length>0?`${dataDetail?.fileList?.length}张`: '暂无' }}
  87. </template>
  88. </el-table-column>
  89. <el-table-column prop="cardFile" label="银行卡照片">
  90. <template #default="scope">
  91. <!-- <img class="cardImage" :src="scope.row.cardFile">-->
  92. {{ scope.row.cardFileUrl?`1张`: '暂无' }}
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="操作">
  96. <template #default="scope">
  97. <a style="color: #409EFF; cursor: pointer" @click="editBankCard(scope.row)">详情</a>
  98. </template>
  99. </el-table-column>
  100. </el-table>
  101. </template>
  102. </el-descriptions-item>
  103. </el-descriptions>
  104. <el-button class="bg-white" plain type="primary" icon="plus" style="width: 100%; border-radius: 2px" @click="addBankCard">添加银行卡</el-button>
  105. </div>
  106. </el-tab-pane>
  107. <el-tab-pane label="资料附件" name="file" style="padding: 0 24px">
  108. <div class="other">
  109. <el-descriptions title="资料附件">
  110. <el-descriptions-item>
  111. <template #default>
  112. <div class="fileItem" v-if="imageChangeName('sfz1')">
  113. <span class="label">身份证(人像面)</span>
  114. <div class="fileName">
  115. <span class="file-name">{{ imageChangeName('sfz1') }}</span>
  116. <el-icon class="file-icon" @click="imageView('sfz1')"><View/></el-icon>
  117. </div>
  118. </div>
  119. <div class="fileItem" v-if="imageChangeName('sfz2')">
  120. <span class="label">身份证(国徽面)</span>
  121. <div class="fileName">
  122. <span class="file-name">{{ imageChangeName('sfz2') }}</span>
  123. <el-icon class="file-icon" @click="imageView('sfz2')"><View /></el-icon>
  124. </div>
  125. </div>
  126. <div class="fileItem" v-if="imageChangeName('qualification')">
  127. <span class="label">展业资格证</span>
  128. <div class="fileName">
  129. <span class="file-name">{{ imageChangeName('qualification') }}</span>
  130. <el-icon class="file-icon" @click="imageView('qualification')"><View /></el-icon>
  131. </div>
  132. </div>
  133. </template>
  134. </el-descriptions-item>
  135. </el-descriptions>
  136. </div>
  137. </el-tab-pane>
  138. </el-tabs>
  139. </div>
  140. <el-dialog
  141. v-model="bankCardDialogShow"
  142. :title="bankTitle"
  143. width="500"
  144. >
  145. <addCard @closeDialog="closeAddBankCard" :userInfo="bankCardInfo"></addCard>
  146. </el-dialog>
  147. <el-dialog
  148. v-model="dialogShow"
  149. title="编辑"
  150. width="1000"
  151. >
  152. <addOperation ref="AddOperationRef" @closeDialog="closeAddOperation"></addOperation>
  153. </el-dialog>
  154. <el-dialog
  155. v-model="allocationShow"
  156. title="分配管理人"
  157. width="800"
  158. >
  159. <allocation ref="AllocationRef" @closeDialog="closeAllocation"></allocation>
  160. </el-dialog>
  161. <el-image-viewer v-if="imageShow" :url-list="[imageUrl]" @close="imageShow = false" />
  162. </div>
  163. </template>
  164. <script setup lang="ts">
  165. import {nextTick, ref} from 'vue'
  166. import pinyin from "js-pinyin";
  167. import { ElMessage, ElMessageBox } from 'element-plus'
  168. import Allocation from "@/views/operationManagement/modules/allocation.vue";
  169. import { useRoute, useRouter } from 'vue-router'
  170. import addCard from './modules/addCard.vue'
  171. import api from '@/api'
  172. import {OperationIsEnable} from "@/api/modules/operation.ts";
  173. import router from "@/router";
  174. let AddOperationRef = ref(null)
  175. const AllocationRef = ref(null)
  176. let myRouter = useRouter()
  177. const myRoute = useRoute()
  178. // 更多
  179. const handleCommand = (e) => {
  180. switch (e) {
  181. case '删除':
  182. ElMessageBox({
  183. title: '删除业务员',
  184. message: '确定要删除该业务员吗?',
  185. type: 'warning',
  186. showCancelButton: true,
  187. confirmButtonText: '确定',
  188. cancelButtonText: '取消',
  189. }).then(( action ) => {
  190. if(action === 'confirm') {
  191. let ids = [myRoute.query.id]
  192. operationDel(ids)
  193. }
  194. }).catch(( action ) => {
  195. })
  196. break;
  197. case '禁用':
  198. ElMessageBox({
  199. title: '禁用业务员',
  200. message: '确定要禁用该业务员吗?',
  201. type: 'warning',
  202. showCancelButton: true,
  203. confirmButtonText: '确定',
  204. cancelButtonText: '取消',
  205. }).then(( action ) => {
  206. if(action === 'confirm') {
  207. let data = {
  208. ids: [myRoute.query.ids],
  209. isEnable: 1,
  210. getAll: 0
  211. }
  212. operationIsEnable(data)
  213. }
  214. }).catch(( action ) => {
  215. })
  216. break;
  217. case '启用':
  218. ElMessageBox({
  219. title: '启用业务员',
  220. message: '确定要启用该业务员吗?',
  221. type: 'warning',
  222. showCancelButton: true,
  223. confirmButtonText: '确定',
  224. cancelButtonText: '取消',
  225. }).then(( action ) => {
  226. if(action === 'confirm'){
  227. let data = {
  228. ids: [myRoute.query.ids],
  229. isEnable: 0,
  230. getAll: 0
  231. }
  232. operationIsEnable(data)
  233. }
  234. }).catch(( action ) => {
  235. })
  236. break;
  237. case '分配管理人':
  238. allocationShow.value = true
  239. nextTick(() => {
  240. AllocationRef.value.initCheckedKeys(dataDetail.value.deptId, 'cur', [dataDetail.value.id], dataDetail.value.leaderId)
  241. })
  242. break;
  243. }
  244. }
  245. // 分配管理人
  246. let allocationShow = ref(false)
  247. const closeAllocation = (type: boolean) => {
  248. allocationShow.value = type
  249. }
  250. //状态匹配
  251. const statusMap = (value: any) => {
  252. const map = {
  253. "0": '未认证',
  254. "1": '认证中',
  255. "2": '认证失败',
  256. "3": '待入职',
  257. "4": '入司审核中',
  258. "5": '入司审核失败',
  259. "6": '已入职',
  260. "7": '离职待审核',
  261. "8": '离职',
  262. }
  263. return map[value]
  264. }
  265. //人员类型匹配
  266. const typeAttrMap=(value)=>{
  267. const map = {
  268. "1": '前线人员',
  269. "2": '后线人员',
  270. "3": '合伙人',
  271. "4": '工作是管理员',
  272. "5": '团队',
  273. "6": '个代',
  274. "7": '电销',
  275. "8": '渠道',
  276. }
  277. return map[value]
  278. }
  279. // 合伙人等级匹配
  280. const gradeMap = (value: any) => {
  281. if(value == null) {
  282. return '未知'
  283. }else{
  284. return value
  285. .map((gradeId: any) => userGradeList.value.find((item: any) => item.grade == gradeId)?.gradeName || gradeId)
  286. .join(',') || '未知';
  287. }
  288. }
  289. // 银行卡列表数据
  290. // let tableData = ref([])
  291. // Tabs切换
  292. let activeName = ref('msg')
  293. // 银行卡信息
  294. let bankCardInfo = ref({})
  295. let bankTitle = ref('添加银行卡')
  296. // 添加银行卡弹框
  297. let bankCardDialogShow = ref(false)
  298. // 添加银行卡
  299. const addBankCard = () => {
  300. bankTitle.value = '添加银行卡'
  301. bankCardDialogShow.value = true
  302. bankCardInfo.value = {
  303. userJzgInfoId: dataDetail.value.id,
  304. name: dataDetail.value.name,
  305. isRead: false
  306. }
  307. }
  308. // 编辑银行卡
  309. const editBankCard = (row) => {
  310. bankTitle.value = '查看银行卡'
  311. bankCardDialogShow.value = true
  312. bankCardInfo.value = {
  313. userJzgInfoId: dataDetail.value.id,
  314. name: dataDetail.value.name,
  315. bankName: row.bankName,
  316. bankCardNumber: row.bankCardNumber,
  317. bankAddress: row.bankAddress,
  318. attachment: row.cardFile,
  319. imageUrl: row.cardFile,
  320. isRead: true
  321. }
  322. }
  323. // 关闭添加银行卡弹框
  324. const closeAddBankCard = (type: string) => {
  325. if(type == '确定') {
  326. initDetail()
  327. }
  328. bankCardDialogShow.value = false
  329. }
  330. // 删除
  331. const operationDel = (id: string[]) => {
  332. api.operationApi.operationDelete({
  333. ids: id,
  334. getAll: 0
  335. }).then(res => {
  336. if(res?.code == 200) {
  337. ElMessage({
  338. message: res.msg,
  339. type: 'success'
  340. })
  341. myRouter.push({
  342. path: 'operationManagement/operation',
  343. })
  344. } else {
  345. ElMessage({
  346. message: res.msg,
  347. type: 'warning'
  348. })
  349. }
  350. })
  351. }
  352. // 启用/禁用
  353. const operationIsEnable = (data: OperationIsEnable) => {
  354. api.operationApi.operationIsEnable(data).then(res => {
  355. if(res?.code == 200) {
  356. ElMessage({
  357. message: res.msg,
  358. type: 'success'
  359. })
  360. initDetail()
  361. } else {
  362. ElMessage({
  363. message: res.msg,
  364. type: 'warning'
  365. })
  366. }
  367. })
  368. }
  369. // 审核通过
  370. const checkPass = () => {
  371. api.operationApi.salesmanAuthSuccess({ userInfoId: dataDetail.value.id }).then(res => {
  372. if(res.code == 200) {
  373. ElMessage({
  374. message: res.msg,
  375. type: 'success',
  376. })
  377. initDetail()
  378. } else {
  379. ElMessage({
  380. message: res.msg,
  381. type: 'warning',
  382. })
  383. }
  384. })
  385. }
  386. // 审核不通过
  387. const checkNotPass = () => {
  388. ElMessageBox({
  389. title: '审核不通过',
  390. showInput: true,
  391. inputPlaceholder: '请输入原因',
  392. inputValue: '',
  393. showCancelButton: true,
  394. confirmButtonText: '确定',
  395. cancelButtonText: '取消',
  396. }).then(({ value, action } ) => {
  397. if(action == 'confirm') {
  398. api.operationApi.salesmanAuthFailed({
  399. userInfoId: dataDetail.value.id,
  400. approvalOpinion: value
  401. }).then(res => {
  402. if(res.code == 200) {
  403. ElMessage({
  404. message: res.msg,
  405. type: 'success',
  406. })
  407. initDetail()
  408. } else {
  409. ElMessage({
  410. message: res.msg,
  411. type: 'warning',
  412. })
  413. }
  414. })
  415. }
  416. }).catch(( action ) => {
  417. })
  418. }
  419. // 编辑/修改
  420. let dialogShow = ref(false)
  421. const editDetail = () => {
  422. dialogShow.value = true
  423. nextTick(() => {
  424. AddOperationRef.value.initEditData(dataDetail.value.userId, dataDetail.value.id)
  425. })
  426. }
  427. const closeAddOperation = (text: string) => {
  428. if(text == '确定') {
  429. initDetail()
  430. }
  431. dialogShow.value = false
  432. }
  433. // 附件转换
  434. const imageChangeName = (type) => {
  435. if(dataDetail.value&&dataDetail.value.fileList.length>0) {
  436. let obj = dataDetail.value.fileList.find(item => item.fileType === type)
  437. return obj?.fileName
  438. }
  439. }
  440. const imageChangeUrl = (type) => {
  441. if(dataDetail.value.fileList.length>0) {
  442. let obj = dataDetail.value.fileList.find(item => item.fileType == type)
  443. return obj?.fileUrl
  444. }
  445. }
  446. // 预览
  447. let imageUrl = ref('')
  448. let imageShow = ref(false)
  449. const imageView = (type) => {
  450. imageUrl.value = imageChangeUrl(type)
  451. imageShow.value = true
  452. }
  453. // 详情
  454. let dataDetail = ref(null)
  455. const initDetail = () => {
  456. let id = myRoute.query?.userId
  457. api.operationApi.operationDetail(id).then(res => {
  458. if(res?.code == 200) {
  459. dataDetail.value = res.data
  460. } else {
  461. ElMessage({
  462. message: res.msg,
  463. type: 'warning'
  464. })
  465. }
  466. })
  467. }
  468. // 初始化银行数据
  469. let bankOption = ref([])
  470. const initBankCard = () => {
  471. api.commonApi.personInfo('bank_info').then(res => {
  472. if(res.code == 200) {
  473. bankOption.value = res.data
  474. } else {
  475. ElMessage({
  476. message: res.msg,
  477. type: 'warning'
  478. })
  479. }
  480. })
  481. }
  482. // 转换
  483. const bankCardChange = (list, code) => {
  484. if(code&&list.length>0) {
  485. let obj = list.find(item => item.id == code)
  486. return obj.label
  487. }
  488. }
  489. // 名字转换首字母
  490. const initName = (name) => {
  491. return name?pinyin.getFullChars(name).substring(0, 1):''
  492. }
  493. onMounted(() => {
  494. initDetail()
  495. initBankCard()
  496. getGradeOptions()
  497. })
  498. // 获取人员等级列表
  499. let userGradeList = ref()
  500. const getGradeOptions = () => {
  501. api.partnerApi.queryGradeName().then((res: any) => {
  502. if (res.code === 200) {
  503. userGradeList.value = res.data;
  504. }
  505. })
  506. }
  507. </script>
  508. <style scoped lang="scss">
  509. .detail{
  510. margin: 0 10px;
  511. height: calc(100vh - 120px);
  512. background-color: white;
  513. overflow-y: auto;
  514. .state{
  515. border: 1px solid #FF4545;
  516. border-radius: 10px;
  517. padding: 10px 20px;
  518. background: #FFF4F4;
  519. display: flex;
  520. margin: 5px 0;
  521. font-weight: 400;
  522. color: #333333;
  523. h3{
  524. font-size: 16px;
  525. margin: 0 0 10px;
  526. color: rgba(0,0,0,.64);
  527. }
  528. p{
  529. font-size: 14px;
  530. margin: 10px 0;
  531. }
  532. }
  533. .info{
  534. background: white;
  535. padding: 24px;
  536. margin: 10px 0;
  537. border-radius: 10px;
  538. :deep(.el-descriptions__title) {
  539. width: 100%;
  540. }
  541. :deep(.el-tabs__nav-wrap) {
  542. padding: 0 25px;
  543. }
  544. :deep(.el-tabs__item) {
  545. font-size: 18px;
  546. }
  547. .firstName{
  548. width: 30px;
  549. height: 30px;
  550. text-align: center;
  551. line-height: 30px;
  552. border-radius: 15px;
  553. background: #409EFF;
  554. color: white;
  555. font-size: 18px;
  556. margin-right: 10px;
  557. }
  558. .allName{
  559. font-size: 14px;
  560. }
  561. }
  562. .message{
  563. background: white;
  564. :deep(.el-tabs__nav-scroll) {
  565. padding: 24px 0 0 24px;
  566. }
  567. .other{
  568. .fileItem{
  569. display: flex;
  570. justify-content: flex-start;
  571. align-items: center;
  572. margin: 10px 0;
  573. .label{
  574. width: 200px;
  575. }
  576. .fileName{
  577. width: calc(100% - 500px);
  578. line-height: 30px;
  579. display: flex;
  580. align-items: center;
  581. padding: 0 20px;
  582. &:hover{
  583. background: #ccc;
  584. }
  585. .file-name{
  586. width: 200px;
  587. overflow: hidden;
  588. text-overflow: ellipsis;
  589. white-space: nowrap;
  590. margin-right: 20px;
  591. }
  592. .file-icon{
  593. display: flex;
  594. justify-content: flex-start;
  595. align-items: center;
  596. height: 30px;
  597. cursor: pointer;
  598. &:hover{
  599. color: #00a0f4;
  600. }
  601. }
  602. }
  603. }
  604. .cardImage{
  605. display: block;
  606. width: 80px;
  607. height: 80px;
  608. border-radius: 5px;
  609. }
  610. :deep(.el-descriptions__title) {
  611. padding-left: 20px;
  612. font-size: 16px;
  613. }
  614. }
  615. }
  616. .image-box{
  617. display: flex;
  618. align-content: center;
  619. justify-content: center;
  620. }
  621. :deep(.el-table th.el-table__cell) {
  622. background-color: #F7F7F9;
  623. }
  624. }
  625. </style>