index.674a5d.js 8.0 KB

1
  1. import{by as L,a7 as q,_ as P,d as U,m as W,bs as H,bz as R,r as A,o as f,A as v,x,h as b,a as g,f as B,c as h,F as G,y as J,G as k,e as K,H as F,bm as O,ac as Q,bt as X,az as y}from"./index.js";import{e as Y}from"./execl-upload.8692a4ce.js";import{m as I,a as M,t as T,b as j}from"./shared.d9aac3ad.js";import{m as N,x as V}from"./status.b7512d56.js";import{c as Z}from"./index.004a0bb2.js";const m=[{type:"index",fixed:"left",label:"\u5E8F\u53F7",width:"50"},{label:"\u4E1A\u52A1\u7F16\u53F7",prop:"invoiceCode",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:"totalPrice",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:"\u7A0E\u7387",prop:"tax",minWidth:"100px",defaultData:"",required:!0},{label:"\u5173\u8054\u91D1\u989D",prop:"inv_fee",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:"inv_good_name",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_subprice",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u524D\u603B\u4EF7",prop:"inv_subtotal",minWidth:"100px",defaultData:"",required:!0},{label:"\u53D1\u7968\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}];m.slice(1).reduce((a,e)=>({...a,[e.label]:e.defaultData?e.defaultData:""}),{});const $=m.reduce((a,e)=>({...a,[e.label]:e.prop}),{}),w=m.reduce((a,e)=>({...a,[e.prop]:e.label}),{}),ee=m.filter(a=>!!a.required).map(a=>a.prop);function ue(a){L({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:q("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(a).reduce((e,r)=>[...e,q("p",{},"\u7B2C"+r+"\u884C,"+a[r])],[])})})}function te(a){const e={};let r=!1,o=!1,E=!1;for(const _ in a){const p=a[_],l=Number(_)+1;for(const u in p){const d=String(p[u]).trim();ee.includes(u)&&(!d||!String(d).trim())?e[l]?e[l]=e[l]+="\u3001"+w[u]:e[l]=w[u]:u==="type"&&!I[d]?r=!0:u==="source"&&!M[d]?o=!0:u==="inv_type"&&!N[d]&&(E=!0)}e[l]?(e[l]+="\u4E0D\u80FD\u4E3A\u7A7A",r&&(e[l]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+T.map(({label:u})=>u).join("\u3001")),o&&(e[l]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+j.map(({label:u})=>u).join("\u3001")),E&&(e[l]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+V.map(({label:u})=>u).join("\u3001"))):(r&&(e[l]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+T.map(({label:u})=>u).join("\u3001")),o&&(e[l]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+j.map(({label:u})=>u).join("\u3001")),E&&(e[l]=" \u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+V.map(({label:u})=>u).join("\u3001")))}return Object.keys(e).length===0?!0:(ue(e),!1)}function ae(a){return!!te(a)}const re={key:0},le={key:1},ie={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},oe=U({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(a,{emit:e}){const r=W([]),o=W(!1),E=e,p=H(a,"visible"),l=R(),u=({results:n,header:i})=>{if(o.value=!0,n.length===0){y.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),o.value=!1;return}let s=!0;if(i.length!==m.length-1?s=!1:m.slice(1).forEach((t,D)=>{t.label!==i[D]&&(s=!1)}),!s){y.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),o.value=!1;return}r.value=[];const c=[];for(const t of n){const D={};Object.keys(t).forEach(C=>{const z=$[C];D[z]=t[C]}),c.push(D)}ae(c)&&(r.value=c),o.value=!1},d=async()=>{try{if(o.value)return;o.value=!0;const n=[];r.value.forEach(t=>{n.push({...t,inv_type:N[t.inv_type],source:M[t.source],type:I[t.type],buyer_name:t.inv_buyer_name,buyer_code:t.inv_buyer_code,platform_type:"1",channel:"1",goodType:"1"})});const{code:i,message:s,data:c}=await Z({list:n});o.value=!1,l({code:i,message:s,noMessage:!1,handler:()=>{y.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),E("refresh"),p.value=!1}})}catch{}},S=()=>{r.value=[]};return(n,i)=>{const s=A("el-table-column"),c=A("el-table");return f(),v(b(X),{modelValue:b(p),"onUpdate:modelValue":i[0]||(i[0]=t=>Q(p)?p.value=t:null),"close-on-click-modal":!1,title:"\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:""},{default:x(()=>[r.value.length===0?(f(),v(b(Y),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:u})):g("v-if",!0),B(c,{data:r.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:x(()=>[(f(!0),h(G,null,J(b(m),(t,D)=>(f(),v(s,{minWidth:t.minWidth,"show-overflow-tooltip":"",fixed:t.fixed,prop:t.prop,type:t.type,key:D},{header:x(()=>[t.required?(f(),h("p",le,[i[1]||(i[1]=K("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),F(" "+k(t.label),1)])):(f(),h("span",re,k(t.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),r.value.length!==0?(f(),h("div",ie,[B(b(O),{size:"small",onClick:S},{default:x(()=>i[2]||(i[2]=[F("\u53D6\u6D88")])),_:1}),B(b(O),{size:"small",type:"primary",loading:o.value,onClick:d},{default:x(()=>i[3]||(i[3]=[F("\u4FDD\u5B58")])),_:1},8,["loading"])])):g("v-if",!0)]),_:1},8,["modelValue"])}}});var me=P(oe,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/provisionOut/components/OrderImportModal/index.vue"]]);export{me as default};