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