import{C as x,D as I,Q as q,R as W,F as O}from"./element-plus.ae09c4a0.js";import{P}from"./index.e64ff1d1.js";import{a as S,c as j,d as L}from"./return_work.6b9592fd.js";import"./lodash.fc1b942f.js";import{d as D,s as E,r as M,b as N,a0 as c,o as m,c as f,W as a,O as o,u as l,V as Q,a7 as T,M as z}from"./@vue.a7a54728.js";const G={class:"edit-popup"},H=D({name:"returnWorkEdit"}),$=D({...H,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(k,{expose:w,emit:b}){const p=b,_=E(),d=E(),n=M("add"),V=N(()=>n.value=="edit"?"\u7F16\u8F91\u8FD4\u4FEE\u5DE5\u5355":"\u65B0\u589E\u8FD4\u4FEE\u5DE5\u5355"),u=c({id:"",work_sn:"",service_work_id:"",issue_work_id:"",return_work_status:"",dispatch_time:"",appointment_time:"",finished_images:"",finished_time:"",master_worker_id:""}),g=c({work_sn:[{required:!0,message:"\u8BF7\u8F93\u5165\u5DE5\u5355\u7F16\u53F7",trigger:["blur"]}],return_work_status:[{required:!0,message:"\u8BF7\u9009\u62E9\u8FD4\u4FEE\u5DE5\u5355\u72B6\u6001",trigger:["blur"]}],dispatch_time:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D3E\u5355\u65F6\u95F4",trigger:["blur"]}],appointment_time:[{required:!0,message:"\u8BF7\u8F93\u5165\u9884\u7EA6\u4E0A\u95E8\u65F6\u95F4",trigger:["blur"]}],finished_time:[{required:!0,message:"\u8BF7\u8F93\u5165\u7ED3\u5355\u65F6\u95F4",trigger:["blur"]}],master_worker_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u5E08\u5085",trigger:["blur"]}]}),F=async r=>{for(const e in u)r[e]!=null&&r[e]!=null&&(u[e]=r[e])},B=async r=>{const e=await S({id:r.id});F(e)},v=async()=>{var e,s;await((e=_.value)==null?void 0:e.validate());const r={...u};n.value=="edit"?await j(r):await L(r),(s=d.value)==null||s.close(),p("success")},h=(r="add")=>{var e;n.value=r,(e=d.value)==null||e.open()},C=()=>{p("close")};return w({open:h,setFormData:F,getDetail:B}),(r,e)=>{const s=x,i=I,R=q,y=W,A=O;return m(),f("div",G,[a(P,{ref_key:"popupRef",ref:d,title:l(V),async:!0,width:"550px",onConfirm:v,onClose:C},{default:o(()=>[a(A,{ref_key:"formRef",ref:_,model:l(u),"label-width":"90px",rules:l(g)},{default:o(()=>[a(i,{label:"\u5DE5\u5355\u7F16\u53F7",prop:"work_sn"},{default:o(()=>[a(s,{modelValue:l(u).work_sn,"onUpdate:modelValue":e[0]||(e[0]=t=>l(u).work_sn=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5DE5\u5355\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),a(i,{label:"\u670D\u52A1\u5DE5\u5355ID",prop:"service_work_id"},{default:o(()=>[a(s,{modelValue:l(u).service_work_id,"onUpdate:modelValue":e[1]||(e[1]=t=>l(u).service_work_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u670D\u52A1\u5DE5\u5355ID"},null,8,["modelValue"])]),_:1}),a(i,{label:"\u6295\u8BC9\u5DE5\u5355ID",prop:"issue_work_id"},{default:o(()=>[a(s,{modelValue:l(u).issue_work_id,"onUpdate:modelValue":e[2]||(e[2]=t=>l(u).issue_work_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6295\u8BC9\u5DE5\u5355ID"},null,8,["modelValue"])]),_:1}),a(i,{label:"\u8FD4\u4FEE\u5DE5\u5355\u72B6\u6001",prop:"return_work_status"},{default:o(()=>[a(y,{class:"flex-1",modelValue:l(u).return_work_status,"onUpdate:modelValue":e[3]||(e[3]=t=>l(u).return_work_status=t),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u8FD4\u4FEE\u5DE5\u5355\u72B6\u6001"},{default:o(()=>[(m(!0),f(Q,null,T(k.dictData.return_work_status,(t,U)=>(m(),z(R,{key:U,label:t.name,value:parseInt(t.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(i,{label:"\u6D3E\u5355\u65F6\u95F4",prop:"dispatch_time"},{default:o(()=>[a(s,{modelValue:l(u).dispatch_time,"onUpdate:modelValue":e[4]||(e[4]=t=>l(u).dispatch_time=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6D3E\u5355\u65F6\u95F4"},null,8,["modelValue"])]),_:1}),a(i,{label:"\u9884\u7EA6\u4E0A\u95E8\u65F6\u95F4",prop:"appointment_time"},{default:o(()=>[a(s,{modelValue:l(u).appointment_time,"onUpdate:modelValue":e[5]||(e[5]=t=>l(u).appointment_time=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9884\u7EA6\u4E0A\u95E8\u65F6\u95F4"},null,8,["modelValue"])]),_:1}),a(i,{label:"\u7ED3\u5355\u62CD\u7167",prop:"finished_images"},{default:o(()=>[a(s,{modelValue:l(u).finished_images,"onUpdate:modelValue":e[6]||(e[6]=t=>l(u).finished_images=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7ED3\u5355\u62CD\u7167"},null,8,["modelValue"])]),_:1}),a(i,{label:"\u7ED3\u5355\u65F6\u95F4",prop:"finished_time"},{default:o(()=>[a(s,{modelValue:l(u).finished_time,"onUpdate:modelValue":e[7]||(e[7]=t=>l(u).finished_time=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7ED3\u5355\u65F6\u95F4"},null,8,["modelValue"])]),_:1}),a(i,{label:"\u5E08\u5085",prop:"master_worker_id"},{default:o(()=>[a(s,{modelValue:l(u).master_worker_id,"onUpdate:modelValue":e[8]||(e[8]=t=>l(u).master_worker_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5E08\u5085"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{$ as _};
