import {
	postJ,
	post,
	get
} from "@/utils/request";
import Vue from "vue";


//工序计算列表
export async function saveParam(params) {
	const data = await postJ(
		Vue.prototype.apiUrl + `/mes/computeparam/save`, params, true,
	);
	if (data.code == 0) {
		return data.data;
	}
	return Promise.reject(data.message);
}

// 根据工单工序取计算参数
export async function getComputeParam(workOrderId, taskId) {
	const data = await get(
		Vue.prototype.apiUrl + `/mes/computeparam/getComputeParam/${workOrderId}/${taskId}`
	);

	if (data.code == 0) {
		return data.data;
	}
	return Promise.reject(data.message);
}