columns.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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: "materialDesc",
  116. title: "物料描述",
  117. },
  118. attr: {
  119. is: "el-input",
  120. },
  121. },
  122. {
  123. item: {
  124. key: "code",
  125. title: "单据号",
  126. },
  127. attr: {
  128. is: "el-input",
  129. },
  130. },
  131. {
  132. item: {
  133. key: "puOrgIds",
  134. title: "采购组织",
  135. },
  136. attr: {
  137. is: "el-popover-multiple-select-v2",
  138. referName: "ORG_PARAM",
  139. valueKey: "id",
  140. },
  141. },
  142. {
  143. item: {
  144. key: "status",
  145. title: "状态",
  146. },
  147. attr: {
  148. is: "el-select",
  149. dictName: "purchase_task_status",
  150. clearable: true,
  151. },
  152. },
  153. {
  154. item: {
  155. key: "date",
  156. title: "创建时间",
  157. },
  158. attr: {
  159. is: "el-date-picker",
  160. type: "daterange",
  161. unlinkPanels: true,
  162. rangeSeparator: "至",
  163. valueFormat: "yyyy-MM-dd",
  164. endPlaceholder: "结束日期",
  165. startPlaceholder: "开始日期",
  166. pickerOptions: pickerOptions,
  167. value: [],
  168. },
  169. },
  170. {
  171. item: {
  172. key: "buyers",
  173. title: "采购员",
  174. },
  175. attr: {
  176. is: "el-popover-multiple-select-v2",
  177. referName: "CONTACTS_PARAM",
  178. valueKey: "code",
  179. },
  180. },
  181. {
  182. item: {
  183. key: "manufacturerName",
  184. title: "生产厂家",
  185. },
  186. attr: {
  187. is: "el-input",
  188. },
  189. },
  190. {
  191. item: {
  192. key: "customerName",
  193. title: "收货客户",
  194. },
  195. attr: {
  196. is: "el-popover-select-v2",
  197. referName: "CUSTOMERDEPT_PARAM",
  198. valueKey: "name",
  199. },
  200. },
  201. {
  202. item: {
  203. key: "documentsCodes",
  204. title: "采购需求单号",
  205. span: 12,
  206. },
  207. attr: {
  208. is: "el-input",
  209. placeholder: "请输入来源单据号,多个用,分隔",
  210. },
  211. },
  212. {
  213. item: {
  214. key: "materialCodes",
  215. title: "物料编码",
  216. span: 12,
  217. },
  218. attr: {
  219. is: "el-input",
  220. placeholder: "请输入物料编码,多个用,分隔",
  221. },
  222. },
  223. ].map(({ item, attr }) => ({
  224. attr,
  225. item: { ...item, hidden: true, span: item.span || 6 },
  226. }));
  227. const pickerOptions = {
  228. shortcuts: [
  229. {
  230. text: "昨天",
  231. onClick(picker) {
  232. const end = new Date();
  233. const start = new Date();
  234. start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
  235. picker.$emit("pick", [start, end]);
  236. },
  237. },
  238. {
  239. text: "最近三天",
  240. onClick(picker) {
  241. const end = new Date();
  242. const start = new Date();
  243. start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
  244. picker.$emit("pick", [start, end]);
  245. },
  246. },
  247. {
  248. text: "最近一周",
  249. onClick(picker) {
  250. const end = new Date();
  251. const start = new Date();
  252. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  253. picker.$emit("pick", [start, end]);
  254. },
  255. },
  256. {
  257. text: "最近一个月",
  258. onClick(picker) {
  259. const end = new Date();
  260. const start = new Date();
  261. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  262. picker.$emit("pick", [start, end]);
  263. },
  264. },
  265. {
  266. text: "最近三个月",
  267. onClick(picker) {
  268. const end = new Date();
  269. const start = new Date();
  270. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  271. picker.$emit("pick", [start, end]);
  272. },
  273. },
  274. {
  275. text: "最近半年",
  276. onClick(picker) {
  277. const end = new Date();
  278. const start = new Date();
  279. start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
  280. picker.$emit("pick", [start, end]);
  281. },
  282. },
  283. ],
  284. };
  285. return { TableColumns, SearchColumns };
  286. }