固定资产项目前端文件
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

865 lines
26 KiB

2 years ago
import { HttpClient } from '@angular/common/http'
2 years ago
import { Injectable } from '@angular/core'
2 years ago
import { JwResponse } from 'app/types'
2 years ago
import { Utils } from 'app/utils'
1 year ago
import { map, of, tap } from 'rxjs'
2 years ago
import { AuthDTO } from './api.dto'
2 years ago
import { PermissionService } from 'app/shared/permission/permission.service'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
2 years ago
export interface UserGroupTreeItem {
name: string
id: string
parentId: string
children: UserGroupTreeItem[]
}
@Injectable({
providedIn: 'root',
})
export class ApiService {
constructor(
private http: HttpClient,
private permission: PermissionService,
) {}
AUTH_KEY_NAME = 'auth'
2 years ago
get authInfo(): AuthDTO | null {
let authInfo: AuthDTO | null = null
try {
const strData = localStorage.getItem(this.AUTH_KEY_NAME)
if (strData) {
authInfo = JSON.parse(strData)
}
} catch (error) {}
return authInfo
2 years ago
}
2 years ago
getAuthInfo() {
return of(Boolean(this.authInfo))
}
removeAuthData() {
localStorage.removeItem(this.AUTH_KEY_NAME)
2 years ago
}
upload(data: FormData) {
return this.http.post<JwResponse>('/api/common/upload', data)
2 years ago
}
1 year ago
_displayConfig: any
setSysDisplayConfig(d: {}) {
return this.http.post<JwResponse>(`/api/sysConfig/update/displaySettings`, d)
}
getSysDisplayConfig(force: boolean = false) {
if (force || !this._displayConfig) {
return this.http.post<JwResponse>(`/api/sysConfig/query/displaySettings`, null).pipe(
map((i) => i.body),
tap((res) => {
this._displayConfig = res.body
}),
)
}
return of(this._displayConfig)
}
2 years ago
getLicenseInfo() {
return this.http.post<JwResponse>('/api/license/info', null)
}
uploadLicenseInfo(formData: FormData) {
return this.http.post<JwResponse>('/api/license/update', formData)
}
1 year ago
importFlowFormByExcel(formData: FormData) {
return this.http.post<JwResponse>('/api/v2/sysFormTemp/importByExcel', formData)
}
1 year ago
uploadFormTpl = (formData: FormData) => {
1 year ago
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/upload`, formData)
}
2 years ago
login(data: {}) {
return this.http.post<JwResponse>('/api/oauth/login', data).pipe(
tap((res) => {
localStorage.setItem(this.AUTH_KEY_NAME, JSON.stringify(res.body))
}),
)
2 years ago
}
logout() {
return this.http.post<JwResponse>('/api/oauth/logout', null)
2 years ago
}
2 years ago
getHomeTodocountData() {
return this.http.post<JwResponse>('/api/flowable/task/todoListCount', null)
}
getHomeData() {
return this.http.post<JwResponse>('/api/home/data', null)
}
getOrgTree() {
return this.http.post<JwResponse>('/api/umsOrganization/tree', null)
2 years ago
}
saveOrg(data: NzSafeAny) {
if (Utils.isEmpty(data.organizationId)) {
return this.http.post<JwResponse>('/api/umsOrganization/add', data)
}
return this.http.post<JwResponse>('/api/umsOrganization/update', data)
2 years ago
}
deleteOrg(id: number) {
return this.http.post<JwResponse>('/api/umsOrganization/delete', [id])
2 years ago
}
getUserPage(data: {}) {
return this.http.post<JwResponse>('/api/umsUser/list', data)
2 years ago
}
2 years ago
getUserDetail(id: number) {
return this.http.post<JwResponse>(`/api/umsUser/query?userId=${id}`, null)
}
2 years ago
deleteUser(ids: number[]) {
return this.http.post<JwResponse>(`/api/umsUser/delete`, ids)
2 years ago
}
2 years ago
saveSelfAccount(data: NzSafeAny) {
return this.http.post<JwResponse>('/api/umsUser/update/selfInfo', data)
}
savePassword(data: NzSafeAny) {
return this.http.post<JwResponse>('/api/umsUser/update/selfPassword', data)
}
saveUser(data: NzSafeAny) {
if (Utils.isEmpty(data.userId)) {
return this.http.post<JwResponse>('/api/umsUser/add', data)
2 years ago
}
return this.http.post<JwResponse>('/api/umsUser/update', data)
2 years ago
}
2 years ago
getMenus() {
return this.http.post<JwResponse>('/api/umsMenu/listAll', null)
}
2 years ago
getRolePage(data: {}) {
return this.http.post<JwResponse>('/api/umsRole/list', data)
}
getRoleDetail(id: number) {
return this.http.post<JwResponse>(`/api/umsRole/query?roleId=${id}`, null)
}
deleteRole(ids: number[]) {
return this.http.post<JwResponse>(`/api/umsRole/delete`, ids)
}
saveRole(data: NzSafeAny) {
if (Utils.isEmpty(data.roleId)) {
return this.http.post<JwResponse>('/api/umsRole/add', data)
}
return this.http.post<JwResponse>('/api/umsRole/update', data)
}
2 years ago
2 years ago
getBasicFinancialCategory(data: {}) {
2 years ago
return this.http.post<JwResponse>('/api/eamBasicFinancialCategory/all', data)
2 years ago
}
2 years ago
getAssetPage(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/list', data)
}
2 years ago
/**
* r入库/退
* @param data
* @returns
*/
getAeamBusinessStorageList(data: {}) {
return this.http.post<JwResponse>('/api/eamBusinessStorage/warehouse/list', data)
}
/**
* //
* @param data
* @returns
*/
getAssetStroagePage(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warehouse/list', data)
}
/**
*
* @param ids
* @returns
*/
2 years ago
getAssetListByIds(ids: number[]) {
return this.http.post<JwResponse>('/api/eamAsset/queryByIds', ids)
}
2 years ago
/**
*
* @param ids
* @returns
*/
getAssetStorageListByIds(ids: number[]) {
return this.http.post<JwResponse>('/api/eamAsset/warehouse/listByIds', ids)
}
getAssetLog(data: {}) {
1 year ago
return this.http.post<JwResponse>('/api/eamAssetLog/list', data).pipe(
map((res) => {
return {
...res,
body: {
...res.body,
rows: res.body.rows
.sort((a: any, b: any) => {
return a.id - b.id
})
.map((i: any, idx: number) => {
return {
idx: idx + 1,
...i,
}
}),
},
}
}),
)
}
2 years ago
getAssetRepairLog(data: {}, id: number) {
return this.http.post<JwResponse>(`/api/eamAsset/repair/list?id=${id}`, data)
}
2 years ago
copyAsset(num: number, id: number) {
return this.http.post<JwResponse>(`/api/eamAsset/copyByNum?num=${num}&id=${id}`, null)
}
deleteAsset(ids: number[]) {
return this.http.post<JwResponse>('/api/eamAsset/delete', ids)
}
uploadAsset(data: FormData) {
return this.http.post<JwResponse>('/api/eamAsset/importData', data)
}
confirmAsset(ids: number[]) {
return this.http.post<JwResponse>('/api/eamAsset/confirm', ids)
}
assetQrcode(id: number) {
return this.http.post<JwResponse>(`/api/qr/generate?id=${id}`, null, {
observe: 'response',
responseType: 'blob' as 'json',
})
}
1 year ago
downloadAssetTemplate(categoryId?: string) {
2 years ago
return this.http.post<JwResponse>(`/api/eamAsset/importTemplate`, null, {
1 year ago
params: categoryId ? { categoryId } : {},
2 years ago
observe: 'response',
responseType: 'blob' as 'json',
})
}
exportAsset(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamAsset/export`, ids, {
observe: 'response',
responseType: 'blob' as 'json',
})
}
saveAsset(data: NzSafeAny) {
if (Utils.isEmpty(data.assetId)) {
return this.http.post<JwResponse>('/api/eamAsset/add', data)
}
return this.http.post<JwResponse>('/api/eamAsset/update', data)
}
2 years ago
getAlertBorrow(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/borrow', data)
}
getAlertMaintenance(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/maintenance', data)
}
getAlertSafety(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/safety', data)
}
getAlertSafetyUp(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/up', data)
}
getAlertSafetyDown(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/down', data)
}
getBasicPositionPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBasicPosition/list', data)
2 years ago
}
2 years ago
getBasicPositionTree() {
return this.http.post<JwResponse>('/api/eamBasicPosition/tree', null)
}
saveBasicPosition(data: NzSafeAny) {
if (Utils.isEmpty(data.positionId)) {
return this.http.post<JwResponse>('/api/eamBasicPosition/add', data)
2 years ago
}
return this.http.post<JwResponse>('/api/eamBasicPosition/update', data)
2 years ago
}
deleteBasicPosition(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBasicPosition/delete`, ids)
2 years ago
}
getBasicMaintenanceVendorPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBasicMaintenanceVendor/list', data)
2 years ago
}
saveBasicMaintenanceVendor(data: NzSafeAny) {
if (Utils.isEmpty(data.maintenanceVendorId)) {
return this.http.post<JwResponse>('/api/eamBasicMaintenanceVendor/add', data)
}
return this.http.post<JwResponse>('/api/eamBasicMaintenanceVendor/update', data)
2 years ago
}
deleteBasicMaintenanceVendor(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBasicMaintenanceVendor/delete`, ids)
2 years ago
}
getBasicManufacturersVendorPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBasicManufacturersVendor/list', data)
2 years ago
}
saveBasicManufacturersVendor(data: NzSafeAny) {
if (Utils.isEmpty(data.manufacturersVendorId)) {
return this.http.post<JwResponse>('/api/eamBasicManufacturersVendor/add', data)
}
return this.http.post<JwResponse>('/api/eamBasicManufacturersVendor/update', data)
2 years ago
}
deleteBasicManufacturersVendor(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBasicManufacturersVendor/delete`, ids)
2 years ago
}
getBasicSupplierVendorPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBasicSupplierVendor/list', data)
}
saveBasicSupplierVendor(data: NzSafeAny) {
if (Utils.isEmpty(data.supplierVendorId)) {
return this.http.post<JwResponse>('/api/eamBasicSupplierVendor/add', data)
2 years ago
}
return this.http.post<JwResponse>('/api/eamBasicSupplierVendor/update', data)
2 years ago
}
deleteBasicSupplierVendor(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBasicSupplierVendor/delete`, ids)
2 years ago
}
getBasicWarehousePage(data: {}) {
return this.http.post<JwResponse>('/api/eamBasicWarehouse/list', data)
2 years ago
}
saveBasicWarehouse(data: NzSafeAny) {
if (Utils.isEmpty(data.warehouseId)) {
return this.http.post<JwResponse>('/api/eamBasicWarehouse/add', data)
}
return this.http.post<JwResponse>('/api/eamBasicWarehouse/update', data)
2 years ago
}
deleteBasicWarehouse(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBasicWarehouse/delete`, ids)
2 years ago
}
2 years ago
categoryTree: NzSafeAny[] = []
getBasicCategoryTree(force?: boolean) {
if (this.categoryTree.length > 0 && !force) {
return of({
body: this.categoryTree,
} as JwResponse)
}
return this.http.post<JwResponse>('/api/eamBasicCategory/tree', null).pipe(
tap((res) => {
this.categoryTree = res.body
}),
)
2 years ago
}
addBasicCategoryTree(data: {}) {
return this.http.post<JwResponse>('/api/eamBasicCategory/add', data)
2 years ago
}
updateBasicCategoryTree(data: {}) {
return this.http.post<JwResponse>('/api/eamBasicCategory/update', data)
2 years ago
}
deleteBasicCategory(ids: number[]) {
return this.http.post<JwResponse>('/api/eamBasicCategory/delete', ids)
2 years ago
}
2 years ago
getStocktakingPlanPage(data: {}) {
return this.http.post<JwResponse>('/api/eamStocktakingPlan/list', data)
}
saveStocktakingPlan(data: NzSafeAny) {
2 years ago
if (Utils.isEmpty(data.stocktakingPlanId)) {
2 years ago
return this.http.post<JwResponse>('/api/eamStocktakingPlan/add', data)
}
return this.http.post<JwResponse>('/api/eamStocktakingPlan/update', data)
}
deleteStocktakingPlan(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamStocktakingPlan/delete`, ids)
}
createStocktakingJobByPlan(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamStocktakingPlan/job`, ids)
}
getStocktakingJobDetailPage(data: {}) {
return this.http.post<JwResponse>('/api/eamStocktakingDetails/list', data)
}
saveStocktakingJobDetail(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
return this.http.post<JwResponse>('/api/eamStocktakingDetails/add', data)
}
return this.http.post<JwResponse>('/api/eamStocktakingDetails/update', data)
}
deleteStocktakingDetail(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamStocktakingDetails/delete`, ids)
}
2 years ago
startStocktakingJob(data: {}) {
return this.http.post<JwResponse>(`/api/eamStocktakingDetails/update`, data)
}
2 years ago
getStocktakingJobPage(data: {}) {
return this.http.post<JwResponse>('/api/eamStocktakingJob/list', data)
2 years ago
}
saveStocktakingJob(data: NzSafeAny) {
if (Utils.isEmpty(data.stocktakingJobId)) {
return this.http.post<JwResponse>('/api/eamStocktakingJob/add', data)
2 years ago
}
return this.http.post<JwResponse>('/api/eamStocktakingJob/update', data)
2 years ago
}
deleteStocktakingJob(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamStocktakingJob/delete`, ids)
2 years ago
}
beginStocktakingJob(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamStocktakingJob/start`, ids)
2 years ago
}
stopStocktakingJob(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamStocktakingJob/complete`, ids)
2 years ago
}
1 year ago
assetAddByFlow(val: {}) {
return this.http.post<JwResponse>('/api/v2/eamManager/add', val)
}
getBusinessStoragePage(data: {}) {
return this.http.post<JwResponse>('/api/eamBusinessStorage/list', data)
}
saveBusinessStorage(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
Reflect.deleteProperty(data, 'id')
return this.http.post<JwResponse>('/api/eamBusinessStorage/add', data)
}
return this.http.post<JwResponse>('/api/eamBusinessStorage/update', data)
}
deleteBusinessStorage(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessStorage/delete`, ids)
}
confirmBusinessStorage(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessStorage/confirm`, ids)
}
getBusinessCollectionPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBusinessCollection/list', data)
}
saveBusinessCollection(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
return this.http.post<JwResponse>('/api/eamBusinessCollection/add', data)
}
return this.http.post<JwResponse>('/api/eamBusinessCollection/update', data)
}
deleteBusinessCollection(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessCollection/delete`, ids)
}
confirmBusinessCollection(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessCollection/confirm`, ids)
}
2 years ago
getBusinessRetirementPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBusinessRetirement/list', data)
}
saveBusinessRetirement(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
return this.http.post<JwResponse>('/api/eamBusinessRetirement/add', data)
}
return this.http.post<JwResponse>('/api/eamBusinessRetirement/update', data)
}
deleteBusinessRetirement(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessRetirement/delete`, ids)
}
confirmBusinessRetirement(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessRetirement/confirm`, ids)
}
cleanBusinessRetirement(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessRetirement/clean`, ids)
}
getBusinessReturnInventoryPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBusinessReturnInventory/list', data)
}
saveBusinessReturnInventory(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
return this.http.post<JwResponse>('/api/eamBusinessReturnInventory/add', data)
}
return this.http.post<JwResponse>('/api/eamBusinessReturnInventory/update', data)
}
deleteBusinessReturnInventory(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessReturnInventory/delete`, ids)
}
confirmBusinessReturnInventory(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessReturnInventory/confirm`, ids)
}
getBusinessBorrowPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBusinessBorrow/list', data)
}
saveBusinessBorrow(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
return this.http.post<JwResponse>('/api/eamBusinessBorrow/add', data)
}
return this.http.post<JwResponse>('/api/eamBusinessBorrow/update', data)
}
deleteBusinessBorrow(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessBorrow/delete`, ids)
}
confirmBusinessBorrow(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessBorrow/confirm`, ids)
}
getBusinessRevertPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBusinessReturn/list', data)
}
saveBusinessRevert(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
return this.http.post<JwResponse>('/api/eamBusinessReturn/add', data)
}
return this.http.post<JwResponse>('/api/eamBusinessReturn/update', data)
}
deleteBusinessRevert(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessReturn/delete`, ids)
}
confirmBusinessRevert(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessReturn/confirm`, ids)
}
getBusinessAllocatePage(data: {}) {
return this.http.post<JwResponse>('/api/eamBusinessAllocate/list', data)
}
saveBusinessAllocate(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
return this.http.post<JwResponse>('/api/eamBusinessAllocate/add', data)
}
return this.http.post<JwResponse>('/api/eamBusinessAllocate/update', data)
}
deleteBusinessAllocate(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessAllocate/delete`, ids)
}
confirmBusinessAllocate(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessAllocate/confirm`, ids)
}
getBusinessTransferPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBusinessTransfer/list', data)
}
saveBusinessTransfer(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
return this.http.post<JwResponse>('/api/eamBusinessTransfer/add', data)
}
return this.http.post<JwResponse>('/api/eamBusinessTransfer/update', data)
}
deleteBusinessTransfer(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessTransfer/delete`, ids)
}
confirmBusinessTransfer(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamBusinessTransfer/confirm`, ids)
}
getRepairTypePage(data: {}) {
return this.http.post<JwResponse>('/api/eamRepairType/list', data)
}
saveRepairType(data: NzSafeAny) {
if (Utils.isEmpty(data.repairTypeId)) {
return this.http.post<JwResponse>('/api/eamRepairType/add', data)
}
return this.http.post<JwResponse>('/api/eamRepairType/update', data)
}
deleteRepairType(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamRepairType/delete`, ids)
}
getRepairPage(data: {}) {
return this.http.post<JwResponse>('/api/eamRepair/list', data)
}
1 year ago
getRepairDetail(id: string) {
return this.http.post<JwResponse>('/api/eamRepair/query', null, { params: { id } })
}
getDeviceOnOffPage(data: {}) {
return this.http.post<JwResponse>('/api/v2/device/list', data)
}
onOffDevice(ids: NzSafeAny[], type: number) {
return this.http.post<JwResponse>(type === 1 ? '/api/v2/device/on' : '/api/v2/device/off', ids)
}
saveRepair(data: NzSafeAny) {
if (Utils.isEmpty(data.id)) {
return this.http.post<JwResponse>('/api/eamRepair/add', data)
}
return this.http.post<JwResponse>('/api/eamRepair/update', data)
}
deleteRepair(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamRepair/delete`, ids)
}
getRepairFaultPage(data: {}) {
return this.http.post<JwResponse>('/api/eamRepairFault/list', data)
}
saveRepairFault(data: NzSafeAny) {
if (Utils.isEmpty(data.faultId)) {
return this.http.post<JwResponse>('/api/eamRepairFault/add', data)
}
return this.http.post<JwResponse>('/api/eamRepairFault/update', data)
}
deleteRepairFault(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamRepairFault/delete`, ids)
}
2 years ago
// flow
1 year ago
2 years ago
getFlowForms(data: {}) {
return this.http.post<JwResponse>(`/api/flForm/all`, data)
}
2 years ago
getFlowRecord(deployId: string, procInsId: string) {
return this.http.get<JwResponse>(`/api/flowable/task/flowRecord?deployId=${deployId}&procInsId=${procInsId}`)
}
2 years ago
setFlowFormsAssignee(data: {}) {
return this.http.post<JwResponse>(`/api/flForm/assignee`, null, {
params: data,
})
}
getMyApplyAssetFlow(data: {}) {
return this.http.post<JwResponse>(`/api/flowable/task/myProcess`, data)
}
2 years ago
deleteAssetFlow(data: {}) {
1 year ago
return this.http.delete<JwResponse>(`/api/flowable/task/delete`, { body: data })
2 years ago
}
getMyTodoAssetFlow(data: {}) {
return this.http.post<JwResponse>(`/api/flowable/task/todoList`, data)
}
getMyFinishedAssetFlow(data: {}) {
return this.http.post<JwResponse>(`/api/flowable/task/finishedList`, data)
}
2 years ago
revokeProcessFlow(data: {}) {
return this.http.post<JwResponse>(`/api/flowable/task/revokeProcess`, data)
}
rejectProcessFlow(data: {}) {
1 year ago
// 驳回
2 years ago
return this.http.post<JwResponse>(`/api/flowable/task/reject`, data)
}
completeProcessFlow(data: {}) {
1 year ago
// 通过 & 重新发起?
2 years ago
return this.http.post<JwResponse>(`/api/flowable/task/complete`, data)
}
1 year ago
handleTaskAssetItem(data: {}, taskId: string) {
return this.http.post<JwResponse>(`/api/v2/flowable/device/update/${taskId}`, { variables: data })
1 year ago
}
2 years ago
cancelFlow(data: {}) {
1 year ago
// return this.http.post<JwResponse>(`/api/flowable/task/stopProcess`, data)
return this.http.post<JwResponse>(`/api/flowable/task/revokeProcess`, data)
2 years ago
}
2 years ago
startFlow(json: {}, form_key: string) {
return this.http.post<JwResponse>(`/api/flowable/definition/start/${form_key}`, json)
}
1 year ago
//v2
getFlowFormsList(data: {}) {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/list`, data)
}
uploadFlowFormTpl = (data: FormData) => {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/importData`, data)
}
getFlowFormsTpl() {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/importTemplate`, null, {
observe: 'response',
responseType: 'blob' as 'json',
})
}
1 year ago
downloadTpl() {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/formTemplate`, null, {
observe: 'response',
responseType: 'blob' as 'json',
})
}
1 year ago
addFlowForm(data: NzSafeAny) {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/add`, data)
}
updateFlowForm(data: NzSafeAny) {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/update`, data)
}
1 year ago
confirmFlowForm(data: NzSafeAny) {
1 year ago
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/confirm`, data)
1 year ago
}
1 year ago
deleteFlowForm(idList: NzSafeAny) {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/delete`, idList)
}
getFlowFormDetail(id: string) {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/query`, null, {
params: {
id,
},
})
}
getFlowFormList() {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/all`, null)
}
1 year ago
// getAssetManagerPage(data: {}) {
// return this.http.post<JwResponse>(`/api/v2/eamManager/list`, data)
// }
1 year ago
getAssetManagerPage(data: {}) {
1 year ago
return this.http.post<JwResponse>(`/api/v2/eamManager/query`, data)
1 year ago
}
getAssetTeamPage(data: {}) {
return this.http.post<JwResponse>(`/api/v2/eamBasicTeam/list`, data)
}
getAssetTeamAll() {
return this.http.post<JwResponse>(`/api/v2/eamBasicTeam/all`, null)
}
saveUserTeam(data: NzSafeAny) {
if (Utils.isEmpty(data.teamId)) {
return this.http.post<JwResponse>('/api/v2/eamBasicTeam/add', data)
}
return this.http.post<JwResponse>('/api/v2/eamBasicTeam/update', data)
}
deleteUserTeam(ids: number[]) {
return this.http.post<JwResponse>('/api/v2/eamBasicTeam/delete', ids)
}
getTaskPage(data: {}) {
return this.http.post<JwResponse>(`/api/v2/flowable/device/list`, data)
}
getPlanPage(data: {}) {
return this.http.post<JwResponse>(`/api/v2/plan/list`, data)
}
1 year ago
savePlan(data: NzSafeAny) {
if (Utils.isEmpty(data.jobId)) {
return this.http.post<JwResponse>(`/api/v2/plan/add`, data)
}
return this.http.post<JwResponse>('/api/v2/plan/update', data)
}
deletePlan(data: {}) {
return this.http.post<JwResponse>(`/api/v2/plan/delete`, data)
}
changePlanStatus(data: {}) {
return this.http.post<JwResponse>(`/api/v2/plan/changeStatus`, data)
1 year ago
}
createRapairTask(data: {}) {
return this.http.post<JwResponse>(`/api/v2/flowable/device/start/repair`, data)
}
1 year ago
createTask(data: {}) {
return this.http.post<JwResponse>(`/api/v2/flowable/device/start`, data)
}
1 year ago
takeTask(data: {}) {
return this.http.post<JwResponse>(`/api/flowable/task/claim`, data)
}
assignTask(data: {}) {
return this.http.post<JwResponse>(`/api/flowable/task/assignTask`, data)
}
1 year ago
getSysLog(data: {}) {
return this.http.post<JwResponse>('/api/v2/sysLog/list', data)
}
getAlarmMsg(data: {}) {
return this.http.post<JwResponse>('/api/v2/alarm/list', data)
}
1 year ago
getFlowMsg(data: {}) {
1 year ago
return this.http.post<JwResponse>('/api/flowable/task/todoListMSG', data)
1 year ago
}
getCalendarData(data: {}) {
return this.http.post<JwResponse>('/api/flFormItem/calendar', data)
}
getFlowHomeData() {
return this.http.post<JwResponse>('/api/flFormItem/home', null)
}
flowFormUpdate(d: {}) {
return this.http.post<JwResponse>('/api/flForm/update', d)
}
1 year ago
deviceLog(d: {}) {
1 year ago
return this.http.post<JwResponse>('/api/eamAssetLog/list/device', d).pipe(
map((res) => {
return {
...res,
body: {
...res.body,
rows: res.body.rows
.sort((a: any, b: any) => {
return a.id - b.id
})
.map((i: any, idx: number) => {
return {
idx: idx + 1,
...i,
}
}),
},
}
}),
)
1 year ago
}
assetFlowRecord(d: {}) {
return this.http.post<JwResponse>('/api/flowable/task/flowRecord', d)
}
operationalStatistics(d: {}) {
return this.http.get<JwResponse>('/api/eamAsset/operationalStatistics', {
params: d,
})
}
downloadTaskReport(id: string) {
return this.http.post<JwResponse>(`/api/v2/flowable/device/export/${id}`, null, {
observe: 'response',
responseType: 'blob' as 'json',
})
}
exportFlowForm(idList: string[]) {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/exportExcel`, idList, {
observe: 'response',
responseType: 'blob' as 'json',
})
}
1 year ago
onOffRecord(q: {}) {
1 year ago
return this.http.post<JwResponse>(`/api/v2/device/record`, null, {
1 year ago
params: q,
1 year ago
})
}
getReportData(data: {}) {
return this.http.post<JwResponse>(`/api/flFormItem/workReport`, data)
}
saveReport(content: string) {
1 year ago
return this.http.post<JwResponse>(
`/api/flFormItem/h5str2word`,
{ content },
{
observe: 'response',
responseType: 'blob' as 'json',
},
)
}
downloadWord(content: {}) {
return this.http.post<JwResponse>(`/api/flFormItem/downloadWord`, content, {
observe: 'response',
responseType: 'blob' as 'json',
})
}
preview(id: string) {
return this.http.post<JwResponse>(`/api/v2/sysFormTemp/preview`, null, {
params: { id },
observe: 'response',
responseType: 'blob' as 'json',
})
}
exportPlanReport(id: string) {
return this.http.post<JwResponse>(
`/api/v2/plan/export`,
{
idList: [id],
},
{
observe: 'response',
responseType: 'blob' as 'json',
},
)
1 year ago
}
bigScreen() {
return this.http.post<JwResponse>(`/api/home/bigScreen`, null)
}
2 years ago
}