{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/form_remind_flowpanel.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/form_remind_flowpanel.vue","mtime":1740130327257},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/babel-loader/lib/index.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport { Toast } from 'mint-ui';\nimport API from \"@/api.js\";\nexport default {\n props: [\"act\",\"openParams\",\"buildFormData\",\"approvers\"],\n data: function() {\n return {\n signMode: \"TEXT\",//意见填写模式,SIGN:手写 TEXT:文本输入\n suggestBoxVisible: false,\n attitude: \"\",\n showInput: false, //是否展示添加常见意见框 开始false\n showEditFirst: false, //展示编辑意见框 \n\n showDelAndEdit: false, //开始false\n allSuggests: [],\n showEditSecond: false, //开始false\n input:'',\n inputSecond: \"\",\n opinionId: \"\", //更新意见信息的ID\n currentNodeId: \"\",\n existCanvas: false, //是否存在手写签名\n nodesList:[],\n nextNodeIds:[],\n canvasHeight: window.innerHeight*0.6 - 88 - 42, //弹框占屏幕60% 88为提交至和回退至的高度 42为手签重写确认按钮的高度\n canvasWidth: window.innerWidth,\n };\n },\n created() {\n \n },\n\n mounted() {\n this.getSuggest();\n this.setNodes();\n // 准备手写签名画布\n this.canvas = this.$refs.canvas; //指定canvas\n this.ctx = this.canvas.getContext(\"2d\"); //设置2D渲染区域\n this.ctx.fillStyle = \"#fff\";\n this.ctx.fillRect(0, 0, 500, 142);\n //this.ctx.lineWidth = 1;//设置线的宽度\n },\n updated(){\n this.resizeCanvas();\n },\n methods: {\n //清除画布数据\n clear() {\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.existCanvas = false;\n },\n resizeCanvas() {\n this.canvas.width = window.innerWidth;\n },\n\n touchStart(ev) {\n ev = ev || event\n ev.preventDefault()\n this.canvasMoveUse = true;\n let rect = this.$refs.canvas.getBoundingClientRect();\n if (ev.touches.length == 1) {\n let obj = {\n x: ev.targetTouches[0].clientX,\n y: ev.targetTouches[0].clientY,\n }\n const canvasX = obj.x - this.$refs.canvas.offsetLeft;\n const canvasY = obj.y - rect.top;\n this.ctx.beginPath(); // 移动的起点\n this.ctx.moveTo(canvasX, canvasY);\n }\n },\n touchMove(ev) {\n if (this.canvasMoveUse) {\n // 只有允许移动时调用\n let rect = this.$refs.canvas.getBoundingClientRect();\n if (ev.touches.length == 1) {\n let obj = {\n x: ev.targetTouches[0].clientX,\n y: ev.targetTouches[0].clientY,\n }\n let canvasX;\n let canvasY;\n canvasX = obj.x - this.$refs.canvas.offsetLeft;\n canvasY = obj.y - rect.top;\n this.ctx.lineTo(canvasX, canvasY);\n this.ctx.stroke();\n }\n }\n },\n touchEnd() {\n this.existCanvas = true;\n this.canvasMoveUse = false;\n },\n \n getSignImageData() {\n if (this.existCanvas) {\n //判断是否存在手写签名\n let pJson;\n let canvas = document.getElementById(\"canvas\");\n let signature = canvas.toDataURL(\"image/png\");\n let str = signature.replace(\"data:image/png;base64,\", \"\");\n pJson = {\n type: \"image/png;base64\",\n data: str\n };\n return pJson;\n }else {\n return false;\n }\n \n },\n\n //保存重新编辑的意见\n updateSuggestion() {\n let opId = this.opinionId,\n opinion = this.inputSecond;\n API.updateOpinion(this.$root.user.id, opId, opinion, {\n onSucess: response => {\n if (response.data.data) {\n let id = response.data.data.id;\n let content = response.data.data.content;\n for (let i = 0; i < this.allSuggests.length; i++) {\n if (this.allSuggests[i].id == id) {\n this.allSuggests[i].content = content;\n this.inputSecond = \"\";\n }\n }\n }\n }\n });\n },\n\n //重新编辑意见\n editSuggestion(id, content) {\n this.inputSecond = content;\n this.opinionId = id;\n },\n\n //删除意见\n deleteSuggestion(id) {\n let opId = id;\n API.deleteComments(this.$root.user.id, opId, {\n onSucess: response => {\n if (response.data.data) {\n let delId = response.data.data.id;\n let allSug = this.allSuggests;\n for (let i = 0; i < allSug.length; i++) {\n if (allSug[i].id == delId) {\n allSug.splice(i, 1);\n i--;\n }\n }\n this.allSuggest = allSug;\n }\n }\n });\n },\n\n //添加意见\n addSuggestion() {\n let opinion = this.input;\n API.addCommonOpinions(this.$root.user.id, opinion, {\n onSucess: response => {\n let newSuggest = response.data.data;\n this.allSuggests.push(newSuggest);\n this.input = \"\";\n }\n });\n },\n\n // 选中的数据放进文本框中\n putData(content) {\n if (this.showDelAndEdit == false) {\n if (!this.attitude) {\n this.attitude = content;\n } else if (this.attitude) {\n this.attitude = this.attitude + \",\" + content;\n }\n }\n },\n\n editSuggest() {\n this.showInput = true;\n this.showEditFirst = false;\n this.showEditSecond = true;\n this.showDelAndEdit = true;\n },\n\n cancelAddSuggest(num) {\n if (num == 1) {\n this.showInput = false;\n this.showDelAndEdit = false;\n this.showEditFirst = false;\n } else if (num == 2) {\n this.showInput = false;\n this.showDelAndEdit = false;\n this.showEditSecond = false;\n }\n },\n\n showInputBox() {\n this.showInput = true;\n this.showEditFirst = true;\n },\n\n //隐藏小意见框\n hiddenSuggest() {\n this.suggestBoxVisible = !this.suggestBoxVisible;\n },\n changeSignMode() {\n if (this.signMode == \"TEXT\") {\n this.signMode = \"SIGN\";\n }\n else {\n this.signMode = \"TEXT\";\n }\n },\n\n //获取返回的数据\n getSuggest() {\n this.$api.getCommonOpinions(this.$root.user.id, {\n onSucess: response => {\n this.allSuggests = response.data.data;\n }\n });\n },\n\n //节点\n setNodes() {\n let obj = JSON.parse(this.act.reminderNodesData);\n this.nodesList = obj.data;\n },\n\n //提交\n onSubmit() {\n let pJson = this.getSignImageData()\n let formData = this.buildFormData;\n formData.stateId = this.stateId;\n let docId = formData.id,\n id = formData.id;\n let formId = formData.formId;\n let document = {\n applicationId: this.$root.appid,\n currentNodeId: this.currentNodeId,\n docId: docId,\n document: formData,\n formId: formId,\n id: id,\n nodertIds:this.nextNodeIds,\n parentId: \"\",\n templateForm: \"\",\n viewId: \"\"\n };\n if (pJson) {\n //手写签名\n document.signatureJson = JSON.stringify(pJson);\n }\n document.attitude = this.attitude;\n this.$api.remindFlow(this.$root.appid, docId, document,{\n onSucess: response => {\n let status;\n if(response.data.errcode == 0) {\n status = 'SUCCESS';\n this.$emit(\"closePopup\",status);\n Toast({\n message: response.data.data,\n iconClass: 'fa fa-check fa-2x'\n });\n }else if(response.data.errcode==4001){\n status = 'ERROR';\n this.$emit(\"closePopup\",status)\n this.$emit(\"closePopup\",status);\n Toast({\n message: response.data.errmsg,\n iconClass: 'fa fa-close fa-2x'\n });\n }\n }\n });\n },\n \n }\n};\n",null]}