From 8a2999d862d875971a074f07df814752f6ac1ae2 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 23 三月 2026 15:28:36 +0800
Subject: [PATCH] 异常反馈处理单 处理原因 改为必填项 首训末 检验单 保存的时候 如果表头选着不合格 表体检验项全是合格 进行提示 修复 工作联系单查询 点击 查看详情后,更新阅读状态 后 页面刷新不会变的问题
---
utils/common.js | 60 +++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 35 insertions(+), 25 deletions(-)
diff --git a/utils/common.js b/utils/common.js
index 25f2f50..f52d462 100644
--- a/utils/common.js
+++ b/utils/common.js
@@ -340,18 +340,22 @@
})
})
}
- //娌℃湁娣诲姞閿佺殑寮傛鏌ヨ
+ //娌℃湁娣诲姞閿佺殑寮傛鏌ヨ
async doRequest2Async({
url,
data,
method,
+ showLoading = true,
}) {
return new Promise((resolve, reject) => {
// that = that || this;
let errorTip = null;
- uni.showLoading({
- title: '鍔犺浇涓�...'
- })
+ if (showLoading) {
+ uni.showLoading({
+ title: '鍔犺浇涓�...'
+ })
+ }
+
uni.request({
method: method || "GET",
url: this.serverUrl + url,
@@ -363,7 +367,9 @@
reject(err)
},
complete: () => {
- uni.hideLoading()
+ if (showLoading) {
+ uni.hideLoading()
+ }
}
})
})
@@ -395,7 +401,7 @@
console.log('鎾斁鏆傚仠锛岄攢姣�');
innerAudioContext.destroy();
});
-
+
}
// playSound(e) {
// // 鍏ㄥ眬缁存姢涓�涓煶棰戝疄渚嬶紝闃叉缂撳瓨婧㈠嚭
@@ -459,28 +465,32 @@
return handler(key, match);
});
}
-
- fieldListFilterRole({FieldList, ExcludeKeys = [] ,RoleList = null}) {
- if(!RoleList) {
+
+ fieldListFilterRole({
+ FieldList,
+ ExcludeKeys = [],
+ RoleList = null
+ }) {
+ if (!RoleList) {
RoleList = [
/^[a-zA-Z]+$/,
/id$/i
]
}
- if(!Array.isArray(RoleList)){
+ if (!Array.isArray(RoleList)) {
return {
status: false,
data: null,
Message: "杩囨护瀛楁鍒楄〃澶辫触锛岃鍒欏繀椤绘槸鏁扮粍銆�"
}
}
-
+
let FieldListCache = Array(...FieldList)
-
+
RoleList.forEach(role => {
FieldListCache = FieldListCache.filter(elem => !role.test(elem.ColmCols))
})
-
+
FieldListCache = FieldListCache.filter(elem => !ExcludeKeys.includes(elem.ColmCols))
return {
status: true,
@@ -488,34 +498,34 @@
Message: ""
}
}
-
- emptyValueFilter(item, fieldList){
+
+ emptyValueFilter(item, fieldList) {
return fieldList.filter(e => {
return item[e.ColmCols]
})
}
-
- httpFormatWs(httpUrl=this.serverUrl) {
- if(httpUrl.indexOf("http://") === 0){
+
+ httpFormatWs(httpUrl = this.serverUrl) {
+ if (httpUrl.indexOf("http://") === 0) {
httpUrl = httpUrl.replace("http://", "")
httpUrl = httpUrl.substring(0, httpUrl.length - 1)
let BackSlashLast = httpUrl.lastIndexOf('/')
httpUrl = httpUrl.substring(0, BackSlashLast)
- httpUrl = "ws://" + httpUrl.split(":")[0]+":12345/ws"
- }else if(httpUrl.indexOf("https://") === 0) {
+ httpUrl = "ws://" + httpUrl.split(":")[0] + ":12345/ws"
+ } else if (httpUrl.indexOf("https://") === 0) {
httpUrl = httpUrl.replace("https://", "")
httpUrl = httpUrl.substring(0, httpUrl.length - 1)
let BackSlashLast = httpUrl.lastIndexOf('/')
httpUrl = httpUrl.substring(0, BackSlashLast)
- httpUrl = "wss://" + httpUrl.split(":")[0]+":12345/ws"
- }else{
+ httpUrl = "wss://" + httpUrl.split(":")[0] + ":12345/ws"
+ } else {
// 鎻愮ず浼犲叆杩炴帴閿欒
}
-
+
return httpUrl
}
-
-
+
+
}
export const CommonUtils = new commonUtils()
\ No newline at end of file
--
Gitblit v1.9.1