feat:能源统计
This commit is contained in:
parent
f14ee6bb95
commit
d195b260fa
|
|
@ -9,8 +9,8 @@ VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
|
||||||
#VUE_APP_WS_API = 'ws://localhost:8000'
|
#VUE_APP_WS_API = 'ws://localhost:8000'
|
||||||
# VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
|
# VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
|
||||||
#VUE_APP_API_BASEURL = http://10.99.5.79:20309/api
|
#VUE_APP_API_BASEURL = http://10.99.5.79:20309/api
|
||||||
# VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
|
VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
|
||||||
VUE_APP_API_BASEURL = http://127.0.0.1:2226/api
|
# VUE_APP_API_BASEURL = http://127.0.0.1:2226/api
|
||||||
#VUE_APP_BASEURL = http://127.0.0.1:8000
|
#VUE_APP_BASEURL = http://127.0.0.1:8000
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,5 +85,13 @@ export default {
|
||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
statCreate: {
|
||||||
|
name: "添加测点统计记录",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.post(
|
||||||
|
`${config.API_URL}/enm/mpointstat/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -99,6 +99,11 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="自动采集">
|
||||||
|
<el-switch v-model="form.is_auto"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-main>
|
</el-main>
|
||||||
|
|
@ -123,7 +128,9 @@ export default {
|
||||||
edit: "编辑",
|
edit: "编辑",
|
||||||
show: "查看",
|
show: "查看",
|
||||||
},
|
},
|
||||||
form: {},
|
form: {
|
||||||
|
is_auto:true
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
name: [{required: true, message: '请输入测点名称'}],
|
name: [{required: true, message: '请输入测点名称'}],
|
||||||
code: [{required: true, message: '请输入测点编号'}],
|
code: [{required: true, message: '请输入测点编号'}],
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
:model="form"
|
:model="form"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
:rules="rule1"
|
:rules="rules"
|
||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
|
|
@ -46,9 +46,20 @@
|
||||||
<el-input v-model="form.leader_name" placeholder="班组班长" disabled/>
|
<el-input v-model="form.leader_name" placeholder="班组班长" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="检测时间" prop="time">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.time"
|
||||||
|
type="datetime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm"
|
||||||
|
format="YYYY-MM-DD HH:mm"
|
||||||
|
placeholder="检测时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :md="12" :sm="24" class="formUnitWrap">
|
<el-col :md="12" :sm="24" class="formUnitWrap">
|
||||||
<el-form-item label="水耗统计">
|
<el-form-item label="水耗统计" prop="val">
|
||||||
<el-input-number v-model="form.note" :precision="2" controls-position="right" placeholder="水耗统计" style="width: 100%;"></el-input-number>
|
<el-input-number v-model="form.val" :precision="2" controls-position="right" placeholder="水耗统计" style="width: 100%;"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<span class="formUnit">(t)</span>
|
<span class="formUnit">(t)</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -78,10 +89,8 @@
|
||||||
type:10,
|
type:10,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
val: [{required: true, message: "请输入检测值", trigger: "blur"}],
|
||||||
number: [{required: true, message: "请输入", trigger: "blur"}],
|
time: [{required: true, message: "请选择检测时间", trigger: "blur"}]
|
||||||
keeper_name: [{required: true, message: "请输入", trigger: "blur"}],
|
|
||||||
belong_dept: [{required: true, message: "请选择", trigger: "blur"}]
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
isSaveing: false,
|
isSaveing: false,
|
||||||
|
|
@ -131,11 +140,16 @@
|
||||||
this.isSaveing = true;
|
this.isSaveing = true;
|
||||||
try {
|
try {
|
||||||
let obj={};
|
let obj={};
|
||||||
obj.note = this.form.note;
|
debugger;
|
||||||
obj.team = this.form.team;
|
obj.year_s = this.form.time.slice(0,4);
|
||||||
obj.shift = this.form.shift;
|
obj.month_s = this.form.time.slice(5,7);
|
||||||
obj.leader = this.form.leader;
|
obj.day_s = this.form.time.slice(8,10);
|
||||||
this.$API.wpm.sflog.update.req(this.form.id,obj).then(res=>{
|
obj.hour = this.form.time.slice(11,13);
|
||||||
|
obj.val = this.form.val;
|
||||||
|
obj.sflog = this.form.id;
|
||||||
|
obj.material = '3349350755361792000';
|
||||||
|
obj.mpoint = '3349214860667219968';
|
||||||
|
this.$API.enm.mpoint.statCreate.req(obj).then(res=>{
|
||||||
this.isSaveing = false;
|
this.isSaveing = false;
|
||||||
this.$emit("success", this.form, this.mode);
|
this.$emit("success", this.form, this.mode);
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,8 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.test(0)
|
// this.test(0)
|
||||||
this.getData();
|
// this.getData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
test(index){
|
test(index){
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2">电石渣</th>
|
<th colspan="2">电石渣</th>
|
||||||
<th colspan="2">原料</th>
|
<th colspan="2">原料磨</th>
|
||||||
<th rowspan="2">压缩空气(m3)</th>
|
<th rowspan="2">压缩空气(m3)</th>
|
||||||
<th colspan="4">回转窑</th>
|
<th colspan="4">回转窑</th>
|
||||||
<th colspan="2">煤磨</th>
|
<th colspan="2">煤磨</th>
|
||||||
|
|
@ -97,33 +97,32 @@
|
||||||
<th>水(t)</th>
|
<th>水(t)</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr v-for="(item,index) in tableDatas" :key="index">
|
<tr v-for="(item,index) in tableDatas3" :key="index">
|
||||||
<td style="width:50px">{{item.month}}</td>
|
<td style="width: 45px;">{{item[0]}}</td>
|
||||||
<td class="numCell">{{item.name}}</td>
|
<td class="numCell">{{item[1]}}</td>
|
||||||
<td class="numCell">{{item.number}}</td>
|
<td class="numCell">{{item[2]}}</td>
|
||||||
<td class="numCell">{{item.unit}}</td>
|
<td class="numCell">{{item[3]}}</td>
|
||||||
<td class="numCell">{{item.hours}}</td>
|
<td class="numCell">{{item[4]}}</td>
|
||||||
<td class="numCell">{{item.days}}</td>
|
<td class="numCell">{{item[5]}}</td>
|
||||||
<td class="numCell">{{item.months}}</td>
|
<td class="numCell">{{item[6]}}</td>
|
||||||
<td class="numCell">{{item.hours}}</td>
|
<td class="numCell">{{item[7]}}</td>
|
||||||
<td class="numCell">{{item.days}}</td>
|
<td class="numCell">{{item[8]}}</td>
|
||||||
<td class="numCell">{{item.months}}</td>
|
<td class="numCell">{{item[9]}}</td>
|
||||||
<td class="numCell">{{item.hours}}</td>
|
<td class="numCell">{{item[10]}}</td>
|
||||||
<td class="numCell">{{item.days}}</td>
|
<td class="numCell">{{item[11]}}</td>
|
||||||
<td class="numCell">{{item.months}}</td>
|
<td class="numCell">{{item[12]}}</td>
|
||||||
<td class="numCell">{{item.months}}</td>
|
<td class="numCell">{{item[13]}}</td>
|
||||||
<td class="numCell">{{item.hours}}</td>
|
<td class="numCell">{{item[14]}}</td>
|
||||||
<td class="numCell">{{item.days}}</td>
|
<td class="numCell">{{item[15]}}</td>
|
||||||
<td class="numCell">{{item.months}}</td>
|
<td class="numCell">{{item[16]}}</td>
|
||||||
<td class="numCell">{{item.months}}</td>
|
<td class="numCell">{{item[17]}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table border="1" cellspacing="0" :key="timeStamp" id="numTable">
|
<!-- <table border="1" cellspacing="0" :key="timeStamp" id="numTable">
|
||||||
<thead style="background: #efefef;height: 40px;">
|
<thead style="background: #efefef;height: 40px;">
|
||||||
<tr>
|
<tr>
|
||||||
<template v-for="(date,ind) in tableHead" :key="ind">
|
<template v-for="(date,ind) in tableHead" :key="ind">
|
||||||
<th v-if="ind==0" colspan="3">{{date}}</th>
|
<th>{{date}}</th>
|
||||||
<th v-else>{{date}}</th>
|
|
||||||
</template>
|
</template>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
@ -143,7 +142,7 @@
|
||||||
<td class="numCell">{{item[7]}}</td>
|
<td class="numCell">{{item[7]}}</td>
|
||||||
<td class="numCell" v-if="index!==4&&index!==11&&index!==16">{{item[8]}}</td>
|
<td class="numCell" v-if="index!==4&&index!==11&&index!==16">{{item[8]}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table> -->
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -172,12 +171,12 @@
|
||||||
{month:'2023.2',name:'乙组',number:'NM005',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
|
{month:'2023.2',name:'乙组',number:'NM005',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
|
||||||
{month:'2023.2',name:'丙组',number:'NM006',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
|
{month:'2023.2',name:'丙组',number:'NM006',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
|
||||||
],
|
],
|
||||||
tableHead:['日期','1号','2号','3号','4号','5号','6号','87号','8号'],
|
tableHead:['车间','工段','能源分类','1号','2号','3号','4号','5号','6号','7号','8号'],
|
||||||
tableDatas2:[
|
tableDatas2:[
|
||||||
['原料车间','电石渣','电量(KW.h)',1,2,3,4,5,6],
|
['原料车间','电石渣','电量(KW.h)',1,2,3,4,5,6],
|
||||||
['原料车间','电石渣','水(t)',1,2,3,4,5,6],
|
['原料车间','电石渣','水(t)',1,2,3,4,5,6],
|
||||||
['原料车间','原料','电量(KW.h)',1,2,3,4,5,6],
|
['原料车间','原料磨','电量(KW.h)',1,2,3,4,5,6],
|
||||||
['原料车间','原料','水(t)',1,2,3,4,5,6],
|
['原料车间','原料磨','水(t)',1,2,3,4,5,6],
|
||||||
['原料车间','压缩空气(m3)',1,2,3,4,5,6],
|
['原料车间','压缩空气(m3)',1,2,3,4,5,6],
|
||||||
|
|
||||||
['烧成车间','回转窑','电量(KW.h)',1,2,3,4,5,6],
|
['烧成车间','回转窑','电量(KW.h)',1,2,3,4,5,6],
|
||||||
|
|
@ -188,12 +187,13 @@
|
||||||
['烧成车间','煤磨','水(t)',1,2,3,4,5,6],
|
['烧成车间','煤磨','水(t)',1,2,3,4,5,6],
|
||||||
['烧成车间','压缩空气(m3)',1,2,3,4,5,6],
|
['烧成车间','压缩空气(m3)',1,2,3,4,5,6],
|
||||||
|
|
||||||
['水泥车间','电石渣','电量(KW.h)',1,2,3,4,5,6],
|
['水泥车间','水泥磨','电量(KW.h)',1,2,3,4,5,6],
|
||||||
['水泥车间','电石渣','水(t)',1,2,3,4,5,6],
|
['水泥车间','水泥磨','水(t)',1,2,3,4,5,6],
|
||||||
['水泥车间','原料','电量(KW.h)',1,2,3,4,5,6],
|
['水泥车间','包装','电量(KW.h)',1,2,3,4,5,6],
|
||||||
['水泥车间','原料','水(t)',1,2,3,4,5,6],
|
['水泥车间','包装','水(t)',1,2,3,4,5,6],
|
||||||
['水泥车间','压缩空气(m3)',1,2,3,4,5,6],
|
['水泥车间','压缩空气(m3)',1,2,3,4,5,6],
|
||||||
],
|
],
|
||||||
|
tableDatas3:[],
|
||||||
sourceData:{}
|
sourceData:{}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -202,7 +202,7 @@
|
||||||
let month = myDate.getMonth()+1;
|
let month = myDate.getMonth()+1;
|
||||||
if(month<10){
|
if(month<10){
|
||||||
month = '0'+month;
|
month = '0'+month;
|
||||||
}
|
}
|
||||||
this.query.month = myDate.getFullYear()+'-'+month;
|
this.query.month = myDate.getFullYear()+'-'+month;
|
||||||
this.getData();
|
this.getData();
|
||||||
|
|
||||||
|
|
@ -224,38 +224,191 @@
|
||||||
let arr = [];
|
let arr = [];
|
||||||
if(that.query.type==0){//日
|
if(that.query.type==0){//日
|
||||||
arr = that.query.month.split('-');
|
arr = that.query.month.split('-');
|
||||||
params.query.year_s = arr[0];
|
params.query.year_s = Number(arr[0]);
|
||||||
params.query.month_s = arr[1];
|
params.query.month_s = Number(arr[1]);
|
||||||
id='energy_day'
|
id='energy_day'
|
||||||
}else if(that.query.type==1){//月
|
}else if(that.query.type==1){//月
|
||||||
params.query.year_s = that.query.year;
|
params.query.year_s = Number(that.query.year);
|
||||||
id='energy_month'
|
id='energy_month'
|
||||||
}else{//年
|
}else{//年
|
||||||
params.query.year_s = that.query.yearStart;
|
params.query.year_s = Number(that.query.yearStart);
|
||||||
id='energy_year'
|
id='energy_year'
|
||||||
}
|
}
|
||||||
this.$API.bi.dataset.exec.req(id,params).then((res) => {
|
this.$API.bi.dataset.exec.req(id,params).then((res) => {
|
||||||
that.tableName = res.name;
|
that.tableName = res.name;
|
||||||
let data = res.data.ds0;
|
let data = res.data.ds0;
|
||||||
that.tableHead = data[0];
|
|
||||||
let data0 = data.slice(1,data.length);
|
let data0 = data.slice(1,data.length);
|
||||||
console.log(this.sourceData)
|
let wrapArr = [];
|
||||||
let tableDatas2 = that.tableDatas2;
|
let innerArr = [];
|
||||||
// data0.forEach(item => {
|
let ind = 0;
|
||||||
// for(let i=0;i<tableDatas2.length;i++){
|
let roomInd = 1;
|
||||||
// if(item[3]==tableDatas2[i][0]){
|
let mgroupInd = 2;
|
||||||
// if(item[4]==tableDatas2[i][1]){
|
let mpointInd =3;
|
||||||
// if(item[5]==tableDatas2[i][2]){
|
let valueInd = 4;
|
||||||
// let ind = item[2]+2;
|
if(that.query.type==0){//日统计
|
||||||
// tableDatas2[i][ind] = item[6]
|
arr = that.query.month.split('-');
|
||||||
|
var date =new Date(Number(arr[0]), Number(arr[1]), 0).getDate();
|
||||||
|
for(let d = 1;d<=date;d++){
|
||||||
|
let arr = [];
|
||||||
|
arr[0]=d;
|
||||||
|
innerArr.push(arr)
|
||||||
|
}
|
||||||
|
}else if(that.query.type==1){//月统计
|
||||||
|
innerArr = [['一'],['二'],['三'],['四'],['五'],['六'],['七'],['八'],['九'],['十'],['十一'],['十二']]
|
||||||
|
}else{//年统计
|
||||||
|
let nowDate = new Date().getFullYear();
|
||||||
|
let num = Number(nowDate)-Number(that.query.yearStart) +1;
|
||||||
|
for(let y = 0;y<num;y++){
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = 2023-y;
|
||||||
|
innerArr.push(arr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//1、将相同日期或月份/年份的数据放到一组
|
||||||
|
data0.forEach(item => {
|
||||||
|
if(that.query.type==0){//日统计
|
||||||
|
ind = item[0]-1;
|
||||||
|
}else if(that.query.type==1){//月统计
|
||||||
|
ind = item[0]-1;
|
||||||
|
}else{//年统计
|
||||||
|
ind = item[0]-2023;
|
||||||
|
}
|
||||||
|
if(wrapArr[ind]){
|
||||||
|
}else{
|
||||||
|
wrapArr[ind] = [];
|
||||||
|
}
|
||||||
|
wrapArr[ind].push(item);
|
||||||
|
if(innerArr[ind]){
|
||||||
|
}else{
|
||||||
|
innerArr[ind] = [];
|
||||||
|
}
|
||||||
|
debugger;
|
||||||
|
if(item[roomInd]=="原料车间"){
|
||||||
|
if(item[mgroupInd]=="电石渣"){
|
||||||
|
if(item[mpointInd]=="动力电"){
|
||||||
|
innerArr[ind][1] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}else{
|
||||||
|
innerArr[ind][2] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}
|
||||||
|
}else if(item[mgroupInd]=="原料磨"){
|
||||||
|
if(item[mpointInd]=="动力电"){
|
||||||
|
innerArr[ind][3] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}else{
|
||||||
|
innerArr[ind][4] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}
|
||||||
|
}else if(item[mgroupInd]=="压缩空气"){
|
||||||
|
innerArr[ind][5] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}
|
||||||
|
}else if(item[roomInd]=="烧成车间"){
|
||||||
|
if(item[mgroupInd]=="回转窑"){
|
||||||
|
if(item[mpointInd]=="动力电"){
|
||||||
|
innerArr[ind][6] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}else if(item[mpointInd]=="煤粉"){
|
||||||
|
innerArr[ind][7] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}else if(item[mpointInd]=="工业水"){
|
||||||
|
innerArr[ind][8] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}else{
|
||||||
|
innerArr[ind][9] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}
|
||||||
|
}else if(item[mgroupInd]=="煤磨"){
|
||||||
|
if(item[mpointInd]=="动力电"){
|
||||||
|
innerArr[ind][10] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}else{
|
||||||
|
innerArr[ind][11] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}
|
||||||
|
}else if(item[mgroupInd]=="压缩空气"){
|
||||||
|
innerArr[ind][12] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}
|
||||||
|
}else if(item[roomInd]=="水泥车间"){
|
||||||
|
if(item[mgroupInd]=="水泥磨"){
|
||||||
|
if(item[mpointInd]=="动力电"){
|
||||||
|
innerArr[ind][13] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}else{
|
||||||
|
innerArr[ind][14] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}
|
||||||
|
}else if(item[mgroupInd]=="包装"){
|
||||||
|
if(item[mpointInd]=="动力电"){
|
||||||
|
innerArr[ind][15] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}else{
|
||||||
|
innerArr[ind][16] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}
|
||||||
|
}else if(item[mgroupInd]=="压缩空气"){
|
||||||
|
innerArr[ind][17] = Number(item[valueInd]).toFixed(2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
that.tableDatas3 = innerArr;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//2、根据表头位置进行排序
|
||||||
|
// let innerArr = [];
|
||||||
|
// innerArr = [];
|
||||||
|
// for(let i = 0;i<wrapArr.length;i++){
|
||||||
|
// let item0 = wrapArr[i];
|
||||||
|
// for(let j = 0;j<item0.length;j++){
|
||||||
|
// let item1 = item0[j];
|
||||||
|
// if(item1[roomInd]=="原料车间"){
|
||||||
|
// if(item1[mgroupInd]=="电石渣"){
|
||||||
|
// if(item1[mpointInd]=="动力电"){
|
||||||
|
// innerArr[1] = item1[valueInd]
|
||||||
|
// }else{
|
||||||
|
// innerArr[2] = item1[valueInd]
|
||||||
// }
|
// }
|
||||||
|
// }else if(item1[mgroupInd]=="原料"){
|
||||||
|
// if(item1[mpointInd]=="动力电"){
|
||||||
|
// innerArr[3] = item1[valueInd]
|
||||||
|
// }else{
|
||||||
|
// innerArr[4] = item1[valueInd]
|
||||||
|
// }
|
||||||
|
// }else if(item1[mgroupInd]=="压缩空气"){
|
||||||
|
// innerArr[5] = item1[valueInd]
|
||||||
|
// }
|
||||||
|
// }else if(item1[roomInd]=="烧成车间"){
|
||||||
|
// if(item1[mgroupInd]=="回转窑"){
|
||||||
|
// if(item1[mpointInd]=="动力电"){
|
||||||
|
// innerArr[6] = item1[valueInd]
|
||||||
|
// }else if(item1[mpointInd]=="煤粉"){
|
||||||
|
// innerArr[7] = item1[valueInd]
|
||||||
|
// }else if(item1[mpointInd]=="工业水"){
|
||||||
|
// innerArr[8] = item1[valueInd]
|
||||||
|
// }else{
|
||||||
|
// innerArr[9] = item1[valueInd]
|
||||||
|
// }
|
||||||
|
// }else if(item1[mgroupInd]=="煤磨"){
|
||||||
|
// if(item1[mpointInd]=="动力电"){
|
||||||
|
// innerArr[10] = item1[valueInd]
|
||||||
|
// }else{
|
||||||
|
// innerArr[11] = item1[valueInd]
|
||||||
|
// }
|
||||||
|
// }else if(item1[mgroupInd]=="压缩空气"){
|
||||||
|
// innerArr[12] = item1[valueInd]
|
||||||
|
// }
|
||||||
|
// }else if(item1[roomInd]=="水泥车间"){
|
||||||
|
// if(item1[mgroupInd]=="水泥磨"){
|
||||||
|
// if(item1[mpointInd]=="动力电"){
|
||||||
|
// innerArr[13] = item1[valueInd]
|
||||||
|
// }else{
|
||||||
|
// innerArr[14] = item1[valueInd]
|
||||||
|
// }
|
||||||
|
// }else if(item1[mgroupInd]=="包装"){
|
||||||
|
// if(item1[mpointInd]=="动力电"){
|
||||||
|
// innerArr[15] = item1[valueInd]
|
||||||
|
// }else{
|
||||||
|
// innerArr[16] = item1[valueInd]
|
||||||
|
// }
|
||||||
|
// }else if(item1[mgroupInd]=="压缩空气"){
|
||||||
|
// innerArr[17] = item1[valueInd]
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// });
|
// }
|
||||||
|
|
||||||
|
this.tableDatas3 = innerArr;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getTableData(){
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
|
||||||
handlePrint() {
|
handlePrint() {
|
||||||
this.$PRINT('#myReport');
|
this.$PRINT('#myReport');
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
mounted() {
|
mounted() {
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let month = myDate.getMonth()+1;
|
let month = myDate.getMonth()+1;
|
||||||
let days = myDate.getDate();
|
let days = myDate.getDate()-1;
|
||||||
if(month<10){
|
if(month<10){
|
||||||
month = '0'+month;
|
month = '0'+month;
|
||||||
}
|
}
|
||||||
|
|
@ -146,8 +146,6 @@
|
||||||
days = '0'+days;
|
days = '0'+days;
|
||||||
}
|
}
|
||||||
this.query.day = myDate.getFullYear()+'-'+month+'-'+days;
|
this.query.day = myDate.getFullYear()+'-'+month+'-'+days;
|
||||||
debugger;
|
|
||||||
console.log(this.query.day)
|
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,127 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="left-panel">
|
||||||
|
<el-select
|
||||||
|
v-model="query.mgroup"
|
||||||
|
placeholder="工段"
|
||||||
|
clearable
|
||||||
|
style="width: 120px;margin-right: 5px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||||
|
</div>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'role.create'"></el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-header>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<scTable ref="table" :apiObj="apiObj" row-key="id" hidePagination>
|
||||||
|
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||||
|
<el-table-column label="开始时间" prop="start_time" min-width="100"></el-table-column>
|
||||||
|
<el-table-column label="结束时间" prop="end_time" min-width="100"></el-table-column>
|
||||||
|
<el-table-column label="停机时长" prop="duration" min-width="150"></el-table-column>
|
||||||
|
<el-table-column label="关联工段" prop="mgroup_name" min-width="150"></el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link size="small" @click="table_edit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
|
||||||
|
<template #reference>
|
||||||
|
<el-button link size="small" v-auth="'role.delete'" type="danger">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
<save-dialog
|
||||||
|
v-if="dialog.save"
|
||||||
|
ref="saveDialog"
|
||||||
|
@success="handleSaveSuccess"
|
||||||
|
@closed="dialog.save = false"
|
||||||
|
></save-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import saveDialog from "./feeset_form.vue";
|
||||||
|
export default {
|
||||||
|
name: 'dept',
|
||||||
|
components: {
|
||||||
|
saveDialog
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
apiObj: this.$API.wpm.stlog,
|
||||||
|
query: {
|
||||||
|
mgroup:'',
|
||||||
|
},
|
||||||
|
dialog: {
|
||||||
|
save: false,
|
||||||
|
},
|
||||||
|
selection:[],
|
||||||
|
options:[],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
this.getMgroup();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取集合列表
|
||||||
|
getMgroup(){
|
||||||
|
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{
|
||||||
|
this.options = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//添加
|
||||||
|
table_add() {
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open("add");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//编辑
|
||||||
|
table_edit(row) {
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open("edit").setData(row);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除测点集
|
||||||
|
async table_del(row){
|
||||||
|
var id = row.id;
|
||||||
|
var res = await this.$API.mtm.mgroup.delete.req(id);
|
||||||
|
if(res.err_msg){
|
||||||
|
this.$message.error(res.err_msg)
|
||||||
|
}else{
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
this.$message.success("删除成功")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//表格选择后回调事件
|
||||||
|
selectionChange(selection){
|
||||||
|
this.selection = selection;
|
||||||
|
},
|
||||||
|
//搜索
|
||||||
|
handleQuery(){
|
||||||
|
this.$refs.table.queryData(this.query)
|
||||||
|
},
|
||||||
|
//本地更新数据
|
||||||
|
//新增岗位后更新数据
|
||||||
|
handleSaveSuccess(data, mode) {
|
||||||
|
this.dialog.save = false;
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.treeMain {width: 100%;height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue