Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspection-pad-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
专网
inspection-pad-web
Commits
2eee7568
提交
2eee7568
authored
4月 07, 2025
作者:
JaxBBLL
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
6ca36df7
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
71 行增加
和
80 行删除
+71
-80
mixin.js
pages/inspectionContent/components/mixin.js
+9
-0
qt.vue
pages/inspectionContent/components/qt.vue
+20
-68
inspectionContentNew.vue
pages/inspectionContent/inspectionContentNew.vue
+13
-1
shared.js
pages/inspectionContent/shared.js
+29
-11
没有找到文件。
pages/inspectionContent/components/mixin.js
浏览文件 @
2eee7568
...
...
@@ -10,5 +10,14 @@ export default {
this
.
itemData
.
status
=
1
;
}
},
setQtValue
(
data
)
{
// 公用-全部机房】其它问题----有填写过内容的,直接带出
if
(
this
.
isQt
)
{
this
.
itemData
.
detail
.
forEach
((
item
)
=>
{
item
.
conclusion
=
data
.
conclusion
;
item
.
photos
=
data
.
photos
;
});
}
},
},
};
pages/inspectionContent/components/qt.vue
浏览文件 @
2eee7568
...
...
@@ -15,31 +15,20 @@
</view>
<view
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
></text>
现场照片
</text>
<CommonUpload
v-model=
"item.photos"
:max-count=
"5"
>
</CommonUpload>
<!--
<view
class=
"photo-box"
>
<view
class=
"photo-container"
>
<view
v-for=
"(photo, itemIndex) in item && item.photos"
:key=
"itemIndex"
class=
"photo-item"
>
<image
:src=
"photo"
class=
"photo"
></image>
<text
class=
"delete-photo"
@
click=
"deletePhoto(index, itemIndex)"
>
×
</text
<CommonUpload
v-model=
"item.photos"
:max-count=
"9999"
@
change=
"onPhotoChange"
>
</CommonUpload>
</view>
<view
@
click=
"takePhoto(index)"
class=
"photo-btn"
>
+
</view>
</view>
<view
class=
"photo-limit"
>
请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。
</view
>
</view>
-->
</view>
</view
><custom-popup
<custom-popup
ref=
"customPopup"
:inspectionItem=
"inspectionItem"
@
confirm=
"handlePopupConfirm"
></custom-popup>
>
</custom-popup>
</view>
</
template
>
...
...
@@ -111,55 +100,6 @@ export default {
},
mounted
()
{},
methods
:
{
// 拍照
takePhoto
(
index
)
{
uni
.
chooseImage
({
count
:
1
,
sourceType
:
[
"camera"
],
// 可以从相机拍摄
success
:
async
(
res
)
=>
{
if
(
this
.
photos
.
length
<
5
)
{
const
base64
=
await
this
.
convertFileToBase64
(
res
.
tempFilePaths
[
0
]);
this
.
itemData
.
detail
[
index
].
photos
.
push
(
base64
);
}
else
{
uni
.
showToast
({
title
:
"最多只能上传5张照片"
,
icon
:
"none"
,
});
}
},
});
},
// 转化为base64
convertFileToBase64
(
filePath
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
plus
.
io
.
resolveLocalFileSystemURL
(
filePath
,
function
(
entry
)
{
entry
.
file
(
function
(
file
)
{
const
reader
=
new
plus
.
io
.
FileReader
();
reader
.
onloadend
=
function
(
evt
)
{
const
base64
=
evt
.
target
.
result
;
// 获取 Base64 数据
resolve
(
base64
);
// 返回 Base64 数据
};
reader
.
readAsDataURL
(
file
);
// 读取文件并转换为 Base64
},
function
(
error
)
{
reject
(
"获取文件对象失败:"
+
error
.
message
);
}
);
},
function
(
error
)
{
reject
(
"解析文件路径失败:"
+
error
.
message
);
}
);
});
},
// 删除照片
deletePhoto
(
index
,
itemIndex
)
{
this
.
itemData
.
detail
[
index
].
photos
.
splice
(
itemIndex
,
1
);
},
// 设置巡检结论
setInspectionResult
(
index
,
value
)
{
this
.
itemData
.
detail
[
index
].
inspectionResult
=
value
;
// 0正常 1异常
...
...
@@ -172,6 +112,11 @@ export default {
// 处理弹窗确认
handlePopupConfirm
(
summary
)
{
this
.
itemData
.
detail
[
this
.
currentIndex
].
conclusion
=
summary
;
// 回显到文字显示区域
console
.
log
(
"qt"
);
this
.
$emit
(
"sync"
,
{
conclusion
:
summary
,
photos
:
this
.
itemData
.
detail
[
this
.
currentIndex
].
photos
,
});
},
// 处理】数据
getFromData
()
{
...
...
@@ -217,6 +162,13 @@ export default {
areAllInspectionResultsOne
(
arr
)
{
return
arr
.
every
((
obj
)
=>
obj
.
inspectionResult
===
0
);
},
onPhotoChange
(
val
)
{
this
.
itemData
.
detail
[
this
.
currentIndex
].
photos
=
val
;
this
.
$emit
(
"sync"
,
{
conclusion
:
this
.
itemData
.
detail
[
this
.
currentIndex
].
conclusion
,
photos
:
val
,
});
},
},
};
</
script
>
...
...
pages/inspectionContent/inspectionContentNew.vue
浏览文件 @
2eee7568
...
...
@@ -111,6 +111,7 @@
ref=
"qt"
inspectionItem=
"其它"
:defaultData=
"list.qt ||
{}"
@sync="setQtValue"
>
</qt>
</view>
</view>
...
...
@@ -145,6 +146,7 @@
<
script
>
import
assRoomApi
from
"@/api/assRoom.js"
;
import
inspectApi
from
"@/api/assRoom.js"
;
import
{
dataToSql
}
from
"./shared"
;
import
{
...
...
@@ -497,7 +499,7 @@ export default {
},
realSave
(
data
)
{
const
send
=
dataToSql
(
data
);
assRoomApi
.
saveBatch
([
send
]
).
then
((
res
)
=>
{
inspectApi
.
save
(
send
).
then
((
res
)
=>
{
console
.
log
(
res
);
});
},
...
...
@@ -755,6 +757,16 @@ export default {
closePopup
()
{
this
.
switchTab
((
this
.
activeTab
+
1
)
%
this
.
tabs
.
length
);
},
setQtValue
(
data
)
{
this
.
tabs
.
forEach
((
item
)
=>
{
let
refName
=
item
.
value
;
// 通过 this.$refs[refName] 获取子组件实例
const
childComponent
=
this
.
$refs
[
refName
];
if
(
childComponent
&&
childComponent
.
setQtValue
)
{
childComponent
.
setQtValue
(
data
);
}
});
},
},
};
</
script
>
...
...
pages/inspectionContent/shared.js
浏览文件 @
2eee7568
...
...
@@ -10,6 +10,7 @@ export function dataToSql(data) {
synFlag
=
data
.
synchronization
;
}
const
send
=
{
id
:
data
.
id
,
inspectionType
:
data
.
inspectionType
,
inspectionCode
:
data
.
inspectionCode
,
recordName
:
`
${
moment
().
format
(
"yyyyMMDD"
)}
-机房巡检`
,
...
...
@@ -24,18 +25,35 @@ export function dataToSql(data) {
creatTime
:
data
.
id
?
data
.
creatTime
:
`
${
new
Date
().
getTime
()}
`
,
updateTime
:
`
${
new
Date
().
getTime
()}
`
,
inspectionData
:
data
.
originData
,
// isSubmit: 1,
// isSign: false,
// signImg: "",
// conclusion: "",
// creatTime: "1744023337279",
// items: [],
// synchronization: 0,
// submitTime: "2025-04-07",
// submitMonth: "2025-04",
// originData: data.originData,
};
console
.
log
(
"dataToSql"
,
send
);
return
send
;
}
export
function
sqlToData
(
sqlData
)
{
let
isSubmit
;
let
synchronization
;
if
(
sqlData
.
synFlag
===
0
)
{
isSubmit
=
0
;
synchronization
=
0
;
}
else
{
isSubmit
=
1
;
synchronization
=
sqlData
.
synFlag
;
}
const
originalData
=
{
id
:
sqlData
.
id
,
inspectionType
:
sqlData
.
inspectionType
,
inspectionCode
:
sqlData
.
inspectionCode
,
isException
:
sqlData
.
isException
,
inspectionNumber
:
sqlData
.
inspectionNumber
,
signImg
:
sqlData
.
signImg
,
originData
:
sqlData
.
inspectionData
,
creatTime
:
sqlData
.
creatTime
,
isSubmit
:
isSubmit
,
synchronization
:
synchronization
,
};
return
originalData
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论