columns.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. export default function useColumns() {
  2. const FormColumns = [
  3. {
  4. item: { key: "code", title: "单据号", },
  5. attr: {
  6. is: "el-input",
  7. clearable: true,
  8. disabled: true,
  9. }
  10. },
  11. {
  12. item: { key: "billDate", title: "单据日期", required: true, },
  13. attr: {
  14. is: "el-date-picker",
  15. clearable: true,
  16. type: "date",
  17. valueFormat: "yyyy-MM-dd",
  18. }
  19. },
  20. {
  21. item: { key: "billType", title: "订单类型", required: true, },
  22. attr: {
  23. is: "el-select",
  24. dictName: "sys_allot_billtype",
  25. clearable: true,
  26. }
  27. },
  28. {
  29. item: { key: "allotType", title: "调拨方式",},
  30. attr: {
  31. is: "el-select",
  32. dictName: "sys_to_type",
  33. disabled: true,
  34. }
  35. },
  36. {
  37. item: { key: "status", title: "单据状态", },
  38. attr: {
  39. is: "el-select",
  40. dictName: "sys_status",
  41. disabled: true,
  42. }
  43. },
  44. {
  45. item: { key: "qty", title: "总数量", },
  46. attr: {
  47. is: "el-input-number",
  48. min: 0,
  49. disabled: true,
  50. }
  51. },
  52. {
  53. item: { key: "customerName", title: "客户", required: true, },
  54. attr: {
  55. is: "el-popover-select-v2",
  56. valueKey: "name",
  57. referName: "CUSTOMER_PARAM",
  58. dataMapping: {
  59. customer: 'id',
  60. customerName: 'name',
  61. },
  62. }
  63. },
  64. {
  65. item: { key: "remark", title: "备注", },
  66. attr: {
  67. is: "el-input",
  68. clearable: true,
  69. }
  70. },
  71. {
  72. item: { key: "deliveryInventoryOrgName", title: "调出库存组织", required: true, },
  73. attr: {
  74. is: "el-popover-select-v2",
  75. valueKey: "name",
  76. referName: "ORG_PARAM",
  77. dataMapping: {
  78. deliveryInventoryOrg: "id",
  79. deliveryInventoryOrgCode: "code",
  80. },
  81. clearable: true,
  82. }
  83. },
  84. {
  85. item: { key: "deliveryWarehouseName", title: "调出仓库", required: true, },
  86. attr: {
  87. is: "el-popover-select-v2",
  88. valueKey: "name",
  89. referName: "WAREHOUSE_PARAM",
  90. dataMapping: {
  91. deliveryWarehouse: "id",
  92. deliveryWarehouseCode: "code",
  93. dwCsFlag: "csFlag",
  94. },
  95. queryParams: (params) => ({
  96. pkOrg: params.deliveryInventoryOrg,
  97. }),
  98. clearable: true,
  99. }
  100. },
  101. {
  102. item: { key: "deliveryDeptName", title: "调出部门", required: true, },
  103. attr: {
  104. is: "el-popover-select-v2",
  105. valueKey: "name",
  106. referName: "DEPT_PARAM",
  107. dataMapping: {
  108. deliveryDept: "id",
  109. deliveryDeptCode: "code",
  110. },
  111. queryParams: (params) => ({
  112. // parame
  113. drpOrg: params.deliveryInventoryOrg,
  114. }),
  115. clearable: true,
  116. }
  117. },
  118. {
  119. item: { key: "businessPersonalName", title: "调出业务员", },
  120. attr: {
  121. is: "el-popover-select-v2",
  122. valueKey: "name",
  123. referName: "CONTACTS_PARAM",
  124. dataMapping: {
  125. businessPersonal: "code",
  126. },
  127. clearable: true,
  128. }
  129. },
  130. {
  131. item: { key: "storageInventoryOrgName", title: "调入库存组织", required: true, },
  132. attr: {
  133. is: "el-popover-select-v2",
  134. valueKey: "name",
  135. referName: "ORG_PARAM",
  136. dataMapping: {
  137. storageInventoryOrg: "id",
  138. storageInventoryOrgCode: "code",
  139. },
  140. clearable: true,
  141. }
  142. },
  143. {
  144. item: { key: "storageWarehouseName", title: "调入仓库", required: true, },
  145. attr: {
  146. is: "el-popover-select-v2",
  147. valueKey: "name",
  148. referName: "WAREHOUSE_PARAM",
  149. dataMapping: {
  150. storageWarehouse: "id",
  151. storageWarehouseCode: "code",
  152. swCsFlag: "csFlag",
  153. },
  154. queryParams: (params) => ({
  155. pkOrg: params.storageInventoryOrg,
  156. }),
  157. clearable: true,
  158. }
  159. },
  160. {
  161. item: { key: "deliveryCode", title: "调拨出库单号", },
  162. attr: {
  163. is: "el-input",
  164. disabled: true,
  165. }
  166. },
  167. {
  168. item: { key: "storageCode", title: "调拨入库单号", },
  169. attr: {
  170. is: "el-input",
  171. disabled: true,
  172. }
  173. },
  174. {
  175. item: { key: "ncCode", title: "NC单据号", },
  176. attr: {
  177. is: "el-input",
  178. disabled: true,
  179. }
  180. },
  181. {
  182. item: { key: "createByName", title: "制单人", },
  183. attr: {
  184. is: "el-input",
  185. disabled: true,
  186. clearable: true,
  187. }
  188. },
  189. {
  190. item: { key: "createTime", title: "制单日期", },
  191. attr: {
  192. is: "el-input",
  193. disabled: true,
  194. clearable: true,
  195. }
  196. },
  197. {
  198. item: { key: "createByName", title: "创建人", },
  199. attr: {
  200. is: "el-input",
  201. disabled: true,
  202. clearable: true,
  203. }
  204. },
  205. {
  206. item: { key: "createTime", title: "创建时间", },
  207. attr: {
  208. is: "el-input",
  209. disabled: true,
  210. clearable: true,
  211. }
  212. },
  213. {
  214. item: { key: "updateByName", title: "最后修改人", },
  215. attr: {
  216. is: "el-input",
  217. disabled: true,
  218. clearable: true,
  219. }
  220. },
  221. {
  222. item: { key: "updateTime", title: "最后修改时间", },
  223. attr: {
  224. is: "el-input",
  225. disabled: true,
  226. clearable: true,
  227. }
  228. },
  229. {
  230. item: { key: "sendNcRes", title: "同步NC结果", span: 12 },
  231. attr: {
  232. is: "el-input",
  233. type: "textarea",
  234. rows: 3,
  235. disabled: true,
  236. clearable: true,
  237. }
  238. },
  239. ].map(({ item, attr }) => ({
  240. attr,
  241. item: { ...item, span: item.span || 6 },
  242. }));
  243. const TabColumns = [
  244. // 物料信息
  245. {
  246. item: { key: "stAllotMaterialList", title: "物料信息" },
  247. attr: { value: [] },
  248. TableColumns: [
  249. {
  250. item: { key: "rowno", title: "行号", width: 80, },
  251. attr: {}
  252. },
  253. {
  254. item: { key: "materialCode", title: "物料编码", require: true, },
  255. attr: {
  256. is: "el-popover-select-v2",
  257. valueKey: "code",
  258. referName: "MATERIAL_PARAM",
  259. dataMapping: {
  260. material: "id",
  261. materialName: "name",
  262. specification: "specification",
  263. model: "model",
  264. unit: "unitId",
  265. unitName: "unitIdName",
  266. manufacturer: "manufacturerIdName",
  267. originPlace: "originPlace",
  268. originPlaceName: "originPlaceName",
  269. },
  270. clearable: true,
  271. }
  272. },
  273. {
  274. item: { key: "materialName", title: "物料名称", },
  275. attr: {}
  276. },
  277. {
  278. item: { key: "qty", title: "数量", require: true, },
  279. attr: {
  280. is: "el-input-number",
  281. min: 0,
  282. clearable: true,
  283. }
  284. },
  285. {
  286. item: { key: "unitName", title: "单位", },
  287. attr: {}
  288. },
  289. {
  290. item: { key: "specification", title: "规格", },
  291. attr: {}
  292. },
  293. {
  294. item: { key: "model", title: "型号", },
  295. attr: {}
  296. },
  297. {
  298. item: { key: "manufacturer", title: "生产厂家/代理人", },
  299. attr: {}
  300. },
  301. {
  302. item: { key: "originPlaceName", title: "产地", },
  303. attr: {}
  304. },
  305. {
  306. item: { key: "storageDeptName", title: "调入部门", require: true, },
  307. attr: {
  308. is: "el-popover-select-v2",
  309. valueKey: "name",
  310. referName: "DEPT_PARAM",
  311. dataMapping: {
  312. storageDept: "id",
  313. storageDeptCode: "code",
  314. },
  315. clearable: true,
  316. }
  317. },
  318. {
  319. item: { key: "producBatch", title: "产品批号", },
  320. attr: {
  321. is: "el-popover-select-v2",
  322. valueKey: "code",
  323. referName: "PATCHCODE_ZT",
  324. clearable: true,
  325. queryParams: (params) => ({
  326. code: params.materialCode,
  327. })
  328. }
  329. },
  330. {
  331. item: { key: "deliveryAllocationName", title: "调出货位", },
  332. attr: {
  333. is: "el-popover-select-v2",
  334. valueKey: "name",
  335. referName: "ALLOCATION_PARAM",
  336. dataMapping: {
  337. deliveryAllocation: "id",
  338. deliveryAllocationCode: "code",
  339. },
  340. clearable: true,
  341. }
  342. },
  343. {
  344. item: { key: "storageAllocationName", title: "调入货位", },
  345. attr: {
  346. is: "el-popover-select-v2",
  347. valueKey: "name",
  348. referName: "ALLOCATION_PARAM",
  349. dataMapping: {
  350. storageAllocation: "id",
  351. storageAllocationCode: "code",
  352. },
  353. clearable: true,
  354. }
  355. },
  356. ]
  357. },
  358. // 收发货信息
  359. {
  360. item: { key: "stAllotReceiveDeliverList", title: "收发货信息" },
  361. attr: { value: [] },
  362. TableColumns: [
  363. {
  364. item: { key: "rowno", title: "行号", width: 80, },
  365. attr: {}
  366. },
  367. {
  368. item: { key: "deliveryCode", title: "调拨出库单号", },
  369. attr: {}
  370. },
  371. {
  372. item: { key: "storageCode", title: "调拨入库单号", },
  373. attr: {}
  374. },
  375. {
  376. item: { key: "manufacturer", title: "生产厂家/代理人", },
  377. attr: {}
  378. },
  379. {
  380. item: { key: "originPlace", title: "产地", },
  381. attr: {}
  382. },
  383. {
  384. item: { key: "classify", title: "类别", },
  385. attr: {}
  386. },
  387. {
  388. item: { key: "deliveryWarehouseName", title: "调出仓库", },
  389. attr: {}
  390. },
  391. {
  392. item: { key: "storageWarehouseName", title: "调入仓库", },
  393. attr: {}
  394. },
  395. {
  396. item: { key: "businessPersonalName", title: "调入业务员", },
  397. attr: {}
  398. },
  399. {
  400. item: { key: "productBatch", title: "产品批号", },
  401. attr: {}
  402. },
  403. {
  404. item: { key: "manufactureDate", title: "生产日期", },
  405. attr: {}
  406. },
  407. {
  408. item: { key: "periodEndDate", title: "有效期至/失效日期", },
  409. attr: {}
  410. },
  411. {
  412. item: { key: "ratifyCode", title: "批准文号", },
  413. attr: {}
  414. },
  415. {
  416. item: { key: "registration", title: "注册证号", },
  417. attr: {}
  418. },
  419. {
  420. item: { key: "productCode", title: "商品名", },
  421. attr: {}
  422. },
  423. {
  424. item: { key: "commonCode", title: "通用名", },
  425. attr: {}
  426. },
  427. {
  428. item: { key: "drug", title: "剂型", },
  429. attr: {}
  430. },
  431. {
  432. item: { key: "customerName", title: "收货客户", },
  433. attr: {}
  434. },
  435. {
  436. item: { key: "addressaddress", title: "收货地址", },
  437. attr: {}
  438. },
  439. {
  440. item: { key: "area", title: "收货地区", },
  441. attr: {}
  442. },
  443. {
  444. item: { key: "place", title: "收货地点", },
  445. attr: {}
  446. },
  447. {
  448. item: { key: "deliveryDate", title: "计划发货日期", },
  449. attr: {}
  450. },
  451. {
  452. item: { key: "strageDate", title: "计划到货日期", },
  453. attr: {}
  454. },
  455. {
  456. item: { key: "transportation", title: "运输方式", },
  457. attr: {}
  458. },
  459. {
  460. item: { key: "remark", title: "备注", },
  461. attr: {}
  462. },
  463. {
  464. item: { key: "customerLogistic", title: "客户物料编码", },
  465. attr: {}
  466. },
  467. {
  468. item: { key: "customerLogisticName", title: "客户物料名称", },
  469. attr: {}
  470. },
  471. ]
  472. },
  473. // 价格费用
  474. {
  475. item: { key: "stAllotReceiveExecuteList", title: "价格费用" },
  476. attr: { value: [] },
  477. TableColumns: [
  478. {
  479. item: { key: "rowno", title: "行号", width: 80, },
  480. attr: {}
  481. },
  482. {
  483. item: { key: "deliveryCode", title: "调拨出库单号", },
  484. attr: {}
  485. },
  486. {
  487. item: { key: "storageCode", title: "调拨入库单号", },
  488. attr: {}
  489. },
  490. {
  491. item: { key: "manufacturer", title: "生产厂家/代理人", },
  492. attr: {}
  493. },
  494. {
  495. item: { key: "originPlace", title: "产地", },
  496. attr: {}
  497. },
  498. {
  499. item: { key: "classify", title: "类别", },
  500. attr: {}
  501. },
  502. {
  503. item: { key: "productBatch", title: "产品批号", },
  504. attr: {}
  505. },
  506. {
  507. item: { key: "manufactureDate", title: "生产日期", },
  508. attr: {}
  509. },
  510. {
  511. item: { key: "periodEndDate", title: "有效期至/失效日期", },
  512. attr: {}
  513. },
  514. {
  515. item: { key: "ratifyCode", title: "批准文号", },
  516. attr: {}
  517. },
  518. {
  519. item: { key: "registration", title: "注册证号", },
  520. attr: {}
  521. },
  522. {
  523. item: { key: "productCode", title: "商品名", },
  524. attr: {}
  525. },
  526. {
  527. item: { key: "commonCode", title: "通用名", },
  528. attr: {}
  529. },
  530. {
  531. item: { key: "drug", title: "剂型", },
  532. attr: {}
  533. },
  534. {
  535. item: { key: "customerLogistic", title: "客户物料码", },
  536. attr: {}
  537. },
  538. {
  539. item: { key: "customerLogisticName", title: "客户物料名称", },
  540. attr: {}
  541. },
  542. ]
  543. },
  544. // 执行结果
  545. {
  546. item: { key: "stAllotReceiveExpenseList", title: "执行结果" },
  547. attr: { value: [] },
  548. TableColumns: [
  549. {
  550. item: { key: "rowno", title: "行号", width: 80, },
  551. attr: {}
  552. },
  553. {
  554. item: { key: "deliveryCode", title: "调拨出库单号", },
  555. attr: {}
  556. },
  557. {
  558. item: { key: "storageCode", title: "调拨入库单号", },
  559. attr: {}
  560. },
  561. {
  562. item: { key: "manufacturer", title: "生产厂家/代理人", },
  563. attr: {}
  564. },
  565. {
  566. item: { key: "originPlace", title: "产地", },
  567. attr: {}
  568. },
  569. {
  570. item: { key: "classify", title: "类别", },
  571. attr: {}
  572. },
  573. {
  574. item: { key: "productBatch", title: "产品批号", },
  575. attr: {}
  576. },
  577. {
  578. item: { key: "manufactureDate", title: "生产日期", },
  579. attr: {}
  580. },
  581. {
  582. item: { key: "periodEndDate", title: "有效期至/失效日期", },
  583. attr: {}
  584. },
  585. {
  586. item: { key: "ratifyCode", title: "批准文号", },
  587. attr: {}
  588. },
  589. {
  590. item: { key: "registration", title: "注册证号", },
  591. attr: {}
  592. },
  593. {
  594. item: { key: "productCode", title: "商品名", },
  595. attr: {}
  596. },
  597. {
  598. item: { key: "commonCode", title: "通用名", },
  599. attr: {}
  600. },
  601. {
  602. item: { key: "drug", title: "剂型", },
  603. attr: {}
  604. },
  605. {
  606. item: { key: "customerLogistic", title: "客户物料码", },
  607. attr: {}
  608. },
  609. {
  610. item: { key: "customerLogisticName", title: "客户物料名称", },
  611. attr: {}
  612. },
  613. ]
  614. },
  615. ];
  616. return { FormColumns, TabColumns }
  617. }