|
|
<template>
|
|
|
<section>
|
|
|
<!--工具条-->
|
|
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
|
<el-form :inline="true" :model="filters">
|
|
|
<el-form-item>
|
|
|
<el-input v-model="filters.warchkeeper" placeholder="值班人员名称"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" v-on:click="getMaintainList()">查询</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="companyAdd">新增</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
|
|
|
<!--列表-->
|
|
|
<el-table :data="securityInspectionList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;">
|
|
|
<el-table-column type="selection" width="55">
|
|
|
</el-table-column>
|
|
|
<el-table-column type="index">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="id" v-if="false" label="ID" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="warchkeeper" label="值班人员" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="handovershifttime" label="交班时间" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="publiclighting" label="公共照明" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="carpark" label="车辆停放" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="campusafforestation" label="院区绿化" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="firefightingequipment" label="消防设备" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="equipmentfacilities" label="设施设备" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="publicsanitation" label="公共卫生" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="property" label="物业" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="securitydanger" label="安全隐患" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="rests" label="其他" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="handovermatters" label="交班事项" sortable>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" min-width="150">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
|
|
<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<!--工具条-->
|
|
|
<el-col :span="24" class="toolbar">
|
|
|
<el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button>
|
|
|
<el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;">
|
|
|
</el-pagination>
|
|
|
</el-col>
|
|
|
|
|
|
<!--编辑界面-->
|
|
|
<el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false">
|
|
|
<el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm">
|
|
|
<el-form-item label="ID">
|
|
|
<span>{{editForm.id}}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="值班人员" prop="warchkeeper">
|
|
|
<el-input v-model="editForm.warchkeeper" auto-complete="off" placeholder="请输入值班人员"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="交班时间" prop="handovershifttime">
|
|
|
<el-date-picker
|
|
|
v-model="editForm.handovershifttime"
|
|
|
type="date"
|
|
|
format="yyyy-MM-dd HH:mm:ss"
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="选择日期时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="公共照明" prop="publiclighting">
|
|
|
<el-input v-model="editForm.publiclighting" auto-complete="off" placeholder="请输入公共照明"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="车辆停放" prop="carpark">
|
|
|
<el-input v-model="editForm.carpark" auto-complete="off" placeholder="请输入车辆停放"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="院区绿化" prop="campusafforestation">
|
|
|
<el-input v-model="editForm.campusafforestation" auto-complete="off" placeholder="请输入院区绿化"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="消防设备" prop="firefightingequipment">
|
|
|
<el-input v-model="editForm.firefightingequipment" auto-complete="off" placeholder="请输入消防设备"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设施设备" prop="equipmentfacilities">
|
|
|
<el-input v-model="editForm.equipmentfacilities" auto-complete="off" placeholder="请输入设施设备"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="公共卫生" prop="publicsanitation">
|
|
|
<el-input v-model="editForm.publicsanitation" auto-complete="off" placeholder="请输入公共卫生"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="物业" prop="property">
|
|
|
<el-input v-model="editForm.property" auto-complete="off" placeholder="请输入物业"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="安全隐患" prop="securitydanger">
|
|
|
<el-input v-model="editForm.securitydanger" auto-complete="off" placeholder="请输入安全隐患"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="其他" prop="rests">
|
|
|
<el-input v-model="editForm.rests" auto-complete="off" placeholder="请输入其他"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="交接事项" prop="handovermatters">
|
|
|
<el-input v-model="editForm.handovermatters" auto-complete="off" placeholder="请输入交接事项"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click.native="editFormVisible = false">取消</el-button>
|
|
|
<el-button type="primary" @click.native="editSubmit" :loading="false">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
<!--新增界面-->
|
|
|
<el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false">
|
|
|
<el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm">
|
|
|
<el-form-item label="值班人员" prop="warchkeeper">
|
|
|
<el-input v-model="addForm.warchkeeper" auto-complete="off" placeholder="请输入值班人员"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="交班时间" prop="handovershifttime">
|
|
|
<el-date-picker
|
|
|
v-model="addForm.handovershifttime"
|
|
|
type="date"
|
|
|
format="yyyy-MM-dd HH:mm:ss"
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="选择日期时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="公共照明" prop="publiclighting">
|
|
|
<el-input v-model="addForm.publiclighting" auto-complete="off" placeholder="请输入公共照明"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="车辆停放" prop="carpark">
|
|
|
<el-input v-model="addForm.carpark" auto-complete="off" placeholder="请输入车辆停放"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="院区绿化" prop="campusafforestation">
|
|
|
<el-input v-model="addForm.campusafforestation" auto-complete="off" placeholder="请输入院区绿化"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="消防设备" prop="firefightingequipment">
|
|
|
<el-input v-model="addForm.firefightingequipment" auto-complete="off" placeholder="请输入消防设备"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设施设备" prop="equipmentfacilities">
|
|
|
<el-input v-model="addForm.equipmentfacilities" auto-complete="off" placeholder="请输入设施设备"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="公共卫生" prop="publicsanitation">
|
|
|
<el-input v-model="addForm.publicsanitation" auto-complete="off" placeholder="请输入公共卫生"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="物业" prop="property">
|
|
|
<el-input v-model="addForm.property" auto-complete="off" placeholder="请输入物业"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="安全隐患" prop="securitydanger">
|
|
|
<el-input v-model="addForm.securitydanger" auto-complete="off" placeholder="请输入安全隐患"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="其他" prop="rests">
|
|
|
<el-input v-model="addForm.rests" auto-complete="off" placeholder="请输入其他"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="交接事项" prop="handovermatters">
|
|
|
<el-input v-model="addForm.handovermatters" auto-complete="off" placeholder="请输入交接事项"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click.native="addFormVisible = false">取消</el-button>
|
|
|
<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import util from '../../common/js/util'
|
|
|
import NProgress from 'nprogress'
|
|
|
import { getList, remove, batchRemove, edit, add } from '../../api/staff/on_duty';
|
|
|
import moment from 'moment'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
filters: {
|
|
|
warchkeeper: ''
|
|
|
},
|
|
|
userid: '',
|
|
|
securityInspectionList: [],
|
|
|
total: 0,
|
|
|
pageNum: 1,
|
|
|
pageSize: 5,
|
|
|
listLoading: false,
|
|
|
sels: [],//列表选中列
|
|
|
//编辑界面是否显示
|
|
|
editFormVisible: false,
|
|
|
editLoading: false,
|
|
|
editFormRules: {
|
|
|
repairscontent: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
reflectway: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
repairsdept: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
repairsname: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
answerthephonename: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
repairsphone: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
maintaincase: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
cooperatemaintainname: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
meno: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
},
|
|
|
//编辑界面数据
|
|
|
editForm: {
|
|
|
id:'',
|
|
|
warchkeeper: '',
|
|
|
handovershifttime: '',
|
|
|
publiclighting: '',
|
|
|
carpark: '',
|
|
|
campusafforestation: '',
|
|
|
firefightingequipment: '',
|
|
|
equipmentfacilities: '',
|
|
|
publicsanitation: '',
|
|
|
property: '',
|
|
|
securitydanger: '',
|
|
|
rests:"",
|
|
|
handovermatters:""
|
|
|
|
|
|
},
|
|
|
//新增界面是否显示
|
|
|
addFormVisible: false,
|
|
|
addLoading: false,
|
|
|
addFormRules: {
|
|
|
repairscontent: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
reflectway: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
repairsdept: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
repairsname: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
answerthephonename: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
repairsphone: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
maintaincase: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
cooperatemaintainname: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
meno: [
|
|
|
{ required: true, message: '不能为空!!!', trigger: 'blur' }
|
|
|
],
|
|
|
},
|
|
|
|
|
|
//新增界面数据
|
|
|
addForm: {
|
|
|
warchkeeper: '',
|
|
|
handovershifttime: '',
|
|
|
publiclighting: '',
|
|
|
carpark: '',
|
|
|
campusafforestation: '',
|
|
|
firefightingequipment: '',
|
|
|
equipmentfacilities: '',
|
|
|
publicsanitation: '',
|
|
|
property: '',
|
|
|
securitydanger: '',
|
|
|
rests:"",
|
|
|
handovermatters:"",
|
|
|
userid: this.userid
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.userid = JSON.parse(sessionStorage.getItem('user')).userId;
|
|
|
this.getMaintainList();
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
handleCurrentChange(val) {
|
|
|
this.pageNum = val;
|
|
|
this.getMaintainList();
|
|
|
},
|
|
|
//获取公司列表
|
|
|
getMaintainList() {
|
|
|
let para = {
|
|
|
pageNum: this.pageNum,
|
|
|
pageSize: this.pageSize,
|
|
|
warchkeeper: this.filters.warchkeeper
|
|
|
};
|
|
|
this.listLoading = true;
|
|
|
getList(para).then((res) => {
|
|
|
this.total = res.data.total;
|
|
|
this.securityInspectionList = res.data.list;
|
|
|
this.listLoading = false;
|
|
|
//NProgress.done();
|
|
|
}).catch((error) => {
|
|
|
|
|
|
this.listLoading = false;
|
|
|
if(null!= error.response && error.response!==undefined){
|
|
|
let status= error.response.status;
|
|
|
let msg = error.response.statusText;
|
|
|
alert(status+msg);
|
|
|
}else {
|
|
|
alert(error);
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
//删除
|
|
|
handleDel: function (index, row) {
|
|
|
this.$confirm('确认删除该记录吗?', '提示', {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.listLoading = true;
|
|
|
//NProgress.start();
|
|
|
let para = { id: row.id };
|
|
|
remove(para).then((res) => {
|
|
|
this.listLoading = false;
|
|
|
//NProgress.done();
|
|
|
this.$message({
|
|
|
message: '删除成功',
|
|
|
type: 'success'
|
|
|
});
|
|
|
this.getMaintainList();
|
|
|
}).catch((error) => {
|
|
|
this.listLoading = false;
|
|
|
alert(error);
|
|
|
});
|
|
|
}).catch();
|
|
|
},
|
|
|
/**
|
|
|
* 显示编辑界面
|
|
|
* @param index
|
|
|
* @param row 为这行的数据对象
|
|
|
*/
|
|
|
handleEdit: function (index, row) {
|
|
|
this.editFormVisible = true;
|
|
|
this.editForm = Object.assign({}, row);
|
|
|
this.getMaintainList();
|
|
|
},
|
|
|
//显示新增界面,每次点开初始化数据
|
|
|
companyAdd: function () {
|
|
|
this.addFormVisible = true;
|
|
|
this.addForm = {
|
|
|
userid: this.userid
|
|
|
};
|
|
|
this.getMaintainList();
|
|
|
},
|
|
|
|
|
|
//新增
|
|
|
addSubmit: function () {
|
|
|
this.$refs.addForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.$confirm('确认提交吗?', '提示', {}).then(() => {
|
|
|
//NProgress.start();
|
|
|
this.listLoading = true;
|
|
|
let para = Object.assign({}, this.addForm);
|
|
|
add(para).then((res) => {
|
|
|
this.addLoading = false;
|
|
|
//NProgress.done();
|
|
|
this.$message({
|
|
|
message: '提交成功',
|
|
|
type: 'success'
|
|
|
});
|
|
|
this.$refs['addForm'].resetFields();
|
|
|
this.addFormVisible = false;
|
|
|
this.getMaintainList();
|
|
|
}).catch(error => alert(error));
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
//编辑
|
|
|
editSubmit: function () {
|
|
|
this.$refs.editForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.$confirm('确认提交吗?', '提示', {}).then(() => {
|
|
|
this.editLoading = true;
|
|
|
let para = Object.assign({}, this.editForm);
|
|
|
this.editLoading = true;
|
|
|
edit(para).then((res) => {
|
|
|
|
|
|
this.$message({
|
|
|
message: '提交成功',
|
|
|
type: 'success'
|
|
|
});
|
|
|
this.$refs['editForm'].resetFields();
|
|
|
this.editFormVisible = false;
|
|
|
this.getMaintainList();
|
|
|
}).catch(error => alert(error));
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
selsChange: function (sels) {
|
|
|
this.sels = sels;
|
|
|
},
|
|
|
//批量删除
|
|
|
batchRemove: function () {
|
|
|
var ids = this.sels.map(item => item.id).toString();
|
|
|
this.$confirm('确认删除选中记录吗?', '提示', {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.listLoading = true;
|
|
|
//NProgress.start();
|
|
|
let para = { ids: ids };
|
|
|
batchRemove(para).then((res) => {
|
|
|
this.listLoading = false;
|
|
|
//NProgress.done();
|
|
|
this.$message({
|
|
|
message: '删除成功',
|
|
|
type: 'success'
|
|
|
});
|
|
|
this.getMaintainList();
|
|
|
});
|
|
|
}).catch(() => {
|
|
|
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
|
|
|
}
|
|
|
</script> |
|
|
\ No newline at end of file |
...
|
...
|
|