1 |
- import{b3 as H,ac as k,_ as $,d as J,w as O,U as K,a_ as Q,b4 as X,r as w,o as f,G as g,C as _,l as E,a as L,j,c as W,F as Y,D as Z,L as N,h as uu,M as T,aR as M,ah as eu,a$ as tu,az as x}from"./index.js";import{e as au}from"./execl-upload.615bf98a.js";import{b as P,d as U,e as S,t as V,s as I,f as m}from"./shared.4cd09a2f.js";import{m as G,b as ru,x as iu,d as lu}from"./status.0f771e9a.js";import{a as ou}from"./index.ac9c33da.js";const c=[{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:"",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:"\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:"\u5165\u8D26\u6708\u4EFD",prop:"fz_date",minWidth:"80px",defaultData:"",required:!0}],hu=[c.slice(1).reduce((r,e)=>({...r,[e.label]:e.defaultData?e.defaultData:""}),{})],pu=c.reduce((r,e)=>({...r,[e.label]:e.prop}),{}),z=c.reduce((r,e)=>({...r,[e.prop]:e.label}),{}),nu=c.filter(r=>!!r.required).map(r=>r.prop);function du(r){H({type:"warning",title:"\u6570\u636E\u6821\u9A8C\u5931\u8D25",message:k("div",{style:"display: flex, flex-direction: column"},{default:()=>Object.keys(r).reduce((e,l)=>[...e,k("p",{},"\u7B2C"+l+"\u884C,"+r[l])],[])})})}function su(r){const e={};let l=!1,p=!1,b=!1,v=!1,F=!1,n=!1;for(const C in r){const h=r[C],a=Number(C)+1;for(const u in h){const i=String(h[u]).trim();nu.includes(u)&&(!i||!String(i).trim())?e[a]?e[a]=e[a]+="\u3001"+z[u]:e[a]=z[u]:u==="type"&&!P[i]?l=!0:u==="source"&&!U[i]?p=!0:u==="inv_type"&&!G[i]?b=!0:u==="tax_diff"&&!S[i]?v=!0:u==="cat_diff"&&!S[i]?F=!0:u==="goodType"&&ru[i]&&(n=!1)}e[a]?(e[a]+="\u4E0D\u80FD\u4E3A\u7A7A",l&&(e[a]+=" , \u7C7B\u578B\u5FC5\u987B\u4E3A"+V.map(({label:u})=>u).join("\u3001")),p&&(e[a]+=" ,\u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+I.map(({label:u})=>u).join("\u3001")),b&&(e[a]+=" ,\u53D1\u7968\u7C7B\u578B\u5FC5\u987B\u4E3A"+iu.map(({label:u})=>u).join("\u3001")),v&&(e[a]+=" ,\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+m.map(({label:u})=>u).join("\u3001")),F&&(e[a]+=" ,\u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+m.map(({label:u})=>u).join("\u3001")),F&&(e[a]+=" ,\u7A0E\u7387\u72B6\u6001"+m.map(({label:u})=>u).join("\u3001")),n&&(e[a]+=" ,\u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+m.map(({label:u})=>u).join("\u3001"))):(l&&(e[a]="\u7C7B\u578B\u5FC5\u987B\u4E3A"+V.map(({label:u})=>u).join("\u3001")),p&&(e[a]=" \u8BA2\u5355\u6765\u6E90\u5FC5\u987B\u4E3A"+I.map(({label:u})=>u).join("\u3001")),b&&(e[a]=" \u7C7B\u76EE\u7F16\u53F7\u72B6\u6001\u5FC5\u987B\u4E3A"+m.map(({label:u})=>u).join("\u3001")),F&&(e[a]=" \u7A0E\u7387\u72B6\u6001\u5FC5\u987B\u4E3A"+m.map(({label:u})=>u).join("\u3001")),n&&(e[a]=" \u5546\u54C1\u7C7B\u578B\u5FC5\u987B\u4E3A"+m.map(({label:u})=>u).join("\u3001")))}return Object.keys(e).length===0?!0:(du(e),!1)}function fu(r){return!!su(r)}const mu={key:0},cu={key:1},Du={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},Eu=J({__name:"index",props:{visible:{type:Boolean,required:!0}},emits:["refresh"],setup(r,{emit:e}){const l=O([]),p=O(!1),{getCurrentLicense:b}=K(),v=e,n=Q(r,"visible"),C=X(),h=({results:i,header:o})=>{if(p.value=!0,i.length===0){x.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),p.value=!1;return}let d=!0;if(o.length!==c.length-1?d=!1:c.slice(1).forEach((D,A)=>{D.label!==o[A]&&(d=!1)}),!d){x.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),p.value=!1;return}l.value=[];const s=[];for(const D of i){const A={};Object.keys(D).forEach((q,Fu)=>{const R=pu[q.replace("_1","")];let B=D[q];q==="\u53D1\u7968\u7C7B\u578B"&&(B=B.replace("(","\uFF08"),B=B.replace(")","\uFF09")),A[R]=B.trim()}),s.push(A)}const t=b(),y=[...new Set(s.map(({inv_buyer_code:D})=>D))];if(y.length!==1){x.warning("\u5BFC\u5165\u6570\u636E\u7684\u8D2D\u4E70\u65B9\u516C\u53F8\u5FC5\u987B\u4E00\u81F4");return}if(y[0]!==t){x.warning("\u5BFC\u5165\u6570\u636E\u8D2D\u4E70\u65B9\u516C\u53F8\u4E0E\u5F53\u524D\u9009\u62E9\u516C\u53F8\u4E0D\u4E00\u81F4");return}fu(s)&&(l.value=s),p.value=!1},a=async()=>{try{if(p.value)return;p.value=!0;const i=[];l.value.forEach(t=>{i.push({...t,inv_type:G[t.inv_type],source:U[t.source],type:P[t.type],goodType:lu[t.goodType],inv_num:Number(t.inv_num).toFixed(8),inv_subprice:Number(t.inv_subprice).toFixed(8),inv_subtotal:Number(t.inv_subtotal).toFixed(8),inv_price:Number(t.inv_price).toFixed(8),inv_total:Number(t.inv_tax_total).toFixed(8),platform_type:"1",channel:"1"})});const{code:o,message:d,data:s}=await ou({list:i});p.value=!1,C({code:o,message:d,noMessage:!1,handler:()=>{x.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),v("refresh"),n.value=!1}})}catch{}},u=()=>{l.value=[]};return(i,o)=>{const d=w("el-table-column"),s=w("el-table");return f(),g(E(tu),{modelValue:E(n),"onUpdate:modelValue":o[0]||(o[0]=t=>eu(n)?n.value=t:null),"close-on-click-modal":!1,title:"\u8BA2\u5355\u5546\u54C1\u5BFC\u5165",width:"1040px",top:"8vh",center:"",onClose:o[1]||(o[1]=t=>l.value=[])},{default:_(()=>[l.value.length===0?(f(),g(E(au),{key:0,style:{"margin-bottom":"10px"},onOnSuccess:h})):L("v-if",!0),j(s,{data:l.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:_(()=>[(f(!0),W(Y,null,Z(E(c),(t,y)=>(f(),g(d,{minWidth:t.minWidth,"show-overflow-tooltip":"",fixed:t.fixed,prop:t.prop,type:t.type,key:y},{header:_(()=>[t.required?(f(),W("p",cu,[o[2]||(o[2]=uu("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),T(" "+N(t.label),1)])):(f(),W("span",mu,N(t.label),1))]),_:2},1032,["minWidth","fixed","prop","type"]))),128))]),_:1},8,["data"]),l.value.length!==0?(f(),W("div",Du,[j(E(M),{size:"small",onClick:u},{default:_(()=>o[3]||(o[3]=[T("\u53D6\u6D88")])),_:1}),j(E(M),{size:"small",type:"primary",loading:p.value,onClick:a},{default:_(()=>o[4]||(o[4]=[T("\u4FDD\u5B58")])),_:1},8,["loading"])])):L("v-if",!0)]),_:1},8,["modelValue"])}}});var bu=$(Eu,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inManager/components/OrderImportModal/index.vue"]]),yu=Object.freeze(Object.defineProperty({__proto__:null,default:bu},Symbol.toStringTag,{value:"Module"}));export{bu as O,yu as i,hu as o};
|