1 |
- import{_ as H,d as P,w as B,aP as R,X as L,aR as G,r as A,o as c,G as C,C as F,l as r,a as N,j as T,c as h,F as J,D as Q,L as k,h as X,M as y,aJ as M,a6 as K,aQ as Z,aq as E,aN as $,aS as uu,a1 as _}from"./index.js";import{e as eu,h as lu}from"./index.e799ac37.js";import{b as j}from"./status.915de772.js";const W={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"},au=[],f=[{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\u540D\u79F0",prop:"TODO9",minWidth:"100px"},{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:"\u5546\u54C1\u7F16\u53F7",prop:"TODO37",minWidth:"90px"},{label:"\u64CD\u4F5C\u6570\u91CF",prop:"TODO38",minWidth:"90px"},{label:"\u5B50\u5546\u54C1\u7F16\u53F7",prop:"TODO39",minWidth:"100px"},{label:"\u5B50\u5546\u54C1\u64CD\u4F5C\u6570\u91CF",prop:"TODO40",minWidth:"110px"}],cu=[f.slice(1).reduce((b,O)=>({...b,[O.label]:O.detaultData?O.defaultData:""}),{})],tu={key:0},ou={key:1},nu={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},iu=P({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["onSuccess"],setup(b,{emit:O}){const o=B(!1),p=B([]),w=b,S=O,g=B(1),v=R(w,"visible"),{currentCompany:V}=L(),z=G(),I=({results:n,header:a})=>{if(o.value=!0,n.length===0){E.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),o.value=!1;return}let m=!0;if(a.length!==f.length-1?m=!1:f.slice(1).forEach((l,s)=>{l.label!==a[s]&&(m=!1)}),!m){E.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),o.value=!1;return}p.value=[];for(const l of n){const s=Object.values(l);let u={};s.forEach((t,i)=>{u["value"+i]=t+""}),p.value.push(u),g.value=g.value+1}const d=[];p.value.forEach((l,s)=>{const u={};for(let t in l){const i=W[t],D=l[t];u[i]=D}d.push(u)});const e=[];if($(new Date).format("YYYY-MM-DD"),d.forEach((l,s)=>{const u=l.invoiceType.trim(),t=j.find(({label:i})=>i===u);t?(l.invoiceType=t.value,(t.value==="normal"||t.value==="electronic")&&l.checkNumber):e.push(String(s+1))}),e.length>0){o.value=!1;return}o.value=!1},U=async()=>{try{if(o.value)return;o.value=!0;const n=[];p.value.forEach((u,t)=>{const i={};for(let D in u){const x=W[D],q=u[D];i[x]=q}n.push(i)}),n.forEach((u,t)=>{const i=u.invoiceType.trim(),D=j.find(({label:x})=>x===i);u.invoiceType=D.value});const a=n.map(({supplierNo:u})=>u);if([...new Set(a)].length>1){E.error("\u5356\u65B9\u516C\u53F8\u7F16\u7801\u4E0D\u4E00\u81F4"),o.value=!1;return}const d=n[0].supplierNo;if(d!=V.value.companyNo){E.error("\u5356\u65B9\u516C\u53F8\u7F16\u7801\u4E0E\u5F53\u524D\u9009\u4E2D\u7684\u516C\u53F8\u4E0D\u4E00\u81F4"),o.value=!1;return}n.forEach(u=>{(u.invoiceType==="fully_digitalized_special_electronic"||u.invoiceType==="fully_digitalized_normal_electronic")&&(u.inv_subtotal_amount=u.inv_total),delete u.inv_total,delete u.supplierNo,delete u.supplierName,delete u.companyName,delete u.companyNo});const{code:e,message:l,data:s}=await lu({list:n,companyNo:d,is_comon:"0"});o.value=!1,z({code:e,message:l,noMessage:!1,handler:()=>{E.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),S("onSuccess"),v.value=!1},onError(){Number(e)===10004?uu({title:"\u4EE5\u4E0B\u5BF9\u8D26\u5355\u4E0D\u7B26\u5408\u8981\u6C42",message:_("div",null,[_("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"),_("p",null,s.join("\u3001"))])}):E.warning(l)}})}catch{}},Y=()=>{p.value=[]};return(n,a)=>{const m=A("el-table-column"),d=A("el-table");return c(),C(r(Z),{"close-on-click-modal":!1,modelValue:r(v),"onUpdate:modelValue":a[0]||(a[0]=e=>K(v)?v.value=e:null),title:"\u975E\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:""},{default:F(()=>[p.value.length===0?(c(),C(r(eu),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:I})):N("v-if",!0),T(d,{data:p.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:F(()=>[(c(!0),h(J,null,Q(r(f),(e,l)=>(c(),C(m,{minWidth:e.minWidth,"show-overflow-tooltip":"",fixed:e.fixed,prop:e.prop,type:e.type,key:l},{header:F(()=>[!r(au).includes(r(W)[e.prop])||e.label==="\u5E8F\u53F7"?(c(),h("span",tu,k(e.label),1)):(c(),h("p",ou,[a[1]||(a[1]=X("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),y(" "+k(e.label),1)]))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),p.value.length!==0?(c(),h("div",nu,[T(r(M),{size:"small",onClick:Y},{default:F(()=>a[2]||(a[2]=[y("\u53D6\u6D88")])),_:1}),T(r(M),{size:"small",type:"primary",loading:o.value,onClick:U},{default:F(()=>a[3]||(a[3]=[y("\u4FDD\u5B58")])),_:1},8,["loading"])])):N("v-if",!0)]),_:1},8,["modelValue"])}}});var pu=H(iu,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inOutManager/components/NotOrderImportModal/index.vue"]]),mu=Object.freeze(Object.defineProperty({__proto__:null,default:pu},Symbol.toStringTag,{value:"Module"}));export{pu as N,mu as i,cu as n};
|