1 |
- import{b3 as U,ac as q,_ as z,d as G,w as D,a$ as P,b4 as J,r as T,o as E,G as g,C as y,l as F,a as W,j as _,c as A,F as Q,D as H,L as k,h as K,M as h,aR as j,ah as $,b0 as X,az as S}from"./index.js";import{b as Y}from"./index.0b63e24d.js";import{e as Z}from"./execl-upload.59283836.js";import{m as V,b as ee,t as M,s as O}from"./shared.a743a5f7.js";import{m as ue,b as te,x as le,c as w,d as ae}from"./status.b7512d56.js";import{E as re}from"./index.53b07c6d.js";import{I as oe}from"./index.46232daf.js";const f=[{type:"index",fixed:"left",label:"\u5E8F\u53F7",width:"50"},{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:["91110113MA008J790J","91110113MA008J790J"]},{label:"\u8BA2\u5355\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0",prop:"buyer_name",minWidth:"150px",required:!0,defaultData:["\u5317\u4EAC\u767E\u8FB0\u8363\u8FBE\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8","\u5317\u4EAC\u767E\u8FB0\u8363\u8FBE\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8"]},{label:"\u8BA2\u5355\u9500\u552E\u65B9\u516C\u53F8\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:["FQR2408091410078906","FQR2408091408089205"]},{label:"\u8BA2\u5355\u4E3B\u5355\u53F7",prop:"cxCode",minWidth:"120px",defaultData:["QR2408091409232833","QR2408091407526489"]},{label:"\u5546\u54C1\u7C7B\u578B",prop:"goodType",minWidth:"120px",required:!0,defaultData:["\u54A8\u8BE2\u5546\u54C1","\u5E93\u5B58\u5546\u54C1"]},{label:"\u5546\u54C1\u7F16\u53F7",prop:"goodNo",minWidth:"100px",required:!0,defaultData:["SKU2408091355123018","SKU2408091354219149"]},{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",minWidth:"100px",required:!0,defaultData:["\u6CF0\u5EB7\u4E13\u7248\u91D1\u94A5\u53195g","\u62C9\u6746\u7BB1"]},{label:"\u8BA2\u5355\u5355\u4F4D",prop:"unit",minWidth:"80px",required:!0,defaultData:["\u4E2A","\u4E2A"]},{label:"\u5546\u54C1\u6570\u91CF",prop:"num",minWidth:"110px",required:!0,defaultData:["2","1"]},{label:"\u5546\u54C1\u5355\u4EF7",prop:"goodPrice",minWidth:"110px",required:!0,defaultData:["725.2","194.04"]},{label:"\u8BA2\u5355\u603B\u91D1\u989D",prop:"totalPrice",minWidth:"110px",required:!0,defaultData:["725.2","194.04"]},{label:"\u51FA\u5E93\u65F6\u95F4",prop:"fz_date",minWidth:"80px",required:!0,defaultData:["2024-11","2024-11"]}],xe=new Array(3).fill(1).map((a,u)=>f.slice(1).reduce((s,p)=>{const i=u===0;let r="";return i?r=p.required?"\u5FC5\u586B":"":r=p.defaultData[u-1],{...s,[p.label]:r}},{})),ie=f.reduce((a,u)=>({...a,[u.label]:u.prop}),{}),R=f.reduce((a,u)=>({...a,[u.prop]:u.label}),{}),se=f.filter(a=>!!a.required).map(a=>a.prop);function ne(a){U({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:q("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(a).reduce((u,s)=>[...u,q("p",{},"\u7B2C"+s+"\u884C,"+a[s])],[])})})}function pe(a){const u={};let s=!1,p=!1,i=!1,r=!1;for(const c in a){const n=a[c],o=Number(c)+1;for(const t in n){const d=String(n[t]).trim();se.includes(t)&&(!d||!String(d).trim())?u[o]?u[o]=u[o]+="\u3001"+R[t]:u[o]=R[t]:t==="type"&&!V[d]?s=!0:t==="source"&&!ee[d]?p=!0:t==="inv_type"&&!ue[d]?i=!0:t==="goodType"&&!te[d]&&(r=!0)}u[o]?(u[o]+="\u4E0D\u80FD\u4E3A\u7A7A",s&&(u[o]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+M.map(({label:t})=>t).join("\u3001")),p&&(u[o]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+O.map(({label:t})=>t).join("\u3001")),i&&(u[o]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+le.map(({label:t})=>t).join("\u3001")),r&&(u[o]+=" ,\u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+w.map(({label:t})=>t).join("\u3001"))):(s&&(u[o]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+M.map(({label:t})=>t).join("\u3001")),p&&(u[o]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+O.map(({label:t})=>t).join("\u3001")),r&&(u[o]=" \u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+w.map(({label:t})=>t).join("\u3001")))}return Object.keys(u).length===0?!0:(ne(u),!1)}function de(a){return!!pe(a)}const me={key:0},fe={key:1},ce={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},ve=G({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(a,{emit:u}){const s=a,p=u,i=D([]),r=D(!1),c=P(s,"visible"),n=D({visible:!1,importColumns:[],columns:[]}),o=J(),t=D({visible:!1,list:[]}),d=({results:v,header:l})=>{if(r.value=!0,v.length===0){S.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),r.value=!1;return}let b=!0;if(l.length!==f.length-1?b=!1:f.slice(1).forEach((e,B)=>{e.label!==l[B]&&(b=!1)}),!b){n.value.visible=!0,n.value.importColumns=[...l],n.value.columns=f.slice(1).map(({label:e})=>e),r.value=!1;return}i.value=[];const m=[];for(const e of v){const B={};Object.keys(e).forEach((x,Ce)=>{const N=ie[x.replace("_1","")];let C=e[x];x==="\u53D1\u7968\u7C7B\u578B"&&(C=C.replace("(","\uFF08"),C=C.replace(")","\uFF09")),B[N]=C&&String(C).trim()}),m.push(B)}de(m)&&(i.value=m),r.value=!1},I=async()=>{try{if(r.value)return;r.value=!0;const v=[];i.value.forEach(e=>{v.push({...e,inv_price:"",inv_unit:"",inv_subprice:"",inv_type:"",inv_good_name:e.goodName,inv_seller_code:e.seller_code,inv_buyer_code:e.buyer_code,inv_seller_name:e.seller_name,inv_buyer_name:e.buyer_name,relaArr:[],type:V[e.type],platform_type:"2",goodType:ae[e.goodType],cat_code:"0",cat_name:"0",channel:"3",source:"1",tax:"0",inv_tax:"0",inv_cat_code:"0"})});const{code:l,message:b,data:m}=await Y({list:v});if(r.value=!1,l==1004&&!m){t.value.visible=!0,t.value.list=m;return}o({code:l,message:b,noMessage:!1,handler:()=>{S.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),p("refresh"),c.value=!1}})}catch{}},L=()=>{i.value=[]};return(v,l)=>{const b=T("el-table-column"),m=T("el-table");return E(),g(F(X),{modelValue:F(c),"onUpdate:modelValue":l[2]||(l[2]=e=>$(c)?c.value=e:null),"close-on-click-modal":!1,title:"\u8BA2\u5355\u5546\u54C1(C\u7AEF\u65E0\u53D1\u7968\u51FA\u5E93)",width:"1040px",top:"8vh",center:"",onClose:l[3]||(l[3]=e=>i.value=[])},{default:y(()=>[i.value.length===0?(E(),g(F(Z),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:d})):W("v-if",!0),_(m,{data:i.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:y(()=>[(E(!0),A(Q,null,H(F(f),(e,B)=>(E(),g(b,{minWidth:e.minWidth,"show-overflow-tooltip":"",fixed:e.fixed,prop:e.prop,type:e.type,key:B},{header:y(()=>[e.required?(E(),A("p",fe,[l[4]||(l[4]=K("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),h(" "+k(e.label),1)])):(E(),A("span",me,k(e.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),i.value.length!==0?(E(),A("div",ce,[_(F(j),{size:"small",onClick:L},{default:y(()=>l[5]||(l[5]=[h("\u53D6\u6D88")])),_:1}),_(F(j),{size:"small",type:"primary",loading:r.value,onClick:I},{default:y(()=>l[6]||(l[6]=[h("\u4FDD\u5B58")])),_:1},8,["loading"])])):W("v-if",!0),_(re,{visible:t.value.visible,"onUpdate:visible":l[0]||(l[0]=e=>t.value.visible=e),list:t.value.list,title:"\u6570\u636E\u6821\u9A8C\u4E0D\u901A\u8FC7"},null,8,["visible","list"]),_(oe,{visible:n.value.visible,"onUpdate:visible":l[1]||(l[1]=e=>n.value.visible=e),"import-columns":n.value.importColumns,columns:n.value.columns},null,8,["visible","import-columns","columns"])]),_:1},8,["modelValue"])}}});var be=z(ve,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/clientC/components/OrderImportModal/index.vue"]]),ge=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{be as O,ge as i,xe as o};
|