<template>
|
<div class="page_status">
|
<v-header
|
title="设备预警"
|
:bar="bar"
|
search
|
@on-search="onSearch"
|
></v-header>
|
|
<div class="tab">
|
<v-tool-table :trs="trs" :tds="tds">
|
<!-- 处理结果: -->
|
<template v-slot:result="item">
|
<div class="table_flex">
|
<!-- {{item.scope.id}} -->
|
<div :style="{ color: item.scope.resultColor }">
|
{{ item.scope.disposeResult }}
|
</div>
|
</div>
|
</template>
|
|
<template v-slot:btn="item">
|
<div class="table_flex" v-if="item.scope.disposeType === '1'">
|
<!-- {{item.scope.id}} -->
|
<span class="col_primary" @click="clickHandle('1', item.scope.id)"
|
>处理</span
|
>
|
<span class="col_primary" @click="clickHandle('4', item.scope.id)"
|
>忽略</span
|
>
|
</div>
|
</template>
|
<template v-slot:more="item">
|
<div class="table_flex">
|
<!-- {{item.scope.id}} -->
|
<span class="col_primary" @click="onCheck(item.scope.id)"
|
>查看</span
|
>
|
</div>
|
</template>
|
</v-tool-table>
|
</div>
|
<!-- 分页 -->
|
<v-tool-page :item="paged" @on-page="onPage"></v-tool-page>
|
<!-- 处理弹窗 -->
|
<el-dialog
|
title="处理"
|
:visible.sync="dialogVisible"
|
width="400px"
|
:before-close="handleClose"
|
append-to-body
|
>
|
<div>
|
<el-form
|
:model="sosForm"
|
ref="sosForm"
|
label-position="top"
|
:inline="true"
|
label-width="400px"
|
class="yourForm"
|
>
|
<el-form-item
|
label="处理人:"
|
prop="disposeUserId"
|
style="width:100%;"
|
>
|
<el-select
|
class="custom-select"
|
v-model="assignor"
|
placeholder="请选择"
|
style="width:100%;"
|
>
|
<el-option
|
v-for="item in handlerList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="预警内容:"
|
prop="earlyWarningText"
|
style="width:100%;"
|
>
|
<el-input
|
style="width:100%;"
|
v-model.trim="sosForm.earlyWarningText"
|
type="textarea"
|
:rows="4"
|
class="input-width"
|
placeholder="请输入预警内容"
|
size="small"
|
></el-input>
|
</el-form-item>
|
</el-form>
|
<div class="fl-cen">
|
<el-button size="small" @click="handleClose">取 消</el-button>
|
<el-button type="primary" @click="submitHandle">确 定</el-button>
|
</div>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { mapState } from "vuex";
|
export default {
|
props: {},
|
components: {},
|
data() {
|
return {
|
bar: [
|
{ title: "设备ID", name: "equipmentNumber" },
|
{ title: "用户姓名", name: "userName" },
|
{ title: "绑定手机号", name: "phone" },
|
{
|
title: "预警类型",
|
name: "type",
|
type: "select",
|
list: [
|
{ label: "血压异常", value: "1" },
|
{ label: "心率异常", value: "2" },
|
{ label: "体温异常", value: "3" },
|
{ label: "SOS预警", value: "4" }
|
],
|
width: "150px !important"
|
}
|
],
|
trs: [
|
{ text: "序号", val: "index", width: "50px" },
|
{ text: "预警时间", val: "creationTime" },
|
{ text: "设备编号", val: "equipmentNumber" },
|
{ text: "用户姓名", val: "userName" },
|
{ text: "绑定手机号", val: "binPhone" },
|
{ text: "预警类型", val: "earlyWarningType" },
|
{ text: "处理结果", val: "btn", slot: "result" },
|
{ text: "处理人", val: "disposeUserName" },
|
{ text: "操作", val: "btn", slot: "btn" },
|
{ text: "更多", val: "btn", slot: "more" }
|
],
|
tds: [],
|
paged: { page: 0, total: 0, r: 0, limit: 10 },
|
os: {},
|
search: {},
|
assignor: "",
|
dialogVisible: false,
|
handlerList: [],
|
sosForm: {
|
id: "",
|
earlyWarningText: ""
|
}
|
};
|
},
|
computed: {
|
...mapState({ vuex_page: "pageReset" })
|
},
|
watch: {
|
vuex_page: {
|
handler(n) {
|
if (n.page === this.$route.path) {
|
this.paged.page = 1;
|
this.init();
|
}
|
},
|
deep: true
|
}
|
},
|
methods: {
|
clickHandle(type, id) {
|
switch (type) {
|
case "1": {
|
this.sosForm.id = id;
|
this.dialogVisible = true;
|
break;
|
}
|
case "4": {
|
this.handle(type, id);
|
break;
|
}
|
|
default:
|
break;
|
}
|
},
|
// 忽略
|
handle(type, id) {
|
let v = {
|
id: id,
|
disposeType: type
|
};
|
this.$api.post("JinhuibraceletApi/dispose", v, e => {
|
demo.toast("已处理");
|
this.dialogVisible = false;
|
this.init();
|
});
|
},
|
submitHandle() {
|
if (!this.assignor) {
|
return demo.toast("请选择分配处理人");
|
}
|
|
let v = {
|
id: this.sosForm.id,
|
disposeUserId: this.assignor,
|
earlyWarningText: this.sosForm.earlyWarningText,
|
disposeType: "3"
|
};
|
this.$api.post("JinhuibraceletApi/dispose", v, e => {
|
demo.toast("已分配");
|
this.dialogVisible = false;
|
this.init();
|
});
|
},
|
handleClose() {
|
this.sosForm.id = "";
|
this.dialogVisible = false;
|
},
|
//分配人
|
distribution() {
|
let user = demo.$session.get("user") || {};
|
let d = {
|
communityId: user.communityId
|
};
|
this.$api.get("JinhuibraceletApi/conductorList", d, e => {
|
this.handlerList = e.map(d => {
|
return {
|
label: d.name,
|
value: d.userId
|
};
|
});
|
});
|
},
|
|
// 置顶
|
onSearch(v) {
|
// if (v.time && v.time.length && v.time[1]) {
|
// v.publishAtBegin = v.time[0];
|
// v.publishAtEnd = v.time[1];
|
// } else {
|
// v.publishAtBegin = "";
|
// v.publishAtEnd = "";
|
// }
|
this.search = demo.copy(v);
|
// delete this.search.time;
|
this.paged.page = 1;
|
this.init();
|
},
|
// 分页点击
|
onPage(v) {
|
if (v.page === this.paged.page && v.page && !v.reset) {
|
return 0;
|
}
|
this.paged.page = v.page;
|
this.paged.limit = v.limit;
|
this.init();
|
},
|
// 获取数据
|
init() {
|
let user = demo.$session.get("user") || {};
|
|
let v = demo.copy(
|
Object.assign(this.os, this.search, {
|
pageNum: this.paged.page,
|
pageSize: this.paged.limit,
|
communityId: user.communityId || ""
|
})
|
);
|
this.$api.get("JinhuibraceletApi/getEarlyWarningList", v, e => {
|
this.paged.total = e.total;
|
this.paged.r++;
|
this.tds = e.records || [];
|
console.log("this.tds---" + JSON.stringify(this.tds));
|
e.records.map((item, index) => {
|
item.index = (this.paged.page - 1) * this.paged.limit + index + 1;
|
if (item.earlyWarningType) {
|
item.earlyWarningType = [
|
"血压异常",
|
"心率异常",
|
"体温异常",
|
"SOS预警"
|
][parseInt(item.earlyWarningType) - 1];
|
}
|
// (1 未处理2 已处理3处理中 4 忽略
|
if (item.disposeType) {
|
item.disposeResult = ["未处理", "已处理", "处理中", "忽略"][
|
parseInt(item.disposeType) - 1
|
];
|
item.resultColor = ["#FB4646", "#05CC96", "#4985FF", "#B4B4B4"][
|
parseInt(item.disposeType) - 1
|
];
|
}
|
});
|
});
|
},
|
onCheck(id) {
|
this.$router.push({
|
path: "/jh_OldManWristband_DeviceWorning_detail",
|
query: { id: id }
|
});
|
}
|
},
|
mounted() {
|
//查询动态分类列表
|
// this.queryDynamic();
|
this.search = {
|
equipmentNumber: "",
|
type: "",
|
userName: "",
|
phone: ""
|
};
|
this.distribution();
|
}
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.page_status {
|
overflow-y: auto;
|
.add,
|
.tab {
|
margin-bottom: 10px;
|
}
|
.yourForm {
|
.el-input {
|
width: 350px;
|
}
|
}
|
}
|
</style>
|