index.b1d127.js 8.3 KB

1
  1. import{by as P,a7 as k,_ as J,d as Q,m as x,bs as H,O as K,bz as $,r as S,o as B,A as T,x as y,h as F,a as j,f as _,c as g,F as X,y as Y,G as w,e as Z,H as W,bm as O,ac as ee,bt as ue,az as h}from"./index.js";import{c as te}from"./index.004a0bb2.js";import{e as le}from"./execl-upload.8692a4ce.js";import{m as L,b as ae,t as M,s as V}from"./shared.e8e6f3b6.js";import{m as re,b as oe,x as ie,c as I,d as se}from"./status.b7512d56.js";import{E as ne}from"./index.71c29d4d.js";import{I as pe}from"./index.e25db4d1.js";const v=[{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\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"]}],Te=new Array(3).fill(1).map((a,e)=>v.slice(1).reduce((n,d)=>{const s=e===0;let r="";return s?r=d.required?"\u5FC5\u586B":"":r=d.defaultData[e-1],{...n,[d.label]:r}},{})),de=v.reduce((a,e)=>({...a,[e.label]:e.prop}),{}),R=v.reduce((a,e)=>({...a,[e.prop]:e.label}),{}),me=v.filter(a=>!!a.required).map(a=>a.prop);function ce(a){P({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:k("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(a).reduce((e,n)=>[...e,k("p",{},"\u7B2C"+n+"\u884C,"+a[n])],[])})})}function fe(a){const e={};let n=!1,d=!1,s=!1,r=!1;for(const b in a){const p=a[b],o=Number(b)+1;for(const t in p){const i=String(p[t]).trim();me.includes(t)&&(!i||!String(i).trim())?e[o]?e[o]=e[o]+="\u3001"+R[t]:e[o]=R[t]:t==="type"&&!L[i]?n=!0:t==="source"&&!ae[i]?d=!0:t==="inv_type"&&!re[i]?s=!0:t==="goodType"&&!oe[i]&&(r=!0)}e[o]?(e[o]+="\u4E0D\u80FD\u4E3A\u7A7A",n&&(e[o]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+M.map(({label:t})=>t).join("\u3001")),d&&(e[o]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+V.map(({label:t})=>t).join("\u3001")),s&&(e[o]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+ie.map(({label:t})=>t).join("\u3001")),r&&(e[o]+=" ,\u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+I.map(({label:t})=>t).join("\u3001"))):(n&&(e[o]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+M.map(({label:t})=>t).join("\u3001")),d&&(e[o]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+V.map(({label:t})=>t).join("\u3001")),r&&(e[o]=" \u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+I.map(({label:t})=>t).join("\u3001")))}return Object.keys(e).length===0?!0:(ce(e),!1)}function ve(a){return!!fe(a)}const be={key:0},Ee={key:1},Ce={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},Be=Q({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(a,{emit:e}){const n=a,d=e,s=x([]),r=x(!1),b=H(n,"visible"),p=x({visible:!1,importColumns:[],columns:[]}),{getCurrentLicense:o}=K(),t=$(),i=x({visible:!1,list:[],title:""}),z=({results:E,header:l})=>{if(r.value=!0,E.length===0){h.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),r.value=!1;return}let c=!0;if(l.length!==v.length-1?c=!1:v.slice(1).forEach((f,A)=>{f.label!==l[A]&&(c=!1)}),!c){p.value.visible=!0,p.value.importColumns=[...l],p.value.columns=v.slice(1).map(({label:f})=>f),r.value=!1;return}s.value=[];const m=[];for(const f of E){const A={};Object.keys(f).forEach((q,ye)=>{const G=de[q.replace("_1","")];let C=f[q];q==="\u53D1\u7968\u7C7B\u578B"&&(C=C.replace("(","\uFF08"),C=C.replace(")","\uFF09")),A[G]=C&&String(C).trim()}),m.push(A)}const u=o(),D=[...new Set(m.map(({seller_code:f})=>f))];if(D.length!==1){h.warning("\u5BFC\u5165\u6570\u636E\u7684\u9500\u552E\u65B9\u516C\u53F8\u5FC5\u987B\u4E00\u81F4");return}if(D[0]!==u){h.warning("\u5BFC\u5165\u6570\u636E\u9500\u552E\u65B9\u516C\u53F8\u4E0E\u5F53\u524D\u9009\u62E9\u516C\u53F8\u4E0D\u4E00\u81F4");return}ve(m)&&(s.value=m),r.value=!1},N=async()=>{try{if(r.value)return;r.value=!0;const E=[];s.value.forEach(u=>{E.push({...u,inv_price:"",inv_unit:"",inv_subprice:"",inv_type:"",inv_good_name:u.goodName,inv_seller_code:u.seller_code,inv_buyer_code:u.buyer_code,inv_seller_name:u.seller_name,inv_buyer_name:u.buyer_name,relaArr:[],type:L[u.type],platform_type:"2",goodType:se[u.goodType],cat_code:"0",cat_name:"0",channel:"3",source:"1",tax:"0",inv_tax:"0",inv_cat_code:"0"})});const{code:l,message:c,data:m}=await te({list:E});if(r.value=!1,l==1004&&m){i.value.visible=!0,i.value.list=m,i.value.title=c;return}t({code:l,message:c,noMessage:!1,handler:()=>{h.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),d("refresh"),b.value=!1}})}catch{}},U=()=>{s.value=[]};return(E,l)=>{const c=S("el-table-column"),m=S("el-table");return B(),T(F(ue),{modelValue:F(b),"onUpdate:modelValue":l[2]||(l[2]=u=>ee(b)?b.value=u: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]=u=>s.value=[])},{default:y(()=>[s.value.length===0?(B(),T(F(le),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:z})):j("v-if",!0),_(m,{data:s.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:y(()=>[(B(!0),g(X,null,Y(F(v),(u,D)=>(B(),T(c,{minWidth:u.minWidth,"show-overflow-tooltip":"",fixed:u.fixed,prop:u.prop,type:u.type,key:D},{header:y(()=>[u.required?(B(),g("p",Ee,[l[4]||(l[4]=Z("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),W(" "+w(u.label),1)])):(B(),g("span",be,w(u.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),s.value.length!==0?(B(),g("div",Ce,[_(F(O),{size:"small",onClick:U},{default:y(()=>l[5]||(l[5]=[W("\u53D6\u6D88")])),_:1}),_(F(O),{size:"small",type:"primary",loading:r.value,onClick:N},{default:y(()=>l[6]||(l[6]=[W("\u4FDD\u5B58")])),_:1},8,["loading"])])):j("v-if",!0),_(ne,{visible:i.value.visible,"onUpdate:visible":l[0]||(l[0]=u=>i.value.visible=u),list:i.value.list,title:i.value.title},null,8,["visible","list","title"]),_(pe,{visible:p.value.visible,"onUpdate:visible":l[1]||(l[1]=u=>p.value.visible=u),"import-columns":p.value.importColumns,columns:p.value.columns},null,8,["visible","import-columns","columns"])]),_:1},8,["modelValue"])}}});var Fe=J(Be,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/clientC/components/OrderImportModal/index.vue"]]),We=Object.freeze(Object.defineProperty({__proto__:null,default:Fe},Symbol.toStringTag,{value:"Module"}));export{Fe as O,We as i,Te as o};