Browse Source

房屋管理添加查询字段

shibei_master
wanggongfeng 3 years ago
parent
commit
dbfa30ca28
  1. 724
      src/views/modules/base/community/community.vue
  2. 507
      src/views/modules/base/community/roomForm.vue
  3. 1192
      src/views/modules/base/community/roomTable.vue

724
src/views/modules/base/community/community.vue

@ -75,6 +75,31 @@
</div> </div>
</div> </div>
<div class="resi-cell">
<div class="resi-cell-label">房屋用途</div>
<div class="resi-cell-value">
<el-select v-model="purpose" placeholder="房屋用途" clearable>
<el-option v-for="item in purposeArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue">
</el-option>
</el-select>
</div>
</div>
<div class="resi-cell">
<div class="resi-cell-label">备注</div>
<div class="resi-cell-value">
<el-input v-model="remark"
size="small"
clearable
placeholder="请输入备注">
</el-input>
</div>
</div>
<el-button style="margin-left:10px" <el-button style="margin-left:10px"
class="diy-button--search" class="diy-button--search"
size="small" size="small"
@ -122,376 +147,391 @@
</template> </template>
<script> <script>
import CDialog from '@c/CDialog' import CDialog from '@c/CDialog'
import communityTable from './communityTable' import communityTable from './communityTable'
import buildTable from './buildTable' import buildTable from './buildTable'
import roomTable from './roomTable' import roomTable from './roomTable'
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
let loading // let loading //
export default { export default {
data () { data () {
return { return {
filterText: '', filterText: '',
treeLoading: true, treeLoading: true,
treeData: [], treeData: [],
openNodes: [], openNodes: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'showName' label: 'showName'
}, },
selTreeObj: {}, selTreeObj: {},
centerPoint: [], centerPoint: [],
staffAgencyId: localStorage.getItem("agencyId"), staffAgencyId: localStorage.getItem("agencyId"),
showImportBtn: false, showImportBtn: false,
rentList: [ rentList: [
{ {
value: '1', value: '1',
label: '出租' label: '出租'
}, },
{ {
value: '2', value: '2',
label: '闲置' label: '闲置'
},
{
value: '0',
label: '自住'
},
],
ownerName: '',
ownerPhone: '',
rentFlag: '',
purpose: '',
remark: '',
showRoomTable: false,
selObj: {},
purposeArr: [
{ dictValue: '1', dictName: '住宅' },
{ dictValue: '2', dictName: '商业' },
{ dictValue: '3', dictName: '办公' },
{ dictValue: '4', dictName: '工业' },
{ dictValue: '5', dictName: '仓储' },
{ dictValue: '6', dictName: '商住混用' },
{ dictValue: '7', dictName: '其他' }
]
}
}, },
{ components: {
value: '0', CDialog
label: '自住'
}, },
], async mounted () {
ownerName: '', this.treeLoading = true
ownerPhone: '',
rentFlag: '', await this.loadOrgData()
showRoomTable: false, await this.loadTree()
selObj: {}, await this.loadOpenNode()
}
}, await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj)
components: { if (this.treeData.length > 0) {
CDialog this.$nextTick(() => {
}, // ref_tree ref value node-key
async mounted () { this.$refs.ref_tree.setCurrentKey(this.treeData[0].id);
this.treeLoading = true });
}
await this.loadOrgData() this.treeLoading = false
await this.loadTree()
await this.loadOpenNode()
await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj)
if (this.treeData.length > 0) {
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.treeData[0].id);
});
}
this.treeLoading = false
},
computed: {
rowHeight () {
return this.$store.state.inIframe ? this.clientHeight - 140 + this.iframeHeight + 'px' : this.clientHeight - 140 + 'px'
}, },
treeHeight () { computed: {
return this.$store.state.inIframe ? this.clientHeight - 200 + this.iframeHeight + 'px' : this.clientHeight - 200 + 'px' rowHeight () {
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
methods: {
handleSearch () {
if (this.ownerName || this.ownerPhone || this.rentFlag) {
this.showRoomTable = true
this.$nextTick(() => {
this.$refs['ref_buildingTable'].loadTable('search', this.selTreeObj)
})
} else {
this.$message.warning('请输入查询条件')
}
},
// return this.$store.state.inIframe ? this.clientHeight - 140 + this.iframeHeight + 'px' : this.clientHeight - 140 + 'px'
resetSearch () {
this.ownerName = ''
this.ownerPhone = ''
this.rentFlag = ''
this.pageSize = 10 },
this.pageNo = 1 treeHeight () {
this.handleNodeClick(this.selObj) return this.$store.state.inIframe ? this.clientHeight - 200 + this.iframeHeight + 'px' : this.clientHeight - 200 + 'px'
// this.loadTable()
},
async loadOpenNode () { },
const url = "/gov/org/building/tree-ids"
let params = {}
const { data, code, msg } = await requestPost(url, params) ...mapGetters(['clientHeight', 'iframeHeight'])
},
methods: {
if (code === 0) { handleSearch () {
this.openNodes = data if (this.ownerName || this.ownerPhone || this.rentFlag || this.purpose || this.remark) {
this.showRoomTable = true
this.$nextTick(() => {
this.$refs['ref_buildingTable'].loadTable('search', this.selTreeObj)
})
} else {
this.$message.warning('请输入查询条件')
}
} else {
this.$message.error(msg)
}
},
async loadTree (isRefresh) {
const url = "/gov/org/building/treelist"
let params = {}
const { data, code, msg } = await requestPost(url, params) },
if (code === 0) { //
resetSearch () {
this.ownerName = ''
this.ownerPhone = ''
this.rentFlag = ''
this.purpose = ''
this.remark = ''
this.pageSize = 10
this.pageNo = 1
this.handleNodeClick(this.selObj)
// this.loadTable()
},
this.treeData = data async loadOpenNode () {
if (!isRefresh && data.length > 0) { const url = "/gov/org/building/tree-ids"
let params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.openNodes = data
this.selTreeObj = data[0]
if (!this.selTreeObj.latitude) {
this.selTreeObj.latitude = this.centerPoint[0]
}
if (!this.selTreeObj.longitude) { } else {
this.selTreeObj.longitude = this.centerPoint[1] this.$message.error(msg)
} }
},
async loadTree (isRefresh) {
const url = "/gov/org/building/treelist"
let params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.treeData = data
if (!isRefresh && data.length > 0) {
this.selTreeObj = data[0]
if (!this.selTreeObj.latitude) {
this.selTreeObj.latitude = this.centerPoint[0]
}
if (!this.selTreeObj.longitude) {
this.selTreeObj.longitude = this.centerPoint[1]
}
}
} else {
this.$message.error(msg)
}
},
//
async loadOrgData () {
const url = "/gov/org/agency/maporg"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/maporg"
let params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.centerPoint = []
this.centerPoint.push(data.latitude)
this.centerPoint.push(data.longitude)
} else {
this.$message.error(msg)
}
},
handleNodeClick (obj) {
this.ownerName = ''
this.ownerPhone = ''
this.rentFlag = ''
this.purpose = ''
this.remark = ''
this.showRoomTable = false
this.selObj = JSON.parse(JSON.stringify(obj))
this.getTreeObj(obj)
this.$nextTick(() => {
if (obj.level === 'building') {//
this.$refs['ref_buildingTable'].loadTable('tree', this.selTreeObj)
} else if (obj.level === 'neighborHood') {//
this.$refs['ref_neighTable'].loadTable(true, this.selTreeObj)
} else {
this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj)
}
})
},
//
async refreshTree () {
this.treeLoading = true
await this.loadTree(this.selTreeObj.id)
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id);
});
this.treeLoading = false
},
//
toNextLevel (row, level) {
if (level === 'community') {
this.selTreeObj = this.$refs.ref_tree.getNode(row.neighborHoodId).data
this.openNodes.push(this.selTreeObj.id)
} else {
this.selTreeObj = this.$refs.ref_tree.getNode(row.buildingId).data
}
this.handleNodeClick(this.selTreeObj)
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id);
});
const node = document.getElementById(this.selTreeObj.id) // Iddom
setTimeout(() => {
if (node) {
this.$nextTick(() => {
node.scrollIntoView({ block: 'center' }) // scrollIntoViewdom block: 'center'
})
}
}, 100)
},
//
getTreeObj (obj) {
//
// idtype
// idtypeidid
// idtypeid
if (obj.level === 'building') {//
let neighborHoodNode = this.$refs.ref_tree.getNode(obj.pid)//
let gridNode = this.$refs.ref_tree.getNode(neighborHoodNode.data.pid)//
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)//
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label
obj.neighborHoodId = neighborHoodNode.data.id
obj.neighborHoodName = neighborHoodNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (obj.level === 'neighborHood') {//
let gridNode = this.$refs.ref_tree.getNode(obj.pid)
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)
obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else {
}
if (!obj.latitude) {
obj.latitude = this.centerPoint[0]
}
if (!obj.longitude) {
obj.longitude = this.centerPoint[1]
}
this.selTreeObj = obj
console.log(this.selTreeObj)
},
filterNode (value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
watch: {
filterText (val) {
this.$refs.ref_tree.filter(val);
}
},
components: {
communityTable, buildTable, roomTable
} }
}
</script>
<style lang="scss" scoped >
.div_main {
display: flex;
}
.scrollar {
margin-top: 10px;
}
} else { .div_tree {
this.$message.error(msg) flex: 0 0 280px;
} background-color: #ffffff;
}, border-radius: 5px;
padding: 10px;
// overflow-y: hidden;
async loadOrgData () { }
const url = "/gov/org/agency/maporg" .filter_tree {
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/maporg" overflow-x: auto;
let params = {} }
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.centerPoint = []
this.centerPoint.push(data.latitude)
this.centerPoint.push(data.longitude)
} else {
this.$message.error(msg)
}
},
handleNodeClick (obj) {
this.ownerName = ''
this.ownerPhone = ''
this.rentFlag = ''
this.showRoomTable = false
this.selObj = JSON.parse(JSON.stringify(obj))
this.getTreeObj(obj)
this.$nextTick(() => {
if (obj.level === 'building') {//
this.$refs['ref_buildingTable'].loadTable('tree', this.selTreeObj)
} else if (obj.level === 'neighborHood') {//
this.$refs['ref_neighTable'].loadTable(true, this.selTreeObj)
} else { .div_table {
this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj) margin-left: 15px;
} // flex: 1;
}) width: calc(100% - 300px);
background-color: #ffffff;
}, border-radius: 5px;
padding: 10px;
// }
async refreshTree () {
this.treeLoading = true
await this.loadTree(this.selTreeObj.id)
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id);
});
this.treeLoading = false
},
//
toNextLevel (row, level) {
if (level === 'community') {
this.selTreeObj = this.$refs.ref_tree.getNode(row.neighborHoodId).data
this.openNodes.push(this.selTreeObj.id)
} else {
this.selTreeObj = this.$refs.ref_tree.getNode(row.buildingId).data
}
this.handleNodeClick(this.selTreeObj)
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id);
});
const node = document.getElementById(this.selTreeObj.id) // Iddom
setTimeout(() => {
if (node) {
this.$nextTick(() => {
node.scrollIntoView({ block: 'center' }) // scrollIntoViewdom block: 'center'
})
}
}, 100)
},
//
getTreeObj (obj) {
//
// idtype
// idtypeidid
// idtypeid
if (obj.level === 'building') {//
let neighborHoodNode = this.$refs.ref_tree.getNode(obj.pid)//
let gridNode = this.$refs.ref_tree.getNode(neighborHoodNode.data.pid)//
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)//
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label
obj.neighborHoodId = neighborHoodNode.data.id
obj.neighborHoodName = neighborHoodNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (obj.level === 'neighborHood') {// .div_btn {
let gridNode = this.$refs.ref_tree.getNode(obj.pid) margin-top: 20px;
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid) }
obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else { .row {
padding: 10px;
}
if (!obj.latitude) {
obj.latitude = this.centerPoint[0]
}
if (!obj.longitude) {
obj.longitude = this.centerPoint[1]
}
this.selTreeObj = obj
console.log(this.selTreeObj)
},
filterNode (value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
watch: {
filterText (val) {
this.$refs.ref_tree.filter(val);
}
},
components: {
communityTable, buildTable, roomTable
} }
}
</script>
<style lang="scss" scoped >
.div_main {
display: flex;
}
.scrollar {
margin-top: 10px;
}
.div_tree {
flex: 0 0 280px;
background-color: #ffffff;
border-radius: 5px;
padding: 10px;
overflow-y: hidden;
}
.filter_tree {
overflow-x: auto;
}
.div_table {
margin-left: 15px;
// flex: 1;
width: calc(100% - 300px);
background-color: #ffffff;
border-radius: 5px;
padding: 10px;
}
.div_btn {
margin-top: 20px;
}
.row {
padding: 10px;
}
</style> </style>
<style> <style>
/* .aui-content > .el-tabs > .el-tabs__content { /* .aui-content > .el-tabs > .el-tabs__content {
padding: 0px; padding: 0px;
} */ } */
.el-tree-node:focus > .el-tree-node__content { .el-tree-node:focus > .el-tree-node__content {
/* background-color: #ccc !important; */ /* background-color: #ccc !important; */
color: #2195fe; color: #2195fe;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.div_tree { .div_tree {
/deep/ .el-scrollbar__wrap { /deep/ .el-scrollbar__wrap {
overflow-x: hidden !important; overflow-x: hidden !important;
}
} }
}
</style> </style>
<style lang="scss" scoped > <style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManage.scss"; @import "@/assets/scss/modules/visual/communityManage.scss";
</style> </style>

507
src/views/modules/base/community/roomForm.vue

@ -110,6 +110,16 @@
v-model="dataForm.ownerIdCard"> v-model="dataForm.ownerIdCard">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注"
prop="remark"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="30"
placeholder="请输入备注"
v-model="dataForm.remark">
</el-input>
</el-form-item>
</el-form> </el-form>
</div> </div>
@ -126,255 +136,260 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost, requestGet } from '@/js/dai/request' import { requestPost, requestGet } from '@/js/dai/request'
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
unitList: [],
houseId: '', //ID
houseType: '1',
purpose: '1',
rentFlag: 0,
dataForm: {
neighborHoodId: '', // ID
buildingId: '',//ID
buildingUnitId: '',//ID
doorName: '',//
houseType: '',//
purpose: '',//
rentFlag: 0,//10 12 0
ownerPhone: '', //
ownerName: '', //
ownerIdCard: '' //
},
keyWords: '',
agencyObj: {},
}
},
components: {},
mounted () {
}, let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
unitList: [],
methods: { houseId: '', //ID
async initForm (type, row, agencyObj) { houseType: '1',
purpose: '1',
this.$refs.ref_form.resetFields(); rentFlag: 0,
this.agencyObj = agencyObj dataForm: {
this.formType = type neighborHoodId: '', // ID
if (row) { buildingId: '',//ID
buildingUnitId: '',//ID
this.houseId = row.houseId doorName: '',//
await this.loadHouseInfo() houseType: '',//
// this.dataForm = JSON.parse(JSON.stringify(row)) purpose: '',//
// this.houseId = this.dataForm.houseId rentFlag: 0,//10 12 0
ownerPhone: '', //
// this.dataForm.buildingUnitId = this.dataForm.unitNumKey ownerName: '', //
// this.dataForm = { ... this.dataForm } ownerIdCard: '', //
// this.houseType = this.dataForm.houseTypeKey remark: ''
// this.purpose = this.dataForm.purposeKey },
// this.rentFlag = parseInt(this.dataForm.rentFlagKey)
keyWords: '',
} else { agencyObj: {},
this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId }
this.dataForm.buildingId = this.agencyObj.id },
} components: {},
mounted () {
await this.loadUnitList() },
}, methods: {
async initForm (type, row, agencyObj) {
async loadHouseInfo () {
this.$refs.ref_form.resetFields();
const url = "/gov/org/ichouse/" + this.houseId this.agencyObj = agencyObj
this.formType = type
const { data, code, msg } = await requestGet(url) if (row) {
if (code === 0) { this.houseId = row.houseId
// debugger await this.loadHouseInfo()
this.dataForm = { ...data } // this.dataForm = JSON.parse(JSON.stringify(row))
// this.houseId = this.dataForm.houseId
this.houseType = this.dataForm.houseType
this.purpose = this.dataForm.purpose // this.dataForm.buildingUnitId = this.dataForm.unitNumKey
this.rentFlag = parseInt(this.dataForm.rentFlag) // this.dataForm = { ... this.dataForm }
// this.houseType = this.dataForm.houseTypeKey
// this.purpose = this.dataForm.purposeKey
} else { // this.rentFlag = parseInt(this.dataForm.rentFlagKey)
this.$message.error(msg)
} } else {
}, this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId
this.dataForm.buildingId = this.agencyObj.id
// }
async loadUnitList () {
const url = '/gov/org/building/buildingunitlist'
await this.loadUnitList()
let params = {
buildingId: this.dataForm.buildingId },
}
async loadHouseInfo () {
const { data, code, msg } = await requestPost(url, params)
const url = "/gov/org/ichouse/" + this.houseId
if (code === 0) {
this.unitList = data const { data, code, msg } = await requestGet(url)
} else {
this.$message.error(msg) if (code === 0) {
} // debugger
}, this.dataForm = { ...data }
async handleComfirm () { this.houseType = this.dataForm.houseType
this.btnDisable = true this.purpose = this.dataForm.purpose
setTimeout(() => { this.rentFlag = parseInt(this.dataForm.rentFlag)
this.btnDisable = false
}, 10000)
} else {
this.dataForm.houseType = this.houseType this.$message.error(msg)
this.dataForm.purpose = this.purpose }
this.dataForm.rentFlag = this.rentFlag
this.$refs['ref_form'].validate((valid, messageObj) => { },
if (!valid) {
this.btnDisable = false //
app.util.validateRule(messageObj) async loadUnitList () {
} else { const url = '/gov/org/building/buildingunitlist'
this.addRoom()
} let params = {
buildingId: this.dataForm.buildingId
}) }
},
const { data, code, msg } = await requestPost(url, params)
async addRoom () {
const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //1518151817X if (code === 0) {
if (this.dataForm.ownerIdCard && regCard.test(this.dataForm.ownerIdCard) === false) { this.unitList = data
this.btnDisable = false } else {
this.$message({ this.$message.error(msg)
type: 'warning', }
message: '请输入正确的身份证号码' },
})
return false; async handleComfirm () {
} this.btnDisable = true
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; // setTimeout(() => {
if (this.dataForm.ownerPhone && regPhone.test(this.dataForm.ownerPhone) === false) { this.btnDisable = false
this.btnDisable = false }, 10000)
this.$message({
type: 'warning', this.dataForm.houseType = this.houseType
message: '请输入正确的手机号码' this.dataForm.purpose = this.purpose
}) this.dataForm.rentFlag = this.rentFlag
return false; this.$refs['ref_form'].validate((valid, messageObj) => {
} if (!valid) {
this.btnDisable = false
let url = '' app.util.validateRule(messageObj)
} else {
if (this.formType === 'add') { this.addRoom()
url = '/gov/org/house/houseadd' }
} else {
url = '/gov/org/house/houseupdate' })
this.dataForm.houseId = this.houseId },
}
async addRoom () {
const { data, code, msg } = await requestPost(url, this.dataForm) const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //1518151817X
this.btnDisable = false if (this.dataForm.ownerIdCard && regCard.test(this.dataForm.ownerIdCard) === false) {
if (code === 0) { this.btnDisable = false
this.$message({ this.$message({
type: 'success', type: 'warning',
message: '操作成功' message: '请输入正确的身份证号码'
}) })
this.resetData() return false;
this.$emit('dialogOk') }
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
} else { if (this.dataForm.ownerPhone && regPhone.test(this.dataForm.ownerPhone) === false) {
this.btnDisable = false
this.$message.error(msg) this.$message({
} type: 'warning',
message: '请输入正确的手机号码'
}, })
return false;
handleCancle () { }
this.resetData()
this.$emit('dialogCancle') let url = ''
}, if (this.formType === 'add') {
url = '/gov/org/house/houseadd'
resetData () { } else {
this.houseId = '' //ID url = '/gov/org/house/houseupdate'
this.houseType = '1' this.dataForm.houseId = this.houseId
this.purpose = '1' }
this.rentFlag = 0
this.dataForm = { const { data, code, msg } = await requestPost(url, this.dataForm)
neighborHoodId: '', // ID this.btnDisable = false
buildingId: '',//ID if (code === 0) {
buildingUnitId: '',//ID this.$message({
doorName: '',// type: 'success',
houseType: '1',// message: '操作成功'
purpose: '1',// })
rentFlag: 0,//10 this.resetData()
ownerPhone: '', // this.$emit('dialogOk')
ownerName: '', //
ownerIdCard: '' // } else {
}
this.$message.error(msg)
}, }
//
startLoading () { },
loading = Loading.service({
lock: true, // handleCancle () {
text: '正在加载……', // this.resetData()
background: 'rgba(0,0,0,.7)' // this.$emit('dialogCancle')
})
}, },
//
endLoading () { resetData () {
// clearTimeout(timer); this.houseId = '' //ID
if (loading) { this.houseType = '1'
loading.close() this.purpose = '1'
} this.rentFlag = 0
this.dataForm = {
neighborHoodId: '', // ID
buildingId: '',//ID
buildingUnitId: '',//ID
doorName: '',//
houseType: '1',//
purpose: '1',//
rentFlag: 0,//10
ownerPhone: '', //
ownerName: '', //
ownerIdCard: '', //
remark: '' //
}
},
//
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 }
],
remark: [
{ required: false }
],
}
},
},
props: {}
} }
},
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 }
],
}
},
},
props: {}
}
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss"; @import "@/assets/scss/modules/visual/communityManageForm.scss";
</style> </style>

1192
src/views/modules/base/community/roomTable.vue

File diff suppressed because it is too large
Loading…
Cancel
Save