add.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. const pickerOptions = {
  2. disabledDate(time) {
  3. return time.getTime() > Date.now();
  4. },
  5. shortcuts: [
  6. {
  7. text: "今天",
  8. onClick(picker) {
  9. picker.$emit("pick", new Date());
  10. },
  11. },
  12. {
  13. text: "昨天",
  14. onClick(picker) {
  15. const date = new Date();
  16. date.setTime(date.getTime() - 3600 * 1000 * 24);
  17. picker.$emit("pick", date);
  18. },
  19. },
  20. {
  21. text: "一周前",
  22. onClick(picker) {
  23. const date = new Date();
  24. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  25. picker.$emit("pick", date);
  26. },
  27. },
  28. ],
  29. };
  30. const columns = [
  31. {
  32. title: "采购组织",
  33. key: "puOrg",
  34. type: "InputDialog",
  35. value: [],
  36. required: true,
  37. },
  38. { title: "需求来源", key: "source", type: "Input", value: "采购创建" },
  39. { title: "采购员", key: "buyer", value: [], type: "InputDialog" },
  40. { title: "交易类型", key: "billYpe", value: [], type: "InputDialog" },
  41. { title: "物料编码", key: "material", type: "Input", required: true },
  42. {
  43. title: "物料名称",
  44. key: "materialName",
  45. type: "InputDialog",
  46. value: [],
  47. required: true,
  48. },
  49. {
  50. title: "物料/物料描述",
  51. key: "materialDesc",
  52. type: "InputDialog",
  53. value: [],
  54. required: true,
  55. },
  56. { title: "生产厂家", key: "manufacturer", type: "Input" },
  57. { title: "收货客户", key: "customer", type: "InputDialog", value: [] },
  58. {
  59. title: "采购单位",
  60. key: "puUnit",
  61. type: "InputDialog",
  62. value: [],
  63. required: true,
  64. },
  65. {
  66. title: "采购数量",
  67. key: "puQty",
  68. type: "InputNumber",
  69. required: true,
  70. },
  71. {
  72. title: "需求时间",
  73. key: "demandDate",
  74. type: "DatePicker",
  75. config: { type: "date", pickerOptions: pickerOptions },
  76. },
  77. { title: "项目名称", key: "projectName", type: "InputDialog", value: [] },
  78. { title: "需求人", key: "demandPersonal", type: "InputDialog", value: [] },
  79. {
  80. title: "需求组织",
  81. key: "demandOrg",
  82. type: "InputDialog",
  83. value: [],
  84. require: true,
  85. },
  86. { title: "需求部门", key: "demandDept", type: "InputDialog", value: [] },
  87. { title: "建议供应商", key: "supplier", type: "InputDialog", value: [] },
  88. { title: "收货人", key: "a", type: "InputDialog", value: [] },
  89. { title: "收货组织", key: "b", type: "InputDialog", value: [] },
  90. { title: "收货人联系方式", key: "c", type: "Input" },
  91. { title: "收货地址", key: "d", type: "Input" },
  92. { title: "收货仓库", key: "e", type: "InputDialog", value: [] },
  93. {
  94. title: "指定供应商",
  95. key: "assignSupplier",
  96. type: "InputDialog",
  97. value: [],
  98. },
  99. { title: "单位", key: "unit", type: "InputDialog", value: [] },
  100. { title: "收货地址", key: "f", type: "InputDialog", value: [] },
  101. ];
  102. export const initColumns = () => columns;