You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6 line
7.1KB

  1. import{I as ce,x as ue,y as pe,E as fe,r as c,o as ge,b as u,c as m,d as v,f as r,h as l,e as y,F as A,H as U,M as _e,j as h,L as me,n as ve,i as I,u as g,t as ye,k as he,U as N,C as we,ae as De,af as Ce,s as ke}from"./index-dd5fae99.js";import{S as Ie,p as X}from"./seal-1f46529d.js";import{a as xe}from"./projectStore-30136ff6.js";import{h as Ve,i as Se,f as $e,b as Y,c as Te,e as be}from"./uploadAction-3962500e.js";import{g as Be}from"./selfEvaluationSure-f97fea2c.js";const je={class:"footerPage"},Pe={id:"signContainer",class:"sign_content h-full"},qe=["id","onDrop"],Le=["id"],Re={key:0},Ee=["id","onDragstart","onDragend"],Fe=["src"],Oe=["onClick"];const Ae={class:"footer"},Ue={class:"el-upload__tip"},Ne={class:"flex justify-center"},Xe=he({name:"stamp"}),We=Object.assign(Xe,{setup(Ye){const z=ce(()=>import("./pdf.worker.entry-849d37c7.js").then(t=>t.p),[]),{proxy:x}=ke(),d=ue(),T=pe(),J=fe.dictStore.uploadUrl,ze=c([{src:Ie}]),b=c(0),V=c({loadType:"url",title:d.query.filename,docValue:""}),w=c(!1),B=c(!1),P=c(),q=async()=>{const t=await N({fileId:d.query.fileId});P.value=d.query.fileId;const e=URL.createObjectURL(t);V.value.docValue=e,L(V.value)},L=t=>{X.GlobalWorkerOptions.workerSrc=z;const e=t.loadType,a=t.docValue;let i=null;if(e==="byBase64"){var o=a,f=K(o);i=f}else i=a;var S=X.getDocument(i);S.promise.then(function(p){b.value=p.numPages,we(()=>{R(p,1)})},function(p){console.error(p)})},R=(t,e)=>{t&&t.getPage(e).then(function(a){const o=a.getViewport({scale:2}),f=document.getElementById("pageCanvas_"+e),S=f.getContext("2d");f.width=2380,f.height=3368,f.style.width="1190px";var p=document.getElementById("pageView_"+e);p.style.height=o.height/2+"px",p.style.width=o.width/2+"px",a.render({canvasContext:S,viewport:o}),e<b.value&&R(t,e+1)})},K=t=>{t=t.replace(/[\r\n]/g,"");var e=window.atob(t),a=e.length,i=new Uint8Array(new ArrayBuffer(a));for(let o=0;o<a;o++)i[o]=e.charCodeAt(o);return i},E=t=>{D.value.splice(t,1)},D=c([]),M=(t,e,a)=>{var i;if(console.log("start"),w.value||(i=D.value)!=null&&i.length&&a)x.$message.warning("请勿重复盖章!");else{const f=Object.assign({posX:0,posY:0},e);t.dataTransfer.setData("Text",JSON.stringify(f)),t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(t.target,62,62)}},G=(t,e)=>{console.log("end"),e>=0&&E(e)},H=t=>{console.log("enter")},W=t=>{t.preventDefault(),t.stopPropagation(),console.log("over")},Q=t=>{console.log("leave")},Z=(t,e)=>{if(t.preventDefault(),t.stopPropagation(),console.log("drop"),t.dataTransfer.getData("Text")){const a=JSON.parse(t.dataTransfer.getData("Text"));a.posX=t.offsetX,a.posY=842-t.offsetY,a.posPage=e,a.width=a.width||124,a.height=a.height||124,a.id="seal_"+Date.parse(new Date),a.left=t.offsetX-a.width/2,a.top=t.offsetY-a.height/2,a.fileUrl="222",D.value.push(a),console.log(a,"印章签署相关信息")}},F=c(),_=c({attachments:[]}),ee={comment:[{required:!0,message:"请输入意见",trigger:"blur"}]};c(!1);const te=c(!1),ae=async t=>{t&&await t.validate(async e=>{if(e){const a={instanceId:d.query.instanceId,projectId:d.query.projectId,taskId:d.query.taskId,action:"PASS",auditInfo:{text:_.value.comment,attachments:_.value.attachments.map(o=>({fileId:o.response.data.id,fileName:o.response.data.originalFileName}))}};(await De(a)).data==="TASKID_ERROR"?(x.$message.warning("当前审批任务有变动,请返回待我处理列表!"),T.go(-1)):(q(),B.value=!0,x.$message.success("提交成功!"),te.value=!1)}})},j=c(!1),oe=async()=>{j.value=!0;const e=await Be({...{posPage:1,posX:230,posY:680},notSealedFileId:P.value,appraisalId:d.query.appraisalId,projectCode:d.query.projectCode,signType:1}),a=await N({fileId:e.data}),i=URL.createObjectURL(a);V.value.docValue=i,L(V.value),j.value=!1,w.value=!0,(await Ce({instanceId:d.query.instanceId,projectId:d.query.projectId,projectCode:d.query.projectCode,taskId:d.query.taskId,action:"PASS"})).data==="TASKID_ERROR"&&(x.$message.warning("当前审批任务有变动,请返回待我处理列表!"),T.go(-1))},se=c({}),le=async()=>{const t=await xe(d.query.projectCode);se.value=t.data};return ge(()=>{B.value=d.query.isCommit==="true",q(),le()}),(t,e)=>{const a=u("CircleClose"),i=u("el-icon"),o=u("el-col"),f=u("el-popover"),S=u("el-card"),p=u("el-row"),ne=u("el-input"),O=u("el-form-item"),C=u("el-button"),re=u("el-upload"),ie=u("el-form"),de=u("el-dialog");return m(),v("div",je,[r(p,{gutter:8,class:ve(`h-full overflow-hidden ${w.value,""}`)},{default:l(()=>[r(o,{span:24,class:"h-full"},{default:l(()=>[y("div",Pe,[(m(!0),v(A,null,U(b.value,s=>(m(),v("div",{id:`pageView_${s}`,key:s,class:"pageView",onDragenter:e[0]||(e[0]=n=>H(n)),onDragover:e[1]||(e[1]=n=>W(n)),onDragleave:e[2]||(e[2]=n=>Q(n)),onDrop:n=>Z(n,s)},[y("canvas",{id:`pageCanvas_${s}`,class:"pageCanvas"},null,8,Le),w.value?h("",!0):(m(),v("div",Re,[D.value.length>0?(m(!0),v(A,{key:0},U(D.value,(n,k)=>(m(),v("div",{key:k},[n.posPage===s?(m(),v("div",{key:0,id:`drag${n.id}`,class:"sealView",draggable:"true",style:_e(`
  2. width: ${n.width}px;
  3. height: ${n.height}px;
  4. left: ${n.left}px;
  5. top: ${n.top}px;`),onDragstart:$=>M($,n,0),onDragend:$=>G($,k)},[y("img",{src:n.src,style:{width:"100%",height:"100%"}},null,8,Fe),y("p",{class:"sealDel",onClick:$=>E(k)},[r(i,null,{default:l(()=>[r(a)]),_:1})],8,Oe)],44,Ee)):h("",!0)]))),128)):h("",!0)]))],40,qe))),128))])]),_:1}),h("",!0)]),_:1},8,["class"]),h("",!0),y("div",Ae,[w.value?h("",!0):(m(),me(C,{key:0,type:"primary",loading:j.value,onClick:oe},{default:l(()=>e[17]||(e[17]=[I(" 确认盖章 ")])),_:1},8,["loading"])),r(C,{onClick:e[8]||(e[8]=s=>g(T).go(-1))},{default:l(()=>e[18]||(e[18]=[I("返回")])),_:1})]),r(de,{"model-value":!B.value,title:"填写审核意见",width:"600px","destroy-on-close":"","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{footer:l(()=>[y("div",Ne,[r(C,{class:"ml-22",type:"primary",onClick:e[11]||(e[11]=s=>ae(F.value))},{default:l(()=>e[20]||(e[20]=[I(" 提交 ")])),_:1}),r(C,{onClick:e[12]||(e[12]=s=>t.$router.go(-1))},{default:l(()=>e[21]||(e[21]=[I(" 返回 ")])),_:1})])]),default:l(()=>[r(ie,{ref_key:"formRef",ref:F,model:_.value,rules:ee,"label-width":"auto","label-suffix":":"},{default:l(()=>[r(p,null,{default:l(()=>[r(o,{span:24},{default:l(()=>[r(O,{label:"审核意见",prop:"comment"},{default:l(()=>[r(ne,{modelValue:_.value.comment,"onUpdate:modelValue":e[9]||(e[9]=s=>_.value.comment=s),maxlength:"200",placeholder:"请输入","show-word-limit":"",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1}),r(o,{span:24},{default:l(()=>[r(O,{label:"附件",prop:"files"},{default:l(()=>[r(re,{"file-list":_.value.attachments,"onUpdate:fileList":e[10]||(e[10]=s=>_.value.attachments=s),class:"w-full",action:g(J),"on-success":s=>g(Ve)(s,_.value.attachments),"on-error":g(Se),"before-upload":s=>g($e)(s,{types:g(Y)}),accept:g(Y).map(s=>`.${s}`).join(","),multiple:"",limit:10,"on-preview":g(Te)},{tip:l(()=>[y("div",Ue,"支持"+ye(g(be))+"文件",1)]),default:l(()=>[r(C,{type:"primary",class:"mr-4"},{default:l(()=>e[19]||(e[19]=[I("上传附件")])),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])])}}});export{We as default};