From 869c0a6cda2bd4494f671240865d9f20b6aad0a6 Mon Sep 17 00:00:00 2001 From: WenShiJun Date: Wed, 6 Mar 2024 16:11:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E4=BE=8B=E4=BC=9A=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=BC=80=E5=8F=91->=E5=8F=82=E4=BC=9A=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E4=B8=8A=E4=BC=A0=E8=AF=81=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 123 +++------ pages/application/safetymeeting/home.vue | 6 +- .../safetymeeting/safetymeeting-detail.vue | 238 +++++++++++------- 3 files changed, 193 insertions(+), 174 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa06cd1..4263587 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,162 +1,117 @@ { - "name": "UniApp_integrated_whb", - "lockfileVersion": 3, "requires": true, - "packages": { - "": { - "dependencies": { - "@dcloudio/uni-ui": "^1.5.0", - "moment": "^2.29.4", - "vue-aliplayer": "^1.0.0" - }, - "devDependencies": { - "@types/html5plus": "^1.0.2", - "@types/uni-app": "^1.4.4" - } + "lockfileVersion": 1, + "dependencies": { + "@babel/parser": { + "version": "7.24.0", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.24.0.tgz", + "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", + "dev": true }, - "node_modules/@babel/parser": { - "version": "7.23.6", - "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.23.6.tgz", - "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } + "@dcloudio/uni-ui": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.2.tgz", + "integrity": "sha512-/MO31TELyHcKt3nS5bo1t8lQmLSnP9EKlHcShjqM27gL0QeYtoc9UekOITRbA9zi8rnlII3Aw91DHtny3IodFg==" }, - "node_modules/@dcloudio/uni-ui": { - "version": "1.5.0", - "resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.0.tgz", - "integrity": "sha512-E7D37VbRZeh1E2yzrIie8psBckIrErdkUbUA751rlG8zdioGovW3zOuUsKgY+Gh7csMvi6XMEoSacvboe8o4Gw==" - }, - "node_modules/@types/html5plus": { + "@types/html5plus": { "version": "1.0.5", "resolved": "https://registry.npmmirror.com/@types/html5plus/-/html5plus-1.0.5.tgz", "integrity": "sha512-qt5z+3WYkARL/rWnJRcB2fCDOZLKa/hEOkse9sjA6FFkXZtKb+OPxKqo8bDgix4+ufahOff0adarVfaUaK1mfw==", "dev": true }, - "node_modules/@types/uni-app": { + "@types/uni-app": { "version": "1.4.8", "resolved": "https://registry.npmmirror.com/@types/uni-app/-/uni-app-1.4.8.tgz", "integrity": "sha512-plxwi9MvGDrekCsDKuNlCN3ZXIv9zkqHsKZJOsc8FQqLSHveDBOm11qOaswe4QyNWVHpvwZMViii/Ni1/d40LA==", "dev": true, - "dependencies": { + "requires": { "vue": "^2.6.8" } }, - "node_modules/@vue/compiler-sfc": { + "@vue/compiler-sfc": { "version": "2.7.16", "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz", "integrity": "sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg==", "dev": true, - "dependencies": { + "requires": { "@babel/parser": "^7.23.5", "postcss": "^8.4.14", + "prettier": "^1.18.2 || ^2.0.0", "source-map": "^0.6.1" - }, - "optionalDependencies": { - "prettier": "^1.18.2 || ^2.0.0" } }, - "node_modules/csstype": { + "csstype": { "version": "3.1.3", "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "dev": true }, - "node_modules/moment": { + "moment": { "version": "2.30.1", "resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz", - "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", - "engines": { - "node": "*" - } + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==" }, - "node_modules/nanoid": { + "nanoid": { "version": "3.3.7", "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz", "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } + "dev": true }, - "node_modules/picocolors": { + "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, - "node_modules/postcss": { - "version": "8.4.33", - "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.33.tgz", - "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", + "postcss": { + "version": "8.4.35", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", "dev": true, - "dependencies": { + "requires": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" } }, - "node_modules/prettier": { + "prettier": { "version": "2.8.8", "resolved": "https://registry.npmmirror.com/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, - "optional": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - } + "optional": true }, - "node_modules/source-map": { + "source-map": { "version": "0.6.1", "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "dev": true }, - "node_modules/source-map-js": { + "source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "dev": true }, - "node_modules/vue": { + "vue": { "version": "2.7.16", "resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.16.tgz", "integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==", - "deprecated": "Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.", "dev": true, - "dependencies": { + "requires": { "@vue/compiler-sfc": "2.7.16", "csstype": "^3.1.0" } }, - "node_modules/vue-aliplayer": { + "vue-aliplayer": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/vue-aliplayer/-/vue-aliplayer-1.0.0.tgz", "integrity": "sha512-z29s38hlNJDckGSPtuTsYwMdjj70SsvJ5VzbEoBoV2BTrg3ucvodM2CW7BWstrG9WaQqz4F8nVGLSON05RrmJw==", - "dependencies": { + "requires": { "vue-github-badge": "^1.0.0" } }, - "node_modules/vue-github-badge": { + "vue-github-badge": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/vue-github-badge/-/vue-github-badge-1.0.1.tgz", "integrity": "sha512-8X+FUWapnnDfs6cRUg3mCfHUf2r5arUfCSRdvbIn860oj9us3Rz3VOtioUgmfzh6EhaaYTs0Oh78EzJ+Z6uqAA==" diff --git a/pages/application/safetymeeting/home.vue b/pages/application/safetymeeting/home.vue index 9f759bb..84cbfd4 100644 --- a/pages/application/safetymeeting/home.vue +++ b/pages/application/safetymeeting/home.vue @@ -35,9 +35,9 @@ 会议时间:{{i.MEETING_DATE_START}} - - 会议状态:{{i.MEETING_STATUS}} - + + + diff --git a/pages/application/safetymeeting/safetymeeting-detail.vue b/pages/application/safetymeeting/safetymeeting-detail.vue index f98a405..885d83f 100644 --- a/pages/application/safetymeeting/safetymeeting-detail.vue +++ b/pages/application/safetymeeting/safetymeeting-detail.vue @@ -40,48 +40,60 @@ - - - 实时照片: - - - - - - - - - + + + 实时照片 + + + + + + + + + + + + + + + + - - - - - 签字照片: - - + + 签字 + - - - - - - - - + + + 签字照片 - + + + + + + + + + + + + + + + + - 是否参会: - + - - @@ -89,13 +101,18 @@ import { basePath,loginUser } from '@/common/tool.js'; + import sign from '@/components/sign/sign.vue'; import ykAuthpup from "@/components/yk-authpup/yk-authpup" + import {baseImgPath} from "../../../common/tool"; export default { components: { + sign, ykAuthpup }, data() { return { + baseImgPath: baseImgPath, + modalShow: false, permissionID:'', SAFETY_MEETING_ID : '', varList:[], @@ -110,8 +127,10 @@ RECORDER:"", MEETING_DATE_START:"", MEETING_DATE_END:"", - livePhotos: [], - signaturePicture: [], + liveImgs: [], + signImgList: [], + LIVEPHOTOS: '', + SIGNATUREPICTURE: '', } }, onLoad(e){ @@ -141,7 +160,6 @@ }, data: { SAFETY_MEETING_ID: _this.SAFETY_MEETING_ID, - CORPINFO_ID:loginUser.CORPINFO_ID, USER_ID:loginUser.USER_ID, }, success: (res) => { @@ -157,38 +175,116 @@ } }); }, + ChooseImage() { + var _this = this; + uni.chooseImage({ + count: 1, + sizeType: ['original', 'compressed'], + sourceType: ['camera'], + success: (res) => { + let img = { + IMGFILES_ID: '', + FILEPATH: res.tempFilePaths[0] + }; + _this.liveImgs = [img]; + } + }); + }, + DelImg() { + var _this = this; + uni.showModal({ + content: '确定要删除这张图片吗?', + cancelColor: "#000000", + cancelText: '取消', + confirmText: '确定', + success: res => { + if (res.confirm) { + _this.liveImgs = []; + } + } + }) + }, + subCanvas (e) { + this.signImgList.splice(0, this.signImgList.length); + this.signImgList.push(e); + this.SIGNATUREPICTURE = e.filePath; + this.modalShow = false; + }, + delImg (e) { + var _this = this; + let i = e.currentTarget.dataset.index + uni.showModal({ + content: '确定要删除这张图片吗?', + cancelColor: "#000000", + cancelText: '取消', + confirmText: '确定', + success: res => { + if (res.confirm) { + _this.signImgList.splice(i, 1) + } + } + }) + }, + submitMeetingAttendance() { + if (this.liveImgs.length === 0 || this.signImgList.length === 0) { + uni.showToast({ + title: '请上传实时照片和签字图片', + icon: 'none' + }); + return; + } - addHidden() { + const livePhotoPath = this.liveImgs[0].FILEPATH; + const signPhotoPath = this.signImgList[0].filePath; + const params = { + SAFETY_MEETING_ID: this.SAFETY_MEETING_ID, + LIVEPHOTOS: livePhotoPath, + SIGNATUREPICTURE: signPhotoPath, + ATTENDANCE_STATUS: '1' + }; + uni.showLoading({ + title: '提交中...' + }); + uni.request({ + url: basePath + '/app/safetymeeting/edit', + method: 'POST', + header: { + 'Content-type':'application/x-www-form-urlencoded' + }, + data: params, + success: (res) => { + uni.hideLoading(); + if (res.data.result === 'success') { + uni.showToast({ + title: '提交成功', + icon: 'success' + }); + this.$refs.showHiddenWindow.close(); + } else { + uni.showToast({ + title: '提交失败', + icon: 'none' + }); + } + } + }); + }, + addMeeting() { if (this.$refs.showHiddenWindow) { + // 清空实时照片和签字图片数组 + this.liveImgs = []; + this.signImgList = []; this.$refs.showHiddenWindow.open(); } this.creatorList = [{ NAME: loginUser.NAME, USER_ID: loginUser.USER_ID }] + // 重新打开抽屉(drawer)时,上面的代码会重置照片和签字 this.$refs['showHiddenWindow'].open() this.showHiddenWindow = true this.hiddenIsEdit = true }, - chooseImage(type) { - uni.chooseImage({ - count: 1, // 限制只能选择一张图片 - success: (res) => { - if (type === 'LIVEPHOTOS' && res.tempFilePaths.length) { - this.livePhotos = res.tempFilePaths[0]; // 如果是单图,确保赋值字符串 - } else if (type === 'SIGNATUREPICTURE' && res.tempFilePaths.length) { - this.signaturePicture = res.tempFilePaths[0]; // 确保赋值为字符串路径 - } - }, - }); - }, - removeImage(type) { - if (type === 'LIVEPHOTOS') { - this.livePhotos = []; // 清空数组即可移除图片 - } else { - this.signaturePicture = null; // 设为null即可移除图片 - } - }, openAuth(permissionID){ this.permissionID = permissionID; @@ -247,38 +343,6 @@ display: inline-block; /* 如果需要显示为inline-block */ } -.image-upload-container { - position: relative; - padding: 10px; -} - -.upload-image { - width: 100%; /* 宽度占满容器,根据需要调整 */ - height: auto; /* 高度自适应 */ - border-radius: 4px; /* 轻微圆角 */ -} - -.image-preview { - position: relative; - width: 90px; /* 根据需要调整 */ - height: 90px; /* 根据需要调整 */ - margin-right: 10px; /* 与下一张图片的间距 */ - display: inline-block; /* 使图片并排显示 */ -} - -.delete-icon { - position: absolute; - top: -10px; /* 超出图片范围的一部分,根据需要调整 */ - right: -10px; /* 超出图片范围的一部分,根据需要调整 */ - background-color: #ff4949; /* 您的红色背景 */ - width: 20px; /* 删除图标的大小,根据实际情况调整 */ - height: 20px; - border-radius: 10px; /* 圆形 */ - display: flex; - align-items: center; - justify-content: center; -} - .delete-icon text { color: white; /* 图标颜色为白色 */ font-size: 14px; /* 图标大小,根据需要调整 */