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