/*
 * @Author: zc
 * @description 工单管理
 * @version:
 * @Date: 2022-08-09 16:19:55
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-16 14:49:01
 */
import request from '/@/utils/request';
import qs from 'qs';
/**
 * @description 列表页面基础数据
 */
export const listBaseData = () => {
	return request({
		url: `/api/v1/Order/base-data`,
		method: 'get',
	});
};
/**
 * @description 工单列表
 * @param {any} params
 */
export const orderList = (params: any) => {
	return request({
		url: `/api/v1/Order?${qs.stringify(params)}`,
		method: 'get',
	});
};
/**
 * @description 工单待办列表
 * @param {any} params
 */
export const orderListBacklog = (params: any) => {
	return request({
		url: `/api/v1/Order/waited`,
		method: 'get',
		params
	});
};
/**
 * @description 历史工单
 * @param {object} params
 */
export const historyOrder = (params: object) => {
	return request({
		url: `/api/v1/Order/history`,
		method: 'get',
		params,
	});
};
/**
 * @description 新增工单
 * @param {object} data
 */
export const orderAdd = (data: object) => {
	return request({
		url: `/api/v1/Order`,
		method: 'post',
		data,
	});
};
/**
 * @description 更新工单
 * @param {object} data
 */
export const orderEdit = (data: object) => {
	return request({
		url: `/api/v1/Order`,
		method: 'put',
		data,
	});
};
/**
 * @description 工单详情
 * @param {string} id
 */
export const orderDetail = (id: string | any[]) => {
	return request({
		url: `/api/v1/Order/${id}`,
		method: 'get',
	});
};
/**
 * @description 删除工单
 * @param {string} id
 */
export const orderDelete = (id: string) => {
	return request({
		url: `/api/v1/Order/${id}`,
		method: 'delete',
	});
};
/**
 * @description 查询工单办理流程开启参数
 * @param {object}params
 */
export const OrderFlowParams = (params?: object) => {
	return request({
		url: `/api/v1/Order/startflow`,
		method: 'get',
		params,
	});
};
/**
 * @description 开始工单办理流程
 * @param data
 */
export const orderStartFlow = (data?: object) => {
	return request({
		url: `/api/v1/Order/startflow`,
		method: 'post',
		data,
	});
};
/**
 * @description 新增页面基础数据
 * @param {object} params
 */
export const orderBaseDataAdd = (params?: object) => {
	return request({
		url: `/api/v1/Order/base-data-add`,
		method: 'get',
		params,
	});
};
/**
 * @description 扩展表单页面基础数据
 * @param {object} params
 */
export const orderBaseExt = (params?: object) => {
	return request({
		url: `/api/v1/Order/base-data-ext`,
		method: 'get',
		params,
	});
};
/**
 * @description 获取热点下一级
 * @param {object} params
 */
export const hotSpotType = (params?: object) => {
	return request({
		url: `/api/v1/HotSpot/children`,
		method: 'get',
		params,
	});
};
/**
 * @description 重复工单列表查询
 * @param {object} params
 */
export const duplicateOrder = (params?: object) => {
	return request({
		url: `/api/v1/Order/duplicate?${qs.stringify(params)}`,
		method: 'get'
	});
};

