index.6d3d49.js 8.7 KB

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