api.ts 2.33 KB
import { http } from '@/typing/http';
import request from '@/utils/request';
import { PMS_HOST, OOP_HOST } from "@/utils/host";

/** 获取服务站配件列表 */
export function getPartShopPageApi(params: PmsStoragePartShop.QueryParams): http.PromisePageResp<PmsStoragePartShop.Item> {
  return request.get(`${PMS_HOST}/erp/part/shop/list`, { params });
}

/** 编辑服务站配件 */
export function savePartStockApi(params: PmsStoragePartShop.Params): http.PromiseResp<string> {
  return request.post(`${PMS_HOST}/erp/part/shop/update/stock`, { ...params });
}
/** 编辑服务站配件价格 */
export function savePartPriceApi(params: PmsStoragePartShop.Params): http.PromiseResp<string> {
  return request.post(`${PMS_HOST}/erp/part/shop/update/price`, { ...params });
}

/** 获取服务站列表 */
export function getShopApi(): http.PromiseResp<PmsStoragePartShop.Option[]> {
  return request.get(`${OOP_HOST}/select/biz/shops`, { params: { bizType: 2 } });
}

/**
 * 配件选择
 */
export function getPartPageListApi(params?: PartPriceCoefficientSpace.QueryPartParams): http.PromisePageResp<PartPriceCoefficientSpace.PartItem> {
  return request.get(`${PMS_HOST}/erp/part/list`, { params });
}

/** 释放库存 */
export function releaseApi(params: PmsStoragePartShop.ReleaseParam): http.PromiseResp<void> {
  return request.post(`${PMS_HOST}/erp/part/shop/release/actual`, { ...params });
}

/**
 * 查询门店备件锁件明细列表
 */
export function getLockDetail(params?: PmsStoragePartShop.LockParams): http.PromiseRespA<PmsStoragePartShop.LockDetailVO> {
  return request.get(`${PMS_HOST}/erp/part/shop/get/lock/detail`, { params });
}

/**
 * 查询门店备件流水明细列表
 */
export function getFlowDetail(params?: PmsStoragePartShop.FlowParams): http.PromisePageResp<PmsStoragePartShop.FlowVO> {
  return request.get(`${PMS_HOST}/erp/part/shop/get/record`, { params });
}
/**
 * 查询门店备件锁库流水明细列表
 */
export function getLockFlowDetail(params?: PmsStoragePartShop.FlowParams): http.PromisePageResp<PmsStoragePartShop.FlowVO> {
  return request.get(`${PMS_HOST}/erp/part/shop/get/lock/record`, { params });
}
// 释放库存
export function unLock(params: PmsStoragePartShop.unLock): http.PromiseResp<string> {
  return request.post(`${PMS_HOST}/erp/part/shop/cancel/lock`, { ...params }, { contentType: "form-urlencoded" });
}