|
@@ -133,7 +133,19 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <div class="section-title">Intermediate Meter Values</div>
|
|
|
|
|
|
|
+ <div class="flexcwr">
|
|
|
|
|
+ <div class="section-title">Intermediate Meter Values</div>
|
|
|
|
|
+ <el-select v-model="measurand" @change="getDeatil">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ value=""
|
|
|
|
|
+ label="All"/>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="(item, index) in optionsMeasurand"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :value="item"
|
|
|
|
|
+ :label="item"/>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </div>
|
|
|
<el-table fit :data="listData">
|
|
<el-table fit :data="listData">
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="Timestamp"
|
|
label="Timestamp"
|
|
@@ -228,33 +240,50 @@
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
details: {},
|
|
details: {},
|
|
|
listData: [],
|
|
listData: [],
|
|
|
- loading: true
|
|
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ measurand: "",
|
|
|
|
|
+ optionsMeasurand: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
|
|
+ this.getMeasuOptions()
|
|
|
this.getDeatil()
|
|
this.getDeatil()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- async getDeatil() {
|
|
|
|
|
- try {
|
|
|
|
|
- const data = await api.getTransactionDetail(this.$route.params.id)
|
|
|
|
|
- if (data.success) {
|
|
|
|
|
- this.details = data.data
|
|
|
|
|
|
|
+ getMeasuOptions() {
|
|
|
|
|
+ api.getMeasurandOptions().then(res => {
|
|
|
|
|
+ if (res.data) {
|
|
|
|
|
+ this.optionsMeasurand = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ getDeatil() {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ api.getTransactionDetail({
|
|
|
|
|
+ transactionPk: this.$route.params.id,
|
|
|
|
|
+ measurand: this.measurand
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if (res.data) {
|
|
|
|
|
+ this.details = res.data
|
|
|
if (this.details.duration) {
|
|
if (this.details.duration) {
|
|
|
this.details.duration = Number((this.details.duration * 60).toFixed(2))
|
|
this.details.duration = Number((this.details.duration * 60).toFixed(2))
|
|
|
}
|
|
}
|
|
|
if (this.details.transactionMeters && this.details.transactionMeters.length) {
|
|
if (this.details.transactionMeters && this.details.transactionMeters.length) {
|
|
|
this.handlePageChange()
|
|
this.handlePageChange()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.listData = []
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- this.loading = false
|
|
|
|
|
- } catch(e) {
|
|
|
|
|
- this.loading = false
|
|
|
|
|
|
|
+ }).catch(err => {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: 'error',
|
|
type: 'error',
|
|
|
- message: e
|
|
|
|
|
|
|
+ message: err
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
handlePageChange() {
|
|
handlePageChange() {
|
|
|
this.listData = []
|
|
this.listData = []
|