1 |
- import{_ as I,d as O,F as f,E as M,y as m,o as d,O as C,L as h,u as B,V as b,z as D,c as k,N as P,M as T,Z as A,aQ as p,bh as L,br as $}from"./index.8fc9dcce.js";import{g as H}from"./index.2ee44b4c.js";import{e as Q}from"./execl-upload.8a4e41a3.js";import{x as w}from"./status.ba9896fa.js";const g=["\u53D1\u7968\u7533\u8BF7\u7F16\u53F7","\u53D1\u7968\u7C7B\u578B","\u53D1\u7968\u4EE3\u7801","\u53D1\u7968\u53F7\u7801","\u53D1\u7968\u91D1\u989D","\u53D1\u7968\u7A0E\u540E\u91D1\u989D","\u6821\u9A8C\u7801","\u5F00\u7968\u65E5\u671F"],W={value0:"invNo",value1:"inv_type",value2:"inv_code",value3:"inv_number",value4:"inv_total",value5:"inv_subtotal",value6:"check_code",value7:"open_date"},Y=()=>{const E=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"}];return g.forEach((F,i)=>{E.push({prop:"value"+i,label:F,minWidth:i===0||i===1?"120px":"90px"})}),E};const Z={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},q=A("\u53D6\u6D88"),G=A("\u4FDD\u5B58"),J=O({__name:"index",emits:["onSuccess"],setup(E,{expose:F,emit:i}){const _=f(!1),t=f(!1),o=f([]),V=Y(),{logout:N}=M(),y=w.map(({label:u})=>u),v=f(1),U=u=>`\u5BFC\u5165\u6570\u636E\u7B2C ${u} \u884C \u53D1\u7968\u7C7B\u578B\u683C\u5F0F\u4E0D\u6B63\u786E,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A${y.join(",")}`,j=({results:u,header:s})=>{if(t.value=!0,u.length===0){p.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),t.value=!1;return}let n=!0;if(s.length!==g.length?n=!1:g.forEach((c,e)=>{c!==s[e]&&(n=!1)}),!n){p.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),t.value=!1;return}o.value=[];for(const c of u){const e=Object.values(c);let a={};e.forEach((r,x)=>{a["value"+x]=r+""});const l=a.value1.trim();if(!y.includes(l)){p.error(U(v.value)),v.value=1,o.value=[];break}o.value.push(a),v.value+=1}t.value=!1},S=async()=>{if(t.value)return;t.value=!0;const u=[];o.value.forEach(e=>{const a={};for(let l in e){const r=W[l],x=e[l];a[r]=x}u.push(a)});let s=!0;if(u.forEach(e=>{const{inv_type:a}=e,l=w.find(({label:r})=>r===a.trim());e.inv_type=l.value,e.inv_type.indexOf("\u7535\u5B50")>=0&&!e.check_code&&(s=!1)}),!s){p.error("\u7535\u5B50\u53D1\u7968\u5FC5\u987B\u4E0A\u4F20\u6821\u9A8C\u7801"),t.value=!1;return}const{code:n,message:c}=await H({data:u});t.value=!1,L({code:n,message:c,logout:N,handler:()=>{p.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),i("onSuccess"),_.value=!1,v.value=1}})},z=()=>{o.value=[],v.value=1};return F({onDisplay:()=>(_.value=!0,o.value=[])}),(u,s)=>{const n=m("el-table-column"),c=m("el-table"),e=m("el-button"),a=m("el-dialog");return d(),C(a,{modelValue:_.value,"onUpdate:modelValue":s[0]||(s[0]=l=>_.value=l),title:"\u5BFC\u5165\u8868\u683C\u6570\u636E",width:"1040px",top:"8vh",center:""},{default:h(()=>[o.value.length===0?(d(),C(B(Q),{key:0,onOnSuccess:j})):b("v-if",!0),D(c,{data:o.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:h(()=>[(d(!0),k(T,null,P(B(V),(l,r)=>(d(),C(n,$(l,{key:r,"show-overflow-tooltip":""}),null,16))),128))]),_:1},8,["data"]),o.value.length!==0?(d(),k("div",Z,[D(e,{size:"small",onClick:z},{default:h(()=>[q]),_:1}),D(e,{size:"small",type:"primary",loading:t.value,onClick:S},{default:h(()=>[G]),_:1},8,["loading"])])):b("v-if",!0)]),_:1},8,["modelValue"])}}});var ue=I(J,[["__scopeId","data-v-1e20f0dd"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/components/execl-files-upload/index.vue"]]);export{ue as default};
|