columns.js 8.0 KB

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