useTable.ts 22 KB

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