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

fix

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