index.a3a924.js 8.3 KB

1
  1. import{b3 as U,ac as q,_ as z,d as P,w as y,a$ as J,b4 as Q,r as W,o as E,G as h,C as D,l as F,a as T,j as _,c as A,F as H,D as K,L as k,h as $,M as g,aR as j,ah as X,b0 as Y,az as N}from"./index.js";import{b as Z}from"./index.0b63e24d.js";import{e as ee}from"./execl-upload.59283836.js";import{m as R,b as ue,t as S,s as M}from"./shared.a743a5f7.js";import{m as te,b as ae,x as O,c as w,d as le}from"./status.b7512d56.js";import{E as re}from"./index.53b07c6d.js";import{I as oe}from"./index.46232daf.js";const c=[{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-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"]}],xe=new Array(3).fill(1).map((r,u)=>c.slice(1).reduce((s,p)=>{const i=u===0;let o="";return i?o=p.required?"\u5FC5\u586B":"":o=p.defaultData[u-1],{...s,[p.label]:o}},{})),ie=c.reduce((r,u)=>({...r,[u.label]:u.prop}),{}),I=c.reduce((r,u)=>({...r,[u.prop]:u.label}),{}),se=c.filter(r=>!!r.required).map(r=>r.prop);function ne(r){U({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:q("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(r).reduce((u,s)=>[...u,q("p",{},"\u7B2C"+s+"\u884C,"+r[s])],[])})})}function pe(r){const u={};let s=!1,p=!1,i=!1,o=!1;for(const d in r){const n=r[d],a=Number(d)+1;for(const t in n){const m=String(n[t]).trim();se.includes(t)&&(!m||!String(m).trim())?u[a]?u[a]=u[a]+="\u3001"+I[t]:u[a]=I[t]:t==="type"&&!R[m]?s=!0:t==="source"&&!ue[m]?p=!0:t==="inv_type"&&!te[m]?i=!0:t==="goodType"&&!ae[m]&&(o=!0)}u[a]?(u[a]+="\u4E0D\u80FD\u4E3A\u7A7A",s&&(u[a]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+S.map(({label:t})=>t).join("\u3001")),p&&(u[a]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+M.map(({label:t})=>t).join("\u3001")),i&&(u[a]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+O.map(({label:t})=>t).join("\u3001")),o&&(u[a]+=" ,\u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+w.map(({label:t})=>t).join("\u3001"))):(s&&(u[a]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+S.map(({label:t})=>t).join("\u3001")),p&&(u[a]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+M.map(({label:t})=>t).join("\u3001")),i&&(u[a]=" \u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+O.map(({label:t})=>t).join("\u3001")),o&&(u[a]="\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(r){return!!pe(r)}const me={key:0},fe={key:1},ce={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},be=P({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(r,{emit:u}){const s=r,p=u,i=y([]),o=y(!1),d=y({visible:!1,list:[]}),n=y({visible:!1,importColumns:[],columns:[]}),a=J(s,"visible"),t=Q(),m=({results:b,header:l})=>{if(o.value=!0,b.length===0){N.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),o.value=!1;return}let v=!0;if(l.length!==c.length-1?v=!1:c.slice(1).forEach((e,B)=>{e.label!==l[B]&&(v=!1)}),!v){n.value.visible=!0,n.value.importColumns=[...l],n.value.columns=c.slice(1).map(({label:e})=>e),o.value=!1;return}i.value=[];const f=[];for(const e of b){const B={};Object.keys(e).forEach((x,Ce)=>{const L=ie[x.replace("_1","")];let C=e[x];x==="\u53D1\u7968\u7C7B\u578B"&&(C=C.replace("(","\uFF08"),C=C.replace(")","\uFF09")),B[L]=C&&String(C).trim()}),f.push(B)}de(f)&&(i.value=f),o.value=!1},V=async()=>{try{if(o.value)return;o.value=!0;const b=[];i.value.forEach(e=>{b.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:[{id:e.relaGoodNo,num:e.relaGoodNum}],type:R[e.type],platform_type:"2",goodType:le[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:v,data:f}=await Z({list:b});if(o.value=!1,l==1004&&!f){d.value.visible=!0,d.value.list=f;return}t({code:l,message:v,noMessage:!1,handler:()=>{N.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),p("refresh"),a.value=!1}})}catch{}},G=()=>{i.value=[]};return(b,l)=>{const v=W("el-table-column"),f=W("el-table");return E(),h(F(Y),{modelValue:F(a),"onUpdate:modelValue":l[2]||(l[2]=e=>X(a)?a.value=e: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:D(()=>[i.value.length===0?(E(),h(F(ee),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:m})):T("v-if",!0),_(f,{data:i.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:D(()=>[(E(!0),A(H,null,K(F(c),(e,B)=>(E(),h(v,{minWidth:e.minWidth,"show-overflow-tooltip":"",fixed:e.fixed,prop:e.prop,type:e.type,key:B},{header:D(()=>[e.required?(E(),A("p",fe,[l[3]||(l[3]=$("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),g(" "+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:G},{default:D(()=>l[4]||(l[4]=[g("\u53D6\u6D88")])),_:1}),_(F(j),{size:"small",type:"primary",loading:o.value,onClick:V},{default:D(()=>l[5]||(l[5]=[g("\u4FDD\u5B58")])),_:1},8,["loading"])])):T("v-if",!0),_(re,{visible:d.value.visible,"onUpdate:visible":l[0]||(l[0]=e=>d.value.visible=e),list:d.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 ve=z(be,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/clientC/components/NotOrderImportModal/index.vue"]]),he=Object.freeze(Object.defineProperty({__proto__:null,default:ve},Symbol.toStringTag,{value:"Module"}));export{ve as N,he as i,xe as n};