index.js 784 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 getList(data) {
  11. const res = await postJ(Vue.prototype.apiUrl + '/qms/quality_work_order/page', data);
  12. if (res.code == 0) {
  13. return res.data;
  14. }
  15. return Promise.reject(new Error(res.message));
  16. }
  17. export async function getById(id) {
  18. const res = await get(Vue.prototype.apiUrl + `/qms/quality_work_order/getById/${id}`);
  19. if (res.code == 0) {
  20. return res.data;
  21. }
  22. return Promise.reject(new Error(res.message));
  23. }
  24. // 编辑
  25. export async function update(data) {
  26. const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/update`, data);
  27. if (res.code == 0) {
  28. return res.message;
  29. }
  30. return Promise.reject(new Error(res.message));
  31. }