import{Q as g,R as v,D as V,C,F as y}from"./element-plus.ae09c4a0.js";import{P as R}from"./index.e64ff1d1.js";import{b as h}from"./master_worker.c8c730d3.js";import{m as x}from"./lodash-es.bb7dceda.js";import{d as A,s as f,a0 as _,w as q,o as I,M as U,O as s,W as u,u as a,aa as M}from"./@vue.a7a54728.js";const Q=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(),n=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,l;t?(e=n.value)==null||e.open():(l=n.value)==null||l.close()});const c=w,b=()=>{var t;c("update:show",!1),(t=p.value)==null||t.resetFields()},k=async()=>{var e,l;await((e=p.value)==null?void 0:e.validate());const t=x(o,M(i));await h(t),(l=n.value)==null||l.close(),c("success")};return(t,e)=>{const l=g,B=v,m=V,d=C,E=y;return I(),U(R,{ref_key:"popupRef",ref:n,title:"\u6DFB\u52A0\u8D28\u4FDD\u91D1\u8BB0\u5F55",async:!0,width:"500px",onConfirm:k,onClose:b},{default:s(()=>[u(E,{ref_key:"formRef",ref:p,model:a(o),"label-width":"90px",rules:a(D)},{default:s(()=>[u(m,{label:"\u52A8\u4F5C",prop:"action"},{default:s(()=>[u(B,{class:"flex-1",modelValue:a(o).action,"onUpdate:modelValue":e[0]||(e[0]=r=>a(o).action=r),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u52A8\u4F5C"},{default:s(()=>[u(l,{label:"\u589E\u52A0",value:1}),u(l,{label:"\u51BB\u7ED3",value:2})]),_:1},8,["modelValue"])]),_:1}),u(m,{label:"\u91D1\u989D",prop:"amount"},{default:s(()=>[u(d,{modelValue:a(o).amount,"onUpdate:modelValue":e[1]||(e[1]=r=>a(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:s(()=>[u(d,{modelValue:a(o).work_id,"onUpdate:modelValue":e[2]||(e[2]=r=>a(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:s(()=>[u(d,{modelValue:a(o).remark,"onUpdate:modelValue":e[3]||(e[3]=r=>a(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{Q as _};
