index.f70524.js 11 KB

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