import{b2 as G,ac as g,_ as R,d as U,w as N,aZ as H,b3 as Z,r as k,o as s,G as y,C as x,l as D,a as j,j as A,c as B,F as $,D as J,L as O,h as K,M as W,aR as T,ah as Q,a_ as X,az as q}from"./index.js";import{e as Y}from"./execl-upload.5dfdadc6.js";import{b as L,c as S,d as w,t as I,s as M,e as h}from"./shared.3ff0a9a1.js";import{a as ee}from"./index.e9006de7.js";import{m as z,x as ue}from"./status.4e0ebdbc.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\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:"\u5173\u8054\u5546\u54C1ID",prop:"relaGoodNo",minWidth:"120px",defaultData:"",required:!0},{label:"\u64CD\u4F5C\u6570\u91CF",prop:"relaGoodNum",minWidth:"100px",defaultData:"",required:!0},{label:"\u5B50\u5546\u54C1\u7F16\u53F7",prop:"childCode",minWidth:"100px",defaultData:"",required:!0},{label:"\u5B50\u5546\u54C1\u64CD\u4F5C\u6570\u91CF",prop:"childNum",minWidth:"120px",defaultData:"",required:!0}],Ee=[f.slice(1).reduce((a,e)=>({...a,[e.label]:e.defaultData?e.defaultData:""}),{})],te=f.reduce((a,e)=>({...a,[e.label]:e.prop}),{}),V=f.reduce((a,e)=>({...a,[e.prop]:e.label}),{}),ae=f.filter(a=>!!a.required).map(a=>a.prop);function re(a){G({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:g("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(a).reduce((e,l)=>[...e,g("p",{},"\u7B2C"+l+"\u884C,"+a[l])],[])})})}function le(a){const e={};let l=!1,p=!1,b=!1,v=!1,d=!1;for(const F in a){const _=a[F],r=Number(F)+1;for(const u in _){const i=String(_[u]).trim();ae.includes(u)&&(!i||!String(i).trim())?e[r]?e[r]=e[r]+="\u3001"+V[u]:e[r]=V[u]:u==="type"&&!L[i]?l=!0:u==="source"&&!S[i]?p=!0:u==="inv_type"&&!z[i]?b=!0:u==="tax_diff"&&!w[i]?v=!0:u==="cat_diff"&&!w[i]&&(d=!0)}e[r]?(e[r]+="\u4E0D\u80FD\u4E3A\u7A7A",l&&(e[r]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+I.map(({label:u})=>u).join("\u3001")),p&&(e[r]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+M.map(({label:u})=>u).join("\u3001")),b&&(e[r]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+ue.map(({label:u})=>u).join("\u3001")),v&&(e[r]+=" ,\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+h.map(({label:u})=>u).join("\u3001")),d&&(e[r]+=" ,\u7A0E\u7387\u72B6\u6001"+h.map(({label:u})=>u).join("\u3001"))):(l&&(e[r]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+I.map(({label:u})=>u).join("\u3001")),p&&(e[r]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+M.map(({label:u})=>u).join("\u3001")),b&&(e[r]=" \u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+h.map(({label:u})=>u).join("\u3001")),d&&(e[r]=" \u7A0E\u7387\u72B6\u6001"+h.map(({label:u})=>u).join("\u3001")))}return Object.keys(e).length===0?!0:(re(e),!1)}function ie(a){return!!le(a)}const oe={key:0},pe={key:1},de={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},ne=U({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(a,{emit:e}){const l=N(!1),p=N([]),b=e,d=H(a,"visible"),F=Z(),_=({results:i,header:o})=>{if(l.value=!0,i.length===0){q.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),l.value=!1;return}let n=!0;if(o.length!==f.length-1?n=!1:f.slice(1).forEach((t,c)=>{t.label.trim()!==o[c].trim()&&(n=!1)}),!n){q.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),l.value=!1;return}p.value=[];const m=[];for(const t of i){const c={};Object.keys(t).forEach(C=>{const P=te[C];let E=t[C];C==="\u53D1\u7968\u7C7B\u578B"&&(E=E.replace("(","\uFF08"),E=E.replace(")","\uFF09")),c[P]=E}),m.push(c)}ie(m)&&(p.value=m),l.value=!1},r=async()=>{try{if(l.value)return;l.value=!0;const i=[];p.value.forEach(t=>{i.push({...t,inv_type:z[t.inv_type],source:S[t.source],type:L[t.type],inv_num:Number(t.inv_num).toFixed(8),inv_subprice:Number(t.inv_subprice).toFixed(8),inv_subtotal:Number(t.inv_subtotal).toFixed(8),inv_price:Number(t.inv_price).toFixed(8),inv_total:Number(t.inv_tax_total).toFixed(8),platform_type:"1",goodType:"1",channel:"2",relaArr:[{id:t.relaGoodNo,num:t.relaGoodNum}]})});const{code:o,message:n,data:m}=await ee({list:i});l.value=!1,F({code:o,message:n,noMessage:!1,handler:()=>{q.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),b("refresh"),d.value=!1}})}catch{}},u=()=>{p.value=[]};return(i,o)=>{const n=k("el-table-column"),m=k("el-table");return s(),y(D(X),{modelValue:D(d),"onUpdate:modelValue":o[0]||(o[0]=t=>Q(d)?d.value=t:null),"close-on-click-modal":!1,title:"\u975E\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:"",onClose:o[1]||(o[1]=t=>p.value=[])},{default:x(()=>[p.value.length===0?(s(),y(D(Y),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:_})):j("v-if",!0),A(m,{data:p.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:x(()=>[(s(!0),B($,null,J(D(f),(t,c)=>(s(),y(n,{minWidth:t.minWidth,"show-overflow-tooltip":"",fixed:t.fixed,prop:t.prop,type:t.type,key:c},{header:x(()=>[t.required?(s(),B("p",pe,[o[2]||(o[2]=K("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),W(" "+O(t.label),1)])):(s(),B("span",oe,O(t.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),p.value.length!==0?(s(),B("div",de,[A(D(T),{size:"small",onClick:u},{default:x(()=>o[3]||(o[3]=[W("\u53D6\u6D88")])),_:1}),A(D(T),{size:"small",type:"primary",loading:l.value,onClick:r},{default:x(()=>o[4]||(o[4]=[W("\u4FDD\u5B58")])),_:1},8,["loading"])])):j("v-if",!0)]),_:1},8,["modelValue"])}}});var se=R(ne,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/outManager/components/NotOrderImportModal/index.vue"]]),xe=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));export{se as N,xe as i,Ee as n};