-
+
-
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
{{
scope.row.houseType == '1'
@@ -186,7 +186,7 @@
}}
-
+
{{
scope.row.purpose == '1'
@@ -207,7 +207,7 @@
}}
-
+
{{
scope.row.rentFlag == 1
@@ -220,13 +220,13 @@
}}
-
+
-
-
+
+
- {{ $t('update') }}
+ {{ '查看' }}
{{ $t('delete') }}
@@ -270,21 +270,21 @@ export default {
mixinViewModuleOptions: {
getDataListURL: '/pli/power/rentHouse/page',
getDataListIsPage: true,
- deleteURL: '/pli/power/rentHouse',
+ deleteURL: '/pli/power/rentHouse/delete',
deleteIsBatch: true,
exportURL: '/pli/power/rentHouse/export'
},
dataForm: {
id: '',
- name: '',
- mobile: '',
- idCard: '',
- gridId: '',
- villageId: '',
- buildId: '',
- unitId: '',
- homeId: '',
- rentFlag: ''
+ name: '',
+ mobile: '',
+ idCard: '',
+ gridId: '',
+ villageId: '',
+ buildId: '',
+ unitId: '',
+ homeId: '',
+ rentFlag: ''
},
timeRange: '',
optionsV: [],
@@ -293,9 +293,9 @@ export default {
optionsD: [],
optionsG: [],
rentFlagArr: [
- { dictValue: 0, dictName: '自住' },
- { dictValue: 1, dictName: '出租' },
- { dictValue: 2, dictName: '闲置' }
+ { dictValue: 0, dictName: '自住' },
+ { dictValue: 1, dictName: '出租' },
+ { dictValue: 2, dictName: '闲置' }
],
//form相关
formShow: false,
@@ -333,6 +333,37 @@ export default {
}
},
methods: {
+ diaClose(){
+
+ },
+ exportHandle () {
+ const url = this.mixinViewModuleOptions.exportURL
+ this.$http({
+ method: 'GET',
+ url,
+ responseType: 'blob',
+ params: this.dataForm
+ }).then(res => {
+ // this.download(res.data, title + '.xls')
+ if (res.headers["content-disposition"]) {
+ let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
+ console.log('filename', fileName)
+ let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
+ var url = window.URL.createObjectURL(blob)
+ var aLink = document.createElement('a')
+ aLink.style.display = 'none'
+ aLink.href = url
+ aLink.setAttribute('download', fileName)
+ document.body.appendChild(aLink)
+ aLink.click()
+ document.body.removeChild(aLink) //下载完成移除元素
+ window.URL.revokeObjectURL(url) //释放掉blob对象
+ } else this.$message.error('下载失败')
+ }).catch(err => {
+ console.log('err', err)
+ return this.$message.error('网络错误')
+ })
+ },
addFormCancle () {
this.formShow = false
},
diff --git a/src/views/modules/plugins/rent/renthouseForm.vue b/src/views/modules/plugins/rent/renthouseForm.vue
index c9c30ac8..80296060 100644
--- a/src/views/modules/plugins/rent/renthouseForm.vue
+++ b/src/views/modules/plugins/rent/renthouseForm.vue
@@ -49,7 +49,6 @@
@@ -105,35 +102,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
- 更新房屋信息
+ 更新房屋信息
@@ -205,7 +183,6 @@ export default {
return {
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情
btnDisable: false,
- unitList: [],
houseId: '', //房屋ID
houseType: '1',
@@ -222,31 +199,86 @@ export default {
ownerPhone: '', //房主电话
ownerName: '', //房主名字
ownerIdCard: '', //房主身份证
- needUpdate: false
+ needUpdate: false,
+ purchaseDate: '',
+ villageId: '',
+ buildId: '',
+ unitId: ''
},
keyWords: '',
agencyObj: {},
- optionsV: [],
- optionsB: [],
- optionsH: [],
- optionsD: [],
- optionsG: [],
-
- gridId: '',
- villageId: '',
- buildId: '',
- unitId: '',
- homeId: '',
+ optionsV: [],
+ optionsB: [],
+ optionsH: [],
+ optionsD: [],
+ 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 () {
this.getGridList()
this.getValiheList()
@@ -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()
},
@@ -457,18 +493,25 @@ export default {
this.dataForm.purpose = this.purpose
this.dataForm.rentFlag = this.rentFlag
- // 小区到房号赋值
- this.dataForm.gridId = this.gridId
- this.dataForm.villageId = this.villageId
- this.dataForm.buildId = this.buildId
- this.dataForm.unitId = this.unitId
- this.dataForm.homeId = this.homeId
+ // 小区到房号赋值
+ this.dataForm.gridId = this.gridId
+ this.dataForm.villageId = this.villageId
+ 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: {}
}