examineDetail.vue 8.51 KB
<template>
  <d2-Container>
    <div class="merchant-checkdetail">
      <div class="merchant-title">
        <span>商户名称:{{ merchantRow.merchantName }}</span>
        <span>业务场景:{{ sceneList[merchantRow.sceneType] }}</span>
        <span>类型:{{ ruleReviewType[merchantRow.ruleType] }}</span>
        <span>生效时间:{{ merchantRow.effectStartDateShow }}</span>
      </div>
      <div class="tips">说明:红色内容为本次规则的新增或修改部分</div>
      <div class="merchant-info">
        <!-- 分账 -->
        <ledgerAccount v-if="merchantRow.ruleType == 1"
                       :items="checkDetailItem" :effectDateType="effectDateType" />
        <!-- 对账 -->
        <reconciliation v-if="merchantRow.ruleType == 3"
                        :form-item="checkRecordList"
                        :items="checkRecordList.goodsTypeGroupReconciliationRuleCTs || []" 
                        :effectDateType="effectDateType"/>
      </div>
      <div class="btns">
        <el-button @click="handleConfirm"
                   type="primary">
          审核
        </el-button>
        <el-button @click="cacel">
          取消
        </el-button>
      </div>
    </div>
  </d2-Container>
</template>

<script>
import ledgerAccount from './components/ledgerAccount.vue'
import reconciliation from './components/reconciliation.vue'
import { ruleAuditDetail, ruleAuditPass } from '@api/ruleReview'
import { sceneList, ruleReview_type_show } from '@/common/constants.js'
import { Util, deepClone } from '@/common/util'
export default {
  name: "ExamineDetail",
  props: {},
  data() {
    return {
      activeName: "first",
      merchantRow: {},
      // 分账数据
      checkDetailItem: {},
      // 对账数据
      checkRecordList: {},
      sceneList: deepClone(sceneList),
      ruleReviewType: deepClone(ruleReview_type_show),
      effectDateType: 0
    }
  },
  created() {
    this.getRowItem()
  },
  mounted() {
    this.getRuleAuditDetail()
  },
  methods: {
    async init() {
      this.getRuleAuditDetail()
    },
    async getRuleAuditDetail() {
      const params = {
        id: this.merchantRow.id
      }
      const res = await ruleAuditDetail(params)
      console.log('res: ', res)
      this.checkDetailItem = res.merchantSettleDistributeRule
      this.checkRecordList = res.merchantReconciliationRule
      this.effectDateType = res.effectDateType // 是否有生效中的规则
    },
    getRowItem() {
      const params = this.$route.query?.params
      if (params) {
        this.merchantRow = JSON.parse(params)
        if (this.merchantRow.effectDateType == 2) {
          this.merchantRow.effectStartDateShow = '立即生效'
        } else {
          this.merchantRow.effectStartDateShow = this.merchantRow.effectStartDate ? Util.dateFormate(this.merchantRow.effectStartDate, 'YYYY-MM-DD') : '--'
        }
        // console.log("is.merchantRow", this.merchantRow)
      }
    },
    // 审核
    handleConfirm() {
      this.$confirm('审核通过后,当前规则会自动应用并生效,可在商户管理-历史记录中查询。', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        closeOnClickModal: false
      }).then(() => {
        ruleAuditPass({ id: this.merchantRow.id }).then(res => {
          this.notice.okTips()
          this.$router.go(-1)
        })
      }).catch(err => {
        console.log(err)
      })
    },

    cacel() {
      this.$router.go(-1)
    }
  },
  components: {
    ledgerAccount,
    reconciliation
  },
  computed: {}
}
</script>
<style lang="scss">
$color: #2a58ad;

.merchant-checkdetail {
  // height: 100%;
  padding-left: 20px;
  padding-right: 16px;
  padding-bottom: 20px;

  // overflow-y: auto;
  .title {
  }

  .tips{
    margin: 15px 0;
    color: #F56C6C;
  }

  .merchant-title {
    font-weight: 500;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .merchant-info {
    margin-top: 20px;
  }

  .type {
    margin-top: 6px;
    display: flex;

    .btn {
      width: 96px;
      height: 40px;
      background: #f8f8f8;
      border-radius: 4px 4px 0 0;
      line-height: 40px;
      text-align: center;
      cursor: pointer;
    }

    .act {
      font-weight: 500;
      color: $color;
      background: #fff;
    }
  }

  .content {
    background: #ffffff;

    .part1 {
      .tit {
        display: flex;
        align-items: center;
        height: 48px;
        background: #ffffff;
        font-weight: 500;
        font-size: 18px;
        color: #333333;
        box-sizing: border-box;
        border-bottom: 1px solid #ebebeb;

        .line {
          margin-left: 16px;
          margin-right: 8px;
          width: 4px;
          height: 16px;
          background: $color;
          border-radius: 2px;
        }
      }

      .cont {
        display: flex;
        flex-flow: column;

        &.cont-table {
          display: block;
        }

        &.cont-table1 {
          padding: 16px 20px 20px;
        }

        display: flex;
        flex-wrap: wrap;
        flex-flow: column;
        padding: 16px 20px 32px;

        .mt16 {
          margin-top: 16px;
        }

        .msg {
          padding-bottom: 12px;
          flex: 1 0 auto;
          // width: 50%;
          display: flex;
          align-items: flex-start;
          line-height: 24px;

          .msg-title {
            width: 138px;
            // height: 20px;
            font-size: 14px;
            color: #666666;
            text-align: right;
          }

          .msg-val {
            // height: 20px;
            font-size: 14px;
            color: #1d1d1d;
            text-align: left;
          }
        }

        .msg-name-val {
          margin-left: 138px;
          font-size: 14px;
        }

        .compute {
          margin-bottom: 10px;
          display: flex;
          font-size: 14px;
          color: #666666;

          .manner {
          }

          .online {
            & + .online {
              margin-left: 44px;
            }

            color: $color;
          }
        }

        .white-table {
          margin-bottom: 16px;
          display: flex;
          flex-wrap: wrap;
          font-size: 14px;
          color: #666666;
          border-top: 1px solid #e5e5e5;
          border-left: 1px solid #e5e5e5;

          .type1 {
            // &:first-child {
            //   border-top: 1px solid #E5E5E5;
            //   border-left: 1px solid #E5E5E5;
            // }
            display: flex;
            width: 33.33%;
            height: 38px;
            line-height: 38px;
            border-bottom: 1px solid #e5e5e5;
            border-right: 1px solid #e5e5e5;
            box-sizing: border-box;

            .type-name {
              text-align: right;
              width: 90px;
            }

            .type-val {
              flex: 1;
              display: flex;
              color: #1d1d1d;
            }

            .type-color {
              color: $color;
            }

            .date {
              margin-right: 10px;
              color: #1d1d1d;
            }
          }

          .type2 {
            width: 66.66%;
            .type-val{
              display: inline-block !important;
              width: calc(100% - 90px);
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
            }
          }
        }

        .title-table {
          font-size: 14px;
          color: #333333;
          border: 1px solid #e8e8ea;

          .head {
            display: flex;
            height: 40px;
            line-height: 40px;
            text-align: center;
            background: #f2f4f7;

            .cost {
              & + .cost {
                border-left: 1px solid #e8e8ea;
              }

              flex: 1;
            }
          }

          .detail {
            display: flex;
            min-height: 40px;
            color: #666666;
            border-top: 1px solid #e8e8ea;

            .detail-i {
              display: flex;
              justify-content: center;
              align-items: center;

              & + .detail-i {
                border-left: 1px solid #e8e8ea;
              }

              flex: 1;
            }
          }
        }
      }
    }

    // .part2 {
    // }
    // .part3 {
    // }
    // .part4 {
    // }
    // .part5 {
    // }
  }

  .btns {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
.isRed{
  color: #F56C6C !important;
}
</style>