|
@@ -9,7 +9,6 @@
|
|
|
<span class="el-mgRight-sm" v-show="value == 'history'"> 上报时间 </span>
|
|
|
<span class="el-mgRight-sm" v-show="value == 'alarm'">告警时间</span>
|
|
|
<span class="el-mgRight-sm" v-show="value == 'valveNote'">操作时间</span>
|
|
|
- <span class="el-mgRight-sm" v-show="value == 'replace'">更换时间</span>
|
|
|
<span>
|
|
|
<el-date-picker
|
|
|
v-model="dataValue"
|
|
@@ -17,7 +16,7 @@
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
- value-format="yyyyMMdd"
|
|
|
+ :value-format="dateType"
|
|
|
:picker-options="endDatePicker"
|
|
|
@change="timeQuery"
|
|
|
:clearable="false"
|
|
@@ -72,47 +71,13 @@
|
|
|
>
|
|
|
</zz-table>
|
|
|
</div>
|
|
|
- <div class="box__wrap" ref="replacebox" v-show="value == 'replace'">
|
|
|
- <zz-table
|
|
|
- :cols="replaceDetailCols"
|
|
|
- :settings="{ showIndex: true, stripe: true }"
|
|
|
- :data="mixins_list"
|
|
|
- class="fullheight"
|
|
|
- :loading="mixins_onQuery"
|
|
|
- :pageset="mixins_pageset"
|
|
|
- @page-change="pageChange"
|
|
|
- >
|
|
|
- <template slot="deviceNo" slot-scope="scope">
|
|
|
- <p v-tip>旧:{{ getRowStr(scope.row, ['DeviceNo']).oldStr || '-' }}</p>
|
|
|
- <p v-tip :style="{ color: getRowStr(scope.row, ['DeviceNo']).color }">
|
|
|
- 新:{{ getRowStr(scope.row, ['DeviceNo']).newStr || '-' }}
|
|
|
- </p>
|
|
|
- </template>
|
|
|
- <template slot="meterNo" slot-scope="scope">
|
|
|
- <p v-tip>旧:{{ getRowStr(scope.row, ['MeterNo']).oldStr || '-' }}</p>
|
|
|
- <p v-tip :style="{ color: getRowStr(scope.row, ['MeterNo']).color }">
|
|
|
- 新:{{ getRowStr(scope.row, ['MeterNo']).newStr || '-' }}
|
|
|
- </p>
|
|
|
- </template>
|
|
|
- <template slot="productId" slot-scope="scope">
|
|
|
- <p v-tip>旧:{{ getRowStr(scope.row, ['ProductId']).oldStr || '-' }}</p>
|
|
|
- <p v-tip :style="{ color: getRowStr(scope.row, ['ProductId']).color }">
|
|
|
- 新:{{ getRowStr(scope.row, ['ProductId']).newStr || '-' }}
|
|
|
- </p>
|
|
|
- </template>
|
|
|
- <template slot="replaceUser" slot-scope="scope">
|
|
|
- <p v-tip>{{ scope.row.replaceUsername }}</p>
|
|
|
- <p v-tip>{{ scope.row.replaceUserPhone }}</p>
|
|
|
- </template>
|
|
|
- </zz-table>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import list from '@/utils/list';
|
|
|
-import { AlertsCols, replaceDetailCols, historyCols, valveInfoCols } from '../baseData';
|
|
|
+import { AlertsCols, historyCols, valveInfoCols } from '../baseData';
|
|
|
import { getRowStr } from './basedata';
|
|
|
import { deviceLoader } from '@/utils/basedata.js';
|
|
|
import { chartOption } from './echartoption';
|
|
@@ -123,10 +88,10 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
deviceLoader,
|
|
|
- detailCols: [],
|
|
|
type: '',
|
|
|
chartoption: {}, //
|
|
|
value: 'history',
|
|
|
+ dateType: 'yyyyMMdd',
|
|
|
tabs: [
|
|
|
{
|
|
|
value: 'history',
|
|
@@ -146,7 +111,7 @@ export default {
|
|
|
// }
|
|
|
],
|
|
|
dataUnit: '',
|
|
|
- dataValue: '',
|
|
|
+ dataValue: [],
|
|
|
endDatePicker: {
|
|
|
disabledDate: (time) => {
|
|
|
return time.getTime() > new Date().getTime();
|
|
@@ -162,23 +127,16 @@ export default {
|
|
|
Cols: [],
|
|
|
AlertsCols,
|
|
|
valveInfoCols,
|
|
|
- replaceDetailCols, //换表表头
|
|
|
historyCols, //告警列表表头
|
|
|
getRowStr,
|
|
|
historyDataList: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- let date = new Date();
|
|
|
- this.value = 'history';
|
|
|
- this.dataValue = [
|
|
|
- this.$moment(new Date(date.getFullYear(), date.getMonth(), 1)).format('YYYYMMDD'),
|
|
|
- this.$moment().format('YYYYMMDD')
|
|
|
- ];
|
|
|
if (!!this.$route.query.type && this.$route.query.type == 2) {
|
|
|
this.tabs[2].label = '闸控记录';
|
|
|
}
|
|
|
-
|
|
|
+ this.initDate('YYYYMMDD');
|
|
|
this.mixins_query = {
|
|
|
deviceId: this.params.id || '',
|
|
|
startDate: this.dataValue.length ? `${this.dataValue[0]}` : '',
|
|
@@ -192,6 +150,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ initDate(type) {
|
|
|
+ let date = new Date();
|
|
|
+ this.dataValue = [this.$moment(new Date(date.getFullYear(), date.getMonth(), 1)).format(type), this.$moment().format(type)];
|
|
|
+ },
|
|
|
change(value) {
|
|
|
this.value = value;
|
|
|
if (value == 'history') {
|
|
@@ -199,8 +161,6 @@ export default {
|
|
|
this.getDiscount();
|
|
|
} else if (value == 'alarm') {
|
|
|
this.getAllHandleAbnormal();
|
|
|
- } else if (value == 'replace') {
|
|
|
- this.getReplaceMeter();
|
|
|
} else if (value == 'valveNote') {
|
|
|
this.getValveData();
|
|
|
}
|
|
@@ -292,19 +252,6 @@ export default {
|
|
|
};
|
|
|
this.mixins_search();
|
|
|
},
|
|
|
- // 换表
|
|
|
- getReplaceMeter() {
|
|
|
- this.mixins_list = [];
|
|
|
- this.mixins_post = 'post';
|
|
|
- this.mixins_dataUrl = '/zoniot-rmcp-web/device/meter/replace/page';
|
|
|
- this.mixins_query = {
|
|
|
- deviceNo: this.params.deviceNo || '',
|
|
|
- replaceMethod: '',
|
|
|
- startDate: this.dataValue.length ? `${this.dataValue[0]}000000` : '',
|
|
|
- endDate: this.dataValue.length ? `${this.dataValue[1]}235959` : ''
|
|
|
- };
|
|
|
- this.mixins_search();
|
|
|
- },
|
|
|
// 阀控记录
|
|
|
getValveData() {
|
|
|
this.mixins_list = [];
|