import moment from 'moment'
import { upcloud_base_common,  } from "@/config/serviceSettings";

// 收货备注 rcvRemark 采购订单asnRemark

const columns = [
  { title: 'id', dataIndex: 'rcvHeaderId', key: 'rcvHeaderId', hidden: true },
  { title: '单据ID', dataIndex: 'asnHeaderId', key: 'asnHeaderId', },
  { title: '单据编号', dataIndex: 'asnAutoBillNum', key: 'asnAutoBillNum', width: 120 },
  { title: '单位助记码', dataIndex: 'shipperZjm', key: 'shipperZjm' },
  { title: '要货部门', dataIndex: 'needDept', key: 'needDept', },
  { title: '要货业务员', dataIndex: 'needUser', key: 'needUser', },
  { title: '代理商', dataIndex: 'agent', key: 'agent', },
  { title: '收货备注', dataIndex: 'rcvRemark', key: 'rcvRemark', },
  { title: '订单备注', dataIndex: 'asnRemark', key: 'asnRemark', },
  { title: '收货员', dataIndex: 'executorUser', key: 'executorUser', },
  // { title: '订单备注', dataIndex: 'asnRemrak', key: 'asnRemrak', },
  {
    title: "收货类型", dataIndex: "rcvType", width: 140, 
   // scopedSlots: { customRender: 'rcvReason1' }
  remoteUrl: { url: upcloud_base_common+'/dict/listbytype?dicttypeCodes=oms_asn_bill_type', method: 'post' },
   replaceFields: {
     value: 'dictCode',
     // value: 'dictName',
     label: 'dictName'
   },
 },
  { title: '供应商', dataIndex: 'vendorName', key: 'vendorName' },
  { title: '货主名称', dataIndex: 'mtlOwnerName', key: 'mtlOwnerName', width: 180 },
  {
    title: '收货日期', dataIndex: 'rcvDate', key: 'rcvDate', customRender(text) {
      if (text) {
        return moment(text).format('YYYY-MM-DD HH:mm:ss');
      } else return '';
    }
  },
  { title: '自动单号', dataIndex: 'autoBillNum', key: 'autoBillNum' },
  { title: '手工单号', dataIndex: 'customBillNum', key: 'customBillNum' },
]
export default columns
