yxk_pc_mdh/gyhl/static/js/350.bfeaeb920c3cf1374e76.js

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({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}}},h={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:plan:add",expression:"'mesInspection:plan: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:plan:remove",expression:"'mesInspection:plan:remove'"}],attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.remove()}}},[e._v("删除")]),e._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"mesInspection:plan:record",expression:"'mesInspection:plan:record'"}],attrs:{type:"primary",disabled:e.btnOtherDisabled},on:{click:function(t){return e.createRecord()}}},[e._v("下达")]),e._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"mesInspection:plan:startUsing",expression:"'mesInspection:plan:startUsing'"}],attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.startUsing()}}},[e._v("启用")]),e._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"mesInspection:plan:forbidden",expression:"'mesInspection:plan:forbidden'"}],attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.forbidden()}}},[e._v("禁用")])],1),e._v(" "),a("div",{staticClass:"sys-search"},[a("el-form",{staticClass:"form_item_search_out",attrs:{inline:""}},[a("div",{staticClass:"form_item_input_out"},[a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"22%"},attrs:{label:"计划名称"}},[a("el-input",{attrs:{placeholder:"计划名称"},model:{value:e.search_data.planName,callback:function(t){e.$set(e.search_data,"planName",t)},expression:"search_data.planName"}})],1),e._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"22%"},attrs:{label:"任务状态"}},[a("el-select",{attrs:{clearable:"",placeholder:"任务状态"},model:{value:e.search_data.status,callback:function(t){e.$set(e.search_data,"status",t)},expression:"search_data.status"}},e._l(e.statusList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"22%"},attrs:{label:"巡检人"}},[a("btn-input",{attrs:{valueText:e.search_data.engineerName,valueId:e.search_data.engineerId,chooseVisible:e.chooseUserVisible},on:{"update:valueText":function(t){return e.$set(e.search_data,"engineerName",t)},"update:value-text":function(t){return e.$set(e.search_data,"engineerName",t)},"update:valueId":function(t){return e.$set(e.search_data,"engineerId",t)},"update:value-id":function(t){return e.$set(e.search_data,"engineerId",t)},"update:chooseVisible":function(t){e.chooseUserVisible=t},"update:choose-visible":function(t){e.chooseUserVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"34%"},attrs:{label:"计划时间"}},[a("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.planTime,callback:function(t){e.planTime=t},expression:"planTime"}})],1)],1),e._v(" "),a("div",{staticClass:"form_item_btn_out"},[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:{"sort-change":e.sortChange,"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:"workOrderNo",align:"center",label:"计划单号"},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.workOrderNo))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"planName",label:"计划名称",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{sortable:"custom",width:"110",prop:"statusId",align:"center",label:"任务状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.statusName))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"deptName",align:"center",label:"巡检部门"}}),e._v(" "),a("el-table-column",{attrs:{prop:"userName",align:"center",label:"巡检人"}}),e._v(" "),a("el-table-column",{attrs:{sortable:"custom",prop:"startTime",align:"center",label:"计划开始时间",width:"124","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{sortable:"custom",prop:"endTime",align:"center",label:"计划完成时间",width:"124","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),e._v(" "),a("dialogChooseSingleUser",{attrs:{visible:e.chooseUserVisible},on:{"update:visible":function(t){e.chooseUserVisible=t},change:e.getUser}})],1)},staticRenderFns:[]};var u=a("VU/8")(d,h,!1,function(e){a("1T22")},"data-v-69624b1a",null);t.default=u.exports}});