From 48191dbe579601dfc1147673cefccd94422fe59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Thu, 12 Feb 2026 15:07:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=85=E9=9A=9C=E4=B8=8A=E6=8A=A5=E5=B0=8F?= =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/enums/fault.js | 35 +++++++++ common/http.interceptor.js | 10 +-- page_shanghu/gongzuotai/shgl.vue | 129 +++++++++---------------------- page_user/guzhang/guzhanglv.vue | 51 +++++------- page_user/guzhang/index.vue | 6 +- store/index.js | 18 ++--- 6 files changed, 107 insertions(+), 142 deletions(-) create mode 100644 common/enums/fault.js diff --git a/common/enums/fault.js b/common/enums/fault.js new file mode 100644 index 0000000..f6103d1 --- /dev/null +++ b/common/enums/fault.js @@ -0,0 +1,35 @@ +/** + * 故障申报状态(与后台一致) + */ +export const FaultStatus = { + IGNORED: { label: '已忽略', value: '0' }, + PENDING: { label: '待处理', value: '1' }, + COMPLETED: { label: '已完成', value: '3' } +} + +/** 仅待处理可审核 */ +export const FAULT_PENDING = FaultStatus.PENDING.value + +/** + * 根据状态码获取展示文案 + * @param {string} status appealStatus + * @returns {string} + */ +export function getFaultStatusLabel(status) { + if (status == null || status === '') return '未知' + const map = { + [FaultStatus.IGNORED.value]: FaultStatus.IGNORED.label, + [FaultStatus.PENDING.value]: FaultStatus.PENDING.label, + [FaultStatus.COMPLETED.value]: FaultStatus.COMPLETED.label + } + return map[status] || '未知' +} + +/** + * 是否为可审核状态(待处理) + * @param {string} status appealStatus + * @returns {boolean} + */ +export function canAuditFault(status) { + return status === FAULT_PENDING +} diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 513850b..464401c 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -1,14 +1,14 @@ const install = (Vue, vm) => { uni.setStorageSync('deptId', 100); Vue.prototype.$u.http.setConfig({ - // baseUrl: 'http://192.168.1.8:4101', //键辉本地 - // baseUrl: 'http://192.168.2.221:4101', //景森本地 - baseUrl: 'https://ele.ccttiot.com/prod-api', //线上 小鹿appid: wx8a05cf95418a6859 小兔骑骑appid:wx38f96c87621a87ab 遇福兴https://fu.chuantewulian.cn wxcb1d6a5d9dca8bbe + baseUrl: 'http://192.168.1.3:4101', //键辉本地 + // baseUrl: 'http://192.168.2.221:4101', //景森本地 + // baseUrl: 'https://ele.ccttiot.com/prod-api', //线上 小鹿appid: wx8a05cf95418a6859 小兔骑骑appid:wx38f96c87621a87ab 遇福兴https://fu.chuantewulian.cn wxcb1d6a5d9dca8bbe // baseUrl: 'https://cc.ccttiot.com/prod-api', //叉车线上 // baseUrl:'https://ysd.chuantewulian.cn/prod-api', //嵛山岛线上api 嵛山岛appid:wx4d178f8c80348214 - loadingText: '努力加载中~', + loadingText: '努力加载中~', loadingTime: 10000, - // 设置自定义头部content-type + // 设置自定义头部content-type header: { 'content-type': 'application/json;charset=UTF-8', }, diff --git a/page_shanghu/gongzuotai/shgl.vue b/page_shanghu/gongzuotai/shgl.vue index 886934d..64e0c51 100644 --- a/page_shanghu/gongzuotai/shgl.vue +++ b/page_shanghu/gongzuotai/shgl.vue @@ -11,14 +11,8 @@ 编号: {{item.vehicleCode}} - - {{ getStatusText(item.appealStatus) }} + + {{ getFaultStatusLabel(item.appealStatus) }} @@ -48,18 +42,11 @@ - + - - 忽略 - - - 处理 - - - 维修完成 - + 忽略 + 已完成 @@ -73,6 +60,8 @@