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

let curDay = moment().format('YYYY-MM-DD');

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

export default function () {
  return {
    day: curDay,
    date: curDay,
    dateRange: [curDay, curDay],
    beginTime: curDay,
    endTime: curDay,
    today: moment().format('YYYY-MM-DD'),
    yesterday: moment().add(-1, 'days').format('YYYY-MM-DD'),
    day7: moment().add(-6, 'days').format('YYYY-MM-DD'),
    day30: moment().add(-29, 'days').format('YYYY-MM-DD'),
    timeLimit: true,
    tableCols: [
      {
        title: 'ID',
        key: 'id',
        width: 60,
        align: 'center'
      },
      {
        title: '申请时间',
        key: 'createTime',
        width: 90,
        align: 'center'
      }, {
        title: '结算类型',
        key: 'clearingType',
        width: 90,
        align: 'center'
      }, {
        title: '商家收款账户',
        key: 'targetAccount',
        width: 90,
        align: 'center'
      }, {
        title: '申请金额(元)',
        key: 'applyAmount',
        width: 90,
        align: 'center'
      }, {
        title: '服务费(元)',
        key: 'serviceAmount',
        width: 90,
        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];
          ow.lineIndex = params.index;
          return (<p class={{ 'high-light': as === 2}}>{ asText }</p>);
        },
        className: 'status-column'
      }, {
        title: '业务单据号',
        key: 'statementSn',
        width: 90,
        align: 'center'
      }, {
        title: '说明',
      }, {
        title: '操作人',
        key: 'applyPid',
        width: 90,
        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: 20
    },
    filters: {
      dateRange: {
        label: '起止日期',
        model: '',
        labelSpan: 8,
      },
      beginTime: '',
      endTime: '',
      timeFlag: {
        label: '时间标志',
        model: '',
        options: [
          {
            value: 1,
            label: '今天',
          },
          {
            value: 2,
            label: '昨天',
          },
          {
            value: 3,
            label: '近7天',
          },
          {
            value: 4,
            label: '近30天',
          },
        ],
      },
      withdrawStatus: {
        label: '提现状态',
        model: '',
        labelSpan: 6,
        fieldSpan: 18,
        options: [
          {
            value: 0,
            label: '提现中',
          },
          {
            value: 1,
            label: '提现成功',
          },
          {
            value: 2,
            label: '提现失败',
          },
        ],
      },
      statementSn: {
        label: '业务单据号',
        model: '',
        labelSpan: 6,
        fieldSpan: 18,
      },
      targetAccount: {
        label: '提现账户',
        model: '',
        options: [
          {
            value: 0,
            label: 'abcxxx@ert.com',
          },
          {
            value: 1,
            label: 'hjkxxx@ihi.com',
          },
        ],
      },
    },
  }
};