提交 713c576b authored 作者: 何宗全's avatar 何宗全

机房日常巡检-临时修改

上级 57b5d1b8
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "杭州内网机房巡检", "name" : "杭州内网机房巡检",
"appid" : "__UNI__A11BFD5", "appid" : "__UNI__A11BFD5",
"description" : "", "description" : "",
"versionName" : "1.0.4", "versionName" : "1.0.6",
"versionCode" : 105, "versionCode" : 106,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
......
...@@ -78,6 +78,42 @@ ...@@ -78,6 +78,42 @@
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
// 机房月度巡检列表
{
"path": "pages/inspectionContent/inspectionContentMonthlyList",
"style": {
"navigationBarTitleText": "",
"app-plus": {
// 将回弹属性关掉
"bounce": "none"
}
}
},
// 机房月度巡检新页面
{
"path": "pages/inspectionContent/inspectionContentMonthlyNew",
"style": {
"navigationBarTitleText": ""
}
},
// 机房年度巡检列表
{
"path": "pages/inspectionContent/inspectionContentYearList",
"style": {
"navigationBarTitleText": "",
"app-plus": {
// 将回弹属性关掉
"bounce": "none"
}
}
},
// 机房年度巡检新页面
{
"path": "pages/inspectionContent/inspectionContentYearNew",
"style": {
"navigationBarTitleText": ""
}
},
// 井道巡检列表 // 井道巡检列表
{ {
"path": "pages/shaftInspection/shaftInspectionList", "path": "pages/shaftInspection/shaftInspectionList",
......
...@@ -79,12 +79,12 @@ export default { ...@@ -79,12 +79,12 @@ export default {
cards: [ cards: [
{ {
image: "../../static/img/jf.png", image: "../../static/img/jf.png",
text: "机房巡检", text: "机房日常巡检",
url: "/pages/inspectionContent/inspectionContentList?backValue=home", 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",
}, },
{ {
...@@ -92,6 +92,16 @@ export default { ...@@ -92,6 +92,16 @@ export default {
text: "设备上架", text: "设备上架",
url: "/pages/listingManagement/index?backValue=home", url: "/pages/listingManagement/index?backValue=home",
}, },
{
image: "../../static/img/jf.png",
text: "机房月度巡检",
url: "/pages/inspectionContent/inspectionContentMonthlyList?backValue=home",
},
{
image: "../../static/img/jf.png",
text: "机房年度巡检",
url: "/pages/inspectionContent/inspectionContentYearList?backValue=home",
},
], ],
userName: this.$store.state.now_user.user, userName: this.$store.state.now_user.user,
}; };
...@@ -181,13 +191,13 @@ export default { ...@@ -181,13 +191,13 @@ export default {
align-items: center; align-items: center;
padding: 10px; padding: 10px;
position: relative; position: relative;
margin-bottom: 147px; margin-bottom: 60px;
.title { .title {
position: absolute; position: absolute;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
ont-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-size: 32px; font-size: 32px;
color: #000000; color: #000000;
text-align: center; text-align: center;
...@@ -234,7 +244,7 @@ export default { ...@@ -234,7 +244,7 @@ export default {
} }
.profile-section { .profile-section {
width: 720px; width: 680px;
.profile-box { .profile-box {
background-color: #fff; background-color: #fff;
...@@ -319,21 +329,23 @@ export default { ...@@ -319,21 +329,23 @@ export default {
} }
.card-section { .card-section {
width: 720px; width: 680px;
margin-top: 20px; margin-top: 16px;
.card-container { .card-container {
display: flex; display: flex;
justify-content: space-between; flex-wrap: wrap;
justify-content: center;
gap: 20px;
.card { .card {
width: 224px; width: 206px;
height: 194px; height: 140px;
border-radius: 10px; border-radius: 9px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding-top: 130px; padding-top: 95px;
background-size: cover; // 背景图覆盖整个卡片 background-size: cover; // 背景图覆盖整个卡片
background-position: center; // 背景图居中 background-position: center; // 背景图居中
......
<template>
<!-- 机房巡检操作 -->
<view>
<view v-for="(item, index) in itemData.detail" :key="index">
<view class="form-item">
<text class="form-label"
><text class="required">*</text>{{ item.label }}</text
>
<view class="switch-container">
<view
:class="['status-btn', { active: item.inspectionResult === 0 }]"
@click="setInspectionResult(index, 0, item.lableArr[0])"
>
{{ item.lableArr[0] }}
</view>
<view
:class="['status-btn', { active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
{{ item.lableArr[1] }}
</view>
</view>
</view>
<template v-if="item.inspectionResult === 1">
<view class="form-item">
<text class="form-label"
><text class="required">*</text>情况摘要</text
>
<text
:class="['conclusion', { 'no-text': !item.conclusion }]"
@click="showPopup(item, index)"
>
{{ item.conclusion || "请输入情况摘要" }}</text
>
</view>
<view class="form-item">
<text class="form-label"
><text class="required">*</text>现场照片</text
>
<CommonUpload v-model="item.photos" :max-count="5">
</CommonUpload> </view
></template> </view
><custom-popup
ref="customPopup"
:inspectionItem="inspectionItem"
@confirm="handlePopupConfirm"
></custom-popup>
</view>
</template>
<script>
import CommonUpload from "@/components/CommonUpload/index.vue";
import customPopup from "./customPopup.vue";
import _ from "lodash";
import mixin from "./mixin";
export default {
components: {
CommonUpload,
customPopup,
},
mixins: [mixin],
props: {
// 父组件传递的巡检状态
status: {
type: Number,
default: 0,
},
// 父组件传递的巡检事项名
inspectionItem: {
type: String,
default: "",
},
// 父组件传递的数据
defaultData: {
type: Object,
default: () => ({}),
},
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
itemData: {
isValid: false, // false是校验未通过 true是校验通过
status: 0, //0是未巡检 1是已巡检 2巡检异常
statusLabel: "未巡检",
inspectionItem: "", //巡检事项
detail: [
{
label: "温度、湿度显示",
inspectionResult: "",
inspectionResultLable: "正常",
lableArr: ["正常", "异常"],
conclusion: "",
photos: [],
},
],
},
};
},
computed: {
userInfo() {
return this.$store.state.now_user || {};
},
},
watch: {
defaultData(newVal) {
// 在这里处理数据变化
if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData;
}
},
},
async mounted() {
console.log("sdsadasd", this.itemData);
// if (Object.keys(this.defaultData).length !== 0) {
// this.itemData = this.defaultData;
// }
},
methods: {
// 拍照
takePhoto(index) {
uni.chooseImage({
count: 1,
sourceType: ["camera"], // 可以从相机拍摄
success: async (res) => {
if (this.photos.length < 5) {
const base64 = await this.convertFileToBase64(res.tempFilePaths[0]);
this.itemData.detail[index].photos.push(base64);
} else {
uni.showToast({
title: "最多只能上传5张照片",
icon: "none",
});
}
},
});
},
// 转化为base64
convertFileToBase64(filePath) {
return new Promise((resolve, reject) => {
plus.io.resolveLocalFileSystemURL(
filePath,
function (entry) {
entry.file(
function (file) {
const reader = new plus.io.FileReader();
reader.onloadend = function (evt) {
const base64 = evt.target.result; // 获取 Base64 数据
resolve(base64); // 返回 Base64 数据
};
reader.readAsDataURL(file); // 读取文件并转换为 Base64
},
function (error) {
reject("获取文件对象失败:" + error.message);
},
);
},
function (error) {
reject("解析文件路径失败:" + error.message);
},
);
});
},
// 删除照片
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
},
// 处理】数据
getFromData() {
const isValid = this.areAllObjectsValid(this.itemData.detail); //false不通过 true通过
console.log("wlhj", isValid);
const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail);
console.log("isAllOne", isAllOne);
this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem;
this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
this.itemData.statusLabel = isAllOne.statusLabel;
console.log("查看数据", this.itemData);
return this.itemData;
},
// 数据校验方法 true说明有未填项
areAllObjectsValid(details) {
// 检查是否有任何项的 inspectionResult 为空字符串
const hasEmptyResult = details.some(
(item) => item.inspectionResult === "",
);
if (hasEmptyResult) {
return false;
}
// 遍历每一项进行检查
for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (!item.conclusion || item.photos.length === 0) {
return false;
}
} else {
// 其他情况(理论上不应该存在,根据当前规则)
return false;
}
}
// 所有检查都通过
return true;
},
areAllInspectionResultsOne(details) {
let hasEmpty = false;
let allZero = true;
let hasOne = false;
for (const item of details) {
if (item.inspectionResult === "") {
hasEmpty = true;
break;
} else if (item.inspectionResult === 1) {
hasOne = true;
allZero = false;
} else if (item.inspectionResult === 0) {
// 继续检查
} else {
// 如果有其他值,可以在这里处理
allZero = false;
}
}
if (hasEmpty) {
return { statusLabel: "未巡检", status: 0 };
} else if (allZero) {
return { statusLabel: "已巡检", status: 1 };
} else if (hasOne) {
return { statusLabel: "巡检异常", status: 2 };
} else {
// 默认情况,可以根据需求调整
return { statusLabel: "未巡检", status: 0 };
}
},
setNormal() {
this.itemData.detail.forEach((item) => {
item.inspectionResult = 0;
});
},
},
};
</script>
<style scoped lang="less">
.form-item {
display: flex;
align-items: center;
padding: 9.6px 0;
line-height: 28.8px;
border-bottom: 0.8px solid #f2f3f5;
.form-label {
font-size: 11.2px;
margin-right: 25.6px;
width: 88px;
text-align: right;
color: #7c7c7c;
.required {
color: red;
margin-right: 3.2px;
}
}
.conclusion {
&.no-text {
color: #c7c7c7;
}
.have {
color: #000;
}
}
.label {
font-size: 11.2px;
}
.switch-container {
display: flex;
gap: 9.6px;
.status-btn {
flex: 1;
padding: 5.6px 19.2px;
font-size: 12.8px;
color: #000000;
background: #f2f2f2;
text-align: center;
font-weight: 400;
line-height: 17.6px;
border-radius: 14.4px;
&.active {
color: #ffffff;
background: #3774f6;
border: 0.32px solid rgba(224, 224, 224, 1);
}
}
}
.input-box {
flex: 1;
border-radius: 3.2px;
font-size: 12.8px;
line-height: 19.2px;
}
.photo-limit {
font-size: 12.8px;
color: #959595;
line-height: 19.2px;
font-weight: 400;
}
.photo-container {
display: flex;
flex-wrap: wrap;
margin-bottom: 6.4px;
.photo-item {
position: relative;
margin-right: 6.4px;
margin-bottom: 6.4px;
.photo {
width: 57.6px;
height: 57.6px;
border-radius: 3.2px;
margin-left: 9.6px;
}
.delete-photo {
position: absolute;
top: -6.4px;
right: -6.4px;
background-color: #ff4d4f;
color: #fff;
width: 12.8px;
height: 12.8px;
border-radius: 50%;
text-align: center;
line-height: 12.8px;
font-size: 9.6px;
}
}
}
.photo-btn {
background: #ffffff;
border: 0.272px solid rgba(221, 221, 221, 1);
border-radius: 1.64px;
width: 57.6px;
height: 57.6px;
font-size: 57.6px;
color: #cccccc;
text-align: center;
line-height: 51.2px;
}
}
</style>
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
<template>
<!-- 机房巡检操作 -->
<view>
<view v-for="(item, index) in itemData.detail" :key="index">
<view class="form-item">
<text class="form-label"
><text class="required">*</text>{{ item.label }}</text
>
<view class="switch-container">
<view
:class="['status-btn', { active: item.inspectionResult === 0 }]"
@click="setInspectionResult(index, 0, item.lableArr[0])"
>
{{ item.lableArr[0] }}
</view>
<view
:class="['status-btn', { active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
{{ item.lableArr[1] }}
</view>
</view>
</view>
<template v-if="item.inspectionResult === 1">
<view class="form-item">
<text class="form-label"
><text class="required">*</text>情况摘要</text
>
<text
:class="['conclusion', { 'no-text': !item.conclusion }]"
@click="showPopup(item, index)"
>
{{ item.conclusion || "请输入情况摘要" }}</text
>
</view>
<view class="form-item">
<text class="form-label"
><text class="required">*</text>现场照片</text
>
<CommonUpload v-model="item.photos" :max-count="5">
</CommonUpload> </view
></template> </view
><custom-popup
ref="customPopup"
:inspectionItem="inspectionItem"
@confirm="handlePopupConfirm"
></custom-popup>
</view>
</template>
<script>
import CommonUpload from "@/components/CommonUpload/index.vue";
import customPopup from "./customPopup.vue";
import _ from "lodash";
import mixin from "./mixin";
export default {
components: {
CommonUpload,
customPopup,
},
mixins: [mixin],
props: {
// 父组件传递的巡检状态
status: {
type: Number,
default: 0,
},
// 父组件传递的巡检事项名
inspectionItem: {
type: String,
default: "",
},
// 父组件传递的数据
defaultData: {
type: Object,
default: () => ({}),
},
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
itemData: {
isValid: false, // false是校验未通过 true是校验通过
status: 0, //0是未巡检 1是已巡检 2巡检异常
statusLabel: "未巡检",
inspectionItem: "", //巡检事项
detail: [
{
label: "平台使用",
inspectionResult: "",
inspectionResultLable: "正常",
lableArr: ["正常", "异常"],
conclusion: "",
photos: [],
},
],
},
};
},
computed: {
userInfo() {
return this.$store.state.now_user || {};
},
},
watch: {
defaultData(newVal) {
// 在这里处理数据变化
if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData;
}
},
},
async mounted() {
console.log("sdsadasd", this.itemData);
// if (Object.keys(this.defaultData).length !== 0) {
// this.itemData = this.defaultData;
// }
},
methods: {
// 拍照
takePhoto(index) {
uni.chooseImage({
count: 1,
sourceType: ["camera"], // 可以从相机拍摄
success: async (res) => {
if (this.photos.length < 5) {
const base64 = await this.convertFileToBase64(res.tempFilePaths[0]);
this.itemData.detail[index].photos.push(base64);
} else {
uni.showToast({
title: "最多只能上传5张照片",
icon: "none",
});
}
},
});
},
// 转化为base64
convertFileToBase64(filePath) {
return new Promise((resolve, reject) => {
plus.io.resolveLocalFileSystemURL(
filePath,
function (entry) {
entry.file(
function (file) {
const reader = new plus.io.FileReader();
reader.onloadend = function (evt) {
const base64 = evt.target.result; // 获取 Base64 数据
resolve(base64); // 返回 Base64 数据
};
reader.readAsDataURL(file); // 读取文件并转换为 Base64
},
function (error) {
reject("获取文件对象失败:" + error.message);
},
);
},
function (error) {
reject("解析文件路径失败:" + error.message);
},
);
});
},
// 删除照片
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
},
// 处理】数据
getFromData() {
const isValid = this.areAllObjectsValid(this.itemData.detail); //false不通过 true通过
console.log("wlhj", isValid);
const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail);
console.log("isAllOne", isAllOne);
this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem;
this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
this.itemData.statusLabel = isAllOne.statusLabel;
console.log("查看数据", this.itemData);
return this.itemData;
},
// 数据校验方法 true说明有未填项
areAllObjectsValid(details) {
// 检查是否有任何项的 inspectionResult 为空字符串
const hasEmptyResult = details.some(
(item) => item.inspectionResult === "",
);
if (hasEmptyResult) {
return false;
}
// 遍历每一项进行检查
for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (!item.conclusion || item.photos.length === 0) {
return false;
}
} else {
// 其他情况(理论上不应该存在,根据当前规则)
return false;
}
}
// 所有检查都通过
return true;
},
areAllInspectionResultsOne(details) {
let hasEmpty = false;
let allZero = true;
let hasOne = false;
for (const item of details) {
if (item.inspectionResult === "") {
hasEmpty = true;
break;
} else if (item.inspectionResult === 1) {
hasOne = true;
allZero = false;
} else if (item.inspectionResult === 0) {
// 继续检查
} else {
// 如果有其他值,可以在这里处理
allZero = false;
}
}
if (hasEmpty) {
return { statusLabel: "未巡检", status: 0 };
} else if (allZero) {
return { statusLabel: "已巡检", status: 1 };
} else if (hasOne) {
return { statusLabel: "巡检异常", status: 2 };
} else {
// 默认情况,可以根据需求调整
return { statusLabel: "未巡检", status: 0 };
}
},
setNormal() {
this.itemData.detail.forEach((item) => {
item.inspectionResult = 0;
});
},
},
};
</script>
<style scoped lang="less">
.form-item {
display: flex;
align-items: center;
padding: 9.6px 0;
line-height: 28.8px;
border-bottom: 0.8px solid #f2f3f5;
.form-label {
font-size: 11.2px;
margin-right: 25.6px;
width: 88px;
text-align: right;
color: #7c7c7c;
.required {
color: red;
margin-right: 3.2px;
}
}
.conclusion {
&.no-text {
color: #c7c7c7;
}
.have {
color: #000;
}
}
.label {
font-size: 11.2px;
}
.switch-container {
display: flex;
gap: 9.6px;
.status-btn {
flex: 1;
padding: 5.6px 19.2px;
font-size: 12.8px;
color: #000000;
background: #f2f2f2;
text-align: center;
font-weight: 400;
line-height: 17.6px;
border-radius: 14.4px;
&.active {
color: #ffffff;
background: #3774f6;
border: 0.32px solid rgba(224, 224, 224, 1);
}
}
}
.input-box {
flex: 1;
border-radius: 3.2px;
font-size: 12.8px;
line-height: 19.2px;
}
.photo-limit {
font-size: 12.8px;
color: #959595;
line-height: 19.2px;
font-weight: 400;
}
.photo-container {
display: flex;
flex-wrap: wrap;
margin-bottom: 6.4px;
.photo-item {
position: relative;
margin-right: 6.4px;
margin-bottom: 6.4px;
.photo {
width: 57.6px;
height: 57.6px;
border-radius: 3.2px;
margin-left: 9.6px;
}
.delete-photo {
position: absolute;
top: -6.4px;
right: -6.4px;
background-color: #ff4d4f;
color: #fff;
width: 12.8px;
height: 12.8px;
border-radius: 50%;
text-align: center;
line-height: 12.8px;
font-size: 9.6px;
}
}
}
.photo-btn {
background: #ffffff;
border: 0.272px solid rgba(221, 221, 221, 1);
border-radius: 1.64px;
width: 57.6px;
height: 57.6px;
font-size: 57.6px;
color: #cccccc;
text-align: center;
line-height: 51.2px;
}
}
</style>
...@@ -295,6 +295,7 @@ export default { ...@@ -295,6 +295,7 @@ export default {
isDialog: false, isDialog: false,
propList: [], propList: [],
did: "", // 最近7天数据的id did: "", // 最近7天数据的id
patrolType: "JFXJ", // 巡检类型
}; };
}, },
computed: { computed: {
...@@ -303,7 +304,7 @@ export default { ...@@ -303,7 +304,7 @@ export default {
}, },
updateDate() { updateDate() {
return moment( return moment(
Number(this.detailsInfo.updateTime || this.detailsInfo.createTime) Number(this.detailsInfo.updateTime || this.detailsInfo.createTime),
).format("YYYY-MM-DD"); ).format("YYYY-MM-DD");
}, },
abnormalLengths() { abnormalLengths() {
...@@ -358,7 +359,7 @@ export default { ...@@ -358,7 +359,7 @@ export default {
this.detailsInfo = detailsInfo; this.detailsInfo = detailsInfo;
this.inspectionNumber = detailsInfo.inspectionNumber; this.inspectionNumber = detailsInfo.inspectionNumber;
this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${ this.inspectionCode = `${this.patrolType}${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100 Math.floor(Math.random() * 900) + 100
}`; }`;
this.cardsInfo = detailsInfo.originData; this.cardsInfo = detailsInfo.originData;
...@@ -377,7 +378,7 @@ export default { ...@@ -377,7 +378,7 @@ export default {
this.detailsItem.afxt.detail.slice(0, 3); this.detailsItem.afxt.detail.slice(0, 3);
} }
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);
...@@ -451,7 +452,7 @@ export default { ...@@ -451,7 +452,7 @@ 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")}${ this.inspectionCode = `${this.patrolType}${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100 Math.floor(Math.random() * 900) + 100
}`; }`;
} }
...@@ -509,11 +510,11 @@ export default { ...@@ -509,11 +510,11 @@ export default {
) { ) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice( this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(
0, 0,
3 3,
); );
} }
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);
...@@ -598,7 +599,7 @@ export default { ...@@ -598,7 +599,7 @@ export default {
}); });
}, },
toSign() { toSign() {
if(!this.allIsSubmitOne) { if (!this.allIsSubmitOne) {
return; return;
} }
this.$refs.signDialog.open(); this.$refs.signDialog.open();
...@@ -643,12 +644,12 @@ export default { ...@@ -643,12 +644,12 @@ export default {
this.detailsInfo.signImg = signImg; // 回显到文字显示区域 this.detailsInfo.signImg = signImg; // 回显到文字显示区域
this.detailsInfo.isSubmit = 1; // 提交状态 this.detailsInfo.isSubmit = 1; // 提交状态
const isException = this.detailsInfo.originData.some( const isException = this.detailsInfo.originData.some(
(item) => item.status == 2 (item) => item.status == 2,
); );
this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常 this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常
let allIsSubmitOne = this.detailsInfo.originData.every( let allIsSubmitOne = this.detailsInfo.originData.every(
(item) => item.isSubmit === 1 (item) => item.isSubmit === 1,
); );
if (!allIsSubmitOne) { if (!allIsSubmitOne) {
...@@ -666,7 +667,7 @@ export default { ...@@ -666,7 +667,7 @@ export default {
const inspectionCode = const inspectionCode =
this.inspectionCode || this.inspectionCode ||
`JFXJ${moment().format("yyyyMMDDHHmmss")}${ `${this.patrolType}${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100 Math.floor(Math.random() * 900) + 100
}`; }`;
...@@ -677,7 +678,7 @@ export default { ...@@ -677,7 +678,7 @@ export default {
const logContent = getLogContent( const logContent = getLogContent(
LOG_TYPE_ENUM.sys, LOG_TYPE_ENUM.sys,
`巡检编号(${inspectionCode})`, `巡检编号(${inspectionCode})`,
"同步" "同步",
); );
this.$logApi.addlog(logContent); this.$logApi.addlog(logContent);
console.log("logContent", logContent); console.log("logContent", logContent);
...@@ -1097,6 +1098,4 @@ export default { ...@@ -1097,6 +1098,4 @@ export default {
border: none; border: none;
} }
} }
</style> </style>
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论