index.bdcf42.js 8.4 KB

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