1 |
- import{b3 as z,ac as g,_ as L,d as P,w as A,a_ as R,b4 as U,r as q,o as c,G as D,C as h,l as y,a as k,j as B,c as x,F as H,D as G,L as W,h as $,M as _,aR as j,ah as J,a$ as K,az as v}from"./index.js";import{a as Q}from"./index.ac9c33da.js";import{e as X}from"./execl-upload.615bf98a.js";import{b as M,c as Y,t as O,s as T}from"./shared.e62a6d9e.js";import{m as S,x as w}from"./status.0f771e9a.js";const m=[{type:"index",fixed:"left",label:"\u5E8F\u53F7",width:"50"},{label:"\u786E\u8BA4\u5355\u7F16\u53F7",prop:"orderCode",minWidth:"100px",required:!0,defaultData:""},{label:"\u9500\u552E\u4E3B\u5355\u53F7",prop:"cxCode",minWidth:"100px",required:!0,defaultData:""},{label:"\u4E1A\u52A1\u7C7B\u578B",prop:"type",minWidth:"100px",required:!0,defaultData:""},{label:"\u5E73\u53F0\u8BA2\u5355\u53F7",prop:"poCode",minWidth:"120px",required:!0,defaultData:""},{label:"\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7",prop:"seller_code",minWidth:"130px",required:!0,defaultData:""},{label:"\u9500\u552E\u65B9\u516C\u53F8\u540D\u79F0",prop:"seller_name",minWidth:"130px",required:!0,defaultData:""},{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u7F16\u53F7",prop:"buyer_code",minWidth:"120px",required:!0,defaultData:""},{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0",prop:"buyer_name",minWidth:"120px",required:!0,defaultData:""},{label:"\u5546\u54C1\u7C7B\u578B",prop:"goodNo",minWidth:"100px",required:!0,defaultData:""},{label:"\u5546\u54C1\u7F16\u53F7",prop:"goodNo",minWidth:"100px",required:!0,defaultData:""},{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",minWidth:"100px",required:!0,defaultData:""},{label:"\u4E0B\u5355\u6570\u91CF",prop:"num",minWidth:"110px",required:!0,defaultData:""},{label:"\u9500\u552E\u5355\u4EF7",prop:"goodPrice",minWidth:"110px",required:!0,defaultData:""},{label:"\u9500\u552E\u5408\u8BA1",prop:"totalPrice",minWidth:"110px",required:!0,defaultData:""},{label:"\u51FA\u5E93\u6708\u4EFD",prop:"fz_date",minWidth:"80px",required:!0,defaultData:""}],me=[m.slice(1).reduce((t,e)=>({...t,[e.label]:e.defaultData?e.defaultData:""}),{})],Z=m.reduce((t,e)=>({...t,[e.label]:e.prop}),{}),V=m.reduce((t,e)=>({...t,[e.prop]:e.label}),{}),ee=m.filter(t=>!!t.required).map(t=>t.prop);function ue(t){z({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:g("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(t).reduce((e,s)=>[...e,g("p",{},"\u7B2C"+s+"\u884C,"+t[s])],[])})})}function te(t){const e={};let s=!1,F=!1,o=!1;for(const i in t){const n=t[i],r=Number(i)+1;for(const u in n){const p=String(n[u]).trim();ee.includes(u)&&(!p||!String(p).trim())?e[r]?e[r]=e[r]+="\u3001"+V[u]:e[r]=V[u]:u==="type"&&!M[p]?s=!0:u==="source"&&!Y[p]?F=!0:u==="inv_type"&&!S[p]&&(o=!0)}e[r]?(e[r]+="\u4E0D\u80FD\u4E3A\u7A7A",s&&(e[r]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+O.map(({label:u})=>u).join("\u3001")),F&&(e[r]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+T.map(({label:u})=>u).join("\u3001")),o&&(e[r]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+w.map(({label:u})=>u).join("\u3001"))):(s&&(e[r]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+O.map(({label:u})=>u).join("\u3001")),F&&(e[r]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+T.map(({label:u})=>u).join("\u3001")),o&&(e[r]=" \u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+w.map(({label:u})=>u).join("\u3001")))}return Object.keys(e).length===0?!0:(ue(e),!1)}function ae(t){return!!te(t)}const re={key:0},le={key:1},oe={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},ie=P({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(t,{emit:e}){const s=t,F=e,o=A([]),i=A(!1),n=R(s,"visible"),r=U(),u=({results:d,header:l})=>{if(i.value=!0,d.length===0){v.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),i.value=!1;return}let f=!0;if(l.length!==m.length-1?f=!1:m.slice(1).forEach((a,E)=>{a.label!==l[E]&&(f=!1)}),!f){v.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),i.value=!1;return}o.value=[];const b=[];for(const a of d){const E={};Object.keys(a).forEach(C=>{const N=Z[C];E[N]=a[C]}),b.push(E)}ae(b)&&(o.value=b),i.value=!1},p=async()=>{try{if(i.value)return;i.value=!0;const d=[];o.value.forEach(a=>{d.push({...a,inv_type:S[a.inv_type],relaArr:[{id:1,num:a.num}],type:M[a.type],platform_type:"2",goodType:"1",cat_code:"0",cat_name:"0",channel:"3",source:"1",unit:"0",tax:"0"})});const{code:l,message:f,data:b}=await Q({list:d});i.value=!1,r({code:l,message:f,noMessage:!1,handler:()=>{v.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),F("refresh"),n.value=!1}})}catch{}},I=()=>{o.value=[]};return(d,l)=>{const f=q("el-table-column"),b=q("el-table");return c(),D(y(K),{modelValue:y(n),"onUpdate:modelValue":l[0]||(l[0]=a=>J(n)?n.value=a:null),"close-on-click-modal":!1,title:"C\u7AEF\u65E0\u53D1\u7968\u8BA2\u5355\u51FA\u5E93",width:"1040px",top:"8vh",center:""},{default:h(()=>[o.value.length===0?(c(),D(y(X),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:u})):k("v-if",!0),B(b,{data:o.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:h(()=>[(c(!0),x(H,null,G(y(m),(a,E)=>(c(),D(f,{minWidth:a.minWidth,"show-overflow-tooltip":"",fixed:a.fixed,prop:a.prop,type:a.type,key:E},{header:h(()=>[a.required?(c(),x("p",le,[l[1]||(l[1]=$("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),_(" "+W(a.label),1)])):(c(),x("span",re,W(a.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),o.value.length!==0?(c(),x("div",oe,[B(y(j),{size:"small",onClick:I},{default:h(()=>l[2]||(l[2]=[_("\u53D6\u6D88")])),_:1}),B(y(j),{size:"small",type:"primary",loading:i.value,onClick:p},{default:h(()=>l[3]||(l[3]=[_("\u4FDD\u5B58")])),_:1},8,["loading"])])):k("v-if",!0)]),_:1},8,["modelValue"])}}});var se=L(ie,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/clientC/components/OrderImportModal/index.vue"]]),be=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));export{se as O,be as i,me as o};
|