老产品前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

477 lines
13 KiB

3 years ago
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'110px'">
<div>
3 years ago
<el-form-item label="核酸检测时间"
label-width="110px"
prop="natStartDate">
<el-date-picker v-model="timeRange"
size="small"
3 years ago
type="daterange"
3 years ago
@change="handleTimeChange"
3 years ago
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
3 years ago
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="检测状态">
3 years ago
<el-select class="list_item_width_1"
size="small"
3 years ago
v-model.trim="formData.checkStatus"
3 years ago
placeholder="请选择">
3 years ago
<el-option v-for="item in statusList"
3 years ago
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
3 years ago
<el-form-item label="场所名称"
prop="placeOrgName">
<el-input v-model="formData.placeOrgName"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入场所名称">
</el-input>
3 years ago
3 years ago
</el-form-item>
<el-form-item label="场所类型"
prop="placeCategory">
<el-select class="item_width_1"
3 years ago
size="small"
3 years ago
v-model="formData.placeCategory"
placeholder="请选择"
clearable>
<el-option v-for="item in placeCategoryList"
3 years ago
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
3 years ago
3 years ago
</el-form-item>
3 years ago
<el-form-item label="姓名"
prop="name">
<el-input v-model="formData.name"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入姓名">
</el-input>
3 years ago
</el-form-item>
3 years ago
<el-form-item label="手机号"
prop="mobile">
<el-input v-model="formData.mobile"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入手机号">
</el-input>
3 years ago
</el-form-item>
3 years ago
<el-form-item label="证件号"
prop="idCard">
<el-input v-model="formData.idCard"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入身份证号或护照号">
</el-input>
3 years ago
3 years ago
</el-form-item>
<el-button style="margin-left:30px"
size="small"
class="diy-button--search"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
size="small"
class="diy-button--reset"
@click="resetSearch">重置</el-button>
3 years ago
</div>
3 years ago
3 years ago
</el-form>
</div>
<div class="div_table">
<el-table class="table"
ref="ref_table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
3 years ago
<el-table-column prop="placeOrgName"
3 years ago
header-align="center"
align="center"
label="场所名称"
3 years ago
min-width="120">
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="name"
header-align="center"
align="center"
label="姓名"
min-width="100">
</el-table-column>
<el-table-column prop="mobile"
header-align="center"
align="center"
label="手机号"
min-width="110">
</el-table-column>
<el-table-column prop="idCard"
header-align="center"
align="center"
label="证件号"
min-width="170">
</el-table-column>
3 years ago
<el-table-column prop="ymjzCount"
3 years ago
header-align="center"
align="center"
3 years ago
label="疫苗接种次数"
3 years ago
width="150">
</el-table-column>
3 years ago
3 years ago
<el-table-column prop="latestNatTime"
3 years ago
header-align="center"
align="center"
show-overflow-tooltip
3 years ago
label="最后一次核酸检测时间"
3 years ago
min-width="230">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="160"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
3 years ago
<el-button v-if="scope.row.agencyId===agencyId "
3 years ago
type="text"
class="div-table-button--delete "
size="small"
@click="handleDelete(scope.row)">删除</el-button>
3 years ago
<!-- <el-button type="text"
3 years ago
class="div-table-button--delete "
size="small"
3 years ago
@click="handleDelete(scope.row)">删除</el-button> -->
3 years ago
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
<!-- 详情弹出框 -->
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'详情'"
3 years ago
width="1350px"
3 years ago
top="5vh"
class="dialog-h"
@closed="diaDetailClose">
<staff-epid-detail ref="ref_detail"
@dialogCancle="diaDetailClose"></staff-epid-detail>
</el-dialog>
</div>
</template>
<script>
import staffEpidDetail from './staffEpidDetail'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // 引入Loading服务
let loading // 加载动画
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 20,
pageNo: 0,
tableLoading: false,
agencyId: '',
3 years ago
placeCategoryList: [
3 years ago
{
value: '0',
3 years ago
label: '九小场所'
3 years ago
},
{
value: '1',
3 years ago
label: '企事业单位'
}
],//场所类型list
statusList: [
{
value: '1',
label: '已检测'
3 years ago
},
3 years ago
{
value: '0',
label: '未检测'
}
3 years ago
],
3 years ago
3 years ago
timeRange: [],
3 years ago
3 years ago
formData: {
3 years ago
checkStatus: '',//检查状态,1:已检测;0:未检测
3 years ago
name: '',//姓名
mobile: '',//手机号
idCard: '',//身份证号码
3 years ago
natStartDate: '',//核酸检测开始日期,eg:2022-02-02
natEndDate: '',//核酸检测结束日期,eg:2022-02-02
placeOrgName: '',//场所名称
placeCategory: '',//场所类别:0九小场所、1企事业单位
3 years ago
},
tableData: [],
//form相关
3 years ago
3 years ago
detailShow: false,
3 years ago
// btnAuths: {
// employee_register_del : false, //删除
// employee_register_view_real_data: false, //显示脱敏信息
// },
3 years ago
}
},
components: {
staffEpidDetail
},
async created () {
},
async mounted () {
3 years ago
// this.updateBtnAuths();
3 years ago
const { user } = this.$store.state
this.agencyId = user.agencyId
await this.loadTable()
},
activated () {
this.$refs['ref_table'].doLayout()
},
methods: {
async handleSearch () {
await this.loadTable()
this.$nextTick(() => {
this.$refs.ref_table.doLayout() // 解决表格错位
})
},
async loadTable () {
this.tableLoading = true
3 years ago
const url = "/gov/org/icEmployeeRegister/list"
3 years ago
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/natlist"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
this.tableData.forEach(item => {
});
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
handleTimeChange (time) {
if (time) {
3 years ago
this.formData.natStartDate = time[0]
this.formData.natEndDate = time[1]
3 years ago
} else {
3 years ago
this.formData.natStartDate = ''
this.formData.natEndDate = ''
3 years ago
}
},
3 years ago
async handleDetail (row) {
3 years ago
3 years ago
this.detailShow = true
this.$nextTick(() => {
this.$refs.ref_detail.initForm(row.registerId)
})
3 years ago
},
3 years ago
3 years ago
diaDetailClose () {
this.detailShow = false
},
async handleDelete (row) {
let message = '确认删除?'
this.$confirm(message, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
3 years ago
this.deleteStaff(row)
3 years ago
})
.catch(err => {
});
},
3 years ago
async deleteStaff (row) {
const url = "/gov/org/icEmployeeRegister/delete"
3 years ago
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/del"
3 years ago
let params = [row.registerId]
3 years ago
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "操作成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//重置搜索条件
resetSearch () {
this.formData = {
3 years ago
checkStatus: '',//检查状态,1:已检测;0:未检测
3 years ago
name: '',//姓名
mobile: '',//手机号
idCard: '',//身份证号码
3 years ago
natStartDate: '',//核酸检测开始日期,eg:2022-02-02
natEndDate: '',//核酸检测结束日期,eg:2022-02-02
placeOrgName: '',//场所名称
placeCategory: '',//场所类别:0九小场所、1企事业单位
3 years ago
}
this.timeRange = []
3 years ago
3 years ago
this.pageNo = 0
// this.loadTable()
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
// 开启加载动画
startLoading () {
loading = Loading.service({
lock: true, // 是否锁定
text: '正在加载……', // 加载中需要显示的文字
background: 'rgba(0,0,0,.7)' // 背景颜色
})
},
// 结束加载动画
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
3 years ago
return this.$store.state.inIframe ? this.clientHeight - 370 + this.iframeHeight : this.clientHeight - 370
3 years ago
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/epidemic.scss";
</style>