index.eeea76.js 10.0 KB

1
  1. import{b2 as P,ac as g,_ as R,d as U,w as j,aZ as H,b3 as Z,r as N,o as n,G as y,C as B,l as D,a as T,j as A,c as h,F as $,D as J,L as k,h as K,M as W,aR as O,ah as Q,a_ as X,az as q}from"./index.js";import{e as Y}from"./execl-upload.0e9ffc49.js";import{b as V,d as S,e as L,t as w,s as I,f as s}from"./shared.9d577e31.js";import{a as uu}from"./index.00d6e041.js";import{m as G,b as eu,x as au,d as tu}from"./status.4e0ebdbc.js";const f=[{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:"\u8BA2\u5355\u8D2D\u4E70\u65B9\u7EB3\u7A0E\u53F7",prop:"buyer_code",minWidth:"130px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0",prop:"buyer_name",minWidth:"150px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7",prop:"seller_code",minWidth:"160px",defaultData:"",required:!0},{label:"\u8BA2\u5355\u9500\u552E\u65B9\u516C\u53F8\u540D\u79F0",prop:"seller_name",minWidth:"160px",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:""},{label:"\u5546\u54C1\u7C7B\u578B",prop:"goodType",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:"\u8BA2\u5355\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:"\u8BA2\u5355\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\u7EB3\u7A0E\u53F7",prop:"inv_buyer_code",minWidth:"130px",defaultData:"",required:!0},{label:"\u8D2D\u4E70\u65B9\u540D\u79F0",prop:"inv_buyer_name",minWidth:"170px",defaultData:"",required:!0},{label:"\u53D1\u7968\u53F7\u7801",prop:"inv_number",minWidth:"100px",defaultData:"",required:!0},{label:"\u5F00\u7968\u65E5\u671F",prop:"inv_open_date",minWidth:"100px",defaultData:"",required:!0},{label:"\u53D1\u7968\u7C7B\u578B",prop:"inv_type",minWidth:"100px",defaultData:"",required:!0},{label:"\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7",mapLabel:"\u53D1\u7968\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7",prop:"inv_seller_code",minWidth:"170px",defaultData:"",required:!0},{label:"\u9500\u552E\u65B9\u516C\u53F8",prop:"inv_seller_name",minWidth:"130px",defaultData:"",required:!0},{label:"\u53D1\u7968\u660E\u7EC6ID",prop:"inv_item_id",minWidth:"110px",defaultData:""},{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:""},{label:"\u5355\u4F4D",mapLabel:"\u53D1\u7968\u5546\u54C1\u5355\u4F4D",prop:"inv_unit",minWidth:"100px",defaultData:""},{label:"\u6570\u91CF",prop:"inv_num",minWidth:"100px",defaultData:""},{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:"\u7A0E\u7387",prop:"inv_tax",minWidth:"80px",defaultData:"",required:!0},{label:"\u7A0E\u989D",prop:"inv_tax_total",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:"cat_diff",minWidth:"100px",defaultData:"",required:!0},{label:"\u7A0E\u7387\u72B6\u6001",prop:"tax_diff",minWidth:"100px",defaultData:"",required:!0},{label:"\u5907\u6CE8",prop:"remark",minWidth:"80px",defaultData:""},{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}],Bu=[f.slice(1).reduce((l,e)=>({...l,[e.label]:e.defaultData?e.defaultData:""}),{})],ru=f.reduce((l,e)=>({...l,[e.label]:e.prop}),{}),M=f.reduce((l,e)=>({...l,[e.prop]:e.label}),{}),lu=f.filter(l=>!!l.required).map(l=>l.prop);function iu(l){P({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:g("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(l).reduce((e,i)=>[...e,g("p",{},"\u7B2C"+i+"\u884C,"+l[i])],[])})})}function ou(l){const e={};let i=!1,o=!1,b=!1,C=!1,p=!1,E=!1;for(const x in l){const _=l[x],r=Number(x)+1;for(const u in _){const t=String(_[u]).trim();lu.includes(u)&&(!t||!String(t).trim())?e[r]?e[r]=e[r]+="\u3001"+M[u]:e[r]=M[u]:u==="type"&&!V[t]?i=!0:u==="source"&&!S[t]?o=!0:u==="inv_type"&&!G[t]?b=!0:u==="tax_diff"&&!L[t]?C=!0:u==="cat_diff"&&!L[t]?p=!0:u==="goodType"&&eu[t]&&(E=!1)}e[r]?(e[r]+="\u4E0D\u80FD\u4E3A\u7A7A",i&&(e[r]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+w.map(({label:u})=>u).join("\u3001")),o&&(e[r]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+I.map(({label:u})=>u).join("\u3001")),b&&(e[r]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+au.map(({label:u})=>u).join("\u3001")),C&&(e[r]+=" ,\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+s.map(({label:u})=>u).join("\u3001")),p&&(e[r]+=" ,\u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+s.map(({label:u})=>u).join("\u3001")),p&&(e[r]+=" ,\u7A0E\u7387\u72B6\u6001"+s.map(({label:u})=>u).join("\u3001")),E&&(e[r]+=" ,\u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+s.map(({label:u})=>u).join("\u3001"))):(i&&(e[r]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+w.map(({label:u})=>u).join("\u3001")),o&&(e[r]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+I.map(({label:u})=>u).join("\u3001")),b&&(e[r]=" \u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+s.map(({label:u})=>u).join("\u3001")),p&&(e[r]=" \u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+s.map(({label:u})=>u).join("\u3001")),E&&(e[r]=" \u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+s.map(({label:u})=>u).join("\u3001")))}return Object.keys(e).length===0?!0:(iu(e),!1)}function pu(l){return!!ou(l)}const du={key:0},nu={key:1},su={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},fu=U({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(l,{emit:e}){const i=j(!1),o=j([]),b=e,p=H(l,"visible"),E=Z(),x=({results:u,header:t})=>{if(i.value=!0,u.length===0){q.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),i.value=!1;return}let d=!0;if(t.length!==f.length-1?d=!1:f.slice(1).forEach((a,c)=>{a.label!==t[c]&&(d=!1)}),!d){q.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),i.value=!1;return}o.value=[];const m=[];for(const a of u){const c={};Object.keys(a).forEach(v=>{const z=ru[v];let F=a[v];v==="\u53D1\u7968\u7C7B\u578B"&&(F=F.replace("(","\uFF08"),F=F.replace(")","\uFF09")),c[z]=F}),m.push(c)}pu(m)&&(o.value=m),i.value=!1},_=async()=>{try{if(i.value)return;i.value=!0;const u=[];o.value.forEach(a=>{u.push({...a,inv_type:G[a.inv_type],source:S[a.source],type:V[a.type],goodType:tu[a.goodType],inv_num:Number(a.inv_num).toFixed(8),inv_subprice:Number(a.inv_subprice).toFixed(8),inv_subtotal:Number(a.inv_subtotal).toFixed(8),inv_price:Number(a.inv_price).toFixed(8),inv_total:Number(a.inv_tax_total).toFixed(8),platform_type:"1",channel:"2",relaArr:[{id:a.relaGoodNo,num:a.relaGoodNum}]})});const{code:t,message:d,data:m}=await uu({list:u});i.value=!1,E({code:t,message:d,noMessage:!1,handler:()=>{q.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),b("refresh"),p.value=!1}})}catch{}},r=()=>{o.value=[]};return(u,t)=>{const d=N("el-table-column"),m=N("el-table");return n(),y(D(X),{modelValue:D(p),"onUpdate:modelValue":t[0]||(t[0]=a=>Q(p)?p.value=a:null),"close-on-click-modal":!1,title:"\u975E\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:"",onClose:t[1]||(t[1]=a=>o.value=[])},{default:B(()=>[o.value.length===0?(n(),y(D(Y),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:x})):T("v-if",!0),A(m,{data:o.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:B(()=>[(n(!0),h($,null,J(D(f),(a,c)=>(n(),y(d,{minWidth:a.minWidth,"show-overflow-tooltip":"",fixed:a.fixed,prop:a.prop,type:a.type,key:c},{header:B(()=>[a.required?(n(),h("p",nu,[t[2]||(t[2]=K("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),W(" "+k(a.label),1)])):(n(),h("span",du,k(a.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),o.value.length!==0?(n(),h("div",su,[A(D(O),{size:"small",onClick:r},{default:B(()=>t[3]||(t[3]=[W("\u53D6\u6D88")])),_:1}),A(D(O),{size:"small",type:"primary",loading:i.value,onClick:_},{default:B(()=>t[4]||(t[4]=[W("\u4FDD\u5B58")])),_:1},8,["loading"])])):T("v-if",!0)]),_:1},8,["modelValue"])}}});var mu=R(fu,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inManager/components/NotOrderImportModal/index.vue"]]),xu=Object.freeze(Object.defineProperty({__proto__:null,default:mu},Symbol.toStringTag,{value:"Module"}));export{mu as N,xu as i,Bu as n};