import { main,files,dict } from '@/api'
import request from '@/utils/require'

// 提交
export function insertEntitySelective(data) {
	return request({
		url: `${main}/client/workOrder/insertEntitySelective`,
		method: 'post',
		data: data,
	})
}
//查询
export function selectPageByEntity(data){
  return request({
    url:`${main}/client/workOrder/selectPageByEntity?pageNum=${data.pageNum}&pageSize=${data.pageSize}&pageType=${data.pageType}`,
    method:'post',
    data:data
  })
}
//详情
export function selectById(data){
  return request({
    url:`${main}/client/workOrder/selectById/${data.fid}`,
    method:'get',
    data:data
  })
}
//修改
export function updateByEntitySelective(data){
  return request({
    url:`${main}/client/workOrder/updateByEntitySelective`,
    method:'put',
    data:data
  })
}
//上传查询
export function findByIds(ids) {
	return request({
		url: `${files}/file/findByIds?ids=${ids}`,
		method: 'get'
	})
}
//获取字典表
export function findYWRYPDictCode(pdictCode) {
	return request({
		url: `${dict}/dataDictionary/findByGroupId/${pdictCode}`,
		method: 'get'
	})
}
//添加处理过程
export function addSolve(data) {
	return request({
		url: `${main}/client/workOrder/add_solve`,
		method: 'post',
		data:data
	})
}
//查看问题描述
export function GetlistProblem(data) {
	return request({
		url: `${main}/client/workOrder/list_problem?fid=${data.fid}`,
		method: 'get'
	})
}
//查看处理过程描述
export function GetlistSolve(data) {
	return request({
		url: `${main}/client/workOrder/list_solve?fid=${data.fid}`,
		method: 'get'
	})
}

//导出列表

export function exportWorkOrderExcel(data) {
	return request({
		url: `${main}/client/workOrder/export_work_order_excel?pageType=${data.pageType}`,
		method: 'post',
		responseType: "blob",
		data:data
	})
}

export function exportWorkPdf(data) {
	return request({
		url: `${main}/client/workOrder/export_work_order_pdf?fid=${data.fid}&pageType=${data.pageType}`,
		method: 'get',
		responseType: "blob"
	})
}


