提交 0b54e7bf authored 作者: caodi\cd's avatar caodi\cd

fix:打包

上级 de073eec
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</view> </view>
</view> </view>
<view class="img"> <view class="img">
<image v-if="details.synchronization == 1" class="bg-img" src="../../static/img/add-img/default.png"></image> <!-- <image v-if="details.synchronization == 1" class="bg-img" src="../../static/img/add-img/default.png"></image> -->
<!-- <image v-else class="bg-img" src="../../static/img/add-img/active.png"></image> --> <!-- <image v-else class="bg-img" src="../../static/img/add-img/active.png"></image> -->
</view> </view>
</view> </view>
......
...@@ -112,14 +112,26 @@ export default { ...@@ -112,14 +112,26 @@ export default {
// 生成签字图片 // 生成签字图片
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
canvasId: "signatureCanvas", canvasId: "signatureCanvas",
success: (res) => { success: async (res) => {
const tempFilePath = res.tempFilePath; const tempFilePath = res.tempFilePath;
// 存储照片到本地
uni.saveImageToPhotosAlbum({
filePath: tempFilePath,
success: function () {
console.log("图片已成功保存到相册");
},
fail: function (err) {
console.error("保存图片到相册失败:", err);
},
});
const base64 = await this.convertFileToBase64(tempFilePath);
// console.log("base64",base64)
// 这里可以将 tempFilePath 上传到服务器或进行其他处理 // 这里可以将 tempFilePath 上传到服务器或进行其他处理
uni.showToast({ uni.showToast({
title: "签字已保存", title: "签字已保存",
icon: "success", icon: "success",
}); });
this.$emit("confirm", tempFilePath); this.$emit("confirm", base64);
this.close(); this.close();
}, },
fail: (err) => { fail: (err) => {
...@@ -127,6 +139,32 @@ export default { ...@@ -127,6 +139,32 @@ export default {
}, },
}); });
}, },
// 转化为base64
convertFileToBase64(filePath) {
return new Promise((resolve, reject) => {
plus.io.resolveLocalFileSystemURL(
filePath,
function (entry) {
entry.file(
function (file) {
const reader = new plus.io.FileReader();
reader.onloadend = function (evt) {
const base64 = evt.target.result; // 获取 Base64 数据
resolve(base64); // 返回 Base64 数据
};
reader.readAsDataURL(file); // 读取文件并转换为 Base64
},
function (error) {
reject("获取文件对象失败:" + error.message);
}
);
},
function (error) {
reject("解析文件路径失败:" + error.message);
}
);
});
},
open() { open() {
this.isOpen = true; this.isOpen = true;
}, },
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
// 父组件传递的数据 // 父组件传递的数据
defaultData: { defaultData: {
type: Object, type: Object,
default: {}, default: () => ({}),
}, },
}, },
data() { data() {
...@@ -156,10 +156,13 @@ export default { ...@@ -156,10 +156,13 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
mounted() { watch: {
if (Object.keys(this.defaultData).length !== 0) { defaultData(newVal) {
this.itemData = this.defaultData; // 在这里处理数据变化
} if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData;
}
},
}, },
methods: { methods: {
// 拍照 // 拍照
...@@ -228,7 +231,7 @@ export default { ...@@ -228,7 +231,7 @@ export default {
// 处理】数据 // 处理】数据
getFromData() { getFromData() {
console.log(111, this.itemData); console.log(111, this.itemData);
const isValid = this.areAllObjectsValid(this.itemData.detail,2); //false不通过 true通过 const isValid = this.areAllObjectsValid(this.itemData.detail, 2); //false不通过 true通过
// const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail); // const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail);
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
......
...@@ -95,7 +95,7 @@ export default { ...@@ -95,7 +95,7 @@ export default {
// 父组件传递的数据 // 父组件传递的数据
defaultData: { defaultData: {
type: Object, type: Object,
default: {}, default: () => ({}),
}, },
}, },
data() { data() {
...@@ -153,10 +153,13 @@ export default { ...@@ -153,10 +153,13 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
mounted() { watch: {
defaultData(newVal) {
// 在这里处理数据变化
if (Object.keys(this.defaultData).length !== 0) { if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData; this.itemData = this.defaultData;
} }
}
}, },
methods: { methods: {
// 拍照 // 拍照
......
...@@ -77,9 +77,16 @@ export default { ...@@ -77,9 +77,16 @@ export default {
default: "", default: "",
}, },
// 父组件传递的数据 // 父组件传递的数据
itemData: { defaultData: {
type: Object, type: Object,
default: () => ({ default: () => ({}),
},
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
itemData: {
isValid: false, // false是校验未通过 true是校验通过 isValid: false, // false是校验未通过 true是校验通过
// status: 0, 0是未巡检 1是已巡检 2巡检异常 statusLabel: "未巡检", // status: 0, 0是未巡检 1是已巡检 2巡检异常 statusLabel: "未巡检",
inspectionItem: "", //巡检事项 inspectionItem: "", //巡检事项
...@@ -109,13 +116,7 @@ export default { ...@@ -109,13 +116,7 @@ export default {
photos: [], photos: [],
}, },
], ],
}), },
},
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
}; };
}, },
computed: { computed: {
...@@ -123,7 +124,14 @@ export default { ...@@ -123,7 +124,14 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
mounted() {}, watch: {
defaultData(newVal) {
// 在这里处理数据变化
if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData;
}
},
},
methods: { methods: {
// 拍照 // 拍照
takePhoto(index) { takePhoto(index) {
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
// 父组件传递的数据 // 父组件传递的数据
defaultData: { defaultData: {
type: Object, type: Object,
default: {}, default: () => ({}),
}, },
}, },
data() { data() {
...@@ -134,10 +134,13 @@ export default { ...@@ -134,10 +134,13 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
mounted() { watch: {
defaultData(newVal) {
// 在这里处理数据变化
if (Object.keys(this.defaultData).length !== 0) { if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData; this.itemData = this.defaultData;
} }
}
}, },
methods: { methods: {
// 拍照 // 拍照
......
...@@ -58,9 +58,17 @@ export default { ...@@ -58,9 +58,17 @@ export default {
default: "", default: "",
}, },
// 父组件传递的数据 // 父组件传递的数据
itemData: { defaultData: {
type: Object, type: Object,
default: () => ({ default: () => ({}),
},
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
// 父组件传递的数据
itemData: {
isValid: true, // true是不校验 isValid: true, // true是不校验
// status: 0, 0是未巡检 1是已巡检 2巡检异常 statusLabel: "未巡检", // status: 0, 0是未巡检 1是已巡检 2巡检异常 statusLabel: "未巡检",
inspectionItem: "", //巡检事项 inspectionItem: "", //巡检事项
...@@ -74,13 +82,7 @@ export default { ...@@ -74,13 +82,7 @@ export default {
photos: [], photos: [],
}, },
], ],
}),
}, },
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
}; };
}, },
computed: { computed: {
...@@ -88,6 +90,14 @@ export default { ...@@ -88,6 +90,14 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
watch: {
defaultData(newVal) {
// 在这里处理数据变化
if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData;
}
}
},
mounted() {}, mounted() {},
methods: { methods: {
// 拍照 // 拍照
......
...@@ -43,7 +43,9 @@ ...@@ -43,7 +43,9 @@
type="number" type="number"
placeholder="请输入" placeholder="请输入"
maxlength="2" maxlength="2"
/> <text class="fg"></text><input />
<text class="fg"></text
><input
class="input" class="input"
v-model="item.UpositonE" v-model="item.UpositonE"
type="number" type="number"
...@@ -115,7 +117,7 @@ export default { ...@@ -115,7 +117,7 @@ export default {
// 父组件传递的数据 // 父组件传递的数据
defaultData: { defaultData: {
type: Object, type: Object,
default: {}, default: () => ({}),
}, },
}, },
data() { data() {
...@@ -149,10 +151,13 @@ export default { ...@@ -149,10 +151,13 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
mounted() { watch: {
if (Object.keys(this.defaultData).length !== 0) { defaultData(newVal) {
this.itemData = this.defaultData; // 在这里处理数据变化
} if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData;
}
},
}, },
methods: { methods: {
// 拍照 // 拍照
......
...@@ -77,9 +77,16 @@ export default { ...@@ -77,9 +77,16 @@ export default {
default: "", default: "",
}, },
// 父组件传递的数据 // 父组件传递的数据
itemData: { defaultData: {
type: Object, type: Object,
default: () => ({ default: () => ({}),
},
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
itemData: {
isValid: false, // false是校验未通过 true是校验通过 isValid: false, // false是校验未通过 true是校验通过
// status: 0, 0是未巡检 1是已巡检 2巡检异常 statusLabel: "未巡检", // status: 0, 0是未巡检 1是已巡检 2巡检异常 statusLabel: "未巡检",
inspectionItem: "", //巡检事项 inspectionItem: "", //巡检事项
...@@ -115,13 +122,7 @@ export default { ...@@ -115,13 +122,7 @@ export default {
photos: [], photos: [],
}, },
], ],
}), },
},
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
}; };
}, },
computed: { computed: {
...@@ -129,7 +130,20 @@ export default { ...@@ -129,7 +130,20 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
mounted() {}, watch: {
defaultData(newVal) {
// 在这里处理数据变化
if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData;
}
}
},
async mounted() {
console.log("sdsadasd", this.itemData);
// if (Object.keys(this.defaultData).length !== 0) {
// this.itemData = this.defaultData;
// }
},
methods: { methods: {
// 拍照 // 拍照
takePhoto(index) { takePhoto(index) {
...@@ -207,7 +221,7 @@ export default { ...@@ -207,7 +221,7 @@ export default {
// this.itemData.status = 2; //1表示已经巡检过有异常 // this.itemData.status = 2; //1表示已经巡检过有异常
// this.itemData.statusLabel = "巡检异常"; // this.itemData.statusLabel = "巡检异常";
// } // }
// console.log(this.itemData); console.log("查看数据", this.itemData);
return this.itemData; return this.itemData;
}, },
// 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
// 父组件传递的数据 // 父组件传递的数据
defaultData: { defaultData: {
type: Object, type: Object,
default: {}, default: () => ({}),
}, },
}, },
data() { data() {
...@@ -138,10 +138,13 @@ export default { ...@@ -138,10 +138,13 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
mounted() { watch: {
defaultData(newVal) {
// 在这里处理数据变化
if (Object.keys(this.defaultData).length !== 0) { if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData; this.itemData = this.defaultData;
} }
}
}, },
methods: { methods: {
// 拍照 // 拍照
......
...@@ -77,9 +77,16 @@ export default { ...@@ -77,9 +77,16 @@ export default {
default: "", default: "",
}, },
// 父组件传递的数据 // 父组件传递的数据
itemData: { defaultData: {
type: Object, type: Object,
default: () => ({ default: () => ({}),
},
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
itemData: {
isValid: false, // false是校验未通过 true是校验通过 isValid: false, // false是校验未通过 true是校验通过
// status: 0, 0是未巡检 1是已巡检 2巡检异常 statusLabel: "未巡检", // status: 0, 0是未巡检 1是已巡检 2巡检异常 statusLabel: "未巡检",
inspectionItem: "", //巡检事项 inspectionItem: "", //巡检事项
...@@ -109,13 +116,7 @@ export default { ...@@ -109,13 +116,7 @@ export default {
photos: [], photos: [],
}, },
], ],
}), },
},
},
data() {
return {
currentIndex: 0, // 当前操作的索引
photos: [],
}; };
}, },
computed: { computed: {
...@@ -123,6 +124,14 @@ export default { ...@@ -123,6 +124,14 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
watch: {
defaultData(newVal) {
// 在这里处理数据变化
if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData;
}
}
},
mounted() {}, mounted() {},
methods: { methods: {
// 拍照 // 拍照
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
> >
</view> </view>
</view> </view>
<view v-if="isSubmit" class="profile-right"> <view v-if="inspectionNumber >1" class="profile-right">
<button v-if="!isSign" class="record-button" @click="toSign"> <button v-if="!isSign" class="record-button" @click="toSign">
巡检人签字 巡检人签字
</button> </button>
...@@ -91,13 +91,18 @@ ...@@ -91,13 +91,18 @@
</view> </view>
</view></view </view></view
> >
<signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog>
</view> </view>
</template> </template>
<script> <script>
import moment from "moment"; import moment from "moment";
import { pad_all_inspection_position } from "@/utils/dict.js"; import { pad_all_inspection_position } from "@/utils/dict.js";
import { getInspectionDetails } from "@/request/index.js"; import { getInspectionDetails } from "@/request/index.js";
import signDialog from "@/components/signDialog.vue";
export default { export default {
components: {
signDialog,
},
data() { data() {
return { return {
inspectionCode: "", inspectionCode: "",
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
v-show="checkValueInArray(tabs, 'wlhj', activeTab)" v-show="checkValueInArray(tabs, 'wlhj', activeTab)"
ref="wlhj" ref="wlhj"
:inspectionItem="tabs[activeTab].label" :inspectionItem="tabs[activeTab].label"
:defaultData="list.wlhj || {}" :defaultData="list.wlhj"
></wlhj> ></wlhj>
<!-- 安防系统 --> <!-- 安防系统 -->
<afxt <afxt
...@@ -268,14 +268,9 @@ export default { ...@@ -268,14 +268,9 @@ export default {
.then((res) => { .then((res) => {
const detailsInfo = res; const detailsInfo = res;
console.log("getDetails", res); console.log("getDetails", res);
let list = detailsInfo.originData[this.value - 1].details; this.list = detailsInfo.originData[this.value - 1].details;
console.log("list", list); console.log("list", this.list);
// 未巡检需要处理默认数据结构
if (list && list.length) {
this.list = list;
}
// this.inspectionResult = list[0].inspectionResult; // this.inspectionResult = list[0].inspectionResult;
console.log("let list", list);
this.detailsInfo = detailsInfo; this.detailsInfo = detailsInfo;
console.log("detailsInfo", detailsInfo); console.log("detailsInfo", detailsInfo);
...@@ -305,6 +300,7 @@ export default { ...@@ -305,6 +300,7 @@ export default {
if (this.uid) { if (this.uid) {
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)
posItem.details = paramsObj; posItem.details = paramsObj;
posItem.isSubmit = isSubmit; posItem.isSubmit = isSubmit;
if (!this.checkInspectionResult(paramsObj)) { if (!this.checkInspectionResult(paramsObj)) {
...@@ -314,10 +310,17 @@ export default { ...@@ -314,10 +310,17 @@ export default {
posItem.status = 2; //1表示已经巡检过有异常 posItem.status = 2; //1表示已经巡检过有异常
posItem.statusLable = "巡检异常"; posItem.statusLable = "巡检异常";
} }
// 使用 filter 方法筛选出 status 为 1 或 2 的对象
const inspectedItems = this.detailsInfo.originData.filter(
(item) => item.status === 1 || item.status === 2
);
// 获取已经巡检过的数量
this.detailsInfo.inspectionNumber = inspectedItems.length;
// let { notZeroCount, equalTwoCount } = this.count( // let { notZeroCount, equalTwoCount } = this.count(
// this.detailsInfo.originData // this.detailsInfo.originData
// ); // );
// this.detailsInfo.inspectionNumber = notZeroCount; //巡检总数 // this.detailsInfo.status = notZeroCount; //巡检总数
// this.detailsInfo.isException = equalTwoCount; //异常数量 // this.detailsInfo.isException = equalTwoCount; //异常数量
console.log("this.detailsInfo", this.detailsInfo); console.log("this.detailsInfo", this.detailsInfo);
this.detailsInfo.submitTime = moment().format("yyyy-MM-DD"); // 记录提交时间 this.detailsInfo.submitTime = moment().format("yyyy-MM-DD"); // 记录提交时间
...@@ -339,7 +342,7 @@ export default { ...@@ -339,7 +342,7 @@ export default {
}; };
}); });
let tabList = JSON.parse(JSON.stringify(dataObj)); let tabList = JSON.parse(JSON.stringify(dataObj));
let posItem = tabList[this.value]; let posItem = tabList[this.value-1];
posItem.details = paramsObj; posItem.details = paramsObj;
if (!this.checkInspectionResult(paramsObj)) { if (!this.checkInspectionResult(paramsObj)) {
posItem.status = 1; //1表示已经巡检过没有异常 posItem.status = 1; //1表示已经巡检过没有异常
...@@ -421,6 +424,7 @@ export default { ...@@ -421,6 +424,7 @@ export default {
return false; return false;
} }
const params = this.getParams(isSubmit); //数据获取 const params = this.getParams(isSubmit); //数据获取
console.log("提交时获取一次",params)
const all_data = this.$store.state.all_data; //获取全部数据 const all_data = this.$store.state.all_data; //获取全部数据
let logContent = ""; let logContent = "";
console.log("all_data", all_data); console.log("all_data", all_data);
......
...@@ -77,31 +77,43 @@ export default { ...@@ -77,31 +77,43 @@ export default {
}; };
}, },
mounted() {
const temp = [];
this.list.forEach((item) => {
temp.push(...(item.list || []));
});
this.notSynchronizationList = temp.filter(
(item) => item.synchronization == 0
);
getAllInspections().then((res) => {
this.allList = res;
});
},
watch: { watch: {
list(newData) { list(newVal) {
console.log("newVal",newVal);
this.init()
},
},
// async mounted() {
// const temp = [];
// this.list.forEach((item) => {
// temp.push(...(item.list || []));
// });
// console.log("this.list", this.list);
// console.log("temp", temp);
// this.notSynchronizationList = temp.filter(
// (item) => item.synchronization == 0 && item.isSign === true
// );
// getAllInspections().then((res) => {
// this.allList = res;
// });
// },
methods: {
init() {
const temp = []; const temp = [];
newData.forEach((item) => { this.list.forEach((item) => {
temp.push(...(item.list || [])); temp.push(...(item.list || []));
}); });
console.log("this.list", this.list);
console.log("temp", temp);
this.notSynchronizationList = temp.filter( this.notSynchronizationList = temp.filter(
(item) => item.synchronization == 0 (item) => item.synchronization == 0 && item.isSign === true
); );
getAllInspections().then((res) => {
this.allList = res;
});
}, },
},
methods: {
close() { close() {
this.$emit("close"); this.$emit("close");
}, },
...@@ -113,18 +125,16 @@ export default { ...@@ -113,18 +125,16 @@ export default {
* 读取上一次打包的文件, 复制到 [ history ] 文件夹中 * 读取上一次打包的文件, 复制到 [ history ] 文件夹中
*/ */
clickHandle() { clickHandle() {
if(this.loading) return; if (this.loading) return;
const directoryPath = `${SYNCHRONIZE_DATA_PAD}/发送数据`; const directoryPath = `${SYNCHRONIZE_DATA_PAD}/发送数据`;
const targetDirectoryPath = `${SYNCHRONIZE_DATA_PAD}/history`; const targetDirectoryPath = `${SYNCHRONIZE_DATA_PAD}/history`;
checkAndCreateDirectory(directoryPath).then(() => { checkAndCreateDirectory(directoryPath).then(() => {
copyDirectory(directoryPath, targetDirectoryPath) copyDirectory(directoryPath, targetDirectoryPath)
.then(() => { .then(() => {
return deleteAllFilesInDirectory(directoryPath); return deleteAllFilesInDirectory(directoryPath);
}) })
.then(() => { .then(() => {
this.coverData(); this.coverData();
}) })
.catch((error) => { .catch((error) => {
...@@ -141,25 +151,26 @@ export default { ...@@ -141,25 +151,26 @@ export default {
const userName = this.$store.state.now_user.user; const userName = this.$store.state.now_user.user;
const notSynchronizationList = this.notSynchronizationList; const notSynchronizationList = this.notSynchronizationList;
const allList = this.allList; const allList = this.allList;
console.log("窗口allList", allList);
console.log(
"窗口this.notSynchronizationList",
this.notSynchronizationList
);
let timeStr = moment().format("yyyy_MM_DD_hh_mm_ss"); let timeStr = moment().format("yyyy_MM_DD_hh_mm_ss");
const JFXJ_DATA = notSynchronizationList const JFXJ_DATA = notSynchronizationList
.filter((item) => item.inspectionType == 1) .filter((item) => item.inspectionType == 1)
.map((item) => { .map((item) => {
return { return item;
...item,
originData: [],
};
}); // 机房数据类型是 1 }); // 机房数据类型是 1
const JDXJ_DATA = notSynchronizationList const JDXJ_DATA = notSynchronizationList
.filter((item) => item.inspectionType == 2) .filter((item) => item.inspectionType == 2)
.map((item) => { .map((item) => {
return item[item.inspectionCode]; return item;
}); // 井道数据类型是 2 }); // 井道数据类型是 2
console.log(5151, JFXJ_DATA, JDXJ_DATA);
this.loading = true; this.loading = true;
const tmepList = []; const tmepList = [];
...@@ -174,6 +185,8 @@ export default { ...@@ -174,6 +185,8 @@ export default {
tmepList.push(this.packedData(item, JDXJ_DATA_FILE_NAME)); tmepList.push(this.packedData(item, JDXJ_DATA_FILE_NAME));
}); });
console.log("同步窗口");
console.log("同步窗口", tmepList);
Promise.all(tmepList) Promise.all(tmepList)
.then(() => { .then(() => {
// 更新巡检数据状态 // 更新巡检数据状态
...@@ -223,8 +236,7 @@ export default { ...@@ -223,8 +236,7 @@ export default {
const log_list = this.$store.state.log_list; const log_list = this.$store.state.log_list;
log_list.push(logContent); log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list); this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list).then((res) => { addLog(log_list).then((res) => {});
});
// 更新同步时间 // 更新同步时间
this.updateSysTime(); this.updateSysTime();
...@@ -290,12 +302,13 @@ export default { ...@@ -290,12 +302,13 @@ export default {
console.log("APP.vue 存储数据失败", error); console.log("APP.vue 存储数据失败", error);
}, },
}); });
createFileWithPlusIO(SYNCHRONIZE_DATA_PAD, USER_FILE_NAME, fileContent).then(() => { createFileWithPlusIO(SYNCHRONIZE_DATA_PAD, USER_FILE_NAME, fileContent)
console.log("---用户数据更新成功") .then(() => {
}).catch(error => { console.log("---用户数据更新成功");
console.log("---用户数据更新失败", error) })
.catch((error) => {
}) console.log("---用户数据更新失败", error);
});
}); });
}, },
}, },
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
><!-- 打包弹窗 --> ><!-- 打包弹窗 -->
<Dialog <Dialog
v-show="isDialog && list.length" v-show="isDialog && list.length"
:list="list" :listArr="list"
@close="openDialog(false)" @close="openDialog(false)"
></Dialog> ></Dialog>
</view> </view>
...@@ -168,7 +168,6 @@ export default { ...@@ -168,7 +168,6 @@ export default {
} }
}); });
const keys = Object.keys(tempAllData); const keys = Object.keys(tempAllData);
// 第二步: 根据搜索条件过滤 // 第二步: 根据搜索条件过滤
const list = keys.map((key) => { const list = keys.map((key) => {
return { return {
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
> >
</view> </view>
</view> </view>
<!-- {{ isSubmit }} {{ isSign }} -->
<view v-if="isSubmit" class="profile-right"> <view v-if="isSubmit" class="profile-right">
<button v-if="!isSign" class="record-button" @click="toSign"> <button v-if="!isSign" class="record-button" @click="toSign">
巡检人签字 巡检人签字
...@@ -283,13 +284,13 @@ export default { ...@@ -283,13 +284,13 @@ export default {
let params = this.detailsInfo; let params = this.detailsInfo;
params.signImg = value; params.signImg = value;
console.log("all_data", all_data); console.log("all_data", all_data);
console.log("all_data", all_data);
const index = all_data.findIndex((element) => element.uid == this.uid); const index = all_data.findIndex((element) => element.uid == this.uid);
console.log("签字获取数据",params)
all_data[index] = params; all_data[index] = params;
const logContent = getLogContent(LOG_TYPE_ENUM.sys, "数据同步", "同步"); const logContent = getLogContent(LOG_TYPE_ENUM.sign, "签字", "机房巡检");
// 更新巡检list // 更新巡检list
console.log("all_data存储", all_data); console.log("all_data存储", all_data);
console.log("all_data一个", all_data[index]);
this.$store.commit("SET_ALL_DATA", all_data); this.$store.commit("SET_ALL_DATA", all_data);
const inspectList = all_data.filter( const inspectList = all_data.filter(
(item) => item.createByName == userInfo.user (item) => item.createByName == userInfo.user
......
...@@ -533,7 +533,7 @@ export default { ...@@ -533,7 +533,7 @@ export default {
}); });
// 清空基础缓存信息 // 清空基础缓存信息
this.$store.commit("SET_TEMP_DATA", {}); // 缓存[巡检信息] // this.$store.commit("SET_TEMP_DATA", {}); // 缓存[巡检信息]
uni.showToast({ uni.showToast({
title: isSubmit ? "提交成功" : "保存草稿成功", title: isSubmit ? "提交成功" : "保存草稿成功",
icon: "success", icon: "success",
......
...@@ -25,6 +25,7 @@ export const LOG_TYPE_ENUM = { ...@@ -25,6 +25,7 @@ export const LOG_TYPE_ENUM = {
add: "新增成功", add: "新增成功",
photo: "拍照", photo: "拍照",
edit: "编辑成功", edit: "编辑成功",
sign: "签字",
darf: "草稿", darf: "草稿",
delete: "删除", delete: "删除",
sys: "同步", sys: "同步",
......
...@@ -120,6 +120,7 @@ export function checkAndCreateDirectory(directoryPath) { ...@@ -120,6 +120,7 @@ export function checkAndCreateDirectory(directoryPath) {
); );
resolve(dirEntry); resolve(dirEntry);
return
}, },
function (error) { function (error) {
// 目录不存在,创建目录 // 目录不存在,创建目录
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论