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