Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspection-pad-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
专网
inspection-pad-web
Commits
30272f37
提交
30272f37
authored
4月 14, 2025
作者:
JaxBBLL
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
21d7b477
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
127 行增加
和
26 行删除
+127
-26
inspect.js
api/inspect.js
+0
-0
home.vue
pages/home/home.vue
+0
-0
inspectionContentList.vue
pages/inspectionContent/inspectionContentList.vue
+52
-18
inspectionContentNew.vue
pages/inspectionContent/inspectionContentNew.vue
+23
-1
shared.js
pages/inspectionContent/shared.js
+52
-7
没有找到文件。
api/inspect.js
浏览文件 @
30272f37
差异被折叠。
点击展开。
pages/home/home.vue
浏览文件 @
30272f37
差异被折叠。
点击展开。
pages/inspectionContent/inspectionContentList.vue
浏览文件 @
30272f37
...
...
@@ -230,7 +230,7 @@ import startDialog from "./components/dialog.vue";
import
assRoomApi
from
"@/api/assRoom.js"
;
import
inspectApi
from
"@/api/inspect"
;
import
{
sqlToData
,
dataToSql
}
from
"./shared"
;
import
{
sqlToData
,
dataToSql
,
getHistoryData
}
from
"./shared"
;
import
Dialog
from
"@/pages/inspectionManagement/dialog.vue"
;
export
default
{
...
...
@@ -267,6 +267,7 @@ export default {
listData
:
[],
isDialog
:
false
,
propList
:
[],
did
:
""
,
// 最近7天数据的id
};
},
computed
:
{
...
...
@@ -292,7 +293,55 @@ export default {
});
}
else
{
this
.
getRoomList
().
then
((
res
)
=>
{
this
.
init
(
res
);
// 获取7日(168小时)内最后一条巡检记录回显到页面(选项、文案、照片;异常项-不调出文案及照片)
getHistoryData
().
then
((
detailsInfo
)
=>
{
if
(
detailsInfo
)
{
// 处理历史数据(选项、文案、照片;异常项-不调出文案及照片)
console
.
log
(
"detailsInfo"
,
detailsInfo
);
this
.
did
=
detailsInfo
.
id
;
delete
detailsInfo
.
id
;
this
.
listData
=
this
.
listFormat
(
detailsInfo
.
originData
);
this
.
detailsInfo
=
detailsInfo
;
this
.
inspectionNumber
=
detailsInfo
.
inspectionNumber
;
this
.
inspectionCode
=
`JFXJ
${
moment
().
format
(
"yyyyMMDDHHmmss"
)}${
Math
.
floor
(
Math
.
random
()
*
900
)
+
100
}
`
;
this
.
cardsInfo
=
detailsInfo
.
originData
;
this
.
isSubmit
=
0
;
this
.
isSign
=
false
;
// 默认选中第一个机房
this
.
detailsItem
=
detailsInfo
.
originData
[
0
].
details
;
if
(
this
.
detailsItem
.
afxt
&&
this
.
detailsItem
.
afxt
.
detail
&&
this
.
detailsItem
.
afxt
.
detail
[
2
].
inspectionResult
===
1
)
{
this
.
detailsItem
.
afxt
.
detail
=
this
.
detailsItem
.
afxt
.
detail
.
slice
(
0
,
3
);
}
this
.
allIsSubmitOne
=
detailsInfo
.
originData
.
every
(
(
item
)
=>
item
.
isSubmit
==
1
);
let
group1
=
this
.
cardsInfo
.
slice
(
0
,
5
);
let
group2
=
this
.
cardsInfo
.
slice
(
5
,
10
);
let
group3
=
this
.
cardsInfo
.
slice
(
10
);
if
(
!
this
.
isSign
)
{
group2
=
group2
.
reverse
();
}
this
.
rows
=
[
group1
,
group2
,
group3
];
this
.
detailsInfo
=
detailsInfo
;
}
else
{
this
.
init
(
res
);
}
});
});
}
}
...
...
@@ -308,7 +357,6 @@ export default {
getRoomList
()
{
return
assRoomApi
.
selectRoomList
(
1
).
then
((
res
)
=>
{
console
.
log
(
"机房列表"
,
res
);
console
.
log
(
"机房列表"
,
JSON
.
stringify
(
res
));
return
res
;
});
},
...
...
@@ -356,20 +404,6 @@ export default {
Math
.
floor
(
Math
.
random
()
*
900
)
+
100
}
`
;
}
// if (this.detailsInfo.inspectionType) {
// const fillCheck = this.detailsInfo.fillCheck.split(",");
// setTimeout(() => {
// this.tabList.forEach((item, index) => {
// item.isVaild = fillCheck.includes(item.value);
// this.tempForm[index] &&
// this.setComponentData(item.refName, this.tempForm[index]);
// });
// }, 500);
// } else {
// this.baseInfo = this.$store.state.temp_data;
// }
resolve
();
});
},
...
...
@@ -504,7 +538,7 @@ export default {
toShaftInspection
(
name
,
jfType
,
value
)
{
console
.
log
(
"name, 跳转到具体的机房, value"
,
name
,
jfType
,
value
);
uni
.
navigateTo
({
url
:
`/pages/inspectionContent/inspectionContentNew?value=
${
value
}
&inspectionCode=
${
this
.
inspectionCode
}
&jfType=
${
jfType
}
&location=
${
name
}
&uid=
${
this
.
uid
}
&backValue=
${
this
.
backValue
}
`
,
url
:
`/pages/inspectionContent/inspectionContentNew?value=
${
value
}
&inspectionCode=
${
this
.
inspectionCode
}
&jfType=
${
jfType
}
&location=
${
name
}
&uid=
${
this
.
uid
}
&backValue=
${
this
.
backValue
}
&did=
${
this
.
did
}
`
,
});
},
lookTable
()
{
...
...
pages/inspectionContent/inspectionContentNew.vue
浏览文件 @
30272f37
...
...
@@ -140,7 +140,7 @@
<
script
>
import
assRoomApi
from
"@/api/assRoom.js"
;
import
inspectApi
from
"@/api/inspect.js"
;
import
{
dataToSql
,
sqlToData
}
from
"./shared"
;
import
{
dataToSql
,
sqlToData
,
getHistoryData
}
from
"./shared"
;
import
{
pad_all_inspection_position
,
...
...
@@ -253,6 +253,28 @@ export default {
if
(
options
.
uid
)
{
this
.
getDetails
(
options
.
uid
);
}
else
if
(
options
.
did
)
{
// 临时id
getHistoryData
().
then
((
detailsInfo
)
=>
{
console
.
log
(
"history"
,
detailsInfo
);
if
(
detailsInfo
)
{
// 处理历史数据(选项、文案、照片;异常项-不调出文案及照片)
this
.
list
=
detailsInfo
.
originData
[
this
.
value
-
1
].
details
;
this
.
tabs
.
forEach
((
item
)
=>
{
if
(
this
.
list
[
item
.
value
]
&&
this
.
list
[
item
.
value
].
status
!==
undefined
)
{
item
.
status
=
this
.
list
[
item
.
value
].
status
;
}
});
this
.
detailsInfo
=
detailsInfo
;
uni
.
hideLoading
();
}
else
{
this
.
init
();
this
.
paramsObjFirst
=
this
.
getAllChildFormData
();
}
});
}
else
{
this
.
init
();
this
.
paramsObjFirst
=
this
.
getAllChildFormData
();
...
...
pages/inspectionContent/shared.js
浏览文件 @
30272f37
import
moment
from
"moment"
;
import
store
from
"@/store"
;
import
inspectApi
from
"@/api/inspect.js"
;
// 将现有机房巡检数据转换为SQL数据所需要格式
export
function
dataToSql
(
data
)
{
// let isException = 0;
// if (data.isSubmit == 0) {
// isException = 2;
// } else {
// isException = data.isException;
// }
let
synFlag
=
0
;
if
(
data
.
synchronization
===
1
)
{
synFlag
=
1
;
}
else
{
if
(
data
.
synchronization
==
2
||
!
data
.
signImg
)
{
synFlag
=
2
;
}
else
{
synFlag
=
0
;
}
}
const
send
=
{
inspectionType
:
data
.
inspectionType
,
inspectionCode
:
data
.
inspectionCode
,
...
...
@@ -17,7 +22,7 @@ export function dataToSql(data) {
isException
:
data
.
isException
,
// 是否异常:0 否 1 是
userId
:
store
.
state
.
now_user
.
userId
,
userName
:
store
.
state
.
now_user
.
user
,
synFlag
:
data
.
synchronization
,
// 0.未同步,1.已同步 2.编辑
synFlag
:
synFlag
,
// 0.未同步,1.已同步 2.编辑
signImg
:
data
.
signImg
||
""
,
createBy
:
store
.
state
.
now_user
.
userId
,
createTime
:
data
.
id
?
data
.
createTime
:
`
${
new
Date
().
getTime
()}
`
,
...
...
@@ -78,3 +83,43 @@ export function sqlToData(sqlData) {
return
ret
;
}
export
function
getHistoryData
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
inspectApi
.
selectLastData
(
store
.
state
.
now_user
.
userId
).
then
((
history
)
=>
{
if
(
history
&&
history
.
length
)
{
const
detailsInfo
=
sqlToData
(
history
[
0
]);
// 处理历史数据(选项、文案、照片;异常项-不调出文案及照片)
console
.
log
(
JSON
.
stringify
(
detailsInfo
));
setHistoryData
(
detailsInfo
);
resolve
(
detailsInfo
);
}
else
{
resolve
(
null
);
}
});
});
}
function
setHistoryData
(
list
)
{
list
.
originData
.
forEach
((
item
)
=>
{
// 如果该机房有异常项,则不调出文案及照片
if
(
item
.
status
==
2
)
{
// 外面的异常标识
item
.
isSubmit
=
0
;
Object
.
keys
(
item
.
details
).
forEach
((
key
)
=>
{
const
current
=
item
.
details
[
key
];
if
(
current
.
status
)
{
// 内部的异常标识
current
.
detail
.
forEach
((
detail
)
=>
{
// 表单项的异常
if
(
detail
.
inspectionResult
==
1
)
{
detail
.
conclusion
=
""
;
detail
.
inspectionResultLable
=
""
;
detail
.
photos
=
[];
}
});
}
});
}
});
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论