提交 faf13563 authored 作者: caodi\cd's avatar caodi\cd

fix:提交

上级 3f34b724
......@@ -61,7 +61,8 @@
@click="
toShaftInspection(
card.dictLabel,
card.jfType
card.jfType,
card.value
)
"
>
......@@ -153,9 +154,9 @@ export default {
});
},
// 跳转到具体的机房
toShaftInspection(location,jfType) {
toShaftInspection(location,jfType,value) {
uni.navigateTo({
url: `/pages/inspectionContent/inspectionContentNew?&inspectionCode=${this.inspectionCode}&jfType=${jfType}&location=${location}&uid=${this.uid}`,
url: `/pages/inspectionContent/inspectionContentNew?value=${value}&inspectionCode=${this.inspectionCode}&jfType=${jfType}&location=${location}&uid=${this.uid}`,
});
},
back() {
......
......@@ -79,7 +79,7 @@
ref="dczt"
:inspectionItem="tabs[activeTab].label"
:defaultData="{}"
:jfType ="jfType"
:jfType="jfType"
></dczt>
<!-- 机房温湿度 -->
<jfwsd
......@@ -137,7 +137,7 @@
<script>
import {
pad_2_1_inspection_items,
pad_2_1_inspection_position,
pad_all_inspection_position,
pad_2_1_floor,
tabsInfo1,
tabsInfo2,
......@@ -210,7 +210,6 @@ export default {
// },
},
onLoad(options) {
this.coverlist();
this.isDisable = options.isDisable == 1 ? true : false;
this.uid = options.uid;
this.jfType = options.jfType;
......@@ -237,7 +236,7 @@ export default {
// 判断是否有回显数据
// 基础数据
this.baseInfo = {
inspectionType: "2",
inspectionType: "1",
inspectionCode: this.inspectionCode,
recordName: `${moment().format("yyyyMMDD")}-机房巡检`,
inspectionTime: moment().format("yyyy-MM-DD HH:mm"),
......@@ -297,25 +296,6 @@ export default {
}
return false;
},
// 数据结构重组
coverlist() {
// 获取井道巡检的三个检查项固定数据再进行处理
const data = pad_2_1_inspection_items.rows.map((item) => {
return {
// ...item,
dictLabel: item.dictLabel,
dictValue: item.dictValue,
conclusion: "", // 情况摘要
// roomType,
inspectionResult: 0, // 异常结论
itemCode: item.dictValue, // 检查项 如:门禁
measuredData: this.floor, // 逗号分隔字符串
photos: [], // 照片
};
});
this.list = data;
},
// 处理提交数据
getParams(isSubmit) {
if (this.uid) {
......@@ -352,34 +332,29 @@ export default {
return this.detailsInfo;
} else {
let baseInfo = this.baseInfo;
let dataObj = pad_2_1_inspection_position.rows.map((item, index) => {
let paramsObj = this.getAllChildFormData();
let dataObj = pad_all_inspection_position.rows.map((item, index) => {
return {
name: item.dictLabel,
value: item.dictValue,
jfType:item.jfType,
isVaild: false, // 校验通过
// type: 1, // 枚举值
position: pad_2_1_floor.rows,
refName: `TabContentItem_${index}`,
descript: "检查内容包括门禁、卫生、设备告警。",
};
});
let tabList = JSON.parse(JSON.stringify(dataObj));
let posItem = tabList[this.value - 1].position[this.dictValue - 1];
posItem.details = this.list;
posItem.isSubmit = isSubmit; //当前项是否提交
if (!this.checkInspectionResult(this.list)) {
posItem.status = 2; //1表示已经巡检过有异常
posItem.statusLable = "巡检异常";
} else {
let posItem = tabList[this.value - 1];
posItem.details = paramsObj;
console.log("posItem", posItem);
if (!this.checkInspectionResult(paramsObj)) {
posItem.status = 1; //1表示已经巡检过没有异常
posItem.statusLable = "已巡检";
} else {
posItem.status = 2; //1表示已经巡检过有异常
posItem.statusLable = "巡检异常";
}
// 根据获取到的每个井道的isSubmit来判断是否有暂存状态,只有有一个井道是暂存,那就是编辑中、暂存状态
let typeSubmit = this.typeSubmit(tabList);
const data = {
...baseInfo,
isSubmit: typeSubmit > 0 ? 0 : 1, //0暂存(编辑中) 1提交(待同步,已同步)
isSubmit: isSubmit, //0暂存(编辑中) 1提交(待同步,已同步)
inspectionNumber: 1,
isException: posItem.status == 2 ? 1 : 0,
items: [],
......@@ -421,15 +396,25 @@ export default {
);
}, 0);
},
// 检查是否存在异常
checkInspectionResult(arr) {
return !arr.some((obj) => obj.inspectionResult === 1);
// 判断数据是否有异常
checkInspectionResult(obj) {
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
const arr = obj[key];
for (let i = 0; i < arr.length; i++) {
if (
arr[i].hasOwnProperty("inspectionResult") &&
arr[i].inspectionResult === 0
) {
return true; // 存在异常
}
}
}
}
return false; // 不存在异常
},
// 提交
submit(isSubmit = 1) {
console.log("all", this.getAllChildFormData());
let paramsObj = this.getAllChildFormData();
return false;
let allValid = this.allValid(paramsObj);
// 校验是否通过
if (isSubmit && !allValid) {
......
......@@ -1439,7 +1439,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1276,
dictCode: 1294,
dictSort: 1,
dictLabel: "F座3楼-内环屏蔽机房",
dictValue: "1",
......@@ -1460,7 +1460,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1277,
dictCode: 1295,
dictSort: 2,
dictLabel: "F座3楼-外环屏蔽机房",
dictValue: "2",
......@@ -1481,7 +1481,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1278,
dictCode: 1281,
dictSort: 3,
dictLabel: "F座2楼-汇聚机房",
dictValue: "3",
......@@ -1502,7 +1502,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1279,
dictCode: 1276,
dictSort: 4,
dictLabel: "A座2楼-汇聚机房",
dictValue: "4",
......@@ -1523,7 +1523,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1280,
dictCode: 1293,
dictSort: 5,
dictLabel: "A座3楼-屏蔽机房",
dictValue: "5",
......@@ -1544,7 +1544,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1281,
dictCode: 1307,
dictSort: 6,
dictLabel: "A座1楼-UPS间",
dictValue: "6",
......@@ -1565,7 +1565,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1325,
dictCode: 1277,
dictSort: 7,
dictLabel: "B座2楼-汇聚机房",
dictValue: "7",
......@@ -1586,7 +1586,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1326,
dictCode: 1278,
dictSort: 8,
dictLabel: "C座2楼-汇聚机房",
dictValue: "8",
......@@ -1607,7 +1607,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1327,
dictCode: 1279,
dictSort: 9,
dictLabel: "D座2楼-汇聚机房",
dictValue: "9",
......@@ -1628,7 +1628,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1328,
dictCode: 1280,
dictSort: 10,
dictLabel: "E座2楼-汇聚机房",
dictValue: "10",
......@@ -1649,7 +1649,7 @@ export const pad_all_inspection_position = {
updateBy: null,
updateTime: null,
remark: null,
dictCode: 1329,
dictCode: 1308,
dictSort: 11,
dictLabel: "F座2楼-UPS间",
dictValue: "11",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论