1 line
7.0 KiB
JavaScript
1 line
7.0 KiB
JavaScript
webpackJsonp([274],{"aQ/v":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("BO1k"),o=a.n(i),r=a("XLwt"),l=a.n(r),s=(a("TIfe"),a("GKmE")),n={data:function(){return{fullscreenLoading:!1,search_time:"",deptId:"",depOptions:[],selectDeptId:[],search_data_device:"",search_data:{pageno:1,pagesize:999999},tableData:[],loading:!1,deviceLoading:!1,pageSizes:[10,20,50],deviceList:[],deviceListAll:[],realtime_data:{name:"",deviceId:""},point_total:"",pointId:"",deviceInfo:{},id:"",websoketData:[]}},mounted:function(){this.search_data.deviceId=this.$route.query.id,this.getList()},created:function(){},methods:{changeTableSort: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(),this.setCharts()},setDeptList:function(e){var t=!0,a=!1,i=void 0;try{for(var r,l=o()(e);!(t=(r=l.next()).done);t=!0){var s=r.value;s.hasChildren?this.setDeptList(s.children):s.children=void 0}}catch(e){a=!0,i=e}finally{try{!t&&l.return&&l.return()}finally{if(a)throw i}}},getList:function(){var e=this;this.deviceLoading=!0,this.search_time?(this.search_data.startTimes=this.search_time[0],this.search_data.endTimes=this.search_time[1]):(this.search_data.startTimes="",this.search_data.endTimes=""),this.$api.dispatchWorkAPI.detailOfDispatch(this.search_data).then(function(t){e.deviceLoading=!1,t.data?(e.total=t.data.totalRows,e.tableData=t.data.datas?t.data.datas:[]):(e.total=0,e.tableData=[]),e.setCharts()}).catch(function(t){e.deviceLoading=!1})},setCharts:function(){var e=[],t=[],a=[];this.tableData.forEach(function(i){e.unshift(i.code),t.unshift(i.startTime.split(" ")[0]);var o=Object(s.f)(Object(s.a)(i.endTime)+864e5);a.unshift(o.split(" ")[0])});var i=l.a.init(document.getElementById("charts_container")),o={backgroundColor:"#fff",title:{text:"任务甘特图",padding:20,textStyle:{fontSize:17,fontWeight:"bolder",color:"#333"},subtextStyle:{fontSize:13,fontWeight:"bolder"}},grid:{containLabel:!0,show:!1,right:130,left:40,bottom:40,top:90},xAxis:{type:"time",axisLabel:{show:!0,interval:0}},yAxis:{axisLabel:{show:!0,interval:0,formatter:function(e,t){return e}},data:e},tooltip:{trigger:"axis",formatter:function(e){var t="",a="",i="";for(var o in e){var r=o%2;r||(a=e[o].data,i=Object(s.f)(Object(s.a)(a)-864e5).split(" ")[0]),r&&(t+=e[o].data+"~"+i+"</br>")}return t}},series:[{name:"计划结束时间",type:"bar",stack:"总量",itemStyle:{normal:{color:"rgb(124, 181, 236)",borderColor:"#fff",borderWidth:2}},zlevel:-1,z:2,data:a},{name:"计划开始时间",type:"bar",stack:"总量",itemStyle:{normal:{color:"white"}},zlevel:-1,z:3,data:t}]};i.setOption(o,!0)},getDeviceList:function(){var e=this;this.deviceLoading=!0,this.$api.deviceAPI.advancedQuery({pageno:1,pagesize:99999,deptId:this.deptId,deviceId:""}).then(function(t){e.deviceLoading=!1,t.data?e.deviceList=t.data.datas?t.data.datas:[]:e.deviceList=[];for(var a=[],i=0;i<e.deviceList.length;i++)-1==a.indexOf(e.deviceList[i].type_mes)&&a.push(e.deviceList[i].type_mes);var o=[];a.forEach(function(e){var t={type_mes:e,value:[]};o.push(t)});for(var r=0;r<o.length;r++)for(var l=0;l<e.deviceList.length;l++)o[r].type_mes==e.deviceList[l].type_mes&&o[r].value.push(e.deviceList[l]);e.deviceListAll=o}).catch(function(t){e.deviceLoading=!1})},getSummaries:function(e){var t=e.columns,a=e.data,i=[];return t.forEach(function(e,t){if(0!==t)if(11==t||12==t){var o=a.map(function(t){return Number(t[e.property])});o.every(function(e){return isNaN(e)})?i[t]="":i[t]=o.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0)}else i[t]="";else i[t]="合计"}),i}},watch:{}},c={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box knowledge-box",staticStyle:{padding:"0"}},[a("el-container",[a("el-container",{staticStyle:{padding:"10px"}},[a("el-header",{staticStyle:{width:"100%","background-color":"#fff",height:"45px","line-height":"45px","border-bottom":"1px solid #ececec"}},[a("div",{staticClass:"header"},[a("div",{staticClass:"header_item",staticStyle:{"font-size":"14px"}},[e._v("时间")]),e._v(" "),a("div",{staticClass:"header_item",staticStyle:{"font-size":"14px"}},[a("el-date-picker",{attrs:{type:"daterange",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd","range-separator":"至","start-placeholder":"计划开工时间","end-placeholder":"计划完工时间"},model:{value:e.search_time,callback:function(t){e.search_time=t},expression:"search_time"}})],1),e._v(" "),a("div",{staticClass:"header_item"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.getList()}}},[e._v("查询")])],1)])]),e._v(" "),a("el-row",[a("el-tabs",{staticStyle:{width:"100%"}},[a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.deviceLoading,expression:"deviceLoading"}],ref:"pointtb",attrs:{id:"out-table",border:"",data:e.tableData,"show-summary":"","summary-method":e.getSummaries,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"sort-change":e.changeTableSort}},[a("el-table-column",{attrs:{prop:"deviceName","show-overflow-tooltip":"",align:"center",label:"生产设备"}}),e._v(" "),a("el-table-column",{attrs:{prop:"processName","show-overflow-tooltip":"",align:"center",label:"工序名"}}),e._v(" "),a("el-table-column",{attrs:{prop:"code",width:"140","show-overflow-tooltip":"",align:"center",label:"派工单号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"createName","show-overflow-tooltip":"",align:"center",label:"派单人"}}),e._v(" "),a("el-table-column",{attrs:{prop:"createTime",width:"100","show-overflow-tooltip":"",align:"center",label:"派单时间"}}),e._v(" "),a("el-table-column",{attrs:{prop:"operatorName","show-overflow-tooltip":"",align:"center",label:"操作工"}}),e._v(" "),a("el-table-column",{attrs:{prop:"serialNo","show-overflow-tooltip":"",align:"center",label:"产品代码"}}),e._v(" "),a("el-table-column",{attrs:{prop:"materielName","show-overflow-tooltip":"",align:"center",label:"产品名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"specification","show-overflow-tooltip":"",align:"center",label:"规格型号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"startTime",width:"120","show-overflow-tooltip":"",sortable:"custom",align:"center",label:"计划开工时间"}}),e._v(" "),a("el-table-column",{attrs:{prop:"endTime",width:"100","show-overflow-tooltip":"",align:"center",label:"计划完工时间"}}),e._v(" "),a("el-table-column",{attrs:{prop:"planCount","show-overflow-tooltip":"",align:"center",label:"派工数量"}}),e._v(" "),a("el-table-column",{attrs:{prop:"completionCount","show-overflow-tooltip":"",align:"center",label:"完工数量"}})],1),e._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading.lock",value:e.fullscreenLoading,expression:"fullscreenLoading",modifiers:{lock:!0}}],attrs:{id:"charts_container"}})],1)])],1)],1)],1)],1)},staticRenderFns:[]};var d=a("VU/8")(n,c,!1,function(e){a("zmt5")},"data-v-ded561cc",null);t.default=d.exports},zmt5:function(e,t){}}); |