import{_ as M,d as j,w as y,aQ as S,aW as T,r as C,o as n,G as b,C as p,l as i,a as B,j as D,c as m,F as z,D as A,L as E,h as U,M as x,aJ as k,a6 as R,aR as H,aq as F}from"./index.js";import{h as L}from"./index.a1a29d62.js";import{e as G}from"./execl-upload.1cb51bca.js";const I={value0:"companyNo",value1:"companyName",value2:"supplierNo",value3:"supplierName",value4:"payNo",value5:"invoiceType",value6:"invoiceCode",value7:"invoiceNumber",value8:"inv_subtotal_amount",value9:"inv_total",value10:"open_time",value11:"checkNumber"},v=[{label:"\u8D2D\u4E70\u65B9\u7EB3\u7A0E\u53F7",prop:"TODO1",minWidth:"100px",reuqired:!0,defaultData:""},{label:"\u5546\u54C1\u7F16\u53F7",prop:"TODO2",minWidth:"100px",reuqired:!0,defaultData:""},{label:"\u76D8\u70B9\u6570\u91CF",prop:"TODO3",minWidth:"100px",reuqired:!0,defaultData:""}];v.slice(1).reduce((f,c)=>({...f,[c.label]:c.defaultData?c.defaultData:""}),{});const J={key:0},P={key:1},Q={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},K=j({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["onSuccess"],setup(f,{emit:c}){const l=y(!1),o=y([]),N=f,w=c,g=y(1),d=S(N,"visible"),O=T(),V=({results:r,header:a})=>{if(l.value=!0,r.length===0){F.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),l.value=!1;return}let u=!0;if(a.length!==v.length-1?u=!1:v.slice(1).forEach((t,e)=>{t.label!==a[e]&&(u=!1)}),!u){F.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),l.value=!1;return}o.value=[];for(const t of r){const e=Object.values(t);let s={};e.forEach((h,_)=>{s["value"+_]=h+""}),o.value.push(s),g.value=g.value+1}o.value.forEach(t=>{const e={};for(let s in t){const h=I[s],_=t[s];e[h]=_}}),l.value=!1},W=async()=>{try{if(l.value)return;l.value=!0;const r=[],{code:a,message:u,data:t}=await L({list:r,companyNo:"",is_comon:"0"});l.value=!1,O({code:a,message:u,noMessage:!1,handler:()=>{F.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),w("onSuccess"),d.value=!1}})}catch{}},q=()=>{o.value=[]};return(r,a)=>{const u=C("el-table-column"),t=C("el-table");return n(),b(i(H),{modelValue:i(d),"onUpdate:modelValue":a[0]||(a[0]=e=>R(d)?d.value=e:null),"close-on-click-modal":!1,title:"\u6279\u91CF\u521B\u5EFA\u76D8\u70B9",width:"1040px",top:"8vh",center:""},{default:p(()=>[o.value.length===0?(n(),b(i(G),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:V})):B("v-if",!0),D(t,{data:o.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:p(()=>[(n(!0),m(z,null,A(i(v),(e,s)=>(n(),b(u,{minWidth:e.minWidth,"show-overflow-tooltip":"",fixed:e.fixed,prop:e.prop,type:e.type,key:s},{header:p(()=>[e.reuqired?(n(),m("p",P,[a[1]||(a[1]=U("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),x(" "+E(e.label),1)])):(n(),m("span",J,E(e.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),o.value.length!==0?(n(),m("div",Q,[D(i(k),{size:"small",onClick:q},{default:p(()=>a[2]||(a[2]=[x("\u53D6\u6D88")])),_:1}),D(i(k),{size:"small",type:"primary",loading:l.value,onClick:W},{default:p(()=>a[3]||(a[3]=[x("\u4FDD\u5B58")])),_:1},8,["loading"])])):B("v-if",!0)]),_:1},8,["modelValue"])}}});var $=M(K,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inventoryCheck/components/BatchCreateModal/index.vue"]]);export{$ as default};
