fix: 智能安全帽和机械设备定位页面开发

This commit is contained in:
vce 2024-03-20 22:28:24 +08:00
parent 68f9c20d9a
commit 9080b1b85d
15 changed files with 404 additions and 575 deletions

View File

@ -11,7 +11,7 @@ var COMPANY = '' //通用
// COMPANY = 'hengtong'//瑞士恒通
// COMPANY = 'yunlian'//云联万物
// COMPANY = 'neimenggu'//内蒙古项目
COMPANY = 'zjsj'//中建四局
// COMPANY = 'zjsj'//中建四局
// COMPANY = 'zjwj'//中建五局
// COMPANY = 'sccr'//四川成润
// COMPANY = 'pssh'//坪山沙湖项目
@ -26,7 +26,7 @@ var PROJECT = {
online_gxlt: 'gxlt', // 广西联通
}
var PROJECT_TYPE = PROJECT.online_zjsj
var PROJECT_TYPE = PROJECT.local_test
var headerShow = true // 是否显示头部
var tabsShow = true // 是否显示tabs
if (COMPANY == 'xingxuan') {

View File

@ -1,49 +0,0 @@
/* 劳务管理-工资发放 */
import { post, get } from '../../http'
import axios from 'axios'
// 企业列表
export function enterpriseList (data) {
return post('xmgl/enterpriseInfo/selectHierarchyEnterpriseList', data)
}
// 班组列表
export function teamList(data) {
return post('xmgl/teamInfo/getTeamInfoList', data);
}
// 部门列表
export function departmentList(data) {
return post('xmgl/departmentInfo/getDepartmentInfoList', data);
}
// 分页查询工资发放记录信息
export function payrollRecord(data) {
return post('xmgl/workerWagesPayment/selectWorkerWagesPaymentPageList', data);
}
// 通过id查询工资发放详情信息
export function payrollRecordDetailById(data) {
return post('xmgl/workerWagesPayment/queryById', data);
}
// 导出人员工资pdf
export function exportSalaryPdf(params) {
window.location.href = axios.defaults.baseURL +`xmgl/workerWagesPayment/salaryPdf?projectSn=${params.projectSn}&teamId=${params.teamId||''}&departmentId=${params.departmentId||''}&payMonth=${params.payMonth||''}&payStatus=${params.payStatus||''}&userEnterpriseId=${params.enterpriseId||''}`;
}
// 导出工资列表excel
export function exportSalaryExcel(params) {
window.location.href = axios.defaults.baseURL +`xmgl/workerWagesPayment/excelProjectWages?projectSn=${params.projectSn}&teamId=${params.teamId||''}&departmentId=${params.departmentId||''}&payMonth=${params.payMonth||''}&payStatus=${params.payStatus||''}&userEnterpriseId=${params.enterpriseId||''}`;
}
// 导入工资列表excel
export function importWagesPaymentExcel(data) {
return post('xmgl/workerWagesPayment/uploadWagesPaymentExcel', data);
}
// 编辑工资发放记录信息
export function updateWorkerWagesPayment(data) {
return post('xmgl/workerWagesPayment/updateWorkerWagesPayment', data);
}

View File

@ -0,0 +1,23 @@
/* 劳务管理-工资发放 */
import { post, get } from '../../http'
import axios from 'axios'
// 机械设备定位--数据台账--分页查询记录信息
export const getEquipmentPayDataPageApi = data => get('/xmgl/mechanicalEquipmentPositionData/page',data);
// 机械设备定位--报警记录--分页查询记录信息
export const getEquipmentAlarmRecordPageApi = data => get('/xmgl/mechanicalEquipmentPositionAlarm/page',data);
// 机械设备定位--设备列表条件--分页查询记录信息
export const getEquipmentListApi = data => get('/xmgl/mechanicalEquipmentPositionDev/list',data);
// 机械设备定位--查询司机
export const getWorkerInfoListApi = data => post('xmgl/workerInfo/selectWorkerInfoList', data);
// 机械设备定位--设备中台--分页查询记录信息
export const getDeviceCentraliceCentralPageApi = data => get('/xmgl/mechanicalEquipmentPositionDev/page',data);
// 机械设备定位--设备中台--添加记录信息
export const addDeviceCentraliceCentralPageApi = data => post('/xmgl/mechanicalEquipmentPositionDev/add',data);
// 机械设备定位--设备中台--修改记录信息
export const editDeviceCentraliceCentralPageApi = data => post('/xmgl/mechanicalEquipmentPositionDev/edit',data);
// 机械设备定位--设备中台--删除记录信息
export const deleteDeviceCentraliceCentralPageApi = data => post('/xmgl/mechanicalEquipmentPositionDev/delete',data);

View File

@ -1,49 +0,0 @@
/* 劳务管理-工资发放 */
import { post, get } from '../../http'
import axios from 'axios'
// 企业列表
export function enterpriseList (data) {
return post('xmgl/enterpriseInfo/selectHierarchyEnterpriseList', data)
}
// 班组列表
export function teamList(data) {
return post('xmgl/teamInfo/getTeamInfoList', data);
}
// 部门列表
export function departmentList(data) {
return post('xmgl/departmentInfo/getDepartmentInfoList', data);
}
// 分页查询工资发放记录信息
export function payrollRecord(data) {
return post('xmgl/workerWagesPayment/selectWorkerWagesPaymentPageList', data);
}
// 通过id查询工资发放详情信息
export function payrollRecordDetailById(data) {
return post('xmgl/workerWagesPayment/queryById', data);
}
// 导出人员工资pdf
export function exportSalaryPdf(params) {
window.location.href = axios.defaults.baseURL +`xmgl/workerWagesPayment/salaryPdf?projectSn=${params.projectSn}&teamId=${params.teamId||''}&departmentId=${params.departmentId||''}&payMonth=${params.payMonth||''}&payStatus=${params.payStatus||''}&userEnterpriseId=${params.enterpriseId||''}`;
}
// 导出工资列表excel
export function exportSalaryExcel(params) {
window.location.href = axios.defaults.baseURL +`xmgl/workerWagesPayment/excelProjectWages?projectSn=${params.projectSn}&teamId=${params.teamId||''}&departmentId=${params.departmentId||''}&payMonth=${params.payMonth||''}&payStatus=${params.payStatus||''}&userEnterpriseId=${params.enterpriseId||''}`;
}
// 导入工资列表excel
export function importWagesPaymentExcel(data) {
return post('xmgl/workerWagesPayment/uploadWagesPaymentExcel', data);
}
// 编辑工资发放记录信息
export function updateWorkerWagesPayment(data) {
return post('xmgl/workerWagesPayment/updateWorkerWagesPayment', data);
}

View File

@ -1,49 +0,0 @@
/* 劳务管理-工资发放 */
import { post, get } from '../../http'
import axios from 'axios'
// 企业列表
export function enterpriseList (data) {
return post('xmgl/enterpriseInfo/selectHierarchyEnterpriseList', data)
}
// 班组列表
export function teamList(data) {
return post('xmgl/teamInfo/getTeamInfoList', data);
}
// 部门列表
export function departmentList(data) {
return post('xmgl/departmentInfo/getDepartmentInfoList', data);
}
// 分页查询工资发放记录信息
export function payrollRecord(data) {
return post('xmgl/workerWagesPayment/selectWorkerWagesPaymentPageList', data);
}
// 通过id查询工资发放详情信息
export function payrollRecordDetailById(data) {
return post('xmgl/workerWagesPayment/queryById', data);
}
// 导出人员工资pdf
export function exportSalaryPdf(params) {
window.location.href = axios.defaults.baseURL +`xmgl/workerWagesPayment/salaryPdf?projectSn=${params.projectSn}&teamId=${params.teamId||''}&departmentId=${params.departmentId||''}&payMonth=${params.payMonth||''}&payStatus=${params.payStatus||''}&userEnterpriseId=${params.enterpriseId||''}`;
}
// 导出工资列表excel
export function exportSalaryExcel(params) {
window.location.href = axios.defaults.baseURL +`xmgl/workerWagesPayment/excelProjectWages?projectSn=${params.projectSn}&teamId=${params.teamId||''}&departmentId=${params.departmentId||''}&payMonth=${params.payMonth||''}&payStatus=${params.payStatus||''}&userEnterpriseId=${params.enterpriseId||''}`;
}
// 导入工资列表excel
export function importWagesPaymentExcel(data) {
return post('xmgl/workerWagesPayment/uploadWagesPaymentExcel', data);
}
// 编辑工资发放记录信息
export function updateWorkerWagesPayment(data) {
return post('xmgl/workerWagesPayment/updateWorkerWagesPayment', data);
}

View File

@ -1,49 +0,0 @@
/* 劳务管理-工资发放 */
import { post, get } from '../../http'
import axios from 'axios'
// 企业列表
export function enterpriseList (data) {
return post('xmgl/enterpriseInfo/selectHierarchyEnterpriseList', data)
}
// 班组列表
export function teamList(data) {
return post('xmgl/teamInfo/getTeamInfoList', data);
}
// 部门列表
export function departmentList(data) {
return post('xmgl/departmentInfo/getDepartmentInfoList', data);
}
// 分页查询工资发放记录信息
export function payrollRecord(data) {
return post('xmgl/workerWagesPayment/selectWorkerWagesPaymentPageList', data);
}
// 通过id查询工资发放详情信息
export function payrollRecordDetailById(data) {
return post('xmgl/workerWagesPayment/queryById', data);
}
// 导出人员工资pdf
export function exportSalaryPdf(params) {
window.location.href = axios.defaults.baseURL +`xmgl/workerWagesPayment/salaryPdf?projectSn=${params.projectSn}&teamId=${params.teamId||''}&departmentId=${params.departmentId||''}&payMonth=${params.payMonth||''}&payStatus=${params.payStatus||''}&userEnterpriseId=${params.enterpriseId||''}`;
}
// 导出工资列表excel
export function exportSalaryExcel(params) {
window.location.href = axios.defaults.baseURL +`xmgl/workerWagesPayment/excelProjectWages?projectSn=${params.projectSn}&teamId=${params.teamId||''}&departmentId=${params.departmentId||''}&payMonth=${params.payMonth||''}&payStatus=${params.payStatus||''}&userEnterpriseId=${params.enterpriseId||''}`;
}
// 导入工资列表excel
export function importWagesPaymentExcel(data) {
return post('xmgl/workerWagesPayment/uploadWagesPaymentExcel', data);
}
// 编辑工资发放记录信息
export function updateWorkerWagesPayment(data) {
return post('xmgl/workerWagesPayment/updateWorkerWagesPayment', data);
}

View File

@ -0,0 +1,25 @@
/* 劳务管理-工资发放 */
import { post, get } from '../../http'
import axios from 'axios'
// 智能安全帽--数据台账--分页查询记录信息
export const getSafeHatPayDataPageApi = data => get('/xmgl/safetyHatData/page',data);
// 智能安全帽--报警记录--分页查询记录信息
export const getSafeHatAlarmRecordPageApi = data => get('/xmgl/safetyHatAlarm/page',data);
// 智能安全帽--设备列表条件--分页查询记录信息
export const getDevSnListApi = data => get('/xmgl/safetyHatDev/list',data);
// 智能安全帽--设备列表条件--分页查询记录信息
export const getWorkerListApi = data => get('/xmgl/workerInfo/selectWorkerInfoList',data);
// 智能安全帽--查询绑定人员
export const getWorkerInfoListApi = data => post('/xmgl/workerInfo/selectWorkerInfoList', data);
// 智能安全帽--设备中台--分页查询记录信息
export const getSafeHatEquipmentCentralPageApi = data => get('/xmgl/safetyHatDev/page',data);
// 智能安全帽--设备中台--添加记录信息
export const addSafeHatEquipmentCentralPageApi = data => post('/xmgl/safetyHatDev/add',data);
// 智能安全帽--设备中台--修改记录信息
export const editSafeHatEquipmentCentralPageApi = data => post('/xmgl/safetyHatDev/edit',data);
// 智能安全帽--设备中台--删除记录信息
export const deleteSafeHatEquipmentCentralPageApi = data => post('/xmgl/safetyHatDev/delete',data);

View File

@ -88,8 +88,8 @@ if (process.env.NODE_ENV == 'development') {
// axios.defaults.baseURL = 'http://182.90.224.237:51234' //郭圣雄远程
// axios.defaults.baseURL ='http://101.43.164.214:45020/' //沈阳和盈
// axios.defaults.baseURL ='http://183.249.224.118:9000/' //嘉兴王江泾公用码头
// axios.defaults.baseURL ='http://101.43.164.214:11111/' // 百色三标段项目
axios.defaults.baseURL = 'http://125.88.207.86:8088/'//中建四局线上(最新)地址
axios.defaults.baseURL ='http://101.43.164.214:11111/' // 百色三标段项目
// axios.defaults.baseURL = 'http://125.88.207.86:8088/'//中建四局线上(最新)地址
// axios.defaults.baseURL = 'http://125.88.207.86:8099/'//中建四局(沙湖)线上(最新)地址

View File

@ -546,7 +546,7 @@ const routes2 = [
{
path: "/project/devicePosition/deviceCentral",
name: "机械设备定位_设备中台",
component: () => import("@/views/projectFront/devicePosition/deviceCentral/deviceCentral.vue"),
component: () => import("@/views/projectFront/devicePosition/deviceCentral/equipmentCentral.vue"),
},
//人员定位--卡片管理
{

View File

@ -2,22 +2,22 @@
<div class="fullHeight">
<div class="searchBox whiteBlock">
<el-form :inline="true" ref="searchForm" :model="searchForm" size="medium">
<!-- 人员名称 -->
<el-form-item label="机械设备名称" prop="deviceName">
<el-select v-model="searchForm.personName" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in personList" :key="index" :label="item.personName" :value="item.id" ></el-option>
<!-- 机械设备名称 -->
<el-form-item label="机械设备名称" prop="equipmentName">
<el-select v-model="searchForm.equipmentName" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in equipmentList" :key="index" :label="item.equipmentName" :value="item.equipmentName" ></el-option>
</el-select>
</el-form-item>
<!-- 设备序号 -->
<el-form-item label="设备序号" prop="deviceNumber">
<el-select v-model="searchForm.departmentId" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in deviceList" :key="index" :label="item.deviceNumber" :value="item.id" ></el-option>
<el-form-item label="设备序号" prop="devSn">
<el-select v-model="searchForm.devSn" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in equipmentList" :key="index" :label="item.devSn" :value="item.devSn" ></el-option>
</el-select>
</el-form-item>
<!-- 时间 -->
<el-form-item label="时间">
<el-date-picker size="medium" v-model="daterange" type="daterange"
range-separator="至" value-format="yyyy-MM-dd"
<el-date-picker size="medium" v-model="daterange" type="datetimerange"
range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']"
:start-placeholder="'开始日期'" :end-placeholder="'结束日期'"
@change="changeDate">
</el-date-picker>
@ -32,8 +32,8 @@
<div class="table_wrap whiteBlock">
<el-table class="tables" v-loading="loading" :data="tableData">
<el-table-column label="序号" align="center" type="index" width="200" />
<el-table-column label="机械设备名称" align="center" prop="deviceName" />
<el-table-column label="设备序号" align="center" prop="deviceNumber" />
<el-table-column label="机械设备名称" align="center" prop="equipmentName" />
<el-table-column label="设备序号" align="center" prop="devSn" />
<el-table-column label="报警时间" align="center" prop="alarmTime" />
<el-table-column label="报警信息" align="center" prop="alarmInfo" width="600"/>
</el-table>
@ -52,14 +52,12 @@
</div>
</template>
<script>
import { rtToolPage } from '@/assets/js/api/workTicketManage.js'
import { checkPhone } from '@/assets/js/util.js'
import { } from '@/assets/js/api/devicePosition/payData'
import { getEquipmentAlarmRecordPageApi,getEquipmentListApi } from '@/assets/js/api/devicePosition/equipmentPosition'
export default {
mounted() {},
created() {
this.getList()
// this.getDutyPerson()
this.getPage()
this.getEquipmentList()
},
data() {
return {
@ -77,44 +75,24 @@ export default {
pageSize: 10,
projectSn: '', // SN
personName: '',
deviceNumber: '',
startTime: '',
endTime: '',
devSn: '',
alarmTime_begin: '',
alarmTime_end: '',
},
personList: [
{id: 1, personName: '张三'},
{id: 2, personName: '李四'},
{id: 3, personName: '王二'},
],
deviceList: [
{id: 1, deviceNumber: 'EMP21313212135132'},
{id: 2, deviceNumber: 'EMP44613213543212'},
{id: 3, deviceNumber: 'EMP21321546312556'},
],
tableData: [
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
{deviceName: '推土机', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '加油提程/总油液/⬆165.54L 里程:763米 时长:01:21 速度: 33.0'},
],
equipmentList: [],
tableData: [],
}
},
methods: {
//
getList() {
rtToolPage({
getPage() {
getEquipmentAlarmRecordPageApi({
pageNo: this.pageInfo.pageNo,
pageSize: this.pageInfo.pageSize,
projectSn: this.$store.state.projectSn,
// projectSn: this.$store.state.projectSn,
devSn: this.searchForm.devSn,
toolName: this.searchForm.toolName,
toolStatus: this.searchForm.toolStatus,
alarmTime_begin:this.searchForm.alarmTime_begin,
alarmTime_end:this.searchForm.alarmTime_end,
}).then(result => {
if (result.success) {
this.List = result.result.records
@ -122,41 +100,39 @@ export default {
}
})
},
async getEquipmentList() {
await getEquipmentListApi().then(result => {
if (result.success) {
this.equipmentList = result.result
}
})
},
SizeChange(val) {
this.pageInfo.pageSize = val
this.getList()
this.getPage()
},
CurrentChange(val) {
this.pageInfo.pageNo = val
this.getList()
this.getPage()
},
searchList() {
this.pageInfo.pageNo = 1 //
this.getList()
this.getPage()
},
refresh() {
this.searchForm = {}
this.pageInfo.pageNo = 1 //
this.pageInfo.pageSize = 10 //
this.getList()
},
//
handleSizeChange(val) {
this.pageSize2 = val
this.getPageList()
},
//
handleCurrentChange(val) {
this.pageNo2 = val
this.getPageList()
this.getPage()
this.getEquipmentList()
},
changeDate() {
if (this.daterange) {
this.searchForm.startTime = this.daterange[0]
this.searchForm.endTime = this.daterange[1]
this.searchForm.alarmTime_begin = this.daterange[0]
this.searchForm.alarmTime_end = this.daterange[1]
} else {
this.searchForm.startTime = ''
this.searchForm.endTime = ''
this.searchForm.alarmTime_begin = ''
this.searchForm.alarmTime_end = ''
}
},
}

View File

@ -2,23 +2,22 @@
<div class="fullHeight">
<div class="searchBox whiteBlock">
<el-form :inline="true" ref="searchForm" :model="searchForm" size="medium">
<!-- 人员名称 -->
<el-form-item label="机械设备名称" prop="deviceName">
<el-select v-model="searchForm.personName" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in personList" :key="index" :label="item.personName" :value="item.id" ></el-option>
<!-- 机械设备名称 -->
<el-form-item label="机械设备名称" prop="equipmentName">
<el-select v-model="searchForm.equipmentName" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in equipmentList" :key="index" :label="item.equipmentName" :value="item.equipmentName" ></el-option>
</el-select>
</el-form-item>
<!-- 设备序号 -->
<el-form-item label="设备序号" prop="deviceNumber">
<el-select v-model="searchForm.departmentId" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in deviceList" :key="index" :label="item.deviceNumber" :value="item.id" ></el-option>
<el-form-item label="设备序号" prop="devSn">
<el-select v-model="searchForm.devSn" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in equipmentList" :key="index" :label="item.devSn" :value="item.devSn" ></el-option>
</el-select>
</el-form-item>
<!-- 时间 -->
<el-form-item label="时间">
<el-date-picker size="medium" v-model="daterange" type="daterange"
range-separator="至" value-format="yyyy-MM-dd"
:start-placeholder="'开始日期'" :end-placeholder="'结束日期'"
<el-date-picker size="medium" v-model="daterange" type="datetimerange" :default-time="['00:00:00', '23:59:59']"
range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" :start-placeholder="'开始日期'" :end-placeholder="'结束日期'"
@change="changeDate">
</el-date-picker>
</el-form-item>
@ -31,9 +30,13 @@
</div>
<div class="table_wrap whiteBlock">
<el-table class="tables" v-loading="loading" :data="tableData">
<el-table-column label="机械设备名称" align="center" prop="deviceName" />
<el-table-column label="设备序号" align="center" prop="deviceNumber" width="180"/>
<el-table-column label="当前位置" align="center" prop="currentLocation" width="180"/>
<el-table-column label="机械设备名称" align="center" prop="equipmentName" />
<el-table-column label="设备序号" align="center" prop="devSn" width="180"/>
<el-table-column label="当前位置" align="center" width="180">
<template slot-scope="scope">
{{ '经度:' + scope.row.longitude + ' 纬度:' + scope.row.latitude }}
</template>
</el-table-column>
<el-table-column label="速度" align="center" prop="speed" />
<el-table-column label="工作状态" align="center" prop="workStatus">
<template slot-scope="scope">
@ -41,17 +44,17 @@
<span v-if="scope.row.workStatus === 1">正在待机</span>
</template>
</el-table-column>
<el-table-column label="设备电量" align="center" prop="deviceBattery">
<el-table-column label="设备电量" align="center" prop="equipmentPower">
<template slot-scope="scope">
{{scope.row.deviceBattery}}%
<!-- <span style="color: #67C23A" v-if="scope.row.deviceBattery >= 80">{{scope.row.deviceBattery}}%</span>
<span style="color: #E6A23C" v-else-if="scope.row.deviceBattery < 80 && scope.row.deviceBattery > 20">{{scope.row.deviceBattery}}%</span>
<span style="color: #be0505" v-else-if="scope.row.deviceBattery <= 20">{{scope.row.deviceBattery}}%</span> -->
{{scope.row.equipmentPower}}%
<!-- <span style="color: #67C23A" v-if="scope.row.equipmentPower >= 80">{{scope.row.equipmentPower}}%</span>
<span style="color: #E6A23C" v-else-if="scope.row.equipmentPower < 80 && scope.row.equipmentPower > 20">{{scope.row.equipmentPower}}%</span>
<span style="color: #be0505" v-else-if="scope.row.equipmentPower <= 20">{{scope.row.equipmentPower}}%</span> -->
</template>
</el-table-column>
<el-table-column label="设备电压" align="center" prop="deviceVoltage">
<el-table-column label="设备电压" align="center" prop="equipmentVoltage">
<template slot-scope="scope">
{{ scope.row.deviceVoltage + ' '}}伏特
{{ scope.row.equipmentVoltage + ' '}}伏特
</template>
</el-table-column>
<el-table-column label="上传时间" align="center" prop="uploadTime" width="180"/>
@ -71,13 +74,12 @@
</div>
</template>
<script>
import { rtToolPage } from '@/assets/js/api/workTicketManage.js'
import { } from '@/assets/js/api/devicePosition/payData'
import { getEquipmentPayDataPageApi,getEquipmentListApi } from '@/assets/js/api/devicePosition/equipmentPosition'
export default {
mounted() {},
created() {
this.getList()
// this.getDutyPerson()
this.getPage()
this.getDevSnList()
},
data() {
return {
@ -94,45 +96,27 @@ export default {
pageNo: 1,
pageSize: 10,
projectSn: '', // SN
personName: '',
deviceNumber: '',
startTime: '',
endTime: '',
equipmentName: '',
devSn: '',
uploadTime_begin: '',
uploadTime_end: '',
},
personList: [
{id: 1, personName: '张三'},
{id: 2, personName: '李四'},
{id: 3, personName: '王二'},
],
deviceList: [
{id: 1, deviceNumber: 'EMP21313212135132'},
{id: 2, deviceNumber: 'EMP44613213543212'},
{id: 3, deviceNumber: 'EMP21321546312556'},
],
tableData: [
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 0, deviceBattery: 50, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 0, deviceBattery: 95, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 1, deviceBattery: 18, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 1, deviceBattery: 45, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 0, deviceBattery: 81, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 1, deviceBattery: 11, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 0, deviceBattery: 67, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 1, deviceBattery: 90, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 0, deviceBattery: 16, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
{deviceName: '挖掘机', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', speed:'15km/h', workStatus: 1, deviceBattery: 80, deviceVoltage: 3.7, uploadTime: '2024-03-13 00:00:00'},
],
equipmentList: [],
devSnList: [],
tableData: [],
}
},
methods: {
//
getList() {
rtToolPage({
getPage() {
getEquipmentPayDataPageApi({
pageNo: this.pageInfo.pageNo,
pageSize: this.pageInfo.pageSize,
projectSn: this.$store.state.projectSn,
// projectSn: this.$store.state.projectSn,
equipmentName: this.searchForm.equipmentName,
devSn: this.searchForm.devSn,
toolName: this.searchForm.toolName,
toolStatus: this.searchForm.toolStatus,
uploadTime_begin: this.searchForm.uploadTime_begin,
uploadTime_end: this.searchForm.uploadTime_end
}).then(result => {
if (result.success) {
this.List = result.result.records
@ -140,41 +124,38 @@ export default {
}
})
},
async getDevSnList() {
await getEquipmentListApi().then(result => {
if (result.success) {
this.equipmentList = result.result
}
})
},
SizeChange(val) {
this.pageInfo.pageSize = val
this.getList()
this.getPage()
},
CurrentChange(val) {
this.pageInfo.pageNo = val
this.getList()
this.getPage()
},
searchList() {
this.pageInfo.pageNo = 1 //
this.getList()
this.getPage()
},
refresh() {
this.searchForm = {}
this.pageInfo.pageNo = 1 //
this.pageInfo.pageSize = 10 //
this.getList()
},
//
handleSizeChange(val) {
this.pageSize2 = val
this.getPageList()
},
//
handleCurrentChange(val) {
this.pageNo2 = val
this.getPageList()
this.getPage()
},
changeDate() {
if (this.daterange) {
this.searchForm.startTime = this.daterange[0]
this.searchForm.endTime = this.daterange[1]
this.searchForm.uploadTime_begin = this.daterange[0]
this.searchForm.uploadTime_end = this.daterange[1]
} else {
this.searchForm.startTime = ''
this.searchForm.endTime = ''
this.searchForm.uploadTime_begin = ''
this.searchForm.uploadTime_end = ''
}
},
}

View File

@ -22,10 +22,10 @@
</div>
<div class="table_wrap whiteBlock">
<el-table class="tables" :data="tableData">
<el-table-column prop="deviceName" align="center" label="机械设备名称" width="280"></el-table-column>
<el-table-column prop="deviceNumber" align="center" label="设备序号"></el-table-column>
<el-table-column prop="deviceDriver" align="center" label="司机"></el-table-column>
<el-table-column prop="timeOfAdd" align="center" label="新增时间"></el-table-column>
<el-table-column prop="equipmentName" align="center" label="机械设备名称" width="280"></el-table-column>
<el-table-column prop="devSn" align="center" label="设备序号"></el-table-column>
<el-table-column prop="driverName" align="center" label="司机"></el-table-column>
<el-table-column prop="createTime" align="center" label="新增时间"></el-table-column>
<el-table-column align="center" label="操作" width="280">
<template slot-scope="scope">
<div class="tableBtns">
@ -50,14 +50,19 @@
<el-dialog :modal-append-to-body="false" @close="close" :title="title" :visible.sync="dialogShow" width="667px">
<div class="dialog_content">
<el-form size="medium" ref="addEditForm" :model="addEditForm" :rules="addEditRules" label-width="120px" class="dialogFormBox">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="addEditForm.deviceName" placeholder="请输入"></el-input>
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="addEditForm.equipmentName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="司机" prop="deviceDriver">
<el-input v-model="addEditForm.deviceDriver" placeholder="请输入"></el-input>
<el-form-item label="设备序号" prop="devSn">
<el-input v-model="addEditForm.devSn" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="新增时间" prop="timeOfAdd">
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="addEditForm.timeOfAdd"
<el-form-item label="司机" prop="driverId">
<el-select v-model="addEditForm.driverId" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in workerList" :key="index" :label="item.workerName" :value="item.id" ></el-option>
</el-select>
</el-form-item>
<el-form-item label="新增时间" prop="createTime">
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="addEditForm.createTime"
type="datetime" placeholder="请选择时间" >
</el-date-picker>
</el-form-item>
@ -75,12 +80,16 @@
</div>
</template>
<script>
import { rtToolPageHistory, rtToolAdd, rtToolDelete, rtToolEdit, rtToolPage } from '@/assets/js/api/workTicketManage.js'
import { } from '@/assets/js/api/devicePosition/deviceCentral.js'
import { getDeviceCentraliceCentralPageApi,
addDeviceCentraliceCentralPageApi,
editDeviceCentraliceCentralPageApi,
deleteDeviceCentraliceCentralPageApi,
getWorkerInfoListApi } from '@/assets/js/api/devicePosition/equipmentPosition.js'
export default {
mounted() {},
created() {
this.getList()
this.getPage()
this.getWorkerInfoList()
},
data() {
return {
@ -91,45 +100,36 @@ export default {
pageSize: 10, //
total: 0 //
},
tableData: [
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
{deviceName: '压路机', deviceNumber: 'EMP21354656321321', deviceDriver: '李大鹏',timeOfAdd: '2024-03-13 00:00:00'},
],
tableData: [],
addEditForm: {
deviceName: '',
deviceDriver: '',
timeOfAdd: '',
equipmentName: '',
devSn: '',
createTime: '',
driverId: '',
},
addEditRules: {
deviceName: [{ required: true, message: '必填', trigger: 'blur' }],
deviceDriver: [{ required: true, message: '必填', trigger: 'blur' }]
equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
devSn: [{ required: true, message: '必填', trigger: 'blur' }],
driverId: [{ required: true, message: '必填', trigger: 'blur' }],
},
searchForm: {}
searchForm: {},
workerList: []
}
},
methods: {
getList() {
// rtToolPage({
// pageNo: this.pagInfo.pageNo,
// pageSize: this.pagInfo.pageSize,
// projectSn: this.$store.state.projectSn,
// devSn: this.searchForm.devSn,
// toolName: this.searchForm.toolName,
// toolStatus: this.searchForm.toolStatus,
// }).then(result => {
// if (result.success) {
// this.tableData = result.result.records
// this.pagInfo.total = result.result.total
// }
// })
getPage() {
getDeviceCentraliceCentralPageApi({
pageNo: this.pagInfo.pageNo,
pageSize: this.pagInfo.pageSize,
projectSn: this.$store.state.projectSn,
devSn: this.searchForm.devSn,
}).then(result => {
if (result.success) {
this.tableData = result.result.records
this.pagInfo.total = result.result.total
}
})
},
add() {
@ -149,17 +149,17 @@ export default {
this.$refs.addEditForm.validate(valid => {
if (valid) {
if (this.title == '新增') {
rtToolAdd(params).then(result => {
addDeviceCentraliceCentralPageApi(params).then(result => {
if (result.success) {
this.$message.success(result.message)
this.getList()
this.getPage()
}
})
} else if (this.title == '编辑') {
rtToolEdit(params).then(result => {
editDeviceCentraliceCentralPageApi(params).then(result => {
if (result.success) {
this.$message.success(result.message)
this.getList()
this.getPage()
}
})
}
@ -176,9 +176,9 @@ export default {
type: 'warning'
})
.then(() => {
rtToolDelete({ id: obj.id }).then(res => {
deleteDeviceCentraliceCentralPageApi({ id: obj.id }).then(res => {
if (res.success) {
this.getList()
this.getPage()
this.$message({
type: 'success',
message: '删除成功!'
@ -198,6 +198,19 @@ export default {
})
})
},
async getWorkerInfoList(){
await getWorkerInfoListApi({
pageNo: this.pagInfo.pageNo,
// pageSize: this.pagInfo.pageSize,
pageSize: 100000,
projectSn: this.$store.state.projectSn,
personType: 1
}).then(result => {
if (result.success) {
this.workerList = result.result.records
}
})
},
close() {
this.addEditForm = {}
this.$nextTick(() => {
@ -206,17 +219,18 @@ export default {
},
SizeChange(val) {
this.pagInfo.pageSize = val
this.getList()
this.getPage()
},
CurrentChange(val) {
this.pagInfo.pageNo = val
this.getList()
this.getPage()
},
refresh() {
this.searchForm = {}
this.pagInfo.pageNo = 1 //
this.pagInfo.pageSize = 10 //
this.getList()
this.getPage()
this.getWorkerInfoList()
},
}
}

View File

@ -3,21 +3,21 @@
<div class="searchBox whiteBlock">
<el-form :inline="true" ref="searchForm" :model="searchForm" size="medium">
<!-- 人员名称 -->
<el-form-item label="人员名称" prop="personName">
<el-select v-model="searchForm.personName" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in personList" :key="index" :label="item.personName" :value="item.id" ></el-option>
<el-form-item label="人员名称" prop="workerInfoId">
<el-select v-model="searchForm.workerInfoId" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in workerList" :key="index" :label="item.workerName" :value="item.id" ></el-option>
</el-select>
</el-form-item>
<!-- 设备序号 -->
<el-form-item label="设备序号" prop="deviceNumber">
<el-select v-model="searchForm.departmentId" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in deviceList" :key="index" :label="item.deviceNumber" :value="item.id" ></el-option>
<el-form-item label="设备序号" prop="devSn">
<el-select v-model="searchForm.devSn" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in devSnList" :key="index" :label="item.devSn" :value="item.devSn" ></el-option>
</el-select>
</el-form-item>
<!-- 时间 -->
<el-form-item label="时间">
<el-date-picker size="medium" v-model="daterange" type="daterange"
range-separator="至" value-format="yyyy-MM-dd"
<el-date-picker size="medium" v-model="daterange" type="datetimerange"
range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']"
:start-placeholder="'开始日期'" :end-placeholder="'结束日期'"
@change="changeDate">
</el-date-picker>
@ -32,8 +32,8 @@
<div class="table_wrap whiteBlock">
<el-table class="tables" v-loading="loading" :data="tableData">
<el-table-column label="序号" align="center" type="index" width="200" />
<el-table-column label="人员名称" align="center" prop="personName" />
<el-table-column label="设备序号" align="center" prop="deviceNumber" />
<el-table-column label="人员名称" align="center" prop="workerName" />
<el-table-column label="设备序号" align="center" prop="devSn" />
<el-table-column label="报警时间" align="center" prop="alarmTime" />
<el-table-column label="报警信息" align="center" prop="alarmInfo" />
</el-table>
@ -52,14 +52,15 @@
</div>
</template>
<script>
import { rtToolPage } from '@/assets/js/api/workTicketManage.js'
import { checkPhone } from '@/assets/js/util.js'
import { } from '@/assets/js/api/smartSafeHat/payData'
import { getSafeHatAlarmRecordPageApi,
getDevSnListApi,
getWorkerInfoListApi } from '@/assets/js/api/smartSafeHat/smartSafeHat.js'
export default {
mounted() {},
created() {
this.getList()
// this.getDutyPerson()
this.getPage()
this.getDevSnList()
this.getWorkerInfoList()
},
data() {
return {
@ -76,87 +77,83 @@ export default {
pageNo: 1,
pageSize: 10,
projectSn: '', // SN
personName: '',
deviceNumber: '',
startTime: '',
endTime: '',
workerInfoId: '',
workerName: '',
devSn: '',
alarmTime_begin: '',
alarmTime_end: '',
},
personList: [
{id: 1, personName: '张三'},
{id: 2, personName: '李四'},
{id: 3, personName: '王二'},
],
deviceList: [
{id: 1, deviceNumber: 'EMP21313212135132'},
{id: 2, deviceNumber: 'EMP44613213543212'},
{id: 3, deviceNumber: 'EMP21321546312556'},
],
tableData: [
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', alarmTime: '2024-03-13 00:00:00', alarmInfo: '异常'},
],
workerList: [],
devSnList: [],
tableData: [],
}
},
methods: {
//
getList() {
rtToolPage({
//
async getPage() {
await getSafeHatAlarmRecordPageApi({
pageNo: this.pageInfo.pageNo,
pageSize: this.pageInfo.pageSize,
projectSn: this.$store.state.projectSn,
// projectSn: this.$store.state.projectSn,
devSn: this.searchForm.devSn,
toolName: this.searchForm.toolName,
toolStatus: this.searchForm.toolStatus,
workerInfoId: this.searchForm.workerInfoId,
alarmTime_begin: this.searchForm.alarmTime_begin,
alarmTime_end: this.searchForm.alarmTime_end,
}).then(result => {
if (result.success) {
this.List = result.result.records
this.tableData = result.result.records
this.pageInfo.total = result.result.total
}
})
},
async getDevSnList() {
await getDevSnListApi().then(result => {
if (result.success) {
this.devSnList = result.result
}
})
},
async getWorkerInfoList(){
await getWorkerInfoListApi({
pageNo: 1,
// pageSize: this.pagInfo.pageSize,
pageSize: 100000,
projectSn: this.$store.state.projectSn,
personType: 1
}).then(result => {
if (result.success) {
this.workerList = result.result.records
}
})
},
SizeChange(val) {
this.pageInfo.pageSize = val
this.getList()
this.getPage()
},
CurrentChange(val) {
this.pageInfo.pageNo = val
this.getList()
this.getPage()
},
searchList() {
this.pageInfo.pageNo = 1 //
this.getList()
this.getPage()
this.getDevSnList()
},
refresh() {
this.searchForm = {}
this.pageInfo.pageNo = 1 //
this.pageInfo.pageSize = 10 //
this.getList()
},
//
handleSizeChange(val) {
this.pageSize2 = val
this.getPageList()
},
//
handleCurrentChange(val) {
this.pageNo2 = val
this.getPageList()
this.getPage()
this.getDevSnList()
this.getWorkerInfoList()
},
changeDate() {
if (this.daterange) {
this.searchForm.startTime = this.daterange[0]
this.searchForm.endTime = this.daterange[1]
this.searchForm.alarmTime_begin = this.daterange[0]
this.searchForm.alarmTime_end = this.daterange[1]
} else {
this.searchForm.startTime = ''
this.searchForm.endTime = ''
this.searchForm.alarmTime_begin = ''
this.searchForm.alarmTime_end = ''
}
},
}

View File

@ -3,21 +3,21 @@
<div class="searchBox whiteBlock">
<el-form :inline="true" ref="searchForm" :model="searchForm" size="medium">
<!-- 人员名称 -->
<el-form-item label="人员名称" prop="personName">
<el-select v-model="searchForm.personName" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in personList" :key="index" :label="item.personName" :value="item.id" ></el-option>
<el-form-item label="人员名称" prop="workerInfoId">
<el-select v-model="searchForm.workerInfoId" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in workerList" :key="index" :label="item.workerName" :value="item.id" ></el-option>
</el-select>
</el-form-item>
<!-- 设备序号 -->
<el-form-item label="设备序号" prop="deviceNumber">
<el-select v-model="searchForm.departmentId" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in deviceList" :key="index" :label="item.deviceNumber" :value="item.id" ></el-option>
<el-form-item label="设备序号" prop="devSn">
<el-select v-model="searchForm.devSn" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in devSnList" :key="index" :label="item.devSn" :value="item.devSn" ></el-option>
</el-select>
</el-form-item>
<!-- 时间 -->
<el-form-item label="时间">
<el-date-picker size="medium" v-model="daterange" type="daterange"
range-separator="至" value-format="yyyy-MM-dd"
<el-date-picker size="medium" v-model="daterange" type="datetimerange" :default-time="['00:00:00', '23:59:59']"
range-separator="至" value-format="yyyy-MM-dd HH:mm:ss"
:start-placeholder="'开始日期'" :end-placeholder="'结束日期'"
@change="changeDate">
</el-date-picker>
@ -31,9 +31,13 @@
</div>
<div class="table_wrap whiteBlock">
<el-table class="tables" v-loading="loading" :data="tableData">
<el-table-column label="人员名称" align="center" prop="personName" />
<el-table-column label="设备序号" align="center" prop="deviceNumber" />
<el-table-column label="当前位置" align="center" prop="currentLocation" />
<el-table-column label="人员名称" align="center" prop="workerName" />
<el-table-column label="设备序号" align="center" prop="devSn" />
<el-table-column label="当前位置" align="center" prop="">
<template slot-scope="scope">
{{ '经度:' + scope.row.longitude + ' 纬度:' + scope.row.latitude }}
</template>
</el-table-column>
<el-table-column label="上传时间" align="center" prop="uploadTime" />
</el-table>
<el-pagination
@ -51,13 +55,13 @@
</div>
</template>
<script>
import { rtToolPage } from '@/assets/js/api/workTicketManage.js'
import { } from '@/assets/js/api/smartSafeHat/payData'
import { getSafeHatPayDataPageApi,getDevSnListApi,getWorkerInfoListApi } from '@/assets/js/api/smartSafeHat/smartSafeHat.js'
export default {
mounted() {},
created() {
this.getList()
// this.getDutyPerson()
this.getPage()
this.getDevSnList()
this.getWorkerInfoList()
},
data() {
return {
@ -74,87 +78,82 @@ export default {
pageNo: 1,
pageSize: 10,
projectSn: '', // SN
personName: '',
deviceNumber: '',
startTime: '',
endTime: '',
workerInfoId: '',
devSn: '',
uploadTime_begin: '',
uploadTime_end: '',
},
personList: [
{id: 1, personName: '张三'},
{id: 2, personName: '李四'},
{id: 3, personName: '王二'},
],
deviceList: [
{id: 1, deviceNumber: 'EMP21313212135132'},
{id: 2, deviceNumber: 'EMP44613213543212'},
{id: 3, deviceNumber: 'EMP21321546312556'},
],
tableData: [
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
{personName: '黄浩平', deviceNumber: 'EMP21313212135132', currentLocation: '123,4561,895,5648', uploadTime: '2024-03-13 00:00:00'},
],
workerList: [],
devSnList: [],
tableData: [],
}
},
methods: {
//
getList() {
rtToolPage({
async getPage() {
await getSafeHatPayDataPageApi({
pageNo: this.pageInfo.pageNo,
pageSize: this.pageInfo.pageSize,
projectSn: this.$store.state.projectSn,
// projectSn: this.$store.state.projectSn,
devSn: this.searchForm.devSn,
toolName: this.searchForm.toolName,
toolStatus: this.searchForm.toolStatus,
workerInfoId: this.searchForm.workerInfoId,
uploadTime_begin: this.searchForm.uploadTime_begin,
uploadTime_end: this.searchForm.uploadTime_end,
}).then(result => {
if (result.success) {
this.List = result.result.records
this.tableData = result.result.records
this.pageInfo.total = result.result.total
}
})
},
async getDevSnList() {
await getDevSnListApi().then(result => {
if (result.success) {
this.devSnList = result.result
}
})
},
async getWorkerInfoList(){
await getWorkerInfoListApi({
pageNo: 1,
// pageSize: this.pagInfo.pageSize,
pageSize: 100000,
projectSn: this.$store.state.projectSn,
personType: 1
}).then(result => {
if (result.success) {
this.workerList = result.result.records
}
})
},
SizeChange(val) {
this.pageInfo.pageSize = val
this.getList()
this.getPage()
},
CurrentChange(val) {
this.pageInfo.pageNo = val
this.getList()
this.getPage()
},
searchList() {
this.pageInfo.pageNo = 1 //
this.getList()
this.getPage()
},
refresh() {
this.searchForm = {}
this.pageInfo.pageNo = 1 //
this.pageInfo.pageSize = 10 //
this.getList()
},
//
handleSizeChange(val) {
this.pageSize2 = val
this.getPageList()
},
//
handleCurrentChange(val) {
this.pageNo2 = val
this.getPageList()
this.getPage()
this.getDevSnList()
this.getWorkerInfoList()
},
changeDate() {
if (this.daterange) {
this.searchForm.startTime = this.daterange[0]
this.searchForm.endTime = this.daterange[1]
this.searchForm.uploadTime_begin = this.daterange[0]
this.searchForm.uploadTime_end = this.daterange[1]
console.log(this.daterange)
} else {
this.searchForm.startTime = ''
this.searchForm.endTime = ''
this.searchForm.uploadTime_begin = ''
this.searchForm.uploadTime_end = ''
}
},
}

View File

@ -22,9 +22,9 @@
</div>
<div class="table_wrap whiteBlock">
<el-table class="tables" :data="tableData">
<el-table-column prop="personName" align="center" label="人员名称" width="280"></el-table-column>
<el-table-column prop="deviceNumber" align="center" label="设备序号"></el-table-column>
<el-table-column prop="timeOfAdd" align="center" label="新增时间"></el-table-column>
<el-table-column prop="workerName" align="center" label="人员名称" width="280"></el-table-column>
<el-table-column prop="devSn" align="center" label="设备序号"></el-table-column>
<el-table-column prop="createTime" align="center" label="新增时间"></el-table-column>
<el-table-column align="center" label="操作" width="280">
<template slot-scope="scope">
<div class="tableBtns">
@ -49,14 +49,17 @@
<el-dialog :modal-append-to-body="false" @close="close" :title="title" :visible.sync="dialogShow" width="667px">
<div class="dialog_content">
<el-form size="medium" ref="addEditForm" :model="addEditForm" :rules="addEditRules" label-width="120px" class="dialogFormBox">
<el-form-item label="绑定人员" prop="personName">
<el-input v-model="addEditForm.personName" placeholder="请输入"></el-input>
<el-form-item label="绑定人员" prop="workerInfoId">
<!-- <el-input v-model="addEditForm.workerName" placeholder="请输入"></el-input> -->
<el-select v-model="addEditForm.workerInfoId" placeholder="请选择" clearable :style="{ width: '100%' }" >
<el-option v-for="(item, index) in workerList" :key="index" :label="item.workerName" :value="item.id" ></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备序号" prop="deviceNumber">
<el-input v-model="addEditForm.deviceNumber" placeholder="请输入"></el-input>
<el-form-item label="设备序号" prop="devSn">
<el-input v-model="addEditForm.devSn" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="新增时间" prop="timeOfAdd">
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="addEditForm.timeOfAdd"
<el-form-item label="新增时间" prop="createTime">
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="addEditForm.createTime"
type="datetime" placeholder="请选择时间" >
</el-date-picker>
</el-form-item>
@ -74,12 +77,16 @@
</div>
</template>
<script>
import { rtToolPageHistory, rtToolAdd, rtToolDelete, rtToolEdit, rtToolPage } from '@/assets/js/api/workTicketManage.js'
import { } from '@/assets/js/api/smartSafeHat/deviceCentral.js'
import { getSafeHatEquipmentCentralPageApi,
addSafeHatEquipmentCentralPageApi,
editSafeHatEquipmentCentralPageApi,
deleteSafeHatEquipmentCentralPageApi,
getWorkerInfoListApi} from '@/assets/js/api/smartSafeHat/smartSafeHat.js'
export default {
mounted() {},
created() {
this.getList()
this.getPage()
this.getWorkerInfoList()
},
data() {
return {
@ -90,45 +97,34 @@ export default {
pageSize: 10, //
total: 0 //
},
tableData: [
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
{personName: '李大鹏', deviceNumber: 'EMP21354656321321', timeOfAdd: '2024-03-13 00:00:00'},
],
workerList: [],
tableData: [],
addEditForm: {
personName: '',
deviceNumber: '',
timeOfAdd: '',
workerInfoId: '',
devSn: '',
createTime: '',
},
addEditRules: {
personName: [{ required: true, message: '必填', trigger: 'blur' }],
deviceNumber: [{ required: true, message: '必填', trigger: 'blur' }]
workerInfoId: [{ required: true, message: '必填', trigger: 'blur' }],
devSn: [{ required: true, message: '必填', trigger: 'blur' }]
},
searchForm: {}
}
},
methods: {
getList() {
// rtToolPage({
// pageNo: this.pagInfo.pageNo,
// pageSize: this.pagInfo.pageSize,
// projectSn: this.$store.state.projectSn,
// devSn: this.searchForm.devSn,
// toolName: this.searchForm.toolName,
// toolStatus: this.searchForm.toolStatus,
// }).then(result => {
// if (result.success) {
// this.tableData = result.result.records
// this.pagInfo.total = result.result.total
// }
// })
async getPage() {
await getSafeHatEquipmentCentralPageApi({
pageNo: this.pagInfo.pageNo,
pageSize: this.pagInfo.pageSize,
// projectSn: this.$store.state.projectSn,
devSn: this.searchForm.devSn,
}).then(result => {
if (result.success) {
this.tableData = result.result.records
this.pagInfo.total = result.result.total
}
})
},
add() {
@ -148,17 +144,17 @@ export default {
this.$refs.addEditForm.validate(valid => {
if (valid) {
if (this.title == '新增') {
rtToolAdd(params).then(result => {
addSafeHatEquipmentCentralPageApi(params).then(result => {
if (result.success) {
this.$message.success(result.message)
this.getList()
this.getPage()
}
})
} else if (this.title == '编辑') {
rtToolEdit(params).then(result => {
editSafeHatEquipmentCentralPageApi(params).then(result => {
if (result.success) {
this.$message.success(result.message)
this.getList()
this.getPage()
}
})
}
@ -175,9 +171,9 @@ export default {
type: 'warning'
})
.then(() => {
rtToolDelete({ id: obj.id }).then(res => {
deleteSafeHatEquipmentCentralPageApi({ id: obj.id }).then(res => {
if (res.success) {
this.getList()
this.getPage()
this.$message({
type: 'success',
message: '删除成功!'
@ -197,6 +193,19 @@ export default {
})
})
},
async getWorkerInfoList(){
await getWorkerInfoListApi({
pageNo: this.pagInfo.pageNo,
// pageSize: this.pagInfo.pageSize,
pageSize: 100000,
projectSn: this.$store.state.projectSn,
personType: 1
}).then(result => {
if (result.success) {
this.workerList = result.result.records
}
})
},
close() {
this.addEditForm = {}
this.$nextTick(() => {
@ -205,17 +214,18 @@ export default {
},
SizeChange(val) {
this.pagInfo.pageSize = val
this.getList()
this.getPage()
},
CurrentChange(val) {
this.pagInfo.pageNo = val
this.getList()
this.getPage()
},
refresh() {
this.searchForm = {}
this.pagInfo.pageNo = 1 //
this.pagInfo.pageSize = 10 //
this.getList()
this.getPage()
this.getWorkerInfoList()
},
}
}