import{C as W,D as q,S as L,T as S,F as O}from"./element-plus.55d71530.js";import{_ as P}from"./picker.33f9b871.js";import{P as T}from"./index.e651cfa0.js";import{r as i}from"./index.e2bd5212.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";import{d as V,s as k,r as j,b as N,_ as E,o as _,c as b,V as l,M as d,u as a,U as z,aa as G,L as H}from"./@vue.96c135a1.js";function le(t){return i.get({url:"/master_worker.master_worker_info/lists",params:t})}function J(t){return i.post({url:"/master_worker.master_worker_info/add",params:t})}function K(t){return i.post({url:"/master_worker.master_worker_info/edit",params:t})}function te(t){return i.post({url:"/master_worker.master_worker_info/delete",params:t})}function Q(t){return i.get({url:"/master_worker.master_worker_info/detail",params:t})}const X={class:"edit-popup"},Y=V({name:"masterWorkerInfoEdit"}),re=V({...Y,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(t,{expose:w,emit:g}){const f=g,c=k(),m=k(),p=j("add"),D=N(()=>p.value=="edit"?"\u7F16\u8F91\u5DE5\u7A0B\u5E08\u4E2A\u4EBA\u4FE1\u606F\u8868":"\u65B0\u589E\u5DE5\u7A0B\u5E08\u4E2A\u4EBA\u4FE1\u606F\u8868"),u=E({id:"",worker_id:"",real_name:"",id_card:"",id_card_front_img:"",id_card_opposite_img:"",mobile:"",address:"",audit_state:""}),A=E({worker_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u7528\u6237id",trigger:["blur"]}],audit_state:[{required:!0,message:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001",trigger:["blur"]}]}),B=async r=>{for(const e in u)r[e]!=null&&r[e]!=null&&(u[e]=r[e])},v=async r=>{const e=await Q({id:r.id});B(e)},C=async()=>{var e,s;await((e=c.value)==null?void 0:e.validate());const r={...u};p.value=="edit"?await K(r):await J(r),(s=m.value)==null||s.close(),f("success")},y=(r="add")=>{var e;p.value=r,(e=m.value)==null||e.open()},I=()=>{f("close")};return w({open:y,setFormData:B,getDetail:v}),(r,e)=>{const s=W,n=q,F=P,U=L,x=S,M=O;return _(),b("div",X,[l(T,{ref_key:"popupRef",ref:m,title:a(D),async:!0,width:"550px",onConfirm:C,onClose:I},{default:d(()=>[l(M,{ref_key:"formRef",ref:c,model:a(u),"label-width":"90px",rules:a(A)},{default:d(()=>[l(n,{label:"\u7528\u6237id",prop:"worker_id"},{default:d(()=>[l(s,{modelValue:a(u).worker_id,"onUpdate:modelValue":e[0]||(e[0]=o=>a(u).worker_id=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237id",readonly:""},null,8,["modelValue"])]),_:1}),l(n,{label:"\u7528\u6237\u59D3\u540D",prop:"real_name"},{default:d(()=>[l(s,{modelValue:a(u).real_name,"onUpdate:modelValue":e[1]||(e[1]=o=>a(u).real_name=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u59D3\u540D"},null,8,["modelValue"])]),_:1}),l(n,{label:"\u8EAB\u4EFD\u8BC1\u53F7",prop:"id_card"},{default:d(()=>[l(s,{modelValue:a(u).id_card,"onUpdate:modelValue":e[2]||(e[2]=o=>a(u).id_card=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8EAB\u4EFD\u8BC1\u53F7"},null,8,["modelValue"])]),_:1}),l(n,{label:"\u8EAB\u4EFD\u8BC1\u6B63\u9762\u7167\u7247",prop:"id_card_front_img"},{default:d(()=>[l(F,{modelValue:a(u).id_card_front_img,"onUpdate:modelValue":e[3]||(e[3]=o=>a(u).id_card_front_img=o)},null,8,["modelValue"])]),_:1}),l(n,{label:"\u8EAB\u4EFD\u8BC1\u53CD\u9762\u7167\u7247",prop:"id_card_opposite_img"},{default:d(()=>[l(F,{modelValue:a(u).id_card_opposite_img,"onUpdate:modelValue":e[4]||(e[4]=o=>a(u).id_card_opposite_img=o)},null,8,["modelValue"])]),_:1}),l(n,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:d(()=>[l(s,{modelValue:a(u).mobile,"onUpdate:modelValue":e[5]||(e[5]=o=>a(u).mobile=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1}),l(n,{label:"\u5730\u5740",prop:"address"},{default:d(()=>[l(s,{modelValue:a(u).address,"onUpdate:modelValue":e[6]||(e[6]=o=>a(u).address=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5730\u5740"},null,8,["modelValue"])]),_:1}),l(n,{label:"\u5BA1\u6838\u72B6\u6001",prop:"audit_state"},{default:d(()=>[l(x,{class:"flex-1",modelValue:a(u).audit_state,"onUpdate:modelValue":e[7]||(e[7]=o=>a(u).audit_state=o),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001"},{default:d(()=>[(_(!0),b(z,null,G(t.dictData.audit_state,(o,R)=>(_(),H(U,{key:R,label:o.name,value:parseInt(o.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{re as _,te as a,le as b};
