import{C as x,D as I,S as q,T as W,F as S}from"./element-plus.55d71530.js";import{P as L}from"./index.9939838f.js";import{a as O,c as P,d as T}from"./return_work.b2e3b7de.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";import{d as D,s as E,r as j,b as M,_ as c,o as m,c as f,V as a,M as o,u as l,U as N,aa as z,L as G}from"./@vue.96c135a1.js";const H={class:"edit-popup"},J=D({name:"returnWorkEdit"}),ee=D({...J,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(k,{expose:w,emit:b}){const p=b,_=E(),d=E(),n=j("add"),V=M(()=>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:""}),B=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\u5DE5\u7A0B\u5E08",trigger:["blur"]}]}),F=async r=>{for(const e in u)r[e]!=null&&r[e]!=null&&(u[e]=r[e])},g=async r=>{const e=await O({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 P(r):await T(r),(s=d.value)==null||s.close(),p("success")},h=(r="add")=>{var e;n.value=r,(e=d.value)==null||e.open()},A=()=>{p("close")};return w({open:h,setFormData:F,getDetail:g}),(r,e)=>{const s=x,i=I,C=q,U=W,y=S;return m(),f("div",H,[a(L,{ref_key:"popupRef",ref:d,title:l(V),async:!0,width:"550px",onConfirm:v,onClose:A},{default:o(()=>[a(y,{ref_key:"formRef",ref:_,model:l(u),"label-width":"90px",rules:l(B)},{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(U,{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(N,null,z(k.dictData.return_work_status,(t,R)=>(m(),G(C,{key:R,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:"\u5DE5\u7A0B\u5E08",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\u5DE5\u7A0B\u5E08"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{ee as _};
