chunk-11bad47a.8a22f982.js 7.86 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-11bad47a"],{"3f0f":function(t,e,a){"use strict";a("6a15")},6895:function(t,e,a){},"6a15":function(t,e,a){},ad9e:function(t,e,a){"use strict";a("6895")},c73a:function(t,e,a){"use strict";a.r(e);var l=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"whole",on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.btnAction("query")}}},[a("sys-head",{attrs:{title:t.sysTitle}}),a("div",{staticClass:"time-select"},[a("bus-project-eq",{attrs:{defaultSelectIndexProject:1,AGVSelectIndexEq:!0,isAGV:!0},on:{selectCallBackEmit:t.projectEqCallBackEmit}}),a("sys-select",{ref:"childSelectFault",attrs:{title:"请选择故障信息"},on:{selectCallBackEmit:t.faultCallBackEmit}}),a("el-col",{attrs:{span:56}},[a("el-date-picker",{staticStyle:{width:"210px"},attrs:{required:"","data-msg":"开始日期时间不能为空",type:"date",placeholder:"选择开始日期时间","value-format":"yyyy-MM-dd"},model:{value:t.form.startTime,callback:function(e){t.$set(t.form,"startTime",e)},expression:"form.startTime"}}),a("el-date-picker",{staticStyle:{width:"210px"},attrs:{required:"",type:"date",placeholder:"选择结束日期时间","value-format":"yyyy-MM-dd"},model:{value:t.form.endTime,callback:function(e){t.$set(t.form,"endTime",e)},expression:"form.endTime"}})],1),a("el-button",{staticStyle:{margin:"0.2vw"},attrs:{icon:"el-icon-search"},on:{click:function(e){return t.btnAction("query")}}},[t._v("搜索")]),a("el-button",{staticStyle:{margin:"0.2vw"},on:{click:function(e){return t.btnAction("excel")}}},[t._v("Excel")]),a("sys-export",{ref:"childExport",attrs:{fileName:t.sysTitle}})],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"tableList",staticStyle:{width:"100%",height:"50px","margin-top":"8px",color:"#000"},attrs:{data:t.sysData.tableData,"cell-style":t.handleChangeCellStyle,height:"360",stripe:"",border:"","element-loading-text":"拼命加载中","element-loading-spinner":"el-icon-loading","header-cell-style":{textAlign:"center",background:"#e4e4e4",color:"#000000"}}},[a("el-table-column",{attrs:{prop:"year",fixed:"",label:"二维码点位",width:"250",align:"center"}},[a("el-table-column",{attrs:{prop:"year",label:"AGV设备",align:"center",width:"250"}})],1),t._l(t.sysData.tableDataColumn,(function(t){return a("el-table-column",{key:t.prop,style:t.style,attrs:{align:"center",fixed:t.fixed,prop:t.prop,label:t.label,width:t.width}})}))],2),t._m(0)],1)},n=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"imgs"},[a("h1",{staticClass:"imgs-test"},[t._v("后期放置AGV点位图片区域")])])}],i={data:function(){return{baseUrl:window.baseOnLineOrOff?window.appConfig.baseUlrOnLine:"http://127.0.0.1:10099",sysTitle:"AGV故障分析表(点位) ver:"+window.appConfig.appId,sysData:{tableData:[],tableDataColumn:[]},form:{startTime:new Date((new Date).setDate(new Date(1).getDate())).format("yyyy-MM-dd"),endTime:(new Date).format("yyyy-MM-dd")},column:{table:window.faultAnalysis},dayBetween:[],loading:!1,params:{nowSelectProjectVal:"",nowSelectEqVal:"",nowSelectFault:"",isFristSelectDate:!1},yearMonthDayFlag:null,maxVal:null,minValRate:null,totalData:"",temp:"",imge:"SB",tableTemp:[]}},methods:{projectEqCallBackEmit:function(t){var e=this;this.params.nowSelectFault="",this.$refs.childSelectFault.value={value:"",label:""},this.params.nowSelectProjectVal=t.nowSelectProject["selectKey"],this.params.nowSelectEqVal=t.nowSelectEq["selectKey"],this.initFaultSelect(),this.params.isFristSelectDate||""!=this.params.nowSelectProjectVal&&(this.params.isFristSelectDate=!0,setTimeout((function(){e.getData("query")}),500))},faultCallBackEmit:function(t){this.params.nowSelectFault=t.selectKey},initFaultSelect:function(){var t={urlSuffix:"".concat(this.baseUrl,"/api/BulletinBoard/GetAGVAlarmList?projectCode=").concat(this.params.nowSelectProjectVal,"&&equipmentCode=").concat(this.params.nowSelectEqVal),logTitle:"读取故障下拉框数据",isUrlALL:!0,keylabel:"value",keyValue:"key",selectDefaultIndex:this.defaultSelectIndexProject};this.$refs.childSelectFault.initData(t)},btnAction:function(t){this.getData(t)},getData:function(t){var e=this;if(""!=this.params.nowSelectProjectVal)if(null!=this.form.startTime&&null!=this.form.endTime)if(new Date(this.form.startTime)>=new Date(this.form.endTime))this.$alert("开始时间不能大于等于结束时间","提示",{dangerouslyUseHTMLString:!0});else{var a={urlSuffix:"".concat(this.baseUrl,"/api/BulletinBoard/GetAGVCodePointAlarmRecord?startTime=").concat(this.form.startTime,"&endTime=").concat(this.form.endTime,"&projectCode=").concat(this.params.nowSelectProjectVal,"&equipmentCode=").concat(this.params.nowSelectEqVal,"&alarmMsg=").concat(this.params.nowSelectFault),logTitle:"表格数据",isUrlALL:!0,isLoad:!0,falg:t},l=function(l){if(e.loading=!1,e.ajaxSuccessDataBefore(l,a.logTitle))if("excel"!=t){var n=l.data.data.result.filter((function(t){return!l.data.data.codepoints.some((function(e){return e.BarCode===t.CodePoint}))}));n.forEach((function(t){console.log("设备:",t.EquipmentName,"   点位:",t.CodePoint,"   次数:",t.count)})),e.initTableColumn(l.data.data.codepoints),e.initTableData(l.data.data.result)}else e.exportExcel(l.data.data.result)};this.loading=!0,"".ajax(this,a,l)}else this.$alert("请选择开始时间-结束时间","提示",{dangerouslyUseHTMLString:!0});else this.$alert("项目号不能为空,请选择项目号","提示",{dangerouslyUseHTMLString:!0})},initTableColumn:function(t){var e=this;this.sysData.tableDataColumn=[],this.dayBetween=[];var a=0;t.forEach((function(t){e.dayBetween.push(t.BarCode),e.sysData.tableDataColumn.push({prop:"data"+a++,label:t.BarCode.toString(),width:105})})),this.sysData.tableDataColumn.push({prop:"Subtotal",label:"小计",width:110})},initTableData:function(t){var e=this,a=this.initTableDataHandle(t);this.sysData.tableData=a,setTimeout((function(){e.$nextTick((function(){e.$refs.tableList.doLayout()}))}),500)},initTableDataHandle:function(t){for(var e=this,a=[],l=t.uniqueFunc("EquipmentName"),n=0,i=!1,o=0,s=function(s){c={year:l[s].EquipmentName},n=0;var r=null;e.dayBetween.forEach((function(e){for(var a=0;a<t.length;a++)if(l[s].EquipmentName==t[a].EquipmentName&&t[a].CodePoint==e){i=!0,o=t[a].count,r+=t[a].count;break}i?(c["data"+n++]=o,c["Subtotal"]=r,i=!1):(c["data"+n++]="0",c["Subtotal"]=r)})),void 0==c.Subtotal&&(c["Subtotal"]="0"),a.push(c)},r=0;r<l.length;r++){var c;s(r)}for(var u=Object.keys(a[0]),d={},h=0;h<a.length;h++)for(var m=0;m<u.length;m++){var f=u[m];"year"!==f&&(d[f]||(d[f]=0),d[f]+=parseInt(a[h][f]))}var p={year:"合计"};for(var y in d)p[y]=d[y].toString();return a.push(p),this.tableTemp=a,a},handleChangeCellStyle:function(t){var e=t.row,a=t.column,l=t.rowIndex,n=t.columnIndex,i=parseInt(e[a.property]);return NaN!=i&&i>1&&n==this.sysData.tableDataColumn.length&&l!=this.sysData.tableData.length-1?"backgroundColor: rgb(0 176 240);":n==this.sysData.tableDataColumn.length&&l==this.sysData.tableData.length-1?"backgroundColor: yellow;":NaN!=i&&i>0&&n>0&&n!=this.sysData.tableDataColumn.length&&l!=this.sysData.tableData.length-1?"backgroundColor: rgb(216 228 188);":void 0},exportExcel:function(t){var e={year:"AGV设备"};this.sysData.tableDataColumn.forEach((function(t,a){"Subtotal"!=t.prop?e["data"+a++]=t.label:e["Subtotal"]="小计"}));var a=this.initTableDataHandle(t);a.unshift(e),this.$refs.childExport.exportExcel(a,!1)},ajaxSuccessDataBefore:function(t){return null!=t.data.data.result&&0!=t.data.data.result.length||(this.sysData.tableData=[],this.$alert("业务操作查询无数据!","提示",{dangerouslyUseHTMLString:!0}),null!=this.eleEchartObj&&this.eleEchartObj.clear(),!1)}},mounted:function(){this.initFaultSelect()}},o=i,s=(a("ad9e"),a("3f0f"),a("2877")),r=Object(s["a"])(o,l,n,!1,null,"d77fb426",null);e["default"]=r.exports}}]);
//# sourceMappingURL=chunk-11bad47a.8a22f982.js.map