undone.js 7.29 KB
/**
 * undone tab store
 * @author: leo
 * @date: 04/05/2017
 */
import CellInfo from 'components/cell/cell-info';
import { CellDispatch, CellDeliver, CellStockOut } from '../components';

export default function() {
    return {
        useFilter: false,
        isExporting: false,
        showOutStock: false,
        showBackTop: false,
        deliverRows: [],
        filters: {
            orderNo: {
                label: '调拨单号',
                model: '',
                holder: '',
            },
            prodCode: {
                label: 'SKN编码',
                model: '',
                holder: 'SKN'
            },
            skuCode: {
                label: 'SKU编码',
                model: '',
                holder: 'SKU'
            },
            merChantCode: {
                label: '商家编码',
                model: '',
                holder: '商家商品编码',
            },
            prodBarCode: {
                label: '商品条码',
                model: '',
                holder: ''
            },
            orderTime: {
                label: '下单时间',
                model: '',
                holder: ''
            },
            startTime: {
                model: ''
            },
            endTime: {
                model: '',
            },
            prodStatus: {
                label: '商品状态',
                model: '',
                options: [
                    {
                        value: 1,
                        label: '待处理'
                    },
                    {
                        value: 2,
                        label: '待处理超时'
                    }
                ]
            }
        },
        page: {
            total: 0,
            current: 1
        },
        table: {
            cols: [
                {
                    type: 'selection',
                    width: 60,
                    align: 'center'
                },
                {
                    title: '下单时间',
                    key: 'createTime',
                    align: 'center'
                },
                {
                    title: '商品图片',
                    align: 'center',
                    render(h, params) {
                        return h('img', {
                            directives: [
                                {
                                    name: 'prod-img',
                                    value: params.row.productSku,
                                    modifiers: {
                                        sku: true
                                    }
                                }
                            ]
                        });
                    }
                },
                {
                    title: '商品信息',
                    align: 'center',
                    render(h, params) {
                        const row = params.row;
                        let infoItems = [
                            {
                                label: 'SKU',
                                value: row.productSku,
                            }, {
                                label: 'SKN',
                                value: row.productSkn,
                            }, {
                                label: '规格',
                                value: `${row._colorName}/${row.sizeName}`,
                            }, {
                                label: '名称',
                                value: row.productName,
                            }, {
                                label: '品牌',
                                value: row.brandName,
                            }, {
                                label: '销售价',
                                value: row.salesPrice,
                            }, {
                                label: '采购价',
                                value: row.purchasePrice,
                            }
                        ];

                        return h(CellInfo, {
                            props: {
                                items: infoItems
                            }
                        });
                    }
                },
                {
                    title: '商品条码',
                    key: 'skuFactoryCode',
                    align: 'center'
                },
                {
                    title: '订单收发货',
                    align: 'center',
                    render(h, params) {
                        const row = params.row;

                        return h(CellDispatch, {
                            props: {
                                showStore: true,
                                storeNum: row.inStoreNum,
                                buyNum: row.buyingNums,
                                shipNum: row.shipmentsNums,
                                lackNum: row.lackNum,
                            }
                        });
                    }
                },
                {
                    title: '发货',
                    width: 120,
                    align: 'center',
                    render: (h, params) => {
                        const row = params.row;
                        const index = params.index;

                        return h(CellDeliver, {
                            props: {
                                rowIndex: index,
                                shipNum: row.shipmentsNums
                            },
                            on: {
                                'deliver-change': this.deliverChange
                            }
                        });
                    }
                },
                {
                    title: '缺货',
                    width: 140,
                    align: 'center',
                    render: (h, params) => {
                        const row = params.row;
                        const index = params.index;

                        return h(CellStockOut, {
                            props: {
                                rowIndex: index,
                                lackNum: row.lackNum
                            },
                            on: {
                                'lack-num-change': this.lackNumChange,
                                'click-upload': () => this.showUploadModal(index)
                            }
                        });
                    }
                },
                {
                    title: '状态',
                    align: 'center',
                    render(h, params) {
                        const row = params.row;
                        let ot = row.isOvertime;

                        ot = ot === 'N' ? true : false;
                        return (
                            <div>
                                <span v-show={ot}>待处理</span>
                                <span v-show={!ot} class="is-overtime">待处理(超时)</span>
                            </div>
                        );
                    },
                    className: 'status-cell'
                },
                {
                    title: '调拨单号',
                    key: 'proRequisitionFormId',
                    align: 'center',
                }
            ],
            list: []
        }
    };
}