From ae27ff75bc3557a87901181e3effac72e13def69 Mon Sep 17 00:00:00 2001 From: chenxinying <1039655633@qq.com> Date: Tue, 20 Feb 2024 10:25:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=97=E9=99=90=E7=A9=BA=E9=97=B4=E5=92=8C?= =?UTF-8?q?=E9=AB=98=E5=A4=84=E4=BD=9C=E4=B8=9A=EF=BC=8C=E5=8A=A8=E7=81=AB?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=AA=8C=E6=94=B6=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../confinedspace-accept-detail.vue | 127 ++++++++++++++++- pages/application/eight-assignments.vue | 8 +- .../highwork-accept-detail.vue | 128 ++++++++++++++++- .../hotwork-accept/hotwork-accept-detail.vue | 131 +++++++++++++++++- .../hotwork-apply/hotwork-apply-detail.vue | 11 +- 5 files changed, 397 insertions(+), 8 deletions(-) diff --git a/pages/application/confinedspace/confinedspace-accept/confinedspace-accept-detail.vue b/pages/application/confinedspace/confinedspace-accept/confinedspace-accept-detail.vue index 7003324..f1b83f5 100644 --- a/pages/application/confinedspace/confinedspace-accept/confinedspace-accept-detail.vue +++ b/pages/application/confinedspace/confinedspace-accept/confinedspace-accept-detail.vue @@ -21,6 +21,28 @@ > + + + 验收视频 + + + {{videoList.length}}/1 + + + + + + + + + + + + + + + 验收部门负责人 @@ -51,6 +73,7 @@ + @@ -69,6 +92,7 @@ }, data() { return { + permissionID:'', baseImgPath:baseImgPath, buttonloading: false, isUps:false, @@ -83,6 +107,7 @@ todayDate:'', modalName:null, imgList:[], + videoList:[] } }, onLoad(event){ @@ -101,7 +126,6 @@ } // 初始化现场作业负责人 this.getDept(); - this.getLimitSpace(); loginSession(); }, @@ -190,6 +214,23 @@ }); return; } + if(!_this.videoList){ + uni.showToast({ + icon: 'none', + title: '请上传验收视频', + duration: 1500 + }); + return; + } + } + var fileList = []; + for (var i = 0; i < _this.videoList.length; i++) { + if(!_this.videoList[i].id){ + var file = {}; + file.type = 3; + file.filePath = _this.videoList[i].filePath; + fileList.push(file); + } } const formData={} @@ -202,6 +243,9 @@ formData.DESCR = _this.pd.DESCR formData.USER_ID = loginUser.USER_ID formData.APPLY_STATUS = APPLY_STATUS + formData.VIDEO_PATH = this.videoList.map(item => { + return item.filePath + }) uni.uploadFile({ url: basePath+'app/confinedspace/nextStep', files: files, @@ -223,7 +267,88 @@ } }) }, + uploadImg(file){ + return new Promise((resolve, reject) => { + var _this = this; + uni.uploadFile({ + url: basePath+'/app/imgfiles/add', + filePath: file.filePath, + name: 'FFILE', + formData: { + 'TYPE': file.type, + 'FOREIGN_KEY': _this.pd.HOTWORK_ID, + CORPINFO_ID: loginUser.CORPINFO_ID, + USER_ID: loginUser.USER_ID, + }, + success: (res) => { + resolve(); + }, + fail: (err) => { + uni.hideLoading(); + uni.showModal({ + content: err.errMsg, + showCancel: false + }); + } + }) + }) + }, + chooseVideo(e) { + var _this = this; + uni.chooseVideo({ + maxDuration: 60, + count: 1, //默认9 + // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 + sourceType: ['camera', 'album'], //从相册选择 + success: (res) => { + if(res.tempFilePath.substring(res.tempFilePath.lastIndexOf(".") + 1, res.tempFilePath.length) === 'mp4'){ + uni.uploadFile({ + url: basePath + '/app/eightwork/saveFile', + filePath: res.tempFilePath, + name: 'file', + formData: { + CORPINFO_ID:loginUser.CORPINFO_ID, + }, + success: ({data}) => { + let img = {}; + img.filePath = JSON.parse(data).FILE_PATH; + this.videoList.push(img) + } + }); + }else { + uni.showToast({ + title: "只能上传MP4格式", + duration: 2000 + }); + } + } + }) + }, + DelVideo(e){ + uni.showModal({ + title: '', + content: '确定要删除这个视频吗?', + cancelColor: "#000000", + cancelText: '取消', + confirmText: '确定', + success: res => { + if (res.confirm) { + this.videoList = [] + } + } + }) + }, + openAuthVideo(permissionID){ + this.permissionID = permissionID; + setTimeout(()=>{ + this.$refs['authpup_video'].open(); + },200) + }, + playVideo(e) { + this.videoSrc = e.currentTarget.dataset.src + this.modalShow = true + }, uploadImgFaults(fileList,signtime) { this.imgList.map(item => { var img = {} diff --git a/pages/application/eight-assignments.vue b/pages/application/eight-assignments.vue index 0eab208..8e0d6f5 100644 --- a/pages/application/eight-assignments.vue +++ b/pages/application/eight-assignments.vue @@ -68,10 +68,11 @@ 吊装作业 - + + - {{eight_work_count.ELECTRICITY_COUNT}} + {{eight_work_count.ELECTRICITY_COUNT}} 临时用电作业 @@ -127,7 +128,7 @@ setCorpinfoId, setloginUser, setDeptId, - premission, + premission, isRest } from '@/common/tool.js'; export default { @@ -143,6 +144,7 @@ }, onShow() { this.premission = Object.assign({}, premission) + console.log(this.premission) this.eight_work_count = {} this.getRedPoint(); }, diff --git a/pages/application/highwork/highwork-accept/highwork-accept-detail.vue b/pages/application/highwork/highwork-accept/highwork-accept-detail.vue index 8834110..3f9a357 100644 --- a/pages/application/highwork/highwork-accept/highwork-accept-detail.vue +++ b/pages/application/highwork/highwork-accept/highwork-accept-detail.vue @@ -21,6 +21,28 @@ > + + + 验收视频 + + + {{videoList.length}}/1 + + + + + + + + + + + + + + + 验收部门负责人 @@ -51,6 +73,7 @@ + @@ -69,6 +92,7 @@ }, data() { return { + permissionID:'', baseImgPath:baseImgPath, buttonloading: false, isUps:false, @@ -83,6 +107,7 @@ todayDate:'', modalName:null, imgList:[], + videoList:[] } }, onLoad(event){ @@ -101,7 +126,6 @@ } // 初始化现场作业负责人 this.getDept(); - this.getLimitSpace(); loginSession(); }, @@ -190,8 +214,24 @@ }); return; } + if(!_this.videoList){ + uni.showToast({ + icon: 'none', + title: '请上传验收视频', + duration: 1500 + }); + return; + } + } + var fileList = []; + for (var i = 0; i < _this.videoList.length; i++) { + if(!_this.videoList[i].id){ + var file = {}; + file.type = 3; + file.filePath = _this.videoList[i].filePath; + fileList.push(file); + } } - const formData={} var files = []; var signtime = []; @@ -202,6 +242,9 @@ formData.DESCR = _this.pd.DESCR?_this.pd.DESCR:"无" formData.USER_ID = loginUser.USER_ID formData.APPLY_STATUS = APPLY_STATUS + formData.VIDEO_PATH = this.videoList.map(item => { + return item.filePath + }) uni.uploadFile({ url: basePath+'app/highwork/nextStep', files: files, @@ -223,7 +266,88 @@ } }) }, + uploadImg(file){ + return new Promise((resolve, reject) => { + var _this = this; + uni.uploadFile({ + url: basePath+'/app/imgfiles/add', + filePath: file.filePath, + name: 'FFILE', + formData: { + 'TYPE': file.type, + 'FOREIGN_KEY': _this.pd.HOTWORK_ID, + CORPINFO_ID: loginUser.CORPINFO_ID, + USER_ID: loginUser.USER_ID, + }, + success: (res) => { + resolve(); + }, + fail: (err) => { + uni.hideLoading(); + uni.showModal({ + content: err.errMsg, + showCancel: false + }); + } + }) + }) + }, + chooseVideo(e) { + var _this = this; + uni.chooseVideo({ + maxDuration: 60, + count: 1, //默认9 + // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 + sourceType: ['camera', 'album'], //从相册选择 + success: (res) => { + if(res.tempFilePath.substring(res.tempFilePath.lastIndexOf(".") + 1, res.tempFilePath.length) === 'mp4'){ + uni.uploadFile({ + url: basePath + '/app/eightwork/saveFile', + filePath: res.tempFilePath, + name: 'file', + formData: { + CORPINFO_ID:loginUser.CORPINFO_ID, + }, + success: ({data}) => { + let img = {}; + img.filePath = JSON.parse(data).FILE_PATH; + this.videoList.push(img) + } + }); + }else { + uni.showToast({ + title: "只能上传MP4格式", + duration: 2000 + }); + } + } + }) + }, + DelVideo(e){ + uni.showModal({ + title: '', + content: '确定要删除这个视频吗?', + cancelColor: "#000000", + cancelText: '取消', + confirmText: '确定', + success: res => { + if (res.confirm) { + this.videoList = [] + } + } + }) + }, + openAuthVideo(permissionID){ + this.permissionID = permissionID; + setTimeout(()=>{ + this.$refs['authpup_video'].open(); + },200) + }, + playVideo(e) { + this.videoSrc = e.currentTarget.dataset.src + this.modalShow = true + }, uploadImgFaults(fileList,signtime) { this.imgList.map(item => { var img = {} diff --git a/pages/application/hotwork/hotwork-accept/hotwork-accept-detail.vue b/pages/application/hotwork/hotwork-accept/hotwork-accept-detail.vue index 2a824ae..1f2c404 100644 --- a/pages/application/hotwork/hotwork-accept/hotwork-accept-detail.vue +++ b/pages/application/hotwork/hotwork-accept/hotwork-accept-detail.vue @@ -21,6 +21,28 @@ > + + + 验收视频 + + + {{videoList.length}}/1 + + + + + + + + + + + + + + + 验收部门负责人 @@ -51,6 +73,8 @@ + + @@ -69,6 +93,7 @@ }, data() { return { + permissionID:'', baseImgPath:baseImgPath, buttonloading: false, isUps:false, @@ -83,6 +108,7 @@ todayDate:'', modalName:null, imgList:[], + videoList:[] } }, onLoad(event){ @@ -101,7 +127,6 @@ } // 初始化现场作业负责人 this.getDept(); - this.getLimitSpace(); loginSession(); }, @@ -173,6 +198,7 @@ }); return; } + if(APPLY_STATUS == 1){ if(new Date(this.pd.ACCEPT_TIME).getTime() - new Date(this.pd.WORK_END_DATE).getTime() >= 3600000){ uni.showToast({ @@ -190,8 +216,25 @@ }); return; } + if(!_this.videoList){ + uni.showToast({ + icon: 'none', + title: '请上传验收视频', + duration: 1500 + }); + return; + } } + var fileList = []; + for (var i = 0; i < _this.videoList.length; i++) { + if(!_this.videoList[i].id){ + var file = {}; + file.type = 3; + file.filePath = _this.videoList[i].filePath; + fileList.push(file); + } + } const formData={} var files = []; var signtime = []; @@ -202,6 +245,10 @@ formData.DESCR = _this.pd.DESCR?_this.pd.DESCR:"无" formData.USER_ID = loginUser.USER_ID formData.APPLY_STATUS = APPLY_STATUS + formData.VIDEO_PATH = this.videoList.map(item => { + return item.filePath + }) + console.log(formData.VIDEO_PATH) uni.uploadFile({ url: basePath+'app/hotwork/nextStep', files: files, @@ -224,6 +271,88 @@ }) }, + uploadImg(file){ + return new Promise((resolve, reject) => { + var _this = this; + uni.uploadFile({ + url: basePath+'/app/imgfiles/add', + filePath: file.filePath, + name: 'FFILE', + formData: { + 'TYPE': file.type, + 'FOREIGN_KEY': _this.pd.HOTWORK_ID, + CORPINFO_ID: loginUser.CORPINFO_ID, + USER_ID: loginUser.USER_ID, + }, + success: (res) => { + resolve(); + }, + fail: (err) => { + uni.hideLoading(); + uni.showModal({ + content: err.errMsg, + showCancel: false + }); + } + }) + }) + }, + chooseVideo(e) { + var _this = this; + uni.chooseVideo({ + maxDuration: 60, + count: 1, //默认9 + // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 + sourceType: ['camera', 'album'], //从相册选择 + success: (res) => { + if(res.tempFilePath.substring(res.tempFilePath.lastIndexOf(".") + 1, res.tempFilePath.length) === 'mp4'){ + uni.uploadFile({ + url: basePath + '/app/eightwork/saveFile', + filePath: res.tempFilePath, + name: 'file', + formData: { + CORPINFO_ID:loginUser.CORPINFO_ID, + }, + success: ({data}) => { + let img = {}; + img.filePath = JSON.parse(data).FILE_PATH; + this.videoList.push(img) + } + }); + }else { + uni.showToast({ + title: "只能上传MP4格式", + duration: 2000 + }); + } + } + }) + }, + DelVideo(e){ + uni.showModal({ + title: '', + content: '确定要删除这个视频吗?', + cancelColor: "#000000", + cancelText: '取消', + confirmText: '确定', + success: res => { + if (res.confirm) { + this.videoList = [] + } + } + }) + }, + + openAuthVideo(permissionID){ + this.permissionID = permissionID; + setTimeout(()=>{ + this.$refs['authpup_video'].open(); + },200) + }, + playVideo(e) { + this.videoSrc = e.currentTarget.dataset.src + this.modalShow = true + }, uploadImgFaults(fileList,signtime) { this.imgList.map(item => { var img = {} diff --git a/pages/application/hotwork/hotwork-apply/hotwork-apply-detail.vue b/pages/application/hotwork/hotwork-apply/hotwork-apply-detail.vue index 2da120c..9739585 100644 --- a/pages/application/hotwork/hotwork-apply/hotwork-apply-detail.vue +++ b/pages/application/hotwork/hotwork-apply/hotwork-apply-detail.vue @@ -318,7 +318,7 @@ 安全管理部门 - + 清除 @@ -1029,6 +1029,15 @@ required = false } } + + if(this.pd.SAFETY_USER_ID && !this.pd.AUDIT_USER_ID ){ + uni.showToast({ + icon: 'none', + title: '请选择安全管理部门负责人', + duration: 1500 + }); + required = false + } if (!required) { return }