parent
8c2ca4d850
commit
fbe8ca6b6c
@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="header-custom">
|
||||
<el-date-picker
|
||||
v-model="start_time"
|
||||
clearable
|
||||
type="datetime"
|
||||
placeholder="选择生产日期"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="end_time"
|
||||
clearable
|
||||
type="datetime"
|
||||
placeholder="选择过期日期"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-select v-model="object_type" clearable placeholder="请选择预警信息类型">
|
||||
<el-option
|
||||
v-for="(item,index) in warning_data_map"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="index + 1"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-model="seach_word" clearable placeholder="请输入搜索预警信息" />
|
||||
<el-button :disabled="loadingReagent" type="primary" icon="el-icon-search" @click="searchData">搜索</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loadingReagent"
|
||||
:data="gridData"
|
||||
stripe
|
||||
height="400"
|
||||
element-loading-text="拼命加载中"
|
||||
:header-cell-style="headerStyle"
|
||||
>
|
||||
<el-table-column
|
||||
align="center"
|
||||
type="index"
|
||||
width="50"
|
||||
label="序号"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="warning_date"
|
||||
label="预警时间"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="object_type"
|
||||
label="预警信息类型"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ warning_data_map[scope.row.object_type - 1] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="object_name"
|
||||
label="对象"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
prop="warning_content"
|
||||
label="内容"
|
||||
/>
|
||||
</el-table>
|
||||
<div class="my-pagination" style="text-align: center">
|
||||
<el-pagination
|
||||
background
|
||||
layout="prev, pager, next"
|
||||
:disabled="loadingReagent"
|
||||
:current-page.sync="page"
|
||||
:total="total"
|
||||
:page-size.sync="page_size"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
<el-dialog
|
||||
width="50%"
|
||||
title="预警详情"
|
||||
:visible.sync="innerVisible"
|
||||
append-to-body
|
||||
>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="预警对象" span="2">{{ rowData.object_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预警内容" span="2">{{ rowData.warning_content }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预警类型">{{ warning_data_map[rowData.object_type - 1] }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预警来源">{{ rowData.object_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="最后使用人">
|
||||
<el-tag>{{ rowData.warning_user_name }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div style="text-align: center;margin-top: 20px">
|
||||
<el-button type="primary" @click="innerVisible=false">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import { home_warning_list } from '@/api/reagent/overView'
|
||||
import stringify from '@/utils/stringify'
|
||||
export default {
|
||||
name:'WaringListView',
|
||||
data() {
|
||||
return {
|
||||
headerStyle: { 'background': '#E6E6E6' },
|
||||
rowData: {},
|
||||
gridData: [],
|
||||
seach_word: '',
|
||||
page: 1,
|
||||
total: 0,
|
||||
page_size: 15,
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
object_type: '',
|
||||
innerVisible: false,
|
||||
loadingReagent: false,
|
||||
dialogTableVisible: false,
|
||||
warning_data_map: ['试剂临期', '试剂过期', '余量不足', '环境异常', '出库临期', '出库超期', '未称重'],
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getWarnList()
|
||||
},
|
||||
methods: {
|
||||
getWarnList() {
|
||||
const data = {
|
||||
'seach_word': this.seach_word,
|
||||
'object_type': this.object_type,
|
||||
'start_time': this.start_time,
|
||||
'end_time': this.end_time,
|
||||
'page': this.page,
|
||||
'page_size': this.page_size
|
||||
}
|
||||
this.loadingReagent = true
|
||||
home_warning_list(stringify(data)).then(res => {
|
||||
this.gridData = res.data.data_list
|
||||
this.total = res.data.total_count
|
||||
}).finally(() => (this.loadingReagent = false))
|
||||
},
|
||||
pageChange(page) {
|
||||
this.page = page
|
||||
this.getWarnList()
|
||||
},
|
||||
|
||||
searchData() {
|
||||
this.getWarnList()
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.header-custom {
|
||||
margin-bottom: 1rem;
|
||||
|
||||
.el-input {
|
||||
width: 12.5rem;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue