columns.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. export default function useColumns() {
  2. const desColumns = [
  3. {
  4. item: {
  5. key: "code",
  6. title: "预留单据号",
  7. },
  8. attr: {}
  9. },
  10. {
  11. item: {
  12. key: "source",
  13. title: "来源单据号",
  14. },
  15. attr: {}
  16. },
  17. {
  18. item: {
  19. key: "customerName",
  20. title: "客户名称",
  21. },
  22. attr: {}
  23. },
  24. {
  25. item: {
  26. key: "createByName",
  27. title: "创建人",
  28. },
  29. attr: {}
  30. },
  31. {
  32. item: {
  33. key: "createBy",
  34. title: "创建人编码",
  35. },
  36. attr: {}
  37. },
  38. {
  39. item: {
  40. key: "createTime",
  41. title: "创建时间",
  42. },
  43. attr: {}
  44. },
  45. ];
  46. const itemsColumns = [
  47. {
  48. item: {
  49. key: "materialCode",
  50. title: "物料编码",
  51. },
  52. attr: {}
  53. },
  54. {
  55. item: {
  56. key: "materialName",
  57. title: "物料名称",
  58. },
  59. attr: {}
  60. },
  61. {
  62. item: {
  63. key: "unitName",
  64. title: "单位名称",
  65. },
  66. attr: {}
  67. },
  68. {
  69. item: {
  70. key: "warehouseName",
  71. title: "仓库",
  72. },
  73. attr: {}
  74. },
  75. {
  76. item: {
  77. key: "allocationName",
  78. title: "货位",
  79. },
  80. attr: {}
  81. },
  82. {
  83. item: {
  84. key: "reservedQty",
  85. title: "预留数量",
  86. },
  87. attr: {}
  88. },
  89. {
  90. item: {
  91. key: "totalIn",
  92. title: "累计入库数量",
  93. },
  94. attr: {}
  95. },
  96. {
  97. item: {
  98. key: "qty",
  99. title: "可用量",
  100. },
  101. attr: {}
  102. },
  103. {
  104. item: {
  105. key: "usedQty",
  106. title: "已用量",
  107. },
  108. attr: {}
  109. },
  110. ].map(({ item, attr }) => ({
  111. item: {
  112. ...item,
  113. width: item.width || 150
  114. },
  115. attr,
  116. }));
  117. const historyColumns = [
  118. {
  119. item: {
  120. key: "materialCode",
  121. title: "物料编码",
  122. },
  123. attr: {}
  124. },
  125. {
  126. item: {
  127. key: "materialName",
  128. title: "物料名称",
  129. width: 200,
  130. },
  131. attr: {}
  132. },
  133. {
  134. item: {
  135. key: "unitName",
  136. title: "单位",
  137. width: 100,
  138. },
  139. attr: {}
  140. },
  141. {
  142. item: {
  143. key: "warehouseName",
  144. title: "仓库",
  145. },
  146. attr: {}
  147. },
  148. {
  149. item: {
  150. key: "productBatchNum",
  151. title: "批号",
  152. width: 100,
  153. },
  154. attr: {}
  155. },
  156. {
  157. item: {
  158. key: "operateBill",
  159. title: "操作单据",
  160. width: 100,
  161. },
  162. attr: {
  163. is: "el-dict-tag",
  164. dictName: "ow_operatetype",
  165. }
  166. },
  167. {
  168. item: {
  169. key: "operateBillcode",
  170. title: "操作单据编码",
  171. width: 200,
  172. },
  173. attr: {}
  174. },
  175. {
  176. item: {
  177. key: "operateBillitem",
  178. title: "操作明细行号",
  179. },
  180. attr: {}
  181. },
  182. {
  183. item: {
  184. key: "allotQty",
  185. title: "操作数量",
  186. },
  187. attr: {}
  188. },
  189. {
  190. item: {
  191. key: "createTime",
  192. title: "操作时间",
  193. width: 200,
  194. },
  195. attr: {}
  196. },
  197. ].map(({ item, attr }) => ({
  198. item: {
  199. ...item,
  200. width: item.width || 150
  201. },
  202. attr,
  203. }));
  204. return { desColumns, itemsColumns, historyColumns }
  205. }