import{C,D as M,F as W}from"./element-plus.ae09c4a0.js";import{P as h}from"./index.e64ff1d1.js";import{r as d,t as x}from"./index.80696382.js";import{d as B,s as F,r as R,b as I,a0 as g,o as P,c as q,W as o,O as n,u as t}from"./@vue.a7a54728.js";function H(a){return d.get({url:"/master_worker.master_worker_agree/lists",params:a})}function U(a){return d.post({url:"/master_worker.master_worker_agree/add",params:a})}function O(a){return d.post({url:"/master_worker.master_worker_agree/edit",params:a})}function J(a){return d.post({url:"/master_worker.master_worker_agree/delete",params:a})}function j(a){return d.get({url:"/master_worker.master_worker_agree/detail",params:a})}const L={class:"edit-popup"},N=B({name:"masterWorkerAgreeEdit"}),K=B({...N,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(a,{expose:k,emit:w}){const _=w,c=F(),p=F(),m=R("add"),E=I(()=>m.value=="edit"?"\u7F16\u8F91\u670D\u52A1\u5408\u4F5C\u534F\u8BAE":"\u65B0\u589E\u670D\u52A1\u5408\u4F5C\u534F\u8BAE"),r=g({id:"",agree_type:"",worker_id:"",sign:"",pdf_url:""}),A=g({worker_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u5E08\u5085ID",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 u=>{for(const e in r)u[e]!=null&&u[e]!=null&&(r[e]=u[e]);r.create_time=x(r.create_time,"yyyy-mm-dd hh:MM:ss")},D=async u=>{const e=await j({id:u.id});f(e)},b=async()=>{var e,l;await((e=c.value)==null?void 0:e.validate());const u={...r};m.value=="edit"?await O(u):await U(u),(l=p.value)==null||l.close(),_("success")},y=(u="add")=>{var e;m.value=u,(e=p.value)==null||e.open()},V=()=>{_("close")};return k({open:y,setFormData:f,getDetail:D}),(u,e)=>{const l=C,i=M,v=W;return P(),q("div",L,[o(h,{ref_key:"popupRef",ref:p,title:t(E),async:!0,width:"550px",onConfirm:b,onClose:V},{default:n(()=>[o(v,{ref_key:"formRef",ref:c,model:t(r),"label-width":"90px",rules:t(A)},{default:n(()=>[o(i,{label:"\u534F\u8BAE\u7C7B\u522B",prop:"agree_type"},{default:n(()=>[o(l,{modelValue:t(r).agree_type,"onUpdate:modelValue":e[0]||(e[0]=s=>t(r).agree_type=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u534F\u8BAE\u7C7B\u522B"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u5E08\u5085ID",prop:"worker_id"},{default:n(()=>[o(l,{modelValue:t(r).worker_id,"onUpdate:modelValue":e[1]||(e[1]=s=>t(r).worker_id=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5E08\u5085ID"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u534F\u8BAE\u7B7E\u540D",prop:"sign"},{default:n(()=>[o(l,{modelValue:t(r).sign,"onUpdate:modelValue":e[2]||(e[2]=s=>t(r).sign=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u534F\u8BAE\u7B7E\u540D"},null,8,["modelValue"])]),_:1}),o(i,{label:"PDF\u534F\u8BAE",prop:"pdf_url"},{default:n(()=>[o(l,{modelValue:t(r).pdf_url,"onUpdate:modelValue":e[3]||(e[3]=s=>t(r).pdf_url=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165PDF\u534F\u8BAE"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{K as _,J as a,H as b};
