import{S as V,T as g,D as v,C,F as y}from"./element-plus.55d71530.js";import{P as h}from"./index.e651cfa0.js";import{c as R}from"./master_worker.6a4d4028.js";import{n as x}from"./lodash-es.bdeecbdb.js";import{d as A,s as f,_,w as q,o as I,L as S,M as n,V as u,u as l,$ as U}from"./@vue.96c135a1.js";const T=A({__name:"add_retention_money",props:{show:{type:Boolean,required:!0},worker_id:{type:[Number,String],required:!0}},emits:["update:show","success"],setup(F,{emit:w}){const p=f(),s=f(),i=F,o=_({amount:"",remark:"",work_id:"",action:2}),D=_({action:[{required:!0,message:"\u8BF7\u9009\u62E9\u52A8\u4F5C",trigger:["blur"]}],amount:[{required:!0,message:"\u8BF7\u8F93\u5165\u91D1\u989D",trigger:["blur"]}],remark:[{required:!0,message:"\u8BF7\u8F93\u5165\u5907\u6CE8",trigger:["blur"]}]});q(()=>i.show,t=>{var e,a;t?(e=s.value)==null||e.open():(a=s.value)==null||a.close()});const c=w,b=()=>{var t;c("update:show",!1),(t=p.value)==null||t.resetFields()},k=async()=>{var e,a;await((e=p.value)==null?void 0:e.validate());const t=x(o,U(i));await R(t),(a=s.value)==null||a.close(),c("success")};return(t,e)=>{const a=V,B=g,m=v,d=C,E=y;return I(),S(h,{ref_key:"popupRef",ref:s,title:"\u6DFB\u52A0\u8D28\u4FDD\u91D1\u8BB0\u5F55",async:!0,width:"500px",onConfirm:k,onClose:b},{default:n(()=>[u(E,{ref_key:"formRef",ref:p,model:l(o),"label-width":"90px",rules:l(D)},{default:n(()=>[u(m,{label:"\u52A8\u4F5C",prop:"action"},{default:n(()=>[u(B,{class:"flex-1",modelValue:l(o).action,"onUpdate:modelValue":e[0]||(e[0]=r=>l(o).action=r),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u52A8\u4F5C"},{default:n(()=>[u(a,{label:"\u589E\u52A0",value:1}),u(a,{label:"\u51BB\u7ED3",value:2})]),_:1},8,["modelValue"])]),_:1}),u(m,{label:"\u91D1\u989D",prop:"amount"},{default:n(()=>[u(d,{modelValue:l(o).amount,"onUpdate:modelValue":e[1]||(e[1]=r=>l(o).amount=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91D1\u989D",oninput:"value=value.replace(/[^\\d.]/g,'')"},null,8,["modelValue"])]),_:1}),u(m,{label:"\u5DE5\u5355ID",prop:"work_id"},{default:n(()=>[u(d,{modelValue:l(o).work_id,"onUpdate:modelValue":e[2]||(e[2]=r=>l(o).work_id=r),oninput:"value=value.replace(/[^\\d]/g,'')",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5DE5\u5355ID"},null,8,["modelValue"])]),_:1}),u(m,{label:"\u5907\u6CE8",prop:"remark"},{default:n(()=>[u(d,{modelValue:l(o).remark,"onUpdate:modelValue":e[3]||(e[3]=r=>l(o).remark=r),type:"textarea",rows:5,clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},512)}}});export{T as _};
