import{r as E,E as _}from"./index.BKEMpsLA.js";import{a as M,r as j,w as k,_ as q,aj as r,J as p,o as m,K as t,S as o,M as c,P as y}from"./vue.YrNK8sx4.js";const P=M({__name:"index",props:{id:{},visible:{type:Boolean}},emits:["update:visible","success"],setup(C,{emit:x}){const u=C,f=x;console.log("props::::",u.id);const n=j(u.visible);k(()=>u.visible,s=>n.value=s),k(()=>n.value,s=>f("update:visible",s));const l=q({status:1,repair_person:"",repair_result:"",repair_cost:0,repair_remark:"",repair_attachments:""}),b=()=>{n.value=!1},g=async()=>{try{const s=await E({url:`/api/system/device-damage-records/${u.id}/update_repair_status/`,method:"post",data:l});s.code===2e3?(_.success("状态更新成功"),f("success"),n.value=!1):_.error(s.msg||"更新失败")}catch{_.error("请求失败")}};return(s,e)=>{const d=r("el-option"),w=r("el-select"),i=r("el-form-item"),v=r("el-input"),U=r("el-input-number"),B=r("el-form"),V=r("el-button"),N=r("el-dialog");return m(),p(N,{modelValue:n.value,"onUpdate:modelValue":e[4]||(e[4]=a=>n.value=a),title:"修改维修状态",width:"500px","close-on-click-modal":!1,onClose:b},{footer:t(()=>[o(V,{onClick:b},{default:t(()=>e[5]||(e[5]=[y("取消")])),_:1}),o(V,{type:"primary",onClick:g},{default:t(()=>e[6]||(e[6]=[y("提交")])),_:1})]),default:t(()=>[o(B,{model:l,"label-width":"100px"},{default:t(()=>[o(i,{label:"维修状态"},{default:t(()=>[o(w,{modelValue:l.status,"onUpdate:modelValue":e[0]||(e[0]=a=>l.status=a),placeholder:"请选择维修状态"},{default:t(()=>[o(d,{label:"待维修",value:1}),o(d,{label:"维修中",value:2}),o(d,{label:"维修完成",value:3})]),_:1},8,["modelValue"])]),_:1}),l.status===2?(m(),p(i,{key:0,label:"维修人员"},{default:t(()=>[o(v,{modelValue:l.repair_person,"onUpdate:modelValue":e[1]||(e[1]=a=>l.repair_person=a),placeholder:"请输入维修人员"},null,8,["modelValue"])]),_:1})):c("",!0),l.status===3?(m(),p(i,{key:1,label:"维修结果"},{default:t(()=>[o(v,{modelValue:l.repair_result,"onUpdate:modelValue":e[2]||(e[2]=a=>l.repair_result=a),placeholder:"请输入维修结果"},null,8,["modelValue"])]),_:1})):c("",!0),l.status===3?(m(),p(i,{key:2,label:"维修费用"},{default:t(()=>[o(U,{modelValue:l.repair_cost,"onUpdate:modelValue":e[3]||(e[3]=a=>l.repair_cost=a),min:0},null,8,["modelValue"])]),_:1})):c("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});export{P as _};
