1 |
- import{_ as Z,d as w,m as W,bs as uu,O as eu,bz as lu,r as V,o as f,A as N,x as b,h as d,a as H,f as j,c as g,F as tu,y as au,G as I,e as ou,H as k,bm as U,ac as iu,bt as nu,az as s,bp as C,by as su,a7 as S}from"./index.js";import{e as pu}from"./execl-upload.8692a4ce.js";import{h as ru}from"./index.bbfcc729.js";import{e as z}from"./status.b7512d56.js";const $={value0:"companyNo",value1:"companyName",value2:"supplierNo",value3:"supplierName",value4:"payNo",value5:"invoiceType",value6:"invoiceCode",value7:"invoiceNumber",value8:"inv_subtotal_amount",value9:"inv_total",value10:"open_time",value11:"checkNumber"},cu=[],T=[{type:"index",fixed:"left",label:"\u5E8F\u53F7",width:"50"},{label:"\u4E1A\u52A1\u7F16\u53F7",prop:"TODO1",minWidth:"100px"},{label:"\u7C7B\u578B",prop:"TODO2",minWidth:"100px"},{label:"\u8BA2\u5355\u6765\u6E90",prop:"TODO3",minWidth:"100px"},{label:"\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u8BC6\u522B\u53F7",prop:"TODO4",minWidth:"140px"},{label:"\u9500\u552E\u65B9\u516C\u53F8",prop:"TODO5",minWidth:"100px"},{label:"\u8BA2\u5355\u7F16\u53F7",prop:"TODO6",minWidth:"120px"},{label:"\u8BA2\u5355\u4E3B\u5355\u53F7",prop:"TODO7",minWidth:"120px"},{label:"\u5546\u54C1\u7F16\u53F7",prop:"TODO8",minWidth:"100px"},{label:"\u5546\u54C1\u540D\u79F0",prop:"TODO9",minWidth:"100px"},{label:"\u5355\u4F4D",prop:"TODO10",minWidth:"80px"},{label:"\u5546\u54C1\u6570\u91CF",prop:"TODO11",minWidth:"110px"},{label:"\u5546\u54C1\u6570\u91CF",prop:"TODO11",minWidth:"110px"},{label:"\u5546\u54C1\u5355\u4EF7",prop:"TODO12",minWidth:"110px"},{label:"\u8BA2\u5355\u603B\u91D1\u989D",prop:"TODO13",minWidth:"110px"},{label:"\u7A0E\u76EE",prop:"TODO14",minWidth:"80px"},{label:"\u7A0E\u76EE\u540D\u79F0",prop:"TODO15",minWidth:"100px"},{label:"\u5173\u8054\u91D1\u989D",prop:"TODO16",minWidth:"100px"},{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0",prop:"TODO17",minWidth:"110px"},{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u7EB3\u7A0E\u8BC6\u522B\u53F7",prop:"TODO18",minWidth:"140px"},{label:"\u53D1\u7968\u53F7\u7801",prop:"TODO19",minWidth:"100px"},{label:"\u53D1\u7968\u7C7B\u578B",prop:"TODO20",minWidth:"100px"},{label:"\u9500\u552E\u65B9\u516C\u53F8\u540D\u79F0",prop:"TODO21",minWidth:"110px"},{label:"\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7",prop:"TODO22",minWidth:"140px"},{label:"\u53D1\u7968\u660E\u7EC6ID",prop:"TODO23",minWidth:"110px"},{label:"\u8D27\u7269\u6216\u5E94\u7A0E\u52B3\u52A1\u3001\u670D\u52A1\u540D\u79F0",prop:"TODO24",minWidth:"200px"},{label:"\u7C7B\u76EE\u7F16\u53F7",prop:"TODO25",minWidth:"90px"},{label:"\u89C4\u683C\u578B\u53F7",prop:"TODO27",minWidth:"110px"},{label:"\u5355\u4F4D",prop:"TODO28",minWidth:"80px"},{label:"\u6570\u91CF",prop:"TODO29",minWidth:"80px"},{label:"\u7A0E\u524D\u5355\u4EF7",prop:"TODO30",minWidth:"100px"},{label:"\u7A0E\u524D\u603B\u4EF7",prop:"TODO30",minWidth:"100px"},{label:"\u7A0E\u7387",prop:"TODO31",minWidth:"80px"},{label:"\u7A0E\u540E\u5355\u4EF7",prop:"TODO32",minWidth:"100px"},{label:"\u7A0E\u540E\u603B\u989D",prop:"TODO33",minWidth:"100px"},{label:"\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001",prop:"TODO34",minWidth:"100px"},{label:"\u7A0E\u7387\u72B6\u6001",prop:"TODO35",minWidth:"100px"},{label:"\u5907\u6CE8",prop:"TODO36",minWidth:"80px"},{label:"\u5165\u8D26\u6708\u4EFD",prop:"TODO37",minWidth:"80px"}];T.slice(1).reduce((A,B)=>({...A,[B.label]:B.detaultData?B.defaultData:""}),{});const mu={key:0},du={key:1},Du={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},Eu=w({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["onSuccess"],setup(A,{emit:B}){const l=W(!1),o=W([]),Y=A,q=B,M=W(1),P=z.map(({label:a})=>a),y=uu(Y,"visible"),R=a=>`\u5BFC\u5165\u6570\u636E\u7B2C ${a} \u884C \u53D1\u7968\u7C7B\u578B\u683C\u5F0F\u4E0D\u6B63\u786E,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A${P.join(",")}`,{currentCompany:G}=eu(),L=lu(),J=({results:a,header:n})=>{if(l.value=!0,a.length===0){s.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),l.value=!1;return}let h=!0;if(n.length!==T.length-1?h=!1:T.slice(1).forEach((u,i)=>{u.label!==n[i]&&(h=!1)}),!h){s.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),l.value=!1;return}o.value=[];for(const u of a){const i=Object.values(u);let F={};i.forEach((m,v)=>{F["value"+v]=m+""}),o.value.push(F),M.value=M.value+1}const D=[];o.value.forEach(u=>{const i={};for(let F in u){const m=$[F],v=u[F];i[m]=v}D.push(i)});const t=[],r=[],O=[],e=[],p=[],c=[],E=[],_=C(new Date).format("YYYY-MM-DD");if(D.forEach((u,i)=>{const F=u.invoiceType.trim(),m=z.find(({label:X})=>X===F);m?(u.invoiceType=m.value,(m.value==="normal"||m.value==="electronic")&&!u.checkNumber&&r.push(String(i+1))):t.push(String(i+1));const v=u.invoiceType==="fully_digitalized_special_electronic"||u.invoiceType==="fully_digitalized_normal_electronic";(!u.open_time||u.open_time&&!C(u.open_time).isSame(C(_))&&!C(u.open_time).isBefore(C(_)))&&E.push(String(i+1));const x=/^\d+(\.\d+)?$/;!x.test(u.invoiceCode)&&!v&&O.push(String(i+1)),x.test(u.invoiceNumber)||e.push(String(i+1)),(!x.test(u.inv_subtotal_amount)||Number(u.inv_subtotal_amount)<0)&&!v&&p.push(String(i+1)),(!x.test(u.inv_total)||Number(u.inv_total)<0)&&v&&c.push(String(i+1))}),t.length>0){s({type:"error",message:R(t.join(","))}),l.value=!1;return}if(r.length>0){s({type:"error",message:`\u7B2C ${r.join(",")} \u884C,\u6821\u9A8C\u7801\u4E0D\u80FD\u4E3A\u7A7A\u3002`}),l.value=!1,o.value=[];return}if(O.length>0){s({type:"error",message:`\u7B2C ${O.join(",")} \u884C,\u53D1\u7968\u4EE3\u7801\u5FC5\u987B\u4E3A\u6570\u5B57\u3002`}),l.value=!1,o.value=[];return}if(e.length>0){s({type:"error",message:`\u7B2C ${e.join(",")} \u884C,\u53D1\u7968\u53F7\u7801\u5FC5\u987B\u4E3A\u6570\u5B57\u3002`}),l.value=!1,o.value=[];return}if(p.length>0){s({type:"error",message:`\u7B2C ${p.join(",")} \u884C,\u53D1\u7968\u7A0E\u524D\u91D1\u989D\u5FC5\u987B\u4E3A\u6570\u5B57\u4E14\u4E0D\u80FD\u662F\u8D1F\u6570`}),l.value=!1,o.value=[];return}if(c.length>0){s({type:"error",message:`\u7B2C ${c.join(",")} \u884C,\u53D1\u7968\u7A0E\u540E\u91D1\u989D\u5FC5\u987B\u4E3A\u6570\u5B57\u4E14\u4E0D\u80FD\u662F\u8D1F\u6570`}),l.value=!1,o.value=[];return}if(E.length>0){s({type:"error",message:`\u7B2C ${E.join(",")} \u884C,\u5F00\u7968\u65E5\u671F\u4E0D\u80FD\u4E3A\u7A7A\u4E14\u4E0D\u80FD\u8D85\u8FC7\u5F53\u524D\u65E5\u671F`}),l.value=!1,o.value=[];return}l.value=!1},K=async()=>{try{if(l.value)return;l.value=!0;const a=[];o.value.forEach(e=>{const p={};for(let c in e){const E=$[c],_=e[c];p[E]=_}a.push(p)}),a.forEach(e=>{const p=e.invoiceType.trim(),c=z.find(({label:E})=>E===p);e.invoiceType=c.value});const n=a.map(({supplierNo:e})=>e);if([...new Set(n)].length>1){s.error("\u5356\u65B9\u516C\u53F8\u7F16\u7801\u4E0D\u4E00\u81F4"),l.value=!1;return}const D=a[0].supplierNo;if(D!=G.value.companyNo){s.error("\u5356\u65B9\u516C\u53F8\u7F16\u7801\u4E0E\u5F53\u524D\u9009\u4E2D\u7684\u516C\u53F8\u4E0D\u4E00\u81F4"),l.value=!1;return}a.forEach(e=>{(e.invoiceType==="fully_digitalized_special_electronic"||e.invoiceType==="fully_digitalized_normal_electronic")&&(e.inv_subtotal_amount=e.inv_total),delete e.inv_total,delete e.supplierNo,delete e.supplierName,delete e.companyName,delete e.companyNo});const{code:t,message:r,data:O}=await ru({list:a,companyNo:D,is_comon:"0"});l.value=!1,L({code:t,message:r,noMessage:!1,handler:()=>{s.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),q("onSuccess"),y.value=!1},onError(){Number(t)===10004?su({title:"\u4EE5\u4E0B\u5BF9\u8D26\u5355\u4E0D\u7B26\u5408\u8981\u6C42",message:S("div",null,[S("p",null,"\u5F53\u524D\u529F\u80FD\u4EC5\u652F\u6301\u4E1A\u52A1\u7C7B\u578B\u4E3A\u91C7\u8D2D\u8BA2\u5355\u7684\u5BF9\u8D26\u5355,\u4EE5\u4E0B\u901A\u7528\u8BA2\u5355\u7C7B\u578B\u7684\u5BF9\u8D26\u5355\u4E0D\u652F\u6301\u8BE5\u529F\u80FD\uFF1A"),S("p",null,O.join("\u3001"))])}):s.warning(r)}})}catch{}},Q=()=>{o.value=[]};return(a,n)=>{const h=V("el-table-column"),D=V("el-table");return f(),N(d(nu),{modelValue:d(y),"onUpdate:modelValue":n[0]||(n[0]=t=>iu(y)?y.value=t:null),"close-on-click-modal":!1,title:"\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:""},{default:b(()=>[o.value.length===0?(f(),N(d(pu),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:J})):H("v-if",!0),j(D,{data:o.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:b(()=>[(f(!0),g(tu,null,au(d(T),(t,r)=>(f(),N(h,{minWidth:t.minWidth,"show-overflow-tooltip":"",fixed:t.fixed,prop:t.prop,type:t.type,key:r},{header:b(()=>[!d(cu).includes(d($)[t.prop])||t.label==="\u5E8F\u53F7"?(f(),g("span",mu,I(t.label),1)):(f(),g("p",du,[n[1]||(n[1]=ou("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),k(" "+I(t.label),1)]))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),o.value.length!==0?(f(),g("div",Du,[j(d(U),{size:"small",onClick:Q},{default:b(()=>n[2]||(n[2]=[k("\u53D6\u6D88")])),_:1}),j(d(U),{size:"small",type:"primary",loading:l.value,onClick:K},{default:b(()=>n[3]||(n[3]=[k("\u4FDD\u5B58")])),_:1},8,["loading"])])):H("v-if",!0)]),_:1},8,["modelValue"])}}});var Bu=Z(Eu,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/summary/components/OrderImportModal/index.vue"]]);export{Bu as default};
|