import{_ as G}from"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import{d as H,V as L,u as O,r as p,c as J,o as K,l as e,w as n,j as r,aE as c,aF as i,B as Q,p as _,A as l,H as U,i as w}from"./index-9PRMimni.js";import{e as W}from"./schemas-BmKi-UM9.js";import{z as X,A as Y}from"./template-rpthWlT9.js";import{B as Z}from"./BasicForm-dL_oCSPM.js";import{u as ee}from"./useForm-CKmgcynv.js";import{u as oe}from"./useModal-CO65vga3.js";const me=H({__name:"index",props:{title:{required:!0,default:"title"},content:{required:!0,default:"content"}},emits:["success"],setup(g,{expose:R,emit:x}){const B=g,{t:a}=L(),u=O(),b=p(),d=p(0),f=p(""),s=p(-1),y=x,{examineAndApproveSchema:C,methods:k}=W(),[F,{getFieldsValue:h,submit:S,setSchema:M}]=ee({gridProps:{cols:13},schemas:C,labelPlacement:"left",showActionButtonGroup:!1,showAdvancedButton:!1}),[P,{openModal:I,closeModal:m,setSubLoading:T,setProps:V}]=oe({title:a("interview.examineAndApproveSchema"),width:500});function A(o){s.value=o;const t=k.updateType(o);M(t)}function j(o){d.value=o?.busId,f.value=o?.moduleCode,s.value=-1,V({title:B.title}),I()}function N(){s.value===1?$():q()}async function $(){try{const o=await X({comment:h().remark,busId:d.value,moduleCode:f.value});o.data.code===200?(u.success(a("common.btnApprove")),m(),y("success")):u.error(o.data.msg)}catch{m()}}async function q(){if(console.log("拒绝"),!await S())return T(!1),!1;try{const t=await Y({comment:h().remark,busId:d.value,moduleCode:f.value});if(t.data.code===200){u.success(a("common.btnReturn")),y("success");return}else u.error(t.data.msg);m()}catch{m()}}return R({handleOpenModal:j}),(o,t)=>{const v=Q,D=U,z=G;return K(),J(z,{ref_key:"modalRef",ref:b,onRegister:e(P)},{default:n(()=>[c(w("span",null,l(g.content),513),[[i,e(s)===-1]]),c(w("div",null,[r(e(Z),{onRegister:e(F)},null,8,["onRegister"])],512),[[i,e(s)!==-1]])]),action:n(()=>[r(D,{class:"flex-1",justify:"center"},{default:n(()=>[c(r(v,{type:"primary",onClick:N},{default:n(()=>[_(l(e(a)("common.approveTipPop.confirm")),1)]),_:1},512),[[i,e(s)!==-1]]),c(r(v,{secondary:"",type:"primary",onClick:t[0]||(t[0]=E=>A(0))},{default:n(()=>[_(l(e(a)("common.approveTipPop.refuse")),1)]),_:1},512),[[i,e(s)===-1]]),c(r(v,{type:"primary",onClick:t[1]||(t[1]=E=>A(1))},{default:n(()=>[_(l(e(a)("common.approveTipPop.approve")),1)]),_:1},512),[[i,e(s)===-1]])]),_:1})]),_:1},8,["onRegister"])}}});export{me as _};
