index.js 2.31 KB
/**
 * on sell page store
 * @author: GeXuHui <qi.li@yoho.cn>
 * @date: 2017/07/26
 */
import timeFormat from 'filters/time-format';

export default function() {
    return {
        tableCols: [{
            title: '商品图片',
            width: 120,
            align: 'center',
            render: (h, params) => {
                let directives = [{name: 'prod-img', value: params.row.productSku, modifiers: {sku: true}}];

                return (
                    <img {...{directives}}/>
                );
            }
        },
        {
            title: '订单号',
            key: 'orderCode',
            align: 'center',
        },
        {
            title: 'SKU',
            key: 'productSku',
            align: 'center'
        },
        {
            title: '瑕疵类型',
            key: 'typeName',
            align: 'center'
        },
        {
            title: '备注',
            key: 'remark',
            align: 'center'
        },
        {
            title: '创建时间',
            width: 150,
            render: (h, params) => {
                return (
                    <span>{timeFormat(params.row.createTime)}</span>
                );
            },
            align: 'center'
        },
        {
            title: '操作',
            key: 'action',
            align: 'center',
            render: (h, params) => {
                return (
                    <div class="action-btn-row">
                        <i-button type="success" size="small" onClick={() => this.editImg(params.row)}>
                            <i class="ivu-icon ivu-icon-eye" style="margin-right: 5px;vertical-align: top;font-size: 16px;"></i>
                            查看明细</i-button>
                    </div>
                );
            }
        }],
        tableData: [],
        pageData: {
            total: 0,
            current: 1,
            pageSize: 20
        },
        filters: {
            orderCode: {
                label: '订单号',
                labelSpan: 6,
                model: '',
                holder: '',
                fieldSpan: 18
            },
            productSku: {
                label: 'SKU编码',
                labelSpan: 6,
                model: '',
                holder: '',
                fieldSpan: 18
            }

        }
    };
}