index.b31645.js 9.5 KB

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