From cfa015e60c7399c6cbfab67699ba53359a2d719e Mon Sep 17 00:00:00 2001 From: hbao Date: Sun, 12 Jun 2022 03:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=85=E5=9F=BA=E5=9C=B0=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E7=AD=BE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homeApplication/proposerLite.vue | 168 ++++++++++++++++-- 1 file changed, 154 insertions(+), 14 deletions(-) diff --git a/src/views/onlineHome/homestead/homeApplication/proposerLite.vue b/src/views/onlineHome/homestead/homeApplication/proposerLite.vue index 7772d004..8c55d198 100644 --- a/src/views/onlineHome/homestead/homeApplication/proposerLite.vue +++ b/src/views/onlineHome/homestead/homeApplication/proposerLite.vue @@ -266,7 +266,16 @@ - + + + 签名确认 + + --> - + + + 签名确认 + --> - + + + 签名确认 + - - --> + + 签名确认 + + 乡镇
政府
审核
批准
意见
- + + + 签名确认 + 乡镇
政府
验收
意见
- + + 签名确认 + + +

电子签名

+
+ + + + + + 清空画板 + 保存提交 + +
@@ -1178,8 +1224,8 @@ import HouseApplyUploadComp from "@/components/house/HouseApplyUploadComp"; import HouseLocationPlanComp from "@/components/house/HouseLocationPlanComp"; import FieldSelect from "@/components/form/FieldSelect"; - import { getQueryLand, saveHouseBaseInfo , houseList , getHouseMembers , allInformationWLHT, checkDuplicateBuilding, checkDuplicateBuildingQuery, customSubmitWLHT, submitStartWLHT, updateStart, updateEnd, submitEndWLHT, getWorkflow } from "@/api/onlineHome/homestead/application"; - import $ from "jquery"; +import { getQueryLand, saveHouseBaseInfo , houseList , getHouseMembers , allInformationWLHT, checkDuplicateBuilding, checkDuplicateBuildingQuery, customSubmitWLHT, submitStartWLHT, updateStart, updateEnd, submitEndWLHT, getWorkflow } from "@/api/onlineHome/homestead/application"; +import $ from "jquery"; import CommonMap from "@/components/house/CommonMap"; import FieldDatePicker from "@/components/form/FieldDatePicker"; import FieldRadio from "@/components/form/FieldRadio"; @@ -1187,6 +1233,7 @@ import FieldCheckbox from "@/components/form/FieldCheckbox"; import {formatDate} from "element-ui/src/utils/date-util.js"; import request from '@/utils/request' import {Notify} from "vant"; +import {uploadFile} from "@/api/homesteadSurvey/zjdzd"; // 意图 const PROPOSER_VIEW = 1; const PROPOSER_EDIT = 2; @@ -1213,6 +1260,7 @@ export default { FieldRadio, HouseApplyUploadComp, FieldDatePicker, CommonMap, FieldSelect, HouseLocationPlanComp}, data() { return { + imageUrl:"", // 当前流程步骤 active: 0, // 申请ID @@ -1350,6 +1398,13 @@ export default { attachmentActive: 0, // 家庭成员tab familyMembersActive: 0, + //电子签名 + showesign: false, + lineWidth: 6, // 画笔的线条粗细 + lineColor: "#000000", // 画笔的颜色 + bgColor: "", // 画布的背景颜色 + resultImg: "", // 最终画布生成的base64图片 + isCrop: false, // 是否裁剪,在画布设定尺寸基础上裁掉四周空白部分 }; }, created() { @@ -1357,6 +1412,8 @@ export default { this.type = this.$route.query.type; this.taskId = this.$route.query.taskId; this.instanceId = this.$route.query.instanceId; + console.log(this.$cookies) + this.imageUrl =this.$cookies.get("url"); this.getFormIntent(); this.getLandCoord(); this.getDetail(); @@ -1462,7 +1519,6 @@ export default { init(value) { const role = this.$store.getters.roles; this.currentUserRole = role[0]; - // 局部变量 let houseApplyStatus = value ? value.tHouseApplyProposer.houseApplyStatus : -1; let proposerId = value ? value.tHouseApplyProposer.id : null; @@ -1639,7 +1695,7 @@ export default { } else { if(!this.applicationDetail.tHouseApproveNatureOptions.approveLeader) - this.$set(this.applicationDetail.tHouseApproveNatureOptions, 'approveLeader', handlerName); + // this.$set(this.applicationDetail.tHouseApproveNatureOptions, 'approveLeader', handlerName); if(!this.applicationDetail.tHouseApproveNatureOptions.approveTime) this.$set(this.applicationDetail.tHouseApproveNatureOptions, 'approveTime', handlerTime); } @@ -1657,7 +1713,7 @@ export default { } else { if(!this.applicationDetail.tHouseApproveAgricultureOptions.approveLeader) - this.$set(this.applicationDetail.tHouseApproveAgricultureOptions, 'approveLeader', handlerName); + //this.$set(this.applicationDetail.tHouseApproveAgricultureOptions, 'approveLeader', handlerName); if(!this.applicationDetail.tHouseApproveAgricultureOptions.approveTime) this.$set(this.applicationDetail.tHouseApproveAgricultureOptions, 'approveTime', handlerTime); } @@ -1682,7 +1738,7 @@ export default { } else { if(!this.applicationDetail.tHouseApproveOtherOptions.approveLeader) - this.$set(this.applicationDetail.tHouseApproveOtherOptions, 'approveLeader', handlerName); + // this.$set(this.applicationDetail.tHouseApproveOtherOptions, 'approveLeader', handlerName); if(!this.applicationDetail.tHouseApproveOtherOptions.approveTime) this.$set(this.applicationDetail.tHouseApproveOtherOptions, 'approveTime', handlerTime); } @@ -1696,7 +1752,7 @@ export default { } else { if(!this.applicationDetail.tHouseApproveTownOptions.approveLeader) - this.$set(this.applicationDetail.tHouseApproveTownOptions, 'approveLeader', handlerName); + // this.$set(this.applicationDetail.tHouseApproveTownOptions, 'approveLeader', handlerName); if(!this.applicationDetail.tHouseApproveTownOptions.approveTime) this.$set(this.applicationDetail.tHouseApproveTownOptions, 'approveTime', handlerTime); } @@ -3044,6 +3100,90 @@ export default { this.applicationDetail.tHouseApplyFamilyMembers[index].age = res[1]; } }, + searchCommit(){ + this.showesign = true + }, + // 清空画板 + handleReset() { + this.resultImg = null + if(this.$refs.esign){ + this.$refs.esign.reset(); + } + }, + // 生成签字图 + handleGenerate() { + if(this.resultImg==null||this.resultImg==''){ + this.$refs.esign + .generate() // 使用生成器调用把签字的图片转换成为base64图片格式 + .then((res) => { + this.resultImg = res; + }) + .catch((err) => { + // 画布没有签字时会执行这里提示一下 + this.$message({ + type: "warning", + message: "请签名后再生成签字图片", + }); + }); + // 在这里向后端发请求把转换后的base64文件传给后端,后端接收以后再转换成图片做静态图片存储 + // 当然也可以把base64转成流文件blob格式的,类似上传给后端这样,具体哪种方式看后端要求 + setTimeout(() => { + // 这里要使用定时器稍微延后以后就能取到base64数据了,当然也可以再加一个确认按钮,如:确认使用这张base64签名图片 + // 点击确认以后,在其回调函数中,再把base64的签名图片传给后端用于存储 + const blobBin = atob(this.resultImg.split(',')[1]) + let d = [] + for (let i=0;i { + console.log(res); + console.log(this.selectedTabName); + console.log(this.currentUserRole); + if(this.selectedTabName ==0){ + if(this.currentUserRole == 'task_executor'){ + //自然资源部门签字 + if(this.checkString(this.applicationDetail.tHouseApproveNatureOptions.approveLeader)) + return '自然资源部门签字不能为空'; + this.applicationDetail.tHouseApproveNatureOptions.approveLeader = res.fileName; + } else if (this.currentUserRole == ''){ + //其他部门签字 + if(this.checkString(this.applicationDetail.tHouseApproveOtherOptions.approveLeader)) + return '其他部门签字不能为空'; + this.applicationDetail.tHouseApproveOtherOptions.approveLeader = res.fileName; + } else if (this.currentUserRole == ''){ + //农村农业部门签字 + if(this.checkString(this.applicationDetail.tHouseApproveAgricultureOptions.approveLeader)) + return '农村农业部门签字不能为空'; + this.applicationDetail.tHouseApproveAgricultureOptions.approveLeader = res.fileName; + } else if (this.currentUserRole == ''){ + //镇级领导签字 tHouseApproveTownOptions + if(this.checkString(this.applicationDetail.tHouseApproveTownOptions.approveLeader)) + return '镇级领导签字不能为空'; + this.applicationDetail.tHouseApproveTownOptions.approveLeader = res.fileName; + } else if (this.currentUserRole == 'village_leader'){ + this.applicationDetail.tHouseApproveVillageOptions.villageLeader = res.fileName; + } + } else if(this.selectedTabName ==1){ + + } else if (this.selectedTabName ==2){ + + } + + }) + }, 200); + }else{ + // submitOnly(this.form).then(response => { + // let _this =this + // this.$toast({ + // icon: 'success', // 找到自己需要的图标 + // message: '修改成功', + // duration:"1000", + // }); + // }); + } + }, }, watch: { selectedTabName: function (newVal, oldVal) {