|
@@ -211,14 +211,14 @@
|
|
|
v-privilege="activeMenu + 'PUT'"
|
|
|
@click="but_redata()"
|
|
|
:loading="loading"
|
|
|
- >重新生成数据</el-button>
|
|
|
- <el-button
|
|
|
- class="button"
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- v-privilege="activeMenu + 'examine'"
|
|
|
- @click="examine()"
|
|
|
- :loading="loading"
|
|
|
+ >重新生成数据</el-button>
|
|
|
+ <el-button
|
|
|
+ class="button"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ v-privilege="activeMenu + 'examine'"
|
|
|
+ @click="examine()"
|
|
|
+ :loading="loading"
|
|
|
>审核</el-button>
|
|
|
<div style="float:right; text-align: right;">
|
|
|
<el-tooltip content="每天早上7点45生成昨日数据" placement="left">
|
|
@@ -271,8 +271,8 @@
|
|
|
size="mini"
|
|
|
highlight-current-row
|
|
|
@selection-change="handleSelectionChange"
|
|
|
- show-summary
|
|
|
- @cell-click="cellClick"
|
|
|
+ show-summary
|
|
|
+ @cell-click="cellClick"
|
|
|
:row-class-name="tableRowClassName"
|
|
|
:summary-method="getSummaries">
|
|
|
<el-table-column
|
|
@@ -282,6 +282,14 @@
|
|
|
align="center"
|
|
|
fixed="left"
|
|
|
></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ width="100px"
|
|
|
+ type="index"
|
|
|
+ label="排序号"
|
|
|
+ fixed="left"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
|
sortable
|
|
|
prop="clock"
|
|
@@ -404,7 +412,7 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
- v-if="scope.row.isSelection"
|
|
|
+ v-if="scope.row.isSelection"
|
|
|
:prop="scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid + '.correctvalue'"
|
|
|
:rules="tableFormRules.correctvalue"
|
|
|
>
|
|
@@ -412,7 +420,7 @@
|
|
|
style="width: 100%;"
|
|
|
v-model="tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].correctvalue"
|
|
|
refcous="true"
|
|
|
- @change="getApportvalue(scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid)"
|
|
|
+ @change="getApportvalue(scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid)"
|
|
|
@keydown.native="keyDown" :id="scope.$index + scope.column.id"
|
|
|
></el-input>
|
|
|
<template slot="error" slot-scope="scope">
|
|
@@ -431,15 +439,15 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
- v-if="scope.row.isSelection"
|
|
|
- :prop="scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid + '.apportvalue'"
|
|
|
+ v-if="scope.row.isSelection"
|
|
|
+ :prop="scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid + '.apportvalue'"
|
|
|
:rules="tableFormRules.apportvalue"
|
|
|
>
|
|
|
<el-input clearable
|
|
|
style="width: 100%;"
|
|
|
v-model="tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].apportvalue"
|
|
|
refcous="true"
|
|
|
- @change="getCorrectvalue(scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid)"
|
|
|
+ @change="getCorrectvalue(scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid)"
|
|
|
@keydown.native="keyDown" :id="scope.$index + scope.column.id"
|
|
|
></el-input>
|
|
|
<template slot="error" slot-scope="scope">
|
|
@@ -501,18 +509,18 @@
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ nameObj.unitid.obj[scope.row.unitid] ? nameObj.unitid.obj[scope.row.unitid] : scope.row.unitid }}</span>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- sortable
|
|
|
- prop="issettle"
|
|
|
- label="状态"
|
|
|
- width="60px"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span :style="{color: nameObj.issettle.obj[scope.row.issettle] ? nameObj.issettle.obj[scope.row.issettle].color : ''}"
|
|
|
- >{{ nameObj.issettle.obj[scope.row.issettle] ? nameObj.issettle.obj[scope.row.issettle].name : scope.row.issettle }}</span>
|
|
|
- </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="issettle"
|
|
|
+ label="状态"
|
|
|
+ width="60px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span :style="{color: nameObj.issettle.obj[scope.row.issettle] ? nameObj.issettle.obj[scope.row.issettle].color : ''}"
|
|
|
+ >{{ nameObj.issettle.obj[scope.row.issettle] ? nameObj.issettle.obj[scope.row.issettle].name : scope.row.issettle }}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
sortable
|
|
@@ -674,7 +682,7 @@ export default {
|
|
|
itemname: '',
|
|
|
itemdesc: '',
|
|
|
measureid: '',
|
|
|
- energytypeid: '',
|
|
|
+ energytypeid: '',
|
|
|
issettle: ''
|
|
|
},
|
|
|
rules: {
|
|
@@ -688,14 +696,14 @@ export default {
|
|
|
numbers: [
|
|
|
// { required: true, message: '该项不能为空', trigger: 'change' },
|
|
|
{ validator: zCheckNumber1, trigger: 'change' }
|
|
|
- ],
|
|
|
- correctvalue: [
|
|
|
- // { required: true, message: '该项不能为空', trigger: 'change' },
|
|
|
- { validator: zCheckNumber1, trigger: 'change' }
|
|
|
- ],
|
|
|
- apportvalue: [
|
|
|
- // { required: true, message: '该项不能为空', trigger: 'change' },
|
|
|
- { validator: zCheckNumber1, trigger: 'change' }
|
|
|
+ ],
|
|
|
+ correctvalue: [
|
|
|
+ // { required: true, message: '该项不能为空', trigger: 'change' },
|
|
|
+ { validator: zCheckNumber1, trigger: 'change' }
|
|
|
+ ],
|
|
|
+ apportvalue: [
|
|
|
+ // { required: true, message: '该项不能为空', trigger: 'change' },
|
|
|
+ { validator: zCheckNumber1, trigger: 'change' }
|
|
|
]
|
|
|
},
|
|
|
pageNum: 1,
|
|
@@ -742,30 +750,30 @@ export default {
|
|
|
energytypeid: {
|
|
|
obj: {},
|
|
|
arr: []
|
|
|
- },
|
|
|
- issettle: {
|
|
|
- obj: {
|
|
|
- '0': {
|
|
|
- name: '待审核',
|
|
|
- color: '#7a7a7a'
|
|
|
- },
|
|
|
+ },
|
|
|
+ issettle: {
|
|
|
+ obj: {
|
|
|
+ '0': {
|
|
|
+ name: '待审核',
|
|
|
+ color: '#7a7a7a'
|
|
|
+ },
|
|
|
'1': {
|
|
|
name: '已审核',
|
|
|
color: 'red'
|
|
|
- }
|
|
|
- },
|
|
|
- arr: [
|
|
|
- {
|
|
|
- id: '0',
|
|
|
- name: '待审核',
|
|
|
- color: '#7a7a7a'
|
|
|
- },
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- name: '已审核',
|
|
|
- color: 'red'
|
|
|
- }
|
|
|
- ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ arr: [
|
|
|
+ {
|
|
|
+ id: '0',
|
|
|
+ name: '待审核',
|
|
|
+ color: '#7a7a7a'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '1',
|
|
|
+ name: '已审核',
|
|
|
+ color: 'red'
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
loading: false,
|
|
@@ -795,11 +803,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
- rowIndex: '',
|
|
|
- columnId: '',
|
|
|
- seqArr: [],
|
|
|
- focusTarget: null,
|
|
|
+ },
|
|
|
+ rowIndex: '',
|
|
|
+ columnId: '',
|
|
|
+ seqArr: [],
|
|
|
+ focusTarget: null,
|
|
|
editSetFlag: '',
|
|
|
}
|
|
|
},
|
|
@@ -831,7 +839,7 @@ export default {
|
|
|
// 接收路由参数
|
|
|
if (that.$route.query.workprocid) {
|
|
|
that.filterForm.disabled.workprocid = true;
|
|
|
- that.filterForm.data.workprocid = that.$route.query.workprocid.split(',');
|
|
|
+ that.filterForm.data.workprocid = that.$route.query.workprocid.split(',');
|
|
|
that.filterForm.data.issettle = '1';
|
|
|
}
|
|
|
that.getTimeGranData();
|
|
@@ -992,7 +1000,7 @@ export default {
|
|
|
itemname: that.filterForm.data.itemname,
|
|
|
itemdesc: that.filterForm.data.itemdesc,
|
|
|
measureid: that.filterForm.data.measureid,
|
|
|
- energytypeid: that.filterForm.data.energytypeid.toString(),
|
|
|
+ energytypeid: that.filterForm.data.energytypeid.toString(),
|
|
|
issettle: that.filterForm.data.issettle
|
|
|
};
|
|
|
that.pageNum = pageNum || that.pageNum;
|
|
@@ -1003,7 +1011,7 @@ export default {
|
|
|
})
|
|
|
.then(function (res) {
|
|
|
if (res.code === '0') {
|
|
|
- let arr = [];
|
|
|
+ let arr = [];
|
|
|
let i = 0;
|
|
|
for (let item of res.data.list) {
|
|
|
arr.push({
|
|
@@ -1029,11 +1037,12 @@ export default {
|
|
|
seqno: item.SEQNO,
|
|
|
updateUser: item.USERID,
|
|
|
updateTime: item.UPTIME,
|
|
|
- fid: item.FID,
|
|
|
- issettle: item.ISSETTLE,
|
|
|
+ fid: item.FID,
|
|
|
+ issettle: item.ISSETTLE,
|
|
|
+ showno: item.SHOWNO,
|
|
|
seq: i
|
|
|
// 修改时间
|
|
|
- })
|
|
|
+ })
|
|
|
i ++;
|
|
|
}
|
|
|
that.tableData = arr;
|
|
@@ -1195,11 +1204,11 @@ export default {
|
|
|
// 表格中多选按钮的相关方法
|
|
|
handleSelectionChange (val) {
|
|
|
let that = this;
|
|
|
- let tableFormDataObj = {};
|
|
|
- let arr = [];
|
|
|
- for (let item of val) {
|
|
|
- arr.push(item.seq);
|
|
|
- }
|
|
|
+ let tableFormDataObj = {};
|
|
|
+ let arr = [];
|
|
|
+ for (let item of val) {
|
|
|
+ arr.push(item.seq);
|
|
|
+ }
|
|
|
this.seqArr = arr.sort(sortNumber);
|
|
|
for (let item of that.tableData) {
|
|
|
item.isSelection = false;
|
|
@@ -1322,108 +1331,108 @@ export default {
|
|
|
that.$message.error(res.message);
|
|
|
}
|
|
|
});
|
|
|
- },
|
|
|
- tableRowClassName ({row, rowIndex}) {
|
|
|
- // 把每一行的索引放进row
|
|
|
- row.index = rowIndex;
|
|
|
- },
|
|
|
- cellClick (row, column, cell, event) {
|
|
|
- let _this = this;
|
|
|
- this.rowIndex = row.index;
|
|
|
- this.columnId = column.id;
|
|
|
- _this.editSetFlag = row.index + column.id;
|
|
|
- _this.focusTarget = event.target;
|
|
|
- while (_this.focusTarget.tagName !== 'TD') {
|
|
|
- _this.focusTarget = _this.focusTarget.parentElement;
|
|
|
- }
|
|
|
- _this.$nextTick(() => {
|
|
|
- let target = this.focusTarget;
|
|
|
- $(target).find('input').focus();
|
|
|
- });
|
|
|
- },
|
|
|
- keyDown (event1) {
|
|
|
- let tdTarget = event1.target;
|
|
|
- let _this = this;
|
|
|
- while (tdTarget.tagName !== 'TD') {
|
|
|
- tdTarget = tdTarget.parentElement;
|
|
|
- }
|
|
|
- // 如果按下键盘下键或者回车键
|
|
|
- if (event.keyCode === 40 || event.keyCode === 13) {
|
|
|
- let index = parseInt(this.rowIndex);
|
|
|
- if (index !== this.seqArr[this.seqArr.length - 1]) {
|
|
|
- for (let i = 0; i < this.seqArr.length; i++) {
|
|
|
- if (index === this.seqArr[i]) {
|
|
|
- index = this.seqArr[i + 1];
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.editSetFlag = index + this.columnId;
|
|
|
- let id = '#' + this.editSetFlag;
|
|
|
- this.$nextTick(() => {
|
|
|
- $(id).click();
|
|
|
- });
|
|
|
- } else if (event.keyCode === 38) { // 键盘上键
|
|
|
- let index = parseInt(this.rowIndex);
|
|
|
- if (index !== this.seqArr[0]) {
|
|
|
- for (let i = 0; i < this.seqArr.length; i++) {
|
|
|
- if (index === this.seqArr[i]) {
|
|
|
- index = this.seqArr[i - 1];
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.editSetFlag = index + this.columnId;
|
|
|
- let id = '#' + this.editSetFlag;
|
|
|
- this.$nextTick(() => {
|
|
|
- $(id).click();
|
|
|
- });
|
|
|
- } else if (event.keyCode === 37) { // 键盘左键
|
|
|
- $(tdTarget).prev().click();
|
|
|
- $(tdTarget).prev().find('input').select();
|
|
|
- } else if (event.keyCode === 39) { // 键盘右键
|
|
|
- $(tdTarget).next().click();
|
|
|
- $(tdTarget).next().find('input').select();
|
|
|
- }
|
|
|
- },
|
|
|
- // 审核
|
|
|
- examine () {
|
|
|
- let that = this;
|
|
|
- if (that.multipleSelection.length > 0) {
|
|
|
- let SubmitData = [];
|
|
|
- let issettle = '';
|
|
|
- for (let key in that.tableFormDataObj) {
|
|
|
- issettle = that.tableFormDataObj[key].issettle === '0' ? '1' : '0'
|
|
|
- SubmitData.push({
|
|
|
- itemid: that.tableFormDataObj[key].itemid,
|
|
|
- issettle: issettle
|
|
|
- });
|
|
|
- }
|
|
|
- that.loading = true;
|
|
|
- that.axios.put('pass/ems/v1/trmactitems/batchUpdate', SubmitData)
|
|
|
- .then(function (res) {
|
|
|
- if (res.code === '0') {
|
|
|
- that.$message({
|
|
|
- message: '操作成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- that.getTableData();
|
|
|
- that.getTableDetailDatas();
|
|
|
- } else {
|
|
|
- that.$message.error(res.message);
|
|
|
- }
|
|
|
- that.loading = false;
|
|
|
- }).catch(function () {
|
|
|
- that.loading = false;
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$message.error('至少要选择一条数据');
|
|
|
- }
|
|
|
+ },
|
|
|
+ tableRowClassName ({row, rowIndex}) {
|
|
|
+ // 把每一行的索引放进row
|
|
|
+ row.index = rowIndex;
|
|
|
+ },
|
|
|
+ cellClick (row, column, cell, event) {
|
|
|
+ let _this = this;
|
|
|
+ this.rowIndex = row.index;
|
|
|
+ this.columnId = column.id;
|
|
|
+ _this.editSetFlag = row.index + column.id;
|
|
|
+ _this.focusTarget = event.target;
|
|
|
+ while (_this.focusTarget.tagName !== 'TD') {
|
|
|
+ _this.focusTarget = _this.focusTarget.parentElement;
|
|
|
+ }
|
|
|
+ _this.$nextTick(() => {
|
|
|
+ let target = this.focusTarget;
|
|
|
+ $(target).find('input').focus();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ keyDown (event1) {
|
|
|
+ let tdTarget = event1.target;
|
|
|
+ let _this = this;
|
|
|
+ while (tdTarget.tagName !== 'TD') {
|
|
|
+ tdTarget = tdTarget.parentElement;
|
|
|
+ }
|
|
|
+ // 如果按下键盘下键或者回车键
|
|
|
+ if (event.keyCode === 40 || event.keyCode === 13) {
|
|
|
+ let index = parseInt(this.rowIndex);
|
|
|
+ if (index !== this.seqArr[this.seqArr.length - 1]) {
|
|
|
+ for (let i = 0; i < this.seqArr.length; i++) {
|
|
|
+ if (index === this.seqArr[i]) {
|
|
|
+ index = this.seqArr[i + 1];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.editSetFlag = index + this.columnId;
|
|
|
+ let id = '#' + this.editSetFlag;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ $(id).click();
|
|
|
+ });
|
|
|
+ } else if (event.keyCode === 38) { // 键盘上键
|
|
|
+ let index = parseInt(this.rowIndex);
|
|
|
+ if (index !== this.seqArr[0]) {
|
|
|
+ for (let i = 0; i < this.seqArr.length; i++) {
|
|
|
+ if (index === this.seqArr[i]) {
|
|
|
+ index = this.seqArr[i - 1];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.editSetFlag = index + this.columnId;
|
|
|
+ let id = '#' + this.editSetFlag;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ $(id).click();
|
|
|
+ });
|
|
|
+ } else if (event.keyCode === 37) { // 键盘左键
|
|
|
+ $(tdTarget).prev().click();
|
|
|
+ $(tdTarget).prev().find('input').select();
|
|
|
+ } else if (event.keyCode === 39) { // 键盘右键
|
|
|
+ $(tdTarget).next().click();
|
|
|
+ $(tdTarget).next().find('input').select();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 审核
|
|
|
+ examine () {
|
|
|
+ let that = this;
|
|
|
+ if (that.multipleSelection.length > 0) {
|
|
|
+ let SubmitData = [];
|
|
|
+ let issettle = '';
|
|
|
+ for (let key in that.tableFormDataObj) {
|
|
|
+ issettle = that.tableFormDataObj[key].issettle === '0' ? '1' : '0'
|
|
|
+ SubmitData.push({
|
|
|
+ itemid: that.tableFormDataObj[key].itemid,
|
|
|
+ issettle: issettle
|
|
|
+ });
|
|
|
+ }
|
|
|
+ that.loading = true;
|
|
|
+ that.axios.put('pass/ems/v1/trmactitems/batchUpdate', SubmitData)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ that.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ that.getTableData();
|
|
|
+ that.getTableDetailDatas();
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ that.loading = false;
|
|
|
+ }).catch(function () {
|
|
|
+ that.loading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error('至少要选择一条数据');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-function sortNumber (a, b) {
|
|
|
- return a - b
|
|
|
+}
|
|
|
+function sortNumber (a, b) {
|
|
|
+ return a - b
|
|
|
}
|
|
|
</script>
|
|
|
|