提交 375928c4 authored 作者: JaxBBLL's avatar JaxBBLL

fix

上级 8c0d9459
......@@ -34,8 +34,16 @@
</view>
</view>
<!-- v-if="allIsSubmitOne" -->
<view v-if="allIsSubmitOne" class="profile-right">
<button v-if="!isSign" class="record-button" @click="toSign">
<view class="profile-right">
<button
v-if="!isSign"
:disabled="!allIsSubmitOne"
class="record-button"
:class="{
'is-disabled': !allIsSubmitOne,
}"
@click="toSign"
>
巡检人签字
</button>
<div v-else style="display: flex">
......@@ -53,13 +61,15 @@
重签
</button>
</div>
<button
v-if="detailsInfo.synchronization != 1 && isSign"
class="inspection-button ml-10"
@click="onSyncData(true)"
>
数据同步
</button>
<template v-if="allIsSubmitOne">
<button
v-if="detailsInfo.synchronization != 1 && isSign"
class="inspection-button ml-10"
@click="onSyncData(true)"
>
数据同步
</button>
</template>
</view>
</view>
</view>
......@@ -803,6 +813,10 @@ export default {
color: #3774f6;
line-height: 28.8px;
font-weight: 400;
&.is-disabled {
color: #c7c7c7;
border-color: #c7c7c7;
}
}
}
}
......
......@@ -16,7 +16,13 @@
<!-- Tab 操作区域 -->
<view class="module">
<view class="location">{{ location }}</view>
<view class="action-btn complete-btn" @click="submit(1)"> 完成巡检 </view>
<view
class="action-btn"
:class="canSubmit ? 'complete-btn' : 'disable-btn'"
@click="submit(1)"
>
完成巡检
</view>
<view class="tab-buttons">
<view
v-for="(tab, index) in tabs"
......@@ -216,12 +222,17 @@ export default {
imgSrc: "",
// 我新增的
jfList: [],
did: "",
};
},
computed: {
userInfo() {
return this.$store.state.now_user || {};
},
canSubmit() {
const ret = this.allValid(this.getAllChildFormData());
return !ret;
},
// isOperationPermissions() {
// // 是否有操作权限
// const {
......@@ -253,12 +264,24 @@ export default {
if (options.uid) {
this.getDetails(options.uid);
} else if (options.did) {
this.did = options.did;
this.init();
this.paramsObjFirst = this.getAllChildFormData();
// 临时id
getHistoryData().then((detailsInfo) => {
console.log("history", detailsInfo);
if (detailsInfo) {
delete detailsInfo.id;
// 处理历史数据(选项、文案、照片;异常项-不调出文案及照片)
this.list = detailsInfo.originData[this.value - 1].details;
this.inspectionNumber = detailsInfo.inspectionNumber;
this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100
}`;
this.tabs.forEach((item) => {
if (
this.list[item.value] &&
......@@ -268,6 +291,7 @@ export default {
}
});
this.detailsInfo = detailsInfo;
uni.hideLoading();
} else {
this.init();
......@@ -366,7 +390,7 @@ export default {
getParams(isSubmit) {
console.log("this.getParams", this.uid, this.value);
console.log("originData", this.detailsInfo.originData);
if (this.uid) {
if (this.uid || this.did) {
let posItem = this.detailsInfo.originData[this.value - 1];
let paramsObj = this.getAllChildFormData(); //获取所有数据
console.log("获取数据", paramsObj);
......@@ -392,11 +416,6 @@ export default {
// 获取已经巡检过的数量
this.detailsInfo.inspectionNumber = inspectedItems.length;
// let { notZeroCount, equalTwoCount } = this.count(
// this.detailsInfo.originData
// );
// this.detailsInfo.status = notZeroCount; //巡检总数
// this.detailsInfo.isException = equalTwoCount; //异常数量
this.detailsInfo.isException = isException ? 1 : 0;
this.detailsInfo.submitTime = moment().format("yyyy-MM-DD"); // 记录提交时间
......@@ -870,6 +889,10 @@ export default {
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
color: #ffffff;
}
&.disable-btn {
background: #f2f2f2;
color: #999999;
}
}
}
.module-box {
......
......@@ -96,7 +96,6 @@ export function getHistoryData() {
if (history && history.length) {
const detailsInfo = sqlToData(history[0]);
// 处理历史数据(选项、文案、照片;异常项-不调出文案及照片)
console.log(JSON.stringify(detailsInfo));
setHistoryData(detailsInfo);
resolve(detailsInfo);
} else {
......@@ -106,8 +105,9 @@ export function getHistoryData() {
});
}
function setHistoryData(list) {
list.originData.forEach((item) => {
function setHistoryData(data) {
data.signImg = "";
data.originData.forEach((item) => {
// 如果该机房有异常项,则不调出文案及照片
if (item.status == 2) {
// 外面的异常标识
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论