approveView.vue 7.13 KB
<!-- 查看 -->
<!-- 盘点详情弹窗弹窗 -->
<template>
    <GLDialog bigTitle="详细信息" :visible.sync="isVisible" :hasFooter="false" :before-close="handleClose" class="points" mode="big" okText="关闭" @onCancel="handleClose" @onOk="handleClose">
      <div class="wrap edit-box">
        <div>
          <p class="edit-title">订单信息</p>
          <el-form label-width="150px" :inline="true">
            <el-row v-for="(item, index) in withdrawDataRow" :key="index">
              <el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label + ':'" class="row-item">
                <span v-if="subItem.addHtml">
                  {{ subItem.addHtml(recordInfo) }}
                </span>
                <span v-else class="detail-txt ellipsis-1" :title="recordInfo[subItem.name]">{{ recordInfo[subItem.name] ? recordInfo[subItem.name] + (subItem.suffix || '') : '-' }}</span>
              </el-form-item>
            </el-row>
          </el-form>
        </div>
        <div>
          <p class="edit-title">付款信息</p>
          <el-form label-width="154px" :inline="true">
            <el-row v-for="(item, index) in paymentDataRow" :key="index">
              <el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label + ':'" class="row-item">
                <span v-if="subItem.addHtml">
                  {{ subItem.addHtml(recordInfo) }}
                </span>
                <span v-else-if="subItem.addStyle" class="flex_sc">
                  <div class="table_point" :style="{ background: subItem.addStyle(recordInfo).color }"></div>
                  {{ subItem.addStyle(recordInfo).status }}
                </span>
                <span v-else class="detail-txt ellipsis-1" :title="recordInfo[subItem.name]">{{ recordInfo[subItem.name] ? recordInfo[subItem.name] + (subItem.suffix || '') : '-' }}</span>
              </el-form-item>
            </el-row>
          </el-form>
        </div>
        <div v-if="recordInfo.operationList">
          <p class="edit-title">操作记录</p>
          <!-- <template v-for="(record, recordIdx) in recordInfo.operationList">
            <el-form label-width="154px" :inline="true" :key="recordIdx">
              <el-row v-for="(item, index) in operationDataRow" :key="index">
                <el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label(record) + ':'" class="row-item">
                  <span v-if="subItem.addHtml" class="flex_sc">
                    <div class="table_point" :style="{ background: subItem.addHtml(record).color }"></div>
                    {{ subItem.addHtml(record).status }}
                  </span>
                  <span v-else class="detail-txt ellipsis-1" :title="record[subItem.name]">{{ record[subItem.name] ? record[subItem.name] + (subItem.suffix || '') : '-' }}</span>
                </el-form-item>
              </el-row>
            </el-form>
          </template> -->
        </div>
      </div>
    </GLDialog>
  </template>
    <script>
  const tableStatus = ['待审核', '已审核', '第三方处理', '成功', '失败', '驳回']
  const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E']
  const channelObj = {
    'TXIAT': '熠轩-银行卡',
    'ZX': '中雄-银行卡',
    'YUNHUO': '云获(嘀加)-银行卡',
    "YUNHUO-ZY": '云获(中赢)-银行卡',
    'YUNHUO-WX': '云获(中赢)-微信',
    'SHENBIANYUN':'身边云-银行卡'
  }
  export default {
    name: 'DetailDialog',
    data() {
      return {
        recordInfo: {},
        withdrawDataRow: [],
        paymentDataRow: [],
        operationDataRow: [],
        withdrawData: [],
        paymentData: [],
        operationData: [],
        isVisible: this.detailVisible,
      }
    },
    props: {
      detailVisible: {
        type: Boolean,
        default: false
      },
      id: {
        type: Number,
        default: 0
      }
    },
    watch: {
      detailVisible(newVal) {
        this.isVisible = newVal
        this.getDetails()
      }
    },
    computed: {},
    mounted() {},
    methods: {
      getDetails() {
        this.$apis.withdraw.getDetails({ id: this.id }).then(res => {
          this.recordInfo = res
          this.getConfig()
        })
      },
      getConfig() {
        this.withdrawData = [
          {
            label: '批次号',
            name: 'outSettleOrderId'
          },
          {
            label: '客户数量',
            name: 'transferType',
            addHtml: obj => {
              return obj.transferType == 0 ? '积分提现' : obj.transferType == 1 ? '普通提现' : '阳光激励'
            }
          },
          {
            label: '积分总额:',
            name: 'integralAmount'
          },
          {
            label: '付款总额/元:',
            name: 'payAmount',
            addHtml: obj => {
              return obj.payAmount ? (obj.payAmount / 100).toFixed(2) : '--'
            }
          },
          {
            label: '状态',
            name: 'status',
            addStyle: obj => {
              return {
                status: tableStatus[obj.status],
                color: colors[obj.status]
              }
            }
          }
        ]
        this.paymentData = [
          {
            label: '付款渠道',
            name: 'name'
          },
          {
            label: '付款主体',
            name: 'idCardNo'
          },
        
          {
            label: '渠道到账时间',
            name: 'receiptDate'
          }
        ]
        this.formToRow('withdrawData')
        // this.formToRow('operationData')
        this.formToRow('paymentData')
      },
  
      handleJudgment(target, key) {
        let arr = target,
          len = arr.length,
          item
        for (let i = 0; i < len; i++) {
          item = arr[i]
          if (item.name == key) {
            arr.splice(i, 1)
          }
        }
      },
      formToRow(formName, numOfRow = 3) {
        var rowNum = Math.ceil(this[formName].length / numOfRow)
        for (var i = 0; i < rowNum; i++) {
          for (var j = 0; j < numOfRow; j++) {
            if (j == 0) {
              this[formName + 'Row'][i] = {
                rowList: []
              }
            }
            if (i * numOfRow + j < this[formName].length) {
              this[formName + 'Row'][i].rowList.push(this[formName][i * numOfRow + j])
            }
          }
        }
      },
      handleClose() {
        this.isVisible = false
        this.$emit('dialogClose')
      }
    }
  }
  </script>
    <style scoped lang="scss">
  .edit-box .row-item {
    width: 30%;
    /deep/ {
      .el-form-item__content {
        height: 30px;
      }
    }
  }
  .detail-txt {
    display: inline-block;
    width: 136px;
  }
  .edit-title {
    font-weight: 600;
    font-size: 16px;
    color: #000000d9;
    line-height: 24px;
  }
  .m-b-20 {
    margin-top: 20px;
  }
  /deep/ .el-form-item {
    margin-bottom: 0;
  }
  .table_point {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
  }
  .copy {
    color: #5850ff;
    margin-left: 20px;
    cursor: pointer;
  }
  </style>