/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  */import{_ as e}from"./myUpload-552dbfd4.js";import{l as a}from"./index-2813313d.js";/* empty css                 *//* empty css                   */import{d as s,m as i,V as l,x as t,X as r,o as m,l as o,w as u,e as p,a as c,b as d,t as n,f,a5 as v,a4 as j,U as y,Z as k,a0 as _}from"./index-0ffeeea6.js";const g={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(),U=i({}),q=i([]),L=l({ticket:[{required:!0,message:"请上传电子发票"}]}),S=i(!1),z=e=>{U.value.ticket=e},C=e=>{U.value.ticket=""};return F.primary&&(U.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,E=k,H=_;return r((m(),o(E,{model:U.value,"label-width":"120px",ref_key:"ruleForm",ref:h,rules:f(L),class:"pr-4"},{default:u((()=>[p("div",g,[p("div",x,[c(t,{label:"电子发票",prop:"ticket"},{default:u((()=>[c(l,{acceptType:".png,.jpg,.jpeg",isMultiple:!1,maxFileSize:2,onFileRemove:C,onFileSuccess:z,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,U.value,void(s&&s.validate((e=>{e?a(U.value.id,U.value).then((e=>{v.success(e.message),w("close")})):S.value=!1})).then((()=>{})));var s})},{default:u((()=>[d(n(s.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model","rules"])),[[H,S.value]])}}});export{w as _};
