index.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import {
  2. get,
  3. put,
  4. putJ,
  5. postJ,
  6. deleteApi
  7. } from "@/utils/request";
  8. import Vue from "vue";
  9. // 工单列表-------------------------------------------------------------------
  10. export async function getSalesWorkOrder(params) {
  11. const res = await get(Vue.prototype.apiUrl + `/eom/afterSalesWorkOrder/page`, params);
  12. if (res.code == 0) {
  13. return res.data;
  14. }
  15. return Promise.reject(new Error(res.message));
  16. }
  17. // 获取信息
  18. export async function getSalesWorkOrderById(id) {
  19. const res = await get(Vue.prototype.apiUrl + `/eom/afterSalesWorkOrder/getById/${id}`);
  20. if (res.code == 0) {
  21. return res.data;
  22. }
  23. return Promise.reject(new Error(res.message));
  24. }
  25. //修改
  26. export async function updateScheme(data) {
  27. const res = await putJ(Vue.prototype.apiUrl + `/eom/afterSalesWorkOrder/updateScheme`, data);
  28. if (res.code == 0) {
  29. return res.data;
  30. }
  31. return Promise.reject(new Error(res.message));
  32. }
  33. /**
  34. * 查询库存可用数
  35. */
  36. export async function getWarehouseOutStock(params) {
  37. const res = await get(Vue.prototype.apiUrl + `/wms/stocktwo/getWarehouseOutStock`, params);
  38. if (res.code == 0) {
  39. return res.data;
  40. }
  41. return Promise.reject(new Error(res.message));
  42. }
  43. /**
  44. * 查询库存仓库列表
  45. */
  46. export async function getIdWarehouseList(params) {
  47. const res = await get(Vue.prototype.apiUrl + `/wms/outindetailtwo/getBatchWarehouseList`, params);
  48. if (res.code == 0) {
  49. return res.data;
  50. }
  51. return Promise.reject(new Error(res.message));
  52. }
  53. //申请备品备件
  54. export async function saveOrUpdateSalesWorkOrder(data) {
  55. const res = await postJ(Vue.prototype.apiUrl + `/eom/afterSalesWorkOrder/saveOrUpdate`, data);
  56. if (res.code == 0) {
  57. return res.data;
  58. }
  59. return Promise.reject(new Error(res.message));
  60. }
  61. /**
  62. * 查询仓库列表
  63. */
  64. export async function getWarehouseList(data) {
  65. const res = await postJ(Vue.prototype.apiUrl + `/wms/warehouse/select/warehouseList`, {
  66. params: {
  67. status: 1
  68. }
  69. });
  70. if (res.code == 0) {
  71. return res.data;
  72. }
  73. return Promise.reject(new Error(res.message));
  74. }