hotDelivery.api.ts 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. import { defHttp } from '/@/utils/http/axios';
  2. import { useMessage } from '/@/hooks/web/useMessage';
  3. import { NEED_SHOW_LAYER_POSITION } from './common.data';
  4. const { createConfirm } = useMessage();
  5. enum Api {
  6. list = '/billetHotsendBase/billetHotsendBase/list',
  7. editCell = '/billetHotsendBase/billetHotsendBase/editDesc',
  8. deleteOne = '/billetHotsendBase/billetHotsendBase/delete',
  9. deleteBatch = '/billetHotsendBase/billetHotsendBase/deleteBatch',
  10. queryBilletNameList = '/actualControl/billetActual/queryBilletNameList',
  11. // 编辑炉次信息
  12. editRulerInfo = '/rulerDefaultConfig/rulerDefaultConfig/add',
  13. // 获取班次基础信息
  14. getRulerDefaultConfig = '/billetHotsend/billetHotsendChangeShift/queryByCcmNo',
  15. // 交班
  16. changeShift = '/billetHotsend/billetHotsendChangeShift/add',
  17. // 编辑班次
  18. editShift = '/billetHotsend/billetHotsendChangeShift/edit',
  19. // 获取定尺信息
  20. getBilletLength = '/actualControl/billetActual/queryBilletLength',
  21. // 获取棒线结束根
  22. queryEndNumByCcmNo = '/billetHotsendBase/billetHotsendBase/queryEndNumByCcmNo',
  23. // 获取车辆信息
  24. carList = '/storageBill/queryNoDepartByCastMachine',
  25. // 棒线保存
  26. rodLineAdd = '/billetHotsendBase/billetHotsendBase/add',
  27. // 发车
  28. depart = '/billetHotsendBase/billetHotsendBase/rodLineDepart',
  29. // 获取棒线车辆
  30. rodLineCarList = '/storageBill/queryNoDepartByCcmNo',
  31. // 明细
  32. rollcluboneNum = '/rollClubOneDetails/list',
  33. rollclubtwoNum = '/rollClubTwoDetails/list',
  34. rollclubthreeNum = '/rollClubThreeDetails/list',
  35. rollheightNum = '/rollHeightDetails/list',
  36. rolloutshippNum = '/rollOutShippDetails/list',
  37. stackNum = '/billet/stackingAndLoadingVehicles/list',
  38. wasteNum = '/billetHotsend/billetHotsendAbandons/list',
  39. // 获取堆垛信息
  40. stackInfo = '/billet/stackingAndLoadingVehicles/getListByTypeConfigId',
  41. // 上堆垛保存
  42. stackSave = '/billet/stackingAndLoadingVehicles/addStacking',
  43. // 堆垛装车保存
  44. stackLoadSave = '/billet/stackingAndLoadingVehicles/loading',
  45. // 堆垛装车发车
  46. stackLoadDepart = '/billet/stackingAndLoadingVehicles/stackDepart',
  47. // 判废
  48. deleteJunk = '/billet/stackingAndLoadingVehicles/judgeDiscard',
  49. // 新增热线基础信息
  50. addBilletHotsendInfo = '/billetHotsendBase/billetHotsendBase/addBilletHotsendInfo',
  51. // 查询车辆是否装运过堆垛信息
  52. queryCarHasStackBillet = '/stackingDownLog/stackingDownLog/queryByStorageBillId',
  53. // 导出接口
  54. exportXls = '/billetHotsendBase/billetHotsendBase/exportExcel',
  55. // 堆垛更换位置
  56. stackLocationChange = '/billet/stackingAndLoadingVehicles/stackLocationChange',
  57. }
  58. /**
  59. * 导出api
  60. * @param params
  61. */
  62. export const getExportUrl = Api.exportXls;
  63. /**
  64. * 列表接口
  65. * @param params
  66. */
  67. export const list = (params) => defHttp.get({ url: Api.list, params });
  68. export const editCell = (params) => {
  69. return defHttp.put({ url: Api.editCell, params }, { joinParamsToUrl: true });
  70. };
  71. /**
  72. * 删除单个
  73. * @param params
  74. * @param handleSuccess
  75. */
  76. export const deleteOne = (params, handleSuccess) => {
  77. return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
  78. handleSuccess();
  79. });
  80. };
  81. /**
  82. * 批量删除
  83. * @param params
  84. * @param handleSuccess
  85. */
  86. export const batchDelete = (params, handleSuccess) => {
  87. createConfirm({
  88. iconType: 'warning',
  89. title: '确认删除',
  90. content: '是否删除选中数据',
  91. okText: '确认',
  92. cancelText: '取消',
  93. onOk: () => {
  94. return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
  95. handleSuccess();
  96. });
  97. },
  98. });
  99. };
  100. // 根据铸机获取铸机下所属棒线和堆垛
  101. export const queryBilletNameList = (params) => defHttp.get({ url: Api.queryBilletNameList, params });
  102. // 获取当前炉次基本配置信息
  103. export const getRulerDefaultConfig = (params) => defHttp.get({ url: Api.getRulerDefaultConfig, params }, { joinParamsToUrl: true });
  104. // 编辑炉次信息
  105. export const editRulerDefaultConfig = (params) => defHttp.post({ url: Api.editRulerInfo, params }, { joinParamsToUrl: true });
  106. // 获取定尺信息
  107. export const getBilletLength = (params) => defHttp.get({ url: Api.getBilletLength, params }, { joinParamsToUrl: true });
  108. // 获取棒线结束根
  109. export const getEndLine = (params) => defHttp.get({ url: Api.queryEndNumByCcmNo, params }, { joinParamsToUrl: true });
  110. // 获取车辆信息
  111. export const getCarList = (params) => defHttp.get({ url: Api.carList, params }, { joinParamsToUrl: true });
  112. // 棒线保存
  113. export const rodLineAdd = (params) => defHttp.post({ url: Api.rodLineAdd, params });
  114. // 交班
  115. export const changeShift = (params) => defHttp.post({ url: Api.changeShift, params });
  116. // 编辑班次
  117. export const editShift = (params) => defHttp.post({ url: Api.editShift, params });
  118. // 发车
  119. export const depart = (params) => defHttp.post({ url: Api.depart, params });
  120. // 明细
  121. export const getDetails = (params) => {
  122. const { table } = params;
  123. const p = { ...params, ...(NEED_SHOW_LAYER_POSITION.includes(table) ? { column: 'createTime' } : {}) };
  124. delete p.table;
  125. return defHttp.get({ url: Api[table], params: p });
  126. };
  127. // 获取堆垛信息
  128. export const getStackInfo = (params) => defHttp.get({ url: Api.stackInfo, params });
  129. // 上堆垛保存
  130. export const stackSave = (params) => defHttp.post({ url: Api.stackSave, params });
  131. // 堆垛装车保存
  132. export const stackLoadSave = (params) => defHttp.post({ url: Api.stackLoadSave, params });
  133. // 堆垛装车发车
  134. export const stackLoadDepart = (params) => defHttp.post({ url: Api.stackLoadDepart, params });
  135. // 获取棒线车辆
  136. export const getRodLineCarList = (params) => defHttp.get({ url: Api.rodLineCarList, params });
  137. // 判废
  138. export const deleteJunk = (params) => defHttp.post({ url: Api.deleteJunk, params });
  139. // 新增热线基础信息
  140. export const addBilletHotsendInfo = (params) => defHttp.post({ url: Api.addBilletHotsendInfo, params });
  141. // 查询车辆是否装运过堆垛信息
  142. export const getCarHasStackBillet = (params) => defHttp.get({ url: Api.queryCarHasStackBillet, params }, { joinParamsToUrl: true });
  143. // 堆垛更换位置
  144. export const stackLocationChange = (params) => defHttp.post({ url: Api.stackLocationChange, params });