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