1 line
9.6 KiB
JavaScript
1 line
9.6 KiB
JavaScript
|
webpackJsonp([452],{"6Mjx":function(e,t){},b61S:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("d7EF"),n=a.n(s),i=a("//Fk"),l=a.n(i),o=a("Xxa5"),r=a.n(o),c=a("exGp"),h=a.n(c),d=a("bOdI"),p=a.n(d),g=a("GKmE"),u="/apis/mdh/hcljy/pageList",m="/apis/mdh/hcljy/del",f="/apis/mdh/hcljy/edit",b={name:"hcljy",components:{},data:function(){var e;return e={qyList:[],total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},planTime:"",statusList:[],getUserList:[],btnDelDisabled:!0,btnOtherDisabled:!0,chooseUserVisible:!1,chooseSbjhVisible:!1,rowIds:[],tableData:[],dialogVisible:!1,pictLoading:!1},p()(e,"qyList",[]),p()(e,"jllxList",[]),p()(e,"dywzList",[]),e},created:function(){var e=this;document.onkeydown=function(t){"Enter"===t.key&&e.search()}},mounted:function(){this.getList()},methods:{reback:function(){var e=this;return h()(r.a.mark(function t(){var a,s;return r.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e.rowIds.length>0)){t.next=15;break}if(a=e.rowIds[0],!(3==a.zt)){t.next=11;break}return s={id:a.id,zt:2,zczt:0},t.next=7,e.$api.yxkAPI.yxkPost(f,s);case 7:0==t.sent.code&&(e.$message({message:"撤回成功",type:"success"}),e.getList()),t.next=13;break;case 11:return e.$message({message:"非已提交状态不能撤回",type:"warning"}),t.abrupt("return",!1);case 13:t.next=17;break;case 15:return e.$message({message:"请选择一条数据",type:"warning"}),t.abrupt("return",!1);case 17:case"end":return t.stop()}},t,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)},initData:function(){var e=this;l.a.all([this.$api.dictAPI.getDictsByType("qy"),this.$api.dictAPI.getDictsByType("jllx"),this.$api.dictAPI.getDictsByType("dywz")]).then(function(t){var a=n()(t,3),s=a[0],i=a[1],l=a[2];0===s.code&&(e.qyList=s.datas),0==i.code&&(e.jllxList=i.datas),0==l.code&&(e.dywzList=l.datas)}).catch(function(e){console.log(e)})},getList:function(){var e=this;this.pictLoading=!0,this.planTime?(this.search_data.startTime=Object(g.b)(this.planTime[0]),this.search_data.endTime=Object(g.b)(this.planTime[1])):(this.search_data.startTime=null,this.search_data.endTime=null),this.$api.yxkAPI.yxkPost(u,this.search_data).then(function(t){if(e.pictLoading=!1,t.data){e.total=t.data.total;var a=t.data.records;e.tableData=a}else 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:"/zlgl/hcljy-add",query:{t:Date.now()}})},viewDetail:function(e){e.zt,this.$router.push({path:"/zlgl/hcljy-add",query:{id:e.id,t:Date.now()}})},execution:function(){},remove:function(){var e=this,t=[];this.rowIds.forEach(function(e){t.push(e.id)}),this.$confirm("确认删除选中的数据吗?","提示",{type:"warning"}).then(function(){e.$api.yxkAPI.yxkPost(m,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"})})})},startUsing:function(){var e=this,t=[];this.rowIds.forEach(function(e){t.push(e.id)}),this.$confirm("确认启用选中的保养计划吗?","提示",{type:"warning"}).then(function(){e.$api.upkeepPlanAPI.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:
|