choose-modal.b6a665.js 2.1 KB

1
  1. import{_ as F,d as U,aV as w,bU as g,x as i,A as I,z as M,r as d,o as T,G as A,D as v,l as f,m as N,h as R,M as j,ar as q,aZ as _}from"./index.js";import{h as z}from"./index.2fb9f37c.js";import{I as G}from"./index.1e471a82.js";const P={class:"flex w-full justify-end mt-[10px]"},S=U({__name:"choose-modal",props:{visible:{type:Boolean,required:!0},data:{type:null,required:!0}},emits:["refresh"],setup(r,{emit:y}){const l=r,o=w(l,"visible"),C=g({success(){_.success("\u7ED1\u5B9A\u6210\u529F!"),o.value=!1,y("refresh")}}),c=i(null),e=i({companyNo:"",supplierNo:"",companyName:"",supplierName:""});i(null);async function h(){const{id:u,InvCode:a,invoice_code:s,invoice_type:t,invoice_total:n,invoice_number:b,invoice_subtotal:k,check_code:x,open_date:D,status:E}=l.data,{companyNo:p,supplierNo:m}=e.value;if(!p||!m){_.warning("\u8BF7\u9009\u62E9\u4E70\u5165\u65B9\u516C\u53F8\u548C\u5356\u51FA\u65B9\u516C\u53F8");return}const V={id:u,InvCode:a,invoice_code:s,invoice_number:b,invoice_type:t,invoice_total:n,open_date:D,invoice_subtotal:k,check_code:x,status:E,companyNo:p,supplierNo:m};C.run(z(V))}const B=()=>e.value={companyNo:"",supplierNo:"",companyName:"",supplierName:""};return I(()=>o.value,()=>{if(!o.value)return;const{companyNo:u,supplierNo:a,companyName:s,supplierName:t}=l.data||{};e.value.companyNo=u,e.value.supplierNo=a,e.value.companyName=s,e.value.supplierName=t,M(()=>c.value.initialData())},{immediate:!0}),(u,a)=>{const s=d("ElButton"),t=d("ElDialog");return T(),A(t,{modelValue:N(o),"onUpdate:modelValue":a[1]||(a[1]=n=>q(o)?o.value=n:null),center:"",onClose:B,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:v(()=>[f(N(G),{ref_key:"invoiceCompanyUpdateRef",ref:c,data:e.value,"onUpdate:data":a[0]||(a[0]=n=>e.value=n),invNumber:r.data.invoice_number,type:"purchase"},null,8,["data","invNumber"]),R("div",P,[f(s,{type:"primary",size:"small",onClick:h},{default:v(()=>[j(" \u4FDD\u5B58 ")]),_:1})])]),_:1},8,["modelValue"])}}});var K=F(S,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/purchase/inputInvoicePool/choose-modal.vue"]]);export{K as default};