1 line
4.6 KiB
JavaScript
1 line
4.6 KiB
JavaScript
webpackJsonp([446],{ASZP:function(e,t){},rzSC:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("d7EF"),s=a.n(n),i=a("//Fk"),o=a.n(i),r=(a("GKmE"),{name:"mesInspection_standard",data:function(){return{total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},typeList:[],btnDelDisabled:!0,btnOtherDisabled:!0,rowIds:[],tableData:[],dialogVisible:!1,pictLoading:!1}},created:function(){var e=this;document.onkeydown=function(t){"Enter"===t.key&&e.search()}},mounted:function(){this.getList()},methods:{clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},initData:function(){var e=this;o.a.all([this.$api.dictAPI.getDictsByType("device_type")]).then(function(t){var a=s()(t,1)[0];0===a.code&&(e.typeList=a.datas)}).catch(function(e){console.log(e)})},getList:function(){var e=this;this.pictLoading=!0,this.$api.mesPatroPlanAPI.list(this.search_data).then(function(t){e.pictLoading=!1,t.data?(e.total=t.data.totalRows,e.tableData=t.data.datas?t.data.datas:[]):(e.total=0,e.tableData=[])}).catch(function(e){console.log(e)})},search:function(){this.search_data.pageno=1,this.getList()},handleCurrentChange:function(e){this.search_data.pageno=e,this.getList()},handleSizeChange:function(e){this.search_data.pagesize=e,this.getList()},viewDetail:function(e){this.$router.push({path:"/mesInspection/standard_add",query:{id:e.id,t:Date.now()}})},add:function(){this.$router.push({path:"/mesInspection/standard_add",query:{t:Date.now()}})},remove:function(){var e=this,t=[];this.rowIds.forEach(function(e){t.push(e.id)});var a={projectIds:t};this.$confirm("确认删除选中的巡检标准吗?","提示",{type:"warning"}).then(function(){e.$api.mesPatroPlanAPI.batchRemoveProject(a).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getList()):e.$message({message:t.msg?t.msg:"删除失败,请重试",type:"error"})}).catch(function(t){e.$message({message:"删除失败,请重试",type:"error"})})})},handleSelectionChange:function(e){this.rowIds=e,this.setBtn(e)},setBtn:function(e){var t=!0,a=!0;e.length>0?(a=!1,1==e.length&&(t=!1)):(t=!0,a=!0),this.btnDelDisabled=a,this.btnOtherDisabled=t}}}),c={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box knowledge-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"mesInspection:standard:add",expression:"'mesInspection:standard:add'"}],attrs:{type:"primary"},on:{click:function(t){return e.add()}}},[e._v("新增")]),e._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"mesInspection:standard:remove",expression:"'mesInspection:standard:remove'"}],attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.remove()}}},[e._v("删除")])],1),e._v(" "),a("div",{staticClass:"sys-search"},[a("el-form",{attrs:{inline:""}},[a("el-form-item",{attrs:{label:"巡检项目"}},[a("el-input",{attrs:{placeholder:"请输入巡检项目"},model:{value:e.search_data.fuzzySearch,callback:function(t){e.$set(e.search_data,"fuzzySearch",t)},expression:"search_data.fuzzySearch"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.search()}}},[e._v("查询")])],1)],1)],1),e._v(" "),a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],ref:"tb",attrs:{border:"",data:e.tableData,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"row-click":e.clickRow,"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"code",label:"编号",align:"center",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-link",{attrs:{type:"primary"},on:{click:function(a){return e.viewDetail(t.row)}}},[e._v(e._s(t.row.code))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"name",align:"center",label:"巡检项目","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"function",align:"center",label:"巡检标准","show-overflow-tooltip":""}})],1)],1),e._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":e.search_data.pageno,"page-sizes":e.pageSizes,"page-size":e.search_data.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)])},staticRenderFns:[]};var l=a("VU/8")(r,c,!1,function(e){a("ASZP")},"data-v-1e49c662",null);t.default=l.exports}}); |