qa-prevention-xgf-app/pages/eight_assignments/electricity/gas/list.vue

95 lines
2.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view class="content">
<view v-if="isView !== '1'" class="flex-end padding" style="padding: 20upx;">
<u-button type="primary" text="添加" size="mini" class="bth-mini" @click="goToAdd"/>
</view>
<u-list v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index">
<view class="flex-between main-title">
<text>动火分析时间: {{ item.ANALYZE_TIME }}</text>
</view>
<view class="flex-between main-title">
<text>分析点名称: {{ item.ANALYZE_PLACE }}</text>
</view>
<view class="flex-between main-title">
<text>分析数据(%LEL): {{ item.ANALYZE_PLACE }}</text>
</view>
<view class="flex-between main-title">
<text>分析人{{ item.ANALYZE_USER_NAME }}</text>
</view>
<view v-if="isView !== '1'" class="flex-between mt-10 subtitle">
<view></view>
<view class="flex-between">
<u-button type="error" text="删除" size="mini" class="bth-mini" @click="fnDelete(item)"/>
</view>
</view>
</u-list-item>
</u-list>
<empty v-else></empty>
</view>
</template>
<script>
import {getHotWorkGasInfo, getHotWorkGasDelete} from "@/api";
import {getHotWorkGasAll} from "../../../../api";
export default {
data() {
return {
list: [],
EW_RU_TASK_ID: '',
EW_RU_JOB_ID: '',
TYPE: '',
isView: '0'
}
},
onLoad(query) {
this.EW_RU_TASK_ID = query.taskId
this.TYPE = query.type
this.EW_RU_JOB_ID = query.EW_RU_JOB_ID
this.isView = query.isView
},
onShow() {
this.resetList()
},
methods: {
async getData() {
let resData = await getHotWorkGasAll({
EW_RU_TASK_ID: this.EW_RU_TASK_ID,
EW_RU_JOB_ID: this.EW_RU_JOB_ID,
});
this.list = [...this.list, ...resData.list];
},
resetList() {
this.list = []
this.getData()
},
fnDelete(item) {
uni.showModal({
title: '提示',
content: '确定要删除这条记录?',
success: async res => {
if (res.confirm) {
await getHotWorkGasDelete({
EW_SP_EG_ID: item.EW_SP_EG_ID
})
uni.$u.toast('删除成功')
this.resetList()
}
}
})
},
goToAdd() {
uni.$u.route({
url: '/pages/eight_assignments/hot_work/gas/add',
params: {
EW_RU_TASK_ID: this.EW_RU_TASK_ID,
EW_RU_JOB_ID: this.EW_RU_JOB_ID,
TYPE: this.TYPE
}
})
}
}
}
</script>