import moment from 'moment'
let grid = {
    labelCol: { span: 6 }, span: 10,
};
import { genWarehouseAuthSearchModal, genCargoownerAuthSearchModal } from "../../../../../SearchModal";
import { api } from '../../api'


export const basicData = function (self) {
    return {
        searchItems: [
            ...genWarehouseAuthSearchModal(1, true, false, null, null, grid),
            ...genCargoownerAuthSearchModal(1, true, false, null, null, grid, { mapper: { cargoOwnerId: 'mtlOwnerId' } }),

            {
                name: 'rcvType',
                label: '订单类型',
                value: '',
                ...grid,
                type: "select",
                autoLoad: true,
                allowClear: false,
                remoteUrl: {
                    url: api.queryDictList + '?dicttypeCodes=oms_asn_bill_type',
                    method: 'post'
                },
                replaceFields: {
                    value: 'dictCode',
                    label: 'dictName'
                },
            },


            { type: 'input', name: 'asnAutoBillNum', label: 'ASN单号', value: '', ...grid },
            { type: 'input', name: 'rcvNo', label: '收货单号', value: '', ...grid },
            { type: 'input', name: 'rcvUser', label: '收货员', value: '', ...grid },
            { type: 'date', name: 'startTime', showTime: true, format: 'YYYY-MM-DD HH:mm:ss', label: '收货开始时间', value: moment().subtract(1, 'week').format('YYYY-MM-DD HH:mm:ss'), ...grid, },
            { type: 'date', name: 'endTime', showTime: true, format: 'YYYY-MM-DD HH:mm:ss', label: '收货结束时间', value: moment().format('YYYY-MM-DD HH:mm:ss'), ...grid, },

        ],
        columns: [
            { hidden: true, title: "rqcHeaderId", dataIndex: "rqcHeaderId", key: "rqcHeaderId" },
            { hidden: true, title: "rcvHeaderId", dataIndex: "rcvHeaderId", key: "rcvHeaderId" },
            { title: "ASN单号", dataIndex: "asnAutoBillNum", width: 90 },
            { title: "收货单号", dataIndex: "rcvNo", width: 90 },
            { title: "收货时间", dataIndex: "rcvDateStr", width: 120 },
            { title: "仓库名称", dataIndex: "warehouseName", width: 90 },
            { title: "货主名称", dataIndex: "mtlOwnerName", width: 90 },
            { title: "单位名称", dataIndex: "vendorName", width: 120 },
            { title: "订单类型", dataIndex: "rcvTypeName", width: 60 },
            { title: "收货员", dataIndex: "rcvUser", width: 120 },
            { title: "备注", dataIndex: "rcvRemark", width: 140 },
        ]

    }
}