/*
 * @Author: zc
 * @description 业务管理-工单发布
 */
import request from '@/utils/request';

/**
 * @description 工单已发布列表
 * @param {any} params
 */
export const publishedList = (params: object) => {
	return request({
		url: `/api/v1/Order/published`,
		method: 'get',
		params,
	});
};
export const publishedListFixed = (params: object) => {
	return request({
		url: `/api/v1/Order/published/items`,
		method: 'get',
		params,
	});
};
/**
 * @description 工单已发布列表导出
 * @param {any} data
 */
export const publishedListExport = (data: object) => {
	return request(
		{
			url: `/api/v1/Order/publishedorder/export`,
			method: 'post',
			responseType: 'blob',
			data,
		},
		{
			reduce_data_format: false,
		}
	);
};
export const publishedListFixedCount = (params: object) => {
	return request({
		url: `/api/v1/Order/published/count`,
		method: 'get',
		params,
	});
};
/**
 * @description 工单发布修改内容
 * @param data
 */
export const publishOrderUpdate = (data: object) => {
	return request({
		url: `/api/v1/Order/published-order-modify`,
		method: 'post',
		data,
	});
};
/**
 * @description 工单发布详情
 * @param id
 */
export const publishOrderDetail = (id: string) => {
	return request({
		url: `/api/v1/Order/published-order/${id}`,
		method: 'get',
	});
};
/**
 * @description 发布页面基础信息
 * @param id
 */
export const baseData = (id: string) => {
	return request({
		url: `/api/v1/Order/publish-order-pagebase/${id}`,
		method: 'get',
	});
};
/**
 * @description 工单发布退回基础信息
 */
export const publishReturnBaseData = (id: string) => {
	return request({
		url: `/api/v1/Order/reTransact/base/${id}`,
		method: 'get',
	});
};
/**
 * @description 工单发布退回基础信息(新)
 */
export const publishReturnBaseDataNew = (id: string) => {
	return request({
		url: `/api/v1/Order/sendback/base/${id}`,
		method: 'get',
	});
};
/**
 * @description 工单发布退回
 * @param data 工单重办数据
 */
export const publishReturn = (data: any) => {
	return request({
		url: '/api/v1/Order/re_transact',
		method: 'post',
		data,
	});
};
/**
 * @description 取消发布
 * @param {any} data
 */
export const cancelPublish = (data: object) => {
	return request({
		url: '/api/v1/Order/publish/cancel',
		method: 'put',
		data,
	});
};
