export default function useColumns() {
  const TableColumns = [
    { item: { key: "code", title: "订单生成单号" }, attr: {} },
    {
      item: { key: "status", title: "状态" },
      attr: {
        is: "el-dict-tag",
        dictName: "purchase_task_status",
      },
    },
    { item: { key: "existPrice", title: "是否有价格",width :150 ,}, attr: {
      is: "el-dict-tag",
      dictName: "sys_true_false",

    } },
    { item: { key: "demandCode", title: "需求单号" }, attr: {} },
    { item: { key: "materialName", title: "物料" }, attr: {} },
    {
      item: { key: "materialCode", title: "物料编码" },
      attr: {},
    },
    {
      item: { key: "materialDesc", title: "物料描述" },
      attr: {},
    },
    {
      item: { key: "manufacturerName", title: "生产厂家" },
      attr: {},
    },
    { item: { key: "puQty", title: "采购数量" }, attr: {} },
    {
      item: { key: "executeQty", title: "已执行数量" },
      attr: {},
    },
    {
      item: { key: "residueQty", title: "未执行数量" },
      attr: {},
    },
    {
      item: { key: "priceType", title: "价格类型" },
      attr: { is: "el-dict-tag", dictName: "sys_price_type" },
    },
    { item: { key: "puUnitName", title: "采购单位" }, attr: {} },
    { item: { key: "buyerName", title: "采购员" }, attr: {} },
    {
      item: { key: "supplierName", title: "建议供应商" },
      attr: {},
    },
    { item: { key: "puOrgName", title: "采购组织" }, attr: {} },
    { item: { key: "currencyName", title: "币种" }, attr: {} },
    { item: { key: "source", title: "需求来源" }, attr: {} },
    {
      item: { key: "customerName", title: "收货客户" },
      attr: {},
    },
    {
      item: { key: "assignSupplierName", title: "指定供应商" },
      attr: {},
    },
    { item: { key: "demandDate", title: "需求时间" }, attr: {} },
    { item: { key: "projectName", title: "项目名称" }, attr: {} },
    {
      item: { key: "demandPersonalName", title: "需求人" },
      attr: {},
    },
    {
      item: { key: "demandOrgName", title: "需求组织" },
      attr: {},
    },
    {
      item: { key: "demandDeptName", title: "需求部门" },
      attr: {},
    },
    {
      item: { key: "isBack", title: "是否退回" },
      attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
    },
    { item: { key: "baskCause", title: "退回原因" }, attr: {} },
    { item: { key: "backDate", title: "退回日期" }, attr: {} },
    { item: { key: "unitName", title: "单位" }, attr: {} },
  ].map(({ item, attr }) => ({
    attr,
    item: { ...item, hidden: true, fixed: false },
  }));

  return { TableColumns };
}
