operationDetail.vue 20 KB

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