index.js 4.91 KB
let filterFields = {
    sknCode: {
        label: 'SKN编码',
        labelSpan: 6,
        model: '',
        holder: '',
        fieldSpan: 18
    },
    prodCode: {
        label: '商家编码',
        labelSpan: 6,
        model: '',
        holder: '',
        fieldSpan: 18
    },
    prodName: {
        label: '商品名称',
        labelSpan: 6,
        model: '',
        holder: '',
        fieldSpan: 18
    },
    prodBarCode: {
        label: '商品条码',
        labelSpan: 6,
        model: '',
        holder: '',
        fieldSpan: 18
    },
    sort: {
        first: {
            label: '选择类目',
            holder: '选择一级类目',
            labelSpan: 6,
            fieldSpan: 18,
            model: ''
        },
        second: {
            label: '二级类目',
            holder: '选择二级类目',
            labelSpan: 6,
            fieldSpan: 18,
            model: ''
        },
        third: {
            label: '三级类目',
            holder: '选择三级类目',
            labelSpan: 6,
            fieldSpan: 18,
            model: ''
        }
    },
    brand: {
        label: '选择品牌',
        labelSpan: 6,
        fieldSpan: 18,
        model: -1
    },
    verifyStatus: {
        label: '审核状态',
        labelSpan: 6,
        fieldSpan: 18,
        model: -1,
        options: [
            {
                value: -1,
                label: '全部'
            },
            {
                value: 1,
                label: '下架待审核'
            },
            {
                value: 2,
                label: '下架驳回'
            }
        ]
    },
    stockStatus: {
        label: '库存情况',
        labelSpan: 6,
        fieldSpan: 18,
        model: -1,
        options: [
            {
                value: -1,
                label: '全部'
            },
            {
                value: 1,
                label: '有库存'
            },
            {
                value: 0,
                label: '无库存'
            }
        ]
    }
};

let initialFields = JSON.stringify(filterFields);

let tableCols = [
    {
        title: '对账单号',
        key: 'image',
        width: 120,
        align: 'center',
        render (row, column, index) {
            return '<cell-image :image-src="row.picImgUrl" :product-url="row.productUrl"></cell-image>';
        }
    },
    {
        title: '生成日期',
        key: 'info',
        align: 'center',
        render(row, column, index) {
            return `<cell-info 
                        :skn="row.productSkn"
                        :product-name="row.productName"
                        :brand-name="row.brandName"
                        :max-name="row.maxSortName"
                        :middle-name="row.middleSortName"
                        :small-name="row.smallSortName">
                    </cell-info>`;
        }
    },
    {
        title: '结算周期',
        key: 'price',
        align: 'center',
        render(row, column, index) {
            row.lineIndex = index;
            return `<cell-price
                        @click-change="editPrice(row)"
                        @click-save="updatePrice"
                        :can-change="true"
                        :current-row="row"
                        :show-change="row.changePrice"
                        :retail-price="row.retailPrice"
                        :sales-price="row.salesPrice">
                    </cell-price>`;
        }
    },
    {
        title: '品牌',
        key: 'stock',
        width: 100,
        align: 'center',
    },
    {
        title: '供应商',
        key: 'shelveTime',
        width: 150,
        align: 'center'
    },
    {
        title: '结算金额',
        key: 'verify',
        align: 'center',
        render(row, column, index) {
            return `${auditStatus[row.auditStatus]}`
        }
    },
    {
        title: '操作',
        key: 'action',
        width: 180,
        align: 'center',
        render: function(row, column, index) {
            return `<div class="action-btn-row">
                <i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button>
                <i-button v-if="row._disabled" type="primary" size="small" 
                    @click="editProduct(${row.productSkn})" disabled>内容编辑</i-button>
                <i-button v-else type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button>
            </div>
            <div class="btn-row-space">
                <i-button v-if="row._disabled" type="error" size="small" 
                    @click="setOffSale(${row.productSkn})" disabled>下架</i-button>
                <i-button v-else type="error" size="small" @click="setOffSale(${row.productSkn})" >下架</i-button>
            </div>`;
        }
    }
];

let tableData = [];

export {
    filterFields,
    initialFields,
    tableCols,
    tableData
};