/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  */import{_ as e}from"./myUpload-1ee851ce.js";import{l as a}from"./index-026eb275.js";/* empty css                   */import{d as s,m as i,X as l,x as t,Z as r,o as m,l as o,w as u,e as p,a as c,b as n,t as d,f,a7 as v,a6 as y,W as j,a0 as k,a2 as _}from"./index-41bf27b7.js";const x={class:"flex flex-row justify-between"},b={class:"w-full"},g={class:"flex justify-end"},w=s({__name:"create",props:{primary:Object},emits:["close"],setup(s,{emit:w}){const F=s,h=i(),q=i({}),L=i([]),R=l({ticket:[{required:!0,message:"请上传电子发票"}]}),S=i(!1),z=e=>{q.value.ticket=e},C=e=>{q.value.ticket=""};return F.primary&&(q.value.id=F.primary.id,F.primary.ticket_link&&(L.value=[{uid:F.primary.id,url:F.primary.ticket_link}])),t((()=>{})),(s,i)=>{const l=e,t=y,F=j,M=k,O=_;return r((m(),o(M,{model:q.value,"label-width":"120px",ref_key:"ruleForm",ref:h,rules:f(R),class:"pr-4"},{default:u((()=>[p("div",x,[p("div",b,[c(t,{label:"电子发票",prop:"ticket"},{default:u((()=>[c(l,{acceptType:".png,.jpg,.jpeg",isMultiple:!0,maxFileSize:2,onFileRemove:C,onFileSuccess:z,fileList:L.value,action:"/qiniu/upload/image"},null,8,["fileList"])])),_:1})])]),p("div",g,[c(F,{type:"primary",onClick:i[0]||(i[0]=e=>{return s=h.value,q.value,void(s&&s.validate((e=>{e?a(q.value.id,q.value).then((e=>{v.success(e.message),w("close")})):S.value=!1})).then((()=>{})));var s})},{default:u((()=>[n(d(s.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model","rules"])),[[O,S.value]])}}});export{w as _};
