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

fix:提交

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