import request from '@/utils/request'

export const InspectionsApi = {
	/**
	 * 获取列表
	 * @param {Object} params
	 */
	getList: (params) => {
		return request({
			url: `/system/enterprise-inspections/page`,
			method: 'GET',
			params
		})
	},

	/**
	 * 获取反馈结果
	 */
	getFeedBack: (id) => {
		return request({
			url: `/system/inspections-log/appList?inspectionsId=${id}`,
			method: 'GET',
		})
	},
	/**
	 * 签到列表
	 */
	getLocate: (id) => {
		return request({
			url: `/system/inspections-log/signInList?inspectionsId=${id}`,
			method: 'GET',
		})
	},
	/**
	 * 签到
	 */
	locate: (data) => {
		return request({
			url: `/system/inspections-log/signIn`,
			method: "POST",
			data
		})
	},
	/**
	 * 转发
	 */
	replay: (data) => {
		return request({
			url: `/system/enterprise-inspections/passOn`,
			method: "POST",
			data
		})
	},
	/**
	 * 开始执法
	 */
	beginEnforce: (data) => {
		return request({
			url: `/system/inspections-log/confirmSignIn`,
			method: 'PUT',
			data
		})
	},
	/**
	 * 执法反馈
	 */
	feeback: data => {
		return request({
			url: `/system/inspections-log/inspectionsAudit`,
			method: 'POST',
			data
		})
	},
	/**
	 * 反馈详情
	 */
	feedBackDetail: id => {
		return request({
			url: `/system/inspections-log/get?id=${id}`,
			method: 'GET',
		})
	}
}