<!-- 分值调整 -->
<script lang="tsx" setup>
import { ElButton,ElInput } from 'element-plus'
import { reactive } from 'vue'
import { propTypes } from '@/utils/propTypes'
const props = defineProps({
  type: propTypes.string.def(''),
})


//得分信息
const rateScoreList = reactive({
    regionalScore:1.0,//地域特性得分
    professScore:1.0,//职业特性得分
    customerCardTypeScore:1.0,//客户所持身份证件或身份证明文件的种类得分
    customerAgeScore:1.0,//客户年龄得分
    customerRelaScore:1.0,//业务关系的渠道得分
    monimoniRecordScore:1.0,//反洗钱交易监测记录得分
    customerTipRecordScore:1.0,//涉及客户的风险提示信息或权威媒体报道信息得分
    proxyProcessScore:1.0,//代理办理得分
    noFaceToFaceTranScore:1.0,//非面对面交易得分
    balaceScore:1.0,//不留余额得分
    correlationDegreeScore:1.0,//现金的关联程度得分

    addScoreAdje:"",//附加分调整
    reasonForAdje:"",//调整原因
})
//等级试算方法
const gradeCalulation = () => {

}
//提交
const submitScore = () => {

}
//导出
const exportScore = () => {

}
//退回
const rebackScore = ()=>{
  
}

</script>
<template>
  <div class="scoreTable">
    <table class="scoreAdjTable">
      <!-- 首行表头 -->
      <tr>
        <th>风险要素</th>
        <th colspan="2">风险子项</th>
        <th>权重</th>
        <th>评分参考</th>
        <th>系统评分</th>
        <th>初评评分</th>
        <th>复评评分</th>
      </tr>
      <!-- 地域特性（权重20） -->
      <tr>
        <td rowspan="4">地域特性（权重20）</td>
        <td rowspan="4">地址</td>
        <td>境外地址</td>
        <td rowspan="4">20</td>
        <td>5.0</td>
        <td rowspan="4">1.0</td>
        <td rowspan="4" v-if="props.type == 'first'">
          <ElInput v-model="rateScoreList.regionalScore" />
        </td>
        <td rowspan="4" v-if="props.type == 'first'">0.0</td>
        <td rowspan="4" v-if="props.type == 'second'">
          3.0
        </td>
        <td rowspan="4" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.regionalScore" /></td>
      </tr>
      <tr>
        <td>新疆、西藏、云南、广东、吉林、广西、福建地址</td>
        <td>4.0</td>
      </tr>
      <tr>
        <td>除新疆、西藏、云南、广东、吉林、广西、福建外的省外地址</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>青海省内地址</td>
        <td>1.0</td>
      </tr>
      <!-- 职业特性（权重15） -->
      <tr>
        <td rowspan="5">职业特性（权重15）</td>
        <td rowspan="5">职业风险程度</td>
        <td>公认具有较高风险的行业，如珠宝业、古董业、拍卖业、艺术品收藏、典当行、娱乐业、博彩业、评估事务所及无业人员</td>
        <td rowspan="5">15</td>
        <td>5.0</td>
        <td rowspan="5">3.0</td>
        <td rowspan="5" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.professScore" /></td>
        <td rowspan="5" v-if="props.type == 'first'">0.0</td>
        <td rowspan="5" v-if="props.type == 'second'">3.0</td>
        <td rowspan="5" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.professScore" /></td>
      </tr>
      <tr>
        <td>现金密集程度较高的行业，如废品收购、旅游、餐饮、零售、影视娱乐。</td>
        <td>4.0</td>
      </tr>
      <tr>
        <td>一般行业客户（除上述和下述之外的所有行业，如学生、农民、牧民、个体工商户、私营企业员工、退休人员等。）</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>金融机构员工、国有企业职工</td>
        <td>2.0</td>
      </tr>
      <tr>
        <td>公务员、军人、非盈利社会事业单位职工</td>
        <td>1.0</td>
      </tr>
      <!-- 客户特性（权重40） -->
      <!-- 客户所持身份证件或身份证明文件的种类 -->
      <tr>
        <td rowspan="17">客户特性（权重40）</td>
        <td rowspan="3">客户所持身份证件或身份证明文件的种类</td>
        <td>护照、港澳台居民身份证</td>
        <td rowspan="3">10</td>
        <td>5.0</td>
        <td rowspan="3">1.0</td>
        <td rowspan="3" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.customerCardTypeScore" /></td>
        <td rowspan="3" v-if="props.type == 'first'">0.0</td>
        <td rowspan="3" v-if="props.type == 'second'">3.0</td>
        <td rowspan="3" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.customerCardTypeScore" /></td>
      </tr>
      <tr>
        <td>除护照、港澳台居民身份证和核查无误的居民身份证以外的其他有效证件</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>核查无误的居民身份证</td>
        <td>1.0</td>
      </tr>
      <!-- 自然人客户年龄 -->
      <tr>
        <td rowspan="4">自然人客户年龄</td>
        <td>25周岁以下</td>
        <td rowspan="4">5</td>
        <td>5.0</td>
        <td rowspan="4">5.0</td>
        <td rowspan="4" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.customerAgeScore" /></td>
        <td rowspan="4" v-if="props.type == 'first'">0.0</td>
        <td rowspan="4" v-if="props.type == 'second'">0.0</td>
        <td rowspan="4" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.customerAgeScore" /></td>
      </tr>
      <tr>
        <td>26-35周岁</td>
        <td>4.0</td>
      </tr>
      <tr>
        <td>36-60周岁</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>61岁以上</td>
        <td>1.0</td>
      </tr>
      <!-- 与客户建立业务关系的渠道 -->
      <tr>
        <td rowspan="3">与客户建立业务关系的渠道</td>
        <td>网络受理</td>
        <td rowspan="3">5</td>
        <td>5.0</td>
        <td rowspan="3">1.0</td>
        <td rowspan="3" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.customerRelaScore" /></td>
        <td rowspan="3" v-if="props.type == 'first'">0.0</td>
        <td rowspan="3" v-if="props.type == 'second'">0.0</td>
        <td rowspan="3" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.customerRelaScore" /></td>
      </tr>
      <tr>
        <td>代理受理、其他方式</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>面对面直接受理（柜面）</td>
        <td>1.0</td>
      </tr>
      <!-- 反洗钱交易监测记录 -->
      <tr>
        <td rowspan="3">反洗钱交易监测记录</td>
        <td>60个工作日内，上报可疑交易次数≥2次</td>
        <td rowspan="3">10</td>
        <td>5.0</td>
        <td rowspan="3">1.0</td>
        <td rowspan="3" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.monimoniRecordScore" /></td>
        <td rowspan="3" v-if="props.type == 'first'">0.0</td>
        <td rowspan="3" v-if="props.type == 'second'">0.0</td>
        <td rowspan="3" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.monimoniRecordScore" /></td>
      </tr>
      <tr>
        <td>60个工作日内，0次＜上报可疑交易次数＜2次</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>60个工作日内，上报可疑交易次数=0次</td>
        <td>1.0</td>
      </tr>
      <!-- 涉及客户的风险提示信息或权威媒体报道信息 -->
      <tr>
        <td rowspan="4">涉及客户的风险提示信息或权威媒体报道信息</td>
        <td>涉及风险提示或媒体报道</td>
        <td rowspan="4">10</td>
        <td>5.0</td>
        <td rowspan="4">1.0</td>
        <td rowspan="4" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.customerTipRecordScore" /></td>
        <td rowspan="4" v-if="props.type == 'first'">0.0</td>
        <td rowspan="4" v-if="props.type == 'second'">3.0</td>
        <td rowspan="4" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.customerTipRecordScore" /></td>
      </tr>
      <tr>
        <td>客户现在被查询/冻结/扣划</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>客户曾经或者现在被监管机构、执法机关关注</td>
        <td>2.0</td>
      </tr>
      <tr>
        <td>无任何提示或媒体报道</td>
        <td>1.0</td>
      </tr>
      <!-- 业务特征（权重25） -->
      <!-- 代理办理 -->
      <tr>
        <td rowspan="13">业务特征（权重25）</td>
        <td rowspan="3">代理办理</td>
        <td>30个工作日内，同一代办人代理客户办理3次以上代理开立3个以上账户或以上业务</td>
        <td rowspan="3">5</td>
        <td>5.0</td>
        <td rowspan="3">1.0</td>
        <td rowspan="3" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.proxyProcessScore" /></td>
        <td rowspan="3" v-if="props.type == 'first'">0.0</td>
        <td rowspan="3" v-if="props.type == 'second'">3.0</td>
        <td rowspan="3" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.proxyProcessScore" /></td>
      </tr>
      <tr>
        <td>30个工作日内，同一代办人代理客户办理业务小于3次</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>客户亲自到柜台办理开户业务</td>
        <td>1.0</td>
      </tr>
      <!-- 非面对面交易 -->
      <tr>
        <td rowspan="3">非面对面交易</td>
        <td>30日内，办理非柜台业务，交易限额≥200万</td>
        <td rowspan="3">5</td>
        <td>5.0</td>
        <td rowspan="3">1.0</td>
        <td rowspan="3" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.noFaceToFaceTranScore" /></td>
        <td rowspan="3" v-if="props.type == 'first'">0.0</td>
        <td rowspan="3" v-if="props.type == 'second'">0.0</td>
        <td rowspan="3" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.noFaceToFaceTranScore" /></td>
      </tr>
      <tr>
        <td>30日内，办理非柜台业务，交易限额＜200万</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>30日内，未办理非柜台业务</td>
        <td>1.0</td>
      </tr>
      <!--  -->
      <tr>
        <td rowspan="3">特殊业务类型的交易频率：1.10个自然日连续10次，规避大额监管，现金为4.9-4.99万元或转账49-49.99万元；
          2.10个自然日同一客户个人结算账户连续开销户5次以上； 3.90天未发生交易的账户突然启用且有5万元以上大额资金往来；
          4.10个自然日多个对公单位与同一个人之间转账次数超过50次，金额200万元以上；交易 5.个人账户资金通过转账方式转入，1个自然内支取，但余额20元以下或不留余额；</td>
        <td>符合其中3条以上的</td>
        <td rowspan="3">10</td>
        <td>5.0</td>
        <td rowspan="3">1.0</td>
        <td rowspan="3" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.balaceScore" /></td>
        <td rowspan="3" v-if="props.type == 'first'">0.0</td>
        <td rowspan="3" v-if="props.type == 'second'">3.0</td>
        <td rowspan="3" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.balaceScore" /></td>
      </tr>
      <tr>
        <td>符合1条以上小于3条</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>交易频率正常，无频繁发生特殊交易</td>
        <td>1.0</td>
      </tr>
      <!-- 与现金的关联程度 -->
      <tr>
        <td rowspan="4">与现金的关联程度</td>
        <td>10个自然日，现金收付合计≥200万或交易笔数50笔且单笔金额超过100元</td>
        <td rowspan="4">5</td>
        <td>5.0</td>
        <td rowspan="4">1.0</td>
        <td rowspan="4" v-if="props.type == 'first'"><ElInput v-model="rateScoreList.correlationDegreeScore" /></td>
        <td rowspan="4" v-if="props.type == 'first'">0.0</td>
        <td rowspan="4" v-if="props.type == 'second'">3.0</td>
        <td rowspan="4" v-if="props.type == 'second'"><ElInput v-model="rateScoreList.correlationDegreeScore" /></td>
      </tr>
      <tr>
        <td>10个自然日，100万≤现金收付合计＜200万</td>
        <td>4.0</td>
      </tr>
      <tr>
        <td>10个自然日，50万≤现金收付合计＜100万</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>10个自然日，现金收付合计＜50万</td>
        <td>1.0</td>
      </tr>
      <!--  -->
      <tr>
        <td colspan="3">上次评级结果：</td>
        <td colspan="3">任务状态： {{ props.type=="first"?"待初评":"待复评" }}</td>
        <td colspan="2">
          <ElButton type="primary" @click="gradeCalulation">等级试算</ElButton>
        </td>
      </tr>
      <tr>
        <td colspan="8">上次评级理由：{{ }}</td>
      </tr>
      <tr class="blockTr">
        <td colspan="8"></td>
      </tr>
      <tr>
        <td>系统</td>
        <td colspan="3">系统评级结果： 较低风险</td>
        <td colspan="4">系统评级总分： 30.0</td>
      </tr>
      <tr class="blockTr">
        <td colspan="8">123</td>
      </tr>
      <tr>
        <td rowspan="3">初评</td>
        <td colspan="3">附加分调整： <ElInput v-model="rateScoreList.addScoreAdje" v-if="props.type=='first'" /> </td>
        <td colspan="2">初评总分：{{}}</td>
        <td colspan="2">初评结果：{{}}</td>
      </tr>
      <tr>
        <td colspan="7">调整原因：<ElInput type="textarea" v-model="rateScoreList.reasonForAdje" v-if="props.type=='first'" /></td>
      </tr>
      <tr>
        <td colspan="3">初评用户：{{ }}</td>
        <td colspan="2">初评日期：{{}}</td>
        <td colspan="2"></td>
      </tr>
      <tr class="blockTr">
        <td colspan="8">123</td>
      </tr>
      <!-- 复评 -->
      <tr>
        <td rowspan="4">复评</td>
        <td colspan="3">附加分调整：<ElInput v-model="rateScoreList.reasonForAdje">
          <td colspan="2">复评总分：</td>
          <td colspan="2">复评结果：</td>
        </elinput></td></tr>
      <tr>
        <td colspan="7">调整原因：<ElInput type="textarea" v-model="rateScoreList.reasonForAdje" /></td></tr>
      <tr>
        <td colspan="7">退回原因：<ElInput type="textarea" v-model="rateScoreList.reasonForAdje" /></td></tr>
      <tr>
        <td colspan="2">复评用户：{{ }}</td>
        <td colspan="3">复评日期：{{ }}</td>
        <td colspan="2"></td>
      </tr>
      <tr class="blockTr">
        <td colspan="8">123</td>
      </tr>
      <tr>
        <td rowspan="3">审核</td>
        <td colspan="7">退回原因：{{ }}</td>
      </tr>
      <tr>
        <td colspan="3">审核用户：{{}}</td>
        <td colspan="4">审核时间：{{ }}</td>
      </tr>
      <tr>
        <td colspan="3">
          <ElButton type="primary">同意初评</ElButton>
        </td>
        <td colspan="2">
          <ElButton type="primary">同意复评</ElButton>
        </td>
        <td colspan="2">
          <ElButton type="primary">均不同意</ElButton>
        </td>
      </tr>
    </table>
    <p class="buttonList">
      <ElButton type="primary" @click="submitScore">提交</ElButton>
      <ElButton type="primary" @click="rebackScore" v-if="props.type=='second'">退回</ElButton>
      <ElButton type="primary" @click="exportScore">导出</ElButton>
    </p>
  </div>
</template>
<style lang="scss" scoped>
.scoreTable {
    height: 75vh;
    overflow-y: auto;
}

.scoreAdjTable {
    width: 100%;
    border-collapse: collapse;
    overflow-y: auto;

    tr {
        min-height: 40px;
    }

    th {
        background-color: #b8e6f8;
    }

    .blockTr {
        color: transparent;
        height: 40px;
    }

    th,
    td {
        border: 1px solid #b8e6f8;
        max-width: 180px;
        padding: 5px;
    }
}

.buttonList {
    text-align: center;
}
</style>