useTable.ts 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. import { Query } from '@/api/webApi'
  2. import { ellipsisCell } from '@/components/SimpleTable/customRender'
  3. import { CommonValue, CommonData, CommonTableColumn } from '~/common'
  4. const idGetter = (name: string) => {
  5. // if (name.endsWith('WaybillGoods')) {
  6. // return DATACONTENT_ID.waybillGoods
  7. // } else {
  8. // return DATACONTENT_ID[name.slice(0, 1).toLowerCase() + name.slice(1)]
  9. // }
  10. return DATACONTENT_ID[name.slice(0, 1).toLowerCase() + name.slice(1)]
  11. }
  12. const tableColumnsMap: {
  13. [tableName: string]: ({
  14. columnLabel: string
  15. columnName: string
  16. } & { [x: string]: any })[]
  17. } = {
  18. DepartureFlightContainer: [
  19. {
  20. columnLabel: '集装器编号',
  21. columnName: 'stowageNo',
  22. width: 120,
  23. needCount: 1,
  24. countMode: 'all',
  25. },
  26. { columnLabel: '配载运单', columnName: 'list', width: 60 },
  27. { columnLabel: '件数', columnName: 'number', width: 60, needCount: 1 },
  28. { columnLabel: '重量', columnName: 'weight', width: 60, needCount: 1 },
  29. {
  30. columnLabel: '拉下',
  31. columnName: 'pull',
  32. className: 'cell-filter cell-filter-yellow',
  33. },
  34. {
  35. columnLabel: '加货',
  36. columnName: 'tally',
  37. className: 'cell-filter cell-filter-yellow',
  38. },
  39. // {
  40. // columnLabel: '待运区',
  41. // columnName: 'wait',
  42. // className: 'cell-filter cell-filter-yellow',
  43. // },
  44. {
  45. columnLabel: '预配载',
  46. columnName: 'stowage',
  47. className: 'cell-filter cell-filter-yellow',
  48. },
  49. // {
  50. // columnLabel: '货站交接',
  51. // columnName: 'depot',
  52. // className: 'cell-filter cell-filter-yellow',
  53. // },
  54. {
  55. columnLabel: '交接复核',
  56. columnName: 'resure',
  57. className: 'cell-filter cell-filter-yellow',
  58. },
  59. {
  60. columnLabel: '机下交接',
  61. columnName: 'planeDown',
  62. className: 'cell-filter cell-filter-yellow',
  63. },
  64. {
  65. columnLabel: '装机',
  66. columnName: 'loadPlane',
  67. className: 'cell-filter cell-filter-yellow',
  68. },
  69. {
  70. columnLabel: '拉回确认',
  71. columnName: 'pullSure',
  72. className: 'cell-filter cell-filter-yellow',
  73. },
  74. ],
  75. DepartureFlightWaybill: [
  76. { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
  77. { columnLabel: '集装器数量', columnName: 'stowageNum' },
  78. {
  79. columnLabel: '品名',
  80. columnName: 'typeCode',
  81. width: 300,
  82. showOverflowTooltip: true,
  83. },
  84. {
  85. columnLabel: '特货信息',
  86. columnName: 'speCargoInfo',
  87. customRender: ellipsisCell,
  88. },
  89. { columnLabel: '运单件数', columnName: 'luggageCount', needCount: 1 },
  90. { columnLabel: '货物重量', columnName: 'weight', needCount: 1 },
  91. { columnLabel: '拉下件数', columnName: 'pullNum', needCount: 1 },
  92. { columnLabel: '退运件数', columnName: 'returnNum', needCount: 1 },
  93. { columnLabel: '最新节点', columnName: 'nodeCode' },
  94. // { columnLabel: '最新位置', columnName: 'execPosition' },
  95. { columnLabel: '处理结果', columnName: 'execResult' },
  96. { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
  97. // { columnLabel: '中转进航班号', columnName: 'inFlightNO' },
  98. // {
  99. // columnLabel: '中转航班降落时间',
  100. // columnName: 'inFlightNOLandTime',
  101. // width: 130,
  102. // },
  103. // { columnLabel: '装载序号', columnName: 'queueNo' },
  104. ],
  105. DepartureWaybillGoods: [
  106. {
  107. columnLabel: '航班号',
  108. columnName: 'flightNO',
  109. needFilters: 1,
  110. width: 70,
  111. },
  112. {
  113. columnLabel: '集装器编号',
  114. columnName: 'ULDNO',
  115. width: 100,
  116. needFilters: 1,
  117. },
  118. { columnLabel: '货物编码', columnName: 'cargoSN', needFilters: 1 },
  119. { columnLabel: '拉下', columnName: 'pullMark', needFilters: 1, width: 60 },
  120. {
  121. columnLabel: '退运',
  122. columnName: 'returnMark',
  123. needFilters: 1,
  124. width: 60,
  125. },
  126. {
  127. columnLabel: '收货核单',
  128. columnName: 'DEH',
  129. className: 'cell-filter cell-filter-green node-departure',
  130. },
  131. {
  132. columnLabel: '收运核查',
  133. columnName: 'ACC_CHECK',
  134. className: 'cell-filter cell-filter-green node-departure',
  135. },
  136. // {
  137. // columnLabel: '拒运',
  138. // columnName: 'ACC_CHECK_2',
  139. // className: 'cell-filter cell-filter-green node-departure',
  140. // },
  141. {
  142. columnLabel: '安检',
  143. columnName: '安检',
  144. className: 'cell-filter cell-filter-green node-departure',
  145. },
  146. {
  147. columnLabel: '加货',
  148. columnName: 'ACC_BUP',
  149. className: 'cell-filter cell-filter-green node-departure',
  150. },
  151. {
  152. columnLabel: '预配载',
  153. columnName: 'LS_CARGO',
  154. className: 'cell-filter cell-filter-green node-departure',
  155. },
  156. // {
  157. // columnLabel: '待运区',
  158. // columnName: 'WAT_LOC',
  159. // className: 'cell-filter cell-filter-green node-departure',
  160. // },
  161. // {
  162. // columnLabel: '货站交接',
  163. // columnName: 'CARGOS_HANDOVER_STATUS_02',
  164. // className: 'cell-filter cell-filter-green node-departure',
  165. // },
  166. {
  167. columnLabel: '交接复核',
  168. columnName: 'CARGOS_HANDOVER_STATUS_03',
  169. className: 'cell-filter cell-filter-green node-departure',
  170. },
  171. {
  172. columnLabel: '机下交接',
  173. columnName: '出港货邮',
  174. className: 'cell-filter cell-filter-green node-departure',
  175. },
  176. {
  177. columnLabel: '装机',
  178. columnName: '装载完成',
  179. className: 'cell-filter cell-filter-green node-departure',
  180. },
  181. {
  182. columnLabel: '关闭舱门',
  183. columnName: '关闭舱门',
  184. className: 'cell-filter cell-filter-green node-departure',
  185. },
  186. {
  187. columnLabel: '拉下登记',
  188. columnName: 'CARGOS_OFFLOAD',
  189. className: 'cell-filter cell-filter-green node-departure',
  190. checkDisabled: true,
  191. },
  192. {
  193. columnLabel: '拉回确认',
  194. columnName: 'OFFLOAD_CONFIRM',
  195. className: 'cell-filter cell-filter-green node-departure',
  196. checkDisabled: true,
  197. },
  198. // {
  199. // columnLabel: '起飞',
  200. // columnName: 'C15',
  201. // className: 'cell-filter cell-filter-green node-departure',
  202. // },
  203. {
  204. columnLabel: '退运',
  205. columnName: 'BILL_RETURN',
  206. className: 'cell-filter cell-filter-green node-departure',
  207. },
  208. {
  209. columnLabel: '卸机',
  210. columnName: 'CARGOS_ARR_HANDOVER',
  211. className: 'cell-filter cell-filter-cyan node-arrival',
  212. },
  213. {
  214. columnLabel: '库区到达',
  215. columnName: 'CARGOS_HANDOVER_STATUS_01',
  216. className: 'cell-filter cell-filter-cyan node-arrival',
  217. },
  218. {
  219. columnLabel: '货站交接',
  220. columnName: '货站交接',
  221. className: 'cell-filter cell-filter-cyan node-arrival',
  222. },
  223. {
  224. columnLabel: '理货',
  225. columnName: 'IMP_TALLY',
  226. className: 'cell-filter cell-filter-cyan node-arrival',
  227. },
  228. {
  229. columnLabel: '出库',
  230. columnName: 'FSUDLV',
  231. className: 'cell-filter cell-filter-cyan node-arrival',
  232. },
  233. ],
  234. DepartureGoodsFlight: [
  235. { columnLabel: '航班号', columnName: 'C0' },
  236. { columnLabel: '航班日期', columnName: 'C1' },
  237. { columnLabel: '起飞航站\n预计起飞时间', columnName: 'C2' },
  238. { columnLabel: '目的航站\n预计降落时间', columnName: 'C3' },
  239. { columnLabel: '节点名称', columnName: 'C4' },
  240. { columnLabel: '位置码', columnName: 'C5' },
  241. { columnLabel: '位置描述', columnName: 'C6' },
  242. { columnLabel: '处理时间', columnName: 'C7' },
  243. { columnLabel: '处理结果', columnName: 'C8' },
  244. { columnLabel: '数据来源', columnName: 'C9' },
  245. { columnLabel: '设备ID', columnName: 'C10' },
  246. { columnLabel: '操作人', columnName: 'C11' },
  247. { columnLabel: '发往位置', columnName: 'C12' },
  248. { columnLabel: '发往位置描述', columnName: 'C13' },
  249. { columnLabel: '集装器编号', columnName: 'C14' },
  250. ],
  251. ArrivalFlightWaybill: [
  252. { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
  253. {
  254. columnLabel: '品名',
  255. columnName: 'typeCode',
  256. width: 300,
  257. showOverflowTooltip: true,
  258. },
  259. {
  260. columnLabel: '特货信息',
  261. columnName: 'speCargoInfo',
  262. needCount: 1,
  263. customRender: ellipsisCell,
  264. },
  265. {
  266. columnLabel: '运单件数',
  267. columnName: 'messageCargos_in',
  268. needCount: 1,
  269. },
  270. {
  271. columnLabel: '理货件数',
  272. columnName: 'acCargos_in',
  273. needCount: 1,
  274. },
  275. {
  276. columnLabel: '货物重量',
  277. columnName: 'weight',
  278. needCount: 1,
  279. },
  280. { columnLabel: '最新节点', columnName: 'nodeCode' },
  281. // { columnLabel: '最新位置', columnName: 'execPosition' },
  282. { columnLabel: '处理结果', columnName: 'execResult' },
  283. { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
  284. // { columnLabel: '中转出航班号', columnName: 'transferFlightNO' },
  285. // {
  286. // columnLabel: '中转航班起飞时间',
  287. // columnName: 'transferFlightDepTime',
  288. // width: 130,
  289. // },
  290. // { columnLabel: '装载序号', columnName: 'queueNo' },
  291. ],
  292. ArrivalWaybillGoods: [
  293. {
  294. columnLabel: '航班号',
  295. columnName: 'flightNO',
  296. needFilters: 1,
  297. width: 70,
  298. },
  299. {
  300. columnLabel: '货物编码',
  301. columnName: 'cargoSN',
  302. needFilters: 1,
  303. width: 100,
  304. },
  305. // { columnLabel: '中转', columnName: 'transMark', needFilters: 1 },
  306. { columnLabel: '拉下', columnName: 'pullMark', needFilters: 1, width: 60 },
  307. {
  308. columnLabel: '退运',
  309. columnName: 'returnMark',
  310. needFilters: 1,
  311. width: 60,
  312. },
  313. {
  314. columnLabel: '卸机',
  315. columnName: 'CARGOS_ARR_HANDOVER',
  316. className: 'cell-filter cell-filter-cyan node-arrival',
  317. },
  318. {
  319. columnLabel: '库区到达',
  320. columnName: 'CARGOS_HANDOVER_STATUS_01',
  321. className: 'cell-filter cell-filter-cyan node-arrival',
  322. },
  323. {
  324. columnLabel: '货站交接',
  325. columnName: 'CARGOS_HANDOVER_STATUS_99',
  326. className: 'cell-filter cell-filter-cyan node-arrival',
  327. },
  328. {
  329. columnLabel: '理货',
  330. columnName: 'IMP_TALLY',
  331. className: 'cell-filter cell-filter-cyan node-arrival',
  332. },
  333. {
  334. columnLabel: '出库',
  335. columnName: 'FSUDLV',
  336. className: 'cell-filter cell-filter-cyan node-arrival',
  337. },
  338. {
  339. columnLabel: '收货核单',
  340. columnName: 'DEH',
  341. className: 'cell-filter cell-filter-green node-departure',
  342. },
  343. {
  344. columnLabel: '查验',
  345. columnName: 'ACC_CHECK',
  346. className: 'cell-filter cell-filter-green node-departure',
  347. },
  348. // {
  349. // columnLabel: '拒运',
  350. // columnName: 'ACC_CHECK_2',
  351. // className: 'cell-filter cell-filter-green node-departure',
  352. // },
  353. {
  354. columnLabel: '安检',
  355. columnName: '安检',
  356. className: 'cell-filter cell-filter-green node-departure',
  357. },
  358. {
  359. columnLabel: '加货',
  360. columnName: 'ACC_BUP',
  361. className: 'cell-filter cell-filter-green node-departure',
  362. },
  363. {
  364. columnLabel: '预配载',
  365. columnName: 'LS_CARGO',
  366. className: 'cell-filter cell-filter-green node-departure',
  367. },
  368. // {
  369. // columnLabel: '待运区',
  370. // columnName: 'WAT_LOC',
  371. // className: 'cell-filter cell-filter-green node-departure',
  372. // },
  373. // {
  374. // columnLabel: '货站交接',
  375. // columnName: 'CARGOS_HANDOVER_STATUS_02',
  376. // className: 'cell-filter cell-filter-green node-departure',
  377. // },
  378. {
  379. columnLabel: '交接复核',
  380. columnName: 'CARGOS_HANDOVER_STATUS_03',
  381. className: 'cell-filter cell-filter-green node-departure',
  382. },
  383. {
  384. columnLabel: '机下交接',
  385. columnName: '出港货邮',
  386. className: 'cell-filter cell-filter-green node-departure',
  387. },
  388. {
  389. columnLabel: '装机',
  390. columnName: '装载完成',
  391. className: 'cell-filter cell-filter-green node-departure',
  392. },
  393. {
  394. columnLabel: '关闭舱门',
  395. columnName: '关闭舱门',
  396. className: 'cell-filter cell-filter-green node-departure',
  397. },
  398. {
  399. columnLabel: '拉下登记',
  400. columnName: 'CARGOS_OFFLOAD',
  401. className: 'cell-filter cell-filter-green node-departure',
  402. checkDisabled: true,
  403. },
  404. {
  405. columnLabel: '拉回确认',
  406. columnName: 'OFFLOAD_CONFIRM',
  407. className: 'cell-filter cell-filter-green node-departure',
  408. checkDisabled: true,
  409. },
  410. // {
  411. // columnLabel: '起飞',
  412. // columnName: 'C15',
  413. // className: 'cell-filter cell-filter-green node-departure',
  414. // },
  415. {
  416. columnLabel: '退运',
  417. columnName: 'BILL_RETURN',
  418. className: 'cell-filter cell-filter-green node-departure',
  419. },
  420. ],
  421. ArrivalGoodsFlight: [
  422. { columnLabel: '航班号', columnName: 'C0' },
  423. { columnLabel: '航班日期', columnName: 'C1' },
  424. { columnLabel: '起飞航站\n预计起飞时间', columnName: 'C2' },
  425. { columnLabel: '目的航站\n预计降落时间', columnName: 'C3' },
  426. { columnLabel: '节点名称', columnName: 'C4' },
  427. { columnLabel: '位置码', columnName: 'C5' },
  428. { columnLabel: '位置描述', columnName: 'C6' },
  429. { columnLabel: '处理时间', columnName: 'C7' },
  430. { columnLabel: '处理结果', columnName: 'C8' },
  431. { columnLabel: '数据来源', columnName: 'C9' },
  432. { columnLabel: '设备ID', columnName: 'C10' },
  433. { columnLabel: '操作人', columnName: 'C11' },
  434. { columnLabel: '发往位置', columnName: 'C12' },
  435. { columnLabel: '发往位置描述', columnName: 'C13' },
  436. ],
  437. InternationalDepartureFlightContainer: [
  438. {
  439. columnLabel: '集装器编号',
  440. columnName: 'stowageNo',
  441. width: 120,
  442. needCount: 1,
  443. countMode: 'all',
  444. },
  445. { columnLabel: '配载运单', columnName: 'list', width: 60 },
  446. { columnLabel: '件数', columnName: 'number', width: 60, needCount: 1 },
  447. { columnLabel: '重量', columnName: 'weight', width: 60, needCount: 1 },
  448. {
  449. columnLabel: '拉下',
  450. columnName: 'pull',
  451. className: 'cell-filter cell-filter-yellow',
  452. },
  453. {
  454. columnLabel: '理货',
  455. columnName: 'tally',
  456. className: 'cell-filter cell-filter-yellow',
  457. },
  458. // {
  459. // columnLabel: '待运区',
  460. // columnName: 'wait',
  461. // className: 'cell-filter cell-filter-yellow',
  462. // },
  463. // {
  464. // columnLabel: '货站交接',
  465. // columnName: 'depot',
  466. // className: 'cell-filter cell-filter-yellow',
  467. // },
  468. {
  469. columnLabel: '交接复核',
  470. columnName: 'resure',
  471. className: 'cell-filter cell-filter-yellow',
  472. },
  473. {
  474. columnLabel: '机下交接',
  475. columnName: 'planeDown',
  476. className: 'cell-filter cell-filter-yellow',
  477. },
  478. {
  479. columnLabel: '装机',
  480. columnName: 'loadPlane',
  481. className: 'cell-filter cell-filter-yellow',
  482. },
  483. {
  484. columnLabel: '实配',
  485. columnName: 'stowage',
  486. className: 'cell-filter cell-filter-yellow',
  487. },
  488. // {
  489. // columnLabel: '拉回确认',
  490. // columnName: 'pullSure',
  491. // className: 'cell-filter cell-filter-yellow',
  492. // },
  493. ],
  494. InternationalDepartureFlightWaybill: [
  495. { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
  496. { columnLabel: '分类', columnName: 'type' },
  497. { columnLabel: '集装器数量', columnName: 'stowageNum' },
  498. {
  499. columnLabel: '品名',
  500. columnName: 'typeCode',
  501. width: 300,
  502. showOverflowTooltip: true,
  503. },
  504. {
  505. columnLabel: '特货信息',
  506. columnName: 'speCargoInfo',
  507. customRender: ellipsisCell,
  508. },
  509. { columnLabel: '运单件数', columnName: 'luggageCount', needCount: 1 },
  510. { columnLabel: '货物重量', columnName: 'weight', needCount: 1 },
  511. { columnLabel: '拉下件数', columnName: 'pullNum', needCount: 1 },
  512. { columnLabel: '退运件数', columnName: 'returnNum', needCount: 1 },
  513. { columnLabel: '最新节点', columnName: 'nodeCode' },
  514. // { columnLabel: '最新位置', columnName: 'execPosition' },
  515. { columnLabel: '处理结果', columnName: 'execResult' },
  516. { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
  517. // { columnLabel: '中转进航班号', columnName: 'inFlightNO' },
  518. // {
  519. // columnLabel: '中转航班降落时间',
  520. // columnName: 'inFlightNOLandTime',
  521. // width: 130,
  522. // },
  523. // { columnLabel: '装载序号', columnName: 'queueNo' },
  524. ],
  525. InternationalDepartureWaybillGoods: [
  526. {
  527. columnLabel: '航班号',
  528. columnName: 'flightNO',
  529. needFilters: 1,
  530. width: 70,
  531. },
  532. {
  533. columnLabel: '集装器编号',
  534. columnName: 'ULDNO',
  535. width: 100,
  536. needFilters: 1,
  537. },
  538. { columnLabel: '货物编码', columnName: 'cargoSN', needFilters: 1 },
  539. { columnLabel: '拉下', columnName: 'pullMark', needFilters: 1, width: 60 },
  540. {
  541. columnLabel: '退运',
  542. columnName: 'returnMark',
  543. needFilters: 1,
  544. width: 60,
  545. },
  546. {
  547. columnLabel: '入园',
  548. columnName: 'EPORTREL',
  549. className: 'cell-filter cell-filter-green node-departure',
  550. },
  551. {
  552. columnLabel: '海关',
  553. columnName: 'MTREL_out',
  554. className: 'cell-filter cell-filter-green node-departure',
  555. },
  556. {
  557. columnLabel: '运抵',
  558. columnName: 'FOH',
  559. className: 'cell-filter cell-filter-green node-departure',
  560. },
  561. {
  562. columnLabel: '安检',
  563. columnName: 'REH',
  564. className: 'cell-filter cell-filter-green node-departure',
  565. },
  566. {
  567. columnLabel: '收运核单',
  568. columnName: 'RCS',
  569. className: 'cell-filter cell-filter-green node-departure',
  570. },
  571. {
  572. columnLabel: '理货',
  573. columnName: 'ACC_BUP',
  574. className: 'cell-filter cell-filter-green node-departure',
  575. },
  576. // {
  577. // columnLabel: '待运区',
  578. // columnName: 'WAT_LOC',
  579. // className: 'cell-filter cell-filter-green node-departure',
  580. // },
  581. // {
  582. // columnLabel: '货站交接',
  583. // columnName: 'CARGOS_HANDOVER_STATUS_02',
  584. // className: 'cell-filter cell-filter-green node-departure',
  585. // },
  586. {
  587. columnLabel: '交接复核',
  588. columnName: 'CARGOS_HANDOVER_STATUS_03',
  589. className: 'cell-filter cell-filter-green node-departure',
  590. },
  591. {
  592. columnLabel: '机下交接',
  593. columnName: '出港货邮',
  594. className: 'cell-filter cell-filter-green node-departure',
  595. },
  596. {
  597. columnLabel: '装机',
  598. columnName: '装载完成',
  599. className: 'cell-filter cell-filter-green node-departure',
  600. },
  601. {
  602. columnLabel: '拉下',
  603. columnName: 'CARGOS_OFFLOAD',
  604. className: 'cell-filter cell-filter-green node-departure',
  605. checkDisabled: true,
  606. },
  607. {
  608. columnLabel: '实配',
  609. columnName: 'LS_CARGO',
  610. className: 'cell-filter cell-filter-green node-departure',
  611. },
  612. ],
  613. InternationalDepartureGoodsFlight: [
  614. { columnLabel: '航班号', columnName: 'C0' },
  615. { columnLabel: '航班日期', columnName: 'C1' },
  616. { columnLabel: '起飞航站\n预计起飞时间', columnName: 'C2' },
  617. { columnLabel: '目的航站\n预计降落时间', columnName: 'C3' },
  618. { columnLabel: '节点名称', columnName: 'C4' },
  619. { columnLabel: '位置码', columnName: 'C5' },
  620. { columnLabel: '位置描述', columnName: 'C6' },
  621. { columnLabel: '处理时间', columnName: 'C7' },
  622. { columnLabel: '处理结果', columnName: 'C8' },
  623. { columnLabel: '数据来源', columnName: 'C9' },
  624. { columnLabel: '设备ID', columnName: 'C10' },
  625. { columnLabel: '操作人', columnName: 'C11' },
  626. { columnLabel: '发往位置', columnName: 'C12' },
  627. { columnLabel: '发往位置描述', columnName: 'C13' },
  628. { columnLabel: '集装器编号', columnName: 'C14' },
  629. ],
  630. InternationalArrivalFlightWaybill: [
  631. { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
  632. {
  633. columnLabel: '品名',
  634. columnName: 'typeCode',
  635. width: 160,
  636. showOverflowTooltip: true,
  637. },
  638. {
  639. columnLabel: '特货信息',
  640. columnName: 'speCargoInfo',
  641. needCount: 1,
  642. customRender: ellipsisCell,
  643. },
  644. {
  645. columnLabel: '运单件数',
  646. columnName: 'messageCargos_in',
  647. needCount: 1,
  648. },
  649. {
  650. columnLabel: '理货件数',
  651. columnName: 'acCargos_in',
  652. needCount: 1,
  653. },
  654. {
  655. columnLabel: '货物重量',
  656. columnName: 'weight',
  657. needCount: 1,
  658. },
  659. { columnLabel: '最新节点', columnName: 'nodeCode' },
  660. // { columnLabel: '最新位置', columnName: 'execPosition' },
  661. { columnLabel: '处理结果', columnName: 'execResult' },
  662. { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
  663. { columnLabel: '中转出航班号', columnName: 'transferFlightNO' },
  664. {
  665. columnLabel: '中转航班起飞时间',
  666. columnName: 'transferFlightDepTime',
  667. width: 130,
  668. },
  669. { columnLabel: '装载序号', columnName: 'queueNo' },
  670. ],
  671. InternationalArrivalWaybillGoods: [
  672. {
  673. columnLabel: '航班号',
  674. columnName: 'flightNO',
  675. needFilters: 1,
  676. width: 70,
  677. },
  678. {
  679. columnLabel: '货物编码',
  680. columnName: 'cargoSN',
  681. needFilters: 1,
  682. width: 100,
  683. },
  684. // { columnLabel: '中转', columnName: 'C2', needFilters: 1 },
  685. {
  686. columnLabel: '退运',
  687. columnName: 'returnMark',
  688. needFilters: 1,
  689. width: 60,
  690. },
  691. {
  692. columnLabel: '海关异常',
  693. columnName: 'exceptionCustomsMark',
  694. needFilters: 1,
  695. width: 60,
  696. },
  697. {
  698. columnLabel: '卸机',
  699. columnName: 'FFM',
  700. className: 'cell-filter cell-filter-green node-departure',
  701. },
  702. {
  703. columnLabel: '机下交接',
  704. columnName: 'CARGOS_HANDOVER_STATUS_01',
  705. className: 'cell-filter cell-filter-green node-departure',
  706. },
  707. {
  708. columnLabel: '货站交接',
  709. columnName: 'CARGOS_HANDOVER_STATUS_99',
  710. className: 'cell-filter cell-filter-green node-departure',
  711. },
  712. {
  713. columnLabel: '理货',
  714. columnName: 'RCF报',
  715. className: 'cell-filter cell-filter-green node-departure',
  716. },
  717. {
  718. columnLabel: '海关放行',
  719. columnName: 'MTREL_in',
  720. className: 'cell-filter cell-filter-green node-departure',
  721. },
  722. {
  723. columnLabel: '出库',
  724. columnName: 'DLV报',
  725. className: 'cell-filter cell-filter-green node-departure',
  726. },
  727. // {
  728. // columnLabel: '海关罚没',
  729. // columnName: 'C11',
  730. // className: 'cell-filter cell-filter-green node-departure',
  731. // },
  732. ],
  733. InternationalArrivalGoodsFlight: [
  734. { columnLabel: '航班号', columnName: 'C0' },
  735. { columnLabel: '航班日期', columnName: 'C1' },
  736. { columnLabel: '起飞航站\n预计起飞时间', columnName: 'C2' },
  737. { columnLabel: '目的航站\n预计降落时间', columnName: 'C3' },
  738. { columnLabel: '节点名称', columnName: 'C4' },
  739. { columnLabel: '位置码', columnName: 'C5' },
  740. { columnLabel: '位置描述', columnName: 'C6' },
  741. { columnLabel: '处理时间', columnName: 'C7' },
  742. { columnLabel: '处理结果', columnName: 'C8' },
  743. { columnLabel: '数据来源', columnName: 'C9' },
  744. { columnLabel: '设备ID', columnName: 'C10' },
  745. { columnLabel: '操作人', columnName: 'C11' },
  746. { columnLabel: '发往位置', columnName: 'C12' },
  747. { columnLabel: '发往位置描述', columnName: 'C13' },
  748. ],
  749. }
  750. export function useTable(tableName: string, dataContent?: CommonValue[]) {
  751. const tableColumns = ref<CommonTableColumn[]>([])
  752. const tableData = ref<CommonData[]>([])
  753. const getTableColumns = () => {
  754. tableColumns.value = tableColumnsMap[tableName].map(column => ({
  755. columnDescribe: '',
  756. dataType: '',
  757. listqueryTemplateID: null,
  758. needCount: null,
  759. needFilters: null,
  760. needGroup: null,
  761. needSearch: null,
  762. needShow: 1,
  763. needSort: null,
  764. orderNumber: null,
  765. queryTemplateColumnSetID: null,
  766. queryTemplateID: null,
  767. ...column,
  768. }))
  769. }
  770. const getTableData = async () => {
  771. if (!idGetter(tableName)) {
  772. return
  773. }
  774. try {
  775. const {
  776. code,
  777. returnData: { listValues },
  778. message,
  779. } = await Query<CommonData>({
  780. id: idGetter(tableName),
  781. dataContent,
  782. })
  783. if (Number(code) !== 0) {
  784. throw new Error(message || '失败')
  785. }
  786. tableData.value = listValues.filter(
  787. row =>
  788. !Object.values(row).some(
  789. cellValue =>
  790. typeof cellValue === 'string' && cellValue.includes('undefined')
  791. )
  792. )
  793. } catch (error) {
  794. console.error(error)
  795. }
  796. }
  797. onMounted(() => {
  798. if (tableColumnsMap[tableName]) {
  799. getTableColumns()
  800. // getTableData()
  801. }
  802. })
  803. return {
  804. tableColumns,
  805. tableData,
  806. getTableData,
  807. }
  808. }