import{_ as T,d as O,w as m,v as Y,r as h,o as d,G as B,C,u as k,a as w,l as A,c as j,F as G,D as H,bw as L,M as z,aY as c,bn as W}from"./index.56c69f5a.js";import{k as q}from"./index.126bf4a4.js";import{e as J}from"./execl-upload.240c34a2.js";import{f as S}from"./status.2df4810d.js";import"./xlsx.ed122d16.js";const b=["\u53D1\u7968\u7533\u8BF7\u7F16\u7801","\u53D1\u7968\u7C7B\u578B","\u53D1\u7968\u4EE3\u7801","\u53D1\u7968\u53F7\u7801","\u4EF7\u7A0E\u5408\u8BA1","\u53D1\u7968\u91D1\u989D","\u6821\u9A8C\u7801","\u5F00\u7968\u65E5\u671F"],K={value0:"invNo",value1:"inv_type",value2:"inv_code",value3:"inv_number",value4:"inv_total",value5:"inv_subtotal",value6:"check_code",value7:"open_date"},Q=()=>{const g=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"}];return b.forEach((y,p)=>{g.push({prop:"value"+p,label:y,minWidth:p===0||p===1?"120px":"90px"})}),g};const R={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},X=O({__name:"index",emits:["onSuccess"],setup(g,{expose:y,emit:p}){const f=m(!1),u=m(!1),s=m([]),V=Q(),{logout:N}=Y(),U=S.map(({label:l})=>l),x=m(1),$=l=>`\u5BFC\u5165\u6570\u636E\u7B2C ${l} \u884C \u53D1\u7968\u7C7B\u578B\u683C\u5F0F\u4E0D\u6B63\u786E,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A${U.join(",")}`,I=({results:l,header:o})=>{if(u.value=!0,l.length===0){c.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),u.value=!1;return}let a=!0;if(o.length!==b.length?a=!1:b.forEach((n,t)=>{n!==o[t]&&(a=!1)}),!a){c.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),u.value=!1;return}s.value=[];for(const n of l){const t=Object.values(n);let r={};t.forEach((_,v)=>{r["value"+v]=_+""}),s.value.push(r)}u.value=!1},M=async()=>{if(u.value)return;u.value=!0;const l=[],o=[],a=[],n=[],t=[],r=[];if(s.value.forEach(e=>{const i={};for(let F in e){const E=K[F],D=e[F];i[E]=D}l.push(i)}),l.forEach((e,i)=>{const{inv_type:F}=e,E=S.find(({label:D})=>D===F.trim());E?e.inv_type=E.value:o.push(i+1),(e.inv_type==="electronic"||e.inv_type==="normal")&&!e.check_code&&a.push(i+1),(e.inv_type==="fully_digitalized_special_electronic"||e.inv_type==="fully_digitalized_normal_electronic")&&String(e.inv_total).trim()===""&&n.push(i+1),(e.inv_type==="fully_digitalized_special_electronic"||e.inv_type==="fully_digitalized_normal_electronic")&&String(e.open_date).trim()===""&&r.push(i+1),(e.inv_type==="fully_digitalized_special_electronic"||e.inv_type==="fully_digitalized_normal_electronic")&&String(e.inv_number).trim()===""&&t.push(i+1)}),a.length>0){c.error(`\u7B2C ${a.join(",")} \u884C\u6821\u9A8C\u7801\u4E0D\u80FD\u4E3A\u7A7A`),u.value=!1;return}if(n.length>0){c.error(`\u7B2C ${n.join(",")} \u884C\uFF0C\u5168\u7535\u7968\u4EF7\u7A0E\u5408\u8BA1\u4E0D\u80FD\u4E3A\u7A7A`),u.value=!1;return}if(r.length>0){c.error(`\u7B2C ${r.join(",")} \u884C\uFF0C\u5168\u7535\u7968\u5F00\u7968\u65E5\u671F\u4E0D\u80FD\u4E3A\u7A7A`),u.value=!1;return}if(t.length>0){c.error(`\u7B2C ${t.join(",")} \u884C\uFF0C\u5168\u7535\u7968\u53D1\u7968\u53F7\u7801\u4E0D\u80FD\u4E3A\u7A7A`),u.value=!1;return}if(o.length>0){c.error($(o.join(","))),u.value=!1;return}const{code:_,message:v}=await q({data:l});u.value=!1,W({code:_,message:v,logout:N,handler:()=>{c.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),p("onSuccess"),f.value=!1,x.value=1}})},P=()=>{s.value=[],x.value=1};return y({onDisplay:()=>(f.value=!0,s.value=[])}),(l,o)=>{const a=h("el-table-column"),n=h("el-table"),t=h("el-button"),r=h("el-dialog");return d(),B(r,{"close-on-click-modal":!1,modelValue:f.value,"onUpdate:modelValue":o[0]||(o[0]=_=>f.value=_),title:"\u6279\u91CF\u5BFC\u5165\u8D22\u52A1\u5F00\u7968\u7ED3\u679C(\u53D1\u7968\u7533\u8BF7\uFF09",width:"1040px",top:"8vh",center:""},{default:C(()=>[s.value.length===0?(d(),B(k(J),{key:0,onOnSuccess:I})):w("v-if",!0),A(n,{data:s.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:C(()=>[(d(!0),j(G,null,H(k(V),(_,v)=>(d(),B(a,L(_,{key:v,"show-overflow-tooltip":""}),null,16))),128))]),_:1},8,["data"]),s.value.length!==0?(d(),j("div",R,[A(t,{size:"small",onClick:P},{default:C(()=>[z("\u53D6\u6D88")]),_:1}),A(t,{size:"small",type:"primary",loading:u.value,onClick:M},{default:C(()=>[z("\u4FDD\u5B58")]),_:1},8,["loading"])])):w("v-if",!0)]),_:1},8,["modelValue"])}}});var oe=T(X,[["__scopeId","data-v-1e20f0dd"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/components/execl-files-upload/index.vue"]]);export{oe as default};
