400 lines
12 KiB
Vue
400 lines
12 KiB
Vue
<template>
|
|
<div class="fullHeight whiteBlock">
|
|
<div style="padding: 15px 15px 0">
|
|
<el-form :inline="true" ref="searchForm" :model="searchForm" size="medium">
|
|
<el-form-item label="桩点名称">
|
|
<el-input v-model="searchForm.pilePointName" placeholder="请输入"></el-input>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="上传时间">
|
|
<el-date-picker
|
|
v-model="searchForm.dateRangeArr"
|
|
type="datetimerange"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
:default-time="['00:00:00', '23:59:59']"
|
|
:range-separator="$t('message.sixComplete.to')"
|
|
:start-placeholder="$t('message.sixComplete.start')"
|
|
:end-placeholder="$t('message.sixComplete.end')"
|
|
>
|
|
</el-date-picker>
|
|
</el-form-item> -->
|
|
<el-form-item>
|
|
<el-button type="primary" plain @click="queryBtn">{{
|
|
$t("message.energyManage.waybill.query")
|
|
}}</el-button>
|
|
<el-button type="warning" plain @click="refresh">{{
|
|
$t("message.deviceManage.refresh")
|
|
}}</el-button>
|
|
<el-button type="primary" size="medium" @click="isAdd(1)">新增</el-button>
|
|
<el-button
|
|
:disabled="$refs.multipleTable && $refs.multipleTable.selection.length == 0"
|
|
:type="
|
|
$refs.multipleTable && $refs.multipleTable.selection.length == 0
|
|
? 'info'
|
|
: 'danger'
|
|
"
|
|
class="delete_btn"
|
|
plain
|
|
@click="deleteAttendanceBatch"
|
|
>删除</el-button
|
|
>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
<div class="table_wrap whiteBlock">
|
|
<el-table class="tables" ref="multipleTable" :data="List">
|
|
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
|
<el-table-column prop="alarmTime" label="报警时间" align="center">
|
|
<template slot-scope="scope">
|
|
{{ scope.row.alarmTime || "--" }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="pilePointName"
|
|
label="桩点名称"
|
|
align="center"
|
|
></el-table-column>
|
|
<el-table-column prop="designPileDepth" align="center" label="设计桩深(m)">
|
|
<template slot-scope="scope">
|
|
{{ scope.row.designPileDepth || "--" }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="realPileDepth" align="center" label="实时桩深">
|
|
<template slot-scope="scope"> {{ scope.row.realPileDepth || "--" }} </template>
|
|
</el-table-column>
|
|
<el-table-column width="220" label="操作" align="center">
|
|
<template slot-scope="scope">
|
|
<div class="tableBtns">
|
|
<div @click="isAdd(2, scope.row)" class="operationText">
|
|
<img src="@/assets/images/icon-edit.png" width="15px" height="15px" />
|
|
<span>编辑</span>
|
|
</div>
|
|
<div @click="deleteDev(scope.row)" class="operationText">
|
|
<img src="@/assets/images/icon-delete.png" width="15px" height="15px" />
|
|
<span>删除</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<el-pagination
|
|
class="pagerBox"
|
|
@size-change="SizeChange"
|
|
@current-change="CurrentChange"
|
|
:current-page="pagInfo.pageNo"
|
|
:page-sizes="$store.state.PAGESIZRS"
|
|
:page-size="pagInfo.pageSize"
|
|
layout="total, sizes, prev, pager, next"
|
|
:total="Number(pagInfo.total)"
|
|
background
|
|
></el-pagination>
|
|
</div>
|
|
<el-dialog
|
|
:modal-append-to-body="false"
|
|
@close="close"
|
|
:title="title"
|
|
:visible.sync="dialogShow"
|
|
width="1024px"
|
|
>
|
|
<div class="dialog_content">
|
|
<el-form
|
|
size="medium"
|
|
ref="addEditForm"
|
|
:model="addEditForm"
|
|
:rules="addEditRules"
|
|
label-width="160px"
|
|
class="dialogFormBox"
|
|
>
|
|
<el-form-item label="报警时间:" prop="alarmTime">
|
|
<el-date-picker
|
|
v-model="addEditForm.alarmTime"
|
|
type="datetime"
|
|
placeholder="选择日期"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="桩点名称:" prop="pilePointName">
|
|
<el-input v-model="addEditForm.pilePointName" placeholder="请输入"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="设计桩深(m):" prop="designPileDepth">
|
|
<el-input
|
|
type="number"
|
|
v-model="addEditForm.designPileDepth"
|
|
placeholder="请输入"
|
|
></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="实时桩深:" prop="realPileDepth">
|
|
<el-input
|
|
type="number"
|
|
v-model="addEditForm.realPileDepth"
|
|
placeholder="请输入"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
<div class="dialog-footer">
|
|
<el-button
|
|
class="cancleBtn"
|
|
@click="dialogShow = false"
|
|
icon="el-icon-circle-close"
|
|
size="medium"
|
|
>{{ $t("message.deviceManage.cancel") }}
|
|
</el-button>
|
|
<el-button
|
|
type="primary"
|
|
icon="el-icon-circle-check"
|
|
@click="submit"
|
|
size="medium"
|
|
>{{ $t("message.deviceManage.save") }}
|
|
</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import {
|
|
getCementMixPileAlarmPageApi,
|
|
addCementMixPileAlarmApi,
|
|
deleteCementMixPileAlarmApi,
|
|
editCementMixPileAlarmApi,
|
|
deleteBatchCementMixPileAlarmApi,
|
|
} from "@/assets/js/api/cementMixingPileMonitor.js";
|
|
export default {
|
|
mounted() {
|
|
this.getList();
|
|
},
|
|
data() {
|
|
return {
|
|
title: "",
|
|
dialogShow: false,
|
|
pagInfo: {
|
|
pageNo: 1, //页数
|
|
pageSize: 10, //条数
|
|
total: 0, //总条数
|
|
},
|
|
List: [],
|
|
addEditForm: {
|
|
pilePointName: "",
|
|
vehicleName: "",
|
|
heading: "",
|
|
positioningTime: "",
|
|
longitude: "",
|
|
latitude: "",
|
|
speed: "",
|
|
realtimeDepth: "",
|
|
realtimeCurrent: "",
|
|
realtimeInjectionVolume: "",
|
|
realtimeVerticality: "",
|
|
realtimeRate: "",
|
|
pointHorizontalDeviationDistance: "",
|
|
},
|
|
addEditRules: {
|
|
pilePointName: [
|
|
{
|
|
required: true,
|
|
message: "必填",
|
|
trigger: "blur",
|
|
},
|
|
],
|
|
},
|
|
searchForm: {
|
|
pilePointName: "",
|
|
dateRangeArr: [],
|
|
},
|
|
stateList: [
|
|
{
|
|
value: "1",
|
|
label: "待机",
|
|
},
|
|
{
|
|
value: "2",
|
|
label: "焊接",
|
|
},
|
|
{
|
|
value: "3",
|
|
label: "报警",
|
|
},
|
|
{
|
|
value: "4",
|
|
label: "关机",
|
|
},
|
|
],
|
|
};
|
|
},
|
|
methods: {
|
|
// 批量删除考勤人员
|
|
deleteAttendanceBatch() {
|
|
if (this.$refs.multipleTable.selection.length === 0)
|
|
return this.$message.warning("请勾选需要删除的数据!");
|
|
this.$confirm("删除后操作不可恢复,请谨慎操作!", "警告", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
})
|
|
.then(() => {
|
|
const ids = this.$refs.multipleTable.selection.map((item) => item.id).join(",");
|
|
console.log(this.$refs.multipleTable.selection);
|
|
deleteBatchCementMixPileAlarmApi({ ids }).then((res) => {
|
|
this.queryBtn();
|
|
});
|
|
})
|
|
.catch(() => {});
|
|
},
|
|
//查询仓库数据
|
|
getList() {
|
|
getCementMixPileAlarmPageApi({
|
|
pageNo: this.pagInfo.pageNo,
|
|
pageSize: this.pagInfo.pageSize,
|
|
projectSn: this.$store.state.projectSn,
|
|
pilePointName: this.searchForm.pilePointName,
|
|
createTime_begin:
|
|
this.searchForm.dateRangeArr instanceof Array && this.searchForm.dateRangeArr[0]
|
|
? this.searchForm.dateRangeArr[0]
|
|
: "",
|
|
createTime_end:
|
|
this.searchForm.dateRangeArr instanceof Array && this.searchForm.dateRangeArr[1]
|
|
? this.searchForm.dateRangeArr[1]
|
|
: "",
|
|
}).then((result) => {
|
|
if (result.success) {
|
|
this.List = result.result.records;
|
|
this.pagInfo.total = result.result.total;
|
|
}
|
|
});
|
|
},
|
|
|
|
isAdd(type, obj) {
|
|
if (type == 1) {
|
|
this.title = "新增";
|
|
this.close();
|
|
} else if (type == 2) {
|
|
this.title = "编辑";
|
|
this.addEditForm = JSON.parse(JSON.stringify(obj));
|
|
}
|
|
|
|
this.dialogShow = true;
|
|
},
|
|
submit() {
|
|
let params = JSON.parse(JSON.stringify(this.addEditForm));
|
|
params.projectSn = this.$store.state.projectSn;
|
|
this.$refs.addEditForm.validate((valid) => {
|
|
if (valid) {
|
|
if (this.title == "新增") {
|
|
addCementMixPileAlarmApi(params).then((result) => {
|
|
if (result.success) {
|
|
this.$message.success(result.message);
|
|
this.getList();
|
|
}
|
|
});
|
|
} else if (this.title === "编辑") {
|
|
editCementMixPileAlarmApi(params).then((result) => {
|
|
if (result.success) {
|
|
this.$message.success(result.message);
|
|
this.getList();
|
|
}
|
|
});
|
|
}
|
|
this.dialogShow = false;
|
|
} else {
|
|
return false;
|
|
}
|
|
});
|
|
},
|
|
deleteDev(obj) {
|
|
this.$confirm("此操作将永久删除, 是否继续?", "提示", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
})
|
|
.then(() => {
|
|
deleteCementMixPileAlarmApi({ id: obj.id }).then((res) => {
|
|
if (res.success) {
|
|
this.getList();
|
|
this.$message({
|
|
type: "success",
|
|
message: "删除成功!",
|
|
});
|
|
} else {
|
|
this.$message({
|
|
type: "error",
|
|
message: res.message,
|
|
});
|
|
}
|
|
});
|
|
})
|
|
.catch(() => {
|
|
this.$message({
|
|
type: "info",
|
|
message: "已取消删除",
|
|
});
|
|
});
|
|
},
|
|
|
|
close() {
|
|
this.addEditForm = {};
|
|
this.$nextTick(() => {
|
|
this.$refs.addEditForm.clearValidate();
|
|
});
|
|
},
|
|
SizeChange(val) {
|
|
this.pagInfo.pageSize = val;
|
|
this.getList();
|
|
},
|
|
CurrentChange(val) {
|
|
this.pagInfo.pageNo = val;
|
|
this.getList();
|
|
},
|
|
queryBtn() {
|
|
this.pagInfo.pageNo = 1; //页数
|
|
this.getList();
|
|
},
|
|
refresh() {
|
|
this.searchForm = {};
|
|
this.pagInfo.pageNo = 1; //页数
|
|
this.pagInfo.pageSize = 10; //条数
|
|
this.getList();
|
|
},
|
|
},
|
|
computed: {
|
|
headers() {
|
|
return {
|
|
Authorization: this.$store.state.userInfo.token,
|
|
};
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style lang="less" scoped>
|
|
.dialog_content {
|
|
padding: 0;
|
|
.dialogFormBox {
|
|
width: initial;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
.el-form-item {
|
|
margin-bottom: 20px;
|
|
}
|
|
}
|
|
}
|
|
.color-ff0 {
|
|
color: #ff0000;
|
|
}
|
|
.el-date-editor {
|
|
width: 360px;
|
|
}
|
|
.pagerBox {
|
|
margin-top: 30px;
|
|
}
|
|
.table_wrap {
|
|
height: calc(100% - 131px);
|
|
}
|
|
.tables {
|
|
min-height: 610px;
|
|
max-height: 610px;
|
|
}
|
|
.upload-btn {
|
|
margin: 0 15px;
|
|
display: inline-block;
|
|
}
|
|
</style>
|