|
|
|
|
import { HttpClient } from '@angular/common/http'
|
|
|
|
|
import { Injectable } from '@angular/core'
|
|
|
|
|
import { JwResponse } from 'app/types'
|
|
|
|
|
import { Utils } from 'app/utils'
|
|
|
|
|
import { of, tap } from 'rxjs'
|
|
|
|
|
import { AuthDTO } from './api.dto'
|
|
|
|
|
import { PermissionService } from 'app/shared/permission/permission.service'
|
|
|
|
|
import { NzSafeAny } from 'ng-zorro-antd/core/types'
|
|
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
|
|
|
|
|
get authInfo(): AuthDTO | null {
|
|
|
|
|
let authInfo: AuthDTO | null = null
|
|
|
|
|
try {
|
|
|
|
|
const strData = localStorage.getItem(this.AUTH_KEY_NAME)
|
|
|
|
|
if (strData) {
|
|
|
|
|
authInfo = JSON.parse(strData)
|
|
|
|
|
this.permission.loadPermission(authInfo?.permissions ?? [])
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {}
|
|
|
|
|
return authInfo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
removeAuthData() {
|
|
|
|
|
localStorage.removeItem(this.AUTH_KEY_NAME)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
upload(data: FormData) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/common/upload', data)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
login(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/oauth/login', data).pipe(
|
|
|
|
|
tap((res) => {
|
|
|
|
|
localStorage.setItem(this.AUTH_KEY_NAME, JSON.stringify(res.body))
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logout() {
|
|
|
|
|
return this.http.post<JwResponse>('/api/oauth/logout', null)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getOrgTree() {
|
|
|
|
|
return this.http.post<JwResponse>('/api/umsOrganization/tree', null)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deleteOrg(id: number) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/umsOrganization/delete', [id])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getUserPage(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/umsUser/list', data)
|
|
|
|
|
}
|
|
|
|
|
getUserDetail(id: number) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/umsUser/query?userId=${id}`, null)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deleteUser(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/umsUser/delete`, ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
return this.http.post<JwResponse>('/api/umsUser/update', data)
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getAssetPage(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamAsset/list', data)
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
*/
|
|
|
|
|
getAssetListByIds(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamAsset/queryByIds', ids)
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 有库存的
|
|
|
|
|
* @param ids
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
getAssetStorageListByIds(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamAsset/warehouse/listByIds', ids)
|
|
|
|
|
}
|
|
|
|
|
getAssetLog(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamAssetLog/list', data)
|
|
|
|
|
}
|
|
|
|
|
getAssetRepairLog(data: {}, id: number) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamAsset/repair/list?id=${id}`, data)
|
|
|
|
|
}
|
|
|
|
|
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',
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
downloadAssetTemplate() {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamAsset/importTemplate`, null, {
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamBasicPosition/update', data)
|
|
|
|
|
}
|
|
|
|
|
deleteBasicPosition(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamBasicPosition/delete`, ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getBasicMaintenanceVendorPage(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamBasicMaintenanceVendor/list', data)
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
deleteBasicMaintenanceVendor(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamBasicMaintenanceVendor/delete`, ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getBasicManufacturersVendorPage(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamBasicManufacturersVendor/list', data)
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
deleteBasicManufacturersVendor(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamBasicManufacturersVendor/delete`, ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamBasicSupplierVendor/update', data)
|
|
|
|
|
}
|
|
|
|
|
deleteBasicSupplierVendor(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamBasicSupplierVendor/delete`, ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getBasicWarehousePage(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamBasicWarehouse/list', data)
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
deleteBasicWarehouse(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamBasicWarehouse/delete`, ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
addBasicCategoryTree(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamBasicCategory/add', data)
|
|
|
|
|
}
|
|
|
|
|
updateBasicCategoryTree(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamBasicCategory/update', data)
|
|
|
|
|
}
|
|
|
|
|
deleteBasicCategory(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamBasicCategory/delete', ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getStocktakingPlanPage(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamStocktakingPlan/list', data)
|
|
|
|
|
}
|
|
|
|
|
saveStocktakingPlan(data: NzSafeAny) {
|
|
|
|
|
if (Utils.isEmpty(data.stocktakingJobId)) {
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getStocktakingJobPage(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamStocktakingJob/list', data)
|
|
|
|
|
}
|
|
|
|
|
saveStocktakingJob(data: NzSafeAny) {
|
|
|
|
|
if (Utils.isEmpty(data.stocktakingJobId)) {
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamStocktakingJob/add', data)
|
|
|
|
|
}
|
|
|
|
|
return this.http.post<JwResponse>('/api/eamStocktakingJob/update', data)
|
|
|
|
|
}
|
|
|
|
|
deleteStocktakingJob(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamStocktakingJob/delete`, ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
beginStocktakingJob(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamStocktakingJob/start`, ids)
|
|
|
|
|
}
|
|
|
|
|
stopStocktakingJob(ids: number[]) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/eamStocktakingJob/complete`, ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// flow
|
|
|
|
|
getFlowForms(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/flForm/all`, data)
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
deleteAssetFlow(data: {}) {
|
|
|
|
|
return this.http.delete<JwResponse>(`/api/flowable/task/delete`, data)
|
|
|
|
|
}
|
|
|
|
|
getMyTodoAssetFlow(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/flowable/task/todoList`, data)
|
|
|
|
|
}
|
|
|
|
|
getMyFinishedAssetFlow(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/flowable/task/finishedList`, data)
|
|
|
|
|
}
|
|
|
|
|
revokeProcessFlow(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/flowable/task/revokeProcess`, data)
|
|
|
|
|
}
|
|
|
|
|
rejectProcessFlow(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/flowable/task/reject`, data)
|
|
|
|
|
}
|
|
|
|
|
completeProcessFlow(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/flowable/task/complete`, data)
|
|
|
|
|
}
|
|
|
|
|
cancelFlow(data: {}) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/flowable/task/stopProcess`, data)
|
|
|
|
|
}
|
|
|
|
|
startFlow(json: {}, form_key: string) {
|
|
|
|
|
return this.http.post<JwResponse>(`/api/flowable/definition/start/${form_key}`, json)
|
|
|
|
|
}
|
|
|
|
|
}
|