import{_ as x,d as B,p as E,x as i,bU as g,r,aD as w,H as f,m as n,o as c,c as N,l,D as u,G as _,h as C,aN as y,a as R,M as V,aQ as T,aZ as U}from"./index.js";import M from"./index.1318cf.js";import{b as j,d as A}from"./index.ae4dabde.js";import{i as q}from"./ticketReturn.8c918810.js";import"./porder.cb2a60e8.js";import"./index.8d1ab27f.js";const G={class:"ticket__content w-full"},H={class:"w-full flex flex-col"},P={class:"flex w-full justify-end mt-[10px]"},Q=B({__name:"return-form",setup(S){const b=E(),d=i(null),o=i({visible:!1,loading:!1,data:null}),t=i({InvCode:"",invoiceNumber:""}),h={InvCode:[{required:!0,message:"\u8BF7\u9009\u62E9\u53D1\u7968\u53F7\u7801",trigger:"change"}]},v=g({success(){U.success("\u521B\u5EFA\u6210\u529F!"),b.push("/purchase/purchaseCollection?tab=invoiceRelation_collection")}});async function D(){try{await d.value.validate();const{InvCode:a}=t.value;v.run(j({InvCode:a}))}catch{}}async function I(a){const e=await A({InvCode:a.InvCode});t.value.invoiceNumber=e.data.invoice_number,t.value.InvCode=e.data.InvCode,o.value.data=e.data}return(a,e)=>{const F=r("ElInput"),m=r("ElFormItem"),k=r("ElButton"),p=w("loading");return f((c(),N("div",G,[l(n(T),{ref_key:"formRef",ref:d,rules:h,model:t.value,"label-width":"110px"},{default:u(()=>[f((c(),_(m,{label:"\u8FDB\u9879\u53D1\u7968\u53F7\u7801",prop:"InvCode"},{default:u(()=>[C("div",H,[l(F,{modelValue:t.value.invoiceNumber,"onUpdate:modelValue":e[0]||(e[0]=s=>t.value.invoiceNumber=s),onClick:e[1]||(e[1]=s=>o.value.visible=!0),placeholder:"\u8FDB\u9879\u53D1\u7968\u53F7\u7801"},null,8,["modelValue"]),o.value.data?(c(),_(n(y),{key:0,class:"mt-[10px]",data:o.value.data,columns:n(q)},null,8,["data","columns"])):R("v-if",!0)])]),_:1})),[[p,o.value.loading]]),l(m,null,{default:u(()=>[C("div",P,[l(k,{type:"primary",onClick:D},{default:u(()=>[V(" \u4FDD\u5B58 ")]),_:1})])]),_:1})]),_:1},8,["model"]),l(M,{visible:o.value.visible,"onUpdate:visible":e[2]||(e[2]=s=>o.value.visible=s),onSubmit:I},null,8,["visible"])])),[[p,n(v).loading]])}}});var O=x(Q,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/purchaseNew/invoiceRelation/components/return-form.vue"]]);export{O as default};
