detail.vue 12.5 KB
<template>
  <view class="page">
    <scroll-view class="scroll" scroll-y>
      <view class="detail-page">
        <view class="section">
          <text class="row company">{{ form.companyName }}</text>
          <view :class="['status', `status_${form.status}`]" />
          <view class="row"><text class="label">编号</text><text class="value">{{ form.serialNumber }}</text></view>
          <view class="row"><text class="label">区域</text><text class="value">{{ form.region }}</text></view>
          <view class="row"><text class="label">企业类型</text><text class="value">{{ getDicName('ENTERPRISE_TYPE',
            form.enterpriseType, enterpriseTypeOptions) }}</text></view>
          <view class="row"><text class="label">登记日期</text><text class="value">{{ form.registerDate }}</text></view>
        </view>

        <view class="title-header">
          <image class="title-header_icon" src="/static/images/title.png" />
          <span>基础资料</span>
        </view>
        <view class="section">
          <view class="row"><text class="label">企业性质</text><text class="value">{{ form.companyNature }}</text></view>
          <view class="row"><text class="label">单位地址</text><text class="value">{{ form.companyAddress }}</text></view>
          <view class="row"><text class="label">注册资本</text><text class="value">{{ form.registeredCapital }} 万元</text>
          </view>
          <view class="row"><text class="label">账号</text><text class="value">{{ form.bankAccount }}</text></view>
          <view class="row"><text class="label">账开户行</text><text class="value">{{ form.bankName }}</text></view>
          <view class="row"><text class="label">税号</text><text class="value">{{ form.taxNumber }}</text></view>
          <view class="row"><text class="label">注册时间</text><text class="value">{{ form.registrationTime }}</text></view>
          <view class="row"><text class="label">经营年限</text><text class="value">{{ form.businessYears }}</text></view>
          <view class="row"><text class="label">经营范围</text><text class="value">{{ form.businessScope }}</text></view>
        </view>

        <!-- 核心人员 -->
        <view class="mgb10">
          <CorePersonnel mode="view" :options="genderOptions" :list="form.corePersonnelList" />
        </view>

        <view class="title-header">
          <image class="title-header_icon" src="/static/images/title.png" />
          <span>资产经营情况</span>
        </view>
        <view class="section">
          <view class="row"><text class="label">经营场地属性</text><text class="value">{{ form.businessProperty }}</text>
          </view>
          <view class="row"><text class="label">占地面积</text><text class="value">{{ form.landArea }} 平方米</text></view>
          <view class="row"><text class="label">仓储条件</text><text class="value">{{ form.storageConditions }}</text>
          </view>
          <view class="row"><text class="label">员工人数</text><text class="value">{{ form.employeeCount }}</text></view>
          <view class="row"><text class="label">设备属性</text><text class="value">{{ form.equipmentAttributes }}</text>
          </view>
          <view class="row"><text class="label">资产评估</text><text class="value">{{ form.assetEvaluation }}</text></view>
          <view class="row"><text class="label">上年度销售额</text><text class="value">{{ form.lastYearSales }}</text></view>
          <view class="row"><text class="label">月均销量</text><text class="value">{{ form.monthlyAvgSales }}</text></view>
        </view>

        <view class="title-header">
          <image class="title-header_icon" src="/static/images/title.png" />
          <span>与我司合作</span>
        </view>
        <view class="section">
          <view class="row"><text class="label">与我司合作时间</text><text class="value">{{ form.cooperationStartDate }}</text>
          </view>
          <view class="row"><text class="label">月均操作量</text><text class="value">{{ form.monthlyAvgVolume }}</text>
          </view>
          <view class="row"><text class="label">是否口头协议操作</text><text class="value">{{ form.isVerbalAgreement }}</text>
          </view>
          <view class="row"><text class="label">是否签订其他协议</text><text class="value">{{ form.otherAgreements }}</text>
          </view>
          <view class="row"><text class="label">是否签订长年合同</text><text class="value">{{ form.hasLongTermContract }}</text>
          </view>
          <view class="row"><text class="label">合同类型</text><text class="value">{{ form.contractType }}</text></view>
          <view class="row"><text class="label">是否有过中断及原因</text><text class="value">{{ form.hasInterruption }}</text>
          </view>
        </view>

        <view class="title-header">
          <image class="title-header_icon" src="/static/images/title.png" />
          <span>办事处意见</span>
        </view>
        <view class="section">
          <view class="row"><text class="label">建议客户分类</text>
            <text class="value">
              <text
                :class="[form.suggestedCategory ? 'category' : '', getCategoryClass(getDicName('CUSTOMER_CATEGORY', form.suggestedCategory, categoryOptions))]">{{
                  getDicName('CUSTOMER_CATEGORY', form.suggestedCategory, categoryOptions) }}</text>
            </text>
          </view>
          <view class="row"><text class="label">授信额度</text><text class="value">{{ form.creditLimit }} 万元</text></view>
          <view class="row"><text class="label">结算期限</text><text class="value">{{ form.settlementPeriod }}</text></view>
          <view class="row"><text class="label">加工操作方案</text><text class="value">{{ form.materialSupplyPlan }}</text>
          </view>
          <view class="row"><text class="label">调查人</text><text class="value">{{ form.investigatorName }}</text></view>
          <view class="row"><text class="label">审核主管</text><text class="value">{{ form.supervisorReviewName }}</text>
          </view>
        </view>

        <view class="title-header">
          <image class="title-header_icon" src="/static/images/title.png" />
          <span>职能核对</span>
        </view>
        <view class="section">
          <view class="row"><text class="label">年度总销量</text><text class="value">{{ form.annualTotalSales }}</text>
          </view>
          <view class="row"><text class="label">主要行业</text><text class="value">{{ form.mainIndustry }}</text></view>
          <view class="row"><text class="label">年度款料概况</text><text class="value">{{ form.annualMaterialOverview
          }}</text></view>
        </view>

        <view class="title-header">
          <image class="title-header_icon" src="/static/images/title.png" />
          <span>公司评审</span>
        </view>
        <view class="section">
          <view class="row"><text class="label">客户分类</text>
            <text class="value">
              <text
                :class="[form.companySuggestedCategory ? 'category' : '', getCategoryClass(getDicName('CUSTOMER_CATEGORY', form.companySuggestedCategory, categoryOptions))]">{{
                  getDicName('CUSTOMER_CATEGORY', form.companySuggestedCategory, categoryOptions) }}</text>
            </text>
          </view>

          <view class="row"><text class="label">授信额度</text><text class="value">{{ form.companyCreditLimit }} 万元</text>
          </view>
          <view class="row"><text class="label">结算期限</text><text class="value">{{ form.companySettlementPeriod }}</text>
          </view>
          <view class="row"><text class="label">加工操作方案</text><text class="value">{{ form.companyMaterialSupplyPlan
          }}</text></view>
          <view class="row"><text class="label">复核人</text><text class="value">{{ form.reviewerName }}</text></view>
          <view class="row"><text class="label">审批人</text><text class="value">{{ form.approverName }}</text></view>
        </view>


      </view>
    </scroll-view>
  </view>
</template>

<script>
import { getDetailApi } from '@/api/credit_manage.js'
import { getDicName } from '@/utils/dic.js'
import { getDicByCodeApi } from '@/api/base.js'
import CorePersonnel from './corePersonnel.vue'

export default {
  name: 'CreditManageDetail',
  components: { CorePersonnel },
  data() {
    return {
      form: {},
      enterpriseTypeOptions: [],
      genderOptions: [],
      categoryOptions: [],
    }
  },
  computed: {
  },
  created() {
    this.loadEnterpriseTypeOptions()
    this.loadGenderOptions()
    this.loadCategoryOptions()
  },
  onLoad(query) {
    const id = (query && (query.id || query.code)) || ''
    if (id) this.loadDetail(id)
  },
  methods: {
    async loadDetail(id) {
      try {
        const res = await getDetailApi(id)
        const data = res.data || {}
        this.form = { ...data }
      } catch (e) {
        this.form = {}
      }
    },
    async loadEnterpriseTypeOptions() {
      try {
        const res = await getDicByCodeApi('ENTERPRISE_TYPE')
        const list = res.data || []
        this.enterpriseTypeOptions = Array.isArray(list) ? list : []
      } catch (e) {
        this.enterpriseTypeOptions = []
      }
    },
    async loadGenderOptions() {
      try {
        const res = await getDicByCodeApi('GENDER_TYPE')
        const list = res.data || []
        this.genderOptions = Array.isArray(list) ? list : []
      } catch (e) {
        this.genderOptions = []
      }
    },
    async loadCategoryOptions() {
      try {
        const res = await getDicByCodeApi('CUSTOMER_CATEGORY')
        const list = res.data || []
        this.categoryOptions = Array.isArray(list) ? list : []
      } catch (e) {
        this.categoryOptions = []
      }
    },
    getDicName,
    getCategoryClass(categoryName) {
      if (!categoryName) return ''
      if (categoryName.includes('A') || categoryName.includes('a')) {
        return 'category_A'
      } else if (categoryName.includes('B') || categoryName.includes('b')) {
        return 'category_B'
      } else if (categoryName.includes('C') || categoryName.includes('c')) {
        return 'category_C'
      } else if (categoryName.includes('D') || categoryName.includes('d')) {
        return 'category_D'
      }
    },
  }
}
</script>

<style lang="scss" scoped>
.page {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.scroll {
  flex: 1;
  padding: 8rpx 0 144rpx 0;
}

.detail-page {
  background: #f3f3f3;
}

.section {
  padding: 0 32rpx 32rpx;
  background: #fff;
  margin-bottom: 20rpx;
  position: relative;

  .status {
    position: absolute;
    top: 16rpx;
    right: 52rpx;
    width: 180rpx;
    height: 146rpx;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center;

    &_AUDIT {
      background-image: url('~@/static/images/dev_manage/status_1.png');
    }

    &_PASS {
      background-image: url('~@/static/images/dev_manage/status_2.png');
    }

    &_REFUSE {
      background-image: url('~@/static/images/dev_manage/status_3.png');
    }

    &_CANCEL {
      background-image: url('~@/static/images/dev_manage/status_4.png');
    }
  }
}

.mgb10 {
  margin-bottom: 20rpx;
}

.row {
  display: flex;
  margin-bottom: 28rpx;

  &:last-child {
    margin-bottom: 0;
  }

  &.company {
    font-size: 36rpx;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.9);
    padding-top: 32rpx;
    line-height: 50rpx;
  }

  .label {
    width: 180rpx;
    line-height: 32rpx;
    font-size: 28rpx;
    color: rgba(0, 0, 0, 0.6);
  }

  .value {
    flex: 1;
    line-height: 32rpx;
    font-size: 28rpx;
    color: rgba(0, 0, 0, 0.9);
    text-align: right;

    .category {
      display: inline-block;
      padding: 4rpx 12rpx;
      border-radius: 6rpx;
      font-size: 24rpx;
      width: auto;

      &.category_A {
        background: #FFF0ED;
        color: #D54941;
      }

      &.category_B {
        background: #FFF1E9;
        color: #E37318;
      }

      &.category_C {
        background: #F2F3FF;
        color: $theme-primary;
      }

      &.category_D {
        background: #E3F9E9;
        color: #2BA471;
      }
    }
  }
}

.card {
  padding: 16rpx 0 8rpx;
  border-top: 1rpx solid #f0f0f0;
}

.title-header {
  background-color: #fff;
  display: flex;
  align-items: center;
  padding: 32rpx 32rpx 22rpx;

  &_icon {
    width: 32rpx;
    height: 28rpx;
    margin-right: 16rpx;
    margin-top: 8rpx;
  }

  span {
    color: rgba(0, 0, 0, 0.9);
    font-size: 32rpx;
    line-height: 44rpx;
    font-weight: 600;
  }
}
</style>