columns.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. export default function useColumns() {
  2. const TableColumns = [
  3. {
  4. item: { key: "code", title: "单据号", },
  5. attr: {},
  6. },
  7. {
  8. item: { key: "status", title: "单据状态", width: 80 },
  9. attr: { is: "el-dict-tag", dictName: "sys_status", },
  10. },
  11. {
  12. item: { key: "deliveryInventoryOrgName", title: "调出库存组织", },
  13. attr: {},
  14. },
  15. {
  16. item: { key: "billType", title: "订单类型", },
  17. attr: { is: "el-dict-tag", dictName: "sys_allot_billtype", },
  18. },
  19. {
  20. item: { key: "createByName", title: "制单人", width: 100 },
  21. attr: {},
  22. },
  23. {
  24. item: { key: "approveUser", title: "当前审批人", width: 100 },
  25. attr: {},
  26. },
  27. {
  28. item: { key: "billDate", title: "单据日期", width: 100 },
  29. attr: {},
  30. },
  31. {
  32. item: { key: "allotType", title: "调拨方式", width: 100 },
  33. attr: { is: "el-dict-tag", dictName: "sys_to_type", },
  34. },
  35. {
  36. item: { key: "storageInventoryOrgName", title: "调拨入库组织", },
  37. attr: {},
  38. },
  39. {
  40. item: { key: "businessPersonalName", title: "调出业务员", width: 100 },
  41. attr: {},
  42. },
  43. {
  44. item: { key: "deliveryDeptName", title: "调出部门", width: 100 },
  45. attr: {},
  46. },
  47. {
  48. item: { key: "qty", title: "总数量", width: 100 },
  49. attr: { isSummary: true, },
  50. },
  51. {
  52. item: { key: "customerName", title: "客户", },
  53. attr: {},
  54. },
  55. {
  56. item: { key: "deliveryWarehouseName", title: "调出仓库", },
  57. attr: {},
  58. },
  59. {
  60. item: { key: "storageWarehouseName", title: "调入仓库", },
  61. attr: {},
  62. },
  63. {
  64. item: { key: "remark", title: "备注", },
  65. attr: {},
  66. },
  67. {
  68. item: { key: "createTime", title: "制单日期" },
  69. attr: {},
  70. },
  71. ].map(({ item, attr }) => ({
  72. attr,
  73. item: {
  74. ...item,
  75. width: item.width || 160,
  76. sortabled: true,
  77. fixedabled: true,
  78. filterabled: true,
  79. hiddenabled: true,
  80. },
  81. }));
  82. const TabColumns = [
  83. // 物料信息
  84. {
  85. item: {
  86. key: "materialInfo",
  87. title: "物料信息"
  88. },
  89. attr: { value: [], },
  90. TableColumns: [
  91. {
  92. item: { key: "rowno", title: "行号", width: 80 },
  93. attr: {},
  94. },
  95. {
  96. item: { key: "materialCode", title: "物料编码", },
  97. attr: {},
  98. },
  99. {
  100. item: { key: "materialName", title: "物料名称", },
  101. attr: {},
  102. },
  103. {
  104. item: { key: "qty", title: "数量", width: 120 },
  105. attr: {},
  106. },
  107. {
  108. item: { key: "unitName", title: "单位", width: 120 },
  109. attr: {},
  110. },
  111. {
  112. item: { key: "specification", title: "规格", },
  113. attr: {},
  114. },
  115. {
  116. item: { key: "model", title: "型号", width: 100 },
  117. attr: {},
  118. },
  119. {
  120. item: { key: "manufacturer", title: "生产厂家/代理人", },
  121. attr: {},
  122. },
  123. {
  124. item: { key: "originPlace", title: "产地", },
  125. attr: {},
  126. },
  127. {
  128. item: { key: "storageDeptName", title: "调入部门", },
  129. attr: {},
  130. },
  131. {
  132. item: { key: "producBatch", title: "产品批号", },
  133. attr: {},
  134. },
  135. {
  136. item: { key: "deliveryAllocationName", title: "调出货位", },
  137. attr: {}
  138. },
  139. {
  140. item: { key: "storageAllocationName", title: "调入货位", },
  141. attr: {}
  142. },
  143. ].map(({ item, attr }) => ({
  144. attr,
  145. item: { ...item, width: item.width || 180 },
  146. }))
  147. },
  148. // 收发货信息
  149. {
  150. item: {
  151. key: "receiveInfo",
  152. title: "收发货信息"
  153. },
  154. attr: { value: [], },
  155. TableColumns: [
  156. {
  157. item: { key: "rowno", title: "行号", },
  158. attr: {},
  159. },
  160. {
  161. item: { key: "deliveryCode", title: "调拨出库单号", },
  162. attr: {},
  163. },
  164. {
  165. item: { key: "storageCode", title: "调拨入库单号", },
  166. attr: {},
  167. },
  168. {
  169. item: { key: "manufacturer", title: "生产厂家/代理人", },
  170. attr: {},
  171. },
  172. {
  173. item: { key: "originPlace", title: "产地", },
  174. attr: {},
  175. },
  176. {
  177. item: { key: "classify", title: "类别", },
  178. attr: {},
  179. },
  180. {
  181. item: { key: "deliveryWarehouseName", title: "调出仓库", },
  182. attr: {},
  183. },
  184. {
  185. item: { key: "storageWarehouseName", title: "调入仓库", },
  186. attr: {},
  187. },
  188. {
  189. item: { key: "businessPersonalName", title: "调入业务员", },
  190. attr: {},
  191. },
  192. {
  193. item: { key: "productBatch", title: "产品批号", },
  194. attr: {},
  195. },
  196. {
  197. item: { key: "manufactureDate", title: "生产日期", },
  198. attr: {},
  199. },
  200. {
  201. item: { key: "periodEndDate", title: "有效期至/失效日期", },
  202. attr: {},
  203. },
  204. {
  205. item: { key: "ratifyCode", title: "批准文号", },
  206. attr: {},
  207. },
  208. {
  209. item: { key: "registration", title: "注册证号", },
  210. attr: {},
  211. },
  212. {
  213. item: { key: "productCode", title: "商品名", },
  214. attr: {},
  215. },
  216. {
  217. item: { key: "commonCode", title: "通用名", },
  218. attr: {},
  219. },
  220. {
  221. item: { key: "drug", title: "剂型", },
  222. attr: {},
  223. },
  224. {
  225. item: { key: "customerName", title: "收货客户", },
  226. attr: {},
  227. },
  228. {
  229. item: { key: "addressaddress", title: "收货地址", },
  230. attr: {},
  231. },
  232. {
  233. item: { key: "area", title: "收货地区", },
  234. attr: {},
  235. },
  236. {
  237. item: { key: "place", title: "收货地点", },
  238. attr: {},
  239. },
  240. {
  241. item: { key: "deliveryDate", title: "计划发货日期", },
  242. attr: {},
  243. },
  244. {
  245. item: { key: "strageDate", title: "计划到货日期", },
  246. attr: {},
  247. },
  248. {
  249. item: { key: "transportation", title: "运输方式", },
  250. attr: {},
  251. },
  252. {
  253. item: { key: "remark", title: "备注", },
  254. attr: {},
  255. },
  256. {
  257. item: { key: "customerLogistic", title: "客户物料编码", },
  258. attr: {},
  259. },
  260. {
  261. item: { key: "customerLogisticName", title: "客户物料名称", },
  262. attr: {},
  263. },
  264. ].map(({ item, attr }) => ({
  265. attr,
  266. item: { ...item, width: item.width || 150 },
  267. }))
  268. },
  269. // 费用价格
  270. {
  271. item: {
  272. key: "priceList",
  273. title: "价格费用"
  274. },
  275. attr: { value: [], },
  276. TableColumns: [
  277. {
  278. item: { key: "rowno", title: "行号", },
  279. attr: {},
  280. },
  281. {
  282. item: { key: "deliveryCode", title: "调拨出库单号", },
  283. attr: {},
  284. },
  285. {
  286. item: { key: "storageCode", title: "调拨入库单号", },
  287. attr: {},
  288. },
  289. {
  290. item: { key: "manufacturer", title: "生产厂家/代理人", },
  291. attr: {},
  292. },
  293. {
  294. item: { key: "originPlace", title: "产地", },
  295. attr: {},
  296. },
  297. {
  298. item: { key: "classify", title: "类别", },
  299. attr: {},
  300. },
  301. {
  302. item: { key: "productBatch", title: "产品批号", },
  303. attr: {},
  304. },
  305. {
  306. item: { key: "manufactureDate", title: "生产日期", },
  307. attr: {},
  308. },
  309. {
  310. item: { key: "periodEndDate", title: "有效期至/失效日期", },
  311. attr: {},
  312. },
  313. {
  314. item: { key: "ratifyCode", title: "批准文号", },
  315. attr: {},
  316. },
  317. {
  318. item: { key: "registration", title: "注册证号", },
  319. attr: {},
  320. },
  321. {
  322. item: { key: "productCode", title: "商品名", },
  323. attr: {},
  324. },
  325. {
  326. item: { key: "commonCode", title: "通用名", },
  327. attr: {},
  328. },
  329. {
  330. item: { key: "drug", title: "剂型", },
  331. attr: {},
  332. },
  333. {
  334. item: { key: "customerLogistic", title: "客户物料码", },
  335. attr: {},
  336. },
  337. {
  338. item: { key: "customerLogisticName", title: "客户物料名称", },
  339. attr: {},
  340. },
  341. ].map(({ item, attr }) => ({
  342. attr,
  343. item: { ...item, width: item.width || 150 },
  344. })),
  345. },
  346. // 执行结果
  347. {
  348. item: {
  349. key: "resultList",
  350. title: "执行结果"
  351. },
  352. attr: { value: [], },
  353. TableColumns: [
  354. {
  355. item: { key: "rowno", title: "行号", },
  356. attr: {},
  357. },
  358. {
  359. item: { key: "deliveryCode", title: "调拨出库单号", },
  360. attr: {},
  361. },
  362. {
  363. item: { key: "storageCode", title: "调拨入库单号", },
  364. attr: {},
  365. },
  366. {
  367. item: { key: "manufacturer", title: "生产厂家/代理人", },
  368. attr: {},
  369. },
  370. {
  371. item: { key: "originPlace", title: "产地", },
  372. attr: {},
  373. },
  374. {
  375. item: { key: "classify", title: "类别", },
  376. attr: {},
  377. },
  378. {
  379. item: { key: "productBatch", title: "产品批号", },
  380. attr: {},
  381. },
  382. {
  383. item: { key: "manufactureDate", title: "生产日期", },
  384. attr: {},
  385. },
  386. {
  387. item: { key: "periodEndDate", title: "有效期至/失效日期", },
  388. attr: {},
  389. },
  390. {
  391. item: { key: "ratifyCode", title: "批准文号", },
  392. attr: {},
  393. },
  394. {
  395. item: { key: "registration", title: "注册证号", },
  396. attr: {},
  397. },
  398. {
  399. item: { key: "productCode", title: "商品名", },
  400. attr: {},
  401. },
  402. {
  403. item: { key: "commonCode", title: "通用名", },
  404. attr: {},
  405. },
  406. {
  407. item: { key: "drug", title: "剂型", },
  408. attr: {},
  409. },
  410. {
  411. item: { key: "customerLogistic", title: "客户物料码", },
  412. attr: {},
  413. },
  414. {
  415. item: { key: "customerLogisticName", title: "客户物料名称", },
  416. attr: {},
  417. },
  418. ].map(({ item, attr }) => ({
  419. attr,
  420. item: { ...item, width: item.width || 150 },
  421. })),
  422. },
  423. ];
  424. const SearchColumns = [
  425. {
  426. item: { key: "deliveryInventoryOrgName", title: "调出库存组织" },
  427. attr: {
  428. is: "el-popover-select-v2",
  429. referName: "ORG_PARAM",
  430. valueKey: "name",
  431. dataMapping: {
  432. deliveryInventoryOrg: "id",
  433. deliveryInventoryOrgName: "name"
  434. },
  435. },
  436. },
  437. {
  438. item: { width: 100, key: "billDates", title: "单据日期", },
  439. attr: {
  440. clearable: true,
  441. is: "el-date-picker",
  442. type: "daterange",
  443. rangeSeparator: "-",
  444. startPlaceholder: "开始日期",
  445. endPlaceholder: "结束日期",
  446. valueFormat: "yyyy-MM-dd",
  447. },
  448. },
  449. {
  450. item: { key: "billType", title: "订单类型" },
  451. attr: {
  452. is: "el-select",
  453. dictName: "sys_allot_billtype",
  454. clearable: true,
  455. },
  456. },
  457. {
  458. item: { key: "storageInventoryOrgName", title: "调入库存组织" },
  459. attr: {
  460. is: "el-popover-select-v2",
  461. referName: "ORG_PARAM",
  462. valueKey: "name",
  463. dataMapping: {
  464. storageInventoryOrg: "id",
  465. storageInventoryOrgName: "name"
  466. },
  467. },
  468. },
  469. {
  470. item: { key: "code", title: "单据号" },
  471. attr: {
  472. is: "el-input",
  473. clearable: true,
  474. },
  475. },
  476. {
  477. item: { key: "createByName", title: "制单人" },
  478. attr: {
  479. is: "el-popover-select-v2",
  480. referName: "CONTACTS_PARAM",
  481. valueKey: "name",
  482. dataMapping: {
  483. createBy: "code",
  484. createByName: "name"
  485. },
  486. },
  487. },
  488. ];
  489. return { TableColumns, TabColumns, SearchColumns }
  490. }