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 lines
8.4KB

  1. import{d as _e,Q as me,G as ve,D as Y,z as he,A as ye,r as c,o as we,c as u,e as m,f as h,h as d,i as n,g as y,F as H,J as M,U as Ce,k as C,I as Ie,n as De,j as V,u as _,t as ke,aF as Se,C as z,N as xe,ad as Te,ae as G,aG as Ve,aE as Pe,x as $e}from"./index.8d65dd27.js";import{S as je,p as J}from"./seal.8981f08a.js";import{h as Oe,i as be,f as qe,c as K,b as Be,e as Re}from"./uploadAction.1ee5b723.js";const Ue={class:"footerPage"},Ae={id:"signContainer",class:"sign_content h-full"},Le=["id","onDrop"],Ee=["id"],Fe={key:0},Ne=["id","onDragstart","onDragend"],Xe=["src"],Ye=["onClick"];const He={class:"footer"},Me={class:"el-upload__tip"},ze={class:"flex justify-center"},Ge=_e({name:"stamp"}),et=Object.assign(Ge,{setup(Je){const Q=me(()=>import("./pdf.worker.entry.f19ddaea.js").then(e=>e.p),[]),I=ve(Y.userStore).userInfo,{proxy:w}=$e(),r=he(),D=ye(),W=Y.dictStore.uploadUrl,Ke=c([{src:je}]),b=c(0),P=c({loadType:"url",title:r.query.filename,docValue:""}),k=c(!1),R=c(!1),U=c(),A=async()=>{var l,o;const e=await Se({projectId:r.query.projectId,auditOpinion:((l=g.value)==null?void 0:l.comment)||void 0});R.value=((o=e.data)==null?void 0:o.isCommit)||!1;const t=await z({fileId:e.data.fileId});U.value=e.data.fileId;const a=URL.createObjectURL(t);P.value.docValue=a,L(P.value)},L=e=>{J.exports.GlobalWorkerOptions.workerSrc=Q;const t=e.loadType,a=e.docValue;let l=null;if(t==="byBase64"){var o=a,f=Z(o);l=f}else l=a;var j=J.exports.getDocument(l);j.promise.then(function(p){b.value=p.numPages,xe(()=>{E(p,1)})},function(p){console.error(p)})},E=(e,t)=>{e&&e.getPage(t).then(function(a){const o=a.getViewport({scale:2}),f=document.getElementById("pageCanvas_"+t),j=f.getContext("2d");f.width=2380,f.height=3368,f.style.width=1190+"px";var p=document.getElementById("pageView_"+t);p.style.height=o.height/2+"px",p.style.width=o.width/2+"px",a.render({canvasContext:j,viewport:o}),t<b.value&&E(e,t+1)})},Z=e=>{e=e.replace(/[\r\n]/g,"");var t=window.atob(e),a=t.length,l=new Uint8Array(new ArrayBuffer(a));for(let o=0;o<a;o++)l[o]=t.charCodeAt(o);return l},F=e=>{S.value.splice(e,1)},S=c([]),ee=(e,t,a)=>{var l;if(console.log("start"),k.value||((l=S.value)==null?void 0:l.length)&&a)w.$message.warning("\u8BF7\u52FF\u91CD\u590D\u76D6\u7AE0\uFF01");else{const f=Object.assign({posX:0,posY:0},t);e.dataTransfer.setData("Text",JSON.stringify(f)),e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(e.target,62,62)}},te=(e,t)=>{console.log("end"),t>=0&&F(t)},ae=e=>{console.log("enter")},oe=e=>{e.preventDefault(),e.stopPropagation(),console.log("over")},se=e=>{console.log("leave")},le=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),console.log("drop"),e.dataTransfer.getData("Text")){const a=JSON.parse(e.dataTransfer.getData("Text"));a.posX=e.offsetX,a.posY=842-e.offsetY,a.posPage=t,a.width=a.width||124,a.height=a.height||124,a.id="seal_"+Date.parse(new Date),a.left=e.offsetX-a.width/2,a.top=e.offsetY-a.height/2,a.fileUrl="222",S.value.push(a),console.log(a,"\u5370\u7AE0\u7B7E\u7F72\u76F8\u5173\u4FE1\u606F")}},N=c(),g=c({attachments:[]}),ne={comment:[{required:!0,message:"\u8BF7\u8F93\u5165\u610F\u89C1",trigger:"blur"}]};c(!1);const re=c(!1),ie=async e=>{!e||await e.validate(async t=>{if(t){const a={instanceId:r.query.instanceId,projectId:r.query.projectId,taskId:r.query.taskId,action:"PASS",auditInfo:{text:g.value.comment,attachments:g.value.attachments.map(o=>({fileId:o.response.data.id,fileName:o.response.data.originalFileName}))}};(await Te(a)).data==="TASKID_ERROR"?(w.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),D.push({name:"waitMeToHandle"})):(A(),w.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),re.value=!1)}})},q=c(!1),de=async()=>{q.value=!0;let e={posPage:6,posX:487,posY:540};if(r.query.instName==="\u9879\u76EE\u9884\u5BA1\u5BA1\u6279\u6D41\u7A0B"&&(I.value.empPosUnitCode===B.value?e={posPage:6,posX:487,posY:540}:I.value.empPosUnitCode===$.value&&(e={posPage:6,posX:487,posY:380})),console.log(I.value.empPosUnitCode),console.log($.value),console.log(I.value.empPosUnitCode===$.value),console.log(e),r.query.instName==="\u9879\u76EE\u9884\u5BA1\u5BA1\u6279\u6D41\u7A0B"&&I.value.empPosUnitCode!==B.value&&!v.value.isHigherSuperOrg)(await G({instanceId:r.query.instanceId,projectId:r.query.projectId,projectCode:r.query.projectCode,taskId:r.query.taskId,action:"PASS"})).data==="TASKID_ERROR"?(w.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),D.push({name:"waitMeToHandle"})):(w.$message.success("\u7B7E\u7F72\u6210\u529F\uFF01"),D.go(-1));else{const t=await Ve({...e,notSealedFileId:U.value,projectId:r.query.projectId*1,signType:1}),a=await z({fileId:t.data}),l=URL.createObjectURL(a);P.value.docValue=l,L(P.value),q.value=!1,k.value=!0,(await G({instanceId:r.query.instanceId,projectId:r.query.projectId,projectCode:r.query.projectCode,taskId:r.query.taskId,action:"PASS"})).data==="TASKID_ERROR"&&(w.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),D.push({name:"waitMeToHandle"}))}},v=c({}),B=c(),$=c(),ce=async()=>{const e=await Pe(r.query.projectId);v.value=e.data,B.value=v.value.isSuperOrg?v.value.superOrgCode:v.value.buildOrgCode,$.value=v.value.isHigherSuperOrg?v.value.higherSuperOrgCode:""};return we(()=>{A(),ce()}),(e,t)=>{const a=u("CircleClose"),l=u("el-icon"),o=u("el-col"),f=u("el-popover"),j=u("el-card"),p=u("el-row"),ue=u("el-input"),X=u("el-form-item"),x=u("el-button"),pe=u("el-upload"),ge=u("el-form"),fe=u("el-dialog");return m(),h("div",Ue,[d(p,{gutter:8,class:De(`h-full overflow-hidden ${k.value,""}`)},{default:n(()=>[d(o,{span:24,class:"h-full"},{default:n(()=>[y("div",Ae,[(m(!0),h(H,null,M(b.value,s=>(m(),h("div",{id:`pageView_${s}`,key:s,class:"pageView",onDragenter:t[0]||(t[0]=i=>ae(i)),onDragover:t[1]||(t[1]=i=>oe(i)),onDragleave:t[2]||(t[2]=i=>se(i)),onDrop:i=>le(i,s)},[y("canvas",{id:`pageCanvas_${s}`,class:"pageCanvas"},null,8,Ee),k.value?C("",!0):(m(),h("div",Fe,[S.value.length>0?(m(!0),h(H,{key:0},M(S.value,(i,T)=>(m(),h("div",{key:T},[i.posPage===s?(m(),h("div",{key:0,id:`drag${i.id}`,class:"sealView",draggable:"true",style:Ce(`
  2. width: ${i.width}px;
  3. height: ${i.height}px;
  4. left: ${i.left}px;
  5. top: ${i.top}px;`),onDragstart:O=>ee(O,i,0),onDragend:O=>te(O,T)},[y("img",{src:i.src,style:{width:"100%",height:"100%"}},null,8,Xe),y("p",{class:"sealDel",onClick:O=>F(T)},[d(l,null,{default:n(()=>[d(a)]),_:1})],8,Ye)],44,Ne)):C("",!0)]))),128)):C("",!0)]))],40,Le))),128))])]),_:1}),C("",!0)]),_:1},8,["class"]),C("",!0),y("div",He,[k.value?C("",!0):(m(),Ie(x,{key:0,type:"primary",loading:q.value,onClick:de},{default:n(()=>[V(" \u786E\u8BA4\u76D6\u7AE0 ")]),_:1},8,["loading"])),d(x,{onClick:t[8]||(t[8]=s=>_(D).go(-1))},{default:n(()=>[V("\u8FD4\u56DE")]),_:1})]),d(fe,{"model-value":!R.value,title:"\u586B\u5199\u5BA1\u6838\u610F\u89C1",width:"600px","destroy-on-close":"","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{footer:n(()=>[y("div",ze,[d(x,{class:"ml-22",type:"primary",onClick:t[11]||(t[11]=s=>ie(N.value))},{default:n(()=>[V(" \u63D0\u4EA4 ")]),_:1}),d(x,{onClick:t[12]||(t[12]=s=>e.$router.go(-1))},{default:n(()=>[V(" \u8FD4\u56DE ")]),_:1})])]),default:n(()=>[d(ge,{ref_key:"formRef",ref:N,model:g.value,rules:ne,"label-width":"auto","label-suffix":":"},{default:n(()=>[d(p,null,{default:n(()=>[d(o,{span:24},{default:n(()=>[d(X,{label:"\u5BA1\u6838\u610F\u89C1",prop:"comment"},{default:n(()=>[d(ue,{modelValue:g.value.comment,"onUpdate:modelValue":t[9]||(t[9]=s=>g.value.comment=s),maxlength:"200",placeholder:"\u8BF7\u8F93\u5165","show-word-limit":"",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1}),d(o,{span:24},{default:n(()=>[d(X,{label:"\u9644\u4EF6",prop:"files"},{default:n(()=>[d(pe,{"file-list":g.value.attachments,"onUpdate:fileList":t[10]||(t[10]=s=>g.value.attachments=s),class:"w-full",action:_(W),"on-success":s=>_(Oe)(s,g.value.attachments),"on-error":_(be),"before-upload":s=>_(qe)(s,{types:_(K)}),accept:_(K).map(s=>`.${s}`).join(","),multiple:"",limit:10,"on-preview":_(Be)},{tip:n(()=>[y("div",Me,"\u652F\u6301"+ke(_(Re))+"\u6587\u4EF6",1)]),default:n(()=>[d(x,{type:"primary",class:"mr-4"},{default:n(()=>[V("\u4E0A\u4F20\u9644\u4EF6")]),_: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{et as default};