Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
computedRoomPad
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
邓文彬
computedRoomPad
Commits
19d9eb70
提交
19d9eb70
authored
3月 04, 2025
作者:
caodi\cd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:井道巡检编辑
上级
4952c520
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
554 行增加
和
34 行删除
+554
-34
index.vue
components/inspectionItem/index.vue
+1
-1
indexCopy.vue
components/inspectionItem/indexCopy.vue
+176
-0
indexCopy.vue
pages/inspectionManagement/indexCopy.vue
+265
-0
shaftInspectionNew.vue
pages/shaftInspection/shaftInspectionNew.vue
+112
-33
没有找到文件。
components/inspectionItem/index.vue
浏览文件 @
19d9eb70
...
@@ -64,7 +64,7 @@ export default {
...
@@ -64,7 +64,7 @@ export default {
?
`/pages/inspectionContent/inspectionContent?isDisable=
${
?
`/pages/inspectionContent/inspectionContent?isDisable=
${
this
.
isDisable
?
1
:
0
this
.
isDisable
?
1
:
0
}
`
}
`
:
`/pages/shaftInspection/shaftInspection?isDisable=
${
:
`/pages/shaftInspection/shaftInspection
New
?isDisable=
${
this
.
isDisable
?
1
:
0
this
.
isDisable
?
1
:
0
}
`
;
}
`
;
...
...
components/inspectionItem/indexCopy.vue
0 → 100644
浏览文件 @
19d9eb70
<
template
>
<view
class=
"inspect-item"
@
click=
"toPage"
>
<view
class=
"content"
:class=
"details.synchronization == 1 ? 'synchronization' : ''"
>
<view
class=
"name"
>
{{
getLabel
(
details
.
inspectionType
)
}}
</view>
<view
class=
"info"
>
<view
class=
"info-row"
>
<text
class=
"title"
>
{{
details
.
recordName
}}
</text>
<text
class=
"status"
>
{{
details
.
synchronization
==
0
?
"待同步"
:
"已同步"
}}
</text>
<view
v-if=
"details.isException == 1"
class=
"status alarm"
>
<text
class=
"iconfont icon-yichang1"
></text>
<text>
有异常
</text></view
>
</view>
<view
class=
"info-row info-row-code"
>
<text>
编号:
</text>
<text
class=
"code-num"
>
{{
details
.
inspectionCode
}}
</text>
</view>
</view>
<view
class=
"img"
>
<image
v-if=
"details.synchronization == 1"
class=
"bg-img"
src=
"../../static/img/add-img/default.png"
></image>
<image
v-else
class=
"bg-img"
src=
"../../static/img/add-img/active.png"
></image>
</view>
</view>
</view>
</
template
>
<
script
>
import
{
pad_inspection_type
}
from
"@/utils/dict.js"
;
export
default
{
props
:
{
details
:
{
type
:
Object
,
},
isDisable
:
{
type
:
Boolean
,
},
},
methods
:
{
getLabel
(
val
)
{
const
temp
=
(
pad_inspection_type
.
rows
.
filter
((
item
)
=>
item
.
dictValue
==
val
)[
0
]
||
{}
).
dictLabel
||
""
;
return
temp
.
length
?
temp
.
slice
(
0
,
2
)
:
""
;
},
toPage
()
{
const
url
=
this
.
details
.
inspectionType
==
1
?
`/pages/inspectionContent/inspectionContent?isDisable=
${
this
.
isDisable
?
1
:
0
}
`
:
`/pages/shaftInspection/shaftInspection?isDisable=
${
this
.
isDisable
?
1
:
0
}
`
;
uni
.
navigateTo
({
url
:
`
${
url
}
&uid=
${
this
.
details
.
uid
}
`
,
});
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.inspect-item {
width: 50%;
padding-right: 16px;
margin-bottom: 16px;
.content {
background: #fff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
padding: 18px 16px 14px 10px;
display: flex;
align-items: center;
height: 84px;
box-sizing: border-box;
position: relative;
background-image: linear-gradient(-67deg, #ffab2423, #ffab2411 50%);
.name {
background: #ffab2423;
border-radius: 12px;
width: 54px;
height: 54px;
margin-right: 10px;
display: flex;
justify-content: center;
align-items: center;
color: #f39800;
}
.info {
.info-row {
display: flex;
align-items: center;
margin-bottom: 8px;
&:last-of-type {
margin: 0;
}
.title {
font-size: 12px;
color: #000000;
font-weight: bold;
margin-right: 8px;
}
.status {
padding: 2px 4px;
font-size: 12px;
color: #ffffff;
text-align: center;
line-height: 20px;
font-weight: 400;
background: #ffab24;
border-radius: 3px;
}
.alarm {
margin-left: 8px;
background: rgba(255, 105, 82, 0.1);
font-size: 12px;
color: #ff6952;
text-align: center;
line-height: 20px;
font-weight: 400;
}
}
.info-row-code {
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
.code-num {
font-size: 14px;
color: #000000;
font-weight: 400;
}
}
}
.img {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
.bg-img {
width: 80px;
height: 80px;
}
}
}
.synchronization {
background-image: linear-gradient(-67deg, #9c9c9c16, #9c9c9c09 50%);
.name {
background: #9c9c9c16;
border-radius: 12px;
color: #4a4a4a;
}
.status {
background: #9c9c9c16 !important;
color: #4a4a4a !important;
}
}
}
</
style
>
pages/inspectionManagement/indexCopy.vue
0 → 100644
浏览文件 @
19d9eb70
<
template
>
<view
class=
"inspection-management"
>
<!-- 搜索项 -->
<SearchCom
@
change=
"change"
/>
<!-- 结果 -->
<view
class=
"inspection-management-content"
>
<view
class=
"count-tatal"
>
<text
class=
"num"
>
{{
countNum
||
0
}}
条
</text>
<text>
查询结果
</text>
</view>
<view
class=
"month-list"
>
<!-- 每月记录 -->
<view
class=
"month-record-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
v-if=
"(item.list || []).length"
class=
"seconed-title"
>
{{
item
.
submitTime
||
item
.
time
}}
</view>
<view
class=
"inspect-list"
>
<InspectionItem
v-for=
"ele in item.list"
:key=
"ele.uid"
:details=
"ele"
/>
</view>
</view>
<Empty
v-if=
"list.length == 0"
/>
</view>
</view>
<!-- 开始巡检 -->
<view
class=
"inspection-button"
@
click=
"toPage"
>
开始巡检
</view
>
</view>
</
template
>
<
script
>
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
{
getDarft
}
from
"@/request/index.js"
;
import
{
getAllInspections
}
from
"@/request/index.js"
;
import
Empty
from
"@/components/empty/index.vue"
;
export
default
{
components
:
{
SearchCom
,
InspectionItem
,
Empty
,
},
data
()
{
return
{
isDialog
:
false
,
//
list
:
[],
// 展示数据
all_data
:
[],
// 所有数据
searchForm
:
{
// 搜索条件
},
countNum
:
0
,
// 统计查询总数
};
},
mounted
()
{
uni
.
showLoading
();
getAllInspections
()
.
then
((
res
)
=>
{
this
.
all_data
=
res
;
this
.
init
();
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
if
(
0
==
error
.
code
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
this
.
all_data
=
[];
uni
.
hideLoading
();
});
},
computed
:
{
userInfo
()
{
return
this
.
$store
.
state
.
now_user
||
{};
},
},
methods
:
{
init
()
{
const
all_data
=
this
.
all_data
||
[];
const
{
inspectionTime
=
[]
}
=
this
.
searchForm
;
const
startTime
=
inspectionTime
[
0
];
const
endTime
=
inspectionTime
[
1
];
// 第一步: 筛选有效的时间范围
const
timeFrame
=
all_data
.
filter
((
item
)
=>
{
if
(
!
inspectionTime
.
length
)
{
return
true
;
}
else
{
return
(
new
Date
(
startTime
).
getTime
()
<=
new
Date
(
item
.
submitTime
).
getTime
()
&&
new
Date
(
item
.
submitTime
).
getTime
()
<=
new
Date
(
endTime
).
getTime
()
);
}
});
// 属于同一个月的数据 聚合
const
tempAllData
=
{};
timeFrame
.
forEach
((
item
)
=>
{
const
val
=
tempAllData
[
item
.
submitMonth
]
||
[];
if
(
val
.
length
)
{
tempAllData
[
item
.
submitMonth
].
push
(
item
);
}
else
{
tempAllData
[
item
.
submitMonth
]
=
[
item
];
}
});
const
keys
=
Object
.
keys
(
tempAllData
);
// 第二步: 根据搜索条件过滤
const
list
=
keys
.
map
((
key
)
=>
{
return
{
time
:
key
,
list
:
this
.
coverData
(
tempAllData
[
key
]),
};
});
this
.
countNum
=
0
;
list
.
forEach
((
item
)
=>
{
this
.
countNum
+=
item
.
list
.
length
;
});
this
.
list
=
list
;
},
coverData
(
arr
=
[])
{
const
{
isException
=
""
,
inspectionType
=
""
,
synchronization
=
""
,
}
=
this
.
searchForm
;
return
arr
.
filter
((
item
)
=>
{
return
(
(
!
isException
||
isException
==
"all"
||
item
.
isException
==
isException
)
&&
(
!
inspectionType
||
inspectionType
==
"all"
||
item
.
inspectionType
==
inspectionType
)
&&
(
!
synchronization
||
synchronization
==
"all"
||
item
.
synchronization
==
synchronization
)
);
});
},
change
(
e
)
{
this
.
searchForm
=
e
;
this
.
init
();
},
toPage
()
{
uni
.
showLoading
();
getDarft
()
.
then
((
res
)
=>
{
const
darf_data
=
res
||
{};
if
(
darf_data
.
inspectionType
==
1
)
{
uni
.
navigateTo
({
url
:
`/pages/inspectionContent/inspectionContent?isDarf=1`
,
});
}
else
if
(
darf_data
.
inspectionType
==
2
)
{
uni
.
navigateTo
({
url
:
`/pages/shaftInspection/shaftInspection?isDarf=1`
,
});
}
else
{
uni
.
navigateTo
({
url
:
"/pages/inspection/inspFirst"
,
});
}
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
0
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
uni
.
navigateTo
({
url
:
"/pages/inspection/inspFirst"
,
});
uni
.
hideLoading
();
});
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.inspection-management {
padding-top: 16px;
.count-tatal {
margin: 16px 0 8px 0;
font-size: 14px;
color: #4a4a4a;
font-weight: 400;
.num {
font-size: 18px;
color: #3774f6;
line-height: 26px;
font-weight: 600;
margin-right: 5px;
}
}
.inspection-management-content {
.month-list {
height: calc(100vh - 26px - 16px - 8px - 36px - 62px);
overflow: auto;
padding-bottom: 140px;
.seconed-title {
margin-top: 16px;
font-size: 18px;
color: #000000;
font-weight: bold;
}
.month-record-item {
margin-bottom: 24px;
&:last-of-type {
margin: 0;
}
.inspect-list {
display: flex;
flex-wrap: wrap;
}
}
}
}
.inspection-button {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 60px;
width: 240px;
height: 48px;
left: 50%;
color: #fff;
transform: translateX(-50%);
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
}
}
</
style
>
pages/shaftInspection/shaftInspectionNew.vue
浏览文件 @
19d9eb70
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<text
class=
"title"
>
巡检井道:
</text>
<text
class=
"title"
>
巡检井道:
</text>
<text
class=
"location"
>
{{
location
}}{{
floor
}}
</text>
<text
class=
"location"
>
{{
location
}}{{
floor
}}
</text>
<button
class=
"submit-btn"
:class=
"
{ active: isSubmitEnabled }" :disabled="!isSubmitEnabled" @click="submit">
<button
class=
"submit-btn"
:class=
"
{ active: isSubmitEnabled }" :disabled="!isSubmitEnabled" @click="submit">
提交
完成当前机房全部巡检
</button>
</button>
</view>
</view>
</view>
</view>
...
@@ -52,13 +52,13 @@
...
@@ -52,13 +52,13 @@
</view>
</view>
<view
class=
"form-item"
>
<view
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
情况摘要:
</text>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
情况摘要:
</text>
<input
v-model=
"list[activeTab].conclusion"
placeholder=
"请输入情况摘要"
class=
"input-box"
/>
<input
v-model=
"list[activeTab]
&&list[activeTab]
.conclusion"
placeholder=
"请输入情况摘要"
class=
"input-box"
/>
</view>
</view>
<view
class=
"form-item"
>
<view
class=
"form-item"
>
<text
class=
"form-label"
>
现场照片:
</text>
<text
class=
"form-label"
>
现场照片:
</text>
<text
class=
"photo-limit"
>
(最多5张)
</text>
<text
class=
"photo-limit"
>
(最多5张)
</text>
<view
class=
"photo-container"
>
<view
class=
"photo-container"
>
<view
v-for=
"(photo, index) in list[activeTab].photos"
:key=
"index"
class=
"photo-item"
>
<view
v-for=
"(photo, index) in list[activeTab]
&&list[activeTab]
.photos"
:key=
"index"
class=
"photo-item"
>
<image
:src=
"photo"
class=
"photo"
></image>
<image
:src=
"photo"
class=
"photo"
></image>
<text
class=
"delete-photo"
@
click=
"deletePhoto(index)"
>
×
</text>
<text
class=
"delete-photo"
@
click=
"deletePhoto(index)"
>
×
</text>
</view>
</view>
...
@@ -122,6 +122,7 @@
...
@@ -122,6 +122,7 @@
location
:
"A座"
,
// 从上一个页面带过来的位置
location
:
"A座"
,
// 从上一个页面带过来的位置
floor
:
"2楼"
,
// 从上一个页面带过来的位置
floor
:
"2楼"
,
// 从上一个页面带过来的位置
isSubmitEnabled
:
false
,
// 提交按钮是否可点击
isSubmitEnabled
:
false
,
// 提交按钮是否可点击
uid
:
""
,
randomDescription
:
"这是一段随机说明文字。"
,
// 随机说明文字
randomDescription
:
"这是一段随机说明文字。"
,
// 随机说明文字
tabs
:
[{
tabs
:
[{
label
:
"门禁"
,
label
:
"门禁"
,
...
@@ -160,9 +161,40 @@
...
@@ -160,9 +161,40 @@
// return !uid || (uid && createByName == this.userInfo.user);
// return !uid || (uid && createByName == this.userInfo.user);
// },
// },
},
},
onLoad
()
{
onLoad
(
options
)
{
this
.
loadHistoryData
();
this
.
coverlist
();
this
.
isDisable
=
options
.
isDisable
==
1
?
true
:
false
;
this
.
uid
=
options
.
uid
console
.
log
(
"options"
,
options
)
if
(
options
.
uid
)
{
this
.
getDetails
(
options
.
uid
);
}
else
if
(
options
.
isDarf
)
{
// 获取草稿数据
uni
.
showLoading
();
getDarft
()
.
then
((
res
)
=>
{
console
.
log
(
"res"
,
res
)
const
darf_data
=
res
||
{};
this
.
baseInfo
=
darf_data
.
originData
.
baseInfo
;
this
.
list
=
darf_data
.
originData
.
tempForm
;
this
.
detailsInfo
=
darf_data
;
uni
.
hideLoading
();
this
.
init
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
}
},
},
watch
:
{},
mounted
()
{
mounted
()
{
this
.
init
();
this
.
init
();
},
},
...
@@ -171,7 +203,7 @@
...
@@ -171,7 +203,7 @@
init
()
{
init
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// 判断是否有回显数据
// 判断是否有回显数据
if
(
this
.
detailsInfo
&&
this
.
detailsInfo
.
inspectionType
)
{}
else
{
if
(
!
this
.
uid
)
{
// 基础数据
// 基础数据
this
.
baseInfo
=
{
this
.
baseInfo
=
{
inspectionType
:
"2"
,
inspectionType
:
"2"
,
...
@@ -190,11 +222,34 @@
...
@@ -190,11 +222,34 @@
items
:
[],
items
:
[],
};
};
}
}
console
.
log
(
2222
,
this
.
baseInfo
)
console
.
log
(
2222
,
this
.
baseInfo
,
this
.
list
,
this
.
detailsInfo
)
this
.
coverlist
();
resolve
();
resolve
();
});
});
},
},
// 回显数据
getDetails
(
uid
)
{
uni
.
showLoading
();
getInspectionDetails
(
uid
)
.
then
((
res
)
=>
{
const
detailsInfo
=
res
;
console
.
log
(
"getDetails"
,
res
)
this
.
baseInfo
=
detailsInfo
.
originData
.
baseInfo
;
this
.
list
=
detailsInfo
.
originData
.
tempForm
;
this
.
detailsInfo
=
detailsInfo
;
this
.
isDisable
=
this
.
isDisable
||
detailsInfo
.
synchronization
==
1
;
// 是否禁用 1:已同步数据 0: 未同步数据
uni
.
hideLoading
();
this
.
isSubmitEnabled
=
this
.
isAllTabValid
()
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
},
// 加载历史数据
// 加载历史数据
loadHistoryData
()
{
loadHistoryData
()
{
const
history
=
uni
.
getStorageSync
(
"inspectionHistory"
);
const
history
=
uni
.
getStorageSync
(
"inspectionHistory"
);
...
@@ -281,6 +336,31 @@
...
@@ -281,6 +336,31 @@
console
.
log
(
"getParams,data"
,
data
)
console
.
log
(
"getParams,data"
,
data
)
return
data
;
return
data
;
},
},
// 检查所有Tab 的必填项是否填写完整
isAllTabValid
()
{
const
data
=
this
.
list
// 校验函数
const
validateData
=
(
data
)
=>
{
return
data
.
every
(
(
item
)
=>
item
.
inspectionResult
!==
null
&&
item
.
conclusion
.
trim
()
!==
""
);
};
// 调用校验函数
const
isValid
=
validateData
(
data
);
console
.
log
(
141
,
isValid
)
return
isValid
},
// 检查当前 Tab 的必填项是否填写完整
isCurrentTabValid
()
{
const
currentTabData
=
this
.
list
[
this
.
activeTab
];
console
.
log
(
"currentTabData"
,
currentTabData
)
return
(
currentTabData
.
inspectionResult
!==
null
&&
// 巡检结论必填
currentTabData
.
conclusion
.
trim
()
!==
""
// 情况摘要必填
// 现场照片为非必填项,不做校验
);
},
// 暂存
// 暂存
saveDraft
(
isSave
=
true
)
{
saveDraft
(
isSave
=
true
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -319,32 +399,23 @@
...
@@ -319,32 +399,23 @@
resolve
();
resolve
();
});
});
},
},
// 检查当前 Tab 的必填项是否填写完整
isCurrentTabValid
()
{
const
data
=
this
.
list
// 校验函数
const
validateData
=
(
data
)
=>
{
return
data
.
every
(
(
item
)
=>
item
.
inspectionResult
!==
null
&&
item
.
conclusion
.
trim
()
!==
""
);
};
// 调用校验函数
const
isValid
=
validateData
(
data
);
console
.
log
(
141
,
isValid
)
return
isValid
},
// 完成
// 完成
complete
()
{
complete
()
{
this
.
saveDraft
().
then
(()
=>
{
this
.
isSubmitEnabled
=
this
.
isAllTabValid
()
if
(
this
.
isCurrentTabValid
())
{
if
(
this
.
isCurrentTabValid
())
{
this
.
isSubmitEnabled
=
true
// 暂存All
this
.
saveDraft
().
then
(()
=>
{
if
(
this
.
isSubmitEnabled
)
{
this
.
openPopup
()
}
})
}
else
{
uni
.
showToast
({
title
:
"请填写完整必填项"
,
icon
:
"none"
,
});
}
}
else
{
this
.
isSubmitEnabled
=
false
this
.
openPopup
()
}
})
},
},
// 提交
// 提交
...
@@ -356,10 +427,18 @@
...
@@ -356,10 +427,18 @@
}
}
const
params
=
this
.
getParams
();
//数据获取
const
params
=
this
.
getParams
();
//数据获取
const
all_data
=
this
.
$store
.
state
.
all_data
;
//获取全部数据
const
all_data
=
this
.
$store
.
state
.
all_data
;
//获取全部数据
const
uid
=
""
params
.
isSubmit
=
1
;
//修改提交状态
params
.
isSubmit
=
1
;
//修改提交状态
let
logContent
=
""
;
let
logContent
=
""
;
if
(
uid
)
{
if
(
this
.
uid
)
{
const
index
=
all_data
.
findIndex
((
element
)
=>
element
.
uid
==
this
.
uid
);
params
.
uid
=
this
.
uid
;
all_data
[
index
]
=
params
;
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
edit
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
}
{
}
{
params
.
uid
=
new
Date
().
getTime
();
// 唯一标识 pad 端使用
params
.
uid
=
new
Date
().
getTime
();
// 唯一标识 pad 端使用
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论