import{by as X,a7 as M,_ as K,d as Q,m as q,O as $,bs as Y,bz as Z,r as O,o as b,A as j,x,h as v,a as S,f as _,c as g,F as uu,y as eu,G,e as tu,H as k,bm as w,ac as au,bt as lu,az as N}from"./index.js";import{e as ru}from"./execl-upload.8692a4ce.js";import{b as R,c as z,d as I,t as J,s as L,e as A}from"./shared.b741187d.js";import{c as iu}from"./index.004a0bb2.js";import{m as U,b as ou,x as pu,c as nu,d as su}from"./status.b7512d56.js";import{E as du}from"./index.71c29d4d.js";import{I as fu}from"./index.e25db4d1.js";const C=[{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:["\u51FA\u5E93","\u51FA\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:["91110113MA004JNJ28","91110113MA004JNJ28"]},{label:"\u8BA2\u5355\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0",prop:"buyer_name",minWidth:"150px",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\u9500\u552E\u65B9\u7EB3\u7A0E\u53F7",prop:"seller_code",minWidth:"160px",required:!0,defaultData:["91110118MACEA1R94G","91110118MACEA1R94G"]},{label:"\u8BA2\u5355\u9500\u552E\u65B9\u516C\u53F8\u540D\u79F0",prop:"seller_name",minWidth:"160px",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\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:["\u975E\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:["91110113MA004JNJ28","91110113MA004JNJ28"]},{label:"\u8D2D\u4E70\u65B9\u540D\u79F0",prop:"inv_buyer_name",minWidth:"170px",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\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:["91110118MACEA1R94G","91110118MACEA1R94G"]},{label:"\u9500\u552E\u65B9\u516C\u53F8",prop:"inv_seller_name",minWidth:"130px",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\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",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",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"]},{label:"\u5173\u8054\u5546\u54C1ID",prop:"relaGoodNo",minWidth:"120px",required:!0,defaultData:["12","14"]},{label:"\u64CD\u4F5C\u6570\u91CF",prop:"relaGoodNum",minWidth:"100px",required:!0,defaultData:["6","6"]}],Nu=new Array(3).fill(1).map((r,e)=>C.slice(1).reduce((i,o)=>{const F=e===0;let d="";return F?d=o.required?"\u5FC5\u586B":"":d=o.defaultData[e-1],{...i,[o.label]:d}},{})),mu=C.reduce((r,e)=>({...r,[e.label]:e.prop}),{}),V=C.reduce((r,e)=>({...r,[e.prop]:e.label}),{}),Eu=C.filter(r=>!!r.required).map(r=>r.prop);function Cu(r){X({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:M("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(r).reduce((e,i)=>[...e,M("p",{},"\u7B2C"+i+"\u884C,"+r[i])],[])})})}function Fu(r){const e={};let i=!1,o=!1,F=!1,d=!1,B=!1,f=!1;for(const h in r){const p=r[h],a=Number(h)+1;for(const u in p){const n=String(p[u]).trim();Eu.includes(u)&&(!n||!String(n).trim())?e[a]?e[a]=e[a]+="\u3001"+V[u]:e[a]=V[u]:u==="type"&&!R[n]?i=!0:u==="source"&&!z[n]?o=!0:u==="inv_type"&&!U[n]?F=!0:u==="tax_diff"&&!I[n]?d=!0:u==="cat_diff"&&!I[n]?B=!0:u==="goodType"&&!ou[n]&&(f=!0)}e[a]?(e[a]+="\u4E0D\u80FD\u4E3A\u7A7A",i&&(e[a]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+J.map(({label:u})=>u).join("\u3001")),o&&(e[a]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+L.map(({label:u})=>u).join("\u3001")),F&&(e[a]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+pu.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")),B&&(e[a]+=" ,\u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+A.map(({label:u})=>u).join("\u3001")),B&&(e[a]+=" ,\u7A0E\u7387\u72B6\u6001"+A.map(({label:u})=>u).join("\u3001")),f&&(e[a]+=" ,\u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+A.map(({label:u})=>u).join("\u3001"))):(i&&(e[a]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+J.map(({label:u})=>u).join("\u3001")),o&&(e[a]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+L.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")),B&&(e[a]=" \u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+A.map(({label:u})=>u).join("\u3001")),f&&(e[a]=" \u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+nu.map(({label:u})=>u).join("\u3001")))}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=q(!1),o=q([]),F=e,d=r,{getCurrentLicense:B}=$(),f=Y(d,"visible"),h=Z(),p=q({visible:!1,list:[],title:""}),a=q({visible:!1,importColumns:[],columns:[]}),u=({results:D,header:l})=>{if(i.value=!0,D.length===0){N.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),i.value=!1;return}let m=!0;if(l.length!==C.length-1?m=!1:C.slice(1).forEach((E,W)=>{E.label!==l[W]&&(m=!1)}),!m){a.value.visible=!0,a.value.importColumns=[...l],a.value.columns=C.slice(1).map(({label:E})=>E),i.value=!1;return}o.value=[];const s=[];for(const E of D){const W={};Object.keys(E).forEach(T=>{const P=mu[T];let c=E[T];T==="\u53D1\u7968\u7C7B\u578B"&&(c=c.replace("(","\uFF08"),c=c.replace(")","\uFF09")),W[P]=c&&String(c).trim()}),s.push(W)}const t=B(),y=[...new Set(s.map(({inv_seller_code:E})=>E))];if(y.length!==1){N.warning("\u5BFC\u5165\u6570\u636E\u7684\u9500\u552E\u65B9\u516C\u53F8\u5FC5\u987B\u4E00\u81F4");return}if(y[0]!==t){N.warning("\u5BFC\u5165\u6570\u636E\u9500\u552E\u65B9\u516C\u53F8\u4E0E\u5F53\u524D\u9009\u62E9\u516C\u53F8\u4E0D\u4E00\u81F4");return}Du(s)&&(o.value=s),i.value=!1},n=async()=>{try{if(i.value)return;i.value=!0;const D=[];o.value.forEach(t=>{D.push({...t,inv_type:U[t.inv_type],source:z[t.source],type:R[t.type],goodType:su[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:"2",relaArr:[{id:t.relaGoodNo,num:t.relaGoodNum}]})});const{code:l,message:m,data:s}=await iu({list:D});if(i.value=!1,l==1004&&s){p.value.visible=!0,p.value.list=s,p.value.title=m;return}h({code:l,message:m,noMessage:!1,handler:()=>{N.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),F("refresh"),f.value=!1}})}catch{}},H=()=>{o.value=[]};return(D,l)=>{const m=O("el-table-column"),s=O("el-table");return b(),j(v(lu),{modelValue:v(f),"onUpdate:modelValue":l[2]||(l[2]=t=>au(f)?f.value=t:null),"close-on-click-modal":!1,title:"\u975E\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:"",onClose:l[3]||(l[3]=t=>o.value=[])},{default:x(()=>[o.value.length===0?(b(),j(v(ru),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:u})):S("v-if",!0),_(s,{data:o.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:x(()=>[(b(!0),g(uu,null,eu(v(C),(t,y)=>(b(),j(m,{minWidth:t.minWidth,"show-overflow-tooltip":"",fixed:t.fixed,prop:t.prop,type:t.type,key:y},{header:x(()=>[t.required?(b(),g("p",bu,[l[4]||(l[4]=tu("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),k(" "+G(t.label),1)])):(b(),g("span",cu,G(t.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),o.value.length!==0?(b(),g("div",Bu,[_(v(w),{size:"small",onClick:H},{default:x(()=>l[5]||(l[5]=[k("\u53D6\u6D88")])),_:1}),_(v(w),{size:"small",type:"primary",loading:i.value,onClick:n},{default:x(()=>l[6]||(l[6]=[k("\u4FDD\u5B58")])),_:1},8,["loading"])])):S("v-if",!0),_(du,{visible:p.value.visible,"onUpdate:visible":l[0]||(l[0]=t=>p.value.visible=t),list:p.value.list,title:p.value.title},null,8,["visible","list","title"]),_(fu,{visible:a.value.visible,"onUpdate:visible":l[1]||(l[1]=t=>a.value.visible=t),"import-columns":a.value.importColumns,columns:a.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/outManager/components/NotOrderImportModal/index.vue"]]),Tu=Object.freeze(Object.defineProperty({__proto__:null,default:Au},Symbol.toStringTag,{value:"Module"}));export{Au as N,Tu as i,Nu as n};