提交 69bfe973 authored 作者: JaxBBLL's avatar JaxBBLL

fix: isException

上级 959d427f
...@@ -530,6 +530,11 @@ export default { ...@@ -530,6 +530,11 @@ 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
);
this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常
console.log("isException", isException);
this.realSave(this.detailsInfo); this.realSave(this.detailsInfo);
}, },
realSave(params, type = "sign") { realSave(params, type = "sign") {
......
...@@ -363,6 +363,12 @@ export default { ...@@ -363,6 +363,12 @@ export default {
(item) => item.status === 1 || item.status === 2 (item) => item.status === 1 || item.status === 2
); );
const isException = this.detailsInfo.originData.some(
(item) => item.status == 2
);
console.log("isException", isException);
// 获取已经巡检过的数量 // 获取已经巡检过的数量
this.detailsInfo.inspectionNumber = inspectedItems.length; this.detailsInfo.inspectionNumber = inspectedItems.length;
// let { notZeroCount, equalTwoCount } = this.count( // let { notZeroCount, equalTwoCount } = this.count(
...@@ -370,6 +376,8 @@ export default { ...@@ -370,6 +376,8 @@ export default {
// ); // );
// this.detailsInfo.status = notZeroCount; //巡检总数 // this.detailsInfo.status = notZeroCount; //巡检总数
// this.detailsInfo.isException = equalTwoCount; //异常数量 // this.detailsInfo.isException = equalTwoCount; //异常数量
this.detailsInfo.isException = isException ? 1 : 0;
this.detailsInfo.submitTime = moment().format("yyyy-MM-DD"); // 记录提交时间 this.detailsInfo.submitTime = moment().format("yyyy-MM-DD"); // 记录提交时间
this.detailsInfo.submitMonth = moment().format("yyyy-MM"); // 记录提交月份 this.detailsInfo.submitMonth = moment().format("yyyy-MM"); // 记录提交月份
this.listData = this.detailsInfo.originData; this.listData = this.detailsInfo.originData;
......
...@@ -3,21 +3,21 @@ import store from "@/store"; ...@@ -3,21 +3,21 @@ import store from "@/store";
// 将现有机房巡检数据转换为SQL数据所需要格式 // 将现有机房巡检数据转换为SQL数据所需要格式
export function dataToSql(data) { export function dataToSql(data) {
let synFlag = 0; let isException = 0;
if (data.isSubmit == 0) { if (data.isSubmit == 0) {
synFlag = 0; isException = 2;
} else { } else {
synFlag = data.synchronization; isException = data.isException;
} }
const send = { const send = {
inspectionType: data.inspectionType, inspectionType: data.inspectionType,
inspectionCode: data.inspectionCode, inspectionCode: data.inspectionCode,
recordName: `${moment().format("yyyyMMDD")}-机房巡检`, recordName: `${moment().format("yyyyMMDD")}-机房巡检`,
inspectionTime: `${new Date().getTime()}`, inspectionTime: `${new Date().getTime()}`,
isException: data.isException, // 是否异常:0 否 1 是 2 巡检中 isException, // 是否异常:0 否 1 是 2.编辑
userId: store.state.now_user.userId, userId: store.state.now_user.userId,
userName: store.state.now_user.user, userName: store.state.now_user.user,
synFlag: synFlag, // 0.未同步,1.已同步,2.编辑 synFlag: data.synchronization, // 0.未同步,1.已同步
signImg: data.signImg || "", signImg: data.signImg || "",
createBy: store.state.now_user.userId, createBy: store.state.now_user.userId,
createTime: data.id ? data.createTime : `${new Date().getTime()}`, createTime: data.id ? data.createTime : `${new Date().getTime()}`,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论