import{D as T,C as q,S as N,T as O,F as P}from"./element-plus.55d71530.js";import{_ as j}from"./index.vue_vue_type_style_index_0_lang.ee5a4e26.js";import{P as $}from"./index.e651cfa0.js";import{r as d,t as E}from"./index.e2bd5212.js";import{d as v,s as F,r as w,b as z,_ as B,o as n,c as i,V as a,M as m,u as r,T as G,R as V,U as D,aa as H,L as J}from"./@vue.96c135a1.js";function le(u){return d.get({url:"/master_worker_customer.master_worker_customer/lists",params:u})}function K(u){return d.post({url:"/master_worker_customer.master_worker_customer/add",params:u})}function Q(u){return d.post({url:"/master_worker_customer.master_worker_customer/edit",params:u})}function se(u){return d.post({url:"/master_worker_customer.master_worker_customer/delete",params:u})}function X(u){return d.get({url:"/master_worker_customer.master_worker_customer/detail",params:u})}const Y={class:"edit-popup"},Z={key:0},ee=v({name:"masterWorkerCustomerEdit"}),me=v({...ee,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(u,{expose:C,emit:g}){const _=g,f=F(),p=F(),c=w("add"),h=z(()=>c.value=="edit"?"\u7F16\u8F91\u5DE5\u7A0B\u5E08\u5BA2\u670D\u8868":"\u65B0\u589E\u5DE5\u7A0B\u5E08\u5BA2\u670D\u8868"),t=B({id:"",user_id:"",masterWorker:w({}),name:"",mobile:"",problem:"",deal_user_id:"",status:"",remark:""}),M=B({status:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:["blur"]}]}),k=async l=>{for(const e in t)l[e]!=null&&l[e]!=null&&(t[e]=l[e]);t.create_time=E(t.create_time,"yyyy-mm-dd hh:MM:ss"),t.update_time=E(t.update_time,"yyyy-mm-dd hh:MM:ss")},x=async l=>{const e=await X({id:l.id});k(e)},W=async()=>{var e,s;await((e=f.value)==null?void 0:e.validate());const l={...t};c.value=="edit"?await Q(l):await K(l),(s=p.value)==null||s.close(),_("success")},A=(l="add")=>{var e;c.value=l,(e=p.value)==null||e.open()},R=()=>{_("close")};return C({open:A,setFormData:k,getDetail:x}),(l,e)=>{const s=T,b=q,y=j,U=N,I=O,S=P;return n(),i("div",Y,[a($,{ref_key:"popupRef",ref:p,title:r(h),async:!0,width:"1000px",onConfirm:W,onClose:R},{default:m(()=>[a(S,{ref_key:"formRef",ref:f,model:r(t),"label-width":"90px",rules:r(M)},{default:m(()=>[a(s,{label:"\u7528\u6237"},{default:m(()=>[r(t).masterWorker?(n(),i("span",Z,G(r(t).masterWorker.nickname),1)):V("",!0)]),_:1}),a(s,{label:"\u59D3\u540D",prop:"name"},{default:m(()=>[a(b,{modelValue:r(t).name,"onUpdate:modelValue":e[0]||(e[0]=o=>r(t).name=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D"},null,8,["modelValue"])]),_:1}),a(s,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:m(()=>[a(b,{modelValue:r(t).mobile,"onUpdate:modelValue":e[1]||(e[1]=o=>r(t).mobile=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1}),a(s,{label:"\u95EE\u9898\u63CF\u8FF0",prop:"problem"},{default:m(()=>[a(y,{class:"flex-1",modelValue:r(t).problem,"onUpdate:modelValue":e[2]||(e[2]=o=>r(t).problem=o),height:500},null,8,["modelValue"])]),_:1}),a(s,{label:"\u72B6\u6001",prop:"status"},{default:m(()=>[a(I,{class:"flex-1",modelValue:r(t).status,"onUpdate:modelValue":e[3]||(e[3]=o=>r(t).status=o),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:m(()=>[(n(!0),i(D,null,H(u.dictData.event_status,(o,L)=>(n(),i(D,{key:L},[parseInt(o.value)!=0?(n(),J(U,{key:0,label:o.name,value:parseInt(o.value)},null,8,["label","value"])):V("",!0)],64))),128))]),_:1},8,["modelValue"])]),_:1}),a(s,{label:"\u5904\u7406\u4EBA\u5907\u6CE8",prop:"remark"},{default:m(()=>[a(y,{class:"flex-1",modelValue:r(t).remark,"onUpdate:modelValue":e[4]||(e[4]=o=>r(t).remark=o),height:500},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{me as _,se as a,le as b};
