From 13203a04c9c4ee0ac0b95a6b92b11eeb4d95ebdc Mon Sep 17 00:00:00 2001
From: 刘淇 <290219706@qq.com>
Date: Fri, 16 Oct 2026 15:33:51 +0800
Subject: [PATCH] 首页 统计
---
pages-sub/daily/maintain-manage/add-record.vue | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
pages-sub/daily/maintain-manage/finish-plan-detail.vue | 13 ++++++++++---
pages-sub/problem/regional-order-manage/list-detail.vue | 4 ++--
pages/index/index.vue | 375 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4 files changed, 290 insertions(+), 212 deletions(-)
diff --git a/pages-sub/daily/maintain-manage/add-record.vue b/pages-sub/daily/maintain-manage/add-record.vue
index 85aba29..3c91a41 100644
--- a/pages-sub/daily/maintain-manage/add-record.vue
+++ b/pages-sub/daily/maintain-manage/add-record.vue
@@ -4,14 +4,21 @@
-
+
+
-
-
+
+
+
{{ item.unit }}
@@ -132,10 +139,14 @@
-
-
-
+
+ 请去平台配置业务类型字段
+
+
+
+
+
@@ -646,31 +657,51 @@ export default {
* 7/8/9/11 的值是数组或对象,async-validator 的 required 按默认 string 类型判定,
* 会放过「空数组」「null」⇒ 必须用 validator 显式判空,否则未选也能提交
*/
- buildRequiredRule(field: any) {
- const type = field.fieldType
- if (type === 6 || type === 7 || type === 8) {
- const action = type === 6 ? '请选择' : '请上传'
- return {
- required: true,
- trigger: 'change',
- validator: (rule, value, callback) => {
- Array.isArray(value) && value.length > 0 ? callback() : callback(new Error(`${action}${field.fieldName}`))
- }
- }
+buildRequiredRule(field: any) {
+ const type = field.fieldType
+ if (type === 6 || type === 7 || type === 8) {
+ const action = type === 6 ? '请选择' : '请上传'
+ return {
+ required: true,
+ trigger: ['change','blur'],
+ validator: (rule, value, callback) => {
+ Array.isArray(value) && value.length > 0 ? callback() : callback(new Error(`${action}${field.fieldName}`))
}
- if (type === 9 || type === 11) {
- return {
- required: true,
- trigger: 'change',
- validator: (rule, value, callback) => {
- value ? callback() : callback(new Error(type === 9 ? `请选择${field.fieldName}` : `请选择${field.fieldName}的位置`))
- }
+ }
+ }
+ if (type === 9 || type === 11) {
+ return {
+ required: true,
+ trigger: ['change','blur'],
+ validator: (rule, value, callback) => {
+ value ? callback() : callback(new Error(type === 9 ? `请选择${field.fieldName}` : `请选择${field.fieldName}的位置`))
+ }
+ }
+ }
+ // ========= 新增:数值类型单独校验 =========
+ if (type === 1) {
+ return {
+ required: true,
+ trigger: ['change','blur'],
+ validator: (rule, value, callback) => {
+ // 空字符串、null、undefined 才是空;数字 1,7,100 全部合法
+ if (value === '' || value === null || value === undefined) {
+ callback(new Error(`请填写${field.fieldName}`))
+ } else {
+ callback()
}
}
- // 1数值/2文本/4日期/5布尔/10链接 为字符串;3枚举/6单选为选择项
- const action = type === 3 || type === 5 ? '请选择' : '请填写'
- return { required: true, message: `${action}${field.fieldName}`, trigger: 'change' }
- },
+ }
+ }
+ // 2文本 /4日期 /5布尔 /10链接
+ const action = type === 3 || type === 5 ? '请选择' : '请填写'
+ return {
+ required: true,
+ message: `${action}${field.fieldName}`,
+ trigger: ['change','blur']
+ }
+},
+
/** 幂等流水号(后端按 userId+clientSeq 去重,命中则返回已存在的 recordId) */
genClientSeq() {
return `${Date.now()}-${Math.random().toString(16).slice(2, 10)}`
@@ -910,6 +941,12 @@ this.$refs.inspectFormRef.validateField(code)
* 重试安全:commitId 一旦取到就缓存住,重试只补写 ②(② 自身按 clientSeq 幂等),避免重复创建养护记录
*/
async submitInspect() {
+ // 调试打印,打开小程序控制台查看
+ console.log('=====调试=====')
+ console.log('dynamicFields', this.dynamicFields)
+ this.dynamicFields.forEach(item=>{
+ console.log(item.fieldCode, this.inspectForm[item.fieldCode], typeof this.inspectForm[item.fieldCode])
+ })
try {
await this.$refs.inspectFormRef.validate()
const dynamicValues = this.buildDynamicFields()
@@ -1068,4 +1105,13 @@ this.$refs.inspectFormRef.validateField(code)
}
}
}
+
+.empty-field-tip {
+ padding: 80rpx 30rpx;
+ text-align: center;
+ font-size: 30rpx;
+ color: #999;
+}
+
+
diff --git a/pages-sub/daily/maintain-manage/finish-plan-detail.vue b/pages-sub/daily/maintain-manage/finish-plan-detail.vue
index a0ce804..f7e7b62 100644
--- a/pages-sub/daily/maintain-manage/finish-plan-detail.vue
+++ b/pages-sub/daily/maintain-manage/finish-plan-detail.vue
@@ -95,7 +95,7 @@
title="提交人"
:value="i.userName || '--'"
align="middle"
- :border="false"
+
>
@@ -105,9 +105,12 @@
:border="false"
inset
title=""
- style="margin-top: 16rpx;"
+
>
-
+
+
+ {{f.name}}
+
{
font-size: 26rpx;
word-break: break-all;
}
+:deep(.field-cell-title-multi) {
+ min-width: 160rpx; // 固定左侧标题最大宽度,文字会在这个宽度内自动换行
+}
+
\ No newline at end of file
diff --git a/pages-sub/problem/regional-order-manage/list-detail.vue b/pages-sub/problem/regional-order-manage/list-detail.vue
index 94a7d94..6aa781f 100644
--- a/pages-sub/problem/regional-order-manage/list-detail.vue
+++ b/pages-sub/problem/regional-order-manage/list-detail.vue
@@ -96,8 +96,8 @@
暂无问题照片
diff --git a/pages/index/index.vue b/pages/index/index.vue
index b34808f..9b6ff7d 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -8,27 +8,25 @@
蓟城山水全域智能运营管理平台
-
+
-
任务完成情况
-
-
-
-
@@ -57,14 +52,30 @@
-
-
- 养护任务
-
-
+
+
+ 养护任务
+ 巡检任务
+ 工单
+
+
待办事项({{ todoTotal }})
@@ -73,38 +84,27 @@
已办事项({{ doneTotal }})
-
-
-
-
-
-
-
-
+
-
+
-
+
事项{{ index + 1 }}
{{ item.taskName || '无' }}
-
-