1 line
9.9 KiB
JavaScript
1 line
9.9 KiB
JavaScript
|
webpackJsonp([350],{"1T22":function(e,t){},"706c":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("d7EF"),n=a.n(s),i=a("//Fk"),r=a.n(i),o=a("GKmE"),l=a("ysqt"),c=a("3MlD"),d={name:"mesInspection_plan",components:{btnInput:l.a,dialogChooseSingleUser:c.a},data:function(){return{total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},planTime:"",statusList:[],getUserList:[],btnDelDisabled:!0,btnOtherDisabled:!0,chooseUserVisible:!1,rowIds:[],tableData:[],dialogVisible:!1,pictLoading:!1}},created:function(){var e=this;document.onkeydown=function(t){"Enter"===t.key&&e.search()}},mounted:function(){this.getList(),this.initData()},methods:{createRecord:function(e){var t=this,a=this.rowIds[0].id;this.$api.mesPatroPlanAPI.createRecordList(a).then(function(e){0===e.code?t.$message({message:e.msg,type:"success"}):t.$message({message:e.msg,type:"error"})}).catch(function(e){})},getUser:function(e){e?(this.$set(this.search_data,"engineerName",e.name),this.$set(this.search_data,"engineerId",e.id)):(this.$set(this.search_data,"engineerName",""),this.$set(this.search_data,"engineerId",""))},sortChange:function(e){var t={column:e.column,prop:e.prop,order:e.order},a="ascending"==t.order?"asc":"desc";this.$set(this.search_data,"sort",t.prop),this.$set(this.search_data,"order",a),this.getList()},clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},startUsing:function(){var e=this,t=[];this.rowIds.forEach(function(e){t.push(e.id)}),this.$confirm("确认启用选中的巡检计划吗?","提示",{type:"warning"}).then(function(){e.$api.mesPatroPlanAPI.startUsing({ids:t}).then(function(t){console.log(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"})})})},forbidden:function(){var e=this,t=[];this.rowIds.forEach(function(e){t.push(e.id)}),this.$confirm("确认禁用选中的巡检计划吗?","提示",{type:"warning"}).then(function(){e.$api.mesPatroPlanAPI.forbidden({ids:t}).then(function(t){console.log(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"})})})},initData:function(){var e=this;r.a.all([this.$api.commonAPI.getUsers(),this.$api.dictAPI.getDictsByType("plan_status")]).then(function(t){var a=n()(t,2),s=a[0],i=a[1];0===s.code&&(e.getUserList=s.datas),0===i.code&&(e.statusList=i.datas)}).catch(function(e){console.log(e)})},getList:function(){var e=this;this.planTime?(this.search_data.startTime=Object(o.b)(this.planTime[0]),this.search_data.endTime=Object(o.b)(this.planTime[1])):(this.search_data.startTime="",this.search_data.endTime=""),this.pictLoading=!0,this.$api.mesPatroPlanAPI.planList(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()},add:function(){this.$router.push({path:"/mesInspection/plan_add",query:{t:Date.now()}})},viewDetail:function(e){146===e.statusId?this.$router.push({path:"/mesInspection/plan_add",query:{id:e.id,t:Date.now()}}):this.$router.push({path:"/mesInspection/plan_detail",query:{id:e.id,t:Date.now()}})},importPlan:function(){},exportPlan:function(){},openDetails:function(e){this.$router.push({path:"/mesInspection/detail",query:{id:e.id,t:Date.now()}})},remove:function(){var e=this,t=[];this.rowIds.forEach(function(e){t.push(e.id)});var a={ids:t};this.$confirm("确认删除选中的巡检计划吗?","提示",{type:"warning"}).then(function(){e.$api.mesPatroPlanAPI.batcnRemovePlan(a).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getList()):e.$message
|