111 lines
3.5 KiB
JavaScript
111 lines
3.5 KiB
JavaScript
/**
|
||
* @Description: 巡检记录 API
|
||
* @Author: Zy
|
||
* @Date: 2026-05-16 15:43:07
|
||
* @LastEditor: Zy
|
||
* @LastEditTime: 2026-05-19 16:25:14
|
||
*/
|
||
|
||
import request, {
|
||
filterParams,
|
||
get,
|
||
put,
|
||
post
|
||
} from "./request.js";
|
||
|
||
|
||
|
||
/**
|
||
* @typedef PointsType 巡检任务表
|
||
* @property {string} id = [巡检点ID]
|
||
* @property {string[]} itemNames = [巡检项目名称]
|
||
* @property {string[]} itemIds = [巡检项目ID]
|
||
* @property {string} pointName = [巡检点名称]
|
||
* */
|
||
/**
|
||
* @typedef InspectionListType 巡检任务表
|
||
* @property {string} id = [巡检任务ID]
|
||
*
|
||
* @property {0|1} inspectSetting = [0必须拍照, 1允许跳检]
|
||
* @property {string} inspectorName = [巡检人员]
|
||
* @property {string} phoneNumber = [巡检人员 联系方式]
|
||
* @property {string} inspectTime = [巡检时间]
|
||
*
|
||
* @property {string} taskName = [巡检任务名称]
|
||
* @property {string} taskTime = [巡检任务执行时间]
|
||
* @property {string} taskStatus = [巡检状态]
|
||
* @property {string} planName = [巡检计划]
|
||
* @property {string} executeDate = [巡检日期]
|
||
* @property {PointsType[]} points = [巡检点]
|
||
* @property {string[]} [itemslist] = [巡检项目]
|
||
* */
|
||
/**
|
||
* @description: 获取巡检任务列表
|
||
* @param { RequestParams<{ date?:string }> } data
|
||
* @return { Promise<RowsResult<InspectionListType>> }
|
||
*/
|
||
export const getInspectionList = (data) => {
|
||
return get('/api/inspection/today/list', filterParams(data))
|
||
}
|
||
|
||
|
||
/**
|
||
* @typedef PointType 巡检点 信息
|
||
* @property {string} imgUrl = [0必须拍照, 1允许跳检]
|
||
* @property {string} itemNames = [巡检人员]
|
||
* @property {string} itemStandards = [巡检人员 联系方式]
|
||
* @property {string} pointId = [巡检时间]
|
||
* @property {string} pointName = [巡检点名称]
|
||
* @property {string} remark = [巡检描述]
|
||
* @property { 0 | 1 } status = [巡检点状态 ]
|
||
* */
|
||
/**
|
||
* @typedef RoutesType 巡检路线 信息
|
||
* @property {string} inspectSetting = [0必须拍照, 1允许跳检]
|
||
* @property {string} description = [巡检人员]
|
||
* @property {string} routeId = [巡检人员 联系方式]
|
||
* @property {string} routeName = [巡检时间]
|
||
* @property {PointType[]} points = [巡检计划]
|
||
* */
|
||
/**
|
||
* @typedef InspectionMainType 巡检任务详情
|
||
* @property {0|1} inspectSetting = [0必须拍照, 1允许跳检]
|
||
* @property {string} inspectorName = [巡检人员]
|
||
* @property {string} villageName = [巡检小区]
|
||
* @property {string} phoneNumber = [巡检人员 联系方式]
|
||
* @property {string} inspectTime = [巡检时间]
|
||
* @property {string} planName = [巡检计划]
|
||
* @property {string} remindTime = [提醒时间]
|
||
* @property {string} taskId = [巡检任务ID]
|
||
* @property {string} taskName = [巡检任务名称]
|
||
* @property {string} taskTime = [巡检任务执行时间]
|
||
* @property {RoutesType[]} routes = [巡检路线信息]
|
||
* */
|
||
/**
|
||
* @description: 获取 巡检任务详情
|
||
* @param {string} id
|
||
* @return {Promise<DataResult<InspectionMainType>>}
|
||
*/
|
||
export const getInspectionMain = (id) => {
|
||
return get('/api/inspection/today/detail', {
|
||
taskId: id
|
||
})
|
||
}
|
||
|
||
|
||
/**
|
||
* @typedef inspectionPointParams 巡检任务表
|
||
* @property {string} pointId = [巡检点ID]
|
||
* @property {string} imgUrl = [巡检点,图片上传]
|
||
* @property {string} remark = [巡检点 巡检描述]
|
||
* @property {string} taskId = [巡检任务ID]
|
||
* @property {number} status = [巡检点状态] 0正常1异常
|
||
* */
|
||
/**
|
||
* @description: 巡检点上传
|
||
* @param {inspectionPointParams} data
|
||
*/
|
||
export const putInsepctionPoint = (data) => {
|
||
return post('/api/inspection/today/pointImg', data)
|
||
}
|