import{S as W,T as V,D as q,F as I}from"./element-plus.55d71530.js";import{P as L}from"./index.8e3b20a1.js";import{r as s,t as P}from"./index.75e08341.js";import{d as w,s as g,r as S,b as O,_ as k,o as m,c as F,V as n,M as i,u,U as T,aa as U,L as j}from"./@vue.96c135a1.js";function Z(t){return s.get({url:"/master_worker.master_worker_agree/lists",params:t})}function N(t){return s.post({url:"/master_worker.master_worker_agree/add",params:t})}function z(t){return s.post({url:"/master_worker.master_worker_agree/edit",params:t})}function $(t){return s.post({url:"/master_worker.master_worker_agree/delete",params:t})}function G(t){return s.get({url:"/master_worker.master_worker_agree/detail",params:t})}const H={class:"edit-popup"},J=w({name:"masterWorkerAgreeEdit"}),ee=w({...J,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(t,{expose:B,emit:A}){const _=A,p=g(),c=g(),d=S("add"),E=O(()=>d.value=="edit"?"\u7F16\u8F91\u670D\u52A1\u5408\u4F5C\u534F\u8BAE":"\u65B0\u589E\u670D\u52A1\u5408\u4F5C\u534F\u8BAE"),a=k({id:"",audit_state:""}),D=k({worker_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u5DE5\u7A0B\u5E08ID",trigger:["blur"]}],sign:[{required:!0,message:"\u8BF7\u8F93\u5165\u534F\u8BAE\u7B7E\u540D",trigger:["blur"]}],pdf_url:[{required:!0,message:"\u8BF7\u8F93\u5165PDF\u534F\u8BAE",trigger:["blur"]}]}),f=async r=>{for(const e in a)r[e]!=null&&r[e]!=null&&(a[e]=r[e]);a.create_time=P(a.create_time,"yyyy-mm-dd hh:MM:ss")},v=async r=>{const e=await G({id:r.id});f(e)},y=async()=>{var e,o;await((e=p.value)==null?void 0:e.validate());const r={...a};d.value=="edit"?await z(r):await N(r),(o=c.value)==null||o.close(),_("success")},b=(r="add")=>{var e;d.value=r,(e=c.value)==null||e.open()},h=()=>{_("close")};return B({open:b,setFormData:f,getDetail:v}),(r,e)=>{const o=W,M=V,x=q,C=I;return m(),F("div",H,[n(L,{ref_key:"popupRef",ref:c,title:u(E),async:!0,width:"550px",onConfirm:y,onClose:h},{default:i(()=>[n(C,{ref_key:"formRef",ref:p,model:u(a),"label-width":"90px",rules:u(D)},{default:i(()=>[n(x,{label:"\u5BA1\u6838\u72B6\u6001",prop:"audit_state"},{default:i(()=>[n(M,{class:"flex-1",modelValue:u(a).audit_state,"onUpdate:modelValue":e[0]||(e[0]=l=>u(a).audit_state=l),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001"},{default:i(()=>[(m(!0),F(T,null,U(t.dictData.audit_state,(l,R)=>(m(),j(o,{key:R,label:l.name,value:parseInt(l.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{ee as _,$ as a,Z as b};
