index.a712f1.js 7.6 KB

1
  1. import{aT as N,a1 as q,_ as V,d as I,w as y,aR as L,aU as P,r as W,o as p,G as F,C as b,l as c,a as A,j as B,c as x,F as z,D as U,L as g,h as R,M as _,aJ as O,a6 as H,aS as G,aq as v}from"./index.js";import{h as J}from"./index.4a9af8a9.js";import{e as K}from"./execl-upload.2ba69270.js";import{b as Q,c as X,t as k,s as T}from"./shared.6241f91b.js";const n=[{type:"index",fixed:"left",label:"\u5E8F\u53F7",width:"50"},{label:"\u4E1A\u52A1\u7F16\u53F7",prop:"code",minWidth:"100px",defaultData:"",required:!0},{label:"\u7C7B\u578B",prop:"type",minWidth:"100px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u6765\u6E90",prop:"source",minWidth:"100px",defaultData:"",required:!0},{label:"\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u8BC6\u522B\u53F7",prop:"seller_code",minWidth:"160px",defaultData:"",required:!0},{label:"\u9500\u552E\u65B9\u516C\u53F8",prop:"seller_name",minWidth:"100px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u7F16\u53F7",prop:"orderCode",minWidth:"120px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u4E3B\u5355\u53F7",prop:"cxCode",minWidth:"120px",defaultData:"",required:!0},{label:"\u5546\u54C1\u7F16\u53F7",prop:"goodNo",minWidth:"100px",defaultData:"",required:!0},{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",minWidth:"100px",defaultData:"",required:!0},{label:"\u5355\u4F4D",prop:"unit",minWidth:"80px",defaultData:"",required:!0},{label:"\u5546\u54C1\u6570\u91CF",prop:"num",minWidth:"110px",defaultData:"",required:!0},{label:"\u5546\u54C1\u5355\u4EF7",prop:"goodPrice",minWidth:"110px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u603B\u91D1\u989D",prop:"totalPirce",minWidth:"110px",defaultData:"",required:!0},{label:"\u7A0E\u76EE",prop:"cat_code",minWidth:"80px",defaultData:"",required:!0},{label:"\u7A0E\u76EE\u540D\u79F0",prop:"cat_name",minWidth:"100px",defaultData:"",required:!0},{label:"\u5173\u8054\u91D1\u989D",prop:"relaTotal",minWidth:"100px",defaultData:"",required:!0},{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0",prop:"inv_buyer_name",minWidth:"130px",defaultData:"",required:!0},{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u7EB3\u7A0E\u8BC6\u522B\u53F7",prop:"inv_buyer_code",minWidth:"170px",defaultData:"",required:!0},{label:"\u53D1\u7968\u53F7\u7801",prop:"inv_number",minWidth:"100px",defaultData:"",required:!0},{label:"\u53D1\u7968\u7C7B\u578B",prop:"inv_type",minWidth:"100px",defaultData:"",required:!0},{label:"\u53D1\u7968\u9500\u552E\u65B9\u516C\u53F8",prop:"inv_seller_name",minWidth:"130px",defaultData:"",required:!0},{label:"\u53D1\u7968\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7",prop:"inv_seller_code",minWidth:"170px",defaultData:"",required:!0},{label:"\u53D1\u7968\u660E\u7EC6ID",prop:"inv_item_id",minWidth:"110px",defaultData:"",required:!0},{label:"\u8D27\u7269\u6216\u5E94\u7A0E\u52B3\u52A1\u3001\u670D\u52A1\u540D\u79F0",prop:"TODO24",minWidth:"200px",defaultData:"",required:!0},{label:"\u7C7B\u76EE\u7F16\u53F7",prop:"inv_cat_code",minWidth:"90px",defaultData:"",required:!0},{label:"\u89C4\u683C\u578B\u53F7",prop:"inv_spec",minWidth:"110px",defaultData:"",required:!0},{label:"\u53D1\u7968\u5546\u54C1\u5355\u4F4D",prop:"inv_unit",minWidth:"100px",defaultData:"",required:!0},{label:"\u53D1\u7968\u5546\u54C1\u6570\u91CF",prop:"inv_num",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u524D\u5355\u4EF7",prop:"inv_price",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u524D\u603B\u4EF7",prop:"inv_subprice",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u7387",prop:"inv_tax",minWidth:"80px",defaultData:"",required:!0},{label:"\u7A0E\u540E\u5355\u4EF7",prop:"inv_price",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u540E\u603B\u989D",prop:"inv_total",minWidth:"100px",defaultData:"",required:!0},{label:"\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001",prop:"TODO34",minWidth:"100px",defaultData:"",required:!1},{label:"\u7A0E\u7387\u72B6\u6001",prop:"TODO35",minWidth:"100px",defaultData:"",required:!1},{label:"\u5907\u6CE8",prop:"remark",minWidth:"80px",defaultData:"",required:!0},{label:"\u5165\u8D26\u6708\u4EFD",prop:"TODO37",minWidth:"80px",defaultData:"",required:!0}],se=[n.slice(1).reduce((u,e)=>({...u,[e.label]:e.defaultData?e.defaultData:""}),{})],Y=n.reduce((u,e)=>({...u,[e.label]:e.prop}),{}),j=n.reduce((u,e)=>({...u,[e.prop]:e.label}),{}),Z=n.filter(u=>!!u.required).map(u=>u.prop);function $(u){N({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:q("div",{style:"display: flex, flex-direction:column"},{default:()=>Object.keys(u).reduce((e,a)=>[...e,q("p",{},"\u7B2C"+a+"\u884C,"+u[a])],[])})})}function ee(u){const e={};let a=!1,o=!1;for(const E in u){const h=u[E],r=Number(E)+1;for(const t in h){const s=String(h[t]).trim();Z.includes(t)&&(!s||!String(s).trim())?e[r]?e[r]=e[r]+="\u3001"+j[t]:e[r]=j[t]:t==="type"&&!Q[s]?a=!0:t==="source"&&!X[s]&&(o=!0)}e[r]?(e[r]+="\u4E0D\u80FD\u4E3A\u7A7A",a&&(e[r]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+k.map(({label:t})=>t).join("\u3001")),o&&(e[r]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+T.map(({label:t})=>t).join("\u3001"))):(a&&(e[r]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+k.map(({label:t})=>t).join("\u3001")),o&&(e[r]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+T.map(({label:t})=>t).join("\u3001")))}return Object.keys(e).length===0?!0:($(e),!1)}function ue(u){return!!ee(u)}const te={key:0},ae={key:1},re={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},le=I({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["onSuccess"],setup(u,{emit:e}){const a=y(!1),o=y([]),E=e,r=L(u,"visible"),t=P(),s=({results:D,header:i})=>{if(a.value=!0,D.length===0){v.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),a.value=!1;return}let d=!0;if(i.length!==n.length-1?d=!1:n.slice(1).forEach((l,m)=>{l.label!==i[m]&&(d=!1)}),!d){v.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),a.value=!1;return}o.value=[];const f=[];for(const l of D){const m={};Object.keys(l).forEach(C=>{const M=Y[C];m[M]=l[C]}),f.push(m)}ue(f)&&(o.value=f),a.value=!1},S=async()=>{try{if(a.value)return;a.value=!0;const D=[],{code:i,message:d,data:f}=await J({});a.value=!1,t({code:i,message:d,noMessage:!1,handler:()=>{v.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),E("onSuccess"),r.value=!1}})}catch{}},w=()=>{o.value=[]};return(D,i)=>{const d=W("el-table-column"),f=W("el-table");return p(),F(c(G),{modelValue:c(r),"onUpdate:modelValue":i[0]||(i[0]=l=>H(r)?r.value=l:null),"close-on-click-modal":!1,title:"\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:""},{default:b(()=>[o.value.length===0?(p(),F(c(K),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:s})):A("v-if",!0),B(f,{data:o.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:b(()=>[(p(!0),x(z,null,U(c(n),(l,m)=>(p(),F(d,{minWidth:l.minWidth,"show-overflow-tooltip":"",fixed:l.fixed,prop:l.prop,type:l.type,key:m},{header:b(()=>[l.required?(p(),x("p",ae,[i[1]||(i[1]=R("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),_(" "+g(l.label),1)])):(p(),x("span",te,g(l.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),o.value.length!==0?(p(),x("div",re,[B(c(O),{size:"small",onClick:w},{default:b(()=>i[2]||(i[2]=[_("\u53D6\u6D88")])),_:1}),B(c(O),{size:"small",type:"primary",loading:a.value,onClick:S},{default:b(()=>i[3]||(i[3]=[_("\u4FDD\u5B58")])),_:1},8,["loading"])])):A("v-if",!0)]),_:1},8,["modelValue"])}}});var ie=V(le,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inOutManager/components/NotOrderImportModal/index.vue"]]),fe=Object.freeze(Object.defineProperty({__proto__:null,default:ie},Symbol.toStringTag,{value:"Module"}));export{ie as N,fe as i,se as n};