import{b2 as G,ac as g,_ as R,d as U,w as j,a_ as H,b3 as $,r as T,o as n,G as y,C as x,l as D,a as k,j as A,c as v,F as J,D as K,L as O,h as Q,M as W,aR as N,ah as X,a$ as Y,az as q}from"./index.js";import{e as Z}from"./execl-upload.765cd18b.js";import{b as I,c as S,d as L,t as w,s as M,e as s}from"./shared.3ff0a9a1.js";import{m as z,b as ee,x as ue,d as ae}from"./status.0f771e9a.js";import{a as te}from"./index.81d51bb0.js";const f=[{type:"index",fixed:"left",label:"\u5E8F\u53F7",width:"50"},{label:"\u4E1A\u52A1\u7F16\u53F7",prop:"invoiceCode",minWidth:"100px",defaultData:"",required:!0},{label:"\u7C7B\u578B",prop:"type",minWidth:"100px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u6765\u6E90",prop:"source",minWidth:"100px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u8D2D\u4E70\u65B9\u7EB3\u7A0E\u53F7",prop:"buyer_code",minWidth:"130px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0",prop:"buyer_name",minWidth:"150px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7",prop:"seller_code",minWidth:"160px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u9500\u552E\u65B9\u516C\u53F8\u540D\u79F0",prop:"seller_name",minWidth:"160px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u7F16\u53F7",prop:"orderCode",minWidth:"120px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u4E3B\u5355\u53F7",prop:"cxCode",minWidth:"120px",defaultData:""},{label:"\u5546\u54C1\u7C7B\u578B",prop:"goodType",minWidth:"120px",defaultData:"",required:!0},{label:"\u5546\u54C1\u7F16\u53F7",prop:"goodNo",minWidth:"100px",defaultData:"",required:!0},{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",minWidth:"100px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u5355\u4F4D",prop:"unit",minWidth:"80px",defaultData:"",required:!0},{label:"\u5546\u54C1\u6570\u91CF",prop:"num",minWidth:"110px",defaultData:"",required:!0},{label:"\u5546\u54C1\u5355\u4EF7",prop:"goodPrice",minWidth:"110px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u603B\u91D1\u989D",prop:"totalPrice",minWidth:"110px",defaultData:"",required:!0},{label:"\u7A0E\u76EE",prop:"cat_code",minWidth:"80px",defaultData:"",required:!0},{label:"\u7A0E\u76EE\u540D\u79F0",prop:"cat_name",minWidth:"100px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u7A0E\u7387",prop:"tax",minWidth:"100px",defaultData:"",required:!0},{label:"\u5173\u8054\u91D1\u989D",prop:"inv_fee",minWidth:"100px",defaultData:"",required:!0},{label:"\u8D2D\u4E70\u65B9\u7EB3\u7A0E\u53F7",prop:"inv_buyer_code",minWidth:"130px",defaultData:"",required:!0},{label:"\u8D2D\u4E70\u65B9\u540D\u79F0",prop:"inv_buyer_name",minWidth:"170px",defaultData:"",required:!0},{label:"\u53D1\u7968\u53F7\u7801",prop:"inv_number",minWidth:"100px",defaultData:"",required:!0},{label:"\u5F00\u7968\u65E5\u671F",prop:"inv_open_date",minWidth:"100px",defaultData:"",required:!0},{label:"\u53D1\u7968\u7C7B\u578B",prop:"inv_type",minWidth:"100px",defaultData:"",required:!0},{label:"\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7",mapLabel:"\u53D1\u7968\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7",prop:"inv_seller_code",minWidth:"170px",defaultData:"",required:!0},{label:"\u9500\u552E\u65B9\u516C\u53F8",prop:"inv_seller_name",minWidth:"130px",defaultData:"",required:!0},{label:"\u53D1\u7968\u660E\u7EC6ID",prop:"inv_item_id",minWidth:"110px",defaultData:""},{label:"\u8D27\u7269\u6216\u5E94\u7A0E\u52B3\u52A1\u3001\u670D\u52A1\u540D\u79F0",prop:"inv_good_name",minWidth:"200px",defaultData:"",required:!0},{label:"\u7C7B\u76EE\u7F16\u53F7",prop:"inv_cat_code",minWidth:"90px",defaultData:"",required:!0},{label:"\u89C4\u683C\u578B\u53F7",prop:"inv_spec",minWidth:"110px",defaultData:""},{label:"\u5355\u4F4D",mapLabel:"\u53D1\u7968\u5546\u54C1\u5355\u4F4D",prop:"inv_unit",minWidth:"100px",defaultData:""},{label:"\u6570\u91CF",prop:"inv_num",minWidth:"100px",defaultData:""},{label:"\u7A0E\u524D\u5355\u4EF7",prop:"inv_subprice",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u524D\u603B\u4EF7",prop:"inv_subtotal",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u7387",prop:"inv_tax",minWidth:"80px",defaultData:"",required:!0},{label:"\u7A0E\u989D",prop:"inv_tax_total",minWidth:"80px",defaultData:"",required:!0},{label:"\u7A0E\u540E\u5355\u4EF7",prop:"inv_price",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u540E\u603B\u989D",prop:"inv_total",minWidth:"100px",defaultData:"",required:!0},{label:"\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001",prop:"cat_diff",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u7387\u72B6\u6001",prop:"tax_diff",minWidth:"100px",defaultData:"",required:!0},{label:"\u5907\u6CE8",prop:"remark",minWidth:"80px",defaultData:""},{label:"\u5165\u8D26\u6708\u4EFD",prop:"fz_date",minWidth:"80px",defaultData:"",required:!0}],_e=[f.slice(1).reduce((l,u)=>({...l,[u.label]:u.defaultData?u.defaultData:""}),{})],re=f.reduce((l,u)=>({...l,[u.label]:u.prop}),{}),V=f.reduce((l,u)=>({...l,[u.prop]:u.label}),{}),le=f.filter(l=>!!l.required).map(l=>l.prop);function ie(l){G({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:g("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(l).reduce((u,i)=>[...u,g("p",{},"\u7B2C"+i+"\u884C,"+l[i])],[])})})}function oe(l){const u={};let i=!1,o=!1,E=!1,h=!1,p=!1,b=!1;for(const _ in l){const F=l[_],r=Number(_)+1;for(const e in F){const t=String(F[e]).trim();le.includes(e)&&(!t||!String(t).trim())?u[r]?u[r]=u[r]+="\u3001"+V[e]:u[r]=V[e]:e==="type"&&!I[t]?i=!0:e==="source"&&!S[t]?o=!0:e==="inv_type"&&!z[t]?E=!0:e==="tax_diff"&&!L[t]?h=!0:e==="cat_diff"&&!L[t]?p=!0:e==="goodType"&&ee[t]&&(b=!1)}u[r]?(u[r]+="\u4E0D\u80FD\u4E3A\u7A7A",i&&(u[r]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+w.map(({label:e})=>e).join("\u3001")),o&&(u[r]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+M.map(({label:e})=>e).join("\u3001")),E&&(u[r]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+ue.map(({label:e})=>e).join("\u3001")),h&&(u[r]+=" ,\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+s.map(({label:e})=>e).join("\u3001")),p&&(u[r]+=" ,\u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+s.map(({label:e})=>e).join("\u3001")),p&&(u[r]+=" ,\u7A0E\u7387\u72B6\u6001"+s.map(({label:e})=>e).join("\u3001")),b&&(u[r]+=" ,\u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+s.map(({label:e})=>e).join("\u3001"))):(i&&(u[r]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+w.map(({label:e})=>e).join("\u3001")),o&&(u[r]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+M.map(({label:e})=>e).join("\u3001")),E&&(u[r]=" \u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+s.map(({label:e})=>e).join("\u3001")),p&&(u[r]=" \u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+s.map(({label:e})=>e).join("\u3001")),b&&(u[r]=" \u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+s.map(({label:e})=>e).join("\u3001")))}return Object.keys(u).length===0?!0:(ie(u),!1)}function pe(l){return!!oe(l)}const de={key:0},ne={key:1},se={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},fe=U({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(l,{emit:u}){const i=j([]),o=j(!1),E=u,p=H(l,"visible"),b=$(),_=({results:e,header:t})=>{if(o.value=!0,e.length===0){q.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),o.value=!1;return}let d=!0;if(t.length!==f.length-1?d=!1:f.slice(1).forEach((a,c)=>{a.label!==t[c]&&(d=!1)}),!d){q.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),o.value=!1;return}i.value=[];const m=[];for(const a of e){const c={};Object.keys(a).forEach((C,ce)=>{const P=re[C.replace("_1","")];let B=a[C];C==="\u53D1\u7968\u7C7B\u578B"&&(B=B.replace("(","\uFF08"),B=B.replace(")","\uFF09")),c[P]=B}),m.push(c)}pe(m)&&(i.value=m),o.value=!1},F=async()=>{try{if(o.value)return;o.value=!0;const e=[];i.value.forEach(a=>{e.push({...a,inv_type:z[a.inv_type],source:S[a.source],type:I[a.type],goodType:ae[a.goodType],inv_num:Number(a.inv_num).toFixed(8),inv_subprice:Number(a.inv_subprice).toFixed(8),inv_subtotal:Number(a.inv_subtotal).toFixed(8),inv_price:Number(a.inv_price).toFixed(8),inv_total:Number(a.inv_tax_total).toFixed(8),platform_type:"1",channel:"1"})});const{code:t,message:d,data:m}=await te({list:e});o.value=!1,b({code:t,message:d,noMessage:!1,handler:()=>{q.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),E("refresh"),p.value=!1}})}catch{}},r=()=>{i.value=[]};return(e,t)=>{const d=T("el-table-column"),m=T("el-table");return n(),y(D(Y),{modelValue:D(p),"onUpdate:modelValue":t[0]||(t[0]=a=>X(p)?p.value=a:null),"close-on-click-modal":!1,title:"\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:"",onClose:t[1]||(t[1]=a=>i.value=[])},{default:x(()=>[i.value.length===0?(n(),y(D(Z),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:_})):k("v-if",!0),A(m,{data:i.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:x(()=>[(n(!0),v(J,null,K(D(f),(a,c)=>(n(),y(d,{minWidth:a.minWidth,"show-overflow-tooltip":"",fixed:a.fixed,prop:a.prop,type:a.type,key:c},{header:x(()=>[a.required?(n(),v("p",ne,[t[2]||(t[2]=Q("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),W(" "+O(a.label),1)])):(n(),v("span",de,O(a.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),i.value.length!==0?(n(),v("div",se,[A(D(N),{size:"small",onClick:r},{default:x(()=>t[3]||(t[3]=[W("\u53D6\u6D88")])),_:1}),A(D(N),{size:"small",type:"primary",loading:o.value,onClick:F},{default:x(()=>t[4]||(t[4]=[W("\u4FDD\u5B58")])),_:1},8,["loading"])])):k("v-if",!0)]),_:1},8,["modelValue"])}}});var me=R(fe,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/outManager/components/OrderImportModal/index.vue"]]),Fe=Object.freeze(Object.defineProperty({__proto__:null,default:me},Symbol.toStringTag,{value:"Module"}));export{me as O,Fe as i,_e as o};