From 84a7a24288684e865fe5a1ec6a10e33319fa0532 Mon Sep 17 00:00:00 2001 From: Zy <1448159279@qq.com> Date: Fri, 15 May 2026 18:11:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=20=E6=8A=95=E8=AF=89?= =?UTF-8?q?=E8=AF=A6=E6=83=85=20=E6=8A=95=E8=AF=89=E5=88=97=E8=A1=A8=20?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=A4=84=E7=90=86=E4=BA=BA=E5=91=98=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wuye-manager-uniapp/App.vue | 15 ++ wuye-manager-uniapp/api/common.js | 73 +++++++ wuye-manager-uniapp/api/complain.js | 85 ++++++++ wuye-manager-uniapp/api/instrument.js | 4 + wuye-manager-uniapp/api/request.js | 183 +++++++++++------- wuye-manager-uniapp/jsdoc.types.js | 33 ++++ .../pageSubPack/complaint/Details.vue | 147 ++++++++------ .../pageSubPack/complaint/Details_handle.vue | 84 ++++++-- .../pageSubPack/complaint/handle.vue | 57 +++++- .../pageSubPack/complaint/handleUser.vue | 87 ++++----- .../pageSubPack/instrument/addreplacement.vue | 1 + .../pageSubPack/instrument/checkouthouse.vue | 69 +++---- wuye-manager-uniapp/pages.json | 6 +- 13 files changed, 604 insertions(+), 240 deletions(-) create mode 100644 wuye-manager-uniapp/api/common.js create mode 100644 wuye-manager-uniapp/api/complain.js create mode 100644 wuye-manager-uniapp/api/instrument.js create mode 100644 wuye-manager-uniapp/jsdoc.types.js diff --git a/wuye-manager-uniapp/App.vue b/wuye-manager-uniapp/App.vue index a13a99b..7dc69c1 100644 --- a/wuye-manager-uniapp/App.vue +++ b/wuye-manager-uniapp/App.vue @@ -117,5 +117,20 @@ export default { overflow: hidden; box-sizing: border-box; } +/* 单行省略 */ +.ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +/* 2行省略 */ +.ellipsis-2 { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} /* 1 电表 2水表 */ diff --git a/wuye-manager-uniapp/api/common.js b/wuye-manager-uniapp/api/common.js new file mode 100644 index 0000000..c8a8cf7 --- /dev/null +++ b/wuye-manager-uniapp/api/common.js @@ -0,0 +1,73 @@ +/** + * @Description: (计划中)公共接口 + * @Author: Zy + * @Date: 2026-05-15 11:37:01 + * @LastEditor: Zy + * @LastEditTime: 2026-05-15 17:02:25 + */ +import request, { + get, + post +} from "./request.js" + +/** + * @typedef EmployeeItem 员工信息项 + * @property {string} userId + * @property {string} tenantId + * @property {string} villageIds + * @property {string} roleName + * @property {string} userName + * @property {string} nickName + * @property {string} userType + * @property {string} email + * @property {string} phonenumber + * @property {string} sex + * @property {string} avatar + * @property {string} status + * @property {string} loginIp + * @property {string} loginDate + * @property {string} remark + * @property {string} createTime + * @property {string} roles + * @property {string} roleIds + * @property {string} postIds + * @property {string} roleId + */ + +/** + * 获取对应类型的员工信息列表 + * @param {RoleKeyEnum} roleKey - 角色标识 + * @param {string} [keyword=''] - 搜索关键词(可选),手机号/姓名 + * @returns {Promise>} + */ +export function getSystemUsers_employee(roleKey, keyword) { + return get(`/manage/repair/person/users?roleKey=${roleKey}&keyword=${keyword}`) +} + + + + + +/** + * @typedef HouseItem 房屋信息项 + * @property {string} addressCn + * @property {string} addressHyphen + * @property {string} buildingName + * @property {number} floorNo + * @property {string} houseId + * @property {string} houseNo + * @property {string} userType + * @property {string} residentName + * @property {number} unitNo + */ +/** + * 获取 小区房屋 列表 + * @param {Object} data - 请求参数 + * @param {number} data.pageNum - 页码(第几页) + * @param {number} data.pageSize - 每页条数 + * @param {string} [keyword=''] - 搜索关键词(可选),房屋号/业主姓名 + * @returns {Promise>} + */ +export function getVillageHouseList_keyword(data, keyword) { + return get(`/manage/replace/sdb/village/house?pageSize=${data.pageSize}&pageNum=${data.pageNum}&keyword=${keyword}`) +} diff --git a/wuye-manager-uniapp/api/complain.js b/wuye-manager-uniapp/api/complain.js new file mode 100644 index 0000000..1ddcf62 --- /dev/null +++ b/wuye-manager-uniapp/api/complain.js @@ -0,0 +1,85 @@ +/** + * @Description: 投诉详情API + * @Author: Zy + * @Date: 2026-05-15 08:50:47 + * @LastEditor: Zy + * @LastEditTime: 2026-05-15 16:47:31 + */ +import request, { + filterParams, + get, + put, + post +} from "./request.js"; + +/** + * 获取投诉信息分页列表 + * @param {Object} data - 请求参数 + * @param {number} data.pageNum - 页码(第几页) + * @param {number} data.pageSize - 每页条数 + * @param {number} [data.status] - 投诉状态(可选),不传=全部,0=待处理,2=已完成 + * @returns {Promise<{ + * code: number, + * msg: string, + * total: number, + * rows: Array<{ + * id: string, + * typeId: number, + * typeName: string, + * problemDes: string, + * complaintName: string, + * phone: string, + * villageId: number, + * problemImageUrl: string, + * status: string, + * createTime: string|null, + * handleId: number|null, + * handleName: string|null, + * handleContent: string|null + * }> + * }>} 返回接口响应结果 + */ +export const getComplainList = (data) => { + return get('/manage/complain/list', filterParams(data)) +} +/** + * 获取 某一个 投诉详情 + * @param {string} id 投诉id + */ +export const getComplaniMain = (id) => { + return post('/manage/complain/list', data) +} + +/** + * @description: 处理投诉API + * @param {Object} data + * @param {string} data.id 处理人员id + * @param {string} data.handleContent 处理描述 + */ +export const putComplainProcess = (data) => { + return put('/manage/complain/process', data) +} + + +/** + * @typedef complainMain 投诉详情内容 + * @property {number} typeId + * @property {string} typeName + * @property {string} problemDes + * @property {string} complaintName + * @property {string} phone + * @property {string} villageId + * @property {string} problemImageUrl + * @property {string} status + * @property {string} createTime + * @property {string} handleName + * @property {string} handleContent + */ +/** + * @description: 查询 具体 投诉详情 + * @param {string} 投诉 id + * @return {Promise>} + */ +export const getComplainMain = (id) => { + return get('/manage/complain/detail?id=' + id) +} diff --git a/wuye-manager-uniapp/api/instrument.js b/wuye-manager-uniapp/api/instrument.js new file mode 100644 index 0000000..8529763 --- /dev/null +++ b/wuye-manager-uniapp/api/instrument.js @@ -0,0 +1,4 @@ +import request, { + get, + post +} from "./request.js" diff --git a/wuye-manager-uniapp/api/request.js b/wuye-manager-uniapp/api/request.js index 949128f..8031dac 100644 --- a/wuye-manager-uniapp/api/request.js +++ b/wuye-manager-uniapp/api/request.js @@ -1,92 +1,133 @@ let baseUrl = ''; if (process.env.NODE_ENV === 'development') { - baseUrl = 'http://192.168.0.239:8080'; // 开发环境 + baseUrl = 'http://192.168.0.239:8080'; // 开发环境 } else { - baseUrl = 'http://192.168.0.224:8080'; // 生产环境 + baseUrl = 'http://192.168.0.224:8080'; // 生产环境 } export default function request(url, data = {}, method = "GET") { - return new Promise((resolve, reject) => { - uni.showLoading({ - title: '请求中...', - mask: true - }); + return new Promise((resolve, reject) => { + uni.showLoading({ + title: '请求中...', + mask: true + }); - uni.request({ - url: baseUrl + url, - data: data, - method: method, - header: { - "Authorization": "Bearer " + (uni.getStorageSync("token") || ''), - "clientid": "butler", - 'content-type': 'application/json' - }, - success: (res) => { - uni.hideLoading(); + uni.request({ + url: baseUrl + url, + data: data, + method: method, + header: { + "Authorization": "Bearer " + (uni.getStorageSync("token") || ''), + "clientid": "butler", + 'content-type': 'application/json' + }, + success: (res) => { + uni.hideLoading(); - // HTTP 失败 - if (res.statusCode !== 200) { - reject({ msg: `请求异常 ${res.statusCode}`, code: res.statusCode }); - return; - } + // HTTP 失败 + if (res.statusCode !== 200) { + reject({ + msg: `请求异常 ${res.statusCode}`, + code: res.statusCode + }); + return; + } - const resData = res.data || {}; + const resData = res.data || {}; - // token 过期 - if (resData.code === 401) { - uni.showToast({ title: '登录过期,请重新登录', icon: 'none' }); - uni.clearStorageSync('token'); - setTimeout(() => { - uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' }); - }, 1500); - reject({ msg: '登录过期', code: 401 }); - return; - } + // token 过期 + if (resData.code === 401) { + uni.showToast({ + title: '登录过期,请重新登录', + icon: 'none' + }); + uni.clearStorageSync('token'); + setTimeout(() => { + uni.reLaunch({ + url: '/pageSubPack/loginSub/pwd-login' + }); + }, 1500); + reject({ + msg: '登录过期', + code: 401 + }); + return; + } - // 成功 - if (resData.code === 200) { - resolve(resData); - } - // 业务失败 - else { - reject({ msg: resData.msg || '请求失败', code: resData.code, data: resData }); - } - }, - fail: (err) => { - uni.hideLoading(); - reject({ msg: '网络异常', code: -1, raw: err }); - } - }); - }); + // 成功 + if (resData.code === 200) { + resolve(resData); + } + // 业务失败 + else { + reject({ + msg: resData.msg || '请求失败', + code: resData.code, + data: resData + }); + } + }, + fail: (err) => { + uni.hideLoading(); + reject({ + msg: '网络异常', + code: -1, + raw: err + }); + } + }); + }); } export const get = (url, data) => request(url, data, 'GET'); export const post = (url, data) => request(url, data, 'POST'); +export const put = (url, data) => request(url, data, 'PUT'); // export const deleteMethod = (url, data) => request(url, data, 'DELETE'); // export const putMethod = (url, data) => request(url, data, 'PUT'); // 上传 export const upload = (filePath, url) => { - return new Promise((resolve, reject) => { - uni.uploadFile({ - url: baseUrl + url, - filePath: filePath, - name: 'file', - header: { - "Authorization": "Bearer " + (uni.getStorageSync("token") || ''), - "clientid": "resident" - }, - success: (res) => { - try { - const data = JSON.parse(res.data); - resolve(data.data || ''); // 直接返回图片地址 - } catch (e) { - resolve(''); - } - }, - fail: (err) => { - reject(err); - } - }); - }); + return new Promise((resolve, reject) => { + uni.uploadFile({ + url: baseUrl + url, + filePath: filePath, + name: 'file', + header: { + "Authorization": "Bearer " + (uni.getStorageSync("token") || ''), + "clientid": "resident" + }, + success: (res) => { + try { + const data = JSON.parse(res.data); + resolve(data.data || ''); // 直接返回图片地址 + } catch (e) { + resolve(''); + } + }, + fail: (err) => { + reject(err); + } + }); + }); }; + + + + + +/** + * 过滤请求参数:移除值为 null / undefined / 空字符串 的字段 + * 用于避免将空参数拼接到 URL 或请求体中 + * @param {Object|null|undefined} params - 原始请求参数 + * @returns {Object} 过滤后的干净参数对象,只保留有效值 + */ +export function filterParams(params) { + if (!params) return {} + return Object.keys(params).reduce((acc, key) => { + const value = params[key] + if (value !== null && value !== undefined && value !== '') { + acc[key] = value + } + return acc + }, {}) +} diff --git a/wuye-manager-uniapp/jsdoc.types.js b/wuye-manager-uniapp/jsdoc.types.js new file mode 100644 index 0000000..affd4f1 --- /dev/null +++ b/wuye-manager-uniapp/jsdoc.types.js @@ -0,0 +1,33 @@ +// 全局 JSDoc 类型定义 全项目所有文件通用 + +/** + * 【全局】通用分页接口返回结构1 + * @template T - 列表项类型 + * @typedef {Object} RowsResult + * @property {number} code 响应码,200=成功 + * @property {string} msg 响应消息 + * @property {number} total 总条数 + * @property {T[]} rows 数据列表 + */ + +/** + * 【全局】通用接口返回结构2 + * @template T - 列表项类型 + * @typedef {Object} DataResult + * @property {number} code 响应码,200=成功 + * @property {string} msg 响应消息 + * @property {T} data 数据列表 + */ + + +/** + * 【全局】角色标识枚举 + * @typedef {'manage'|'repair'|'inspection'|'EquipmentMaintenance'|'complainUser'} RoleKeyEnum + * + * @enum {RoleKeyEnum} + * @property {'manage'} manage - 物业管理员 + * @property {'repair'} repair - 小区维修人员 + * @property {'inspection'} inspection - 巡检人员 + * @property {'EquipmentMaintenance'} EquipmentMaintenance - 设备维护人员 + * @property {'complainUser'} complainUser - 投诉处理人员 + */ diff --git a/wuye-manager-uniapp/pageSubPack/complaint/Details.vue b/wuye-manager-uniapp/pageSubPack/complaint/Details.vue index 26ad80b..cb77e56 100644 --- a/wuye-manager-uniapp/pageSubPack/complaint/Details.vue +++ b/wuye-manager-uniapp/pageSubPack/complaint/Details.vue @@ -9,21 +9,28 @@ > - - + + - {{ item.title }} - 待处理 + {{ item.typeName }} + + 待处理 + 已完成 - {{ item.desction }} + {{ item.problemDes }} 投诉人: - {{ item.user }} + {{ item.complaintName }} 手机号: @@ -32,9 +39,9 @@ 投诉时间: - {{ item.time }} + {{ item.createTime }} - + 处理 @@ -45,18 +52,22 @@ - @@ -128,12 +156,11 @@ function handleComplaint() { padding: 20rpx 40rpx; .detail_list { .item { - height: 390rpx; background: #ffffff; border-radius: 16rpx; margin-bottom: 20rpx; box-sizing: border-box; - padding: 30rpx 36rpx 55rpx 54rpx; + padding: 30rpx 36rpx 30rpx 54rpx; .title { font-weight: 400; font-size: 32rpx; diff --git a/wuye-manager-uniapp/pageSubPack/complaint/Details_handle.vue b/wuye-manager-uniapp/pageSubPack/complaint/Details_handle.vue index 488ec2e..74d5a3a 100644 --- a/wuye-manager-uniapp/pageSubPack/complaint/Details_handle.vue +++ b/wuye-manager-uniapp/pageSubPack/complaint/Details_handle.vue @@ -6,13 +6,14 @@ 投诉状态 - 待处理 - + 待处理 + 已完成 - - 已完成处理,已联系工作人员粘贴标语提醒,并派人定时巡视。 + + + {{ complainInfo.handleContent }} @@ -24,28 +25,30 @@ 投诉类型 - 社区服务 + + {{ complainInfo.typeName }} + 问题描述 - 投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容 - + {{ complainInfo.problemDes }} 投诉人姓名 - 匿名 + + {{ complainInfo.complaintName }} + 手机号码 - 无 + {{ complainInfo.phone }} @@ -54,7 +57,7 @@ - + 处理 @@ -73,7 +76,10 @@ @@ -176,6 +227,7 @@ function handleSelecthouse() { .img { width: 132rpx; height: 132rpx; + border: 1rpx solid #efefef; } } } diff --git a/wuye-manager-uniapp/pageSubPack/complaint/handle.vue b/wuye-manager-uniapp/pageSubPack/complaint/handle.vue index d357cd9..678ba8f 100644 --- a/wuye-manager-uniapp/pageSubPack/complaint/handle.vue +++ b/wuye-manager-uniapp/pageSubPack/complaint/handle.vue @@ -3,12 +3,22 @@ 处理人员 - {{ checkoutinfo.username ? checkoutinfo.username : '请选择' }} + + {{ checkoutinfo.userName ? checkoutinfo.userName : '请选择' }} + 处理描述 -