columns.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import CONFIG from "@/config";
  2. export default function useColumns() {
  3. const TableColumns = [
  4. {
  5. item: { width:100,key: "puOrgName", title: "采购组织" },
  6. attr: {},
  7. },
  8. { item: { width:100,key: "materialName", title: "物料" }, attr: {} },
  9. { item: { width:100,key: "materialCode", title: "物料编码" }, attr: {} },
  10. { item: { width:100,key: "materialClassifyName", title: "物料一级分类" }, attr: {} },
  11. { item: { width:100,key: "manufacturerName", title: "生产厂家名称" }, attr: {} },
  12. { item: { width:100,key: "model", title: "物料型号" }, attr: {} },
  13. { item: { width:100,key: "specification", title: "物料规格" }, attr: {} },
  14. {
  15. item: { width:100,key: "supplierName", title: "供应商名称" },
  16. attr: {},
  17. },
  18. { item: { width:100,key: "customerName", title: "客户" }, attr: {} },
  19. {
  20. item: { width:100,key: "taxPrice", title: "主含税单价" },
  21. attr: {
  22. is: "el-computed-input-v2",
  23. formatter: (prop) => {
  24. return (prop * 1).toFixed(CONFIG.precision);
  25. },
  26. },
  27. },
  28. { item: { width:100,key: "unitName", title: "主单位" }, attr: {} },
  29. { item: { width:100,key: "effectiveDate", title: "价格生效日期" }, attr: {} },
  30. { item: { width:100,key: "endDate", title: "价格失效日期" }, attr: {} },
  31. { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
  32. { item: { width:100,key: "source", title: "来源单据" }, attr: {} },
  33. {
  34. item: { width:100,key: "convertRate", title: "换算率" },
  35. attr: {
  36. is: "el-computed-input-v2",
  37. formatter: (prop) => {
  38. return (prop * 1).toFixed(CONFIG.precision);
  39. },
  40. },
  41. },
  42. {
  43. item: { width:100,key: "status", title: "有效状态" },
  44. attr: { is: "el-dict-tag", dictName: "is_effective" },
  45. },
  46. {
  47. item: { width:100,key: "enableStatus", title: "启用状态" },
  48. attr: { is: "el-dict-tag", dictName: "is_effective" },
  49. },
  50. {
  51. item: { width:100,key: "materialStatus", title: "物料启用状态" },
  52. attr: { is: "el-dict-tag", dictName: "is_effective" },
  53. },
  54. {
  55. item: { width:100,key: "isDistribution", title: "配送价" },
  56. attr: { is: "el-dict-tag", dictName: "is_effective" },
  57. },
  58. {
  59. item: { width:100,key: "priceType", title: "价格类型" },
  60. attr: { is: "el-dict-tag", dictName: "sys_price_type" },
  61. },
  62. { item: { width:100,key: "expiryEarly", title: "效期预警" }, attr: {} },
  63. { item: { width:100,key: "priority", title: "含税/无税优先" }, attr: {} },
  64. { item: { width:100,key: "createByName", title: "创建人" }, attr: {} },
  65. { item: { width:100,key: "updateByName", title: "更新人名称" }, attr: {} },
  66. ].map(({ item, attr }) => ({
  67. attr,
  68. item: { ...item, hidden: true, fixed: false },
  69. }));
  70. return { TableColumns };
  71. }