import moment from 'moment'
import { rcvTypeOptions } from "../../../../config/options";
import {upcloud_base_common} from "@/config/serviceSettings";
// 主表信息增加验收单号，复检类型（质量主管复检/质量经理复检），质量主管复检人（二级复检时显示）
const columns = [
  { title: 'rqcHeaderId', dataIndex: 'rqcHeaderId', key: 'rqcHeaderId', hidden: true },
  { title: 'rcvHeaderId', dataIndex: 'rcvHeaderId', key: 'rcvHeaderId', hidden: true },
  { title: 'shipperid', dataIndex: 'shipperid', key: 'shipperid', hidden: true },
  { title: '验收结论', dataIndex: 'rqcResult', key: 'rqcResult', hidden: true },

  { title: '单据ID', dataIndex: 'asnHeaderId', key: 'asnHeaderId', },
  { title: '单据编号', dataIndex: 'asnAutoBillNum', key: 'asnAutoBillNum', width: 120 },
  { title: '要货部门', dataIndex: 'needDept', key: 'needDept', },
  { title: '要货业务员', dataIndex: 'needUser', key: 'needUser', },
  { title: '单位助记码', dataIndex: 'shipperZjm', key: 'shipperZjm' },
  { title: '代理商', dataIndex: 'agent', key: 'agent', },
  { title: '验收员', dataIndex: 'rqcUser', key: 'rqcUser', },
  { title: '验收单号', dataIndex: 'rqcNo', key: 'rqcNo', },
  {
    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: 'vendorName', key: 'vendorName' },
  { title: '货主名称', dataIndex: 'mtlOwnerName', key: 'mtlOwnerName', width: 180 },
  {
    title: '验收日期', dataIndex: 'rcvDate', key: 'sAttainDate', 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
