1 |
- import{_ as w,d as U,aV as F,bU as g,x as i,A as I,z as M,r as d,o as T,G as R,D as v,l as f,m as N,h as j,M as q,ar as z,aZ as y}from"./index.js";import{h as A}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:_}){const l=r,o=F(l,"visible"),C=g({success(){y.success("\u7ED1\u5B9A\u6210\u529F!"),o.value=!1,_("refresh")}}),p=i(null),e=i({companyNo:"",supplierNo:"",companyName:"",supplierName:""});i(null);async function B(){const{id:u,InvCode:a,invoice_code:s,invoice_type:t,invoice_total:n,invoice_number:h,invoice_subtotal:D,check_code:k,open_date:x,status:E}=l.data,{companyNo:c,supplierNo:m}=e.value;if(!c||!m){y.warning("\u8BF7\u9009\u62E9\u8D2D\u4E70\u65B9\u516C\u53F8\u548C\u9500\u552E\u65B9\u516C\u53F8");return}const V={id:u,InvCode:a,invoice_code:s,invoice_number:h,invoice_type:t,invoice_total:n,open_date:x,invoice_subtotal:D,check_code:k,status:E,companyNo:c,supplierNo:m};C.run(A(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(()=>p.value.initialData())},{immediate:!0}),(u,a)=>{const s=d("ElButton"),t=d("ElDialog");return T(),R(t,{modelValue:N(o),"onUpdate:modelValue":a[1]||(a[1]=n=>z(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:p,data:e.value,"onUpdate:data":a[0]||(a[0]=n=>e.value=n),invNumber:r.data.invoice_number,type:"purchase"},null,8,["data","invNumber"]),j("div",P,[f(s,{type:"primary",size:"small",onClick:B},{default:v(()=>[q(" \u4FDD\u5B58 ")]),_:1})])]),_:1},8,["modelValue"])}}});var K=w(S,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/supplyNew/inputInvoicePool/choose-modal.vue"]]);export{K as default};
|