Shannon_mu 3 anni fa
parent
commit
067ec06bbb

+ 80 - 118
accessControlSystem/src/views/accessControlAuthorization/employeeAuthorization/index.vue

@@ -1,87 +1,73 @@
 <template>
-    <div class="content main">
+    <div class="main">
         <template v-if="tableShow">
-            <organ-tree @organId="currentOrganId" :buildingType="1"></organ-tree>
-            <div class="content-right">
-                <div class="search">
-                    <el-input
-                        clearable
-                        placeholder="输入姓名/手机号"
-                        class="search-input"
-                        v-trim
-                        v-model.trim="mixins_query.name"
-                    ></el-input>
-                    <el-select v-model="mixins_query.householdType" clearable placeholder="住户类型">
-                        <el-option v-for="(item, index) in householdType" :key="index" :label="item.label" :value="item.status">{{
-                            item.label
-                        }}</el-option>
-                    </el-select>
-                    <el-button
-                        class="search-btn"
-                        type="primary"
-                        @click="mixins_search()"
-                        :disabled="mixins_onQuery"
-                        :loading="mixins_onQuery"
-                        icon="el-icon-search"
-                        >搜索</el-button
-                    >
-                </div>
-                <zz-table
-                    :settings="{ showIndex: true, stripe: true }"
-                    :cols="cols"
+            <div class="search">
+                <el-input
+                    clearable
+                    placeholder="输入员工名称/手机号"
+                    class="search-input"
+                    v-trim
+                    v-model.trim="mixins_query.name"
+                ></el-input>
+                <el-select v-model="mixins_query.communityId" placeholder="选择社区" clearable>
+                    <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
+                </el-select>
+                <el-button
+                    class="search-btn"
+                    type="primary"
+                    @click="mixins_search()"
+                    :disabled="mixins_onQuery"
                     :loading="mixins_onQuery"
-                    :data="mixins_list"
-                    :pageset="mixins_pageset"
-                    @page-change="pageChange"
+                    icon="el-icon-search"
+                    >搜索</el-button
                 >
-                    <template slot-scope="scope" slot="roomNumber">
-                        <div class="table-list" v-for="(item, index) in scope.row.houseList" :key="index">
-                            {{ item.buildingName }}-{{ CheckChinese(item.unitName, '单元') }}-{{ item.roomNumber }}
-                        </div>
-                    </template>
-                    <template slot-scope="scope" slot="householdType">
-                        <div class="table-list" v-for="(item, index) in scope.row.houseList" :key="index">
-                            <template v-if="item.householdType === 1"> 业主 </template>
-                            <template v-else-if="item.householdType === 2"> 亲属 </template>
-                            <template v-else> 租客 </template>
-                        </div>
-                    </template>
-                    <template slot-scope="scope" slot="faceStatus">
-                        <span v-if="scope.row.faceStatus == 1" class="mainText">启用</span>
-                        <span v-else-if="scope.row.faceStatus == 0" class="redText">禁用</span>
-                    </template>
-                    <template slot-scope="scope" slot="appStatus">
-                        <span v-if="scope.row.appStatus == 1" class="mainText">启用</span>
-                        <span v-else-if="scope.row.appStatus == 0" class="redText">禁用</span>
-                    </template>
-
-                    <template slot-scope="scope" slot="opt">
-                        <div class="opt">
-                            <el-tooltip class="item" effect="light" placement="bottom" content="查看">
-                                <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetail(scope.row)"></i>
-                            </el-tooltip>
-                        </div>
-                    </template>
-                </zz-table>
             </div>
+            <zz-table
+                :settings="{ showIndex: true, stripe: true }"
+                :cols="cols"
+                :loading="mixins_onQuery"
+                :data="mixins_list"
+                :pageset="mixins_pageset"
+                @page-change="pageChange"
+            >
+                <template slot-scope="scope" slot="communityName">
+                    <div class="table-list" v-for="item in scope.row.houseList" :key="item.id">
+                        {{ item.communityName }}
+                    </div>
+                </template>
+                <template slot-scope="scope" slot="faceStatus">
+                    <span v-if="scope.row.faceStatus == 1" class="mainText">启用</span>
+                    <span v-else-if="scope.row.faceStatus == 0" class="redText">禁用</span>
+                </template>
+                <template slot-scope="scope" slot="appStatus">
+                    <span v-if="scope.row.appStatus == 1" class="mainText">启用</span>
+                    <span v-else-if="scope.row.appStatus == 0" class="redText">禁用</span>
+                </template>
+                <template slot-scope="scope" slot="opt">
+                    <div class="opt">
+                        <el-tooltip class="item" effect="light" placement="bottom" content="查看">
+                            <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetail(scope.row)"></i>
+                        </el-tooltip>
+                    </div>
+                </template>
+            </zz-table>
         </template>
-        <look-page v-else :params="thisData" @clerOwnerStatus="clerOwnerStatus"></look-page>
+        <resident-look-page v-else :params="thisData" @clerOwnerStatus="clerOwnerStatus"></resident-look-page>
     </div>
 </template>
 
 <script>
 import list from '@utils/list.js';
-import lookPage from '../stepPage/lookPage.vue';
-
+import residentLookPage from '../stepPage/residentLookPage.vue';
 export default {
     mixins: [list],
-    components: { lookPage },
+    components: { residentLookPage },
     data() {
         return {
             currentId: '',
             cols: [
                 {
-                    label: '姓名',
+                    label: '用户名',
                     prop: 'name'
                 },
                 {
@@ -89,22 +75,18 @@ export default {
                     prop: 'phone'
                 },
                 {
-                    label: '身份证号',
+                    label: '公司',
                     prop: 'idNumber'
                 },
                 {
                     label: '社区名称',
-                    prop: 'communityName'
+                    prop: 'communityName',
+                    slot: 'communityName'
                 },
                 {
-                    label: '住户类型',
-                    prop: 'householdType',
-                    slot: 'householdType'
-                },
-                {
-                    label: '房屋地址',
-                    prop: 'roomNumber',
-                    slot: 'roomNumber'
+                    label: 'app授权',
+                    prop: 'appStatus',
+                    slot: 'appStatus'
                 },
                 {
                     label: '人脸授权',
@@ -112,52 +94,32 @@ export default {
                     slot: 'faceStatus'
                 },
                 {
-                    label: 'app授权',
-                    prop: 'appStatus',
-                    slot: 'appStatus'
-                },
-                {
-                    label: '门禁卡数量',
+                    label: '门禁卡',
                     prop: 'cardNum'
                 },
+
                 {
                     label: '操作',
                     slot: 'opt',
                     width: 130
                 }
             ],
-            householdType: [
-                {
-                    status: 1,
-                    label: '业主'
-                },
-                {
-                    status: 2,
-                    label: '亲属'
-                },
-                {
-                    status: 3,
-                    label: '租客'
-                }
-            ],
-            thisLeftData: {},
             thisData: {},
+            communityArr: [],
             mixins_post: 'get',
             tableShow: true
         };
     },
     methods: {
-        lookDetail(row) {
-            this.thisData = row;
-            this.tableShow = false;
-        },
-        clerOwnerStatus() {
-            this.thisData = {};
-            this.tableShow = true;
-            this.mixins_search();
-        },
-        currentOrganId(data) {
-            this.currentId = data || '';
+        getorgTree() {
+            this.$http
+                .get('/sc-community/assets/community/list')
+                .then((data) => {
+                    this.communityArr = data.data;
+                    this.$store.commit('setAreaSelect', data.data);
+                })
+
+                .catch(function () {});
         },
         CheckChinese(val, name) {
             var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
@@ -169,22 +131,22 @@ export default {
         },
         checkDateType(time) {
             return !!time ? this.$moment(new Date(time)).format('YYYY-MM-DD') : '--';
-        }
-    },
-    watch: {
-        currentId(newValue, oldValue) {
-            this.mixins_query.communityId = newValue.communityId;
-            this.mixins_query.buildingId = newValue.buildingId;
-            this.mixins_query.unitName = newValue.unitName;
-            this.mixins_query.roomNumber = newValue.houseId;
-            this.thisLeftData = newValue;
+        },
+        lookDetail(row) {
+            this.thisData = row;
+            this.tableShow = false;
+        },
+        clerOwnerStatus() {
+            this.thisData = {};
+            this.tableShow = true;
             this.mixins_search();
         }
     },
     created() {
+        this.getorgTree();
         this.mixins_dataUrl = '/sc-gate-web/auth/userPage'; // 分页查询接口
         this.mixins_query = {};
-        this.mixins_search('search');
+        this.mixins_search();
     }
 };
 </script>

+ 119 - 81
accessControlSystem/src/views/accessControlAuthorization/residentAuthorization/index.vue

@@ -1,73 +1,87 @@
 <template>
-    <div class="main">
+    <div class="content main">
         <template v-if="tableShow">
-            <div class="search">
-                <el-input
-                    clearable
-                    placeholder="输入员工名称/手机号"
-                    class="search-input"
-                    v-trim
-                    v-model.trim="mixins_query.name"
-                ></el-input>
-                <el-select v-model="mixins_query.communityId" placeholder="选择社区" clearable>
-                    <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
-                </el-select>
-                <el-button
-                    class="search-btn"
-                    type="primary"
-                    @click="mixins_search()"
-                    :disabled="mixins_onQuery"
+            <organ-tree @organId="currentOrganId" :buildingType="1"></organ-tree>
+            <div class="content-right">
+                <div class="search">
+                    <el-input
+                        clearable
+                        placeholder="输入姓名/手机号"
+                        class="search-input"
+                        v-trim
+                        v-model.trim="mixins_query.name"
+                    ></el-input>
+                    <el-select v-model="mixins_query.householdType" clearable placeholder="住户类型">
+                        <el-option v-for="(item, index) in householdType" :key="index" :label="item.label" :value="item.status">{{
+                            item.label
+                        }}</el-option>
+                    </el-select>
+                    <el-button
+                        class="search-btn"
+                        type="primary"
+                        @click="mixins_search()"
+                        :disabled="mixins_onQuery"
+                        :loading="mixins_onQuery"
+                        icon="el-icon-search"
+                        >搜索</el-button
+                    >
+                </div>
+                <zz-table
+                    :settings="{ showIndex: true, stripe: true }"
+                    :cols="cols"
                     :loading="mixins_onQuery"
-                    icon="el-icon-search"
-                    >搜索</el-button
+                    :data="mixins_list"
+                    :pageset="mixins_pageset"
+                    @page-change="pageChange"
                 >
+                    <template slot-scope="scope" slot="roomNumber">
+                        <div class="table-list" v-for="item in scope.row.houseList" :key="item.id">
+                            {{ item.buildingName }}-{{ CheckChinese(item.unitName, '单元') }}-{{ item.roomNumber }}
+                        </div>
+                    </template>
+                    <template slot-scope="scope" slot="householdType">
+                        <div class="table-list" v-for="(item, index) in scope.row.houseList" :key="index">
+                            <template v-if="item.householdType === 1"> 业主 </template>
+                            <template v-else-if="item.householdType === 2"> 亲属 </template>
+                            <template v-else> 租客 </template>
+                        </div>
+                    </template>
+                    <template slot-scope="scope" slot="faceStatus">
+                        <span v-if="scope.row.faceStatus == 1" class="mainText">启用</span>
+                        <span v-else-if="scope.row.faceStatus == 0" class="redText">禁用</span>
+                    </template>
+                    <template slot-scope="scope" slot="appStatus">
+                        <span v-if="scope.row.appStatus == 1" class="mainText">启用</span>
+                        <span v-else-if="scope.row.appStatus == 0" class="redText">禁用</span>
+                    </template>
+
+                    <template slot-scope="scope" slot="opt">
+                        <div class="opt">
+                            <el-tooltip class="item" effect="light" placement="bottom" content="查看">
+                                <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetail(scope.row)"></i>
+                            </el-tooltip>
+                        </div>
+                    </template>
+                </zz-table>
             </div>
-            <zz-table
-                :settings="{ showIndex: true, stripe: true }"
-                :cols="cols"
-                :loading="mixins_onQuery"
-                :data="mixins_list"
-                :pageset="mixins_pageset"
-                @page-change="pageChange"
-            >
-                <template slot-scope="scope" slot="communityName">
-                    <div class="table-list" v-for="(item, index) in scope.row.houseList" :key="index">
-                        {{ item.communityName }}
-                    </div>
-                </template>
-                <template slot-scope="scope" slot="faceStatus">
-                    <span v-if="scope.row.faceStatus == 1" class="mainText">启用</span>
-                    <span v-else-if="scope.row.faceStatus == 0" class="redText">禁用</span>
-                </template>
-                <template slot-scope="scope" slot="appStatus">
-                    <span v-if="scope.row.appStatus == 1" class="mainText">启用</span>
-                    <span v-else-if="scope.row.appStatus == 0" class="redText">禁用</span>
-                </template>
-                <template slot-scope="scope" slot="opt">
-                    <div class="opt">
-                        <el-tooltip class="item" effect="light" placement="bottom" content="查看">
-                            <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetail(scope.row)"></i>
-                        </el-tooltip>
-                    </div>
-                </template>
-            </zz-table>
         </template>
-        <resident-look-page v-else :params="thisData" @clerOwnerStatus="clerOwnerStatus"></resident-look-page>
+        <look-page v-else :params="thisData" @clerOwnerStatus="clerOwnerStatus"></look-page>
     </div>
 </template>
 
 <script>
 import list from '@utils/list.js';
-import residentLookPage from '../stepPage/residentLookPage.vue';
+import lookPage from '../stepPage/lookPage.vue';
+
 export default {
     mixins: [list],
-    components: { residentLookPage },
+    components: { lookPage },
     data() {
         return {
             currentId: '',
             cols: [
                 {
-                    label: '用户名',
+                    label: '姓名',
                     prop: 'name'
                 },
                 {
@@ -75,18 +89,22 @@ export default {
                     prop: 'phone'
                 },
                 {
-                    label: '公司',
+                    label: '身份证号',
                     prop: 'idNumber'
                 },
                 {
                     label: '社区名称',
-                    prop: 'communityName',
-                    slot: 'communityName'
+                    prop: 'communityName'
                 },
                 {
-                    label: 'app授权',
-                    prop: 'appStatus',
-                    slot: 'appStatus'
+                    label: '住户类型',
+                    prop: 'householdType',
+                    slot: 'householdType'
+                },
+                {
+                    label: '房屋地址',
+                    prop: 'roomNumber',
+                    slot: 'roomNumber'
                 },
                 {
                     label: '人脸授权',
@@ -94,32 +112,52 @@ export default {
                     slot: 'faceStatus'
                 },
                 {
-                    label: '门禁卡',
+                    label: 'app授权',
+                    prop: 'appStatus',
+                    slot: 'appStatus'
+                },
+                {
+                    label: '门禁卡数量',
                     prop: 'cardNum'
                 },
-
                 {
                     label: '操作',
                     slot: 'opt',
                     width: 130
                 }
             ],
+            householdType: [
+                {
+                    status: 1,
+                    label: '业主'
+                },
+                {
+                    status: 2,
+                    label: '亲属'
+                },
+                {
+                    status: 3,
+                    label: '租客'
+                }
+            ],
+            thisLeftData: {},
             thisData: {},
-            communityArr: [],
             mixins_post: 'get',
             tableShow: true
         };
     },
     methods: {
-        getorgTree() {
-            this.$http
-                .get('/sc-community/assets/community/list')
-                .then((data) => {
-                    this.communityArr = data.data;
-                    this.$store.commit('setAreaSelect', data.data);
-                })
-
-                .catch(function () {});
+        lookDetail(row) {
+            this.thisData = row;
+            this.tableShow = false;
+        },
+        clerOwnerStatus() {
+            this.thisData = {};
+            this.tableShow = true;
+            this.mixins_search();
+        },
+        currentOrganId(data) {
+            this.currentId = data || '';
         },
         CheckChinese(val, name) {
             var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
@@ -131,22 +169,22 @@ export default {
         },
         checkDateType(time) {
             return !!time ? this.$moment(new Date(time)).format('YYYY-MM-DD') : '--';
-        },
-        lookDetail(row) {
-            this.thisData = row;
-            this.tableShow = false;
-        },
-        clerOwnerStatus() {
-            this.thisData = {};
-            this.tableShow = true;
+        }
+    },
+    watch: {
+        currentId(newValue, oldValue) {
+            this.mixins_query.communityId = newValue.communityId;
+            this.mixins_query.buildingId = newValue.buildingId;
+            this.mixins_query.unitName = newValue.unitName;
+            this.mixins_query.roomNumber = newValue.houseId;
+            this.thisLeftData = newValue;
             this.mixins_search();
         }
     },
     created() {
-        this.getorgTree();
         this.mixins_dataUrl = '/sc-gate-web/auth/residentPage'; // 分页查询接口
         this.mixins_query = {};
-        this.mixins_search();
+        this.mixins_search('search');
     }
 };
 </script>
@@ -160,4 +198,4 @@ export default {
         padding: 0;
     }
 }
-</style>
+</style>

+ 150 - 19
accessControlSystem/src/views/accessControlAuthorization/stepPage/lookPage.vue

@@ -2,12 +2,13 @@
     <div class="content">
         <div class="top-title">
             <h1>
-                <span>{{ detailsData.name }}</span> <span class="fenge"></span><span class="twoText">所属公司:{{}}</span
+                <span>{{ detailsData.name }}</span> <span class="fenge"></span
                 ><span class="twoText">所属社区:{{ detailsData.communityName }}</span>
             </h1>
             <el-button class="right" type="primary" @click="close()">返回</el-button>
             <div class="text">
                 <span>手机号:{{ detailsData.phone }}</span>
+                <span>身份证号:{{ detailsData.idNumber }}</span>
             </div>
         </div>
         <div class="contentDetail">
@@ -18,7 +19,21 @@
             </div>
             <div class="content-item" v-show="tabsIndex === 0">
                 <div class="formContent-item_title">围墙机</div>
+                <el-checkbox-group v-model="formData.gateIds" class="mgB20">
+                    <template v-for="(item, index) in gateList">
+                        <el-checkbox-button :key="index" v-if="item.gateType == 1" class="buttonSelect" :label="item.id">{{
+                            item.deviceName
+                        }}</el-checkbox-button>
+                    </template>
+                </el-checkbox-group>
                 <div class="formContent-item_title">单元机</div>
+                <el-checkbox-group v-model="formData.gateIds" class="mgB20">
+                    <template v-for="(item, index) in gateList">
+                        <el-checkbox-button :key="index" v-if="item.gateType == 2" class="buttonSelect" :label="item.id">{{
+                            item.deviceName
+                        }}</el-checkbox-button>
+                    </template>
+                </el-checkbox-group>
                 <div class="formContent-item_title">权限配置</div>
                 <div class="widthFlex">
                     <el-form ref="form" :model="formData" :rules="formRules" label-width="110px">
@@ -52,7 +67,7 @@
                                 <el-radio :label="1">禁用</el-radio>
                             </el-radio-group>
                         </el-form-item>
-                        <el-form-item label="门禁机照片" prop="facePictureUrl">
+                        <el-form-item label="门禁机照片" prop="facePictureUrl" v-if="formData.faceStatus == 0">
                             <div class="imgdis-div" v-show="formData.facePictureUrl">
                                 <i class="el-icon-delete" @click="delformphoto"></i>
                                 <img :src="envConfig.baseImgApi + formData.facePictureUrl" alt="" width="60" height="60" />
@@ -63,11 +78,11 @@
                                 ref="uploaduserlogo"
                                 class="mini-upload"
                                 :limit="1"
-                                action="/sc-user-center/user/addUserPhoto"
+                                action="/sc-community/upload/uploadFile"
                                 list-type="picture-card"
                                 :on-success="uploadsuccess"
                                 :auto-upload="true"
-                                name="avatarfile"
+                                name="file"
                             >
                                 <i slot="default" class="el-icon-plus"></i>
                                 <div slot="file" slot-scope="{ file }">
@@ -82,6 +97,9 @@
                         </el-form-item>
                     </el-form>
                 </div>
+                <div style="text-align: right">
+                    <el-button type="primary" @click="addInstall">保存</el-button>
+                </div>
             </div>
             <div class="content-item" v-show="tabsIndex === 1">
                 <zz-table
@@ -127,10 +145,14 @@ export default {
                 }
             ],
             formData: {
-                faceStatus: '',
-                appStatus: '',
+                faceStatus: 0,
+                appStatus: 0,
                 authType: 1,
-                facePictureUrl: ''
+                type: '',
+                communityId: '',
+                userId: '',
+                facePictureUrl: '',
+                gateIds: []
             },
             formRules: {
                 facePictureUrl: this.$valid.custome({
@@ -151,33 +173,35 @@ export default {
             },
             pickerTime: '',
             detailsData: {},
+            gateList: [],
             cols: [
                 {
                     label: '卡号',
-                    prop: 'name'
+                    prop: 'cardNo'
                 },
                 {
                     label: '卡类型',
-                    prop: 'phone'
+                    prop: 'cardType'
                 },
                 {
                     label: '卡状态',
-                    prop: 'idNumber'
+                    prop: 'cardStatus'
                 },
                 {
                     label: '开卡时间',
-                    prop: 'communityName'
+                    prop: 'createDate'
                 },
                 {
                     label: '到期时间',
-                    prop: 'appStatus'
+                    prop: 'expirationTime'
                 },
                 {
                     label: '操作',
                     slot: 'opt',
                     width: 130
                 }
-            ]
+            ],
+            mixins_post: 'get'
         };
     },
     methods: {
@@ -203,20 +227,127 @@ export default {
             let start = '00:00:00',
                 end = '23:59:59';
             if (!!e) {
-                this.formData.startDate = `${e[0]} ${start}`;
-                this.formData.endDate = `${e[1]} ${end}`;
+                // this.formData.startDate = `${e[0]} ${start}`;
+                // this.formData.endDate = `${e[1]} ${end}`;
+                this.formData.startDate = `${e[0]}`;
+                this.formData.endDate = `${e[1]}`;
             } else {
                 this.formData.startDate = ``;
                 this.formData.endDate = ``;
             }
+        },
+        getGateList(communityId, resolve) {
+            this.$http.get('/sc-gate-web/gate/list', { communityId: communityId }).then(({ msg, data, status }) => {
+                if (status == 0) {
+                    this.gateList = data;
+                } else {
+                    this.$message.error(msg);
+                }
+                resolve && resolve(true);
+            });
+        },
+        addInstall() {
+            this.$refs.form.validate((valid) => {
+                let installData = JSON.parse(JSON.stringify(this.formData));
+                if (installData.faceStatus == 1) {
+                    delete installData.facePictureUrl;
+                }
+                if (installData.authType == 1) {
+                    delete installData.startDate;
+                    delete installData.endDate;
+                }
+                if (valid) {
+                    this.$http
+                        .post('/sc-gate-web/auth/save', installData)
+                        .then(({ status, msg }) => {
+                            if (status == 0) {
+                                this.$message.success(msg);
+                                this.$emit('clerOwnerStatus');
+                            } else {
+                                this.$message.error(msg);
+                            }
+                        })
+                        .catch(() => {});
+                }
+            });
+        },
+        getList() {
+            if (!this.mixins_dataUrl) {
+                this.mixins_onQuery = false;
+                return;
+            }
+            let data = Object.assign({}, this.mixins_pageset, this.mixins_query);
+            this.mixins_onQuery = true;
+            delete data.total;
+            this.$http[this.mixins_post](this.mixins_dataUrl, data)
+                .then(({ status, data, msg }) => {
+                    this.mixins_onQuery = false;
+                    if (0 === status) {
+                        this.mixins_list = data;
+                    } else {
+                        this.$message.error(msg);
+                    }
+                })
+                .catch((err) => {
+                    this.mixins_onQuery = false;
+                });
+        },
+        lookPage(row) {
+            new Promise((resolve) => {
+                this.$store.dispatch('addPopup', {
+                    url: '/accessControlCard/popups/lookPage.vue',
+                    width: '494px',
+                    height: '400px',
+                    props: {
+                        callback: resolve,
+                        row
+                    },
+                    hideStar: false,
+                    title: '查看门禁'
+                });
+            }).then(() => {
+                this.mixins_search();
+            });
+        },
+        getIdList(communityId, type, userId) {
+            this.$http
+                .get('/sc-gate-web/auth/findDetail', { communityId: communityId, type: type, userId: userId })
+                .then(({ msg, data, status }) => {
+                    if (status == 0) {
+                        if (data !== null) {
+                            const { appStatus, authType, endDate, startDate, faceStatus, facePictureUrl, gateIds } = data;
+                            this.formData.appStatus = appStatus;
+                            this.formData.authType = authType;
+                            this.formData.endDate = endDate;
+                            this.formData.startDate = startDate;
+                            this.pickerTime = [!!startDate ? startDate : '', !!endDate ? endDate : ''];
+                            this.formData.faceStatus = faceStatus;
+                            this.formData.facePictureUrl = facePictureUrl;
+                            this.formData.gateIds = gateIds;
+                        }
+                    } else {
+                        this.$message.error(msg);
+                    }
+                });
         }
     },
     created() {
         this.detailsData = this.params;
-        console.log(this.params);
-        this.mixins_dataUrl = '/sc-gate-web/auth/residentPage'; // 分页查询接口
-        this.mixins_query = {};
-        this.mixins_search();
+        const { communityId, id } = this.params;
+        this.getIdList(communityId, 1, id);
+        this.formData.userId = id;
+        this.formData.communityId = communityId;
+        this.formData.type = 1;
+        new Promise((resolve) => {
+            this.getGateList(this.params.communityId, resolve);
+        }).then(() => {
+            this.mixins_dataUrl = '/sc-gate-web/gateCard/list'; // 分页查询接口
+            this.mixins_query = {
+                userId: this.params.id,
+                cardType: 1
+            };
+            this.mixins_search();
+        });
     }
 };
 </script>

+ 14 - 111
accessControlSystem/src/views/accessControlAuthorization/stepPage/residentLookPage.vue

@@ -2,13 +2,12 @@
     <div class="content">
         <div class="top-title">
             <h1>
-                <span>{{ detailsData.name }}</span> <span class="fenge"></span
+                <span>{{ detailsData.name }}</span> <span class="fenge"></span><span class="twoText">所属公司:{{}}</span
                 ><span class="twoText">所属社区:{{ detailsData.communityName }}</span>
             </h1>
             <el-button class="right" type="primary" @click="close()">返回</el-button>
             <div class="text">
                 <span>手机号:{{ detailsData.phone }}</span>
-                <span>身份证号:{{ detailsData.idNumber }}</span>
             </div>
         </div>
         <div class="contentDetail">
@@ -19,21 +18,7 @@
             </div>
             <div class="content-item" v-show="tabsIndex === 0">
                 <div class="formContent-item_title">围墙机</div>
-                <el-checkbox-group v-model="formData.gateIds" class="mgB20">
-                    <template v-for="(item, index) in gateList">
-                        <el-checkbox-button :key="index" v-if="item.gateType == 1" class="buttonSelect" :label="item.id">{{
-                            item.deviceName
-                        }}</el-checkbox-button>
-                    </template>
-                </el-checkbox-group>
                 <div class="formContent-item_title">单元机</div>
-                <el-checkbox-group v-model="formData.gateIds" class="mgB20">
-                    <template v-for="(item, index) in gateList">
-                        <el-checkbox-button :key="index" v-if="item.gateType == 2" class="buttonSelect" :label="item.id">{{
-                            item.deviceName
-                        }}</el-checkbox-button>
-                    </template>
-                </el-checkbox-group>
                 <div class="formContent-item_title">权限配置</div>
                 <div class="widthFlex">
                     <el-form ref="form" :model="formData" :rules="formRules" label-width="110px">
@@ -78,11 +63,11 @@
                                 ref="uploaduserlogo"
                                 class="mini-upload"
                                 :limit="1"
-                                action="/sc-community/upload/uploadFile"
+                                action="/sc-user-center/user/addUserPhoto"
                                 list-type="picture-card"
                                 :on-success="uploadsuccess"
                                 :auto-upload="true"
-                                name="file"
+                                name="avatarfile"
                             >
                                 <i slot="default" class="el-icon-plus"></i>
                                 <div slot="file" slot-scope="{ file }">
@@ -97,9 +82,6 @@
                         </el-form-item>
                     </el-form>
                 </div>
-                <div style="text-align: right">
-                    <el-button type="primary" @click="addInstall">保存</el-button>
-                </div>
             </div>
             <div class="content-item" v-show="tabsIndex === 1">
                 <zz-table
@@ -148,8 +130,7 @@ export default {
                 faceStatus: '',
                 appStatus: '',
                 authType: 1,
-                facePictureUrl: '',
-                gateIds: []
+                facePictureUrl: ''
             },
             formRules: {
                 facePictureUrl: this.$valid.custome({
@@ -170,35 +151,33 @@ export default {
             },
             pickerTime: '',
             detailsData: {},
-            gateList: [],
             cols: [
                 {
                     label: '卡号',
-                    prop: 'cardNo'
+                    prop: 'name'
                 },
                 {
                     label: '卡类型',
-                    prop: 'cardType'
+                    prop: 'phone'
                 },
                 {
                     label: '卡状态',
-                    prop: 'cardStatus'
+                    prop: 'idNumber'
                 },
                 {
                     label: '开卡时间',
-                    prop: 'createDate'
+                    prop: 'communityName'
                 },
                 {
                     label: '到期时间',
-                    prop: 'expirationTime'
+                    prop: 'appStatus'
                 },
                 {
                     label: '操作',
                     slot: 'opt',
                     width: 130
                 }
-            ],
-            mixins_post: 'get'
+            ]
         };
     },
     methods: {
@@ -230,90 +209,14 @@ export default {
                 this.formData.startDate = ``;
                 this.formData.endDate = ``;
             }
-        },
-        getGateList(communityId, resolve) {
-            this.$http.get('/sc-gate-web/gate/list', { communityId: communityId }).then(({ msg, data, status }) => {
-                if (status == 0) {
-                    this.gateList = data;
-                } else {
-                    this.$message.error(msg);
-                }
-                resolve && resolve(true);
-            });
-        },
-        addInstall() {
-            this.$refs.form.validate((valid) => {
-                let installData = JSON.parse(JSON.stringify(this.formData));
-                if (valid) {
-                    this.$http
-                        .post('/sc-gate-web/auth/save', installData)
-                        .then(({ status, msg }) => {
-                            if (status == 0) {
-                                this.$message.success(msg);
-                                this.$emit('clerOwnerStatus');
-                            } else {
-                                this.$message.error(msg);
-                            }
-                            loading.close();
-                        })
-                        .catch(() => {
-                            loading.close();
-                        });
-                }
-            });
-        },
-        getList() {
-            if (!this.mixins_dataUrl) {
-                this.mixins_onQuery = false;
-                return;
-            }
-            let data = Object.assign({}, this.mixins_pageset, this.mixins_query);
-            this.mixins_onQuery = true;
-            delete data.total;
-            this.$http[this.mixins_post](this.mixins_dataUrl, data)
-                .then(({ status, data, msg }) => {
-                    this.mixins_onQuery = false;
-                    if (0 === status) {
-                        this.mixins_list = data;
-                    } else {
-                        this.$message.error(msg);
-                    }
-                })
-                .catch((err) => {
-                    this.mixins_onQuery = false;
-                });
-        },
-        lookPage(row) {
-            new Promise((resolve) => {
-                this.$store.dispatch('addPopup', {
-                    url: '/accessControlCard/popups/lookPage.vue',
-                    width: '494px',
-                    height: '400px',
-                    props: {
-                        callback: resolve,
-                        row
-                    },
-                    hideStar: false,
-                    title: '查看门禁'
-                });
-            }).then(() => {
-                this.mixins_search();
-            });
         }
     },
     created() {
         this.detailsData = this.params;
-
-        new Promise((resolve) => {
-            this.getGateList(this.params.communityId, resolve);
-        }).then(() => {
-            this.mixins_dataUrl = '/sc-gate-web/gateCard/list'; // 分页查询接口
-            this.mixins_query = {
-                userId: this.gateList.userId,
-                cardType: this.gateList.cardType
-            };
-            this.mixins_search();
-        });
+        console.log(this.params);
+        this.mixins_dataUrl = '/sc-gate-web/auth/residentPage'; // 分页查询接口
+        this.mixins_query = {};
+        this.mixins_search();
     }
 };
 </script>

+ 7 - 13
accessControlSystem/src/views/deviceManagement/accessControlMachineManagement/index.vue

@@ -47,10 +47,13 @@
                 @selection-change="selectionChange"
             >
                 <template slot-scope="scope" slot="faceStatus">
-                    {{ !!scope.row.appStatus ? `${scope.row.appStatus == 0 ? '不支持/' : '支持/'}` : '' }}
-                    {{ !!scope.row.faceStatus ? `${scope.row.faceStatus == 0 ? '关闭' : '开启'}` : '' }}
+                    {{ scope.row.faceSupport == 0 ? '不支持/' : '支持/' }}
+                    {{ scope.row.faceStatus == 0 ? '关闭' : '开启' }}
+                </template>
+                <template slot-scope="scope" slot="tempPasswordStatus">
+                    {{ scope.row.tempPasswordSupport == 0 ? '不支持/' : '支持/' }}
+                    {{ scope.row.tempPasswordStatus == 0 ? '关闭' : '开启' }}
                 </template>
-
                 <template slot-scope="scope" slot="opt">
                     <div class="opt">
                         <el-tooltip class="item" effect="light" placement="bottom" content="详情">
@@ -139,16 +142,7 @@ export default {
                 {
                     label: '临时密码开门',
                     prop: 'tempPasswordStatus',
-                    format(val) {
-                        switch (val) {
-                            case -1:
-                                return `不支持`;
-                            case 0:
-                                return `禁用`;
-                            case 1:
-                                return `启用`;
-                        }
-                    }
+                    slot: 'tempPasswordStatus'
                 },
                 {
                     label: '临时密码',