jobBooking.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import { postJ, post, get } from "@/utils/request";
  2. import Vue from "vue";
  3. // 报工 工单信息
  4. export async function getByIdReport(id, taskId) {
  5. const data = await get(
  6. Vue.prototype.apiUrl + `/pda/mes/workorder/getByIdReport/${id}/${taskId}`
  7. );
  8. if (data.code == 0) {
  9. return data.data;
  10. }
  11. return Promise.reject(data.message);
  12. }
  13. // 报工-pad扫码切换工单
  14. export async function getByCodeReport(code, taskId) {
  15. const data = await get(
  16. Vue.prototype.apiUrl +
  17. `/pda/mes/workorder/getByCodeReport/${code}/${taskId}`
  18. );
  19. if (data.code == 0) {
  20. return data.data;
  21. }
  22. return Promise.reject(data.message);
  23. }
  24. export async function jobSave(params) {
  25. const data = await postJ(
  26. Vue.prototype.apiUrl + `/pda/mes/workreport/save`,
  27. params,
  28. true
  29. );
  30. if (data.code == 0) {
  31. return data.data;
  32. }
  33. return Promise.reject(data.message);
  34. }
  35. export async function createInProduct(params) {
  36. const data = await postJ(
  37. Vue.prototype.apiUrl + `/pda/mes/workreport/createInProduct`,
  38. params,
  39. true
  40. );
  41. if (data.code == 0) {
  42. return data.data;
  43. }
  44. return Promise.reject(data.message);
  45. }
  46. //碳谷
  47. export async function createInProductBatchTG(params) {
  48. const data = await postJ(
  49. Vue.prototype.apiUrl + "/pda/mes/workreport/createInProductBatchTG",
  50. params,
  51. true
  52. );
  53. if (data.code == 0) {
  54. return data.data;
  55. }
  56. return Promise.reject(data.message);
  57. }
  58. // 委外报工 工单信息
  59. export async function outSourceGetByIdReport(id, taskId) {
  60. const data = await get(
  61. Vue.prototype.apiUrl +
  62. `/pda/mes/workorder/outSourceGetByIdReport/${id}/${taskId}`
  63. );
  64. if (data.code == 0) {
  65. return data.data;
  66. }
  67. return Promise.reject(data.message);
  68. }
  69. //批量创建在制品
  70. export async function createInProductBatch(params) {
  71. const data = await postJ(
  72. Vue.prototype.apiUrl + `/pda/mes/workreport/createInProductBatch`,
  73. params
  74. );
  75. if (data.code == 0) {
  76. return data.data;
  77. }
  78. return Promise.reject(data.message);
  79. }