column.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. export const TableColumns = [
  2. { item: { key: "code", title: "订单生成单号" }, attr: {} },
  3. {
  4. item: { key: "status", title: "状态" },
  5. attr: {
  6. is: "el-dict-tag",
  7. dictName: "purchase_task_status",
  8. },
  9. },
  10. { item: { key: "demandCode", title: "需求单号" }, attr: {} },
  11. { item: { key: "materialName", title: "物料" }, attr: {} },
  12. {
  13. item: { key: "materialCode", title: "物料编码" },
  14. attr: {},
  15. },
  16. {
  17. item: { key: "materialDesc", title: "物料描述" },
  18. attr: {},
  19. },
  20. {
  21. item: { key: "manufacturerName", title: "生产厂家" },
  22. attr: {},
  23. },
  24. { item: { key: "puQty", title: "采购数量" }, attr: {} },
  25. {
  26. item: { key: "executeQty", title: "已执行数量" },
  27. attr: {},
  28. },
  29. {
  30. item: { key: "residueQty", title: "未执行数量" },
  31. attr: {},
  32. },
  33. {
  34. item: { key: "priceType", title: "价格类型" },
  35. attr: { is: "el-dict-tag", dictName: "sys_price_type" },
  36. },
  37. { item: { key: "puUnitName", title: "采购单位" }, attr: {} },
  38. { item: { key: "buyerName", title: "采购员" }, attr: {} },
  39. {
  40. item: { key: "supplierName", title: "建议供应商" },
  41. attr: {},
  42. },
  43. { item: { key: "puOrgName", title: "采购组织" }, attr: {} },
  44. { item: { key: "currencyName", title: "币种" }, attr: {} },
  45. { item: { key: "source", title: "需求来源" }, attr: {} },
  46. {
  47. item: { key: "customerName", title: "收货客户" },
  48. attr: {},
  49. },
  50. {
  51. item: { key: "assignSupplierName", title: "指定供应商" },
  52. attr: {},
  53. },
  54. { item: { key: "demandDate", title: "需求时间" }, attr: {} },
  55. { item: { key: "projectName", title: "项目名称" }, attr: {} },
  56. {
  57. item: { key: "demandPersonalName", title: "需求人" },
  58. attr: {},
  59. },
  60. {
  61. item: { key: "demandOrgName", title: "需求组织" },
  62. attr: {},
  63. },
  64. {
  65. item: { key: "demandDeptName", title: "需求部门" },
  66. attr: {},
  67. },
  68. {
  69. item: { key: "isBack", title: "是否退回" },
  70. attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
  71. },
  72. { item: { key: "baskCause", title: "退回原因" }, attr: {} },
  73. { item: { key: "backDate", title: "退回日期" }, attr: {} },
  74. { item: { key: "unitName", title: "单位" }, attr: {} },
  75. ].map(({ item, attr }) => ({
  76. attr,
  77. item: { ...item, hidden: true, fixed: false },
  78. }));
  79. export const SearchColumns = [
  80. {
  81. item: {
  82. key: "classIds",
  83. title: "物料分类",
  84. },
  85. attr: {
  86. is: "el-popover-multiple-tree-select",
  87. referName: "MATERIALCLASSIFY_PARAM",
  88. valueKey: "id",
  89. },
  90. },
  91. {
  92. item: {
  93. key: "materialCodes",
  94. title: "物料编码",
  95. },
  96. attr: {
  97. is: "el-popover-multiple-select-v2",
  98. valueKey: "code",
  99. referName: "MATERIAL_PARAM",
  100. },
  101. },
  102. {
  103. item: {
  104. key: "materialDesc",
  105. title: "物料描述",
  106. },
  107. attr: {
  108. is: "el-input",
  109. },
  110. },
  111. {
  112. item: {
  113. key: "code",
  114. title: "单据号",
  115. },
  116. attr: {
  117. is: "el-input",
  118. },
  119. },
  120. {
  121. item: {
  122. key: "puOrgIds",
  123. title: "采购组织",
  124. },
  125. attr: {
  126. is: "el-popover-multiple-select-v2",
  127. referName: "ORG_PARAM",
  128. valueKey: "id",
  129. },
  130. },
  131. {
  132. item: {
  133. key: "status",
  134. title: "状态",
  135. },
  136. attr: {
  137. is: "el-select",
  138. dictName: "purchase_task_status",
  139. clearable: true,
  140. },
  141. },
  142. {
  143. item: {
  144. key: "date",
  145. title: "创建时间",
  146. },
  147. attr: {
  148. is: "el-date-picker",
  149. type: "daterange",
  150. unlinkPanels: true,
  151. rangeSeparator: "至",
  152. valueFormat: "yyyy-MM-dd",
  153. endPlaceholder: "结束日期",
  154. startPlaceholder: "开始日期",
  155. pickerOptions: pickerOptions,
  156. value: [],
  157. },
  158. },
  159. {
  160. item: {
  161. key: "buyers",
  162. title: "采购员",
  163. },
  164. attr: {
  165. is: "el-popover-multiple-select-v2",
  166. referName: "CONTACTS_PARAM",
  167. valueKey: "code",
  168. },
  169. },
  170. {
  171. item: {
  172. key: "manufacturerName",
  173. title: "生产厂家",
  174. },
  175. attr: {
  176. is: "el-input",
  177. },
  178. },
  179. {
  180. item: {
  181. key: "customerName",
  182. title: "收货客户",
  183. },
  184. attr: {
  185. is: "el-popover-select-v2",
  186. referName: "CUSTOMERDEPT_PARAM",
  187. valueKey: "name",
  188. },
  189. },
  190. {
  191. item: {
  192. key: "documentsCodes",
  193. title: "需求来源",
  194. span: 12,
  195. },
  196. attr: {
  197. is: "el-input",
  198. placeholder: "请输入来源单据号,多个用,分隔",
  199. },
  200. },
  201. {
  202. item: {
  203. key: "materialCodes",
  204. title: "物料编码",
  205. span: 12,
  206. },
  207. attr: {
  208. is: "el-input",
  209. placeholder: "请输入物料编码,多个用,分隔",
  210. },
  211. },
  212. ].map(({ item, attr }) => ({
  213. attr,
  214. item: { ...item, hidden: true, span: item.span || 6 },
  215. }));
  216. const pickerOptions = {
  217. shortcuts: [
  218. {
  219. text: "昨天",
  220. onClick(picker) {
  221. const end = new Date();
  222. const start = new Date();
  223. start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
  224. picker.$emit("pick", [start, end]);
  225. },
  226. },
  227. {
  228. text: "最近三天",
  229. onClick(picker) {
  230. const end = new Date();
  231. const start = new Date();
  232. start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
  233. picker.$emit("pick", [start, end]);
  234. },
  235. },
  236. {
  237. text: "最近一周",
  238. onClick(picker) {
  239. const end = new Date();
  240. const start = new Date();
  241. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  242. picker.$emit("pick", [start, end]);
  243. },
  244. },
  245. {
  246. text: "最近一个月",
  247. onClick(picker) {
  248. const end = new Date();
  249. const start = new Date();
  250. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  251. picker.$emit("pick", [start, end]);
  252. },
  253. },
  254. {
  255. text: "最近三个月",
  256. onClick(picker) {
  257. const end = new Date();
  258. const start = new Date();
  259. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  260. picker.$emit("pick", [start, end]);
  261. },
  262. },
  263. {
  264. text: "最近半年",
  265. onClick(picker) {
  266. const end = new Date();
  267. const start = new Date();
  268. start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
  269. picker.$emit("pick", [start, end]);
  270. },
  271. },
  272. ],
  273. };