提交 1d1d0032 authored 作者: caodi\cd's avatar caodi\cd

fix:同步

上级 059f084e
差异被折叠。
......@@ -478,7 +478,7 @@ export default {
});
// 清空基础缓存信息
this.$store.commit("SET_TEMP_DATA", {}); // 缓存[巡检信息]
// this.$store.commit("SET_TEMP_DATA", {}); // 缓存[巡检信息]
uni.showToast({
title: isSubmit ? "提交成功" : "保存草稿成功",
icon: "success",
......
......@@ -35,10 +35,10 @@
>
</view>
</view>
<view class="profile-right">
<!-- <button class="record-button" @click="toListingManagement">
巡检人签字
</button> -->
<view v-if="isSubmit" class="profile-right">
<button v-if="!isSign" class="record-button" @click="toSign">
巡检人签字
</button>
</view>
</view>
</view>
......@@ -101,15 +101,25 @@
</view>
</view>
</view>
<signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog>
</view>
</template>
<script>
import moment from "moment";
import { pad_2_1_inspection_position, pad_2_1_floor } from "@/utils/dict.js";
import {
writeInspectionData,
addLog,
getLogContent,
LOG_TYPE_ENUM,
} from "@/utils/IoReadingAndWriting.js";
import { getInspectionDetails } from "@/request/index.js";
import signDialog from "@/components/signDialog.vue";
export default {
components: {
signDialog,
},
data() {
return {
tabs: ["所有井道"], // 选项卡内容
......@@ -135,6 +145,8 @@ export default {
},
detailsInfo: {}, // 详情
isDisable: false, // 禁用
isSign: false, //签名状态
isSubmit: 0, //提交状态
uid: "",
options: {}, //存储数据
};
......@@ -221,6 +233,8 @@ export default {
this.inspectionNumber = detailsInfo.inspectionNumber;
this.inspectionCode = detailsInfo.inspectionCode;
this.cardsInfo = this.tabList = detailsInfo.originData;
this.isSubmit = this.detailsInfo.isSubmit;
this.isSign = this.detailsInfo.isSign;
console.log("this.cardsInfo", this.cardsInfo);
this.cardsInfo.forEach((item) => {
this.tabs.push(item.name);
......@@ -246,13 +260,54 @@ export default {
deleteClick() {
this.$refs.inputDialog2.open();
},
toSign() {
this.$refs.signDialog.open();
},
// tab选中change 时间
changeTab(index, item) {
this.draft(this.activeTabIndex, false, false).then(() => {
this.activeTabIndex = index;
});
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域
this.detailsInfo.signImg = summary; // 回显到文字显示区域
this.submit("sign", this.detailsInfo.signImg);
},
// 提交
submit(type = "sign", value = "") {
const all_data = this.$store.state.all_data; //获取全部数据
let params = this.detailsInfo;
params.signImg = value;
console.log("all_data", all_data);
console.log("all_data", all_data);
const index = all_data.findIndex((element) => element.uid == this.uid);
all_data[index] = params;
const logContent = getLogContent(LOG_TYPE_ENUM.sys, "数据同步", "同步");
// 更新巡检list
console.log("all_data存储", all_data);
this.$store.commit("SET_ALL_DATA", all_data);
const inspectList = all_data.filter(
(item) => item.createByName == userInfo.user
);
writeInspectionData(inspectList, userInfo.user);
// 更新日志
const log_list = this.$store.state.log_list;
logContent.inspectionType = params.inspectionType;
log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list).then((res) => {
console.log("日志文件写入成功");
});
uni.showToast({
title: type == "sign" ? "签字成功" : "同步成功",
icon: "success",
});
},
lookTable() {
uni.navigateTo({
url: "/pages/report/sampleTable?isJF=0",
......
......@@ -250,7 +250,8 @@ export default {
inspectionNumber: 0, //巡检数量
floor: this.floor, // 楼层
isSubmit: "", // 0 是草稿态; 1 是正式提交
isSign: "", // 是否签字
isSign: false, // 是否签字
signImg:"",// 签字图片地址
conclusion: "", //摘要
creatTime: `${new Date().getTime()}`,
items: [],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论