return-form.fd8662.js 2.1 KB

1
  1. 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 y,l,D as u,G as _,h as C,aN as N,a as R,M as V,aQ as T,aZ as U}from"./index.js";import M from"./index.d8f51d.js";import{b as j,d as A}from"./index.ff7eb665.js";import{i as q}from"./ticketReturn.6df30604.js";import"./porder.9a85976d.js";import"./index.2fb9f37c.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:""}),D={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/invoiceRelation")}});async function I(){try{await d.value.validate();const{InvCode:a}=t.value;v.run(j({InvCode:a}))}catch{}}async function h(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(),y("div",G,[l(n(T),{ref_key:"formRef",ref:d,rules:D,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(N),{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:I},{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:h},null,8,["visible"])])),[[p,n(v).loading]])}}});var O=x(Q,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/supply/invoiceRelation/components/return-form.vue"]]);export{O as default};