import{by as X,a7 as O,_ as K,d as Q,m as g,O as $,bs as Y,bz as Z,r as S,o as b,A as N,x as h,h as v,a as w,f as y,c as T,F as uu,y as eu,G as J,e as tu,H as M,bm as I,ac as au,bt as lu,az as j}from"./index.js";import{e as ru}from"./execl-upload.8692a4ce.js";import{b as z,d as U,e as L,t as V,s as G,f as A}from"./shared.110b48c6.js";import{m as H,b as iu,x as ou,c as pu,d as nu}from"./status.b7512d56.js";import{c as su}from"./index.004a0bb2.js";import{E as du}from"./index.71c29d4d.js";import{I as fu}from"./index.e25db4d1.js";const F=[{type:"index",fixed:"left",label:"\u5E8F\u53F7",width:"50"},{label:"\u4E1A\u52A1\u7F16\u53F7",prop:"invoiceCode",minWidth:"100px",required:!0,defaultData:["hp2410161627508256","hp2410161634513798"]},{label:"\u7C7B\u578B",prop:"type",minWidth:"100px",required:!0,defaultData:["\u5165\u5E93","\u5165\u5E93\u7EA2\u51B2"]},{label:"\u8BA2\u5355\u6765\u6E90",prop:"source",minWidth:"100px",required:!0,defaultData:["\u91C7\u9500\u7ED3\u7B97","\u975E\u91C7\u9500\u7ED3\u7B97"]},{label:"\u8BA2\u5355\u8D2D\u4E70\u65B9\u7EB3\u7A0E\u53F7",prop:"buyer_code",minWidth:"130px",required:!0,defaultData:["91110118MACEA1R94G","91110118MACEA1R94G"]},{label:"\u8BA2\u5355\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0",prop:"buyer_name",minWidth:"150px",required:!0,defaultData:["\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8","\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8"]},{label:"\u8BA2\u5355\u9500\u552E\u65B9\u7EB3\u7A0E\u53F7",prop:"seller_code",minWidth:"160px",required:!0,defaultData:["91110113MA004JNJ28","91110113MA004JNJ28"]},{label:"\u8BA2\u5355\u9500\u552E\u65B9\u516C\u53F8\u540D\u79F0",prop:"seller_name",minWidth:"160px",required:!0,defaultData:["\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8","\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8"]},{label:"\u8BA2\u5355\u7F16\u53F7",prop:"orderCode",minWidth:"120px",required:!0,defaultData:["FCG2312151515318702","FCG2312281122491501"]},{label:"\u8BA2\u5355\u4E3B\u5355\u53F7",prop:"cxCode",minWidth:"120px",defaultData:["QR2312151514229403","QR2312281121198629"]},{label:"\u5546\u54C1\u7C7B\u578B",prop:"goodType",minWidth:"120px",required:!0,defaultData:["\u5E93\u5B58\u5546\u54C1","\u54A8\u8BE2\u5546\u54C1"]},{label:"\u5546\u54C1\u7F16\u53F7",prop:"goodNo",minWidth:"100px",required:!0,defaultData:["SKU2310111111191036","SKU2307191640103890"]},{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",minWidth:"100px",required:!0,defaultData:["JXHC \u54C1\u724C\u6587\u521B2024\u5E74\u7B80\u88C5\u672C\uFF08\u6A59\u8272\uFF09","JXHC\u6CF0\u5EB7\u5BB6\u65CF\u529E\u516C\u5BA4\u624B\u518C"]},{label:"\u8BA2\u5355\u5355\u4F4D",prop:"unit",minWidth:"80px",required:!0,defaultData:["\u672C","\u4E2A"]},{label:"\u5546\u54C1\u6570\u91CF",prop:"num",minWidth:"110px",required:!0,defaultData:["40","160"]},{label:"\u5546\u54C1\u5355\u4EF7",prop:"goodPrice",minWidth:"110px",required:!0,defaultData:["6.83","12.74"]},{label:"\u8BA2\u5355\u603B\u91D1\u989D",prop:"totalPrice",minWidth:"110px",required:!0,defaultData:["273","2038.4"]},{label:"\u7A0E\u76EE",prop:"cat_code",minWidth:"80px",required:!0,defaultData:["1060105020000000000","1060201990000000000"]},{label:"\u7A0E\u76EE\u540D\u79F0",prop:"cat_name",minWidth:"100px",required:!0,defaultData:["\u7EB8\u5236\u54C1","\u5370\u5237\u54C1"]},{label:"\u8BA2\u5355\u7A0E\u7387",prop:"tax",minWidth:"100px",required:!0,defaultData:["13","13"]},{label:"\u5173\u8054\u91D1\u989D",prop:"inv_fee",minWidth:"100px",required:!0,defaultData:["273","2038.4"]},{label:"\u8D2D\u4E70\u65B9\u7EB3\u7A0E\u53F7",prop:"inv_buyer_code",minWidth:"130px",required:!0,defaultData:["91110118MACEA1R94G","91110118MACEA1R94G"]},{label:"\u8D2D\u4E70\u65B9\u540D\u79F0",prop:"inv_buyer_name",minWidth:"170px",required:!0,defaultData:["\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8","\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8"]},{label:"\u53D1\u7968\u53F7\u7801",prop:"inv_number",minWidth:"100px",required:!0,defaultData:["24112000000154116434","24112000000154116434"]},{label:"\u5F00\u7968\u65E5\u671F",prop:"inv_open_date",minWidth:"100px",required:!0,defaultData:["2024-10-16","2024-11-18"]},{label:"\u53D1\u7968\u7C7B\u578B",prop:"inv_type",minWidth:"100px",required:!0,defaultData:["\u7535\u5B50\u53D1\u7968\uFF08\u589E\u503C\u7A0E\u4E13\u7528\u53D1\u7968\uFF09","\u7535\u5B50\u53D1\u7968\uFF08\u589E\u503C\u7A0E\u4E13\u7528\u53D1\u7968\uFF09"]},{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",required:!0,defaultData:["91110113MA004JNJ28","91110113MA004JNJ28"]},{label:"\u9500\u552E\u65B9\u516C\u53F8",prop:"inv_seller_name",minWidth:"130px",required:!0,defaultData:["\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8","\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8"]},{label:"\u53D1\u7968\u660E\u7EC6ID",prop:"inv_item_id",minWidth:"110px",defaultData:["1280","1281"]},{label:"\u8D27\u7269\u6216\u5E94\u7A0E\u52B3\u52A1\u3001\u670D\u52A1\u540D\u79F0",prop:"inv_good_name",minWidth:"200px",required:!0,defaultData:["*\u5370\u5237\u54C1*JXHC \u54C1\u724C\u6587\u521B2024\u5E74\u7B80\u88C5\u672C\uFF08\u6A59\u8272\uFF09","*\u7EB8\u5236\u54C1*JXHC\u6CF0\u5EB7\u5BB6\u65CF\u529E\u516C\u5BA4\u624B\u518C"]},{label:"\u7C7B\u76EE\u7F16\u53F7",prop:"inv_cat_code",minWidth:"90px",required:!0,defaultData:["1060201990000000000","1060105990000000000"]},{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:["\u672C","\u4E2A"]},{label:"\u6570\u91CF",prop:"inv_num",minWidth:"100px",required:!0,defaultData:["40","160"]},{label:"\u7A0E\u524D\u5355\u4EF7",prop:"inv_subprice",minWidth:"100px",required:!0,defaultData:["6.0398230088496","11.274336283186"]},{label:"\u7A0E\u524D\u603B\u4EF7",prop:"inv_subtotal",minWidth:"100px",required:!0,defaultData:["241.59","1803.89"]},{label:"\u7A0E\u7387",prop:"inv_tax",minWidth:"80px",required:!0,defaultData:["13%","13%"]},{label:"\u7A0E\u989D",prop:"inv_tax_total",minWidth:"80px",required:!0,defaultData:["31.41","234.51"]},{label:"\u7A0E\u540E\u5355\u4EF7",prop:"inv_price",minWidth:"100px",required:!0,defaultData:["6.825","12.74"]},{label:"\u7A0E\u540E\u603B\u989D",prop:"inv_total",minWidth:"100px",required:!0,defaultData:["273","2038.4"]},{label:"\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001",prop:"cat_diff",minWidth:"100px",required:!0,defaultData:["\u4E00\u81F4","\u4E00\u81F4"]},{label:"\u7A0E\u7387\u72B6\u6001",prop:"tax_diff",minWidth:"100px",required:!0,defaultData:["\u4E0D\u4E00\u81F4","\u4E00\u81F4"]},{label:"\u5907\u6CE8",prop:"remark",minWidth:"80px",defaultData:["\u540C\u610F",""]},{label:"\u5165\u8D26\u6708\u4EFD",prop:"fz_date",minWidth:"80px",required:!0,defaultData:["2024-10","2024-11"]}],ju=new Array(3).fill(1).map((r,e)=>F.slice(1).reduce((i,o)=>{const D=e===0;let f="";return D?f=o.required?"\u5FC5\u586B":"":f=o.defaultData[e-1],{...i,[o.label]:f}},{})),mu=F.reduce((r,e)=>({...r,[e.label]:e.prop}),{}),R=F.reduce((r,e)=>({...r,[e.prop]:e.label}),{}),Eu=F.filter(r=>!!r.required).map(r=>r.prop);function Cu(r){X({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:O("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(r).reduce((e,i)=>[...e,O("p",{},"\u7B2C"+i+"\u884C,"+r[i])],[])})})}function Fu(r){const e={};let i=!1,o=!1,D=!1,f=!1,_=!1,m=!1,x=!1;for(const n in r){const s=r[n],a=Number(n)+1;for(const u in s){const p=String(s[u]).trim();Eu.includes(u)&&(!p||!String(p).trim())?e[a]?e[a]=e[a]+="\u3001"+R[u]:e[a]=R[u]:u==="type"&&!z[p]?i=!0:u==="source"&&!U[p]?o=!0:u==="inv_type"&&!H[p]?D=!0:u==="tax_diff"&&!L[p]?f=!0:u==="cat_diff"&&!L[p]?_=!0:u==="goodType"&&!iu[p]?m=!0:u==="inv_num"&&(!p||Number(p)===0)&&(x=!0)}e[a]?(e[a]+="\u4E0D\u80FD\u4E3A\u7A7A",i&&(e[a]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+V.map(({label:u})=>u).join("\u3001")),o&&(e[a]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+G.map(({label:u})=>u).join("\u3001")),D&&(e[a]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+ou.map(({label:u})=>u).join("\u3001")),f&&(e[a]+=" ,\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+A.map(({label:u})=>u).join("\u3001")),_&&(e[a]+=" ,\u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+A.map(({label:u})=>u).join("\u3001")),_&&(e[a]+=" ,\u7A0E\u7387\u72B6\u6001"+A.map(({label:u})=>u).join("\u3001")),m&&(e[a]+=" ,\u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+A.map(({label:u})=>u).join("\u3001")),x&&(e[a]+=" ,\u8BA2\u5355\u5546\u54C1\u53D1\u7968\u6570\u91CF\u4E0D\u80FD\u4E3A0")):(i&&(e[a]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+V.map(({label:u})=>u).join("\u3001")),o&&(e[a]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+G.map(({label:u})=>u).join("\u3001")),D&&(e[a]=" \u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+A.map(({label:u})=>u).join("\u3001")),_&&(e[a]=" \u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+A.map(({label:u})=>u).join("\u3001")),m&&(e[a]=" \u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+pu.map(({label:u})=>u).join("\u3001")),x&&(e[a]=" \u8BA2\u5355\u5546\u54C1\u53D1\u7968\u6570\u91CF\u4E0D\u80FD\u4E3A0"))}return Object.keys(e).length===0?!0:(Cu(e),!1)}function Du(r){return!!Fu(r)}const cu={key:0},Bu={key:1},bu={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},vu=Q({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(r,{emit:e}){const i=g([]),o=g(!1),{getCurrentLicense:D}=$(),f=e,m=Y(r,"visible"),x=Z(),n=g({visible:!1,list:[],title:""}),s=g({visible:!1,importColumns:[],columns:[]}),a=({results:c,header:l})=>{if(o.value=!0,c.length===0){j.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),o.value=!1;return}let E=!0;if(l.length!==F.length-1?E=!1:F.slice(1).forEach((C,q)=>{C.label!==l[q]&&(E=!1)}),!E){s.value.visible=!0,s.value.importColumns=[...l],s.value.columns=F.slice(1).map(({label:C})=>C),o.value=!1;return}i.value=[];const d=[];for(const C of c){const q={};Object.keys(C).forEach((k,_u)=>{const P=mu[k.replace("_1","")];let B=C[k];k==="\u53D1\u7968\u7C7B\u578B"&&(B=B.replace("(","\uFF08"),B=B.replace(")","\uFF09")),q[P]=B&&String(B).trim()}),d.push(q)}const t=D(),W=[...new Set(d.map(({inv_buyer_code:C})=>C))];if(W.length!==1){j.warning("\u5BFC\u5165\u6570\u636E\u7684\u8D2D\u4E70\u65B9\u516C\u53F8\u5FC5\u987B\u4E00\u81F4");return}if(W[0]!==t){j.warning("\u5BFC\u5165\u6570\u636E\u8D2D\u4E70\u65B9\u516C\u53F8\u4E0E\u5F53\u524D\u9009\u62E9\u516C\u53F8\u4E0D\u4E00\u81F4");return}Du(d)&&(i.value=d),o.value=!1},u=async()=>{try{if(o.value)return;o.value=!0;const c=[];i.value.forEach(t=>{c.push({...t,inv_type:H[t.inv_type],source:U[t.source],type:z[t.type],goodType:nu[t.goodType],inv_num:Number(t.inv_num).toFixed(15),inv_subprice:Number(t.inv_subprice).toFixed(15),inv_subtotal:Number(t.inv_subtotal).toFixed(15),inv_price:Number(t.inv_price).toFixed(15),inv_total:Number(t.inv_tax_total).toFixed(15),platform_type:"1",channel:"1",relaArr:[]})});const{code:l,message:E,data:d}=await su({list:c});if(o.value=!1,l==1004&&d){n.value.visible=!0,n.value.list=d,n.value.title=E;return}x({code:l,message:E,noMessage:!1,handler:()=>{j.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),f("refresh"),m.value=!1}})}catch{}},p=()=>{i.value=[]};return(c,l)=>{const E=S("el-table-column"),d=S("el-table");return b(),N(v(lu),{modelValue:v(m),"onUpdate:modelValue":l[2]||(l[2]=t=>au(m)?m.value=t:null),"close-on-click-modal":!1,title:"\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:"",onClose:l[3]||(l[3]=t=>i.value=[])},{default:h(()=>[i.value.length===0?(b(),N(v(ru),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:a})):w("v-if",!0),y(d,{data:i.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:h(()=>[(b(!0),T(uu,null,eu(v(F),(t,W)=>(b(),N(E,{minWidth:t.minWidth,"show-overflow-tooltip":"",fixed:t.fixed,prop:t.prop,type:t.type,key:W},{header:h(()=>[t.required?(b(),T("p",Bu,[l[4]||(l[4]=tu("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),M(" "+J(t.label),1)])):(b(),T("span",cu,J(t.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),i.value.length!==0?(b(),T("div",bu,[y(v(I),{size:"small",onClick:p},{default:h(()=>l[5]||(l[5]=[M("\u53D6\u6D88")])),_:1}),y(v(I),{size:"small",type:"primary",loading:o.value,onClick:u},{default:h(()=>l[6]||(l[6]=[M("\u4FDD\u5B58")])),_:1},8,["loading"])])):w("v-if",!0),y(du,{visible:n.value.visible,"onUpdate:visible":l[0]||(l[0]=t=>n.value.visible=t),list:n.value.list,title:n.value.title},null,8,["visible","list","title"]),y(fu,{visible:s.value.visible,"onUpdate:visible":l[1]||(l[1]=t=>s.value.visible=t),"import-columns":s.value.importColumns,columns:s.value.columns},null,8,["visible","import-columns","columns"])]),_:1},8,["modelValue"])}}});var Au=K(vu,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inManager/components/OrderImportModal/index.vue"]]),ku=Object.freeze(Object.defineProperty({__proto__:null,default:Au},Symbol.toStringTag,{value:"Module"}));export{Au as O,ku as i,ju as o};