|
@@ -42,7 +42,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="photos_num" label="照片">
|
|
|
<template slot-scope="scope">
|
|
|
- <span style="color: #025BAA">{{ scope.row.photos_num?scope.row.photos_num : 0 }}张</span>
|
|
|
+ <span style="color: #025BAA">{{ scope.row.photos_num?(scope.row.photos_num + '张') : '—' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="report" label="报告">
|
|
@@ -67,16 +67,17 @@
|
|
|
v-model="dialogTime"
|
|
|
type="daterange"
|
|
|
range-separator="至"
|
|
|
+ @change="changeTime"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期">
|
|
|
</el-date-picker>
|
|
|
- <el-table :data="tableData" style="margin-bottom: 55px">
|
|
|
- <el-table-column property="serialNumber" label="日期"></el-table-column>
|
|
|
+ <el-table :data="historyTableData" style="margin-bottom: 55px">
|
|
|
+ <el-table-column property="finishDate" label="日期"></el-table-column>
|
|
|
<el-table-column property="equipmentName" label="事项类型"></el-table-column>
|
|
|
<el-table-column property="equipmentNumber" label="事项名称"></el-table-column>
|
|
|
<el-table-column property="photos_num" label="照片">
|
|
|
<template slot-scope="scope">
|
|
|
- <span style="color: #025BAA">{{ scope.row.photos_num?scope.row.photos_num : 0 }}张</span>
|
|
|
+ <span style="color: #025BAA">{{ scope.row.photos_num?(scope.row.photos_num + '张') : '—' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column property="report" label="报告">
|
|
@@ -89,7 +90,10 @@
|
|
|
<el-pagination
|
|
|
background
|
|
|
layout="prev, pager, next"
|
|
|
- :total="tatol">
|
|
|
+ :current-page="hisCurPage"
|
|
|
+ :page-size="hisPageSize"
|
|
|
+ :total="hisTotal"
|
|
|
+ @current-change="changeHisTablePage">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -99,8 +103,9 @@
|
|
|
|
|
|
<script>
|
|
|
import { Select, Input } from 'meri-design';
|
|
|
-import { querySystemList, queryEquipmentList, queryTableData } from '../../api/coreDeviceReport';
|
|
|
+import { querySystemList, queryEquipmentList, queryTableData, queryHistoryTableData } from '../../api/coreDeviceReport';
|
|
|
import _ from 'lodash';
|
|
|
+import moment from 'moment';
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
@@ -123,7 +128,16 @@ export default {
|
|
|
pageSize: 10, // 每页条数
|
|
|
tatol: 0, // 总数据
|
|
|
dialogTableVisible: false, // 弹窗显示状态
|
|
|
- dialogTime: '', // 弹框内的时间
|
|
|
+
|
|
|
+ // 核心设备实例
|
|
|
+ assetnum: null, // 设备台账编码
|
|
|
+ historyTableData: [], // 核心设备实例的所有历史事项信息
|
|
|
+ dialogTime: null, // 弹框内的时间
|
|
|
+ hisCurPage: 1, // 当前页码
|
|
|
+ hisPageSize: 10, // 当前页码
|
|
|
+ hisTotal: 0, // 总条数
|
|
|
+ startTime: null, // 开始时间
|
|
|
+ endTime: null, // 结束事件
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -157,9 +171,7 @@ export default {
|
|
|
})
|
|
|
this.systemList = newData;
|
|
|
}
|
|
|
- }).catch((err) => {
|
|
|
- console.err(err)
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
/**
|
|
|
* 切换系统名称
|
|
@@ -221,6 +233,60 @@ export default {
|
|
|
*/
|
|
|
showEquipmentStatus(row, column, e) {
|
|
|
this.dialogTableVisible = true;
|
|
|
+ this.assetnum = row.assetnum;
|
|
|
+ this.initTimePicker();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取核心设备实例的所有历史事项信息
|
|
|
+ */
|
|
|
+ getEquipmentHistoryMsg() {
|
|
|
+ this.historyTableData = [];
|
|
|
+ let param = {
|
|
|
+ page: this.hisCurPage,
|
|
|
+ size: this.hisPageSize,
|
|
|
+ // assetnum: this.assetnum,
|
|
|
+ assetnum: 8952,
|
|
|
+ // startDate: this.startTime,
|
|
|
+ startDate: 20180101000000,
|
|
|
+ // endDate: this.endTime
|
|
|
+ endDate: 20180201000000
|
|
|
+ }
|
|
|
+ queryHistoryTableData('/data/base/queryDateByAssetNum', param).then((res) => {
|
|
|
+ const { result, data, count } = res;
|
|
|
+ if (result === 'success') {
|
|
|
+ this.historyTableData = data;
|
|
|
+ this.hisTotal = count;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 初始化时间选择器
|
|
|
+ */
|
|
|
+ initTimePicker() {
|
|
|
+ let endTime = new Date(),
|
|
|
+ startTime = new Date(endTime.getTime() - 1000*60*60*24*30);
|
|
|
+ this.dialogTime = [startTime, endTime];
|
|
|
+ this.changeTime();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换时间
|
|
|
+ */
|
|
|
+ changeTime() {
|
|
|
+ this.hisCurPage = 1;
|
|
|
+ if (this.dialogTime) {
|
|
|
+ this.startTime = moment.unix(new Date(this.dialogTime[0]).getTime() / 1000).format('YYYYMMDDHHmmss');
|
|
|
+ this.endTime = moment.unix(new Date(this.dialogTime[1]).getTime() / 1000).format('YYYYMMDDHHmmss');
|
|
|
+ } else {
|
|
|
+ this.initTimePicker();
|
|
|
+ }
|
|
|
+ this.getEquipmentHistoryMsg();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换设备台账下所有历史事项信息页码
|
|
|
+ */
|
|
|
+ changeHisTablePage(page) {
|
|
|
+ this.hisCurPage = page;
|
|
|
+ this.getEquipmentHistoryMsg();
|
|
|
},
|
|
|
}
|
|
|
}
|