1 |
- import{bb as Y,am as V,da as q,aR as $,bO as J,ae as du,_ as Fu,d as Du,x as l,ai as Eu,aM as Bu,cl as mu,p as fu,W as Cu,bc as vu,aZ as _,r as y,aD as hu,H as bu,m as e,o as D,G as E,D as s,l as c,J as B,M as N,a as C,bd as Au,dG as _u,cE as yu,b5 as Nu,b7 as G}from"./index.js";import{e as gu,f as wu,c as xu}from"./index.ff7eb665.js";import ku from"./invoice-modal.5313fb.js";import{u as m,w as H}from"./xlsx.ed122d16.js";import Ru from"./index.3bf35e.js";import Su from"./index.9ea7c5.js";import Pu from"./index.37d0fc.js";import"./index.bf16817a.js";import"./execl-upload.7c83427b.js";import"./index.26d6ac45.js";const Tu=[{type:"selection",width:40,align:"center",fixed:"left"},{label:"\u5BF9\u8D26\u56DE\u7968\u7533\u8BF7",prop:"hpNo",width:140},{label:"\u53D1\u7968\u7F16\u7801",prop:"payNo",width:150},{label:"\u7533\u8BF7\u4EBA",prop:"apply_name"},{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"supplierName",width:145,...Y("supplierNo","supplierName","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u53D1\u7968\u7A0E\u524D\u91D1\u989D",width:"110px",prop:"inv_subtotal_amount"},{label:"\u53D1\u7968\u7A0E\u540E\u91D1\u989D",width:"110px",prop:"inv_amount"},{label:"\u72B6\u6001",prop:"status",width:120,cellRenderer:({row:a,props:i})=>V($,{size:i.size},{default:()=>{var r;return(r=q.find(v=>String(a.status)===String(v.value)))==null?void 0:r.label}})},{label:"\u53D1\u7968\u7C7B\u578B",width:185,cellRenderer({row:a}){return V($,null,{default:()=>{var i;return((i=J.find(({value:r})=>r===a.invoiceType))==null?void 0:i.label)||"--"}})}},{label:"\u53D1\u7968\u72B6\u6001",width:70,prop:"invStatus_cn"},{label:"\u53D1\u7968\u53F7\u7801",width:110,prop:"invoiceNumber"},{label:"\u53D1\u7968\u4EE3\u7801",width:110,prop:"invoiceCode"},{label:"\u5F00\u7968\u65E5\u671F",prop:"open_time",width:90,formatter:({open_time:a})=>a?du(a).format("YYYY-MM-DD"):""},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyName",width:145,...Y("companyNo","companyName","\u4E70\u5165\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u521B\u5EFA\u65F6\u95F4",prop:"addtime",width:150},{label:"\u64CD\u4F5C",fixed:"right",slot:"operation",width:140}],Uu={columns:Tu,title:"\u91C7\u8D2D\u56DE\u7968",statusProp:"companyNo",deleteProp:"hpNo",delTooltip:"\u662F\u5426\u64A4\u56DE\u91C7\u8D2D\u56DE\u7968\u7533\u8BF7",superUserNoAction:!0,showDelete:({status:a})=>Number(a)<=3,apis:{httpDelete:gu,httpAdd:!0,httpList:wu}},W={formItems:[{field:"create_timer",type:"date_picker",otherOptions:{type:"daterange",startProp:"start",endProp:"end",startPlaceholder:"\u65B0\u5EFA\u8D77\u59CB\u65F6\u95F4",endPlaceholder:"\u65B0\u5EFA\u7ED3\u675F\u65F6\u95F4"}},{field:"status",type:"select",placeholder:"\u5BA1\u6838\u72B6\u6001",options:q},{field:"supplierNo",type:"supplier-query"},{field:"hpNo",type:"input",placeholder:"\u5BF9\u8D26\u56DE\u7968\u7F16\u7801"},{field:"payNo",type:"input",placeholder:"\u53D1\u7968\u7F16\u7801"},{field:"invoiceNumber",type:"input",placeholder:"\u53D1\u7968\u53F7\u7801"},{field:"apply_name",type:"input",placeholder:"\u7533\u8BF7\u4EBA"}]},Iu={\u4E70\u65B9\u516C\u53F8\u7F16\u7801:"",\u56DE\u7968\u7533\u8BF7\u7F16\u7801:"",\u5BA1\u6838\u72B6\u6001:"",\u5BA1\u6838\u5907\u6CE8:""},Mu=Du({__name:"index",setup(a){const i="invoiceRelation",r="/purchase/invoiceRelationDetail",v=["2","3","4","6","7","10","11","12","13"],h=l([]),{isSuperUser:S}=Eu(),{hasPermissionWithCode:b}=Bu(i),d=l(null),P=mu({payNo:"",hpNo:""});l(!1);const{push:T}=fu();Cu();const U=l(null),I=l(null),Z=l(null),M=l(null),g=l({inv_subtotal_amount:"",total:"",inv_fee:""}),{run:K,loading:Q}=vu({success:()=>{var o;_.success("\u64A4\u9500\u6210\u529F"),(o=d.value)==null||o.onSearch()}}),X={pageSearchHook:()=>Au(void 0,void 0,W)},uu={content:{preview:({hpNo:o})=>T(`${r}?id=${o}`),create:()=>T(r),result:({inv_subtotal_amount:o,total:u,inv_fee:n})=>{const F=d.value.getBasicParams();P.hpNo=F.hpNo,P.payNo=F.payNo,g.value.inv_subtotal_amount=o,g.value.inv_fee=n,g.value.total=u}}};function eu(){const o=m.book_new(),u=m.json_to_sheet([Iu]);m.book_append_sheet(o,u,"sheet"),H(o,"\u6279\u91CF\u5BFC\u5165\u56DE\u7968\u6A21\u677F.xlsx",{bookType:"xlsx"})}async function ou(){if(h.value.length===0){_.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u4E70\u5165\u53D1\u7968\u5173\u8054\u6570\u636E");return}if(h.value.length>1){_.warning("\u53EA\u80FD\u9009\u62E9\u4E00\u6761\u4E70\u5165\u53D1\u7968\u5173\u8054\u6570\u636E");return}const o=["\u5F85\u5173\u8054\u8BA2\u5355","\u8BA2\u5355\u5173\u8054\u5B8C\u6BD5\u5F85\u8D22\u52A1\u5BA1\u6838","\u5F85\u4E70\u65B9\u516C\u53F8\u8BA4\u8BC1","\u8BA4\u8BC1\u6210\u529F","\u8BA4\u8BC1\u5931\u8D25","\u56DE\u7968\u5DF2\u9000","\u8D22\u52A1\u5BA1\u6838\u9A73\u56DE"],[u]=h.value;if(!v.includes(String(u.status))){_.warning("\u8BF7\u9009\u62E9\u72B6\u6001\u4E3A:"+o.join("\u3001")+"\u7684\u91C7\u8D2D\u5355");return}const n=await _u({code:u.hpNo}),F=await yu({number:u.invoiceNumber}),{data:w=[]}=n||{},{buyer_name:x,buyer_id:k,seller_name:t,seller_id:z,number:nu,issue_date:au,type:lu}=(F||{}).data||{},su=w.map(p=>{var L;const{total_amount:A,tax_amount:j,num:f}=p,R=Number(Nu(A,j)).toFixed(2),ru=!Number(R)||!Number(f)?"":Number(G(R,f)).toFixed(2),pu=!Number(A)||!Number(f)?"":Number(G(A,f)).toFixed(2);return{\u53D1\u7968\u660E\u7EC6ID:p.id,\u5BF9\u8D26\u56DE\u7968\u7F16\u53F7:p.invoiceCode,\u53D1\u7968\u7C7B\u578B:((L=J.find(cu=>cu.value===lu))==null?void 0:L.label)||"--",\u53D1\u7968\u53F7\u7801:nu,\u5F00\u7968\u65E5\u671F:au,\u8D2D\u4E70\u65B9\u540D\u79F0:x,\u8D2D\u4E70\u65B9\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7:k,\u9500\u552E\u65B9\u540D\u79F0:t,\u9500\u552E\u65B9\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7:z,\u7C7B\u76EE\u7F16\u53F7:p.cat_code,"\u8D27\u7269\u6216\u5E94\u7A0E\u52B3\u52A1\u3001\u670D\u52A1\u540D\u79F0":p.good_name,\u5355\u4F4D:p.unit,\u6570\u91CF:f,\u5355\u4EF7:ru,\u91D1\u989D:R,\u7A0E\u7387:p.tax,\u7A0E\u989D:j,\u7A0E\u540E\u5355\u4EF7:pu,\u7A0E\u540E\u91D1\u989D:A,\u91C7\u8D2D\u5355\u5173\u8054\u91D1\u989D:"",\u5BF9\u8D26\u5355\u53F7:"",\u91C7\u8D2D\u5355\u7F16\u53F7:"",\u9500\u552E\u5355\u7F16\u53F7:"",\u4F9B\u8D27\u5546:"",\u4E1A\u52A1\u516C\u53F8:"",\u8BA2\u5355\u5355\u4F4D:"",\u5546\u54C1\u6570\u91CF:"",\u5546\u54C1\u5355\u4EF7:"",\u603B\u8D27\u6B3E:"",\u9500\u552E\u4E3B\u5355\u53F7:"",\u5546\u54C1\u7F16\u7801:"",\u5546\u54C1\u540D\u79F0:"",\u8D27\u7269\u548C\u52B3\u52A1\u540D\u79F0:"",\u5546\u54C1\u5F00\u7968\u7C7B\u76EE:"",\u5546\u54C1\u548C\u670D\u52A1\u5206\u7C7B\u7B80\u79F0:"",\u5F00\u7968\u7A0E\u7387:"",\u5F00\u7968\u5546\u54C1\u540D\u79F0:"",\u5F00\u7968\u7C7B\u578B:"",\u91C7\u8D2D\u5355\u53EF\u5173\u8054\u91D1\u989D:""}}),O=m.book_new(),iu=m.json_to_sheet(su);m.book_append_sheet(O,iu,"sheet"),H(O,"\u53D1\u7968\u660E\u7EC6.xlsx",{bookType:"xlsx"})}function tu(o){const u={status:"8",hpNo:o.hpNo};K(xu(u))}return(o,u)=>{const n=y("ElButton"),F=y("ElTooltip"),w=y("PageContainer"),x=y("PageAuth"),k=hu("loading");return bu((D(),E(x,{pageName:i},{default:s(()=>[c(w,{hooks:X,events:uu,contentConfig:e(Uu),"search-config":e(W),"get-content-ref":t=>d.value=t,onContentSelectChange:u[3]||(u[3]=t=>h.value=t)},{content_header:s(()=>[e(b)("019")?(D(),E(n,{key:0,size:"small",icon:e(B)("arrow-down-line"),onClick:u[0]||(u[0]=()=>eu())},{default:s(()=>[N(" \u4E0B\u8F7D\u8BA4\u8BC1\u6A21\u677F ")]),_:1},8,["icon"])):C("v-if",!0),c(n,{size:"small",icon:e(B)("arrow-down-line"),onClick:ou},{default:s(()=>[N("\u5BFC\u51FA\u53D1\u7968\u660E\u7EC6 ")]),_:1},8,["icon"]),!e(S)&&e(b)("064")?(D(),E(n,{key:1,size:"small",type:"primary",icon:e(B)("arrow-up-line"),onClick:u[1]||(u[1]=()=>M.value.onDisplay())},{default:s(()=>[N("\u6279\u91CF\u5BFC\u5165\u7968\u4E0E\u8BA2\u5355\u5173\u8054\u6570\u636E ")]),_:1},8,["icon"])):C("v-if",!0),e(b)("018")&&!e(S)?(D(),E(n,{key:2,size:"small",type:"primary",icon:e(B)("arrow-up-line"),onClick:u[2]||(u[2]=()=>I.value.onDisplay())},{default:s(()=>[N("\u6279\u91CF\u5BFC\u5165\u8BA4\u8BC1\u7ED3\u679C ")]),_:1},8,["icon"])):C("v-if",!0)]),content_action:s(t=>[v.includes(String(t.status))?(D(),E(n,{key:0,link:"",type:"primary",icon:e(B)("scaletooriginal"),onClick:()=>U.value.onDisplay(t)},null,8,["icon","onClick"])):C("v-if",!0),(t.status=="11"||t.status=="12")&&e(b)("010")?(D(),E(F,{key:1,content:"\u64A4\u9500\u56DE\u7968\u7533\u8BF7",placement:"top"},{default:s(()=>[c(n,{link:"",type:"primary",icon:e(B)("refresh"),onClick:z=>tu(t)},null,8,["icon","onClick"])]),_:2},1024)):C("v-if",!0)]),_:1},8,["contentConfig","search-config","get-content-ref"]),c(ku,{ref_key:"invoiceModalRef",ref:U},null,512),c(Ru,{ref_key:"excelUploadRef",ref:I,onOnSuccess:u[4]||(u[4]=()=>d.value.onSearch())},null,512),c(Su,{ref_key:"excelUploadInvRef",ref:Z,onOnSuccess:u[5]||(u[5]=()=>d.value.onSearch())},null,512),c(Pu,{ref_key:"excelUploadRelationRef",ref:M,onOnSuccess:u[6]||(u[6]=()=>d.value.onSearch())},null,512)]),_:1})),[[k,e(Q)]])}}});var qu=Fu(Mu,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/purchaseNew/invoiceRelation/index.vue"]]);export{qu as default};
|