1 |
- import{bb as O,am as j,da as G,aR as z,bO as H,ae as pu,_ as cu,d as du,x as l,ai as Du,aM as Fu,cl as Eu,p as mu,W as Bu,bc as fu,aZ as f,r as C,aD as Cu,H as vu,m as o,o as v,G as h,D as d,l as p,J as b,M as Y,a as x,bd as hu,dG as bu,cE as _u,b5 as yu,b7 as V}from"./index.js";import{e as Au,f as Nu,c as gu}from"./index.ff7eb665.js";import xu from"./invoice-modal.047b9b.js";import{u as w,w as wu}from"./xlsx.ed122d16.js";import ku from"./index.2a36fb.js";import Ru from"./index.757203.js";import Su from"./index.249ba2.js";import"./index.bf16817a.js";import"./execl-upload.7c83427b.js";import"./index.26d6ac45.js";const Pu=[{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,...O("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:n,props:s})=>j(z,{size:s.size},{default:()=>{var i;return(i=G.find(E=>String(n.status)===String(E.value)))==null?void 0:i.label}})},{label:"\u53D1\u7968\u7C7B\u578B",width:185,cellRenderer({row:n}){return j(z,null,{default:()=>{var s;return((s=H.find(({value:i})=>i===n.invoiceType))==null?void 0:s.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:n})=>n?pu(n).format("YYYY-MM-DD"):""},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyName",width:145,...O("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}],Iu={title:"\u91C7\u8D2D\u56DE\u7968",companyProp:"supplierNo",columns:Pu,apis:{httpDelete:Au,httpList:Nu,httpAdd:!0},deleteProp:"hpNo",delTooltip:"\u662F\u5426\u64A4\u56DE\u91C7\u8D2D\u56DE\u7968\u7533\u8BF7",superUserNoAction:!0,showDelete:({status:n})=>Number(n)<=3},$={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:G},{field:"companyNo",type:"business-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"}]},Uu=du({__name:"index",setup(n){const s="supplyInvoiceRelation",i="/supply/supplyInvoiceRelationDetail",E=["2","3","4","6","7","10","11","12","13"],m=l([]),{isSuperUser:W}=Du(),{hasPermissionWithCode:k}=Fu(s),D=l(null),R=Eu({payNo:"",hpNo:""});l(!1);const{push:S}=mu();Bu();const P=l(null),q=l(null),J=l(null),I=l(null),_=l({inv_subtotal_amount:"",total:"",inv_fee:""}),{run:Z,loading:K}=fu({success:()=>{var e;f.success("\u64A4\u9500\u6210\u529F"),(e=D.value)==null||e.onSearch()}}),Q={pageSearchHook:()=>hu(void 0,void 0,$)},X={content:{preview:({hpNo:e})=>S(`${i}?id=${e}`),create:()=>S(i),result:({inv_subtotal_amount:e,total:u,inv_fee:a})=>{const c=D.value.getBasicParams();R.hpNo=c.hpNo,R.payNo=c.payNo,_.value.inv_subtotal_amount=e,_.value.inv_fee=a,_.value.total=u}}};async function uu(){if(m.value.length===0){f.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u5BF9\u8D26\u56DE\u7968\u7533\u8BF7");return}if(m.value.length>1){f.warning("\u53EA\u80FD\u9009\u62E9\u4E00\u6761\u5BF9\u8D26\u56DE\u7968\u7533\u8BF7");return}const e=["\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]=m.value;if(!E.includes(String(u.status))){f.warning("\u8BF7\u9009\u62E9\u72B6\u6001\u4E3A:"+e.join("\u3001")+"\u7684\u91C7\u8D2D\u5355");return}const a=await bu({code:u.hpNo}),c=await _u({number:u.invoiceNumber}),{data:y=[]}=a||{},{buyer_name:A,buyer_id:N,seller_name:t,seller_id:U,number:tu,issue_date:ou,type:nu}=(c||{}).data||{},au=y.map(r=>{var L;const{total_amount:B,tax_amount:M,num:F}=r,g=Number(yu(B,M)).toFixed(2),su=!Number(g)||!Number(F)?"":Number(V(g,F)).toFixed(2),iu=!Number(B)||!Number(F)?"":Number(V(B,F)).toFixed(2);return{\u53D1\u7968\u660E\u7EC6ID:r.id,\u5BF9\u8D26\u56DE\u7968\u7F16\u53F7:r.invoiceCode,\u53D1\u7968\u7C7B\u578B:((L=H.find(ru=>ru.value===nu))==null?void 0:L.label)||"--",\u53D1\u7968\u53F7\u7801:tu,\u5F00\u7968\u65E5\u671F:ou,\u8D2D\u4E70\u65B9\u540D\u79F0:A,\u8D2D\u4E70\u65B9\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7:N,\u9500\u552E\u65B9\u540D\u79F0:t,\u9500\u552E\u65B9\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7:U,\u7C7B\u76EE\u7F16\u53F7:r.cat_code,"\u8D27\u7269\u6216\u5E94\u7A0E\u52B3\u52A1\u3001\u670D\u52A1\u540D\u79F0":r.good_name,\u5355\u4F4D:r.unit,\u6570\u91CF:F,\u5355\u4EF7:su,\u91D1\u989D:g,\u7A0E\u7387:r.tax,\u7A0E\u989D:M,\u7A0E\u540E\u5355\u4EF7:iu,\u7A0E\u540E\u91D1\u989D:B,\u91C7\u8D2D\u5355\u5173\u8054\u91D1\u989D:"",\u5BF9\u8D26\u7F16\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:""}}),T=w.book_new(),lu=w.json_to_sheet(au);w.book_append_sheet(T,lu,"sheet"),wu(T,"\u53D1\u7968\u660E\u7EC6.xlsx",{bookType:"xlsx"})}function eu(e){const u={status:"8",hpNo:e.hpNo};Z(gu(u))}return(e,u)=>{const a=C("ElButton"),c=C("ElTooltip"),y=C("PageContainer"),A=C("PageAuth"),N=Cu("loading");return vu((v(),h(A,{pageName:s},{default:d(()=>[p(y,{hooks:Q,events:X,contentConfig:o(Iu),"search-config":o($),"get-content-ref":t=>D.value=t,onContentSelectChange:u[1]||(u[1]=t=>m.value=t)},{content_header:d(()=>[p(a,{size:"small",icon:o(b)("arrow-down-line"),onClick:uu},{default:d(()=>[Y("\u5BFC\u51FA\u53D1\u7968\u660E\u7EC6 ")]),_:1},8,["icon"]),!o(W)&&o(k)("064")?(v(),h(a,{key:0,size:"small",type:"primary",icon:o(b)("arrow-up-line"),onClick:u[0]||(u[0]=()=>I.value.onDisplay())},{default:d(()=>[Y("\u6279\u91CF\u5BFC\u5165\u7968\u4E0E\u8BA2\u5355\u5173\u8054\u6570\u636E ")]),_:1},8,["icon"])):x("v-if",!0)]),content_action:d(t=>[E.includes(String(t.status))?(v(),h(a,{key:0,link:"",type:"primary",icon:o(b)("scaletooriginal"),onClick:()=>P.value.onDisplay(t)},null,8,["icon","onClick"])):x("v-if",!0),(t.status=="11"||t.status=="12")&&o(k)("010")?(v(),h(c,{key:1,content:"\u64A4\u9500\u56DE\u7968\u7533\u8BF7",placement:"top"},{default:d(()=>[p(a,{link:"",type:"primary",icon:o(b)("refresh"),onClick:U=>eu(t)},null,8,["icon","onClick"])]),_:2},1024)):x("v-if",!0)]),_:1},8,["contentConfig","search-config","get-content-ref"]),p(xu,{ref_key:"invoiceModalRef",ref:P},null,512),p(ku,{ref_key:"excelUploadRef",ref:q},null,512),p(Ru,{ref_key:"excelUploadInvRef",ref:J,onOnSuccess:u[2]||(u[2]=()=>D.value.onSearch())},null,512),p(Su,{ref_key:"excelUploadRelationRef",ref:I,onOnSuccess:u[3]||(u[3]=()=>D.value.onSearch())},null,512)]),_:1})),[[N,o(K)]])}}});var Hu=cu(Uu,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/supplyNew/invoiceRelation/index.vue"]]);export{Hu as default};
|