import{s as N}from"./salary-CA4jeSd5.js";import{o as P,p as b}from"./salarySlip-BbpYT7jj.js";import{_ as R,r,N as F,x as O,e as s,o as f,c as h,f as n,h as t,k as S,m as x,F as A,I as E,J as U,O as y,v as q}from"./index-C1_1_QXk.js";const J={class:"form-modal"},j={class:"dialog-footer"},z={__name:"pay",props:["row","addVisible"],emits:["changeVisible","getList"],setup(V,{emit:I}){const{proxy:c}=q(),e=r({}),m=r(!1),p=V,i=I,_=r([]),M={subMchId:[{required:!0,message:"请选择发薪账户",trigger:"change"}]};F(()=>{}),N().then(o=>{_.value=[{value:"",label:"请选择"},...o.data.map(a=>({value:a.account,label:a.alias,id:a.account}))]});const u=O({get:()=>p.addVisible,set:o=>i("changeVisible",o)});function w(){m.value=!1,e.value={...e.value,...p.row},c.$refs.paidRef!==void 0&&c.$refs.paidRef.resetFields()}function B(){e.value={}}function k(){u.value=!1}function C(){c.$refs.paidRef.validate(o=>{o&&y.confirm("您确定要发薪吗",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{P({id:e.value.id}).then(a=>{a.code==="repeat"?y.confirm("【"+a.data+"】今日在此项目下已存在发薪记录，是否跳过",{confirmButtonText:"跳过",cancelButtonText:"继续发薪",type:"warning",callback:d=>{b({id:e.value.id,subMchId:e.value.subMchId,action:d}).then(v=>{u.value=!1,i("getList"),c.$modal.msgSuccess("成功")})}}):b({id:e.value.id,subMchId:e.value.subMchId}).then(d=>{u.value=!1,i("getList"),c.$modal.msgSuccess("成功")})})}).catch(()=>{})})}return(o,a)=>{const d=s("el-option"),v=s("el-select"),L=s("el-form-item"),T=s("el-form"),g=s("el-button"),$=s("el-dialog");return f(),h("div",J,[n($,{title:"确认发薪",modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=l=>u.value=l),width:"500px",onOpen:w,onClose:B},{footer:t(()=>[S("span",j,[n(g,{onClick:k},{default:t(()=>[x("取 消")]),_:1}),n(g,{type:"primary",loading:m.value,onClick:C},{default:t(()=>[x("确认发薪")]),_:1},8,["loading"])])]),default:t(()=>[n(T,{ref:"paidRef",model:e.value,rules:M,inline:!0,"label-width":"110px"},{default:t(()=>[n(L,{label:"发薪账户",prop:"subMchId"},{default:t(()=>[n(v,{modelValue:e.value.subMchId,"onUpdate:modelValue":a[0]||(a[0]=l=>e.value.subMchId=l),placeholder:"请选择",style:{width:"240px"}},{default:t(()=>[(f(!0),h(A,null,E(_.value,l=>(f(),U(d,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}},K=R(z,[["__scopeId","data-v-f676f4a1"]]);export{K as default};
