index.js 2.02 KB
/**
 * on sale page store
 * @author: qi.li <qi.li@yoho.cn>
 * @date: 2017/04/13
 */
export default function() {
    return {
        tableCols: [{
            title: 'SKN',
            key: 'productSkn',
            align: 'center'
        },
        {
            title: '图片',
            key: 'image',
            align: 'center',
            render: (h, params) => {
                return (
                    <img v-prod-img={params.row.productSkn}/>
                );
            }
        },
        {
            title: '商品名称',
            key: 'productName',
            align: 'center',
        },
        {
            title: '品牌',
            key: 'brandName',
            align: 'center',
        },
        {
            title: '库存',
            key: 'storage',
            align: 'center',
            render: (h, params) => {
                return (
                    <span>{params.row.storage || 0}</span>
                );
            }
        },
        {
            title: '销售价',
            key: 'salePrice',
            align: 'center',
            render: (h, params) => {
                return (
                    <span>{params.row.salePrice || 0}</span>
                );
            }
        },
        {
            title: '更新时间',
            key: 'editTime',
            align: 'center',
            render: (h, params) => {
                return (
                    <span>{params.row.editTime || '-'}</span>
                );
            }
        },
        {
            title: '操作',
            key: 'action',
            align: 'center',
            render: (h, params) => {
                return (
                    <action-group>
                        <i-button type="primary" size="small" onClick={() => this.editStore(params.row)}>库存编辑</i-button>
                    </action-group>
                );
            }
        }],
        tableData: [],
        pageData: {
            total: 0,
            current: 1,
            pageSize: 20
        }
    };
}