1 |
- import{_ as P,d as R,E as h,a5 as q,aC as I,x as F,o as i,N as x,K as v,u as E,a as w,y as N,c as y,M as K,L as G,W as A,aS as p,T as j,b as J}from"./index.1417328f.js";import{e as Q}from"./execl-upload.2ed330c3.js";import{g as X}from"./index.28d5e629.js";import{h as V}from"./status.727086c1.js";import"./xlsx.ed122d16.js";const k=["\u5356\u65B9\u516C\u53F8\u7F16\u7801","\u5BF9\u8D26\u7F16\u53F7","\u53D1\u7968\u7C7B\u578B","\u53D1\u7968\u4EE3\u7801","\u53D1\u7968\u53F7\u7801","\u53D1\u7968\u7A0E\u524D\u91D1\u989D","\u5F00\u7968\u65E5\u671F","\u6821\u9A8C\u7801(\u7535\u5B50\u7968\u5FC5\u586B,\u5168\u7535\u7968\u4E0D\u9700\u8981)"],T={value0:"supplierNo",value1:"payNo",value2:"invoiceType",value3:"invoiceCode",value4:"invoiceNumber",value5:"inv_subtotal_amount",value6:"open_time",value7:"checkNumber"},Y=[],Z=()=>{const C=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"}];return k.forEach((g,f)=>{C.push({prop:"value"+f,label:g,minWidth:f===0||f===1?"120px":"90px"})}),C},ee={key:0},ue={key:1},te=J("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1),ae={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},oe=A("\u53D6\u6D88"),le=A("\u4FDD\u5B58"),se=R({__name:"index",emits:["onSuccess"],setup(C,{expose:g,emit:f}){const m=h(!1),a=h(!1),n=h([]),U=Z(),W=V.map(({label:t})=>t),S=h(1),z=t=>`\u5BFC\u5165\u6570\u636E\u7B2C ${t} \u884C \u53D1\u7968\u7C7B\u578B\u683C\u5F0F\u4E0D\u6B63\u786E,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A${W.join(",")}`,{currentCompany:B}=q(),M=I(),H=({results:t,header:o})=>{if(a.value=!0,t.length===0){p.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),a.value=!1;return}let l=!0;if(o.length!==k.length?l=!1:k.forEach((r,s)=>{r!==o[s]&&(l=!1)}),!l){p.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),a.value=!1;return}n.value=[];for(const r of t){const s=Object.values(r);let d={};s.forEach((e,u)=>{d["value"+u]=e+""}),n.value.push(d),S.value=S.value+1}a.value=!1},$=async()=>{if(a.value)return;a.value=!0;const t=[];n.value.forEach((u,D)=>{const _={};for(let c in u){const b=T[c],O=u[c];_[b]=O}t.push(_)});const o=[],l=[];if(t.forEach((u,D)=>{const _=u.invoiceType.trim(),c=V.find(({label:b})=>b===_);c?(u.invoiceType=c.value,(c.value==="normal"||c.value==="electronic")&&!u.checkNumber&&l.push(String(D+1))):o.push(String(D+1))}),o.length>0){p({type:"error",message:z(o.join(","))}),a.value=!1;return}if(l.length>0){p({type:"error",message:`\u7B2C ${l.join(",")} \u884C,\u6821\u9A8C\u7801\u4E0D\u80FD\u4E3A\u7A7A\u3002`}),a.value=!1;return}const r=t.map(({supplierNo:u})=>u),s=[...new Set(r)];if(s.length>1){p.error("\u5356\u65B9\u516C\u53F8\u7F16\u7801\u4E0D\u4E00\u81F4"),a.value=!1;return}if(s[0]!==B.value.companyNo){p.error("\u5356\u65B9\u516C\u53F8\u7F16\u7801\u4E0E\u5F53\u524D\u9009\u62E9\u7684\u516C\u53F8\u4E0D\u4E00\u81F4"),a.value=!1;return}t.forEach(u=>{delete u.supplierNo});const{code:d,message:e}=await X({list:t,companyNo:B.value.companyNo,relaComNo:B.value.companyNo});a.value=!1,M({code:d,message:e,noMessage:!1,handler:()=>{p.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),f("onSuccess"),m.value=!1}})},L=()=>{n.value=[]};return g({onDisplay:()=>(m.value=!0,n.value=[])}),(t,o)=>{const l=F("el-table-column"),r=F("el-table"),s=F("el-button"),d=F("el-dialog");return i(),x(d,{modelValue:m.value,"onUpdate:modelValue":o[0]||(o[0]=e=>m.value=e),title:"\u5BFC\u5165\u6279\u91CF\u5F00\u7968\u6570\u636E",width:"1040px",top:"8vh",center:""},{default:v(()=>[n.value.length===0?(i(),x(E(Q),{key:0,onOnSuccess:H})):w("v-if",!0),N(r,{data:n.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:v(()=>[(i(!0),y(G,null,K(E(U),(e,u)=>(i(),x(l,{type:e.type,minWidth:e.minWidth,fixed:e.fixed,key:u,prop:e.prop,"show-overflow-tooltip":""},{header:v(()=>[!E(Y).includes(E(T)[e.prop])||e.label==="\u5E8F\u53F7"?(i(),y("span",ee,j(e.label),1)):(i(),y("p",ue,[te,A(" "+j(e.label),1)]))]),_:2},1032,["type","minWidth","fixed","prop"]))),128))]),_:1},8,["data"]),n.value.length!==0?(i(),y("div",ae,[N(s,{size:"small",onClick:L},{default:v(()=>[oe]),_:1}),N(s,{size:"small",type:"primary",loading:a.value,onClick:$},{default:v(()=>[le]),_:1},8,["loading"])])):w("v-if",!0)]),_:1},8,["modelValue"])}}});var de=P(se,[["__file","/Users/apple/Desktop/Company Projects/accout-vue3-ui/src/views/supply/ticketReturn/components/execl-files-upload/index.vue"]]);export{de as default};
|