1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
webpackJsonp([190],{"6rNV":function(e,t){},aXuM:function(e,t){},iqHr:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("d7EF"),i=a.n(s),r=a("//Fk"),o=a.n(r),l=a("GKmE"),n={components:{DialogChooseSingleUser:a("3MlD").a},name:"repair_record_list",data:function(){return{advanceQueryDialogVisible:!1,formData:{},total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10,startTime:"",endTime:"",time:"",status:"",heldPerson:"",createBy:"",title:""},repairTime:"",getUserList:[],btnDelDisabled:!0,btnOtherDisabled:!0,rowIds:[],tableData:[],dialogVisible:!1,pictLoading:!1,chooseUserVisible:!1,hitchList:[],deviceStatusList:[],offHourTotal:0,costTotal:0,manHourTotal:0,manHourCostTotal:0,sparePartsCostTotal:0,resultList:[]}},created:function(){var e=this;document.onkeydown=function(t){"Enter"===t.key&&e.search()}},mounted:function(){this.getList(),this.initData(),this.initResultList()},methods:{moreSearch:function(){this.advanceQueryDialogVisible=!0},initResultList:function(){var e=this;this.$api.dictAPI.getDictsByType("acceptance_result").then(function(t){0===t.code&&(e.resultList=t.datas)})},save:function(){for(var e in this.formData)this.search_data[e]=this.formData[e];this.search_data.pageno=1,this.$nextTick(function(){this.advanceQueryDialogVisible=!1,this.getList()})},clear:function(){for(var e in this.formData)this.formData[e]="";this.$forceUpdate()},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;o.a.all([this.$api.commonAPI.getUsers(),this.$api.dictAPI.getDictsByType("device_malfunction"),this.$api.dictAPI.getDictsByType("device_status")]).then(function(t){var a=i()(t,5),s=a[0],r=a[1],o=a[2];a[3],a[4];0===s.code&&(e.getUserList=s.datas),0===r.code&&(e.hitchList=r.datas),0===o.code&&(e.deviceStatusList=o.datas)}).catch(function(e){console.log(e)})},getSummaries:function(e){var t=[];return t[1]="总计",t[11]=""+this.manHourCostTotal,t[10]=""+this.manHourTotal,t[5]=""+this.offHourTotal,t[12]=""+this.sparePartsCostTotal,t[13]=""+this.costTotal,t},getList:function(){var e=this;this.repairTime?(this.search_data.startTime=Object(l.b)(this.repairTime[0]),this.search_data.endTime=Object(l.b)(this.repairTime[1])):(this.search_data.startTime="",this.search_data.endTime=""),this.pictLoading=!0,this.$api.repairCheckAPI.deviceRepairEventList(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.offHourTotal=t.offHourTotal,e.costTotal=t.costTotal,e.manHourTotal=t.manHourTotal,e.sparePartsCostTotal=t.sparePartsCostTotal,e.manHourCostTotal=t.manHourCostTotal):(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:"/repair/record_redact",query:{s:this.$route.path,t:Date.now()}})},getUser:function(e){var t=this,a=this.rowIds[0],s=e.id,i=a.reventId;this.$confirm("确认将维修单转派给"+e.name+"吗?","提示",{type:"warning"}).then(function(){t.$api.repairCheckAPI.reventTurnToSend({eventId:i,userId:s}).then(function(e){0===e.code?(t.$message({message:e.msg,type:"success"}),t.getList()):t.$message({message:e.msg?"转派失败,请重试":e.msg,type:"error"})}).catch(function(e){t.$message({message:"转派失败,请重试",type:"error"})})})},send:function(){var e=this.rowIds[0];if(56===e.reventStatusId){e.id;this.chooseUserVisible=!0}else this.$alert("维修单已在处理进程中,您无法转派该维修单!","提示",{type:"warning"})},openDetails:function(e){146===e.statusId?this.$router.push({path:"/repair/record_redact",query:{id:e.id,eventid:e.eventId,s:this.$route.path,t:Date.now()}}):this.$router.push({path:"/repair/detail",query:{id:e.eventId,t:Date.now()}})},complete:function(){var e=this.rowIds[0];if(58!==e.reventStatusId){var t=e.reventId;this.$router.push({path:"/repair/check",query:{id:t,t:Date.now()}})}else this.$alert("维修单已完成验收,您无法再次处理该维修单!","提示",{type:"warning"})},repair:function(){var e=this.rowIds[0];if(58!==e.reventStatusId){var t=e.reventId;this.$router.push({path:"/repair/record",query:{id:t,t:Date.now()}})}else this.$alert("维修单已完成验收,您无法再次处理该维修单!","提示",{type:"warning"})},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.repairCheckAPI.batchRemoveRecord(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 repair-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"repair:record:add",expression:"'repair:record: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:"repair:record:remove",expression:"'repair:record: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",{staticClass:"form_item_search_out",attrs:{inline:""}},[a("div",{staticClass:"form_item_input_out"},[a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"36%"},attrs:{label:"报修时间"}},[a("el-date-picker",{attrs:{type:"daterange",format:"yyyy-MM-dd","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.repairTime,callback:function(t){e.repairTime=t},expression:"repairTime"}})],1),e._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"20%"},attrs:{label:"设备名称"}},[a("el-input",{attrs:{placeholder:"设备名称"},model:{value:e.search_data.deviceName,callback:function(t){e.$set(e.search_data,"deviceName",t)},expression:"search_data.deviceName"}})],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.type,callback:function(t){e.$set(e.search_data,"type",t)},expression:"search_data.type"}},e._l(e.hitchList,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("el-select",{attrs:{clearable:"",placeholder:"请选择"},model:{value:e.search_data.usage,callback:function(t){e.$set(e.search_data,"usage",t)},expression:"search_data.usage"}},e._l(e.deviceStatusList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],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),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.moreSearch()}}},[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:"",fit:"",data:e.tableData,"summary-method":e.getSummaries,"show-summary":"","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:"deviceSerialno",align:"center",label:"设备编号","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-link",{attrs:{type:"primary"},on:{click:function(a){return e.openDetails(t.row)}}},[e._v(e._s(t.row.deviceSerialno))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"deviceName",label:"设备名称",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{sortable:"custom",prop:"startTime",label:"实际开工时间",align:"center","show-overflow-tooltip":"",width:"124px"}}),e._v(" "),a("el-table-column",{attrs:{sortable:"custom",prop:"endTime",align:"center",label:"实际完工时间","show-overflow-tooltip":"",width:"124px"}}),e._v(" "),a("el-table-column",{attrs:{prop:"offHour",align:"center",label:"停机时间(小时)","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"typeName",align:"center",label:"故障类型","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"usageName",align:"center",label:"使用状况","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"cause",align:"center",label:"故障原因","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"solution",align:"center",label:"维修方案","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"manHour",align:"center",label:"维修工时(小时)","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"manHourCost",align:"center",label:"工时费(元)","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"sparePartsCost",align:"center",label:"备件费(元)","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"cost",align:"center",label:"维修费(元)","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"heldPersonName",align:"center",label:"维修人","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{sortable:"custom",width:"114",prop:"statusId",align:"center",label:"验收结果","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.statusName))])]}}])})],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("el-dialog",{attrs:{title:"高级查询",center:"",visible:e.advanceQueryDialogVisible,width:"670px"},on:{"update:visible":function(t){e.advanceQueryDialogVisible=t}}},[a("el-form",{ref:"form",staticClass:"dialog-form",staticStyle:{width:"620px"},attrs:{inline:!0,"label-width":"80px"}},[a("div",{staticClass:"dialog-line"},[a("el-form-item",{staticClass:"dialog-form-inline-single",attrs:{label:"设备编号"}},[a("el-input",{attrs:{placeholder:"请输入设备编号"},model:{value:e.formData.deviceSerialno,callback:function(t){e.$set(e.formData,"deviceSerialno",t)},expression:"formData.deviceSerialno"}})],1)],1),e._v(" "),a("div",{staticClass:"dialog-line"},[a("el-form-item",{staticClass:"dialog-form-inline-single",attrs:{label:"维修人"}},[a("el-input",{attrs:{placeholder:"请输入设备编号"},model:{value:e.formData.heldPersonName,callback:function(t){e.$set(e.formData,"heldPersonName",t)},expression:"formData.heldPersonName"}})],1)],1),e._v(" "),a("div",{staticClass:"dialog-line"},[a("el-form-item",{staticClass:"dialog-form-inline-single",attrs:{label:"验收结果"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:e.formData.statusId,callback:function(t){e.$set(e.formData,"statusId",t)},expression:"formData.statusId"}},e._l(e.resultList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1)]),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("确定")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.advanceQueryDialogVisible=!1}}},[e._v("关闭")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.clear}},[e._v("清空")])],1)],1),e._v(" "),a("DialogChooseSingleUser",{attrs:{visible:e.chooseUserVisible},on:{"update:visible":function(t){e.chooseUserVisible=t},change:e.getUser}})],1)},staticRenderFns:[]};var d=a("VU/8")(n,c,!1,function(e){a("aXuM"),a("6rNV")},"data-v-6650efdd",null);t.default=d.exports}}); |