index.18ed087e.js 3.7 KB

1
  1. import{_ as I,d as U,E as B,D as W,x as _,o as c,N as E,K as p,u as D,a as y,y as x,c as v,M as z,L as j,W as C,aS as F,b9 as H,ba as q,T as g,$ as L,a0 as M,b as O}from"./index.1417328f.js";import{e as T}from"./index.644f3a37.js";import{e as K}from"./execl-upload.2ed330c3.js";import"./xlsx.ed122d16.js";const b=["\u6536\u6B3E\u65B9\u516C\u53F8\u7F16\u53F7","\u6536\u6B3E\u65B9\u516C\u53F8\u540D\u79F0","\u6536\u6B3E\u65B9\u8D26\u6237","\u4EA4\u6613\u65F6\u95F4","\u6536\u5165\u91D1\u989D","\u8D26\u53F7\u4F59\u989D","\u4EA4\u6613\u884C\u540D","\u5BF9\u65B9\u7701\u5E02","\u5BF9\u65B9\u8D26\u53F7","\u5BF9\u65B9\u6237\u540D","\u4EA4\u6613\u7528\u9014"],P=["\u6536\u6B3E\u65B9\u516C\u53F8\u7F16\u53F7","\u6536\u6B3E\u65B9\u8D26\u6237","\u4EA4\u6613\u65F6\u95F4","\u6536\u5165\u91D1\u989D","\u4EA4\u6613\u884C\u540D","\u5BF9\u65B9\u8D26\u53F7","\u5BF9\u65B9\u6237\u540D"],$=["value0","value2","value3","value4","value6","value8","value9"],G=()=>{const s=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"}];return b.forEach((m,d)=>{s.push({prop:"value"+d,label:m,minWidth:d===0||d===1?"120px":"90px"})}),s};const J=s=>(L("data-v-b450d560"),s=s(),M(),s),Q={key:0},R={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=C("\u53D6\u6D88"),ee=C("\u4FDD\u5B58"),ue=U({__name:"index",emits:["onSuccess"],setup(s,{expose:m,emit:d}){const f=B(!1),u=B(!1),t=B([]),k=G(),{logout:S}=W(),w=()=>{},A=({results:i,header:l})=>{if(u.value=!0,i.length===0){F.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),u.value=!1;return}let n=!0;if(l.length!==b.length?n=!1:b.forEach((o,a)=>{o!==l[a]&&(n=!1)}),!n){F.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),u.value=!1;return}t.value=[];try{i.forEach(o=>{const a=Object.values(o);let r={};a.forEach((e,h)=>{r["value"+h]=e+""}),t.value.push(r)}),u.value=!1}catch{F.error("\u5BFC\u5165\u6570\u636E\u62FC\u63A5\u6709\u8BEF\uFF01"),u.value=!1}},N=async()=>{if(u.value)return;u.value=!0;let i=!0,l=[];if(t.value.forEach(a=>{let r=[];for(let e in a)$.includes(e)&&!a[e]&&(i=!1),r.push(a[e]);l.push(r)}),!i){H({title:"\u5FC5\u586B\u5B57\u6BB5\u7F3A\u5931\uFF01",type:"error"}),u.value=!1;return}const{code:n,message:o}=await T({data:l});q({code:n,message:o,logout:S,handler:()=>{u.value=!1,F.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),d("onSuccess"),f.value=!1}})},V=()=>{t.value=[]};return m({onDisplay:()=>(f.value=!0,t.value=[])}),(i,l)=>{const n=_("el-table-column"),o=_("el-table"),a=_("el-button"),r=_("el-dialog");return c(),E(r,{modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=e=>f.value=e),title:"\u5BFC\u5165\u5BA2\u6237\u4ED8\u6B3E\u8D44\u91D1\u6570\u636E",width:"1040px",top:"8vh",center:"",onClose:w},{default:p(()=>[t.value.length===0?(c(),E(D(K),{key:0,onOnSuccess:A})):y("v-if",!0),x(o,{data:t.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:p(()=>[(c(!0),v(j,null,z(D(k),(e,h)=>(c(),E(n,{type:e.type,minWidth:e.minWidth,fixed:e.fixed,key:h,prop:e.prop,"show-overflow-tooltip":""},{header:p(()=>[!D(P).includes(e.label)||e.label==="\u5E8F\u53F7"?(c(),v("span",Q,g(e.label),1)):(c(),v("p",R,[X,C(" "+g(e.label),1)]))]),_:2},1032,["type","minWidth","fixed","prop"]))),128))]),_:1},8,["data"]),t.value.length!==0?(c(),v("div",Y,[x(a,{size:"small",onClick:V},{default:p(()=>[Z]),_:1}),x(a,{size:"small",type:"primary",loading:u.value,onClick:N},{default:p(()=>[ee]),_:1},8,["loading"])])):y("v-if",!0)]),_:1},8,["modelValue"])}}});var se=I(ue,[["__scopeId","data-v-b450d560"],["__file","/Users/apple/Desktop/Company Projects/accout-vue3-ui/src/views/InvoiceSales/capitalClaim/components/execl-files-upload/index.vue"]]);export{se as default};