/*! * build: Hopaheal * copyright: Mead * time: 2023-3-13 15:21:04 */ (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-29ef5f9e"],{"020b":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{"append-to-body":"","before-close":e.handleClose,title:"批量维护",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",{staticClass:"content_1"},[a("el-form",{ref:"form",attrs:{"label-width":"120px",model:e.form,rules:e.rules}},[a("el-form-item",{attrs:{label:"实验室:",prop:"room_id"}},[a("el-select",{attrs:{clearable:"",disabled:"",placeholder:"请选择实验室"},model:{value:e.form.room_id,callback:function(t){e.$set(e.form,"room_id",t)},expression:"form.room_id"}},e._l(e.roomList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"维护周:",prop:"week"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护周"},model:{value:e.form.week,callback:function(t){e.$set(e.form,"week",t)},expression:"form.week"}},e._l(e.weekList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.name,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"维护星期:",prop:"week_index"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护星期"},model:{value:e.form.week_index,callback:function(t){e.$set(e.form,"week_index",t)},expression:"form.week_index"}},e._l(e.weekIndexList,(function(e,t){return a("el-option",{key:t,attrs:{label:e,value:t}})})),1)],1),a("el-form-item",{attrs:{label:"维护时间段:",prop:"time_id"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护时间段"},on:{change:e.changeTime},model:{value:e.form.time_id,callback:function(t){e.$set(e.form,"time_id",t)},expression:"form.time_id"}},e._l(e.timeList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),e.transformAuth("200601")?a("el-form-item",{attrs:{label:"维护人员:",prop:"maintain_admin_id"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护人员"},on:{change:e.changeAdmin},model:{value:e.form.maintain_admin_id,callback:function(t){e.$set(e.form,"maintain_admin_id",t)},expression:"form.maintain_admin_id"}},e._l(e.maintainAdminList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1):e._e(),a("el-form-item",{attrs:{label:"维护内容:",prop:"body"}},[a("el-input",{attrs:{placeholder:"请输入内容",rows:10,type:"textarea"},model:{value:e.form.body,callback:function(t){e.$set(e.form,"body",t)},expression:"form.body"}})],1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.handleClose}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])],1)])},s=[],o=a("f7e3"),l=a("d12b"),r={name:"TemplateClassdialog",data(){return{dialogVisible:!1,type:"",form:{status:1,week:"",time_id:"",week_index:"",room_id:"",body:""},body:"",maintainAdminList:[],roomList:[],weekList:[],timeList:[],cycleList:[{id:1,name:"全部周"},{id:2,name:"单周"},{id:3,name:"双周"}],weekIndexList:["星期一","星期二","星期三","星期四","星期五","星期六","星期日"],rules:{week:[{required:!0,trigger:"change",message:"请选择教学周"}],time_id:[{required:!0,trigger:"change",message:"请选择维护节次"}],week_index:[{required:!0,trigger:"change",message:"请选择星期"}],room_id:[{required:!0,trigger:"change",message:"请选择实验室"}],status:[{required:!0,trigger:"change",message:"请选择状态"}]}}},methods:{transformAuth:l["transformAuth"],async getDetail(e){const{data:t}=await Object(o["getDetail"])(e);this.form={id:t.id,status:t.status,week:t.week,time_id:t.time?t.time.id:"",week_index:t.week_index,room_id:t.room?t.room.id:"",body:t.body}},async adminOptions(){const{data:e}=await Object(o["adminOptions"])({role_names:["admin","maintain"]});this.maintainAdminList=e},getTnyMac(e){console.log(e,"pppppppppppppppppp"),this.form.body=e,console.log()},async getTimeList(){const{data:e}=await Object(o["timeList"])();this.timeList=e},handleClose(){this.body="",this.dialogVisible=!1},showEdit(e){this.weekList=[];let t=localStorage.getItem("roomList")?JSON.parse(localStorage.getItem("roomList")):[];this.roomList=t,this.getWeeks(),this.adminOptions(),this.$nextTick(()=>{this.form=Object.assign({},e),this.$set(this.form,this.form)}),console.log(""),this.getTimeList(),this.dialogVisible=!0},getWeeks(){let e=localStorage.getItem("term_weeks");for(let t=1;t<=e;t++)this.weekList.push({name:"第"+t+"周",value:t})},changeTime(e){this.timeList.map(t=>{t.id==e&&(this.form.time_name=t.name)}),this.form.body="text"},createRepairList(){this.$refs["batch-repair-table"].showEdit(this.form)},changeAdmin(e){this.maintainAdminList.map(t=>{t.id==e&&(this.form.maintain_admin_name=t.name)})},save(){console.log(this.form,"form"),this.$emit("change-row",this.form),this.body="",this.dialogVisible=!1}}},n=r,d=(a("5957"),a("0b56")),m=Object(d["a"])(n,i,s,!1,null,"51c837da",null);t["default"]=m.exports},"139a":function(e,t,a){},"1d13":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{"append-to-body":"","before-close":e.handleClose,title:"批量维护列表",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",{staticClass:"content_1"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{border:"",data:e.list,"max-height":"500"}},[a("el-table-column",{attrs:{align:"center",label:"序号",prop:"date",type:"index",width:"50"}}),a("el-table-column",{attrs:{align:"center",label:"实验室名称","min-width":"180",prop:"room_name"}}),a("el-table-column",{attrs:{align:"center",label:"维护时间","min-width":"240",prop:"day"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",[e._v(" 第"+e._s(i.week?i.week:"--")+"周 星期"+e._s(e.transformWeek(i.week_index))+" "+e._s(i.time_name)+" ")])]}}])}),a("el-table-column",{attrs:{align:"center",label:"维护人员","min-width":"120",prop:"admin"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",[e._v(e._s(i.admin_name))])]}}])}),a("el-table-column",{attrs:{align:"center",label:"维护内容","min-width":"200",prop:"body"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("div",{domProps:{innerHTML:e._s(i.body)}})]}}])}),a("el-table-column",{attrs:{align:"center",label:"操作","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.doEdit(i)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.doDelete(i)}}},[e._v("删除")])]}}])})],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.handleClose}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.sureAdd()}}},[e._v("立即添加")])],1),a("batchEdit",{ref:"batch-edit",on:{"change-row":e.changeRow}})],1)},s=[],o=a("d12b"),l=a("020b"),r=a("f7e3"),n={name:"LabcenterBatchrepairtable",components:{batchEdit:l["default"]},data(){return{dialogVisible:!1,list:[],listLoading:!0,room_id:""}},methods:{handleClose(){this.dialogVisible=!1},transformWeek:o["transformWeek"],showEdit(e){let t=localStorage.getItem("term_weeks");console.log(e,"pppppppppp");var a=[];if(this.room_id=e.room_id,1==e.week_type)for(var i=1;i{t.id==e.room_id&&(l=t.name)});let n=[];a.map(t=>{n.push({week:t,id:t,time_id:e.time_id,week_index:e.week_index,admin_id:e.admin_id,body:e.body,room_name:l,time_name:e.time_name,status:1,admin_name:e.admin_name,room_id:e.room_id})}),this.list=n,console.log(n,"datadatadatadatadatadatadatadatadatadatadatadata"),this.dialogVisible=!0,this.listLoading=!1},changeRow(e){this.list.map((t,a)=>{t.id==e.id&&this.$set(this.list,a,e)}),console.log(this.list,"list")},doEdit(e){this.$refs["batch-edit"].showEdit(e),console.log(e,"ooooooooooo")},doDelete(e){this.$baseConfirm("你确定要取消当前实验室维护吗?",null,async()=>{this.list=this.list.filter(t=>t.id!==e.id),this.$set(this.list,this.list),this.$baseMessage("删除成功","success",!1,"vab-hey-message-success")})},async sureAdd(){if(0==this.list.length)return this.$message.warning("请至少添加一条维护数据!"),void(this.dialogVisible=!1);let e={room_id:this.room_id,maintain_data:this.list};const{message:t}=await Object(r["batchRepair"])(e);this.$baseMessage(t,"success",!1,"vab-hey-message-success"),this.$router.push({path:"/room/repair"})}}},d=n,m=a("0b56"),c=Object(m["a"])(d,i,s,!1,null,null,null);t["default"]=c.exports},"3a94":function(e,t,a){},"3c5b":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{"before-close":e.handleClose,title:1==e.type?"添加":"编辑",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",{staticClass:"content_1"},[a("el-form",{ref:"form",attrs:{"label-width":"120px",model:e.form,rules:e.rules}},[a("el-form-item",{attrs:{label:"实验室:",prop:"room_id"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择实验室"},model:{value:e.form.room_id,callback:function(t){e.$set(e.form,"room_id",t)},expression:"form.room_id"}},e._l(e.roomList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"维护教学周:",prop:"week"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护教学周"},model:{value:e.form.week,callback:function(t){e.$set(e.form,"week",t)},expression:"form.week"}},e._l(e.weekList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.name,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"维护星期:",prop:"week_index"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护星期"},model:{value:e.form.week_index,callback:function(t){e.$set(e.form,"week_index",t)},expression:"form.week_index"}},e._l(e.weekIndexList,(function(e,t){return a("el-option",{key:t,attrs:{label:e,value:t}})})),1)],1),a("el-form-item",{attrs:{label:"维护时间段:",prop:"time_id"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护时间段"},model:{value:e.form.time_id,callback:function(t){e.$set(e.form,"time_id",t)},expression:"form.time_id"}},e._l(e.timeList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),e.transformAuth("200601")?a("el-form-item",{attrs:{label:"维护人员:",prop:"maintain_admin_id"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护人员"},on:{change:e.changeAdmin},model:{value:e.form.maintain_admin_id,callback:function(t){e.$set(e.form,"maintain_admin_id",t)},expression:"form.maintain_admin_id"}},e._l(e.maintainAdminList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1):e._e(),a("el-form-item",{attrs:{label:"维护内容:",prop:"body"}},[a("el-input",{attrs:{placeholder:"请输入内容",rows:10,type:"textarea"},model:{value:e.form.body,callback:function(t){e.$set(e.form,"body",t)},expression:"form.body"}})],1),a("el-form-item",{attrs:{label:"状态:",prop:"status"}},[a("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[a("el-radio",{attrs:{label:1}},[e._v("正常")]),a("el-radio",{attrs:{label:0}},[e._v("禁用")])],1)],1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.handleClose}},[e._v("取 消")]),1==e.type?a("el-button",{attrs:{type:"primary"},on:{click:e.sureAdd}},[e._v(" 添 加 ")]):e._e(),2==e.type?a("el-button",{attrs:{type:"primary"},on:{click:e.sureSave}},[e._v(" 保存 ")]):e._e()],1)])},s=[],o=a("f7e3"),l=a("d12b"),r={name:"TemplateClassdialog",data(){return{dialogVisible:!1,type:"",form:{status:1,week:"",time_id:"",week_index:"",maintain_admin_id:"",room_id:"",body:""},maintainAdminList:[],roomList:[],weekList:[],timeList:[],weekIndexList:["星期一","星期二","星期三","星期四","星期五","星期六","星期日"],rules:{maintain_admin_id:[{required:!0,trigger:"change",message:"请选择维护人员"}],week:[{required:!0,trigger:"change",message:"请选择教学周"}],time_id:[{required:!0,trigger:"change",message:"请选择维护节次"}],week_index:[{required:!0,trigger:"change",message:"请选择星期"}],room_id:[{required:!0,trigger:"change",message:"请选择实验室"}],body:[{required:!0,trigger:"blur",message:"请输入维护内容"}],status:[{required:!0,trigger:"change",message:"请选择状态"}]}}},methods:{transformAuth:l["transformAuth"],changeAdmin(e){this.maintainAdminList.map(t=>{t.id==e&&(this.form.maintain_admin_name=t.name)})},async getRoomList(){const{data:e}=await Object(o["getRoomListOption"])();this.roomList=e,localStorage.setItem("roomList",JSON.stringify(e))},async adminOptions(){const{data:e}=await Object(o["adminOptions"])({role_names:["admin","maintain"]});this.maintainAdminList=e},async getDetail(e){const{data:t}=await Object(o["getDetail"])(e);this.form={id:t.id,status:t.status,week:t.week,time_id:t.time?t.time.id:"",week_index:t.week_index,room_id:t.room?t.room.id:"",body:t.body,maintain_admin_id:t.maintain_admin?t.maintain_admin.id:""}},getTnyMac(e){this.form.body=e},async getTimeList(){const{data:e}=await Object(o["timeList"])();this.timeList=e},handleClose(){this.form={status:1,week:"",time_id:"",week_index:"",room_id:"",body:"",maintain_admin_id:""},this.$refs["form"].resetFields(),this.dialogVisible=!1},showEdit(e){this.weekList=[],console.log(this.$store.state.user.user_id),this.getRoomList(),this.getWeeks(),this.getTimeList(),this.adminOptions(),e?(this.type=2,console.log(e),this.getDetail(e.id)):this.type=1,this.dialogVisible=!0},getWeeks(){let e=localStorage.getItem("term_weeks");for(let t=1;t<=e;t++)this.weekList.push({name:"第"+t+"周",value:t})},sureAdd(){this.form.maintain_admin_id||(this.form.maintain_admin_id=this.$store.state.user.user_id),this.$refs["form"].validate(async e=>{if(e){const{message:e}=await Object(o["doAdd"])(this.form);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.$emit("fetch-data"),this.$refs["form"].resetFields(),this.handleClose()}})},sureSave(){this.$refs["form"].validate(async e=>{if(e){const{message:e}=await Object(o["doEdit"])(this.form);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.$emit("fetch-data"),this.$refs["form"].resetFields(),this.handleClose()}})}}},n=r,d=(a("7008"),a("0b56")),m=Object(d["a"])(n,i,s,!1,null,"470e88dc",null);t["default"]=m.exports},"457f":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[a("vab-query-form",[a("vab-query-form-left-panel",{attrs:{span:8}},[a("el-button",{attrs:{icon:"el-icon-plus",type:"primary"},on:{click:e.handleEdit}},[e._v(" 申请维护 ")]),a("el-button",{staticClass:"batch-add",attrs:{icon:"el-icon-plus",type:"warning"},on:{click:e.batchRepair}},[e._v(" 批量维护 ")])],1),a("vab-query-form-right-panel",{attrs:{span:16}},[a("el-form",{attrs:{inline:!0,model:e.queryForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{prop:"room_id"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择实验室"},on:{change:e.queryData},model:{value:e.queryForm.room_id,callback:function(t){e.$set(e.queryForm,"room_id",t)},expression:"queryForm.room_id"}},e._l(e.roomList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",[a("el-input",{attrs:{clearable:"",placeholder:"请输入维护人员姓名"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData(t)}},model:{value:e.queryForm.maintain_admin_name,callback:function(t){e.$set(e.queryForm,"maintain_admin_name","string"===typeof t?t.trim():t)},expression:"queryForm.maintain_admin_name"}})],1),a("el-form-item",{attrs:{prop:"status"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护状态"},on:{change:e.queryData},model:{value:e.queryForm.complete_status,callback:function(t){e.$set(e.queryForm,"complete_status",t)},expression:"queryForm.complete_status"}},e._l(e.statusList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-search",type:"primary"},on:{click:e.queryData}},[e._v(" 查询 ")])],1)],1)],1)],1),a("div",[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{border:"",data:e.list},on:{"selection-change":e.setSelectRows}},[a("el-table-column",{attrs:{"show-overflow-tooltip":"",type:"selection"}}),a("el-table-column",{attrs:{align:"center",label:"序号",prop:"date",type:"index",width:"50"}}),a("el-table-column",{attrs:{align:"center",label:"实验室名称","min-width":"180",prop:"room"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",[e._v(" "+e._s(i.room?i.room.name:"--")+" ")])]}}])}),a("el-table-column",{attrs:{align:"center",label:"维护时间","min-width":"240",prop:"day"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",[e._v(" 第"+e._s(i.week)+"周 / 周"+e._s(e.transformWeek(i.week_index))+"("+e._s(i.day)+") / "+e._s(i.time?i.time.name:"--")+" ")])]}}])}),a("el-table-column",{attrs:{align:"center",label:"维护人员","min-width":"120",prop:"maintain_admin"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",[e._v(" "+e._s(i.maintain_admin?i.maintain_admin.name:"--")+" ")])]}}])}),a("el-table-column",{attrs:{align:"center",label:"维护状态","min-width":"100",prop:"status"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[0==i.complete_status?a("el-tag",{attrs:{type:"warning"}},[e._v(" 待维护 ")]):e._e(),1==i.complete_status?a("el-tag",{attrs:{type:"success"}},[e._v(" 维护完成 ")]):e._e()]}}])}),a("el-table-column",{attrs:{align:"center",label:"可用座位数","min-width":"100",prop:"use_student_nums"}}),a("el-table-column",{attrs:{align:"center",label:"状态","min-width":"100",prop:"status"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[1==i.status?a("el-tag",[e._v("正常")]):e._e(),0==i.status?a("el-tag",{attrs:{type:"danger"}},[e._v("禁用")]):e._e()]}}])}),a("el-table-column",{attrs:{align:"center",label:"申请时间","min-width":"150",prop:"created_at"}}),a("el-table-column",{attrs:{align:"center",fixed:"right",label:"操作","min-width":"180"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handleDetail(i)}}},[e._v("详情")]),0==i.complete_status?a("el-button",{staticStyle:{color:"#0ba526"},attrs:{type:"text"},on:{click:function(t){return e.handleEdit(i)}}},[e._v(" 编辑 ")]):e._e(),1==i.status&&0==i.complete_status?a("el-button",{staticStyle:{color:"#ff6e27"},attrs:{type:"text"},on:{click:function(t){return e.handleCancel(i)}}},[e._v(" 取消维护 ")]):e._e(),1==i.status&&0==i.complete_status?a("el-button",{staticStyle:{color:"#0ba526"},attrs:{type:"text"},on:{click:function(t){return e.handleComplete(i)}}},[e._v(" 维护完成 ")]):e._e(),e.transformAuth("*")?a("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(t){return e.handleDelete(i)}}},[e._v(" 删除 ")]):e._e()]}}])})],1),a("el-pagination",{attrs:{background:"","current-page":e.queryForm.page,layout:e.layout,"page-size":e.queryForm.per_page,"page-sizes":[15,20,30,40,50,100],total:e.total},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})],1),a("addRepair",{ref:"add-repair",on:{"fetch-data":e.getList}}),a("batchAddRepair",{ref:"bath-repair"}),a("repairDetail",{ref:"repair-detail"}),a("completeDialog",{ref:"complete-batch",on:{"fetch-data":e.getList}})],1)},s=[],o=a("d12b"),l=a("f7e3"),r=a("3c5b"),n=a("a3bd"),d=a("c4d7"),m=a("6d5d"),c={components:{addRepair:r["default"],batchAddRepair:n["default"],repairDetail:d["default"],completeDialog:m["default"]},data(){return{listLoading:!0,layout:"total, sizes, prev, pager, next, jumper",total:1,queryForm:{status:"",room_id:"",page:1,per_page:15},roomList:[],selectRows:[],list:[1,1,1,1,1,1,1,1],statusList:[{id:1,name:"维护完成"},{id:0,name:"待维护"}]}},created(){this.getList();let e=localStorage.getItem("roomList")?JSON.parse(localStorage.getItem("roomList")):[];this.roomList=e},methods:{transformAuth:o["transformAuth"],handleExport(){},transformWeek:o["transformWeek"],batchRepair(){this.$router.push({path:"/room/batchRepair"})},async getList(){const{data:e}=await Object(l["repairList"])(this.queryForm);this.list=e.list;const{pagination:t}=e.meta;this.total=t.total,this.listLoading=!1},queryData(){this.queryForm.page=1,this.getList()},handleSizeChange(e){this.queryForm.per_page=e,this.getList()},handleCurrentChange(e){this.queryForm.page=e,this.getList()},handleDetail(e){this.$refs["repair-detail"].showEdit(e.id)},handleEdit(e){e.id?this.$refs["add-repair"].showEdit({id:e.id}):this.$refs["add-repair"].showEdit()},handleComplete(e){this.$refs["complete-batch"].showEdit(e.id)},handleCancel(e){this.$baseConfirm("你确定要取消当前实验室维护吗?",null,async()=>{const{message:t}=await Object(l["cancelRepair"])({id:e.id});this.$baseMessage(t,"success",!1,"vab-hey-message-success"),await this.getList()})},setSelectRows(e){this.selectRows=e},handleDelete(e){if(e.id)this.$baseConfirm("您确定要删除当前维护数据吗",null,async()=>{const{message:t}=await Object(l["batchDelete"])({ids:[e.id]});this.$baseMessage(t,"success",!1,"vab-hey-message-success"),await this.getList()});else if(this.selectRows.length>0){let e=this.selectRows.map(e=>e.id);this.$baseConfirm("您确定要删除当前维护数据吗",null,async()=>{const{message:t}=await Object(l["batchDelete"])({ids:e});this.$baseMessage(t,"success",!1,"vab-hey-message-success"),await this.getList()})}else this.$baseMessage("请先选择要删除的项!","error",!1,"vab-hey-message-error")}}},u=c,f=(a("aef5"),a("0b56")),p=Object(f["a"])(u,i,s,!1,null,"7d7b1144",null);t["default"]=p.exports},5957:function(e,t,a){"use strict";a("cf81")},"6ba4":function(e,t,a){},"6d5d":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{"before-close":e.handleClose,title:"维护完成",visible:e.dialogVisible,width:"950px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("el-form",{ref:"form",attrs:{"label-width":"110px",model:e.complete_form,rules:e.rules}},[a("el-form-item",{attrs:{label:"可用座位数:",prop:"use_student_nums"}},[a("el-input",{attrs:{placeholder:"请输入可用座位数"},model:{value:e.complete_form.use_student_nums,callback:function(t){e.$set(e.complete_form,"use_student_nums",t)},expression:"complete_form.use_student_nums"}})],1),a("el-form-item",{attrs:{label:"备注:"}},[a("el-input",{attrs:{rows:8,type:"textarea"},model:{value:e.complete_form.check_result,callback:function(t){e.$set(e.complete_form,"check_result",t)},expression:"complete_form.check_result"}})],1)],1),a("div",{staticStyle:{"text-align":"center"}},[a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.handleClose}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.doComplete}},[e._v("确 定")])],1)])],1)},s=[],o=a("f7e3"),l={data(){return{dialogVisible:!1,complete_form:{complete_status:1},rules:{use_student_nums:[{required:!0,trigger:"blur",message:"请输入可用座位数"}]}}},methods:{showEdit(e){this.complete_form.id=e,this.dialogVisible=!0},handleClose(){this.complete_form={id:"",complete_status:1,remark:""},this.dialogVisible=!1},async doComplete(){this.$refs["form"].validate(async e=>{var t=new RegExp("^[0-9]*[1-9][0-9]*$");if(e){if(!t.test(this.complete_form.use_student_nums))return this.$message.warning("可用座位数必须为正整数"),void(this.complete_form.use_student_nums="");const{message:e}=await Object(o["repairComplete"])(this.complete_form);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.$emit("fetch-data"),this.$refs["form"].resetFields(),this.handleClose()}})}}},r=l,n=a("0b56"),d=Object(n["a"])(r,i,s,!1,null,null,null);t["default"]=d.exports},7008:function(e,t,a){"use strict";a("139a")},"77cc":function(e,t,a){"use strict";a("6ba4")},9577:function(e,t,a){},a3bd:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{"before-close":e.handleClose,title:"批量维护",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",{staticClass:"content_1"},[a("el-form",{ref:"form",attrs:{"label-width":"120px",model:e.form,rules:e.rules}},[a("el-form-item",{attrs:{label:"实验室:",prop:"room_id"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择实验室"},model:{value:e.form.room_id,callback:function(t){e.$set(e.form,"room_id",t)},expression:"form.room_id"}},e._l(e.roomList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"维护周期:",prop:"week_type"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护周"},model:{value:e.form.week_type,callback:function(t){e.$set(e.form,"week_type",t)},expression:"form.week_type"}},e._l(e.cycleList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"维护星期:",prop:"week_index"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护星期"},model:{value:e.form.week_index,callback:function(t){e.$set(e.form,"week_index",t)},expression:"form.week_index"}},e._l(e.weekIndexList,(function(e,t){return a("el-option",{key:t,attrs:{label:e,value:t}})})),1)],1),a("el-form-item",{attrs:{label:"维护时间段:",prop:"time_id"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择维护时间段"},on:{change:e.changeTime},model:{value:e.form.time_id,callback:function(t){e.$set(e.form,"time_id",t)},expression:"form.time_id"}},e._l(e.timeList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"维护内容:",prop:"body"}},[a("tiny-mce",{attrs:{content:e.form.body,"tiny-height":300},on:{childByValue:e.getTnyMac}})],1),a("el-form-item",{attrs:{label:"状态:",prop:"status"}},[a("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[a("el-radio",{attrs:{label:1}},[e._v("正常")]),a("el-radio",{attrs:{label:0}},[e._v("禁用")])],1)],1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.handleClose}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.createRepairList}},[e._v("生成维护表")])],1),a("batchRepairTable",{ref:"batch-repair-table"})],1)},s=[],o=a("f7e3"),l=a("1d13"),r={name:"TemplateClassdialog",components:{batchRepairTable:l["default"]},data(){return{dialogVisible:!1,type:"",form:{status:1,week_type:"",time_id:"",week_index:"",room_id:"",body:""},roomList:[],weekList:[],timeList:[],cycleList:[{id:1,name:"全部周"},{id:2,name:"单周"},{id:3,name:"双周"}],weekIndexList:["星期一","星期二","星期三","星期四","星期五","星期六","星期日"],rules:{week:[{required:!0,trigger:"change",message:"请选择教学周"}],time_id:[{required:!0,trigger:"change",message:"请选择维护节次"}],week_index:[{required:!0,trigger:"change",message:"请选择星期"}],room_id:[{required:!0,trigger:"change",message:"请选择实验室"}],body:[{required:!0,trigger:"blur",message:"请输入维护内容"}],status:[{required:!0,trigger:"change",message:"请选择状态"}]}}},methods:{async getDetail(e){const{data:t}=await Object(o["getDetail"])(e);this.form={id:t.id,status:t.status,week:t.week,time_id:t.time?t.time.id:"",week_index:t.week_index,room_id:t.room?t.room.id:"",body:t.body}},getTnyMac(e){this.form.body=e},async getTimeList(){const{data:e}=await Object(o["timeList"])();this.timeList=e},handleClose(){this.form={status:1,week:"",time_id:"",week_index:"",room_id:"",body:""},this.$refs["form"].resetFields(),this.dialogVisible=!1},showEdit(){let e=localStorage.getItem("roomList")?JSON.parse(localStorage.getItem("roomList")):[];this.roomList=e,this.getTimeList(),this.dialogVisible=!0},getWeeks(){let e=localStorage.getItem("term_weeks");for(let t=1;t<=e;t++)this.weekList.push({name:"第"+t+"周",value:t})},changeTime(e){this.timeList.map(t=>{t.id==e&&(this.form.time_name=t.name)})},createRepairList(){this.$refs["batch-repair-table"].showEdit(this.form)},sureAdd(){this.$refs["form"].validate(async e=>{if(e){const{message:e}=await Object(o["doAdd"])(this.form);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.$emit("fetch-data"),this.$refs["form"].resetFields(),this.handleClose()}})},sureSave(){this.$refs["form"].validate(async e=>{if(e){const{message:e}=await Object(o["doEdit"])(this.form);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.$emit("fetch-data"),this.$refs["form"].resetFields(),this.handleClose()}})}}},n=r,d=(a("c93d"),a("0b56")),m=Object(d["a"])(n,i,s,!1,null,"fc36d224",null);t["default"]=m.exports},aef5:function(e,t,a){"use strict";a("9577")},c4d7:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{"before-close":e.handleClose,center:"",title:"维护详情",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",{staticClass:"content"},[a("div",{staticClass:"form"},[a("div",{staticClass:"label"},[e._v("实验室名称:")]),a("div",{staticClass:"text"},[e._v(e._s(e.detail.room?e.detail.room.name:"--"))])]),a("div",{staticClass:"form"},[a("div",{staticClass:"label"},[e._v("维护时间:")]),a("div",{staticClass:"text"},[e._v(" 第"+e._s(e.detail.week)+"周 / 周"+e._s(e.transformWeek(e.detail.week_index))+"("+e._s(e.detail.day)+") / "+e._s(e.detail.time?e.detail.time.name:"--")+" ")])]),a("div",{staticClass:"form"},[a("div",{staticClass:"label"},[e._v("维护人员:")]),a("div",{staticClass:"text"},[e._v(" "+e._s(e.detail.maintain_admin?e.detail.maintain_admin.name:"--")+" ")])]),a("div",{staticClass:"form"},[a("div",{staticClass:"label"},[e._v("维护内容:")]),a("div",{staticClass:"text",domProps:{innerHTML:e._s(e.detail.body)}})])]),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("确 定")])],1)])},s=[],o=a("d12b"),l=a("f7e3"),r={name:"TemplateClassdialog",data(){return{dialogVisible:!1,detail:""}},methods:{transformWeek:o["transformWeek"],async recordDetail(e){const{data:t}=await Object(l["getDetail"])(e);this.detail=t},handleClose(){this.dialogVisible=!1},showEdit(e){this.recordDetail(e),this.dialogVisible=!0}}},n=r,d=(a("77cc"),a("0b56")),m=Object(d["a"])(n,i,s,!1,null,"464c0f58",null);t["default"]=m.exports},c93d:function(e,t,a){"use strict";a("3a94")},cf81:function(e,t,a){},f7e3:function(e,t,a){"use strict";a.r(t),a.d(t,"repairList",(function(){return s})),a.d(t,"timeList",(function(){return o})),a.d(t,"doAdd",(function(){return l})),a.d(t,"doEdit",(function(){return r})),a.d(t,"getDetail",(function(){return n})),a.d(t,"cancelRepair",(function(){return d})),a.d(t,"batchRepair",(function(){return m})),a.d(t,"batchDelete",(function(){return c})),a.d(t,"adminOptions",(function(){return u})),a.d(t,"getRoomListOption",(function(){return f})),a.d(t,"repairComplete",(function(){return p}));var i=a("b775");function s(e){return Object(i["default"])({url:"/lab/maintain",method:"get",params:e})}function o(e){return Object(i["default"])({url:"/school/time-select-options",method:"get",params:e})}function l(e){return Object(i["default"])({url:"/lab/maintain",method:"post",data:e})}function r(e){return Object(i["default"])({url:"/lab/maintain/"+e.id,method:"put",data:e})}function n(e){return Object(i["default"])({url:"/lab/maintain/info/"+e,method:"get"})}function d(e){return Object(i["default"])({url:"/lab/maintain/pause",method:"get",params:e})}function m(e){return Object(i["default"])({url:"/lab/maintain/batch",method:"post",data:e})}function c(e){return Object(i["default"])({url:"/lab/maintain-delete",method:"post",data:e})}function u(e){return Object(i["default"])({url:"/base/admin-select-options",method:"get",params:e})}function f(e){return Object(i["default"])({url:"/school/room-select-options",method:"get",params:e})}function p(e){return Object(i["default"])({url:"/lab/maintain/complete",method:"post",data:e})}}}]);