index.ts 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. import request from '@/config/axios'
  2. // 设备台账 VO
  3. export interface IotDeviceVO {
  4. id: number // 主键id
  5. deviceCode: string // 资产编码
  6. deviceName: string // 设备名称
  7. brand: number // 品牌
  8. model: number // 规格型号
  9. deptId: number // 所在部门id
  10. deptName: string // 所在部门名称
  11. deviceStatus: string // 设备状态
  12. deviceStatusName: string // 设备状态名称
  13. assetProperty: string // 资产性质
  14. picUrl: string // 图片
  15. remark: string // 备注
  16. manufacturerId: number // 制造商id
  17. supplierId: number // 供应商id
  18. manDate: Date // 生产日期
  19. nameplate: string // 铭牌信息
  20. expires: number // 质保到期
  21. plPrice: number // 采购/租赁价格
  22. plDate: Date // 采购/租赁日期
  23. plYear: number // 折旧年限
  24. plStartDate: number // 折旧开始日期
  25. plMonthed: number // 已提折旧月数
  26. plAmounted: number // 已提折旧金额
  27. remainAmount: number // 剩余金额
  28. infoId: number // 资料分类id
  29. infoType: string // 资料类型
  30. infoName: string // 资料名称
  31. infoRemark: string // 资料备注
  32. infoUrl: string // 资料附件
  33. templateJson: string // 动态模板信息
  34. bomNodeId: number // bom节点id
  35. name: string // bom节点名称
  36. code: string // bom节点编码
  37. devicePersons: string // 设备责任人 逗号分隔
  38. location: string
  39. lat: number
  40. lng: number
  41. hasSetMaintenanceBom: boolean // 当前设备是否已经配置了保养BOM
  42. shouldWorkOrder: boolean // 当前设备根据保养规则应当生成保养工单
  43. runningWorkOrder: boolean // 当前设备是否已经有待执行的保养工单
  44. }
  45. // 设备台账 API
  46. export const IotDeviceApi = {
  47. getCompany: async (params: any) => {
  48. return await request.get({ url: `/rq/iot-device/company?id=` + params })
  49. },
  50. getCompanyByDevice: async (params: any) => {
  51. return await request.get({ url: `/rq/iot-device/company/` + params })
  52. },
  53. getMaxCode: async (params: any) => {
  54. return await request.get({ url: `/rq/iot-device/max?yfCode=` + params })
  55. },
  56. getMapDevice: async (params: any) => {
  57. return await request.get({ url: `/rq/iot-device/map`, params })
  58. },
  59. getAllDeviceParams: async (params: any) => {
  60. return await request.get({ url: `/rq/iot-device/all/params`, params })
  61. },
  62. // 查询设备台账分页
  63. getIotDevicePage: async (params: any) => {
  64. return await request.get({ url: `/rq/iot-device/page`, params })
  65. },
  66. getPlanDevicePage: async (params: any) => {
  67. return await request.get({ url: `/rq/iot-opeation-fill/planDevPage`, params })
  68. },
  69. // 获得设备关联责任人 分页
  70. responsiblePage: async (params: any) => {
  71. return await request.get({ url: `/rq/iot-device/responsiblePage`, params })
  72. },
  73. // 获得设备动态 分页
  74. deviceDynamicsPage: async (params: any) => {
  75. return await request.get({ url: `/rq/iot-device/deviceDynamicsPage`, params })
  76. },
  77. // 获得设备状态调整数据 分页
  78. statusRelationDevices: async (params: any) => {
  79. return await request.get({ url: `/rq/iot-device/statusRelationDevices`, params })
  80. },
  81. // 获得设备调拨数据 分页
  82. allotRelationDevices: async (params: any) => {
  83. return await request.get({ url: `/rq/iot-device/allotRelationDevices`, params })
  84. },
  85. // 获得设备关联责任人 分页
  86. simpleDevices: async (params: any) => {
  87. return await request.get({ url: `/rq/iot-device/simple-list`, params })
  88. },
  89. // 查询 设备bom关联 列表分页
  90. deviceAssociateBomPage: async (params: any) => {
  91. return await request.get({ url: `/rq/iot-device/deviceAssociateBomPage`, params })
  92. },
  93. // 项目-任务 根据选择的部门筛选设备 忽略数据权限
  94. getDevicesByDepts: async (params: any) => {
  95. return await request.get({ url: `/rq/iot-device/getDevicesByDepts`, params })
  96. },
  97. // 查询 设备 bom关联 列表
  98. deviceAssociateBomList: async (params: any) => {
  99. return await request.get({ url: `/rq/iot-device/deviceAssociateBomList`, params })
  100. },
  101. deviceAssociateBomListPage: async (params: any) => {
  102. return await request.get({ url: `/rq/iot-device/deviceAssociateBomListPage`, params })
  103. },
  104. // 查询设备台账详情
  105. getIotDevice: async (id: number) => {
  106. return await request.get({ url: `/rq/iot-device/get?id=` + id })
  107. },
  108. getIotDeviceTds: async (id: number) => {
  109. return await request.get({ url: `/rq/iot-device/get/gateway/td?id=` + id })
  110. },
  111. getIotDeviceZHBDTds: async (id: number) => {
  112. return await request.get({ url: `/rq/iot-device/get/zhbd/td?id=` + id })
  113. },
  114. // 新增设备台账
  115. createIotDevice: async (data: IotDeviceVO) => {
  116. return await request.post({ url: `/rq/iot-device/create`, data })
  117. },
  118. // 保存 设备-状态 的关联关系
  119. saveDeviceStatuses: async (data: any) => {
  120. return await request.post({ url: `/rq/iot-device/saveDeviceStatuses`, data })
  121. },
  122. // 保存 设备调拨记录
  123. saveDeviceAllot: async (data: any) => {
  124. return await request.post({ url: `/rq/iot-device/saveDeviceAllot`, data })
  125. },
  126. // 修改设备台账
  127. updateIotDevice: async (data: IotDeviceVO) => {
  128. return await request.put({ url: `/rq/iot-device/update`, data })
  129. },
  130. // 删除设备台账
  131. deleteIotDevice: async (id: number) => {
  132. return await request.delete({ url: `/rq/iot-device/delete?id=` + id })
  133. },
  134. // 导出设备台账 Excel
  135. exportIotDevice: async (params) => {
  136. return await request.download({ url: `/rq/iot-device/export-excel`, params })
  137. },
  138. exportIotDeviceAdjust: async (params) => {
  139. return await request.download({ url: `/pms/iot-device-status-log/export-excel`, params })
  140. },
  141. exportIotDevicePerson: async (params) => {
  142. return await request.download({ url: `/pms/iot-device-person-log/export-excel`, params })
  143. },
  144. exportIotDeviceAllot: async (params) => {
  145. return await request.download({ url: `/pms/iot-device-allot-log/export-excel`, params })
  146. },
  147. exportIotDeviceMainAlarm: async (params) => {
  148. return await request.download({ url: `/pms/iot-main-work-order/exportMaintenances`, params })
  149. },
  150. getIotDeviceTdPage: async (params: any) => {
  151. return await request.get({ url: `/rq/iot-device/td/page`, params })
  152. },
  153. getIotDeviceOliConnectPage: async (params: any) => {
  154. return await request.get({ url: `/rq/iot-device/td/ly/page`, params })
  155. },
  156. // 新增时根据部门id获取设备列表
  157. getIotDeviceSetOptions: async (id: any) => {
  158. return await request.get({ url: `/rq/iot-device/dept/${id}` })
  159. },
  160. // 设备总数量
  161. getIotDeviceCount: async (params: any) => {
  162. return await request.get({ url: `/rq/report/device/count`, params })
  163. },
  164. // 设备状态
  165. getIotDeviceStatus: async (params: any) => {
  166. return await request.get({ url: `/rq/report/device/status`, params })
  167. },
  168. // 分类top
  169. getIotDeviceClassify: async (params: any) => {
  170. return await request.get({ url: `/rq/report/device/type`, params })
  171. },
  172. // 列表
  173. getIotDeviceList: async (params: any) => {
  174. return await request.get({ url: `/rq/report/device/page`, params })
  175. },
  176. // 查看详情时获取成套设备列表
  177. getIotDeviceSets: async (params: any) => {
  178. return await request.get({ url: `/rq/iot-device-group-detail/page`, params })
  179. },
  180. // 获取成套列表
  181. getIotDeviceSetList: async (params: any) => {
  182. return await request.get({ url: `/rq/iot-device-group/page`, params })
  183. },
  184. // 添加成套
  185. createIotDeviceSet: async (data: any) => {
  186. return await request.post({ url: `/rq/iot-device-group/create`, data })
  187. },
  188. // 编辑成套
  189. updateIotDeviceSet: async (data: any) => {
  190. return await request.put({ url: `/rq/iot-device-group/update`, data })
  191. },
  192. // 删除成套
  193. deleteIotDeviceSet: async (id: number) => {
  194. return await request.delete({ url: `/rq/iot-device-group/delete?id=` + id })
  195. },
  196. // 获取关联设备
  197. getIotDeviceSetRelation: async (params) => {
  198. return await request.get({ url: `/rq/iot-device-group/device/group`, params })
  199. },
  200. // 设备报表导出
  201. exportDeviceReport: async (params) => {
  202. return await request.download({ url: `/rq/report/export-excel`, params })
  203. },
  204. // 获取成套设备参数
  205. getDeviceSetParams: async (id) => {
  206. return await request.get({ url: `/rq/iot-device-group/td/${id}` })
  207. }
  208. }