import{d as u,y as o,g as l,A as r,f as c,n as d,j as t,F as p,E as n,B as s,aT as h}from"./ResizeObserver.es.62ab429c.js";import{U as g}from"./index.3b85c1f2.js";import{C as m}from"./index.786e83cc.js";import{T as S}from"./index.1db64c88.js";import"./index.3b8bb459.js";import"./index.5a30932c.js";import"./index.ac0c4528.js";import"./index.2745b15c.js";import"./index.9a52dc9a.js";import"./index.d7a13e47.js";import"./index.82be4917.js";import"./use-id.1bbe472d.js";import"./icon_checkbox.808b953c.js";import"./icon_checkbox_default.256c0849.js";import"./icon_checkbox-tenant.ecfa11df.js";import"./index.2bf63958.js";import"./index.2b14f9f1.js";import"./index.a6e5e68b.js";const y="_cashProtocol_1b3hk_1",C="_submit_1b3hk_4",b="_dialogPopup_1b3hk_14",f="_dialogSection_1b3hk_18",_="_dialogTitle_1b3hk_21",T="_dialogContent_1b3hk_37",B="_dialogBtn_1b3hk_44";var e={cashProtocol:y,submit:C,dialogPopup:b,dialogSection:f,dialogTitle:_,dialogContent:T,dialogBtn:B},j=u({name:"cash-protocol",data(){return{dialogStatus:!1,realStatus:!0,url:"",signStatus:""}},async mounted(){try{const{data:a}=await o.get("/api-teacher/sysUserContractRecord/checkContractSignV2?contractType=WITHDRAW");this.signStatus=a;const i=l.user.data;!i.realName||!i.idCardNo?this.realStatus=!1:this.getDetail()}catch{}},methods:{async getDetail(){try{if(this.signStatus==="SUCCESS"){const a=await o.get("/api-teacher/sysUserContractRecord/querySignContract",{params:{contractType:"WITHDRAW"}});this.url=r()+window.location.pathname+"/pdf/web/viewer.html?file="+encodeURIComponent(a.data)+"&btn=1"}else{const a=await o.get("/api-teacher/sysUserContractRecord/queryLatestContractTemplate",{params:{contractType:"WITHDRAW"}});this.url=r()+window.location.pathname+"/pdf/web/viewer.html?file="+encodeURIComponent(a.data.origanalFileUrl)+"&btn=1"}}catch{}},async onSubmit(){try{await o.get("/api-teacher/sysUserContractRecord/sign",{params:{contractType:"WITHDRAW"}}),this.dialogStatus=!0}catch{}},onSuccess(){this.realStatus=!0,this.getDetail()},onBack(){c().isApp?d({api:"goBack"}):this.$router.back()}},render(){return t("div",{class:e.cashProtocol},[t(S,{position:"top"},{default:()=>[t(m,null,null)]}),this.realStatus?t(p,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(n,{type:"primary",size:"large",block:!0,round:!0,class:e.submit,onClick:this.onSubmit},{default:()=>[s("\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F")]}):""]):t(g,{hideHeader:!0,onSuccess:this.onSuccess},null),t(h,{show:this.dialogStatus,"onUpdate:show":a=>this.dialogStatus=a,round:!0,class:e.dialogPopup},{default:()=>[t("div",{class:e.dialogSection},[t("div",{class:e.dialogTitle},[s("\u63D0\u793A")]),t("div",{class:e.dialogContent},[s("\u7ED3\u7B97\u534F\u8BAE\u7B7E\u7F72\u4E2D\uFF0C\u7B7E\u7F72\u6210\u529F\u540E\u5373\u53EF\u7533\u8BF7\u7ED3\u7B97")]),t(n,{round:!0,type:"primary",class:e.dialogBtn,onClick:()=>this.onBack()},{default:()=>[s("\u6211\u77E5\u9053\u4E86")]})])]})])}});export{j as default};
