提交 5b600a22 authored 作者: JaxBBLL's avatar JaxBBLL

fix: bugs

上级 57222d0f
...@@ -223,10 +223,9 @@ export default { ...@@ -223,10 +223,9 @@ export default {
const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail); const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail);
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
console.log(222, this.itemData);
this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常 this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
this.itemData.statusLabel = isAllOne.statusLabel; this.itemData.statusLabel = isAllOne.statusLabel;
// console.log(this.itemData); console.log('afxt', this.itemData);
return this.itemData; return this.itemData;
}, },
// 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
...@@ -249,7 +248,7 @@ export default { ...@@ -249,7 +248,7 @@ export default {
console.log("确定需要校验的范围 ", itemsToCheck); console.log("确定需要校验的范围 ", itemsToCheck);
// 检查 conclusion 和 photos(如果存在) // 检查 conclusion 和 photos(如果存在)
for (const item of itemsToCheck) { for (const item of itemsToCheck) {
if (item.inspectionResult === 0) { if (item.inspectionResult === 0 || item.inspectionResult === 2) {
continue; // 跳过检查 continue; // 跳过检查
} }
if ("conclusion" in item && !item.conclusion) { if ("conclusion" in item && !item.conclusion) {
......
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
"需处理", "需处理",
"已处理" "已处理"
]; ];
}, }
}, },
}; };
</script> </script>
...@@ -143,6 +143,7 @@ export default { ...@@ -143,6 +143,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
// pointer-events: none;
z-index: 999999; z-index: 999999;
.synchronous-content { .synchronous-content {
padding: 3% 20px 32px 24px; padding: 3% 20px 32px 24px;
......
...@@ -287,13 +287,36 @@ ...@@ -287,13 +287,36 @@
class="cards-item" class="cards-item"
> >
<view class="name" <view class="name"
>{{ item.label }}{{ index === 0 ? `(${item.setting})` : "" >
}}<text <template v-if="index==0">
<view>
{{ item.label }}
<text
class="status" class="status"
:class="{ warning: item.inspectionResult === 1 }" :class="{ warning: item.inspectionResult === 1 }"
>{{ item.inspectionResultLable }}</text >{{ item.inspectionResultLable }}
></view </text>
</view>
<!-- <text>
{{ item.settingLabel }} {{ `(${item.setting})` }}
</text> -->
</template>
<template v-else>
{{ item.label }}
<text
class="status"
:class="{ warning: item.inspectionResult === 1 }"
>{{ item.inspectionResultLable }}
</text>
</template>
</view
> >
<view v-if="index==0" class="list">
<view class="label" style="width: 70px;">{{item.settingLabel}}</view>
<view class="content">
{{ item.setting }}
</view>
</view>
<view class="list"> <view class="list">
<view class="label">情况描述:</view> <view class="label">情况描述:</view>
<view class="content"> <view class="content">
......
...@@ -67,6 +67,7 @@ export default { ...@@ -67,6 +67,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
z-index: 99999;
.synchronous-content { .synchronous-content {
padding: 25.6px 19.2px; padding: 25.6px 19.2px;
width: 420px; width: 420px;
......
<template> <template>
<view class="container"> <view class="container">
<uni-nav-bar :fixed="true" background-color="rgba(214, 240, 255, 0.0)" status-bar rightWidth="240"> <uni-nav-bar
:fixed="true"
background-color="rgba(214, 240, 255, 0.0)"
status-bar
rightWidth="240"
>
<block slot="left"> <block slot="left">
<view class="" @click="back"> <view class="" @click="back">
<text class="iconfont icon-fanhui"></text> <text class="iconfont icon-fanhui"></text>
...@@ -16,12 +21,17 @@ ...@@ -16,12 +21,17 @@
<view class="profile-box"> <view class="profile-box">
<view class="profile-left"> <view class="profile-left">
<view class="avatar"> <view class="avatar">
<image src="@/static/img/add-img/defaultAvatar.png" mode="aspectFit"></image> <image
src="@/static/img/add-img/defaultAvatar.png"
mode="aspectFit"
></image>
</view> </view>
<view class="info"> <view class="info">
<view class="describe"> <view class="describe">
<view class="username">{{ userInfo.user }}</view> <view class="username">{{ userInfo.user }}</view>
<view v-if="abnormalLengths" class="abnormal">存在异常 {{ abnormalLengths }}</view> <view v-if="abnormalLengths" class="abnormal"
>存在异常 {{ abnormalLengths }}</view
>
</view> </view>
<view class="describe"> <view class="describe">
<view class="number"> <view class="number">
...@@ -39,23 +49,40 @@ ...@@ -39,23 +49,40 @@
</view> </view>
<!-- v-if="allIsSubmitOne" --> <!-- v-if="allIsSubmitOne" -->
<view class="profile-right"> <view class="profile-right">
<button <view
v-if="!isSign" v-if="!isSign"
:disabled="!allIsSubmitOne" :disabled="!allIsSubmitOne"
class="record-button"
:class="{ :class="{
'is-disabled': !allIsSubmitOne 'record-button': true,
'disabled-btn': !allIsSubmitOne,
}" }"
@click="toSign" @click="toSign"
> >
巡检人签字 巡检人签字
</button> </view>
<div v-else style="display: flex"> <div v-else style="display: flex">
<image class="sign-img" mode="aspectFit" :src="detailsInfo.signImg" @click="previewImage([detailsInfo.signImg], 0)"></image> <image
<button v-if="detailsInfo.synchronization != 1" class="record-button" @click="toSign">重签</button> class="sign-img"
mode="aspectFit"
:src="detailsInfo.signImg"
@click="previewImage([detailsInfo.signImg], 0)"
></image>
<button
v-if="detailsInfo.synchronization != 1"
class="record-button"
@click="toSign"
>
重签
</button>
</div> </div>
<template v-if="allIsSubmitOne"> <template v-if="allIsSubmitOne">
<button v-if="detailsInfo.synchronization != 1 && isSign" class="inspection-button ml-10" @click="onSyncData(true)">数据同步</button> <button
v-if="detailsInfo.synchronization != 1 && isSign"
class="inspection-button ml-10"
@click="onSyncData(true)"
>
数据同步
</button>
</template> </template>
</view> </view>
</view> </view>
...@@ -76,14 +103,24 @@ ...@@ -76,14 +103,24 @@
</view> </view>
</view> </view>
<view v-if="!isSign" class="card-box"> <view v-if="!isSign" class="card-box">
<view class="card-row" :class="{ right: rowIndex % 2 !== 0 }" v-for="(row, rowIndex) in rows" :key="rowIndex"> <view
<view class="card-wrapper" v-for="(card, cardIndex) in row" :key="cardIndex" @click="startDialog(card.name, card.jfType, card.value, false)"> class="card-row"
:class="{ right: rowIndex % 2 !== 0 }"
v-for="(row, rowIndex) in rows"
:key="rowIndex"
>
<view
class="card-wrapper"
v-for="(card, cardIndex) in row"
:key="cardIndex"
@click="startDialog(card.name, card.jfType, card.value, false)"
>
<view <view
class="card" class="card"
:class="{ :class="{
status1: card.status == 1, status1: card.status == 1,
status2: card.status == 2, status2: card.status == 2,
active: value === card.value active: value === card.value,
}" }"
> >
<view class="card-content"> <view class="card-content">
...@@ -92,9 +129,18 @@ ...@@ -92,9 +129,18 @@
<text class="iconfont icon-weixunjian"></text> <text class="iconfont icon-weixunjian"></text>
</template> </template>
<template v-else> <template v-else>
<text v-if="card.status == 0" class="iconfont icon-weixunjian"></text> <text
<text v-if="card.status == 1" class="iconfont icon-wancheng"></text> v-if="card.status == 0"
<text v-if="card.status == 2" class="iconfont icon-shibai1"></text> class="iconfont icon-weixunjian"
></text>
<text
v-if="card.status == 1"
class="iconfont icon-wancheng"
></text>
<text
v-if="card.status == 2"
class="iconfont icon-shibai1"
></text>
</template> </template>
<text class="status" v-if="card.isSubmit == 0">草稿</text> <text class="status" v-if="card.isSubmit == 0">草稿</text>
...@@ -105,13 +151,38 @@ ...@@ -105,13 +151,38 @@
</view> </view>
</view> </view>
<view class="spacer-image right" v-if="cardIndex < row.length - 1"> <view class="spacer-image right" v-if="cardIndex < row.length - 1">
<image v-if="inspectionNumber == 11" class="img" src="@/static/img/arr2.svg" mode="aspectFit"></image> <image
<image v-else class="img" src="@/static/img/arr1.svg" mode="aspectFit"></image> v-if="inspectionNumber == 11"
class="img"
src="@/static/img/arr2.svg"
mode="aspectFit"
></image>
<image
v-else
class="img"
src="@/static/img/arr1.svg"
mode="aspectFit"
></image>
</view> </view>
<view class="spacer-image bottom" v-if="rowIndex < rows.length - 1"> <view class="spacer-image bottom" v-if="rowIndex < rows.length - 1">
<view v-if="(rowIndex == 1 && cardIndex == 0) || (rowIndex == 0 && cardIndex == 4)"> <view
<image v-if="inspectionNumber == 11" class="img" src="@/static/img/arr2.svg" mode="aspectFit"></image> v-if="
<image v-else class="img" src="@/static/img/arr1.svg" mode="aspectFit"></image> (rowIndex == 1 && cardIndex == 0) ||
(rowIndex == 0 && cardIndex == 4)
"
>
<image
v-if="inspectionNumber == 11"
class="img"
src="@/static/img/arr2.svg"
mode="aspectFit"
></image>
<image
v-else
class="img"
src="@/static/img/arr1.svg"
mode="aspectFit"
></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -119,18 +190,31 @@ ...@@ -119,18 +190,31 @@
</view> </view>
</view> </view>
<view v-else class="card-box detail"> <view v-else class="card-box detail">
<view class="card-row" :class="{ right: rowIndex % 2 !== 0 }" v-for="(row, rowIndex) in rows" :key="rowIndex"> <view
<view class="card-wrapper" v-for="(card, cardIndex) in row" :key="cardIndex" @click="getDetailsItem(card.name, card.jfType, card.value)"> class="card-row"
:class="{ right: rowIndex % 2 !== 0 }"
v-for="(row, rowIndex) in rows"
:key="rowIndex"
>
<view
class="card-wrapper"
v-for="(card, cardIndex) in row"
:key="cardIndex"
@click="getDetailsItem(card.name, card.jfType, card.value)"
>
<view <view
class="card" class="card"
:class="{ :class="{
active: value === card.value, active: value === card.value,
warning: card.statusLable == '巡检异常' warning: card.statusLable == '巡检异常',
}" }"
> >
<view class="card-content"> <view class="card-content">
<view class="first-row"> <view class="first-row">
<image class="icon" src="@/static/img/add-img/home1.png"></image> <image
class="icon"
src="@/static/img/add-img/home1.png"
></image>
<text class="status">{{ card.statusLable }}</text> <text class="status">{{ card.statusLable }}</text>
</view> </view>
<view class="second-row"> <view class="second-row">
...@@ -147,32 +231,45 @@ ...@@ -147,32 +231,45 @@
</view> </view>
<signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog> <signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog>
<!-- 巡检弹窗 --> <!-- 巡检弹窗 -->
<startDialog ref="startDialog" :startDialogData="startDialogData" @confirm="handleStartDialog"></startDialog> <startDialog
<Dialog v-show="isDialog" :list="propList" @close="onSyncData(false)"></Dialog> ref="startDialog"
:startDialogData="startDialogData"
@confirm="handleStartDialog"
></startDialog>
<Dialog
v-show="isDialog"
:list="propList"
@close="onSyncData(false)"
></Dialog>
</view> </view>
</template> </template>
<script> <script>
import moment from 'moment'; import moment from "moment";
import { writeInspectionData, addLog, getLogContent, LOG_TYPE_ENUM } from '@/utils/IoReadingAndWriting.js'; import {
import signDialog from '@/components/signDialog.vue'; writeInspectionData,
import detail from './components/detail.vue'; addLog,
import startDialog from './components/dialog.vue'; getLogContent,
LOG_TYPE_ENUM,
} from "@/utils/IoReadingAndWriting.js";
import signDialog from "@/components/signDialog.vue";
import detail from "./components/detail.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 inspectApi from "@/api/inspect";
import { sqlToData, dataToSql, getHistoryData } from './shared'; import { sqlToData, dataToSql, getHistoryData } from "./shared";
import Dialog from '@/pages/inspectionManagement/dialog.vue'; import Dialog from "@/pages/inspectionManagement/dialog.vue";
export default { export default {
components: { components: {
signDialog, signDialog,
detail, detail,
startDialog, startDialog,
Dialog Dialog,
}, },
data() { data() {
return { return {
inspectionCode: '', inspectionCode: "",
rows: [], rows: [],
baseInfo: {}, // 基础信息 baseInfo: {}, // 基础信息
inspectionNumber: 0, // 已巡检的井道数量 inspectionNumber: 0, // 已巡检的井道数量
...@@ -181,23 +278,23 @@ export default { ...@@ -181,23 +278,23 @@ export default {
isDisable: false, // 禁用 isDisable: false, // 禁用
isSign: false, //签名状态 isSign: false, //签名状态
isSubmit: 0, //提交状态 isSubmit: 0, //提交状态
uid: '', uid: "",
options: {}, //存储数据 options: {}, //存储数据
backValue: '', backValue: "",
all_data: [], //所有数据 all_data: [], //所有数据
jfType: '0', //机房类型 jfType: "0", //机房类型
allIsSubmitOne: false, allIsSubmitOne: false,
startDialogData: { startDialogData: {
text: [], text: [],
isList: true, isList: true,
isLast: false isLast: false,
}, //弹窗文案 }, //弹窗文案
name: 'F座3楼-内环屏蔽机房', name: "F座3楼-内环屏蔽机房",
value: '1', value: "1",
listData: [], listData: [],
isDialog: false, isDialog: false,
propList: [], propList: [],
did: '' // 最近7天数据的id did: "", // 最近7天数据的id
}; };
}, },
computed: { computed: {
...@@ -205,33 +302,35 @@ export default { ...@@ -205,33 +302,35 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
updateDate() { updateDate() {
return moment(Number(this.detailsInfo.updateTime || this.detailsInfo.createTime)).format('YYYY-MM-DD'); return moment(
Number(this.detailsInfo.updateTime || this.detailsInfo.createTime)
).format("YYYY-MM-DD");
}, },
abnormalLengths() { abnormalLengths() {
const originData = this.detailsInfo?.originData; const originData = this.detailsInfo?.originData;
let ret = 0; let ret = 0;
(originData || []).forEach(jf => { (originData || []).forEach((jf) => {
const details = jf.details || {} const details = jf.details || {};
Object.keys(details).forEach(key => { Object.keys(details).forEach((key) => {
const item = details[key] const item = details[key];
console.log('x', key, item); console.log("x", key, item);
(item.detail || []).forEach(current =>{ (item.detail || []).forEach((current) => {
if(current.inspectionResult === 1) { if (current.inspectionResult === 1) {
ret++ ret++;
}
})
})
})
console.log('ret', ret);
return ret
} }
});
});
});
console.log("ret", ret);
return ret;
},
}, },
onLoad(options) { onLoad(options) {
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;
this.uid = this.options.uid || ''; this.uid = this.options.uid || "";
this.value = this.options.value || '1'; this.value = this.options.value || "1";
}, },
onShow() { onShow() {
// 已经签名不触发更新,主要用于图片预览关闭后会触发onShow // 已经签名不触发更新,主要用于图片预览关闭后会触发onShow
...@@ -248,7 +347,7 @@ export default { ...@@ -248,7 +347,7 @@ export default {
getHistoryData().then((detailsInfo) => { getHistoryData().then((detailsInfo) => {
if (detailsInfo) { if (detailsInfo) {
// 处理历史数据(选项、文案、照片;异常项-不调出文案及照片) // 处理历史数据(选项、文案、照片;异常项-不调出文案及照片)
console.log('detailsInfo', detailsInfo); console.log("detailsInfo", detailsInfo);
this.did = detailsInfo.id; this.did = detailsInfo.id;
...@@ -259,7 +358,9 @@ export default { ...@@ -259,7 +358,9 @@ export default {
this.detailsInfo = detailsInfo; this.detailsInfo = detailsInfo;
this.inspectionNumber = detailsInfo.inspectionNumber; this.inspectionNumber = detailsInfo.inspectionNumber;
this.inspectionCode = `JFXJ${moment().format('yyyyMMDDHHmmss')}${Math.floor(Math.random() * 900) + 100}`; this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100
}`;
this.cardsInfo = detailsInfo.originData; this.cardsInfo = detailsInfo.originData;
this.isSubmit = 0; this.isSubmit = 0;
this.isSign = false; this.isSign = false;
...@@ -267,10 +368,17 @@ export default { ...@@ -267,10 +368,17 @@ export default {
// 默认选中第一个机房 // 默认选中第一个机房
this.detailsItem = detailsInfo.originData[0].details; this.detailsItem = detailsInfo.originData[0].details;
if (this.detailsItem.afxt && this.detailsItem.afxt.detail && this.detailsItem.afxt.detail[2].inspectionResult === 1) { if (
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3); this.detailsItem.afxt &&
} this.detailsItem.afxt.detail &&
this.allIsSubmitOne = detailsInfo.originData.every((item) => item.isSubmit == 1); 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 group1 = this.cardsInfo.slice(0, 5);
let group2 = this.cardsInfo.slice(5, 10); let group2 = this.cardsInfo.slice(5, 10);
...@@ -293,21 +401,21 @@ export default { ...@@ -293,21 +401,21 @@ export default {
// `请到“${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;
}, },
methods: { methods: {
getRoomList() { getRoomList() {
return assRoomApi.selectRoomList(1).then((res) => { return assRoomApi.selectRoomList(1).then((res) => {
console.log('机房列表', res); console.log("机房列表", res);
return res; return res;
}); });
}, },
listFormat(baseList) { listFormat(baseList) {
const roomFeatureMap = { const roomFeatureMap = {
1: '1', 1: "1",
2: '0', 2: "0",
3: '2' 3: "2",
}; };
let list = baseList.map((item, index) => { let list = baseList.map((item, index) => {
const jfType = roomFeatureMap[item.roomFeature]; const jfType = roomFeatureMap[item.roomFeature];
...@@ -319,10 +427,10 @@ export default { ...@@ -319,10 +427,10 @@ export default {
* 前端用的:jfType 机房类型 0屏蔽  1汇聚  2电池间(1) 3电池间(2) * 前端用的:jfType 机房类型 0屏蔽  1汇聚  2电池间(1) 3电池间(2)
* 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: item.isVaild || false, // 校验通过 isVaild: item.isVaild || false, // 校验通过
status: item.status || 0, status: item.status || 0,
statusLable: item.statusLable || '未巡检' statusLable: item.statusLable || "未巡检",
}; };
}); });
return list; return list;
...@@ -333,7 +441,7 @@ export default { ...@@ -333,7 +441,7 @@ export default {
let list = this.listFormat(baseList); let list = this.listFormat(baseList);
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();
...@@ -343,13 +451,15 @@ export default { ...@@ -343,13 +451,15 @@ export default {
if (this.uid) { if (this.uid) {
this.inspectionCode = this.detailsInfo.inspectionCode; this.inspectionCode = this.detailsInfo.inspectionCode;
} else { } else {
this.inspectionCode = `JFXJ${moment().format('yyyyMMDDHHmmss')}${Math.floor(Math.random() * 900) + 100}`; this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100
}`;
} }
resolve(); resolve();
}); });
}, },
deepClone(target) { deepClone(target) {
if (typeof target !== 'object' || target === null) { if (typeof target !== "object" || target === null) {
return target; return target;
} }
...@@ -376,9 +486,9 @@ export default { ...@@ -376,9 +486,9 @@ export default {
return inspectApi return inspectApi
.info(uid) .info(uid)
.then((res) => { .then((res) => {
console.log('before sqlToData', res); console.log("before sqlToData", res);
const detailsInfo = sqlToData(res); const detailsInfo = sqlToData(res);
console.log('getDetails', detailsInfo); console.log("getDetails", detailsInfo);
this.listData = this.listFormat(detailsInfo.originData); this.listData = this.listFormat(detailsInfo.originData);
...@@ -392,10 +502,19 @@ export default { ...@@ -392,10 +502,19 @@ export default {
// 默认选中第一个机房 // 默认选中第一个机房
this.detailsItem = detailsInfo.originData[0].details; this.detailsItem = detailsInfo.originData[0].details;
if (this.detailsItem.afxt && this.detailsItem.afxt.detail && this.detailsItem.afxt.detail[2].inspectionResult === 1) { if (
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3); this.detailsItem.afxt &&
} this.detailsItem.afxt.detail &&
this.allIsSubmitOne = detailsInfo.originData.every((item) => item.isSubmit == 1); 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 group1 = this.cardsInfo.slice(0, 5);
let group2 = this.cardsInfo.slice(5, 10); let group2 = this.cardsInfo.slice(5, 10);
...@@ -404,7 +523,7 @@ export default { ...@@ -404,7 +523,7 @@ export default {
group2 = group2.reverse(); group2 = group2.reverse();
} }
this.rows = [group1, group2, group3]; this.rows = [group1, group2, group3];
console.log('this.cardsInfo', this.cardsInfo); console.log("this.cardsInfo", this.cardsInfo);
this.isDisable = this.isDisable || detailsInfo.synchronization == 1; // 是否禁用 1:已同步数据 0: 未同步数据 this.isDisable = this.isDisable || detailsInfo.synchronization == 1; // 是否禁用 1:已同步数据 0: 未同步数据
uni.hideLoading(); uni.hideLoading();
...@@ -412,8 +531,8 @@ export default { ...@@ -412,8 +531,8 @@ export default {
.catch((error) => { .catch((error) => {
uni.showToast({ uni.showToast({
title: error.msg, title: error.msg,
icon: 'none', icon: "none",
duration: 1000 duration: 1000,
}); });
uni.hideLoading(); uni.hideLoading();
}); });
...@@ -427,29 +546,38 @@ export default { ...@@ -427,29 +546,38 @@ export default {
if (this.detailsItem.afxt.detail[2].inspectionResult === 1) { if (this.detailsItem.afxt.detail[2].inspectionResult === 1) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3); this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3);
} }
console.log('this.detailsItem', this.detailsItem); console.log("this.detailsItem", this.detailsItem);
}, },
startDialogBtn(name = 'F座3楼-内环屏蔽机房', jfType = '0', value = '1') { startDialogBtn(name = "F座3楼-内环屏蔽机房", jfType = "0", value = "1") {
let item = this.findTargetObject(this.listData); let item = this.findTargetObject(this.listData);
console.log('即将操作的机房', item); console.log("即将操作的机房", item);
this.name = this.uid ? item.name : name; this.name = this.uid ? item.name : name;
this.jfType = this.uid ? item.jfType : jfType; this.jfType = this.uid ? item.jfType : jfType;
this.value = this.uid ? item.value : value; this.value = this.uid ? item.value : value;
this.startDialogData.text = [`请到“${name}”后;`, '点击“我已到达”开始巡检']; this.startDialogData.text = [
`请到“${name}”后;`,
"点击“我已到达”开始巡检",
];
this.name = name; this.name = name;
this.jfType = jfType; this.jfType = jfType;
this.value = value; this.value = value;
this.$refs.startDialog.open(); this.$refs.startDialog.open();
}, },
startDialog(name = 'F座3楼-内环屏蔽机房', jfType = '0', value = '1') { startDialog(name = "F座3楼-内环屏蔽机房", jfType = "0", value = "1") {
this.name = name; this.name = name;
this.jfType = jfType; this.jfType = jfType;
this.value = value; this.value = value;
if (!this.uid && value != '1') { if (!this.uid && value != "1") {
this.startDialogData.text = [`当前线路非常用巡检线路,`, `是否需要从“${this.name}”开始巡检`]; this.startDialogData.text = [
`当前线路非常用巡检线路,`,
`是否需要从“${this.name}”开始巡检`,
];
} else { } else {
this.startDialogData.text = [`请到“${this.name}”后;`, '点击“我已到达”开始巡检']; this.startDialogData.text = [
`请到“${this.name}”后;`,
"点击“我已到达”开始巡检",
];
} }
this.$refs.startDialog.open(); this.$refs.startDialog.open();
}, },
...@@ -459,17 +587,20 @@ export default { ...@@ -459,17 +587,20 @@ export default {
}, },
// 跳转到具体的机房 // 跳转到具体的机房
toShaftInspection(name, jfType, value) { toShaftInspection(name, jfType, value) {
console.log('name, 跳转到具体的机房, value', name, jfType, value); console.log("name, 跳转到具体的机房, value", name, jfType, value);
uni.navigateTo({ uni.navigateTo({
url: `/pages/inspectionContent/inspectionContentNew?value=${value}&inspectionCode=${this.inspectionCode}&jfType=${jfType}&location=${name}&uid=${this.uid}&backValue=${this.backValue}&did=${this.did}` url: `/pages/inspectionContent/inspectionContentNew?value=${value}&inspectionCode=${this.inspectionCode}&jfType=${jfType}&location=${name}&uid=${this.uid}&backValue=${this.backValue}&did=${this.did}`,
}); });
}, },
lookTable() { lookTable() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/report/sampleTable?isJF=1' url: "/pages/report/sampleTable?isJF=1",
}); });
}, },
toSign() { toSign() {
if(!this.allIsSubmitOne) {
return;
}
this.$refs.signDialog.open(); this.$refs.signDialog.open();
}, },
findTargetObject(rows) { findTargetObject(rows) {
...@@ -511,10 +642,14 @@ export default { ...@@ -511,10 +642,14 @@ export default {
this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域 this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域
this.detailsInfo.signImg = signImg; // 回显到文字显示区域 this.detailsInfo.signImg = signImg; // 回显到文字显示区域
this.detailsInfo.isSubmit = 1; // 提交状态 this.detailsInfo.isSubmit = 1; // 提交状态
const isException = this.detailsInfo.originData.some((item) => item.status == 2); const isException = this.detailsInfo.originData.some(
(item) => item.status == 2
);
this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常 this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常
let allIsSubmitOne = this.detailsInfo.originData.every((item) => item.isSubmit === 1); let allIsSubmitOne = this.detailsInfo.originData.every(
(item) => item.isSubmit === 1
);
if (!allIsSubmitOne) { if (!allIsSubmitOne) {
// 如果有机房没有巡检完,记录是编辑状态 // 如果有机房没有巡检完,记录是编辑状态
...@@ -525,23 +660,31 @@ export default { ...@@ -525,23 +660,31 @@ export default {
this.realSave(this.detailsInfo); this.realSave(this.detailsInfo);
}, },
realSave(params, type = 'sign') { realSave(params, type = "sign") {
const send = dataToSql(params); const send = dataToSql(params);
const api = this.uid ? inspectApi.update : inspectApi.save; const api = this.uid ? inspectApi.update : inspectApi.save;
const inspectionCode = this.inspectionCode || `JFXJ${moment().format('yyyyMMDDHHmmss')}${Math.floor(Math.random() * 900) + 100}`; const inspectionCode =
this.inspectionCode ||
`JFXJ${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100
}`;
send.inspectionCode = inspectionCode; send.inspectionCode = inspectionCode;
console.log('send', send); console.log("send", send);
api(this.uid ? { id: this.uid, ...send } : send).then((res) => { api(this.uid ? { id: this.uid, ...send } : send).then((res) => {
const logContent = getLogContent(LOG_TYPE_ENUM.sys, `巡检编号(${inspectionCode})`, '同步'); const logContent = getLogContent(
LOG_TYPE_ENUM.sys,
`巡检编号(${inspectionCode})`,
"同步"
);
this.$logApi.addlog(logContent); this.$logApi.addlog(logContent);
console.log('logContent', logContent); console.log("logContent", logContent);
uni.showToast({ uni.showToast({
title: type == 'sign' ? '签字成功' : '同步成功', title: type == "sign" ? "签字成功" : "同步成功",
icon: 'success' icon: "success",
}); });
if (!this.uid) { if (!this.uid) {
...@@ -553,13 +696,13 @@ export default { ...@@ -553,13 +696,13 @@ export default {
}); });
}, },
back() { back() {
if (this.backValue === 'home') { if (this.backValue === "home") {
uni.navigateTo({ uni.navigateTo({
url: '/pages/home/home' url: "/pages/home/home",
}); });
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/inspectionManagement/index` url: `/pages/inspectionManagement/index`,
}); });
} }
}, },
...@@ -567,8 +710,7 @@ export default { ...@@ -567,8 +710,7 @@ export default {
uni.previewImage({ uni.previewImage({
current: index, current: index,
urls: images, urls: images,
success: (res) =>{ success: (res) => {},
}
}); });
}, },
onSyncData(show) { onSyncData(show) {
...@@ -576,15 +718,15 @@ export default { ...@@ -576,15 +718,15 @@ export default {
this.propList = [ this.propList = [
{ {
...dataToSql(this.detailsInfo), ...dataToSql(this.detailsInfo),
id: this.uid id: this.uid,
} },
]; ];
console.log('propList', this.propList); console.log("propList", this.propList);
if (!show) { if (!show) {
this.getDetails(this.uid); this.getDetails(this.uid);
} }
} },
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -716,6 +858,7 @@ export default { ...@@ -716,6 +858,7 @@ export default {
margin-right: 12.8px; margin-right: 12.8px;
} }
.record-button { .record-button {
display: block;
width: 115.2px; width: 115.2px;
height: 28.8px; height: 28.8px;
background: #ffffff; background: #ffffff;
...@@ -726,9 +869,12 @@ export default { ...@@ -726,9 +869,12 @@ export default {
color: #3774f6; color: #3774f6;
line-height: 28.8px; line-height: 28.8px;
font-weight: 400; font-weight: 400;
&.is-disabled { display: flex;
justify-content: center;
&.disabled-btn {
color: #c7c7c7; color: #c7c7c7;
border-color: #c7c7c7; background-color: #f9f9f9;
border-color: #f2f2f2;
} }
} }
} }
...@@ -951,4 +1097,6 @@ export default { ...@@ -951,4 +1097,6 @@ export default {
border: none; border: none;
} }
} }
</style> </style>
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
</view> </view>
<!-- v-if="value > 2" --> <!-- v-if="value > 2" -->
<view class="action-btn complete-btn" @click="submit(1)"> 完成巡检 </view> <view class="action-btn complete-btn" @click="submit(1)"> 完成巡检 </view>
<view class="action-btn" @click="normal"> 一键正常 </view> <!-- <view class="action-btn" @click="normal"> 一键正常 </view> -->
</view> </view>
<startDialog <startDialog
ref="startDialog" ref="startDialog"
...@@ -1154,10 +1154,10 @@ export default { ...@@ -1154,10 +1154,10 @@ export default {
gap: 16px; gap: 16px;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
bottom: 25.6px; bottom: 20px;
.action-btn { .action-btn {
width: 145.6px; width: 118px;
height: 38.4px; height: 38.4px;
line-height: 38.4px; line-height: 38.4px;
background: #ffffff; background: #ffffff;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<uni-easyinput v-if="passwordVisible" class="log-input" prefixIcon="locked" clearSize="0" <uni-easyinput v-if="passwordVisible" class="log-input" prefixIcon="locked" clearSize="0"
v-model="person.pwd" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" v-model="person.pwd" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder"
:passwordIcon="false" :type="passwordVisible ? 'text' : 'password'"></uni-easyinput> :passwordIcon="false" :type="passwordVisible ? 'text' : 'password'"></uni-easyinput>
<uni-easyinput v-else class="log-input" prefixIcon="locked-filled" clearSize="0" v-model="person.pd" <uni-easyinput v-else class="log-input" prefixIcon="locked-filled" clearSize="0" v-model="person.pwd"
@iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" :passwordIcon="false" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" :passwordIcon="false"
:type="passwordVisible ? 'text' : 'password'"></uni-easyinput> :type="passwordVisible ? 'text' : 'password'"></uni-easyinput>
</view> </view>
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
data() { data() {
return { return {
person: { person: {
account: "管理员", account: "", // "管理员",
pwd: "Gly@124", pwd: "" // Gly@124",
}, },
backButtonPress: 0, backButtonPress: 0,
personList: [], personList: [],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论