import{_ as B,d as D,k as E,n as i,di as F,cm as g,r,aw as h,B as f,i as n,o as c,c as N,h as l,y as u,A as _,e as C,ca as V,a as R,H as T,cd as A}from"./index.js";import j from"./index.b3ab20.js";import{b as M,d as U}from"./index.41007914.js";import{i as q}from"./ticketReturn.e53d6b17.js";import"./porder.827c74bc.js";import"./index.5741d39c.js";const H={class:"ticket__content w-full"},P={class:"w-full flex flex-col"},S={class:"flex w-full justify-end mt-[10px]"},$=D({__name:"return-form",setup(z){const b=E(),d=i(null),o=i({visible:!1,loading:!1,data:null}),t=i({InvCode:"",invoiceNumber:""}),I={InvCode:[{required:!0,message:"\u8BF7\u9009\u62E9\u53D1\u7968\u53F7\u7801",trigger:"change"}]},v=F({success(){g.success("\u521B\u5EFA\u6210\u529F!"),b.push("/supply/supplyCollection")}});async function k(){try{await d.value.validate();const{InvCode:a}=t.value;v.run(M({InvCode:a}))}catch{}}async function w(a){const e=await U({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 y=r("ElInput"),m=r("ElFormItem"),x=r("ElButton"),p=h("loading");return f((c(),N("div",H,[l(n(A),{ref_key:"formRef",ref:d,rules:I,model:t.value,"label-width":"110px"},{default:u(()=>[f((c(),_(m,{label:"\u9500\u9879\u53D1\u7968\u53F7\u7801",prop:"InvCode"},{default:u(()=>[C("div",P,[l(y,{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:"\u9500\u9879\u53D1\u7968\u53F7\u7801"},null,8,["modelValue"]),o.value.data?(c(),_(n(V),{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",S,[l(x,{type:"primary",onClick:k},{default:u(()=>e[3]||(e[3]=[T(" \u4FDD\u5B58 ")])),_:1})])]),_:1})]),_:1},8,["model"]),l(j,{visible:o.value.visible,"onUpdate:visible":e[2]||(e[2]=s=>o.value.visible=s),onSubmit:w},null,8,["visible"])])),[[p,n(v).loading]])}}});var W=B($,[["__file","D:/work/jiesuan/settle-vue3/src/views/supplyNew/invoiceRelation/components/return-form.vue"]]);export{W as default};
