| | |
| | | <box-title title="基础信息"></box-title> |
| | | </view> |
| | | <view class="event-info"> |
| | | <u-form-item @click="showSelectBus(roleList, '角色', 'roleName')" class="form-item" |
| | | labelWidth="100" label="角色" required prop="type"> |
| | | <u--input border="none" v-model="roleName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.roleList, '角色', 'roleTypeName','roleType')" class="form-item" |
| | | labelWidth="100" label="角色" required prop="roleType"> |
| | | <u--input border="none" v-model="roleTypeName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item @click="showSelectBus(relationList, '角色关系', 'relationName')" |
| | | class="form-item" labelWidth="100" label="角色关系" required prop="type"> |
| | | <u--input border="none" v-model="relationName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.relationshipList, '角色关系', 'relationshipName','relationship')" |
| | | class="form-item" labelWidth="100" label="角色关系" required prop="relationship"> |
| | | <u--input border="none" v-model="relationshipName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="姓名" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="请输入"> |
| | | <u-form-item class="form-item" labelWidth="100" label="姓名" required prop="name"> |
| | | <u--input border="none" v-model="form.name" placeholder="请输入"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="身份证" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="请输入"> |
| | | <u-form-item class="form-item" labelWidth="100" label="身份证" prop="idCard"> |
| | | <u--input border="none" v-model="form.idCard" placeholder="请输入"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item @click="typeShow = true" class="form-item" labelWidth="100" label="性别" required |
| | | prop="type"> |
| | | <u--input border="none" v-model="roleName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.genderList, '性别', 'genderName','gender')" |
| | | class="form-item" labelWidth="100" label="性别" prop="gender"> |
| | | <u--input border="none" v-model="genderName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="手机号码" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="请输入"> |
| | | <u-form-item class="form-item" labelWidth="100" label="手机号码" prop="phoneNumber"> |
| | | <u--input border="none" v-model="form.phoneNumber" placeholder="请输入"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="其他联系方式" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="请输入"> |
| | | <u-form-item class="form-item" labelWidth="100" label="其他联系方式" prop="otherContact"> |
| | | <u--input border="none" v-model="form.otherContact" placeholder="请输入"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item @click="typeShow = true" class="form-item" labelWidth="100" label="是否主要联系人" |
| | | required prop="type"> |
| | | <u--input border="none" v-model="roleName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.isPrimaryContactList, '是否主要联系人', 'isPrimaryContactName','isPrimaryContact')" |
| | | class="form-item" labelWidth="110" label="是否主要联系人" |
| | | prop="isPrimaryContact"> |
| | | <u--input border="none" v-model="isPrimaryContactName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item @click="typeShow = true" class="form-item" labelWidth="100" label="居住情况" required |
| | | prop="type"> |
| | | <u--input border="none" v-model="roleName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.residentialStatusList, '居住情况', 'residentialStatusName','residentialStatus')" |
| | | class="form-item" labelWidth="100" label="居住情况" |
| | | prop="residentialStatus"> |
| | | <u--input border="none" v-model="residentialStatusName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="港澳台通行证" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="请输入"> |
| | | <u-form-item class="form-item" labelWidth="100" label="港澳台通行证" prop="hkmtPass"> |
| | | <u--input border="none" v-model="form.hkmtPass" placeholder="请输入"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="护照" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="请输入"> |
| | | <u-form-item class="form-item" labelWidth="100" label="护照" prop="passport"> |
| | | <u--input border="none" v-model="form.passport" placeholder="请输入"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="现居住地" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="请输入"> |
| | | <u-form-item class="form-item" labelWidth="100" label="现居住地" prop="currentAddress"> |
| | | <u--input border="none" v-model="form.currentAddress" placeholder="请输入"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item @click="typeShow = true" class="form-item" labelWidth="100" label="民族" required |
| | | prop="type"> |
| | | <u--input border="none" v-model="roleName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.ethnicityList, '民族', 'ethnicityName','ethnicity')" |
| | | class="form-item" labelWidth="100" label="民族" prop="ethnicity"> |
| | | <u--input border="none" v-model="ethnicityName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item @click="typeShow = true" class="form-item" labelWidth="100" label="学历" required |
| | | prop="type"> |
| | | <u--input border="none" v-model="roleName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.educationList, '学历', 'educationName','education')" |
| | | class="form-item" labelWidth="100" label="学历" prop="education"> |
| | | <u--input border="none" v-model="educationName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item @click="typeShow = true" class="form-item" labelWidth="100" label="是否党员" required |
| | | prop="type"> |
| | | <u--input border="none" v-model="roleName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.partyEmberList, '是否党员', 'partyEmberName','partyEmber')" |
| | | class="form-item" labelWidth="100" label="是否党员" prop="partyEmber"> |
| | | <u--input border="none" v-model="partyEmberName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="工作单位" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="请输入"> |
| | | <u-form-item class="form-item" labelWidth="100" label="工作单位" prop="employer"> |
| | | <u--input border="none" v-model="form.employer" placeholder="请输入"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item @click="typeShow = true" class="form-item" labelWidth="100" label="工作状态" required |
| | | prop="type"> |
| | | <u--input border="none" v-model="roleName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.workStatusList, '工作状态', 'workStatusName','workStatus')" |
| | | class="form-item" labelWidth="100" label="工作状态" prop="workStatus"> |
| | | <u--input border="none" v-model="workStatusName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item @click="typeShow = true" class="form-item" labelWidth="100" label="婚姻状态" required |
| | | prop="type"> |
| | | <u--input border="none" v-model="roleName" disabled disabledColor="#ffffff" |
| | | <u-form-item @click="showSelectBus(dataList.maritalStatusList, '婚姻状态', 'maritalStatusName','maritalStatus')" |
| | | class="form-item" labelWidth="100" label="婚姻状态" prop="maritalStatus"> |
| | | <u--input border="none" v-model="maritalStatusName" disabled disabledColor="#ffffff" |
| | | placeholder="请选择"> |
| | | </u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="户籍登记地" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="请输入"> |
| | | <u-form-item class="form-item" labelWidth="100" label="户籍登记地" prop="hukouRegistration"> |
| | | <u--input border="none" v-model="form.hukouRegistration" placeholder="请输入"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="车牌号" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="多个用中划线(-)隔开"> |
| | | <u-form-item class="form-item" labelWidth="100" label="车牌号" prop="cardNumber"> |
| | | <u--input border="none" v-model="form.cardNumber" placeholder="多个用中划线(-)隔开"> |
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="备注" required prop="location"> |
| | | <u--input border="none" v-model="form.location" placeholder="补充说明"> |
| | | <u-form-item class="form-item" labelWidth="100" label="备注" prop="remark"> |
| | | <u--input border="none" v-model="form.remark" placeholder="补充说明"> |
| | | </u--input> |
| | | </u-form-item> |
| | | </view> |
| | |
| | | |
| | | <view class="btn-group b-c-w"> |
| | | <view> |
| | | <u-button @click="submit" type="primary" text="添加"></u-button> |
| | | <u-button @click="submit" type="primary" :text="addOrUpdateTitle" width="120px"></u-button> |
| | | </view> |
| | | <view> |
| | | <u-button @click="navigator" type="primary" :plain="true" text="返回首页"></u-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <!-- 事件类型下拉框 --> |
| | | <select-bus v-if="typeShow" :show="typeShow" v-model="form[selectBusModel]" type="radio" |
| | |
| | | <script> |
| | | import selectBus from "@/components/my-components/selectBus.vue" |
| | | import uploadMixin from "@/mixin/uploadMixin"; |
| | | import { |
| | | saveOrUpdateHousehold,removeHousehold |
| | | } from '@/api/house/household.js' |
| | | export default { |
| | | components: { |
| | | selectBus |
| | |
| | | mixins: [uploadMixin], |
| | | data() { |
| | | return { |
| | | |
| | | addOrUpdateTitle:"添加", |
| | | houseCode:"", |
| | | form: { |
| | | roleName: "", |
| | | relationName: '', |
| | | location: "", |
| | | title: "", |
| | | roleType:null, |
| | | description: "", |
| | | }, |
| | | rules: {}, |
| | | |
| | | rules: { |
| | | // roleType: [{ |
| | | // required: true, |
| | | // message: '请选择角色' |
| | | // }], |
| | | name: [{ |
| | | required: true, |
| | | message: '请填写姓名' |
| | | }], |
| | | }, |
| | | typeShow: false, |
| | | |
| | | roleName: "", |
| | | dataList: { |
| | | roleList: [{ |
| | | value: 1, |
| | | value: "1", |
| | | name: '业主', |
| | | }, |
| | | { |
| | | value: 2, |
| | | value: "2", |
| | | name: '出租户', |
| | | }, |
| | | { |
| | | value: 3, |
| | | value: "3", |
| | | name: '空挂户', |
| | | }, |
| | | ], |
| | | |
| | | relationName: '', |
| | | relationList: [{ |
| | | relationshipList: [{ |
| | | value: 1, |
| | | name: '业主', |
| | | }, |
| | |
| | | name: '其他', |
| | | }, |
| | | ], |
| | | genderList:[ |
| | | { |
| | | value: 1, |
| | | name: '男', |
| | | }, |
| | | { |
| | | value: 0, |
| | | name: '女', |
| | | }, |
| | | { |
| | | value: 2, |
| | | name: '未知', |
| | | } |
| | | ], |
| | | isPrimaryContactList:[ |
| | | { |
| | | value: 1, |
| | | name: '是', |
| | | }, |
| | | { |
| | | value: 0, |
| | | name: '否', |
| | | } |
| | | ], |
| | | residentialStatusList:[ |
| | | { |
| | | value: 1, |
| | | name: '是', |
| | | }, |
| | | { |
| | | value: 0, |
| | | name: '否', |
| | | } |
| | | ], |
| | | ethnicityList:[ |
| | | |
| | | ], |
| | | educationList:[ |
| | | |
| | | ], |
| | | partyEmberList:[ |
| | | { |
| | | value: 1, |
| | | name: '是', |
| | | }, |
| | | { |
| | | value: 2, |
| | | name: '否', |
| | | } |
| | | ], |
| | | workStatusList:[ |
| | | |
| | | ], |
| | | maritalStatusList:[ |
| | | |
| | | ] |
| | | }, |
| | | roleTypeName: '', |
| | | relationshipName: '', |
| | | genderName: '', |
| | | residentialStatusName:"", |
| | | isPrimaryContactName: '', |
| | | ethnicityName: '', |
| | | educationName: '', |
| | | partyEmberName: '', |
| | | workStatusName: '', |
| | | maritalStatusName: '', |
| | | // 下拉变量 |
| | | selectBusList: [], |
| | | selectBusVal: '', |
| | | selectBusTitle: '', |
| | |
| | | this.getHeader() |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | onLoad(option) { |
| | | |
| | | const data = JSON.parse(option.data) |
| | | this.houseCode = data.houseCode |
| | | if(data.type == 2){ |
| | | this.addOrUpdateTitle = "保存" |
| | | } |
| | | if(data.type == 2){ |
| | | this.addOrUpdateTitle = "修改" |
| | | this.getHouseholdInfo(data) |
| | | } |
| | | }, |
| | | onShow() { |
| | | |
| | | }, |
| | | methods: { |
| | | // 获取住户信息 |
| | | getHouseholdInfo(data){ |
| | | this.form = data |
| | | this.roleTypeName = this.findObjValue(data.roleType, this.dataList.roleList) |
| | | this.relationshipName = this.findObjValue(data.relationship, this.dataList.relationshipList) |
| | | this.genderName = this.findObjValue(data.gender, this.dataList.genderList) |
| | | this.isPrimaryContactName = this.findObjValue(data.isPrimaryContact, this.dataList.isPrimaryContactList) |
| | | this.ethnicityName = this.findObjValue(data.ethnicity, this.dataList.ethnicityList) |
| | | this.educationName = this.findObjValue(data.education, this.dataList.educationList) |
| | | this.partyEmberName = this.findObjValue(data.partyEmber, this.dataList.partyEmberList) |
| | | this.workStatusName = this.findObjValue(data.workStatus, this.dataList.workStatusList) |
| | | this.maritalStatusName = this.findObjValue(data.maritalStatus, this.dataList.maritalStatusList) |
| | | }, |
| | | // 显示选择弹框 |
| | | showSelectBus(data, title, model) { |
| | | showSelectBus(data, title, model, key) { |
| | | this.selectBusList = data |
| | | this.selectBusTitle = title |
| | | this.selectBusModel = model |
| | | this.selectBusKey = key |
| | | this.typeShow = true |
| | | }, |
| | | |
| | | //类型选择确认 |
| | | typeSelect(item) { |
| | | this[this.selectBusModel] = item.name |
| | | this.form[this.selectBusModel] = item.value |
| | | this.typeShow = !this.typeShow |
| | | }, |
| | | |
| | | //表单提交 |
| | | submit() { |
| | | |
| | | this.$refs.form.validate().then(res => { |
| | | this.saveOrUpdate(); |
| | | }) |
| | | }, |
| | | // 新增更新操作 |
| | | async saveOrUpdate() { |
| | | this.form['houseCode'] = this.houseCode |
| | | // 字典解析 |
| | | const roleTypeIndex = this.dataList.roleList.findIndex(item => item.name === this.roleTypeName) |
| | | const relationshipIndex = this.dataList.relationshipList.findIndex(item => item.name === this.relationshipName) |
| | | const genderIndex = this.dataList.genderList.findIndex(item => item.name === this.genderName) |
| | | const isPrimaryContactIndex = this.dataList.isPrimaryContactList.findIndex(item => item.name === this.isPrimaryContactName) |
| | | const ethnicityIndex = this.dataList.ethnicityList.findIndex(item => item.name === this.ethnicityName) |
| | | const educationIndex = this.dataList.educationList.findIndex(item => item.name === this.educationName) |
| | | const partyEmberIndex = this.dataList.partyEmberList.findIndex(item => item.name === this.partyEmberName) |
| | | const workStatusIndex = this.dataList.workStatusList.findIndex(item => item.name === this.workStatusName) |
| | | const maritalStatusIndex = this.dataList.maritalStatusList.findIndex(item => item.name === this.maritalStatusName) |
| | | |
| | | //跳转到报事列表 |
| | | this.form['roleType'] = roleTypeIndex >0 ? this.dataList.roleList[roleTypeIndex].value : "" |
| | | this.form['relationship'] = relationshipIndex >0 ? this.dataList.relationshipList[relationshipIndex].value: "" |
| | | this.form['gender'] = genderIndex >0 ?this.dataList.genderList[genderIndex].value: "" |
| | | this.form['isPrimaryContact'] = isPrimaryContactIndex >0 ?this.dataList.isPrimaryContactList[isPrimaryContactIndex].value: "" |
| | | this.form['ethnicity'] = ethnicityIndex >0 ?this.dataList.ethnicityList[ethnicityIndex].value: "" |
| | | this.form['education'] = educationIndex >0 ?this.dataList.educationList[educationIndex].value: "" |
| | | this.form['partyEmber'] = partyEmberIndex >0 ?this.dataList.partyEmberList[partyEmberIndex].value:"" |
| | | this.form['workStatus'] = workStatusIndex >0 ?this.dataList.workStatusList[workStatusIndex].value:"" |
| | | this.form['maritalStatus'] = maritalStatusIndex >0 ?this.dataList.maritalStatusList[maritalStatusIndex].value:"" |
| | | |
| | | const res = await saveOrUpdateHousehold(this.form) |
| | | if (res.code !== 200) { |
| | | uni.showToast({ |
| | | title: "保存失败", |
| | | icon: "error", |
| | | duration: 1500 |
| | | }) |
| | | return |
| | | } |
| | | uni.showToast({ |
| | | title: "保存成功", |
| | | icon: "success", |
| | | duration: 1500, |
| | | success: () => { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 1500) |
| | | } |
| | | }) |
| | | }, |
| | | findObjValue(value, obj) { |
| | | const res = obj.find(item => { |
| | | return item.value == value |
| | | }) |
| | | return res.name |
| | | }, |
| | | // 跳转到首页 |
| | | navigator() { |
| | | this.$u.func.globalNavigator("/subPackage/bs/views/bsList") |
| | | }, |
| | |
| | | } |
| | | |
| | | .box-title { |
| | | padding: 10px 0; |
| | | padding: 10px 10px; |
| | | } |
| | | |
| | | .event-info { |
| | | // background-color: #ffffff; |
| | | padding: 20rpx; |
| | | |
| | | .form-item { |
| | | background-color: #ffffff; |
| | | padding: 5px 10px; |
| | | padding: 5px 20px; |
| | | border-bottom: 1px solid #eff1f3; |
| | | } |
| | | |