yxk_pc_mdh/gyhl/static/js/285.6085eaa6606d7e38be09.js

1 line
10 KiB
JavaScript
Raw Normal View History

2025-08-28 15:26:35 +08:00
webpackJsonp([285],{XXkW:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("d7EF"),i=a.n(s),n=a("//Fk"),r=a.n(n),o=a("GKmE"),c=a("ysqt"),l=a("3MlD"),d="/apis/mdh/scrw/pageList",h="/apis/mdh/scrw/del",u={name:"scrw",components:{btnInput:c.a,dialogChooseSingleUser:l.a},data:function(){return{total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},planTime:"",statusList:[{name:"未开始",id:1},{name:"生产中",id:2},{name:"已完成",id:3}],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:{handleStep:function(e){var t=["1"==e.sbzt,"1"==e.hclzt,"1"==e.fqzt];return t.includes(!1)?t.findIndex(function(e){return 0==e}):t.length},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;r.a.all([this.$api.commonAPI.getUsers(),this.$api.dictAPI.getDictsByType("plan_status")]).then(function(t){var a=i()(t,2),s=a[0];a[1];0===s.code&&(e.getUserList=s.datas)}).catch(function(e){console.log(e)})},getList:function(){var e=this;this.planTime?(this.search_data.ksrq=Object(o.f)(this.planTime[0]),this.search_data.jsrq=Object(o.f)(this.planTime[1])):(this.search_data.ksrq=null,this.search_data.jsrq=null),this.pictLoading=!0,this.$api.yxkAPI.yxkPost(d,this.search_data).then(function(t){e.pictLoading=!1,t.data?(e.total=t.data.total,e.tableData=t.data.records?t.data.records:[]):(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:"/basic/scrw-add",query:{t:Date.now()}})},viewDetail:function(e){146===e.status?this.$router.push({path:"/basic/scrw-add",query:{id:e.id,t:Date.now()}}):this.$router.push({path:"/basic/scrw-detail",query:{id:e.id,scrwdh:e.scrwdh,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(h,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:"启用失败,请重试",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.upkeepPlanAPI.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"})})})},handleSelectionChange:function(e){this.rowIds=e,this.setBtn(e)},setBtn:function(e){var