import config from "@/config"
import http from "@/utils/request"

export default {
	type: {
		url: `${config.API_URL}/zcxt/supplierType`,
		name: "供应商类别",

		get: async function (data = {}) {
			return await http.post(`${this.url}/getList`, data);
		},

		add: async function (data = {}) {
			return await http.post(`${this.url}/save`, data);
		},

		edit: async function (data = {}) {
			return await http.post(`${this.url}/update`, data);
		},

		del: async function (data = {}) {
			return await http.post(`${this.url}/remove`, data);
		}
	},

	list: {
		url: `${config.API_URL}/zcxt/supplier`,
		name: "已签约供应商",

		get: async function (data = {}) {
			return await http.post(`${this.url}/getPage`, data);
		},

		all: async function (data = {}) {
			return await http.post(`${this.url}/getList`, data);
		},

		detail: async function (data = {}) {
			return await http.post(`${this.url}/getById`, data);
		},

		add: async function (data = {}) {
			return await http.post(`${this.url}/save`, data);
		},

		edit: async function (data = {}) {
			return await http.post(`${this.url}/update`, data);
		},

		del: async function (data = {}) {
			return await http.post(`${this.url}/remove`, data);
		}
	},

	evaluate: {
		url: `${config.API_URL}/zcxt/supplierEvaluate`,
		name: "供应商评价",

		getTongJi: async function (data = {}) {
			return await http.post(`${this.url}/getTongJi`, data);
		},

		get: async function (data = {}) {
			return await http.post(`${this.url}/getPage`, data);
		},

		detail: async function (data = {}) {
			return await http.post(`${this.url}/getById`, data);
		},

		add: async function (data = {}) {
			return await http.post(`${this.url}/save`, data);
		},

		edit: async function (data = {}) {
			return await http.post(`${this.url}/update`, data);
		},

		del: async function (data = {}) {
			return await http.post(`${this.url}/remove`, data);
		},

		active: async function (data = {}) { // 发起
			return await http.post(`${this.url}/active`, data);
		},

		evaluate: async function (data = {}) { // 评价人评价
			return await http.post(`${this.url}/evaluate`, data);
		},

		revert: async function (data = {}) { // 退回
			return await http.post(`${this.url}/revert`, data);
		},

		calc: async function (data = {}) { // 计算
			return await http.post(`${this.url}/calculate`, data);
		}
	},
}