提交 380d0daa authored 作者: JaxBBLL's avatar JaxBBLL

fix

上级 0db56cf7
<template> <template>
<!-- 首页 --> <!-- 首页 -->
<view class="container"> <view class="container">
<view class="flex">
<navigator url="/pages/test/index" hover-class="navigator-hover"> <navigator url="/pages/test/index" hover-class="navigator-hover">
<button type="default">跳转到新页面</button> <button type="default" class="uni-btn">跳转TEST</button>
</navigator> </navigator>
<navigator
url="/pages/inspectionContent/inspectionContentList?uid=svk7crpold"
hover-class="navigator-hover"
>
<button type="default" class="uni-btn">测试巡检</button>
</navigator>
</view>
<!-- 第一个模块 --> <!-- 第一个模块 -->
<view class="header"> <view class="header">
<view class="title">杭州内网监管在线-运维在线</view> <view class="title">杭州内网监管在线-运维在线</view>
...@@ -76,21 +84,22 @@ ...@@ -76,21 +84,22 @@
export default { export default {
data() { data() {
return { return {
cards: [{ cards: [
image: '../../static/img/jf.png', {
text: '机房巡检', image: "../../static/img/jf.png",
url:"/pages/inspectionContent/inspectionContentList?backValue=home" text: "机房巡检",
url: "/pages/inspectionContent/inspectionContentList?backValue=home",
}, },
{ {
image: '../../static/img/jd.png', image: "../../static/img/jd.png",
text: '井道巡检', text: "井道巡检",
url:"/pages/shaftInspection/shaftInspectionList?backValue=home" url: "/pages/shaftInspection/shaftInspectionList?backValue=home",
}, },
{ {
image: '../../static/img/sj.png', image: "../../static/img/sj.png",
text: '设备上架', text: "设备上架",
url: "/pages/listingManagement/index?backValue=home" url: "/pages/listingManagement/index?backValue=home",
} },
], ],
userName: this.$store.state.now_user.userName, userName: this.$store.state.now_user.userName,
}; };
...@@ -118,11 +127,10 @@ export default { ...@@ -118,11 +127,10 @@ export default {
}); });
}, },
// 三模块卡片跳转页面 // 三模块卡片跳转页面
toList(url){ toList(url) {
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
}); });
}, },
// 巡检管理 // 巡检管理
toInspectionManagement() { toInspectionManagement() {
...@@ -155,8 +163,7 @@ export default { ...@@ -155,8 +163,7 @@ export default {
}, },
}); });
}, },
},
}
}; };
</script> </script>
......
...@@ -5,19 +5,9 @@ export default { ...@@ -5,19 +5,9 @@ export default {
item.inspectionResult = 0; item.inspectionResult = 0;
}); });
console.log("this.isQt", this.isQt); console.log("this.isQt", this.isQt);
if (!this.isQt) { if (!this.isQt) {
this.itemData.status = 1; this.itemData.status = 1;
} }
}, },
setQtValue(data) {
// 公用-全部机房】其它问题----有填写过内容的,直接带出
if (this.isQt) {
this.itemData.detail.forEach((item) => {
item.conclusion = data.conclusion;
item.photos = data.photos;
});
}
},
}, },
}; };
...@@ -204,6 +204,8 @@ import detail from "./components/detail.vue"; ...@@ -204,6 +204,8 @@ import detail from "./components/detail.vue";
import startDialog from "./components/dialog.vue"; import startDialog from "./components/dialog.vue";
import assRoomApi from "@/api/assRoom.js"; import assRoomApi from "@/api/assRoom.js";
import inspectApi from "@/api/inspect";
import { sqlToData } from "./shared";
export default { export default {
components: { components: {
signDialog, signDialog,
...@@ -247,25 +249,28 @@ export default { ...@@ -247,25 +249,28 @@ export default {
this.options = options; this.options = options;
this.backValue = this.options.backValue || ""; this.backValue = this.options.backValue || "";
this.isDisable = options.isDisable == 1 ? true : false; this.isDisable = options.isDisable == 1 ? true : false;
console.log("options.uid", this.options.uid);
this.uid = this.options.uid || ""; this.uid = this.options.uid || "";
this.value = this.options.value || "1"; this.value = this.options.value || "1";
}, },
onShow() { onShow() {
if (this.uid) { if (this.uid) {
this.getRoomList().then((res) => {
this.init(res).then(() => {
this.getDetails(this.uid); this.getDetails(this.uid);
});
});
} else { } else {
this.getRoomList().then((res) => { this.getRoomList().then((res) => {
this.init(res); this.init(res);
}); });
} }
// this.startDialogData.text = [ // this.startDialogData.text = [
// `请到“${this.name}”后;`, // `请到“${this.name}”后;`,
// "点击“我已到达”开始巡检", // "点击“我已到达”开始巡检",
// ]; // ];
console.log("this.startDialogData", this.startDialogData); console.log("this.startDialogData", this.startDialogData);
this.all_data = this.$store.state.all_data; this.all_data = this.$store.state.all_data;
console.log("onShow", this.all_data);
}, },
methods: { methods: {
getRoomList() { getRoomList() {
...@@ -275,6 +280,7 @@ export default { ...@@ -275,6 +280,7 @@ export default {
}); });
}, },
init(baseList) { init(baseList) {
this.value = baseList[0].dictValue;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const roomFeatureMap = { const roomFeatureMap = {
1: "1", 1: "1",
...@@ -292,33 +298,41 @@ export default { ...@@ -292,33 +298,41 @@ export default {
* roomFeature 机房类型枚举:1.汇聚机房,2.屏蔽机房,3.UPS机房,4.数据机房 * roomFeature 机房类型枚举:1.汇聚机房,2.屏蔽机房,3.UPS机房,4.数据机房
*/ */
jfType: item.dictValue == "11" ? "3" : jfType, jfType: item.dictValue == "11" ? "3" : jfType,
isVaild: false, // 校验通过 isVaild: item.isVaild || false, // 校验通过
status: 0, status: item.status || 0,
statusLable: "未巡检", statusLable: item.statusLable || "未巡检",
}; };
}); });
this.listData = this.deepClone(list); this.listData = this.deepClone(list);
console.log("查看this.listData", this.listData); console.log("this.listData", this.listData);
const group1 = list.slice(0, 5); const group1 = list.slice(0, 5);
const group2 = list.slice(5, 10).reverse(); const group2 = list.slice(5, 10).reverse();
const group3 = list.slice(10); const group3 = list.slice(10);
this.rows = [group1, group2, group3]; this.rows = [group1, group2, group3];
if (this.uid) {
this.inspectionCode = this.detailsInfo.inspectionCode;
} else {
this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${ this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100 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;
} }
// 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(); resolve();
}); });
}, },
...@@ -347,12 +361,13 @@ export default { ...@@ -347,12 +361,13 @@ export default {
// 回显数据 // 回显数据
getDetails(uid) { getDetails(uid) {
uni.showLoading(); uni.showLoading();
getInspectionDetails(uid) return inspectApi
.info(uid)
.then((res) => { .then((res) => {
const detailsInfo = res; const detailsInfo = sqlToData(res);
console.log("detailsInfo", detailsInfo); console.log("getDetails", detailsInfo);
this.listData = this.deepClone(detailsInfo.originData); this.listData = this.deepClone(detailsInfo.originData);
console.log("详情this.listData", this.listData);
this.detailsInfo = detailsInfo; this.detailsInfo = detailsInfo;
this.inspectionNumber = detailsInfo.inspectionNumber; this.inspectionNumber = detailsInfo.inspectionNumber;
...@@ -360,8 +375,10 @@ export default { ...@@ -360,8 +375,10 @@ export default {
this.cardsInfo = detailsInfo.originData; this.cardsInfo = detailsInfo.originData;
this.isSubmit = this.detailsInfo.isSubmit; this.isSubmit = this.detailsInfo.isSubmit;
this.isSign = this.detailsInfo.isSign; this.isSign = this.detailsInfo.isSign;
// 默认选中第一个机房
this.detailsItem = detailsInfo.originData[0].details; this.detailsItem = detailsInfo.originData[0].details;
console.log(12121);
if ( if (
this.detailsItem.afxt && this.detailsItem.afxt &&
this.detailsItem.afxt.detail && this.detailsItem.afxt.detail &&
...@@ -373,8 +390,9 @@ export default { ...@@ -373,8 +390,9 @@ export default {
); );
} }
this.allIsSubmitOne = detailsInfo.originData.every( this.allIsSubmitOne = detailsInfo.originData.every(
(item) => item.isSubmit === 1 (item) => item.isSubmit == 1
); );
let group1 = this.cardsInfo.slice(0, 5); let group1 = this.cardsInfo.slice(0, 5);
let group2 = this.cardsInfo.slice(5, 10); let group2 = this.cardsInfo.slice(5, 10);
let group3 = this.cardsInfo.slice(10); let group3 = this.cardsInfo.slice(10);
...@@ -396,6 +414,58 @@ export default { ...@@ -396,6 +414,58 @@ export default {
uni.hideLoading(); uni.hideLoading();
}); });
}, },
// 回显数据
// getDetails(uid) {
// uni.showLoading();
// getInspectionDetails(uid)
// .then((res) => {
// const detailsInfo = res;
// console.log("detailsInfo", detailsInfo);
// this.listData = this.deepClone(detailsInfo.originData);
// console.log("详情this.listData", this.listData);
// this.detailsInfo = detailsInfo;
// this.inspectionNumber = detailsInfo.inspectionNumber;
// this.inspectionCode = detailsInfo.inspectionCode;
// this.cardsInfo = detailsInfo.originData;
// this.isSubmit = this.detailsInfo.isSubmit;
// this.isSign = this.detailsInfo.isSign;
// this.detailsItem = detailsInfo.originData[0].details;
// console.log(12121);
// 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];
// console.log("this.cardsInfo", this.cardsInfo);
// this.isDisable = this.isDisable || detailsInfo.synchronization == 1; // 是否禁用 1:已同步数据 0: 未同步数据
// uni.hideLoading();
// })
// .catch((error) => {
// uni.showToast({
// title: error.msg,
// icon: "none",
// duration: 1000,
// });
// uni.hideLoading();
// });
// },
// 获取机房详情 // 获取机房详情
getDetailsItem(location, jfType, value) { getDetailsItem(location, jfType, value) {
this.activeName = location; this.activeName = location;
......
...@@ -118,13 +118,6 @@ ...@@ -118,13 +118,6 @@
</view> </view>
<view class="submit-module"> <view class="submit-module">
<view class="action-btn" @click="submit(0)">暂存</view> <view class="action-btn" @click="submit(0)">暂存</view>
<!-- <view
v-if="isSubmitEnabled"
class="action-btn complete-btn"
@click="submit(1)"
>
完成巡检
</view> -->
<view <view
v-if="tabs[activeTab].value !== 'qt'" v-if="tabs[activeTab].value !== 'qt'"
class="action-btn complete-btn" class="action-btn complete-btn"
...@@ -240,6 +233,7 @@ export default { ...@@ -240,6 +233,7 @@ export default {
// }, // },
}, },
onLoad(options) { onLoad(options) {
console.log("option detail", options);
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;
...@@ -722,8 +716,6 @@ export default { ...@@ -722,8 +716,6 @@ export default {
// return false; // return false;
// } // }
let data = this.getAllChildFormData(); let data = this.getAllChildFormData();
console.log("哒哒哒", data);
console.log("哒哒哒", data, data[this.tabs[this.activeTab].value]);
this.tabs[this.activeTab].status = this.tabs[this.activeTab].status =
data[this.tabs[this.activeTab].value].status; data[this.tabs[this.activeTab].value].status;
if (this.activeTab === this.tabs.length - 1) { if (this.activeTab === this.tabs.length - 1) {
...@@ -758,15 +750,15 @@ export default { ...@@ -758,15 +750,15 @@ export default {
this.switchTab((this.activeTab + 1) % this.tabs.length); this.switchTab((this.activeTab + 1) % this.tabs.length);
}, },
setQtValue(data) { setQtValue(data) {
this.tabs.forEach((item) => { this.detailsInfo.originData.forEach((item) => {
let refName = item.value; if (item.details && item.details.qt && item.details.qt.detail) {
// 通过 this.$refs[refName] 获取子组件实例 item.details.qt.detail.forEach((current) => {
const childComponent = this.$refs[refName]; item.conclusion = data.conclusion;
if (childComponent && childComponent.setQtValue) { item.photos = data.photos;
console.log("setQtValue", data); });
childComponent.setQtValue(data);
} }
}); });
console.log("setQtValue", this.detailsInfo);
}, },
}, },
}; };
......
...@@ -40,19 +40,31 @@ export function sqlToData(sqlData) { ...@@ -40,19 +40,31 @@ export function sqlToData(sqlData) {
isSubmit = 1; isSubmit = 1;
synchronization = sqlData.synFlag; synchronization = sqlData.synFlag;
} }
const originData = JSON.parse(sqlData.inspectionData || "{}");
const originalData = { const inspectedItems = originData.filter(
(item) => item.status == 1 || item.status == 2
);
// 获取已经巡检过的数量
const inspectionNumber = inspectedItems.length;
// 是否全部填写完
const allIsSubmitOne = originData.every((item) => item.isSubmit == 1);
const ret = {
id: sqlData.id, id: sqlData.id,
inspectionType: sqlData.inspectionType, inspectionType: sqlData.inspectionType,
inspectionCode: sqlData.inspectionCode, inspectionCode: sqlData.inspectionCode,
isException: sqlData.isException, isException: sqlData.isException,
inspectionNumber: sqlData.inspectionNumber,
signImg: sqlData.signImg, signImg: sqlData.signImg,
originData: sqlData.inspectionData,
createTime: sqlData.createTime, createTime: sqlData.createTime,
isSubmit: isSubmit, isSubmit: isSubmit,
synchronization: synchronization, synchronization: synchronization,
originData,
inspectionNumber,
allIsSubmitOne,
}; };
return originalData; return ret;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论