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