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