// const {
// 	http
// } = uni.$u

import {
	http,
	toast
} from '@/uni_modules/uview-plus'

//获取用户协议列表
export const getProtocolList = (data) => http.get('/prod-api/care/protocol/list', data);
//获取用户协议详情
export const getProtocolInfo = (data) => http.get(`/prod-api/care/protocol/${data.id??0}`, data);
//查询护理人员列表
export const getNursesList = (data) => http.get(`/prod-api/care/nurses/list`, data);
//查询护理人员详情
export const getNursesInfo = (data) => http.get(`/prod-api/care/nurses/${data.id??0}`, data);
//编辑护理人员
export const editNurses = (data) => http.get(`/prod-api/care/nurses/${data.id??0}`, data);

//护理申请列表
export const getCareList = (data) => http.get(`/prod-api/care/applications/list`, data);
//护理申请列表
export const getStreetListUrl = (data) => http.get(`/prod-api/care/applications/oneCheckList`, data);
//护理详情
export const getCareInfo = (data) => http.get(`/prod-api/care/applications/${data.id??0}`, data);


//护理送审
export const postCareStart = (params, config = {}) => http.post('/prod-api/care/applications/start', params, config);

//流程记录列表
export const getCareRecords = (data) => http.get('/prod-api/care/careRecords/list', data);
//删除审批单
export const delCareApp = (params, config = {}) => http.delete(`/prod-api/care/applications/${params.id??0}`, params,
	config);
//护理指派
export const postCareAssign = (parmas, config = {}) => http.post('/prod-api/care/applications/assign', parmas, config)
//护理审核
export const postCareCheck = (parmas, config = {}) => http.post('/prod-api/care/applications/check', parmas, config)
// 街道初审
export const postStreetCheck = (parmas, config = {}) => http.post('/prod-api/care/applications/onecheck', parmas,
	config)
//完成护理申请
export const postCareComplete = (parmas, config = {}) => http.post('/prod-api/care/applications/complete', parmas,
	config)
//查询全部公司 
export const getCompanyList = (data) => http.get('/prod-api/care/companies/listAll', data)
//查询公司的护理人员
export const getCompanyNursesList = (data) => http.get('/prod-api/care/nurses/listCompanyNurses', data)

//图片上传
export const uploadImg = (params, config = {}) => http.upload(`/prod-api/care/clocks/upload`, params, config);

export const uploadImgUrl = `/prod-api/care/clocks/upload`;


//获取图片上传的数量
export const getImgNumber = (data) => http.get(`/prod-api/system/workConfig/type/${data.key??'need_img_num'}`, data);


// export const getClockList = (data) => http.get(`/prod-api/care/applications/clockList`, data);


//添加护理打卡记录
export const addCareClocks = (params, config = {}) => http.post(`/prod-api/care/clocks`, params, config);
//添加死亡记录
export const addDieRecord = (params, config = {}) => http.post(`/prod-api/care/clocks/die`, params, config);
//添加死亡记录
export const endCareRequest = (params, config = {}) => http.post(`/prod-api/care/applications/complete`, params, config);
//修改护理打卡记录
export const updateCareClocks = (params, config = {}) => http.put(`/prod-api/care/clocks`, params, config);
//删除护理打卡记录
export const delCareClocks = (data) => http.delete(`/prod-api/care/clocks/${data.id}`);

//护理记录列表-护理人员
//pageNum=1&pageSize=10&status=assigned
export const getAppClockList = (data) => http.get(`/prod-api/care/applications/clockList`, data);
//护理记录列表-护理公司
//pageNumAssign=1&pageSizeAssign=10&status=wait_assign_nurse&pageNum=1
export const getAssignList = (data) => http.get(`/prod-api/care/applications/assignList`, data);

//得到当前护理打卡记录
export const getClockList = (data) => http.get(`/prod-api/care/clocks/list`, data);


//完成护理任务
export const completeTask = (params, config = {}) => http.post(`/prod-api/care/applications/complete`, params, config);

//评分
export const rateRequest = (params, config = {}) => http.post(`/prod-api/care/scores`, params, config);