import { get, put, putJ, postJ, deleteApi } from "@/utils/request"; import Vue from "vue"; // 列表 export async function getList(data) { const res = await postJ(Vue.prototype.apiUrl + '/qms/quality_work_order/page', data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } export async function getById(id) { const res = await get(Vue.prototype.apiUrl + `/qms/quality_work_order/getById/${id}`); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 获取详情 受托单 export async function getRequestentrustById(id) { const res = await get(Vue.prototype.apiUrl + `/qms/requestentrust/getById/${id}`); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 获取详情 任务单 export async function getTaskmonadById(id) { const res = await get(Vue.prototype.apiUrl + `/qms/taskmonad/getById/${id}`); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 编辑 export async function update(data) { const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/update`, data); if (res.code == 0) { return res.message; } return Promise.reject(new Error(res.message)); } //单个质检项保存 export async function exeReportWorkBySingleTemplate(data) { const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/exeReportWorkBySingleTemplate`, data); if (res.code == 0) { return res.message; } return Promise.reject(new Error(res.message)); } //单个质检项保存 任务 export async function exeReportWorkBySingleTaskmonad(data) { const res = await postJ(Vue.prototype.apiUrl + `/qms/taskmonad/exeReportWorkBySingleTemplate`, data); if (res.code == 0) { return res.message; } return Promise.reject(new Error(res.message)); } //单个质检项保存 s受托 export async function exeReportWorkBySingleRequestentrust(data) { const res = await postJ(Vue.prototype.apiUrl + `/qms/requestentrust/exeReportWorkBySingleTemplate`, data); if (res.code == 0) { return res.message; } return Promise.reject(new Error(res.message)); } // 查询工厂列表-分页 export async function getFactoryarea(params) { const res = await get(Vue.prototype.apiUrl + `/main/factoryarea/page`, params); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 受托单列表 export async function getRequestentrustList(params) { const res = await get(Vue.prototype.apiUrl + `/qms/requestentrust/page`, params); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 任务单列表 export async function getTaskmonadList(params) { const res = await get(Vue.prototype.apiUrl + `/qms/taskmonad/page`, params); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 报工校验 export async function verificationQualityInspector(id) { const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/verificationQualityInspector/${id}`); return res.code } //收样 export async function sampleCollection(data) { const res = await putJ( Vue.prototype.apiUrl + `/qms/quality_work_order/sampleCollection`, data ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //实验 // 获取详情 export async function getByIdExperiment(id) { const res = await get(Vue.prototype.apiUrl + `/qms/experiment/getById/${id}`); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 保存 export async function saveExperiment(data) { const res = await postJ(Vue.prototype.apiUrl + `/qms/experiment/save`, data); if (res.code == 0) { return res.message; } return Promise.reject(new Error(res.message)); } // 修改 export async function updateExperiment(data) { const res = await putJ(Vue.prototype.apiUrl + `/qms/experiment/update`, data); if (res.code == 0) { return res.message; } return Promise.reject(new Error(res.message)); } // 检查质检工单是否可以请样 export async function checkByQualityWorkOrderId(qualityWorkOrderId) { const res = await get(Vue.prototype.apiUrl + `/qms/samplingrecord/checkByQualityWorkOrderId/${qualityWorkOrderId}`); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 根据质检工单id获取清单列表 export async function queryQualityInventory(data) { const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/query_quality_inventory`, data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 根据质检工单id获取质检样品列表 export async function queryQualitySamplContent(data) { const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/query_quality_sampl_content`, data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 根据质检工单id获取方案内容 export async function queryQualityTempleContent(data) { const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/query_quality_temple_content`, data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); }