index.0caf10.js 3.7 KB

1
  1. import{_ as U,d as z,x as v,w as W,r as d,o as n,G as B,D as i,m as f,a as y,l as h,c as _,F as j,E as H,L as x,M as C,aZ as m,bW as E,bx as q,Q as L,R as M,h as O}from"./index.js";import{f as G}from"./index.bccd7610.js";import{e as Q}from"./execl-upload.959bd5d6.js";import"./xlsx.ed122d16.js";const D=["\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"],Z=()=>[{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 J=c=>(L("data-v-5811f155"),c=c(),M(),c),K={key:0},P={key:1},X=J(()=>O("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),Y={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},$=z({__name:"index",emits:["onSuccess"],setup(c,{expose:b,emit:g}){const p=v(!1),u=v(!1),l=v([]),N=Z(),{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!==D.length?o=!1:D.forEach((t,e)=>{t!==s[e]&&(o=!1)}),!o){m.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),u.value=!1;return}l.value=[];try{r.forEach(t=>{const e=Object.values(t);let F={companyNo:e[0],companyName:e[1],tradNo:e[2],orderCode:e[3],trad_fee:e[4]};l.value.push(F)}),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(l.value.forEach(t=>{for(let e in t)T.includes(e)&&!t[e]&&(r=!1)}),!r){E({title:"\u5FC5\u586B\u5B57\u6BB5\u7F3A\u5931\uFF01",type:"error"}),u.value=!1;return}const{code:s,message:o}=await G({list:f(l)});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"),p.value=!1},error:()=>{u.value=!1,E({title:o,type:"error"})}})},V=()=>{l.value=[]};return b({onDisplay:()=>(p.value=!0,l.value=[])}),(r,s)=>{const o=d("el-table-column"),t=d("el-table"),e=d("el-button"),F=d("el-dialog");return n(),B(F,{"close-on-click-modal":!1,"close-on-press-escape":!1,modelValue:p.value,"onUpdate:modelValue":s[0]||(s[0]=a=>p.value=a),title:"\u5BFC\u5165\u8BA2\u5355\u8BA4\u6B3E\u6570\u636E",width:"1040px",top:"8vh",center:"",onClose:A},{default:i(()=>[l.value.length===0?(n(),B(f(Q),{key:0,onOnSuccess:w})):y("v-if",!0),h(t,{data:l.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",K,x(a.label),1)):(n(),_("p",P,[X,C(" "+x(a.label),1)]))]),_:2},1032,["type","minWidth","fixed","prop"]))),128))]),_:1},8,["data"]),l.value.length!==0?(n(),_("div",Y,[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 te=U($,[["__scopeId","data-v-5811f155"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/capitalClaim/components/execl-capital-files-upload/index.vue"]]);export{te as default};