operationDetail.vue 17 KB

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