withdraw.js 3.43 KB
import moment from 'moment';

const withdrawStatus = {
  0: '提现中',
  1: '提现成功',
  2: '提现失败',
};

export default function() {
  return {
    filters: {
      createTime: {
        label: '创建时间',
        model: '',
      },
      beginTime: {
        model: '',
      },
      endTime: {
        model: '',
      },
      timeFlag: {
        label: '时间标志',
        model: '',
        options: [
          {
            value: 1,
            label: '今天',
          },
          {
            value: 2,
            label: '昨天',
          },
          {
            value: 3,
            label: '近7天',
          },
          {
            value: 4,
            label: '近30天',
          },
        ],
      },
      withdrawStatus: {
        label: '提现状态',
        model: '',
        options: [
          {
            value: 0,
            label: '提现中',
          },
          {
            value: 1,
            label: '提现成功',
          },
          {
            value: 2,
            label: '提现失败',
          },
        ],
      },
      statementSn: {
        label: '业务单据号',
        model: '',
      },
      pageNo: 1,
      pageSize: 20,
    },
    tableCols: [
      {
        title: 'ID',
        key: 'id',
        align: 'center',
      },
      {
        title: '申请时间',
        key: 'createTime',
        align: 'center',
        render(h, params) {
          const time = moment.unix(params.row.createTime);
          return (
            <div>
              <div>{time.format('YYYY/MM/DD')}</div>
              <div>{time.format('HH:mm:ss')}</div>
            </div>
          );
        },
      },
      {
        title: '结算类型',
        key: 'clearingType',
        align: 'center',
      },
      {
        title: '申请金额(元)',
        key: 'applyAmount',
        align: 'center',
      },
      {
        title: '服务费(元)',
        key: 'serviceAmount',
        align: 'center',
      },
      {
        title: '成功金额(元)',
      },
      {
        title: '提现状态',
        key: 'status',
        align: 'center',
        render: (h, params) => {
          const row = params.row;
          const as = row.status;
          const asText = as === 2 ? `${withdrawStatus[row.status]}(${row.rejectReason})` : withdrawStatus[as];
          row.lineIndex = params.index;
          return (<p class={{ 'high-light': as === 2}}>{ asText }</p>);
        },
        className: 'status-column',
      },
      {
        title: '业务单据号',
        key: 'statementSn',
        align: 'center',
      },
      {
        title: '说明',
        key: 'remarks',
      },
      {
        title: '操作人',
        key: 'applyPid',
        align: 'center',
      },
      {
        title: '操作',
        key: 'action',
        width: 180,
        align: 'center',
        render: (h, params) => {
          const row = params.row;
          return (
            <div><div class="cell-action-row"><i-button type="primary" size="small"
              onClick={()=>this.getDetailById(row.id)}>提现明细</i-button></div><div class="cell-action-row"><i-button type="primary" size="small"
              onClick={()=>this.getInfoById(row.id)}>结算明细</i-button></div></div>
          );
        },
        className: 'action-column',
      },
    ],
    tableData: [],
    pageData: {
      total: 0,
      current: 1,
      pageSize: 10,
    },
  };
}