|
|
@ -49,7 +49,6 @@ |
|
|
|
<el-select |
|
|
|
v-model.trim="buildId" |
|
|
|
placeholder="楼号" |
|
|
|
clearable |
|
|
|
style="width: 120px;" |
|
|
|
:disabled="changeVDisabled" |
|
|
|
@clear="handleClearBuild" |
|
|
@ -69,7 +68,6 @@ |
|
|
|
v-model.trim="unitId" |
|
|
|
:disabled="changeBDisabled" |
|
|
|
placeholder="单元" |
|
|
|
clearable |
|
|
|
style="width: 120px;" |
|
|
|
@click="handleClearDan" |
|
|
|
@change="handleChangeD" |
|
|
@ -88,7 +86,6 @@ |
|
|
|
v-model.trim="homeId" |
|
|
|
:disabled="changeDDisabled" |
|
|
|
placeholder="房号" |
|
|
|
clearable |
|
|
|
style="width: 120px;" |
|
|
|
@change="homeIdHandleChange" |
|
|
|
> |
|
|
@ -105,35 +102,16 @@ |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<!--<el-form-item label="房屋类型"--> |
|
|
|
<!--prop="houseType"--> |
|
|
|
<!--label-width="150px"--> |
|
|
|
<!--style="display: block">--> |
|
|
|
<!--<el-radio-group v-model="houseType">--> |
|
|
|
|
|
|
|
<!--<el-radio :label="'1'">楼房</el-radio>--> |
|
|
|
<!--<el-radio :label="'2'">平房</el-radio>--> |
|
|
|
<!--<el-radio :label="'3'">别墅</el-radio>--> |
|
|
|
<!--</el-radio-group>--> |
|
|
|
<!--</el-form-item>--> |
|
|
|
|
|
|
|
<!--<el-form-item label="房屋用途"--> |
|
|
|
<!--prop="purpose"--> |
|
|
|
<!--label-width="150px"--> |
|
|
|
<!--style="display: block">--> |
|
|
|
<!--<el-radio-group v-model="purpose">--> |
|
|
|
|
|
|
|
<!--<el-radio :label="'1'">住宅</el-radio>--> |
|
|
|
<!--<el-radio :label="'2'">商业</el-radio>--> |
|
|
|
<!--<el-radio :label="'3'">办公</el-radio>--> |
|
|
|
<!--<el-radio :label="'4'">工业</el-radio>--> |
|
|
|
<!--<el-radio :label="'5'">仓储</el-radio>--> |
|
|
|
<!--<el-radio :label="'6'">商住混用</el-radio>--> |
|
|
|
<!--<el-radio :label="'7'">其他</el-radio>--> |
|
|
|
<!--</el-radio-group>--> |
|
|
|
<!--</el-form-item>--> |
|
|
|
|
|
|
|
<el-form-item label="购房时间" prop="purchaseDate" label-width="150px"> |
|
|
|
<el-date-picker v-model="dataForm.purchaseDate" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期" |
|
|
|
style="width:200px" |
|
|
|
:clearable="false"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="房屋状态" |
|
|
|
prop="rentFlag" |
|
|
|
label-width="150px" |
|
|
@ -176,7 +154,7 @@ |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label=" " prop="needUpdate" label-width="150px"> |
|
|
|
<el-checkbox v-model="dataForm.needUpdate">更新房屋信息</el-checkbox> |
|
|
|
<el-checkbox v-model="needUpdate">更新房屋信息</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
@ -205,7 +183,6 @@ export default { |
|
|
|
return { |
|
|
|
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
btnDisable: false, |
|
|
|
unitList: [], |
|
|
|
|
|
|
|
houseId: '', //房屋ID |
|
|
|
houseType: '1', |
|
|
@ -222,7 +199,11 @@ export default { |
|
|
|
ownerPhone: '', //房主电话 |
|
|
|
ownerName: '', //房主名字 |
|
|
|
ownerIdCard: '', //房主身份证 |
|
|
|
needUpdate: false |
|
|
|
needUpdate: false, |
|
|
|
purchaseDate: '', |
|
|
|
villageId: '', |
|
|
|
buildId: '', |
|
|
|
unitId: '' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -236,15 +217,66 @@ export default { |
|
|
|
optionsG: [], |
|
|
|
|
|
|
|
gridId: '', |
|
|
|
gridName: '', |
|
|
|
villageId: '', |
|
|
|
villageName: '', |
|
|
|
buildId: '', |
|
|
|
buildName: '', |
|
|
|
unitId: '', |
|
|
|
unitName: '', |
|
|
|
homeId: '', |
|
|
|
homeName: '', |
|
|
|
needUpdate: false |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
mounted () { |
|
|
|
computed: { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
buildingUnitId: [ |
|
|
|
{ required: true, message: '所属单元不能为空', trigger: 'blur' }, |
|
|
|
], |
|
|
|
doorName: [ |
|
|
|
{ required: true, message: '门牌号不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
houseType: [ |
|
|
|
{ required: true, message: '房屋类型不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
purpose: [ |
|
|
|
{ required: true, message: '房屋用途不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
rentFlag: [ |
|
|
|
{ required: true, message: '是否出租不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
ownerPhone: [ |
|
|
|
{ required: false } |
|
|
|
], |
|
|
|
ownerName: [ |
|
|
|
{ required: false } |
|
|
|
], |
|
|
|
ownerIdCard: [ |
|
|
|
{ required: false } |
|
|
|
], |
|
|
|
villageId: [ |
|
|
|
{ required: true, message: '所属房屋不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
gridId: [ |
|
|
|
{ required: true, message: '所属网格不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
purchaseDate: [ |
|
|
|
{ required: true, message: '购房时间不能为空', trigger: 'blur' } |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
changeVDisabled() { |
|
|
|
return !this.villageId |
|
|
|
}, |
|
|
|
changeBDisabled() { |
|
|
|
return !this.buildId |
|
|
|
}, |
|
|
|
changeDDisabled() { |
|
|
|
return !this.unitId |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
created () { |
|
|
@ -261,25 +293,16 @@ export default { |
|
|
|
async initForm (type, row, agencyObj) { |
|
|
|
|
|
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
// this.agencyObj = agencyObj |
|
|
|
this.resetData() |
|
|
|
this.formType = type |
|
|
|
// if (row) { |
|
|
|
// |
|
|
|
// this.houseId = row.houseId |
|
|
|
// await this.loadHouseInfo() |
|
|
|
// |
|
|
|
// } else { |
|
|
|
// |
|
|
|
// this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId |
|
|
|
// this.dataForm.buildingId = this.agencyObj.id |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// await this.loadUnitList() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async loadHouseInfo () { |
|
|
|
if(this.houseId === '' || this.houseId === null){ |
|
|
|
this.$message.error('请选择房号') |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
const url = "/gov/org/ichouse/" + this.houseId |
|
|
|
|
|
|
@ -292,7 +315,6 @@ export default { |
|
|
|
this.houseType = this.dataForm.houseType |
|
|
|
this.purpose = this.dataForm.purpose |
|
|
|
this.rentFlag = parseInt(this.dataForm.rentFlag) |
|
|
|
this.dataForm.needUpdate = false |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
@ -301,23 +323,6 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//加载单元 |
|
|
|
// async loadUnitList () { |
|
|
|
// const url = '/gov/org/building/buildingunitlist' |
|
|
|
// |
|
|
|
// let params = { |
|
|
|
// buildingId: this.dataForm.buildingId |
|
|
|
// } |
|
|
|
// |
|
|
|
// const { data, code, msg } = await requestPost(url, params) |
|
|
|
// |
|
|
|
// if (code === 0) { |
|
|
|
// this.unitList = data |
|
|
|
// } else { |
|
|
|
// this.$message.error(msg) |
|
|
|
// } |
|
|
|
// }, |
|
|
|
|
|
|
|
handleClearVillage() { |
|
|
|
this.buildId = '' |
|
|
|
this.homeId = '' |
|
|
@ -332,6 +337,13 @@ export default { |
|
|
|
this.homeId = '' |
|
|
|
}, |
|
|
|
handleChangeGrid(val) { |
|
|
|
// 网格 |
|
|
|
this.optionsG.find((item) => { |
|
|
|
if (item.value === val) { |
|
|
|
this.gridName = item.label |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
console.log('val', val) |
|
|
|
this.villageId = '' |
|
|
|
this.buildId = '' |
|
|
@ -425,6 +437,12 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleChangeV(val) { |
|
|
|
// 小区 |
|
|
|
this.optionsV.find((item) => { |
|
|
|
if (item.value === val) { |
|
|
|
this.villageName = item.label |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log('val', val) |
|
|
|
this.buildId = '' |
|
|
|
this.unitId = '' |
|
|
@ -432,17 +450,35 @@ export default { |
|
|
|
this.getBuildList() |
|
|
|
}, |
|
|
|
handleChangeB(val) { |
|
|
|
// 楼号 |
|
|
|
this.optionsB.find((item) => { |
|
|
|
if (item.value === val) { |
|
|
|
this.buildName = item.label |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log('val', val) |
|
|
|
this.unitId = '' |
|
|
|
this.homeId = '' |
|
|
|
this.getUniList() |
|
|
|
}, |
|
|
|
handleChangeD(val) { |
|
|
|
// 单元号 |
|
|
|
this.optionsD.find((item) => { |
|
|
|
if (item.value === val) { |
|
|
|
this.unitName = item.label |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log('val', val) |
|
|
|
this.homeId = '' |
|
|
|
this.getHouseList() |
|
|
|
}, |
|
|
|
homeIdHandleChange(val){ |
|
|
|
// 房间号 |
|
|
|
this.optionsH.find((item) => { |
|
|
|
if (item.value === val) { |
|
|
|
this.homeName = item.label |
|
|
|
} |
|
|
|
}) |
|
|
|
this.houseId = val |
|
|
|
this.loadHouseInfo() |
|
|
|
}, |
|
|
@ -463,12 +499,19 @@ export default { |
|
|
|
this.dataForm.buildId = this.buildId |
|
|
|
this.dataForm.unitId = this.unitId |
|
|
|
this.dataForm.homeId = this.homeId |
|
|
|
this.dataForm.gridName = this.gridName |
|
|
|
this.dataForm.villageName = this.villageName |
|
|
|
this.dataForm.buildName = this.buildName |
|
|
|
this.dataForm.unitName = this.unitName |
|
|
|
this.dataForm.homeName = this.homeName |
|
|
|
this.dataForm.needUpdate = this.needUpdate |
|
|
|
|
|
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
|
if (!valid) { |
|
|
|
this.btnDisable = false |
|
|
|
app.util.validateRule(messageObj) |
|
|
|
} else { |
|
|
|
this.dataForm.id = '' |
|
|
|
this.addRoom() |
|
|
|
} |
|
|
|
|
|
|
@ -521,12 +564,6 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleCancle () { |
|
|
|
this.resetData() |
|
|
|
this.$emit('dialogCancle') |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
resetData () { |
|
|
|
this.houseId = '' //房屋ID |
|
|
|
this.houseType = '1' |
|
|
@ -542,63 +579,26 @@ export default { |
|
|
|
rentFlag: 0,//是否出租【是:1,否:0】 |
|
|
|
ownerPhone: '', //房主电话 |
|
|
|
ownerName: '', //房主名字 |
|
|
|
ownerIdCard: '' //房主身份证 |
|
|
|
ownerIdCard: '', //房主身份证 |
|
|
|
needUpdate: false, |
|
|
|
purchaseDate: '', |
|
|
|
id: '' |
|
|
|
} |
|
|
|
this.gridId = '' |
|
|
|
this.villageId = '' |
|
|
|
this.buildId = '' |
|
|
|
this.unitId = '' |
|
|
|
this.homeId = '' |
|
|
|
this.gridName = '' |
|
|
|
this.villageName = '' |
|
|
|
this.buildName = '' |
|
|
|
this.unitName = '' |
|
|
|
this.homeName = '' |
|
|
|
this.needUpdate = false |
|
|
|
|
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading () { |
|
|
|
loading = Loading.service({ |
|
|
|
lock: true, // 是否锁定 |
|
|
|
text: '正在加载……', // 加载中需要显示的文字 |
|
|
|
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 结束加载动画 |
|
|
|
endLoading () { |
|
|
|
// clearTimeout(timer); |
|
|
|
if (loading) { |
|
|
|
loading.close() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
buildingUnitId: [ |
|
|
|
{ required: true, message: '所属单元不能为空', trigger: 'blur' }, |
|
|
|
], |
|
|
|
doorName: [ |
|
|
|
{ required: true, message: '门牌号不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
houseType: [ |
|
|
|
{ required: true, message: '房屋类型不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
purpose: [ |
|
|
|
{ required: true, message: '房屋用途不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
rentFlag: [ |
|
|
|
{ required: true, message: '是否出租不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
ownerPhone: [ |
|
|
|
{ required: false } |
|
|
|
], |
|
|
|
ownerName: [ |
|
|
|
{ required: false } |
|
|
|
], |
|
|
|
ownerIdCard: [ |
|
|
|
{ required: false } |
|
|
|
], |
|
|
|
villageId: [ |
|
|
|
{ required: true, message: '所属房屋不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
gridId: [ |
|
|
|
{ required: true, message: '所属网格不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
props: {} |
|
|
|
} |
|
|
|
</script> |
|
|
|