import{r as f,c,C as P,d as i,e as x,f as l,h as t,D as $,G as d,E as Q,F as R,J as j,m as u,L as p,v as G}from"./index-DixHiRTW.js";import{b as I,q as J,a as z,c as H}from"./bill-DzglaayF.js";const K={class:"bill"},Z={__name:"index",setup(O){const{proxy:r}=G(),g=f([]),h=f([{}]),v=f(!1),y=f(0),o=f({billDate:"",baseCode:"",page:1,limit:10});function S(a){r.$router.push(`/bill/details?baseCode=${a.baseCode}&billDate=${a.billYM}`)}function V(a){r.download("/djl-salary/advance/salary/bill/export",{billDate:a.billYM,baseCode:a.baseCode},"预支工资账单导出结果.xlsx")}function M(a){r.$modal.confirm("是否确认结算当前账单？").then(function(){return z({id:a.id,baseCode:a.baseCode})}).then(n=>{_(),r.$modal.msgSuccess(n.code)}).catch(()=>{})}function Y(a){r.$modal.confirm("是否确认收款？").then(function(){return H({id:a.id,baseCode:a.baseCode})}).then(n=>{_(),r.$modal.msgSuccess(n.code)}).catch(()=>{})}function D(){o.value.page=1,o.value.limit=10,_()}function q(){o.value={billDate:"",baseCode:"",page:1,limit:10},D()}function _(){v.value=!0,I(o.value).then(a=>{h.value=a.data,y.value=a.count,v.value=!1})}function F(){J().then(a=>{a.data=a.data||[],g.value=a.data.map(n=>({value:n.baseCode,label:n.name}))})}return F(),_(),(a,n)=>{const L=c("el-date-picker"),C=c("el-form-item"),N=c("el-option"),U=c("el-select"),m=c("el-button"),B=c("el-form"),s=c("el-table-column"),b=c("el-tag"),E=c("el-table"),T=c("pagination"),A=P("loading");return i(),x("div",K,[l(B,{model:o.value,ref:"queryRef",inline:!0},{default:t(()=>[l(C,{label:"账单年月",prop:"billDate"},{default:t(()=>[l(L,{modelValue:o.value.billDate,"onUpdate:modelValue":n[0]||(n[0]=e=>o.value.billDate=e),type:"month",placeholder:"账单年月","value-format":"YYYY-MM"},null,8,["modelValue"])]),_:1}),l(C,{label:"派遣",prop:"baseCode"},{default:t(()=>[l(U,{modelValue:o.value.baseCode,"onUpdate:modelValue":n[1]||(n[1]=e=>o.value.baseCode=e),placeholder:"请选择",style:{width:"240px"},filterable:""},{default:t(()=>[(i(!0),x(R,null,j(g.value,e=>(i(),d(N,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(C,null,{default:t(()=>[l(m,{type:"primary",icon:"Search",onClick:D},{default:t(()=>[u("搜索")]),_:1}),l(m,{icon:"Refresh",onClick:q},{default:t(()=>[u("重置")]),_:1})]),_:1})]),_:1},8,["model"]),$((i(),d(E,{data:h.value},{default:t(()=>[l(s,{label:"派遣公司",prop:"dispatchName"}),l(s,{label:"账单年月",prop:"billYM"}),l(s,{label:"累计发放金额",prop:"totalMoney"}),l(s,{label:"累计发放次数",prop:"totalTimes"}),l(s,{label:"手续费总额",prop:"totalFee"}),l(s,{label:"平台分成",prop:"platFee"}),l(s,{label:"盈利",prop:"profit"}),l(s,{label:"状态",align:"center"},{default:t(({row:e})=>[e.state=="none"?(i(),d(b,{key:0,type:"warning"},{default:t(()=>[u("未结算")]),_:1})):p("",!0),e.state=="settle"?(i(),d(b,{key:1},{default:t(()=>[u("已结算")]),_:1})):p("",!0),e.state=="payment"?(i(),d(b,{key:2,type:"success"},{default:t(()=>[u("已付款")]),_:1})):p("",!0)]),_:1}),l(s,{label:"平台状态",align:"center"},{default:t(({row:e})=>[e.platState=="settle"?(i(),d(b,{key:0,type:"warning"},{default:t(()=>[u("挂账")]),_:1})):p("",!0),e.platState=="payment"?(i(),d(b,{key:1,type:"success"},{default:t(()=>[u("已收款")]),_:1})):p("",!0)]),_:1}),l(s,{label:"操作",width:"240",align:"center"},{default:t(({row:e})=>[e.state=="none"?(i(),d(m,{key:0,link:"",type:"primary",icon:"Memo",onClick:k=>M(e)},{default:t(()=>[u("结算")]),_:2},1032,["onClick"])):p("",!0),e.state=="payment"&&e.platState=="settle"?(i(),d(m,{key:1,link:"",type:"primary",icon:"Tickets",onClick:k=>Y(e)},{default:t(()=>[u("收款")]),_:2},1032,["onClick"])):p("",!0),l(m,{link:"",type:"primary",icon:"Edit",onClick:k=>S(e)},{default:t(()=>[u("明细")]),_:2},1032,["onClick"]),l(m,{link:"",type:"primary",icon:"Download",onClick:k=>V(e)},{default:t(()=>[u("导出")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[A,v.value]]),$(l(T,{total:y.value,page:o.value.page,"onUpdate:page":n[2]||(n[2]=e=>o.value.page=e),limit:o.value.limit,"onUpdate:limit":n[3]||(n[3]=e=>o.value.limit=e),onPagination:_},null,8,["total","page","limit"]),[[Q,y.value>0]])])}}};export{Z as default};
