|
@@ -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>
|