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