import{d as n,x as o,g as u,f as l,n as c,j as t,F as d,B as r,z as i,aR as p}from"./index.3bfa6a0e.js";import{U as g}from"./index.a68b9b7d.js";import{C as h}from"./index.645e7ddc.js";import{T as m}from"./index.52c97b40.js";import"./index.0916b076.js";import"./index.bb2d59fe.js";import"./index.68aa5658.js";import"./index.fb1da5d0.js";import"./index.79997a38.js";import"./index.983bfd1a.js";import"./use-id.7c44c16f.js";import"./icon_checkbox_default.2fe5d57e.js";import"./icon_checkbox-tenant.ecfa11df.js";import"./index.8903238b.js";import"./index.9551d420.js";import"./index.b1671445.js";import"./index.4a8093e5.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 e={cashProtocol:f,submit:S,dialogPopup:y,dialogSection:C,dialogTitle:_,dialogContent:w,dialogBtn:B},V=n({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 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 o.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 o.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 o.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:e.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:e.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:e.dialogPopup},{default:()=>[t("div",{class:e.dialogSection},[t("div",{class:e.dialogTitle},[i("\u63D0\u793A")]),t("div",{class:e.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:e.dialogBtn,onClick:()=>this.onBack()},{default:()=>[i("\u6211\u77E5\u9053\u4E86")]})])]})])}});export{V as default};
