import{C as I,D as L,S,T as O,F as P}from"./element-plus.55d71530.js";import{_ as T}from"./index.vue_vue_type_style_index_0_lang.7c7bbd24.js";import{P as j}from"./index.8e3b20a1.js";import{r as n,t as b}from"./index.75e08341.js";import{d as V,s as g,r as N,b as $,_ as B,o as c,c as D,V as a,M as s,u as t,U as z,aa as G,L as H}from"./@vue.96c135a1.js";function le(r){return n.get({url:"/firm.firm_register/lists",params:r})}function J(r){return n.post({url:"/firm.firm_register/add",params:r})}function K(r){return n.post({url:"/firm.firm_register/edit",params:r})}function ae(r){return n.post({url:"/firm.firm_register/delete",params:r})}function Q(r){return n.get({url:"/firm.firm_register/detail",params:r})}const W={class:"edit-popup"},X=V({name:"firmRegisterEdit"}),re=V({...X,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(r,{expose:y,emit:C}){const f=C,_=g(),m=g(),p=N("add"),E=$(()=>p.value=="edit"?"\u7F16\u8F91\u4F01\u4E1A\u6CE8\u518C\u8868":"\u65B0\u589E\u4F01\u4E1A\u6CE8\u518C\u8868"),u=B({id:"",firm_name:"",user_name:"",mobile:"",address:"",cooperate_description:"",status:"",user_id:""}),v=B({firm_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u516C\u53F8\u540D\u79F0",trigger:["blur"]}],user_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0",trigger:["blur"]}],mobile:[{required:!0,message:"\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD",trigger:["blur"]}],user_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u7528\u6237ID",trigger:["blur"]}]}),F=async o=>{for(const e in u)o[e]!=null&&o[e]!=null&&(u[e]=o[e]);u.create_time=b(u.create_time,"yyyy-mm-dd hh:MM:ss"),u.update_time=b(u.update_time,"yyyy-mm-dd hh:MM:ss")},R=async o=>{const e=await Q({id:o.id});F(e)},w=async()=>{var e,i;await((e=_.value)==null?void 0:e.validate());const o={...u};p.value=="edit"?await K(o):await J(o),(i=m.value)==null||i.close(),f("success")},x=(o="add")=>{var e;p.value=o,(e=m.value)==null||e.open()},h=()=>{f("close")};return y({open:x,setFormData:F,getDetail:R}),(o,e)=>{const i=I,d=L,k=T,U=S,q=O,A=P;return c(),D("div",W,[a(j,{ref_key:"popupRef",ref:m,title:t(E),async:!0,width:"550px",onConfirm:w,onClose:h},{default:s(()=>[a(A,{ref_key:"formRef",ref:_,model:t(u),"label-width":"90px",rules:t(v)},{default:s(()=>[a(d,{label:"\u516C\u53F8\u540D\u79F0",prop:"firm_name"},{default:s(()=>[a(i,{modelValue:t(u).firm_name,"onUpdate:modelValue":e[0]||(e[0]=l=>t(u).firm_name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u516C\u53F8\u540D\u79F0",disabled:""},null,8,["modelValue"])]),_:1}),a(d,{label:"\u7528\u6237\u540D\u79F0",prop:"user_name"},{default:s(()=>[a(i,{modelValue:t(u).user_name,"onUpdate:modelValue":e[1]||(e[1]=l=>t(u).user_name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0",disabled:""},null,8,["modelValue"])]),_:1}),a(d,{label:"\u8054\u7CFB\u7535\u8BDD",prop:"mobile"},{default:s(()=>[a(i,{modelValue:t(u).mobile,"onUpdate:modelValue":e[2]||(e[2]=l=>t(u).mobile=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD",disabled:""},null,8,["modelValue"])]),_:1}),a(d,{label:"\u5730\u5740",prop:"address"},{default:s(()=>[a(i,{modelValue:t(u).address,"onUpdate:modelValue":e[3]||(e[3]=l=>t(u).address=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5730\u5740",disabled:""},null,8,["modelValue"])]),_:1}),a(d,{label:"\u5408\u4F5C\u610F\u5411",prop:"cooperate_description"},{default:s(()=>[a(k,{class:"flex-1",modelValue:t(u).cooperate_description,"onUpdate:modelValue":e[4]||(e[4]=l=>t(u).cooperate_description=l),height:500,disabled:""},null,8,["modelValue"])]),_:1}),a(d,{label:"\u5BA1\u6838\u72B6\u6001",prop:"status"},{default:s(()=>[a(q,{class:"flex-1",modelValue:t(u).status,"onUpdate:modelValue":e[5]||(e[5]=l=>t(u).status=l),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001"},{default:s(()=>[(c(!0),D(z,null,G(r.dictData.audit_state,(l,M)=>(c(),H(U,{key:M,label:l.name,value:parseInt(l.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{re as _,ae as a,le as b};
