webpackJsonp([44],{"4tei":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("CCn6"),l={name:"index",data:function(){return{searchFrom:{type:"1",teacher_id:"",staff_id:""},teacherList:[],staffList:[],tableData:[],total:0,nowPage:1,limit:10,loading:!1}},components:{page:a("kmJW").a},mounted:function(){this.getTeacherList(),this.getStaffList(),this.getData()},filters:{reasonFormat:function(t){var e="";return[{id:0,name:"人员入职"},{id:1,name:"人员离职"},{id:2,name:"请假"},{id:3,name:"其它"}].forEach(function(a){a.id==t&&(e=a.name)}),e}},methods:{getTeacherList:function(){var t=this;Object(n._113)({page:1,limit:1e3}).then(function(e){t.teacherList=e.list})},getStaffList:function(){var t=this;Object(n._99)({page:1,limit:1e3}).then(function(e){t.staffList=e.list})},getData:function(){var t=this,e={limit:this.limit,page:this.nowPage};this.searchFrom.teacher_id&&(e.teacher_id=this.searchFrom.teacher_id),this.searchFrom.staff_id&&(e.staff_id=this.searchFrom.staff_id),-1!=this.searchFrom.type&&(e.type=this.searchFrom.type),Object(n._100)(e).then(function(e){t.tableData=e.list,t.total=e.total})},onSearch:function(t,e){t&&(this.searchFrom[t+"_id"]=e),this.getData()},onPageChange:function(t){this.nowPage=t,this.getData()},onSizeChange:function(t){this.limit=t,this.nowPage=1,this.getData()}}},r={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"user"},[a("el-form",{ref:"searchFrom",attrs:{model:t.searchFrom,"label-width":"80px",inline:""}},[a("el-form-item",{attrs:{label:"设备名称"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择",clearable:"",disabled:!t.teacherList.length},on:{change:t.getData},model:{value:t.searchFrom.teacher_id,callback:function(e){t.$set(t.searchFrom,"teacher_id",e)},expression:"searchFrom.teacher_id"}},t._l(t.teacherList,function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.id}})}))],1),t._v(" "),a("el-form-item",{attrs:{label:"顾问名称"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择",clearable:"",disabled:!t.staffList.length},on:{change:t.getData},model:{value:t.searchFrom.staff_id,callback:function(e){t.$set(t.searchFrom,"staff_id",e)},expression:"searchFrom.staff_id"}},t._l(t.staffList,function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.id}})}))],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.getData}},[t._v("搜索")])],1)],1),t._v(" "),a("el-tabs",{staticStyle:{background:"white","padding-top":"10px"},attrs:{type:"card"},on:{"tab-click":t.getData},model:{value:t.searchFrom.type,callback:function(e){t.$set(t.searchFrom,"type",e)},expression:"searchFrom.type"}},[a("el-tab-pane",{attrs:{label:"全部使用记录",name:"-1"}}),t._v(" "),a("el-tab-pane",{attrs:{label:"当前使用记录",name:"1"}}),t._v(" "),a("el-tab-pane",{attrs:{label:"历史使用记录",name:"2"}})],1),t._v(" "),a("el-table",{attrs:{data:t.tableData}},[a("el-table-column",{attrs:{prop:"id",label:"ID"}}),t._v(" "),a("el-table-column",{attrs:{label:"设备名称"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"cell-link",on:{click:function(a){t.onSearch("teacher",e.row.teacher_id)}}},[t._v(t._s(e.row.teacher_name))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"staff_name",label:"当前顾问"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"cell-link",on:{click:function(a){t.onSearch("staff",e.row.staff_id)}}},[t._v(t._s(e.row.staff_name))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"移交原因"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n        "+t._s(t._f("reasonFormat")(e.row.reason))+"\n      ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"start_at",label:"设备开始使用时间"}}),t._v(" "),a("el-table-column",{attrs:{label:"设备使用结束时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n        "+t._s("0000-00-00 00:00:00"==e.row.over_at?"-":e.row.over_at)+"\n      ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"created_at",label:"创建时间"}})],1),t._v(" "),a("page",{attrs:{total:t.total,limit:t.limit},on:{pageChange:t.onPageChange,sizeChange:t.onSizeChange}})],1)},staticRenderFns:[]};var i=a("VU/8")(l,r,!1,function(t){a("SnGZ")},"data-v-d8b7c170",null);e.default=i.exports},SnGZ:function(t,e){}});