import{d as i,g as s,w as a,T as c,n,j as t,F as u,B as l,z as m}from"./index.4f40e5e1.js";import{U as p}from"./index.629aebdf.js";import{C as h}from"./index.41aa1fc7.js";import{T as d}from"./index.4b5981fc.js";import"./index.4e826412.js";import"./index.8a241fb6.js";import"./index.ccdfba8f.js";import"./index.d4a74c0c.js";import"./index.c4fa4795.js";import"./index.8e0ac410.js";import"./use-id.d72892eb.js";import"./icon_checkbox_default.2fe5d57e.js";import"./icon_checkbox-tenant.ecfa11df.js";import"./index.94ab113d.js";import"./index.10256463.js";const g="_cashProtocol_12q0m_1",y="_submit_12q0m_4";var r={cashProtocol:g,submit:y},N=i({name:"cash-protocol",data(){return{realStatus:!0,url:"",signStatus:""}},async mounted(){try{console.log(s.user);const e=s.user.data;!e.realName||!e.idCardNo?this.realStatus=!1:this.getDetail();const{data:o}=await a.get("/api-teacher/sysUserContractRecord/checkContractSignV2?contractType=WITHDRAW");this.signStatus=o}catch{}},methods:{async getDetail(){try{const e=await a.get("/api-teacher/sysUserContractRecord/queryLatestContractTemplate",{params:{contractType:"WITHDRAW"}});this.url=window.location.origin+window.location.pathname+"/pdf/web/viewer.html?file="+encodeURIComponent(e.data.origanalFileUrl)+"&btn=1"}catch{}},async onSubmit(){try{await a.get("/api-teacher/sysUserContractRecord/sign",{params:{contractType:"WITHDRAW"}}),setTimeout(()=>{c("\u7B7E\u7F72\u6210\u529F")},100),setTimeout(()=>{n({api:"openPageSuccess",content:{page:"WITHDRAW"}})},1e3)}catch{}},onSuccess(){this.realStatus=!0,this.getDetail()}},render(){return t("div",{class:r.cashProtocol},[t(d,{position:"top"},{default:()=>[t(h,null,null)]}),this.realStatus?t(u,null,[t("iframe",{src:this.url,frameborder:"0",style:{width:"100%",height:"calc(100vh - var(--header-height))",border:"none"}},null),this.signStatus==="NOT_SIGN"?t(l,{type:"primary",size:"large",block:!0,round:!0,class:r.submit,onClick:this.onSubmit},{default:()=>[m("\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F")]}):""]):t(p,{hideHeader:!0,onSuccess:this.onSuccess},null)])}});export{N as default};
