import{d as n,y as e,g as u,f as l,n as c,j as t,F as d,B as r,A as i,aS as p}from"./ResizeObserver.es.b7226882.js";import{U as g}from"./index.c1bb54e7.js";import{C as h}from"./index.969bba7f.js";import{T as m}from"./index.1743594f.js";import"./index.00914c2e.js";import"./index.af733095.js";import"./index.527ae768.js";import"./index.1799aedf.js";import"./index.b1e15d61.js";import"./index.40f703b6.js";import"./index.021f1c7b.js";import"./use-id.5d5e6e63.js";import"./icon_checkbox.808b953c.js";import"./icon_checkbox_default.256c0849.js";import"./icon_checkbox-tenant.ecfa11df.js";import"./index.9dec3b5d.js";import"./index.016a5975.js";import"./index.1eaf642c.js";const f="_cashProtocol_1ufde_1",S="_submit_1ufde_4",y="_dialogPopup_1ufde_14",C="_dialogSection_1ufde_18",_="_dialogTitle_1ufde_21",w="_dialogContent_1ufde_37",B="_dialogBtn_1ufde_44";var o={cashProtocol:f,submit:S,dialogPopup:y,dialogSection:C,dialogTitle:_,dialogContent:w,dialogBtn:B},j=n({name:"cash-protocol",data(){return{dialogStatus:!1,realStatus:!0,url:"",signStatus:""}},async mounted(){try{const{data:a}=await e.get("/api-teacher/sysUserContractRecord/checkContractSignV2?contractType=WITHDRAW");this.signStatus=a;const s=u.user.data;!s.realName||!s.idCardNo?this.realStatus=!1:this.getDetail()}catch{}},methods:{async getDetail(){try{if(this.signStatus==="SUCCESS"){const a=await e.get("/api-teacher/sysUserContractRecord/querySignContract",{params:{contractType:"WITHDRAW"}});this.url=window.location.origin+window.location.pathname+"/pdf/web/viewer.html?file="+encodeURIComponent(a.data)+"&btn=1"}else{const a=await e.get("/api-teacher/sysUserContractRecord/queryLatestContractTemplate",{params:{contractType:"WITHDRAW"}});this.url=window.location.origin+window.location.pathname+"/pdf/web/viewer.html?file="+encodeURIComponent(a.data.origanalFileUrl)+"&btn=1"}}catch{}},async onSubmit(){try{await e.get("/api-teacher/sysUserContractRecord/sign",{params:{contractType:"WITHDRAW"}}),this.dialogStatus=!0}catch{}},onSuccess(){this.realStatus=!0,this.getDetail()},onBack(){l().isApp?c({api:"goBack"}):this.$router.back()}},render(){return t("div",{class:o.cashProtocol},[t(m,{position:"top"},{default:()=>[t(h,null,null)]}),this.realStatus?t(d,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(r,{type:"primary",size:"large",block:!0,round:!0,class:o.submit,onClick:this.onSubmit},{default:()=>[i("\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F")]}):""]):t(g,{hideHeader:!0,onSuccess:this.onSuccess},null),t(p,{show:this.dialogStatus,"onUpdate:show":a=>this.dialogStatus=a,round:!0,class:o.dialogPopup},{default:()=>[t("div",{class:o.dialogSection},[t("div",{class:o.dialogTitle},[i("\u63D0\u793A")]),t("div",{class:o.dialogContent},[i("\u7ED3\u7B97\u534F\u8BAE\u7B7E\u7F72\u4E2D\uFF0C\u7B7E\u7F72\u6210\u529F\u540E\u5373\u53EF\u7533\u8BF7\u7ED3\u7B97")]),t(r,{round:!0,type:"primary",class:o.dialogBtn,onClick:()=>this.onBack()},{default:()=>[i("\u6211\u77E5\u9053\u4E86")]})])]})])}});export{j as default};