import{_ as U,d as z,w as F,v as W,r as p,o as n,G as B,C as i,u as f,a as y,l as h,c as _,F as j,D as H,L as b,M as C,aW as m,bz as D,bm as q,Q as L,R as M,b as O}from"./index.0bc83371.js";import{f as G}from"./index.e48cc546.js";import{e as Q}from"./execl-upload.cc28de33.js";import"./xlsx.ed122d16.js";const E=["\u6536\u6B3E\u65B9\u516C\u53F8\u7F16\u7801","\u6536\u6B3E\u65B9\u516C\u53F8\u540D\u79F0","\u8D44\u91D1\u7F16\u7801","\u8BA2\u5355\u7F16\u7801","\u8BA4\u9886\u8D44\u91D1"],R=["\u6536\u6B3E\u65B9\u516C\u53F8\u7F16\u7801","\u8D44\u91D1\u7F16\u7801","\u8BA2\u5355\u7F16\u7801","\u8BA4\u9886\u8D44\u91D1"],T=["companyNo","tradNo","orderCode","trad_fee"],J=()=>[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"},{prop:"companyNo",label:"\u6536\u6B3E\u65B9\u516C\u53F8\u7F16\u7801"},{prop:"companyName",label:"\u6536\u6B3E\u65B9\u516C\u53F8\u540D\u79F0"},{prop:"tradNo",label:"\u8D44\u91D1\u7F16\u7801"},{prop:"orderCode",label:"\u8BA2\u5355\u7F16\u7801"},{prop:"trad_fee",label:"\u8BA4\u9886\u8D44\u91D1"}];const K=c=>(L("data-v-5811f155"),c=c(),M(),c),P={key:0},X={key:1},Y=K(()=>O("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),Z={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},$=z({__name:"index",emits:["onSuccess"],setup(c,{expose:x,emit:g}){const d=F(!1),u=F(!1),t=F([]),N=J(),{logout:k}=W(),A=()=>{},w=({results:r,header:s})=>{if(u.value=!0,r.length===0){m.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),u.value=!1;return}let o=!0;if(s.length!==E.length?o=!1:E.forEach((l,e)=>{l!==s[e]&&(o=!1)}),!o){m.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),u.value=!1;return}t.value=[];try{r.forEach(l=>{const e=Object.values(l);let v={companyNo:e[0],companyName:e[1],tradNo:e[2],orderCode:e[3],trad_fee:e[4]};t.value.push(v)}),u.value=!1}catch{m.error("\u5BFC\u5165\u6570\u636E\u62FC\u63A5\u6709\u8BEF\uFF01"),u.value=!1}},S=async()=>{if(u.value)return;u.value=!0;let r=!0;if(t.value.forEach(l=>{for(let e in l)T.includes(e)&&!l[e]&&(r=!1)}),!r){D({title:"\u5FC5\u586B\u5B57\u6BB5\u7F3A\u5931\uFF01",type:"error"}),u.value=!1;return}const{code:s,message:o}=await G({list:f(t)});q({code:s,message:o,logout:k,handler:()=>{u.value=!1,m.success("\u8BA2\u5355\u8BA4\u6B3E\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),g("onSuccess"),d.value=!1},error:()=>{u.value=!1,D({title:o,type:"error"})}})},V=()=>{t.value=[]};return x({onDisplay:()=>(d.value=!0,t.value=[])}),(r,s)=>{const o=p("el-table-column"),l=p("el-table"),e=p("el-button"),v=p("el-dialog");return n(),B(v,{"close-on-click-modal":!1,modelValue:d.value,"onUpdate:modelValue":s[0]||(s[0]=a=>d.value=a),title:"\u5BFC\u5165\u8BA2\u5355\u8BA4\u6B3E\u6570\u636E",width:"1040px",top:"8vh",center:"",onClose:A},{default:i(()=>[t.value.length===0?(n(),B(f(Q),{key:0,onOnSuccess:w})):y("v-if",!0),h(l,{data:t.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:i(()=>[(n(!0),_(j,null,H(f(N),(a,I)=>(n(),B(o,{type:a.type,minWidth:a.minWidth,fixed:a.fixed,key:I,prop:a.prop,"show-overflow-tooltip":""},{header:i(()=>[!f(R).includes(a.label)||a.label==="\u5E8F\u53F7"?(n(),_("span",P,b(a.label),1)):(n(),_("p",X,[Y,C(" "+b(a.label),1)]))]),_:2},1032,["type","minWidth","fixed","prop"]))),128))]),_:1},8,["data"]),t.value.length!==0?(n(),_("div",Z,[h(e,{size:"small",onClick:V},{default:i(()=>[C("\u53D6\u6D88")]),_:1}),h(e,{size:"small",type:"primary",loading:u.value,onClick:S},{default:i(()=>[C("\u4FDD\u5B58")]),_:1},8,["loading"])])):y("v-if",!0)]),_:1},8,["modelValue"])}}});var le=U($,[["__scopeId","data-v-5811f155"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/capitalClaim/components/execl-capital-files-upload/index.vue"]]);export{le as default};