兴安优化-人员下发记录
This commit is contained in:
28
src/api/system/eqDown.js
Normal file
28
src/api/system/eqDown.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询下发记录列表
|
||||
export function pageList(query) {
|
||||
return request({
|
||||
url: '/system/sysEqDownRecord/pageList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询下发记录详细
|
||||
export function getDownRecord(id) {
|
||||
return request({
|
||||
url: '/system/sysEqDownRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增下发记录
|
||||
export function down(data) {
|
||||
return request({
|
||||
url: '/system/sysEqDownRecord/down',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
250
src/views/system/eqDown/index.vue
Normal file
250
src/views/system/eqDown/index.vue
Normal file
@@ -0,0 +1,250 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="姓名" prop="peopleName">
|
||||
<el-input
|
||||
v-model="queryParams.peopleName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select filterable v-model="queryParams.equipmentId" placeholder="请选择" clearable @keyup.enter.native="handleQuery" >
|
||||
<el-option
|
||||
v-for="item in equipmentOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDown"
|
||||
v-hasPermi="['system:eqDown:down']"
|
||||
>重新下发</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:empowerRecord:export']"
|
||||
>导出</el-button>
|
||||
</el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="eqDownList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="姓名" align="center" prop="name" min-width="100">
|
||||
<template v-slot="scope">
|
||||
{{scope.row.peopleName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备名称" align="center" prop="equipmentName" >
|
||||
<template v-slot="scope">
|
||||
{{scope.row.equipmentName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="信息下发" align="center" prop="infoDown" >
|
||||
<template v-slot="scope">
|
||||
<template v-if="scope.row.downResult===1">
|
||||
失败
|
||||
</template>
|
||||
<template v-if="scope.row.downResult===0">
|
||||
成功
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="照片下发" align="center" prop="peopleId" min-width="100">
|
||||
<template v-slot="scope">
|
||||
<el-image style="width: 80px; height: 80px" :src="scope.row.avatar" fit="cover"
|
||||
:preview-src-list="[scope.row.avatar]"
|
||||
/>
|
||||
<div class="published-div" v-if="scope.row.downResult===0">
|
||||
<el-button type="success" icon="el-icon-check" size="mini" circle></el-button>
|
||||
</div>
|
||||
<div class="published-div" v-if="scope.row.downResult===1">
|
||||
<el-button type="danger" icon="el-icon-close" size="mini" circle></el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作类型" align="center" prop="equipmentName" >
|
||||
<template v-slot="scope">
|
||||
<template v-if="scope.row.operType===0">
|
||||
新增
|
||||
</template>
|
||||
<template v-if="scope.row.operType===1">
|
||||
修改
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="下发回执" align="center" prop="equipmentName" >
|
||||
<template v-slot="scope">
|
||||
{{scope.row.msg}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" min-width="100">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-download"
|
||||
@click="handleDown(scope.row)"
|
||||
v-hasPermi="['system:eqDown:down']"
|
||||
>重新下发</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {alllistEquipment} from "@/api/system/equipment";
|
||||
import {listSysPeople} from "@/api/system/sysPeople";
|
||||
import {down, pageList} from "@/api/system/eqDown";
|
||||
import {forbidRecordApi} from "@/api/system/empowerRecord";
|
||||
|
||||
export default {
|
||||
name: "EmpowerRecord",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 授权记录表格数据
|
||||
eqDownList: [],
|
||||
equipmentOptions:[],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
peopleName: null,
|
||||
equipmentId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
/** 查询选项列表 */
|
||||
getOptions() {
|
||||
alllistEquipment({productId: 3}).then(response => {
|
||||
this.equipmentOptions = response.data
|
||||
})
|
||||
},
|
||||
/** 查询授权记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
pageList(this.queryParams).then(response => {
|
||||
this.eqDownList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
||||
/** 重新下发按钮操作 */
|
||||
handleDown(row) {
|
||||
const ids = row.id ? [row.id] : this.ids;
|
||||
if (!ids.length) {
|
||||
this.$modal.msgError("请选择要重新下发的记录!");
|
||||
return;
|
||||
}
|
||||
const title = row.peopleName ? row.peopleName : ids.length + "条数据";
|
||||
this.$modal.confirm('是否确定要重新下发' + title + '?').then(function() {
|
||||
return down(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("重新下发成功!");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/empowerRecord/export', {
|
||||
...this.queryParams
|
||||
}, `empowerRecord_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
||||
.published-div {
|
||||
position: absolute;
|
||||
top: 70px;
|
||||
right: 150px;
|
||||
}
|
||||
.el-button--mini.is-circle {
|
||||
padding: 2px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user