columns.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. export default function useColumns() {
  2. const TableColumns = [
  3. { item: { key: "orgId", title: "所属组织" }, attr: {} },
  4. { item: { key: "code", title: "单据编码" }, attr: {} },
  5. {
  6. item: { key: "createTime", title: "申请时间" },
  7. attr: { },
  8. },
  9. { item: { key: "status", title: "单据状态" },
  10. attr: {
  11. is: "el-select",
  12. dictName: "documents_status", // 字典名
  13. }
  14. },
  15. { item: { key: "materialCode", title: "物料编码" }, attr: {} },
  16. {
  17. item: { key: "materialName", title: "物料名称" },
  18. attr: {},
  19. },
  20. { item: { key: "approver", title: "最后审批人" }, attr: {} },
  21. { item: { key: "approvalTime", title: "最后审核时间" }, attr: {} },
  22. { item: { key: "createByName", title: "创建人" }, attr: {} },
  23. { item: { key: "createTime", title: "创建时间" }, attr: {} },
  24. {
  25. item: { key: "updateByName", title: "最后修改人" },
  26. attr: { is: "el-file-preview" },
  27. },
  28. { item: { key: "updateTime", title: "最后修改时间" }, attr: {} },
  29. ].map(({ item, attr }) => ({
  30. attr,
  31. item: { ...item, hidden: true, fixed: false },
  32. }));
  33. const SearchColumns = [
  34. {
  35. item: { key: "materialCode", title: "物料编码" },
  36. attr: {
  37. is: "el-input",
  38. // referName: "SUPPLIER_PARAM",
  39. // valueKey: "name",
  40. // dataMapping: { supplier: "id", supplierName: "name" },
  41. },
  42. },
  43. {
  44. item: { key: "materialName", title: "物料名称" },
  45. attr: {
  46. is: "el-input",
  47. },
  48. },
  49. {
  50. item: { key: "status", title: "单据状态" },
  51. attr: {
  52. is: "el-select",
  53. dictName: "documents_status",
  54. clearable: true,
  55. },
  56. },
  57. ].map(({ item, attr }) => ({
  58. attr,
  59. item: { ...item, hidden: true, span: item.span || 6 },
  60. }));
  61. return { TableColumns, SearchColumns };
  62. }