Commit fc0ecae84376fbd53b9edc6b494330b06327176b

Authored by 史婷婷
1 parent 49f7233f

feat: 资信管理-变更记录详情+核心人员兼容history模式

... ... @@ -103,6 +103,13 @@
103 103 "navigationBarBackgroundColor": "#ffffff",
104 104 "navigationBarTextStyle": "black"
105 105 }
  106 + }, {
  107 + "path": "pages/credit_manage/history_detail",
  108 + "style": {
  109 + "navigationBarTitleText": "变更记录详情",
  110 + "navigationBarBackgroundColor": "#ffffff",
  111 + "navigationBarTextStyle": "black"
  112 + }
106 113 },
107 114 {
108 115 "path": "pages/flow/myflow",
... ...
1 1 <template>
2   - <view class="core-personnel">
3   - <view class="header" :class="{'bp': mode !== 'add'}">
  2 + <view class="core-personnel" :class="{ 'history': mode == 'history' }">
  3 + <!-- 变更记录详情-核心人员 -->
  4 + <view v-if="mode === 'history'" class="header">
  5 + <text class="title">{{ title }}</text>
  6 + </view>
  7 + <!-- 新增&详情-核心人员 -->
  8 + <view v-else class="header" :class="{ 'bp': mode !== 'add' }">
4 9 <image class="opCollapse" src="/static/images/title.png" />
5 10 <text class="title">核心人员</text>
6 11 <view class="ops">
... ... @@ -90,7 +95,7 @@
90 95 </view>
91 96 </view>
92 97
93   - <view v-else class="view-list" v-show="!collapsedView">
  98 + <view v-else-if="mode === 'view'" class="view-list" v-show="!collapsedView">
94 99 <view v-for="(item, idx) in items" :key="'v-' + idx" class="card">
95 100 <view class="row"><text class="label">姓名</text><text class="value">{{ item.name }}</text></view>
96 101 <view class="row"><text class="label">性别</text><text class="value">{{ getSexName(item) }}</text></view>
... ... @@ -103,6 +108,19 @@
103 108 <view class="row"><text class="label">现住址</text><text class="value">{{ item.address }}</text></view>
104 109 </view>
105 110 </view>
  111 + <view v-else-if="mode === 'history'" class="history-list" v-show="!collapsedView">
  112 + <view v-for="(item, idx) in items" :key="'v-' + idx" class="card">
  113 + <view class="row"><text class="label">姓名</text><text class="value" :class="{'change': item.nameChange || ['ADD', 'DELETE'].includes(item.type)}">{{ item.name }}</text></view>
  114 + <view class="row"><text class="label">性别</text><text class="value" :class="{'change': item.sexChange || ['ADD', 'DELETE'].includes(item.type)}">{{ getSexName(item) }}</text></view>
  115 + <view class="row"><text class="label">籍贯</text><text class="value" :class="{'change': item.nativePlaceChange || ['ADD', 'DELETE'].includes(item.type)}">{{ item.nativePlace }}</text></view>
  116 + <view class="row"><text class="label">年龄</text><text class="value" :class="{'change': item.ageChange || ['ADD', 'DELETE'].includes(item.type)}">{{ item.age }}</text></view>
  117 + <view class="row"><text class="label">职务</text><text class="value" :class="{'change': item.positionChange || ['ADD', 'DELETE'].includes(item.type)}">{{ item.position }}</text></view>
  118 + <view class="row"><text class="label">手机</text><text class="value" :class="{'change': item.mobileChange || ['ADD', 'DELETE'].includes(item.type)}">{{ item.mobile }}</text></view>
  119 + <view class="row"><text class="label">固定电话</text><text class="value" :class="{'change': item.phoneChange || ['ADD', 'DELETE'].includes(item.type)}">{{ item.phone }}</text></view>
  120 + <view class="row"><text class="label">邮箱地址</text><text class="value" :class="{'change': item.emailChange || ['ADD', 'DELETE'].includes(item.type)}">{{ item.email }}</text></view>
  121 + <view class="row"><text class="label">现住址</text><text class="value" :class="{'change': item.addressChange || ['ADD', 'DELETE'].includes(item.type)}">{{ item.address }}</text></view>
  122 + </view>
  123 + </view>
106 124 <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options"
107 125 v-model="sheet.value" @confirm="onProductConfirm" />
108 126 </view>
... ... @@ -113,6 +131,7 @@ import { uuid } from '@/utils/uuid.js'
113 131 export default {
114 132 name: 'CorePersonnel',
115 133 props: {
  134 + title: { type: String, default: '' },
116 135 mode: { type: String, default: 'add' },
117 136 list: { type: Array, default: () => [] },
118 137 max: { type: Number, default: 8 },
... ... @@ -240,6 +259,14 @@ export default {
240 259 <style lang="scss" scoped>
241 260 .core-personnel {
242 261 margin-top: 10px;
  262 +
  263 + &.history {
  264 + margin-top: 0;
  265 +
  266 + .header {
  267 + padding: 32rpx 0 0 32rpx;
  268 + }
  269 + }
243 270 }
244 271
245 272 .header {
... ... @@ -247,6 +274,7 @@ export default {
247 274 display: flex;
248 275 align-items: center;
249 276 padding: 24rpx 32rpx;
  277 +
250 278 &.bp {
251 279 border-bottom: 1rpx dashed #f0f0f0;
252 280 }
... ... @@ -382,41 +410,86 @@ export default {
382 410 .view-list {
383 411 padding: 26rpx 32rpx;
384 412 background: #ffffff;
385   -}
386 413
387   -.card {
388   - background: #f3f3f3;
389   - border-radius: 16rpx;
390   - padding: 32rpx 44rpx;
391   - margin-bottom: 20rpx;
  414 + .card {
  415 + background: #f3f3f3;
  416 + border-radius: 16rpx;
  417 + padding: 32rpx 44rpx;
  418 + margin-bottom: 20rpx;
392 419
393   - &:last-child {
  420 + &:last-child {
  421 + margin-bottom: 0;
  422 + }
  423 + }
  424 +
  425 + .row {
  426 + display: flex;
  427 + margin-bottom: 24rpx;
  428 + line-height: 32rpx;
  429 + }
  430 +
  431 + .row:last-child {
394 432 margin-bottom: 0;
395 433 }
396   -}
397 434
398   -.row {
399   - display: flex;
400   - margin-bottom: 24rpx;
401   - line-height: 32rpx;
402   -}
  435 + .label {
  436 + width: 180rpx;
  437 + margin-right: 14rpx;
  438 + color: rgba(0, 0, 0, 0.6);
  439 + font-size: 28rpx;
  440 + }
403 441
404   -.row:last-child {
405   - margin-bottom: 0;
  442 + .value {
  443 + flex: 1;
  444 + color: rgba(0, 0, 0, 0.9);
  445 + font-size: 28rpx;
  446 + white-space: pre-wrap;
  447 + word-break: break-all;
  448 + }
406 449 }
407 450
408   -.label {
409   - width: 180rpx;
410   - margin-right: 14rpx;
411   - color: rgba(0, 0, 0, 0.6);
412   - font-size: 28rpx;
413   -}
  451 +.history-list {
  452 + padding: 20rpx 32rpx;
  453 + background: #ffffff;
414 454
415   -.value {
416   - flex: 1;
417   - color: rgba(0, 0, 0, 0.9);
418   - font-size: 28rpx;
419   - white-space: pre-wrap;
420   - word-break: break-all;
  455 + .card {
  456 + background: #f3f3f3;
  457 + border-radius: 16rpx;
  458 + padding: 32rpx 44rpx;
  459 + margin-bottom: 20rpx;
  460 +
  461 + &:last-child {
  462 + margin-bottom: 0;
  463 + }
  464 + }
  465 +
  466 + .row {
  467 + display: flex;
  468 + margin-bottom: 24rpx;
  469 + line-height: 32rpx;
  470 + }
  471 +
  472 + .row:last-child {
  473 + margin-bottom: 0;
  474 + }
  475 +
  476 + .label {
  477 + width: 180rpx;
  478 + margin-right: 14rpx;
  479 + color: rgba(0, 0, 0, 0.6);
  480 + font-size: 28rpx;
  481 + }
  482 +
  483 + .value {
  484 + flex: 1;
  485 + color: rgba(0, 0, 0, 0.9);
  486 + font-size: 28rpx;
  487 + white-space: pre-wrap;
  488 + word-break: break-all;
  489 +
  490 + &.change {
  491 + color: $theme-primary;
  492 + }
  493 + }
421 494 }
422 495 </style>
... ...
... ... @@ -248,7 +248,10 @@ export default {
248 248 }
249 249 },
250 250 onViewHistory(item) {
251   - console.log('onViewHistory', item)
  251 + const id = item && (item.id)
  252 + if (!id) return
  253 + const query = '?id=' + encodeURIComponent(id)
  254 + uni.navigateTo({ url: '/pages/credit_manage/history_detail' + query })
252 255 },
253 256 getDicName,
254 257 getCategoryClass(categoryName) {
... ...
  1 +<template>
  2 + <view class="page">
  3 + <scroll-view class="scroll" scroll-y>
  4 + <view class="detail-page">
  5 + <view class="section">
  6 + <view class="row"><text class="label" style="color: rgba(0,0,0,0.9);">变更日期</text><text class="value">{{
  7 + changeTime || '' }}</text></view>
  8 + </view>
  9 + <view v-for="(it, idx) in otherList" :key="idx" class="section">
  10 + <view class="row row_head"><text class="label">序号{{ it.serialNumber }}</text></view>
  11 + <view class="row"><text class="label">变更前</text><text class="value">{{ it.beforeChange }}</text></view>
  12 + <view class="row"><text class="label">变更后</text><text class="value">{{ it.afterChange }}</text></view>
  13 + </view>
  14 +
  15 + <CorePersonnel title="人员信息变更前" mode="history" :options="genderOptions" :list="personnelBefore" />
  16 + <CorePersonnel title="人员信息变更后" mode="history" :options="genderOptions" :list="personnelAfter" />
  17 + </view>
  18 + </scroll-view>
  19 + </view>
  20 +</template>
  21 +
  22 +<script>
  23 +import { getDicByCodeApi } from '@/api/base.js'
  24 +import { getCreditHistoryList } from '@/api/credit_manage.js'
  25 +import CorePersonnel from './corePersonnel.vue'
  26 +
  27 +export default {
  28 + name: 'CreditHistoryDetail',
  29 + components: { CorePersonnel },
  30 + data() {
  31 + return {
  32 + id: '',
  33 + otherList: [],
  34 + personnelBefore: [],
  35 + personnelAfter: [],
  36 + genderOptions: [],
  37 + changeTime: '',
  38 + }
  39 + },
  40 + created() {
  41 + this.loadGenderOptions()
  42 + },
  43 + onLoad(query) {
  44 + const id = (query && query.id) || ''
  45 + this.id = id
  46 + if (id) this.loadDetail(id)
  47 + },
  48 + methods: {
  49 + async loadDetail(id) {
  50 + try {
  51 + const res = await getCreditHistoryList(id);
  52 + const data = res.data || {};
  53 + this.otherList = Array.isArray(data.otherChangeList) ? data.otherChangeList : []
  54 + this.personnelAfter = Array.isArray(data.personnelAfterChangeList) ? data.personnelAfterChangeList : []
  55 + this.changeTime = data.changeTime ? data.changeTime : '';
  56 + this.personnelBefore = Array.isArray(data.personnelBeforeChangeList) ? data.personnelBeforeChangeList : []
  57 + } catch (e) {
  58 + this.otherList = []
  59 + this.personnelAfter = []
  60 + this.personnelBefore = []
  61 + this.changeTime = ''
  62 + }
  63 + },
  64 + async loadGenderOptions() {
  65 + try {
  66 + const res = await getDicByCodeApi('GENDER_TYPE')
  67 + const list = res.data || []
  68 + this.genderOptions = Array.isArray(list) ? list : []
  69 + } catch (e) {
  70 + this.genderOptions = []
  71 + }
  72 + },
  73 + }
  74 +}
  75 +</script>
  76 +
  77 +<style lang="scss" scoped>
  78 +.page {
  79 + display: flex;
  80 + flex-direction: column;
  81 + height: 100%;
  82 +}
  83 +
  84 +.scroll {
  85 + flex: 1;
  86 + padding: 8rpx 0 144rpx 0;
  87 +}
  88 +
  89 +.detail-page {
  90 + background: #f3f3f3;
  91 +}
  92 +
  93 +.section {
  94 + padding: 32rpx;
  95 + background: #fff;
  96 + margin-bottom: 20rpx;
  97 +}
  98 +
  99 +.row {
  100 + display: flex;
  101 + margin-bottom: 24rpx;
  102 +
  103 + &:last-child {
  104 + margin-bottom: 0;
  105 + }
  106 +
  107 + .label {
  108 + width: 120rpx;
  109 + font-size: 28rpx;
  110 + color: rgba(0, 0, 0, 0.6);
  111 + }
  112 +
  113 + .value {
  114 + flex: 1;
  115 + text-align: right;
  116 + font-size: 28rpx;
  117 + color: rgba(0, 0, 0, 0.9);
  118 + }
  119 +
  120 + &.row_head {
  121 + padding-bottom: 20rpx;
  122 + border-bottom: 1rpx dashed #f0f0f0;
  123 +
  124 + .label {
  125 + color: rgba(0, 0, 0, 0.9);
  126 + font-weight: 600;
  127 + padding-left: 6rpx;
  128 + }
  129 + }
  130 +}
  131 +
  132 +.title-header {
  133 + background-color: #fff;
  134 + display: flex;
  135 + align-items: center;
  136 + padding: 32rpx 32rpx 22rpx;
  137 +
  138 + &_icon {
  139 + width: 32rpx;
  140 + height: 28rpx;
  141 + margin-right: 16rpx;
  142 + margin-top: 8rpx;
  143 + }
  144 +
  145 + span {
  146 + color: rgba(0, 0, 0, 0.9);
  147 + font-size: 32rpx;
  148 + line-height: 44rpx;
  149 + font-weight: 600;
  150 + }
  151 +}
  152 +
  153 +.mgb10 {
  154 + margin-bottom: 20rpx;
  155 +}
  156 +</style>
\ No newline at end of file
... ...