import{_ as h,d as w,k as x,n as i,di as E,cm as g,r,aw as y,B as p,i as n,o as c,c as N,h as l,y as u,A as _,e as C,ca as R,a as V,H as T,cd as A}from"./index.js";import j from"./index.fcef8c.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]"},$=w({__name:"return-form",setup(z){const b=x(),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=E({success(){g.success("\u521B\u5EFA\u6210\u529F!"),b.push("/purchase/invoiceRelation")}});async function k(){try{await d.value.validate();const{InvCode:a}=t.value;v.run(M({InvCode:a}))}catch{}}async function B(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 D=r("ElInput"),m=r("ElFormItem"),F=r("ElButton"),f=y("loading");return p((c(),N("div",H,[l(n(A),{ref_key:"formRef",ref:d,rules:I,model:t.value,"label-width":"110px"},{default:u(()=>[p((c(),_(m,{label:"\u8FDB\u9879\u53D1\u7968\u53F7\u7801",prop:"InvCode"},{default:u(()=>[C("div",P,[l(D,{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(R),{key:0,class:"mt-[10px]",data:o.value.data,columns:n(q)},null,8,["data","columns"])):V("v-if",!0)])]),_:1})),[[f,o.value.loading]]),l(m,null,{default:u(()=>[C("div",S,[l(F,{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:B},null,8,["visible"])])),[[f,n(v).loading]])}}});var W=h($,[["__file","D:/work/jiesuan/settle-vue3/src/views/purchase/invoiceRelation/components/return-form.vue"]]);export{W as default};
