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

fix

上级 0db56cf7
<template>
<!-- 首页 -->
<view class="container">
<navigator url="/pages/test/index" hover-class="navigator-hover">
<button type="default">跳转到新页面</button>
</navigator>
<view class="flex">
<navigator url="/pages/test/index" hover-class="navigator-hover">
<button type="default" class="uni-btn">跳转TEST</button>
</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="title">杭州内网监管在线-运维在线</view>
......@@ -74,89 +82,88 @@
<script>
export default {
data() {
return {
cards: [{
image: '../../static/img/jf.png',
text: '机房巡检',
url:"/pages/inspectionContent/inspectionContentList?backValue=home"
},
{
image: '../../static/img/jd.png',
text: '井道巡检',
url:"/pages/shaftInspection/shaftInspectionList?backValue=home"
},
{
image: '../../static/img/sj.png',
text: '设备上架',
url: "/pages/listingManagement/index?backValue=home"
}
],
userName: this.$store.state.now_user.userName,
};
},
computed: {
isAdmin() {
return this.$store.state.now_user.isAdmin;
},
},
methods: {
// 修改密码
updatePassword() {
uni.navigateTo({
url: "/pages/index/editPd",
});
},
//退出
logOut() {
this.$refs.inputDialog2.open();
},
// 查看操作日志
lookLog() {
uni.navigateTo({
url: "/pages/index/operLog",
});
},
// 三模块卡片跳转页面
toList(url){
uni.navigateTo({
url: url,
});
},
// 巡检管理
toInspectionManagement() {
uni.navigateTo({
url: "/pages/inspectionManagement/index?backValue=home",
});
},
toListingManagement() {
uni.navigateTo({
url: "/pages/listingManagement/index?backValue=home",
});
},
// 井道巡检
toShaftInspection() {
uni.navigateTo({
url: "/pages/shaftInspection/shaftInspectionNew?backValue=home",
});
},
//退出--弹出对话框
dialogInputConfirm2() {
uni.redirectTo({
url: "/pages/login/login",
success: () => {
// uni.clearStorage(); //测试将所有缓存清除
uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync(
"last_time",
this.$store.state.now_user.LastSynchronizationTime || ""
);
},
});
},
}
data() {
return {
cards: [
{
image: "../../static/img/jf.png",
text: "机房巡检",
url: "/pages/inspectionContent/inspectionContentList?backValue=home",
},
{
image: "../../static/img/jd.png",
text: "井道巡检",
url: "/pages/shaftInspection/shaftInspectionList?backValue=home",
},
{
image: "../../static/img/sj.png",
text: "设备上架",
url: "/pages/listingManagement/index?backValue=home",
},
],
userName: this.$store.state.now_user.userName,
};
},
computed: {
isAdmin() {
return this.$store.state.now_user.isAdmin;
},
},
methods: {
// 修改密码
updatePassword() {
uni.navigateTo({
url: "/pages/index/editPd",
});
},
//退出
logOut() {
this.$refs.inputDialog2.open();
},
// 查看操作日志
lookLog() {
uni.navigateTo({
url: "/pages/index/operLog",
});
},
// 三模块卡片跳转页面
toList(url) {
uni.navigateTo({
url: url,
});
},
// 巡检管理
toInspectionManagement() {
uni.navigateTo({
url: "/pages/inspectionManagement/index?backValue=home",
});
},
toListingManagement() {
uni.navigateTo({
url: "/pages/listingManagement/index?backValue=home",
});
},
// 井道巡检
toShaftInspection() {
uni.navigateTo({
url: "/pages/shaftInspection/shaftInspectionNew?backValue=home",
});
},
//退出--弹出对话框
dialogInputConfirm2() {
uni.redirectTo({
url: "/pages/login/login",
success: () => {
// uni.clearStorage(); //测试将所有缓存清除
uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync(
"last_time",
this.$store.state.now_user.LastSynchronizationTime || ""
);
},
});
},
},
};
</script>
......
......@@ -5,19 +5,9 @@ export default {
item.inspectionResult = 0;
});
console.log("this.isQt", this.isQt);
if (!this.isQt) {
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";
import startDialog from "./components/dialog.vue";
import assRoomApi from "@/api/assRoom.js";
import inspectApi from "@/api/inspect";
import { sqlToData } from "./shared";
export default {
components: {
signDialog,
......@@ -247,25 +249,28 @@ export default {
this.options = options;
this.backValue = this.options.backValue || "";
this.isDisable = options.isDisable == 1 ? true : false;
console.log("options.uid", this.options.uid);
this.uid = this.options.uid || "";
this.value = this.options.value || "1";
},
onShow() {
if (this.uid) {
this.getDetails(this.uid);
this.getRoomList().then((res) => {
this.init(res).then(() => {
this.getDetails(this.uid);
});
});
} else {
this.getRoomList().then((res) => {
this.init(res);
});
}
// this.startDialogData.text = [
// `请到“${this.name}”后;`,
// "点击“我已到达”开始巡检",
// ];
console.log("this.startDialogData", this.startDialogData);
this.all_data = this.$store.state.all_data;
console.log("onShow", this.all_data);
},
methods: {
getRoomList() {
......@@ -275,6 +280,7 @@ export default {
});
},
init(baseList) {
this.value = baseList[0].dictValue;
return new Promise((resolve, reject) => {
const roomFeatureMap = {
1: "1",
......@@ -292,33 +298,41 @@ export default {
* roomFeature 机房类型枚举:1.汇聚机房,2.屏蔽机房,3.UPS机房,4.数据机房
*/
jfType: item.dictValue == "11" ? "3" : jfType,
isVaild: false, // 校验通过
status: 0,
statusLable: "未巡检",
isVaild: item.isVaild || false, // 校验通过
status: item.status || 0,
statusLable: item.statusLable || "未巡检",
};
});
this.listData = this.deepClone(list);
console.log("查看this.listData", this.listData);
console.log("this.listData", this.listData);
const group1 = list.slice(0, 5);
const group2 = list.slice(5, 10).reverse();
const group3 = list.slice(10);
this.rows = [group1, group2, group3];
this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${
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);
if (this.uid) {
this.inspectionCode = this.detailsInfo.inspectionCode;
} else {
this.baseInfo = this.$store.state.temp_data;
this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${
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();
});
},
......@@ -347,12 +361,13 @@ export default {
// 回显数据
getDetails(uid) {
uni.showLoading();
getInspectionDetails(uid)
return inspectApi
.info(uid)
.then((res) => {
const detailsInfo = res;
console.log("detailsInfo", detailsInfo);
const detailsInfo = sqlToData(res);
console.log("getDetails", detailsInfo);
this.listData = this.deepClone(detailsInfo.originData);
console.log("详情this.listData", this.listData);
this.detailsInfo = detailsInfo;
this.inspectionNumber = detailsInfo.inspectionNumber;
......@@ -360,8 +375,10 @@ export default {
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 &&
......@@ -373,8 +390,9 @@ export default {
);
}
this.allIsSubmitOne = detailsInfo.originData.every(
(item) => item.isSubmit === 1
(item) => item.isSubmit == 1
);
let group1 = this.cardsInfo.slice(0, 5);
let group2 = this.cardsInfo.slice(5, 10);
let group3 = this.cardsInfo.slice(10);
......@@ -396,6 +414,58 @@ export default {
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) {
this.activeName = location;
......
......@@ -118,13 +118,6 @@
</view>
<view class="submit-module">
<view class="action-btn" @click="submit(0)">暂存</view>
<!-- <view
v-if="isSubmitEnabled"
class="action-btn complete-btn"
@click="submit(1)"
>
完成巡检
</view> -->
<view
v-if="tabs[activeTab].value !== 'qt'"
class="action-btn complete-btn"
......@@ -240,6 +233,7 @@ export default {
// },
},
onLoad(options) {
console.log("option detail", options);
this.isDisable = options.isDisable == 1 ? true : false;
this.uid = options.uid;
this.jfType = options.jfType;
......@@ -722,8 +716,6 @@ export default {
// return false;
// }
let data = this.getAllChildFormData();
console.log("哒哒哒", data);
console.log("哒哒哒", data, data[this.tabs[this.activeTab].value]);
this.tabs[this.activeTab].status =
data[this.tabs[this.activeTab].value].status;
if (this.activeTab === this.tabs.length - 1) {
......@@ -758,15 +750,15 @@ export default {
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) {
console.log("setQtValue", data);
childComponent.setQtValue(data);
this.detailsInfo.originData.forEach((item) => {
if (item.details && item.details.qt && item.details.qt.detail) {
item.details.qt.detail.forEach((current) => {
item.conclusion = data.conclusion;
item.photos = data.photos;
});
}
});
console.log("setQtValue", this.detailsInfo);
},
},
};
......
......@@ -40,19 +40,31 @@ export function sqlToData(sqlData) {
isSubmit = 1;
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,
inspectionType: sqlData.inspectionType,
inspectionCode: sqlData.inspectionCode,
isException: sqlData.isException,
inspectionNumber: sqlData.inspectionNumber,
signImg: sqlData.signImg,
originData: sqlData.inspectionData,
createTime: sqlData.createTime,
isSubmit: isSubmit,
synchronization: synchronization,
originData,
inspectionNumber,
allIsSubmitOne,
};
return originalData;
return ret;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论