zhengkaixin преди 4 години
родител
ревизия
7877078ed0

+ 22 - 0
src/projects/business/apis/Common/device.js

@@ -29,3 +29,25 @@ export function openDoor(id) {
 		method: 'post',
 	})
 }
+
+
+
+//业务人员 查询摄像头
+export function livePageList(params) {
+
+    return request({
+        url: '/mobile/cameraApi/pageList',
+        data: Qs.stringify(params),
+        method: 'post',
+    })
+}
+//业务人员 update 摄像头
+export function liveUpdate(params) {
+
+    return request({
+
+        url: '/mobile/cameraApi/update',
+        data: Qs.stringify(params),
+        method: 'post',
+    })
+}

+ 2 - 1
src/projects/business/apis/Master/live.js

@@ -39,4 +39,5 @@ export function cameraDetail(params) {
         data: Qs.stringify(params),
         method: 'post',
     })
-}
+}
+

+ 12 - 0
src/projects/business/router/common.js

@@ -134,6 +134,18 @@ const routesCommon = [
 							mode: true
 						}
 					},
+					//手表绑定列表
+					{
+						path: 'watchBindListAdmin',
+						name: 'CommonDeviceWatchBindListAdmin',
+						component: () => import('../views/Common/Device/WatchBindListAdmin.vue'),
+						meta: {
+							requireAuth: true,
+							role: [],
+							title: '手表绑定列表(高管)',
+							mode: true
+						}
+					},
 					//手表绑定详情
 					{
 						path: 'watchBindInfo',

+ 96 - 29
src/projects/business/views/Common/Device/WatchBindInfo.vue

@@ -1,38 +1,105 @@
 <template>
 <div>
-    <header class="mui-bar mui-bar-nav">
-			<h1 class="mui-title">关联新设备</h1>
-			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
-		</header>
-		<div class="mui-content">			
-			<div class="mui-content-padded vongi-qingjiadt vongi-editme">
-				<form class="mui-input-group">
-					<div class="mui-input-row">
-						<label>设备名称</label>
-						<span>居家养老001</span>
-					</div>
-					<div class="mui-input-row">
-						<label>设备序列号</label>
-						<span>E59676248</span>
-					</div>
-				</form>
-			</div>
-			<div class="mui-content-padded vongi-qingjiadt vongi-editme">
-				<form class="mui-input-group">
-					<div class="mui-input-row">
-						<label>分配人员ID<i class="colorfe616c">*</i></label>
-						<input type="text" class="mui-input-clear" placeholder="0">
-					</div>
-				</form>
-			</div>
-			<div class="vongi-btn vongi-login-btn">
-				<button class="mui-btn mui-btn-primary">保  存</button>
-			</div>			
-		</div>
+
+    <common @asynCallBack="asynCallBack"></common>
+    <top-header :pageTitle="pageTitle" :routeName="routeName"></top-header>
+    <div class="mui-content">
+        <div class="mui-content-padded vongi-qingjiadt vongi-editme">
+            <form class="mui-input-group">
+                <div class="mui-input-row">
+                    <label>设备名称</label>
+                    <span>{{detail.name}}</span>
+                </div>
+                <div class="mui-input-row">
+                    <label>设备序列号</label>
+                    <span>{{detail.onId}}</span>
+                </div>
+            </form>
+        </div>
+        <div class="mui-content-padded vongi-qingjiadt vongi-editme">
+            <form class="mui-input-group">
+                <div class="mui-input-row">
+                    <label>分配人员ID<i class="colorfe616c">*</i></label>
+                    <input type="text" class="mui-input-clear" v-model="detail.personId" placeholder="输入人员ID">
+                </div>
+            </form>
+        </div>
+        <div class="vongi-btn vongi-login-btn">
+            <button class="mui-btn mui-btn-primary" @click="submit()">保 存</button>
+        </div>
+    </div>
 </div>
 </template>
 
 <script>
+import * as API_Device from "@/apis/Common/device";
+import Common from '$project/components/Common.vue'
+import Loading from '$project/components/Loading.vue'
+import TopHeader from '$project/components/TopHeader.vue'
+import {
+    mapGetters,
+    mapMutations
+} from 'vuex'
+export default {
+    name: 'CommonDeviceWatchBindInfo',
+    components: {
+        Common,
+        Loading,
+        TopHeader
+    },
+    data() {
+        return {
+            pageTitle: '关联新设备',
+            routeName: "CommonDeviceWatchBindList",
+
+            isLoading: false,
+            detail: {},
+
+        }
+    },
+    created() {
+        this.detail = this.$route.query;
+        this.routeName = this.$route.query.routeName;
+    },
+    methods: {
+        //获取详情
+        submit() {
+
+            this.isLoading = true;
+            if (!this.detail.personId) {
+                this.detail.personId = "0"
+            }
+            API_Device.liveUpdate(this.detail).then(response => {
+
+                this.isLoading = false;
+                mui.toast("操作成功");
+                //跳转首页
+                this.$router.push({
+                    name: this.routeName,
+                    query: {}
+                })
+            }).catch(error => {
+                this.isLoading = false;
+                mui.toast(error);
+            })
+        },
+
+        asynCallBack() {
+
+        },
+    },
+    mounted() {
+        //获取详情
+
+    },
+    destroyed() {},
+    computed: {
+        ...mapGetters({
+            openId: 'wx_openid',
+            token: 'token',
+        })
+    },
+}
 </script>
 
 <style scoped src="$project/assets/css/xpwyfyy.css"></style>

+ 113 - 22
src/projects/business/views/Common/Device/WatchBindList.vue

@@ -1,31 +1,122 @@
 <template>
 <div>
-    <header class="mui-bar mui-bar-nav">
-			<h1 class="mui-title">设备维护</h1>
-			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
-		</header>
-		<div class="mui-content">
-			<div class="mui-content-padded">
-				<ul class="mui-table-view vongi-jy-ul">
-					<li class="mui-table-view-cell">
-						<a class="mui-navigate-right" href="#">
-							居家养老001
-							<span class="mui-pull-right">10016</span>
-						</a>
-					</li>
-					<li class="mui-table-view-cell">
-						<a class="mui-navigate-right" href="#">
-							居家养老001
-							<span class="mui-pull-right">10016</span>
-						</a>
-					</li>
-				</ul>
-			</div>
-		</div>
+    <common @asynCallBack="asynCallBack"></common>
+    <top-header :pageTitle="pageTitle" :routeName="routeName"></top-header>
+    <div class="mui-content">
+        <div class="mui-content-padded">
+            <ul class="mui-table-view vongi-jy-ul">
+
+                <li class="mui-table-view-cell" v-for="(item,index) in recordList">
+                    <a @click="goto(item)" class="mui-navigate-right">
+                        {{item.deviceName}}
+                        <span class="mui-pull-right">{{item.personId}}</span>
+                    </a>
+                </li>
+
+            </ul>
+        </div>
+    </div>
+    <NullList :remark="'暂无设备'" v-if="!recordList.length"></NullList>
+
+    <loading :visible="isLoading"></loading>
 </div>
 </template>
 
 <script>
+import * as API_Device from "@/apis/Common/device";
+import NullList from "$project/components/NullList.vue";
+
+import Common from "$project/components/Common.vue";
+import Loading from "$project/components/Loading.vue";
+import TopHeader from "$project/components/TopHeader.vue";
+import isReachBottom from "$project/utils/isReachBottom";
+
+import {
+    mapGetters,
+    mapMutations
+} from "vuex";
+export default {
+    name: "CommonDeviceWatchBindList",
+    components: {
+        Common,
+        Loading,
+        TopHeader,
+        NullList,
+    },
+    data() {
+        return {
+            pageTitle: "设备维护",
+
+            isLoading: false,
+
+            listForm: {
+                pageIndex: 1,
+                pageSize: 20,
+                totalPage: 1,
+            },
+            routeName: "Master",
+            recordList: [],
+        };
+    },
+    created() {},
+    methods: {
+        goto(mod) {
+            if (mod.personId) {
+
+                mui.toast("已设置,如需修改,联系中层以上人员重置");
+                return;
+            }
+            //跳转首页
+            this.$router.push({
+                name: 'CommonDeviceWatchBindInfo',
+                query: {
+                    id: mod.id,
+                    name: mod.deviceName,
+                    onId: mod.deviceSerial,
+                    personId: mod.personId,
+                    routeName: 'CommonDeviceWatchBindList',
+                }
+            })
+        },
+        //获取列表
+        getList() {
+            this.isLoading = true;
+
+            API_Device.livePageList(this.listForm)
+                .then((response) => {
+                    if (response) {
+                        if (this.listForm.pageIndex == 1) {
+                            this.recordList = response.data;
+                            this.listForm.pageIndex = response.pageNumber;
+                            this.listForm.totalPage = response.totalPage;
+                        } else {
+                            this.recordList = [...this.recordList, ...response.data];
+                        }
+                    }
+                    this.listForm.pageIndex++;
+                    this.isLoading = false;
+                })
+                .catch((error) => {
+                    this.isLoading = false;
+                    mui.toast(error);
+                });
+        },
+        asynCallBack() {},
+    },
+    mounted() {
+        //获取列表
+        this.getList();
+    },
+    destroyed() {},
+    computed: {
+        ...mapGetters({
+            openId: "wx_openid",
+            token: "token",
+            person_data: "person_data",
+            person_popedom: "person_popedom",
+        }),
+    },
+};
 </script>
 
 <style scoped src="$project/assets/css/xpwyfyy.css"></style>

+ 121 - 0
src/projects/business/views/Common/Device/WatchBindListAdmin.vue

@@ -0,0 +1,121 @@
+<template>
+<div>
+    <common @asynCallBack="asynCallBack"></common>
+    <top-header :pageTitle="pageTitle" :routeName="routeName"></top-header>
+    <div class="mui-content">
+        <div class="mui-content-padded">
+            <ul class="mui-table-view vongi-jy-ul">
+
+                <li class="mui-table-view-cell" v-for="(item,index) in recordList">
+                    <a @click="goto(item)" class="mui-navigate-right">
+                        {{item.deviceName}}
+                        <span class="mui-pull-right">{{item.personId}}</span>
+                    </a>
+                </li>
+
+            </ul>
+        </div>
+    </div>
+    <NullList :remark="'暂无设备'" v-if="!recordList.length"></NullList>
+
+    <loading :visible="isLoading"></loading>
+</div>
+</template>
+
+<script>
+import * as API_Device from "@/apis/Common/device";
+import NullList from "$project/components/NullList.vue";
+
+import Common from "$project/components/Common.vue";
+import Loading from "$project/components/Loading.vue";
+import TopHeader from "$project/components/TopHeader.vue";
+import isReachBottom from "$project/utils/isReachBottom";
+
+import {
+    mapGetters,
+    mapMutations
+} from "vuex";
+export default {
+    name: "CommonDeviceWatchBindListAdmin",
+    components: {
+        Common,
+        Loading,
+        TopHeader,
+        NullList,
+    },
+    data() {
+        return {
+            pageTitle: "设备维护",
+
+            isLoading: false,
+
+            listForm: {
+                pageIndex: 1,
+                pageSize: 20,
+                totalPage: 1,
+            },
+            routeName: "Master",
+            recordList: [],
+        };
+    },
+    created() {},
+    methods: {
+        goto(mod) {
+
+            //跳转首页
+            this.$router.push({
+                name: 'CommonDeviceWatchBindInfo',
+                query: {
+                    id: mod.id,
+                    name: mod.deviceName,
+                    onId: mod.deviceSerial,
+                    personId: mod.personId,
+                    routeName: 'CommonDeviceWatchBindListAdmin',
+                }
+            })
+        },
+        //获取列表
+        getList() {
+            this.isLoading = true;
+
+            API_Device.livePageList(this.listForm)
+                .then((response) => {
+                    if (response) {
+                        if (this.listForm.pageIndex == 1) {
+                            this.recordList = response.data;
+                            this.listForm.pageIndex = response.pageNumber;
+                            this.listForm.totalPage = response.totalPage;
+                        } else {
+                            this.recordList = [...this.recordList, ...response.data];
+                        }
+                    }
+                    this.listForm.pageIndex++;
+                    this.isLoading = false;
+                })
+                .catch((error) => {
+                    this.isLoading = false;
+                    mui.toast(error);
+                });
+        },
+        asynCallBack() {},
+    },
+    mounted() {
+        //获取列表
+        this.getList();
+    },
+    destroyed() {},
+    computed: {
+        ...mapGetters({
+            openId: "wx_openid",
+            token: "token",
+            person_data: "person_data",
+            person_popedom: "person_popedom",
+        }),
+    },
+};
+</script>
+
+<style scoped src="$project/assets/css/xpwyfyy.css"></style>
+<style src="$project/assets/css/iconfont.css"></style>
+<style>
+</style>