
import { upcloud_base_common,  } from "@/config/serviceSettings";
import { arrivalModeList } from "../../api/index";
// 需要显示销退入库单备注，账期类型，退货类型，单据时间，原销售开票单号
// 主表信息：字段名称供应商编号，供应商名称，采购员不正确，应改为客户编号，客户名称，业务员

export const mainCols = [
    { title: 'billid', dataIndex: 'billid', key: 'billid', hidden: true },
    { title: '客户id', dataIndex: 'customerId', key: 'customerId', hidden: true },
    {
        title: "收货类型", dataIndex: "rcvType", width: 140,
        // scopedSlots: { customRender: 'rcvReason1' }
        autoLoad: true, remoteUrl: { url: upcloud_base_common+'/dict/listbytype?dicttypeCodes=oms_asn_bill_type', method: 'post' },
        replaceFields: {
            value: 'dictCode',
            // value: 'dictName',
            label: 'dictName'
        },
    },
    { title: '货主编号', dataIndex: 'mtlOwnerNum', key: 'mtlOwnerNum', width: 100, },
    { title: '货主名称', dataIndex: 'mtlOwnerName', key: 'mtlOwnerName', width: 180, },
    { title: '客户编号', dataIndex: 'customerNum', key: 'customerNum', },
    { title: '客户名称', dataIndex: 'customerName', key: 'customerName', },
    { title: '单据编号', dataIndex: 'asnAutoBillNum', key: 'asnAutoBillNum', width: 120 },
    { title: '销售退回单备注', dataIndex: 'asnRemark', key: 'asnRemark', width: 150, },
    { title: '单位助记码', dataIndex: 'shipperZjm', key: 'shipperZjm' },
    // { title: 'ASN单号', dataIndex: 'asnAutoBillNum', key: 'asnAutoBillNum', hidden: true },
    { title: '账期类型', dataIndex: 'saleBillType', key: 'saleBillType' },
    { title: '单据时间', dataIndex: 'billDate', key: 'billDate', width: 120 },
    { title: '未收数量', dataIndex: 'remainqty', key: 'remainqty' },
    { title: '销售开票单号', dataIndex: 'saleBillNo', key: 'saleBillNo' },
    { title: '业务员', dataIndex: 'bizUser', key: 'bizUser' },
    { title: '退货类型', dataIndex: 'returnType', key: 'returnType' },
    {
        title: '到货方式', dataIndex: 'arrivalMode', key: 'arrivalMode', customRender(text) {
            let item = arrivalModeList.find(t => t.dictCode == text);
            if (item) {
                return item.dictName;
            } else return '';
        }
    },

    { title: '仓库', dataIndex: 'warehouseName', key: 'warehouseName' },
    { title: '仓库编码', dataIndex: 'warehouseCode', key: 'warehouseCode' },
];