提交 f0f46db5 authored 作者: 刘守彩's avatar 刘守彩

fix: bugs

上级 f1457a26
...@@ -71,8 +71,9 @@ ...@@ -71,8 +71,9 @@
<script> <script>
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin";
export default { export default {
mixins: [mixin],
components: { components: {
customPopup, customPopup,
}, },
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
type="text" type="text"
placeholder="请输入" placeholder="请输入"
maxlength="3" maxlength="3"
/>{{ item.inspectionResult === 1?item.unit:"" }} />{{ item.inspectionResult === 1 ? item.unit : "" }}
</view> </view>
<template v-if="item.inspectionResult === 1"> <template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item"> <view v-if="'conclusion' in item" class="form-item">
...@@ -79,8 +79,9 @@ ...@@ -79,8 +79,9 @@
<script> <script>
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin";
export default { export default {
mixins: [mixin],
components: { components: {
customPopup, customPopup,
}, },
......
...@@ -69,7 +69,9 @@ ...@@ -69,7 +69,9 @@
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin";
export default { export default {
mixins: [mixin],
components: { components: {
customPopup, customPopup,
}, },
......
...@@ -79,8 +79,9 @@ ...@@ -79,8 +79,9 @@
<script> <script>
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin";
export default { export default {
mixins: [mixin],
components: { components: {
customPopup, customPopup,
}, },
......
export default {
methods: {
setNormal() {
this.itemData.detail.forEach((item) => {
item.inspectionResult = 0;
});
console.log("this.isQt", this.isQt);
if (!this.isQt) {
this.itemData.status = 1;
}
},
},
};
...@@ -43,7 +43,9 @@ ...@@ -43,7 +43,9 @@
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin";
export default { export default {
mixins: [mixin],
components: { components: {
customPopup, customPopup,
}, },
...@@ -66,6 +68,7 @@ export default { ...@@ -66,6 +68,7 @@ export default {
}, },
data() { data() {
return { return {
isQt: true,
currentIndex: 0, // 当前操作的索引 currentIndex: 0, // 当前操作的索引
photos: [], photos: [],
// 父组件传递的数据 // 父组件传递的数据
......
...@@ -100,8 +100,9 @@ ...@@ -100,8 +100,9 @@
<script> <script>
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin";
export default { export default {
mixins: [mixin],
components: { components: {
customPopup, customPopup,
}, },
......
...@@ -67,11 +67,13 @@ ...@@ -67,11 +67,13 @@
<script> <script>
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin";
export default { export default {
components: { components: {
customPopup, customPopup,
}, },
mixins: [mixin],
props: { props: {
// 父组件传递的巡检状态 // 父组件传递的巡检状态
status: { status: {
...@@ -302,6 +304,11 @@ export default { ...@@ -302,6 +304,11 @@ export default {
return { statusLabel: "未巡检", status: 0 }; return { statusLabel: "未巡检", status: 0 };
} }
}, },
setNormal() {
this.itemData.detail.forEach((item) => {
item.inspectionResult = 0;
});
},
}, },
}; };
</script> </script>
......
...@@ -31,36 +31,43 @@ ...@@ -31,36 +31,43 @@
type="text" type="text"
placeholder="请输入" placeholder="请输入"
maxlength="3" maxlength="3"
/>{{ item.inspectionResult === 1?item.unit:"" }} />{{ item.inspectionResult === 1 ? item.unit : "" }}
</view> </view>
<template v-if="item.inspectionResult === 1"> <template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item"> <view v-if="'conclusion' in item" class="form-item">
<text class="form-label"><text class="required">*</text>情况摘要</text> <text class="form-label"
<text class="conclusion" @click="showPopup(index)">{{ ><text class="required">*</text>情况摘要</text
item.conclusion || "请输入情况摘要" >
}}</text> <text class="conclusion" @click="showPopup(index)">{{
</view> item.conclusion || "请输入情况摘要"
<view class="form-item" v-if="'photos' in item"> }}</text>
<text class="form-label"><text class="required">*</text>现场照片</text> </view>
<view class="photo-box"> <view class="form-item" v-if="'photos' in item">
<view class="photo-container"> <text class="form-label"
<view ><text class="required">*</text>现场照片</text
v-for="(photo, itemIndex) in item && item.photos" >
:key="itemIndex" <view class="photo-box">
class="photo-item" <view class="photo-container">
> <view
<image :src="photo" class="photo"></image> v-for="(photo, itemIndex) in item && item.photos"
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" :key="itemIndex"
>×</text class="photo-item"
> >
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view> </view>
<view @click="takePhoto(index)" class="photo-btn"> + </view> <view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
>
</view> </view>
<view class="photo-limit" </view></template
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view ></view
>
</view>
</view></template></view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
:inspectionItem="inspectionItem" :inspectionItem="inspectionItem"
...@@ -72,8 +79,9 @@ ...@@ -72,8 +79,9 @@
<script> <script>
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin";
export default { export default {
mixins: [mixin],
components: { components: {
customPopup, customPopup,
}, },
......
...@@ -68,8 +68,9 @@ ...@@ -68,8 +68,9 @@
<script> <script>
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin";
export default { export default {
mixins: [mixin],
components: { components: {
customPopup, customPopup,
}, },
......
...@@ -37,9 +37,13 @@ ...@@ -37,9 +37,13 @@
<button v-if="!isSign" class="record-button" @click="toSign"> <button v-if="!isSign" class="record-button" @click="toSign">
巡检人签字 巡检人签字
</button> </button>
<button v-if="!isSign" class="record-button" @click="toSign"> <div v-else>
重签 <image
</button> style="border: 1px solid red"
:src="detailsInfo.signImg"
></image>
<button class="record-button" @click="toSign">重签</button>
</div>
</view> </view>
</view> </view>
</view> </view>
...@@ -324,8 +328,12 @@ export default { ...@@ -324,8 +328,12 @@ export default {
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) console.log(12121);
if (this.detailsItem.afxt && this.detailsItem.afxt.detail && this.detailsItem.afxt.detail[2].inspectionResult === 1) { if (
this.detailsItem.afxt &&
this.detailsItem.afxt.detail &&
this.detailsItem.afxt.detail[2].inspectionResult === 1
) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice( this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(
0, 0,
3 3
...@@ -404,7 +412,7 @@ export default { ...@@ -404,7 +412,7 @@ 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}`, url: `/pages/inspectionContent/inspectionContentNew?value=${value}&inspectionCode=${this.inspectionCode}&jfType=${jfType}&location=${name}&uid=${this.uid}&backValue=${this.backValue}`,
}); });
...@@ -455,6 +463,7 @@ export default { ...@@ -455,6 +463,7 @@ export default {
handlePopupConfirm(summary) { handlePopupConfirm(summary) {
this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域 this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域
this.detailsInfo.signImg = summary; // 回显到文字显示区域 this.detailsInfo.signImg = summary; // 回显到文字显示区域
console.log("summary", summary);
this.submit("sign", this.detailsInfo.signImg); this.submit("sign", this.detailsInfo.signImg);
}, },
// 提交 // 提交
......
...@@ -44,11 +44,7 @@ ...@@ -44,11 +44,7 @@
</view> </view>
<view class="tab-content"> <view class="tab-content">
<view class="jfImg"> <view class="jfImg">
<image <image class="weitu" :src="imgSrc" mode=""></image
class="weitu"
:src="imgSrc"
mode=""
></image
></view> ></view>
<view class="kong"></view> <view class="kong"></view>
<!-- 操作区域 --> <!-- 操作区域 -->
...@@ -135,6 +131,7 @@ ...@@ -135,6 +131,7 @@
> >
下一项 下一项
</view> </view>
<view class="action-btn" @click="normal"> 一键正常 </view>
</view> </view>
<startDialog <startDialog
ref="startDialog" ref="startDialog"
...@@ -218,7 +215,7 @@ export default { ...@@ -218,7 +215,7 @@ export default {
value: "1", value: "1",
paramsObjFirst: {}, paramsObjFirst: {},
all_data: [], all_data: [],
imgSrc:"" imgSrc: "",
}; };
}, },
computed: { computed: {
...@@ -243,7 +240,7 @@ export default { ...@@ -243,7 +240,7 @@ export default {
this.dictValue = options.dictValue; this.dictValue = options.dictValue;
this.inspectionCode = options.inspectionCode; this.inspectionCode = options.inspectionCode;
this.backValue = options.backValue || ""; this.backValue = options.backValue || "";
this.imgSrc = `../../static/img/jf/jf${this.value}.png` this.imgSrc = `../../static/img/jf/jf${this.value}.png`;
this.tabs = this.tabs =
this.jfType === "2" || this.jfType === "3" this.jfType === "2" || this.jfType === "3"
? this.deepClone(tabsInfo2) ? this.deepClone(tabsInfo2)
...@@ -490,7 +487,9 @@ export default { ...@@ -490,7 +487,9 @@ export default {
let logContent = ""; let logContent = "";
console.log("all_data", this.all_data); console.log("all_data", this.all_data);
if (this.uid) { if (this.uid) {
const index = this.all_data.findIndex((element) => element.uid == this.uid); const index = this.all_data.findIndex(
(element) => element.uid == this.uid
);
params.uid = this.uid; params.uid = this.uid;
this.all_data[index] = params; this.all_data[index] = params;
...@@ -659,6 +658,23 @@ export default { ...@@ -659,6 +658,23 @@ export default {
const isValid = validateData(data); const isValid = validateData(data);
return isValid; return isValid;
}, },
normal() {
this.tabs.forEach((item) => {
console.log("item.value", item.value);
let refName = item.value;
// 通过 this.$refs[refName] 获取子组件实例
const childComponent = this.$refs[refName];
if (childComponent && childComponent.setNormal) {
childComponent.setNormal();
}
});
this.tabs.forEach((tab, index) => {
if (index !== this.tabs.length - 1) {
tab.status = 1;
}
});
},
// 下一项 // 下一项
nextTab() { nextTab() {
// if (!this.isCurrentTabValid()) { // if (!this.isCurrentTabValid()) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论