| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- import { get, postJ, deleteApi } from "@/utils/request";
- import Vue from "vue";
- // 质检报告列表
- export async function getReportList(data) {
- const res = await get(
- Vue.prototype.apiUrl + "/qms/quality_work_order/pageByReport",
- data,
- );
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- // 检测报告基本信息
- export async function queryInspectionReportData({ id, type }) {
- const res = await get(
- Vue.prototype.apiUrl +
- `/qms/quality_work_order/queryInspectionReportData/${id}`,
- { type },
- );
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- // 检测报告检测项列表信息
- export async function queryInspectionReportList({ id, type }) {
- const res = await get(
- Vue.prototype.apiUrl +
- `/qms/quality_work_order/queryInspectionReportList/${id}`,
- { type },
- );
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- // 生成/修改检测报告
- export async function generateReport(data) {
- const res = await postJ(
- Vue.prototype.apiUrl + "/qms/quality_work_order/generateReport",
- data,
- );
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- // 报表模板分页查询(质检工单生成报告时选择模板)
- export async function getQmsReportTemplatePageList(params) {
- const res = await get(
- Vue.prototype.apiUrl + "/main/qmsreporttemplate/page",
- params,
- );
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- // 生成编码(报告单号)
- export async function getCode(code) {
- const res = await get(
- Vue.prototype.apiUrl + `/main/codemanage/getCode/${code}`,
- );
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- // 删除检测报告
- export async function deleteReport(id) {
- const res = await deleteApi(
- Vue.prototype.apiUrl + `/qms/quality_work_order/deleteReport/${id}`,
- );
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- /**
- * 不合格品台账列表
- */
- export async function getList(data) {
- let par = new URLSearchParams(data);
- const res = await get(
- Vue.prototype.apiUrl + `/qms/unqualifiedproducts/page?` + par,
- );
- 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/unqualifiedproducts/getById/${id}`,
- );
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
|