From 82200a36173e9c57896797c96912fe99a20b63d3 Mon Sep 17 00:00:00 2001 From: Zy <1448159279@qq.com> Date: Tue, 19 May 2026 09:23:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E8=AE=B0=E5=BD=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wuye-manager-uniapp/api/BaseUrl.js | 15 + wuye-manager-uniapp/api/common.js | 22 +- wuye-manager-uniapp/api/complain.js | 2 +- wuye-manager-uniapp/api/insepction.js | 74 ++++ wuye-manager-uniapp/api/instrument.js | 48 ++- wuye-manager-uniapp/api/request.js | 7 +- .../components/filePicker/filePicker.vue | 8 +- wuye-manager-uniapp/jsdoc.types.js | 23 +- .../inspection/inspection_main.vue | 209 +++++---- .../inspection/inspection_record.vue | 405 ++++++++++-------- .../inspection/inspection_upload.vue | 292 +++++++------ .../inspection/toDays_inscpection.vue | 7 + .../pageSubPack/instrument/addreplacement.vue | 63 ++- .../pageSubPack/instrument/checkouthouse.vue | 47 +- .../instrument/replacement_record.vue | 73 ++-- wuye-manager-uniapp/pages.json | 6 +- wuye-manager-uniapp/utils/time.js | 46 ++ 17 files changed, 880 insertions(+), 467 deletions(-) create mode 100644 wuye-manager-uniapp/api/BaseUrl.js create mode 100644 wuye-manager-uniapp/api/insepction.js create mode 100644 wuye-manager-uniapp/utils/time.js diff --git a/wuye-manager-uniapp/api/BaseUrl.js b/wuye-manager-uniapp/api/BaseUrl.js new file mode 100644 index 0000000..eeee3c9 --- /dev/null +++ b/wuye-manager-uniapp/api/BaseUrl.js @@ -0,0 +1,15 @@ +/** + * @Description: 抽离 公共基础地址 + * @Author: Zy + * @Date: 2026-05-18 15:36:10 + * @LastEditor: Zy + * @LastEditTime: 2026-05-18 15:36:21 + */ +let baseUrl = '' + +if (process.env.NODE_ENV === 'development') { + baseUrl = 'http://192.168.0.239:8080' // 开发环境 +} else { + baseUrl = 'http://192.168.0.239:8080' // 生产环境 +} +export default baseUrl; diff --git a/wuye-manager-uniapp/api/common.js b/wuye-manager-uniapp/api/common.js index 4ac9cf4..d7e6449 100644 --- a/wuye-manager-uniapp/api/common.js +++ b/wuye-manager-uniapp/api/common.js @@ -3,9 +3,12 @@ * @Author: Zy * @Date: 2026-05-15 11:37:01 * @LastEditor: Zy - * @LastEditTime: 2026-05-15 17:02:25 + * @LastEditTime: 2026-05-18 15:34:07 */ -import request, { get, post } from './request.js' +import request, { + get, + post +} from './request.js' /** * @typedef EmployeeItem 员工信息项 @@ -61,8 +64,19 @@ export function getSystemUsers_employee(roleKey, keyword) { * @param {string} [keyword=''] - 搜索关键词(可选),房屋号/业主姓名 * @returns {Promise>} */ -export function getVillageHouseList_keyword(data, keyword) { +export function getVillageHouseList_keyword(data, searchValue = '') { return get( - `/manage/replace/sdb/village/house?pageSize=${data.pageSize}&pageNum=${data.pageNum}&keyword=${keyword}` + `/manage/replace/sdb/village/house?pageSize=${data.pageSize}&pageNum=${data.pageNum}&searchValue=${searchValue}` ) } + + + +/** + * @description: 管家端通用 文件上传 + * @param {FormData} file + * @return + */ +export function uploadFile(file) { + return post('/resource/oss/upload', file) +} diff --git a/wuye-manager-uniapp/api/complain.js b/wuye-manager-uniapp/api/complain.js index 1ddcf62..f0c6ffb 100644 --- a/wuye-manager-uniapp/api/complain.js +++ b/wuye-manager-uniapp/api/complain.js @@ -3,7 +3,7 @@ * @Author: Zy * @Date: 2026-05-15 08:50:47 * @LastEditor: Zy - * @LastEditTime: 2026-05-15 16:47:31 + * @LastEditTime: 2026-05-16 15:42:36 */ import request, { filterParams, diff --git a/wuye-manager-uniapp/api/insepction.js b/wuye-manager-uniapp/api/insepction.js new file mode 100644 index 0000000..1bce4af --- /dev/null +++ b/wuye-manager-uniapp/api/insepction.js @@ -0,0 +1,74 @@ +/** + * @Description: 巡检记录 API + * @Author: Zy + * @Date: 2026-05-16 15:43:07 + * @LastEditor: Zy + * @LastEditTime: 2026-05-18 16:35:05 + */ + +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 {string} taskName = [巡检任务名称] + * @property {string} taskTime = [巡检任务执行时间] + * @property {string} taskStatus = [巡检状态] + * @property {string} planName = [巡检计划] + * @property {string} inspectorName = [巡检人员] + * @property {string} executeDate = [巡检日期] + * @property {PointsType[]} points = [巡检点] + * @property {string[]} [itemslist] = [巡检项目] + * */ +/** + * @description: 获取巡检任务列表 + * @param { RequestParams<{ date?:string }> } data + * @return { Promise> } + */ +export const getInspectionList = (data) => { + return get('/api/inspection/today/list', filterParams(data)) +} + + + +/** + * @description: 获取 巡检任务详情 + * @param {string} id + * @return + */ +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) +} diff --git a/wuye-manager-uniapp/api/instrument.js b/wuye-manager-uniapp/api/instrument.js index 8529763..e143d3b 100644 --- a/wuye-manager-uniapp/api/instrument.js +++ b/wuye-manager-uniapp/api/instrument.js @@ -1,4 +1,50 @@ +/** + * @Description: 仪表换新API + * @Author: Zy + * @Date: 2026-05-16 15:53:23 + * @LastEditor: Zy + * @LastEditTime: 2026-05-16 16:38:54 + */ import request, { + filterParams, get, - post + post, + put } from "./request.js" + + +/** + * 设备类型枚举 + * @typedef {1 | 2} DeviceType + * @description 1=水表 2=电表 + */ +/** + * @typedef ReplaceMentRecordList 巡检任务表 + * @property {string} deviceCode = [设备编号] + * @property {DeviceType} deviceType = [设备类型] + * @property {string} houseId = [楼栋ID] + * @property {string} buildingName = [楼栋名称] + * @property {string} unitNo = [单元号] + * @property {string} houseNo = [房屋号] + * @property {string} addressCn = [房屋地址] + * @property {string} addressHyphen = [房屋地址] + * @property {string} createTime = [创建时间] + * */ + +/** + * 获取仪表换新记录 + * @param {RequestParams} data 请求参数 + * @return {Promise>} + */ +export const getReplaceMainList = (data) => { + return get('/manage/replace/sdb/record/list', filterParams(data)) +} + + +/** + * @description: 添加仪表API + * @param {{ deviceType:DeviceType, deviceCode:string,houseId:string }} data + */ +export const AddReplaceMainList = (data) => { + return put('/manage/replace/sdb/replace/device', filterParams(data)) +} diff --git a/wuye-manager-uniapp/api/request.js b/wuye-manager-uniapp/api/request.js index 7ae9447..40906da 100644 --- a/wuye-manager-uniapp/api/request.js +++ b/wuye-manager-uniapp/api/request.js @@ -1,9 +1,4 @@ -let baseUrl = '' -if (process.env.NODE_ENV === 'development') { - baseUrl = 'http://192.168.0.239:8080' // 开发环境 -} else { - baseUrl = 'http://192.168.0.239:8080' // 生产环境 -} +import baseUrl from './BaseUrl.js' export default function request(url, data = {}, method = 'GET') { return new Promise((resolve, reject) => { diff --git a/wuye-manager-uniapp/components/filePicker/filePicker.vue b/wuye-manager-uniapp/components/filePicker/filePicker.vue index 1bae843..e185032 100644 --- a/wuye-manager-uniapp/components/filePicker/filePicker.vue +++ b/wuye-manager-uniapp/components/filePicker/filePicker.vue @@ -24,6 +24,7 @@ diff --git a/wuye-manager-uniapp/pageSubPack/inspection/toDays_inscpection.vue b/wuye-manager-uniapp/pageSubPack/inspection/toDays_inscpection.vue index 3984583..1b4cef9 100644 --- a/wuye-manager-uniapp/pageSubPack/inspection/toDays_inscpection.vue +++ b/wuye-manager-uniapp/pageSubPack/inspection/toDays_inscpection.vue @@ -46,6 +46,7 @@ diff --git a/wuye-manager-uniapp/pageSubPack/instrument/checkouthouse.vue b/wuye-manager-uniapp/pageSubPack/instrument/checkouthouse.vue index 9f6a877..8d9ef38 100644 --- a/wuye-manager-uniapp/pageSubPack/instrument/checkouthouse.vue +++ b/wuye-manager-uniapp/pageSubPack/instrument/checkouthouse.vue @@ -4,23 +4,25 @@ 请输入关键字进行搜索 - + + + 暂无数据 + @@ -54,18 +59,31 @@ import { getVillageHouseList_keyword } from '@/api/common.js' const Searching = ref(true) const queryParmas = ref({ - keyword: '', + searchValue: '', pageNum: 1, pageSize: 10 }) /** 点击时切换到input,并聚焦 */ function handleClick() { Searching.value = false + queryParmas.value.searchValue = '' } /** 判断 失去焦点时 切换回 view */ function handleInput() { - if (queryParmas.value.keyword.trim()) { + const value = queryParmas.value.searchValue.trim() + if (value) { + handleSearch() + } else if (value === '') { + queryParmas.value.searchValue = '' Searching.value = true + handleSearch() + } +} +function handleInputString() { + if (queryParmas.value.searchValue.trim() === '') { + queryParmas.value.searchValue = '' + Searching.value = true + handleSearch() } } @@ -102,13 +120,20 @@ function getlist() { title: '加载中', mask: true }) - getVillageHouseList_keyword(queryParmas.value, queryParmas.value.keyword) + getVillageHouseList_keyword(queryParmas.value, queryParmas.value.searchValue) .then(res => { // 追加数据(正确方式) searchlist.value = [...searchlist.value, ...res.rows] + total.value = res.total // 判断是否还有更多 hasMore.value = searchlist.value.length < total.value }) + .catch(() => { + uni.showToast({ + icon: 'error', + title: '网络异常' + }) + }) .finally(() => { isLoading.value = false uni.hideLoading() @@ -126,6 +151,7 @@ function resetList() { // Search function handleSearch() { + hasMore.value = true queryParmas.value.pageNum = 1 queryParmas.value.pageSize = 10 searchlist.value = [] @@ -211,6 +237,13 @@ function handleSelecthouse() { } } } + .noData { + text-align: center; + color: rgba(0, 0, 0, 0.26); + font-size: larger; + padding-top: 50rpx; + letter-spacing: 10rpx; + } .action_btn { width: 670rpx; diff --git a/wuye-manager-uniapp/pageSubPack/instrument/replacement_record.vue b/wuye-manager-uniapp/pageSubPack/instrument/replacement_record.vue index aba8bc4..beb3292 100644 --- a/wuye-manager-uniapp/pageSubPack/instrument/replacement_record.vue +++ b/wuye-manager-uniapp/pageSubPack/instrument/replacement_record.vue @@ -17,16 +17,16 @@ - {{ item.title }} + {{ item.addressCn }} - 换新时间时间:{{ item.time }} + 换新时间时间:{{ item.createTime }} - 电表 - 水表 + 电表 + 水表 @@ -42,7 +42,10 @@