|
@@ -0,0 +1,450 @@
|
|
|
+<template>
|
|
|
+ <div class="main">
|
|
|
+ <div></div>
|
|
|
+ <div class="formContent">
|
|
|
+ <div class="formContent-item">
|
|
|
+ <div class="formContent-item_title">基础信息</div>
|
|
|
+ <div class="formContent-formList">
|
|
|
+ <zz-form :cols="formCols" :data="formData" :rules="formRules" :errors="formErrors" labelWidth="70" ref="form">
|
|
|
+ <template slot="sex">
|
|
|
+ <el-radio v-model="formData.sex" :label="0">未知</el-radio>
|
|
|
+ <el-radio v-model="formData.sex" :label="1">男</el-radio>
|
|
|
+ <el-radio v-model="formData.sex" :label="2">女</el-radio>
|
|
|
+ </template>
|
|
|
+ <template slot="remarks">
|
|
|
+ <el-input type="textarea" v-model="formData.remark" maxlength="50" placeholder="请输入备注"> </el-input>
|
|
|
+ </template>
|
|
|
+ </zz-form>
|
|
|
+ <el-upload
|
|
|
+ :headers="token"
|
|
|
+ ref="uploaduserlogo"
|
|
|
+ class="mini-upload"
|
|
|
+ limit="1"
|
|
|
+ action="/user-center/user/addUserPhoto"
|
|
|
+ list-type="picture-card"
|
|
|
+ :on-success="uploadsuccess"
|
|
|
+ :auto-upload="true"
|
|
|
+ name="avatarfile"
|
|
|
+ >
|
|
|
+ <i slot="default" class="el-icon-plus"></i>
|
|
|
+ <div slot="file" slot-scope="{ file }">
|
|
|
+ <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
|
|
+ <span class="el-upload-list__item-actions">
|
|
|
+ <span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
|
|
|
+ <i class="el-icon-delete"></i>
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="formContent-item">
|
|
|
+ <div class="formContent-item_title">证件信息</div>
|
|
|
+ <zz-form :cols="formCols2" :data="formData" :rules="formRules" :errors="formErrors" labelWidth="70" ref="form">
|
|
|
+ <template slot="idType">
|
|
|
+ <el-select v-model="formData.idType" clearable>
|
|
|
+ <el-option v-for="(item, index) in idTypeArray" :key="index" :label="item.label" :value="item.status">{{
|
|
|
+ item.label
|
|
|
+ }}</el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template slot="birthDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formData.birthDate"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="date"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </template>
|
|
|
+ <template slot="effectiveDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="effectiveDate"
|
|
|
+ value-format="yyyyMMdd"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="选择开始日期"
|
|
|
+ end-placeholder="选择结束日期"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ @change="effectiveDateToggle"
|
|
|
+ :editable="false"
|
|
|
+ ></el-date-picker>
|
|
|
+ </template>
|
|
|
+ </zz-form>
|
|
|
+ </div>
|
|
|
+ <div class="formContent-item">
|
|
|
+ <div class="formContent-item_title">绑定房产</div>
|
|
|
+ <div class="formContent-formList" v-for="(item, index) in formData.houseList" :key="index">
|
|
|
+ <div class="block-title">
|
|
|
+ <div class="floor list-title">{{ item.houseId }}</div>
|
|
|
+ <span class="remove list-title" @click="removeHouse(index, 'houseList')">移除</span>
|
|
|
+ <img class="bg-img" src="@/assets/img/ownerManagement/bg_card@2x.png" alt="" />
|
|
|
+ <img class="bg-imgIoc" src="@/assets/img/ownerManagement/icon_building@2x.png" alt="" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <zz-form :cols="formCols3" :data="item" :rules="formRules" :errors="formErrors" labelWidth="70" ref="form">
|
|
|
+ <template slot="householdType">
|
|
|
+ <el-select v-model="item.householdType" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in householdTypeArray"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.status"
|
|
|
+ >{{ item.label }}</el-option
|
|
|
+ >
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template slot="checkInDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="item.checkInDate"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="date"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </template>
|
|
|
+ </zz-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="addHouse add-block" @click="addHouse(1, 'houseList')">
|
|
|
+ <img src="@/assets/img/ownerManagement/btn_add@2x.png" />
|
|
|
+ </div>
|
|
|
+ <div class="formContent-item_title">绑定车位</div>
|
|
|
+ <div class="addCat">
|
|
|
+ <div class="block-title" v-for="(item, index) in formData.parkingList" :key="index">
|
|
|
+ <div class="floor list-title">{{ item.parkingId }}</div>
|
|
|
+ <span class="remove list-title" @click="removeHouse(index, 'parkingList')">移除</span>
|
|
|
+ <img class="bg-img" src="@/assets/img/ownerManagement/bg_card@2x.png" alt="" />
|
|
|
+ <img class="bg-imgIoc" src="@/assets/img/ownerManagement/icon_car@2x.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="addHouse add-block" @click="addHouse(2, 'parkingList')">
|
|
|
+ <img src="@/assets/img/ownerManagement/btn_add@2x.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ props: ['params'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ token: {
|
|
|
+ [localStorage.getItem('SC_token') && 'Authorization']: 'Bearer ' + localStorage.getItem('SC_token')
|
|
|
+ },
|
|
|
+ pickerOptions: {
|
|
|
+ disabledDate(val) {
|
|
|
+ return +new Date(val) > +new Date();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ effectiveDate: '',
|
|
|
+ formData: {
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ personnelNumber: '',
|
|
|
+ sex: 0,
|
|
|
+ remarks: '',
|
|
|
+ facePictureUrl: '',
|
|
|
+
|
|
|
+ idType: '',
|
|
|
+ idNumber: '',
|
|
|
+ permanentAddress: '',
|
|
|
+ issuingAuthority: '',
|
|
|
+ effectiveDateStart: '',
|
|
|
+ effectiveDateEnd: '',
|
|
|
+ nationality: '',
|
|
|
+ nativePlace: '',
|
|
|
+ nation: '',
|
|
|
+ birthDate: '',
|
|
|
+ houseList: [
|
|
|
+ {
|
|
|
+ checkInDate: '',
|
|
|
+ householdType: '',
|
|
|
+ houseId: 'sssss'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ checkInDate: '',
|
|
|
+ householdType: '',
|
|
|
+ houseId: '9999'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ parkingList: [
|
|
|
+ {
|
|
|
+ parkingId: 'xxxx'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ formCols: [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ label: '姓名',
|
|
|
+ prop: 'name',
|
|
|
+ slot: 'name',
|
|
|
+ input: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '手机号',
|
|
|
+ prop: 'phone',
|
|
|
+ slot: 'phone',
|
|
|
+ input: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '人员编号',
|
|
|
+ prop: 'personnelNumber',
|
|
|
+ slot: 'personnelNumber',
|
|
|
+ input: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '性别',
|
|
|
+ prop: 'sex',
|
|
|
+ slot: 'sex'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'remarks',
|
|
|
+ slot: 'remarks'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ formCols2: [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ label: '证件类型',
|
|
|
+ prop: 'idType',
|
|
|
+ slot: 'idType'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '证件号码',
|
|
|
+ prop: 'idNumber',
|
|
|
+ slot: 'idNumber',
|
|
|
+ input: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '户籍地址',
|
|
|
+ prop: 'permanentAddress',
|
|
|
+ slot: 'permanentAddress',
|
|
|
+ input: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '签发机关',
|
|
|
+ prop: 'issuingAuthority',
|
|
|
+ slot: 'issuingAuthority',
|
|
|
+ input: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '有效期',
|
|
|
+ prop: 'effectiveDate',
|
|
|
+ slot: 'effectiveDate'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '国籍',
|
|
|
+ prop: 'nationality',
|
|
|
+ slot: 'nationality',
|
|
|
+ input: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '籍贯',
|
|
|
+ prop: 'nativePlace',
|
|
|
+ slot: 'nativePlace',
|
|
|
+ input: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '民族',
|
|
|
+ prop: 'nation',
|
|
|
+ slot: 'nation',
|
|
|
+ input: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '出生日期',
|
|
|
+ prop: 'birthDate',
|
|
|
+ slot: 'birthDate'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ formCols3: [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ label: '类型',
|
|
|
+ prop: 'householdType',
|
|
|
+ slot: 'householdType'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '入住时间',
|
|
|
+ prop: 'checkInDate',
|
|
|
+ slot: 'checkInDate'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ idTypeArray: [
|
|
|
+ {
|
|
|
+ status: 1,
|
|
|
+ label: '居民身份证'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ status: 2,
|
|
|
+ label: '居民户口簿'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ status: 3,
|
|
|
+ label: '暂住证'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ status: 4,
|
|
|
+ label: '其他'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ householdTypeArray: [
|
|
|
+ {
|
|
|
+ status: 1,
|
|
|
+ label: '业主'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ status: 2,
|
|
|
+ label: '亲属'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ status: 3,
|
|
|
+ label: '租客'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ formRules: {
|
|
|
+ name: [this.$valid.selectRequired('填写姓名')],
|
|
|
+ phone: [this.$valid.selectRequired('填写手机号')],
|
|
|
+ householdType: [this.$valid.selectRequired('填写类型')]
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleRemove(file) {
|
|
|
+ this.$refs.uploaduserlogo.clearFiles();
|
|
|
+ },
|
|
|
+ uploadsuccess(response, file, fileList) {
|
|
|
+ if (0 === response.status) {
|
|
|
+ this.formData.facePictureUrl = response.data;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ effectiveDateToggle(va) {
|
|
|
+ this.formData.effectiveDateStart = va[0];
|
|
|
+ this.formData.effectiveDateEnd = va[1];
|
|
|
+ },
|
|
|
+ addHouse(num, arr) {
|
|
|
+ let newObj = {};
|
|
|
+ if (num === 1) {
|
|
|
+ newObj = {
|
|
|
+ checkInDate: '',
|
|
|
+ householdType: '',
|
|
|
+ houseId: ''
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ newObj = {
|
|
|
+ parkingId: ''
|
|
|
+ };
|
|
|
+ }
|
|
|
+ this.formData[arr].push(newObj);
|
|
|
+ },
|
|
|
+ removeHouse(index, arr) {
|
|
|
+ this.formData[arr].splice(index, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang='scss' scoped >
|
|
|
+@import '@assets/css/public-style.scss';
|
|
|
+.formContent {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 20px;
|
|
|
+ background: white;
|
|
|
+ .formContent-item {
|
|
|
+ width: calc((100% / 3) - 80px);
|
|
|
+ .formContent-item_title {
|
|
|
+ font-size: 14px;
|
|
|
+ position: relative;
|
|
|
+ margin-left: 14px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ &::before {
|
|
|
+ position: absolute;
|
|
|
+ left: -14px;
|
|
|
+ top: 4px;
|
|
|
+ width: 4px;
|
|
|
+ height: 12px;
|
|
|
+ border-radius: 2px;
|
|
|
+ display: block;
|
|
|
+ background: $mainBgColor;
|
|
|
+ content: ' ';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .formContent-formList {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+ .block-title {
|
|
|
+ width: 200px;
|
|
|
+ height: 80px;
|
|
|
+ background: #ffffff;
|
|
|
+ border-radius: 2px;
|
|
|
+ border: 1px solid #e0e1e3;
|
|
|
+ position: relative;
|
|
|
+ .floor {
|
|
|
+ margin: 16px 0 9px 0;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ .remove {
|
|
|
+ color: $mainBgColor;
|
|
|
+ font-size: 12px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .list-title {
|
|
|
+ margin-left: 20px;
|
|
|
+ position: relative;
|
|
|
+ z-index: 2;
|
|
|
+ }
|
|
|
+ img {
|
|
|
+ &.bg-img {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 100px;
|
|
|
+ }
|
|
|
+ &.bg-imgIoc {
|
|
|
+ position: absolute;
|
|
|
+ right: 20px;
|
|
|
+ top: 28px;
|
|
|
+ width: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .addHouse {
|
|
|
+ margin-bottom: 25px;
|
|
|
+ }
|
|
|
+ .add-block {
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
+ background: #ffffff;
|
|
|
+ border-radius: 2px;
|
|
|
+ border: 1px solid #e0e1e3;
|
|
|
+ position: relative;
|
|
|
+ cursor: pointer;
|
|
|
+ & > img {
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .addCat {
|
|
|
+ & > div {
|
|
|
+ float: left;
|
|
|
+ margin-right: 20px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|