Browse Source

Merge branch 'dev' into test

# Conflicts:
#	src/views/modules/base/community/community.vue
#	src/views/modules/base/community/roomForm.vue
test
wanggongfeng 3 years ago
parent
commit
8f0b4d427f
  1. 670
      src/views/modules/base/community/community.vue
  2. 484
      src/views/modules/base/community/roomForm.vue
  3. 2
      src/views/modules/base/community/roomTable.vue

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

@ -48,7 +48,6 @@
<div class="resi-cell-label">房主手机</div> <div class="resi-cell-label">房主手机</div>
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-input v-model="ownerPhone" <el-input v-model="ownerPhone"
class="resi-cell-input"
size="small" size="small"
clearable clearable
placeholder="请输入内容"> placeholder="请输入内容">
@ -80,8 +79,13 @@
<div class="resi-cell-label">房屋用途</div> <div class="resi-cell-label">房屋用途</div>
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="purpose" placeholder="房屋用途" clearable> <el-select v-model="purpose"
<el-option v-for="item in purposeArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue"> placeholder="房屋用途"
clearable>
<el-option v-for="item in purposeArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option> </el-option>
</el-select> </el-select>
@ -120,6 +124,8 @@
:ownerName="ownerName" :ownerName="ownerName"
:ownerPhone="ownerPhone" :ownerPhone="ownerPhone"
:rentFlag="rentFlag" :rentFlag="rentFlag"
:purpose="purpose"
:remark="remark"
@toNextLevel="toNextLevel" @toNextLevel="toNextLevel"
@refreshTree="refreshTree"></build-table> @refreshTree="refreshTree"></build-table>
@ -129,6 +135,8 @@
:ownerName="ownerName" :ownerName="ownerName"
:ownerPhone="ownerPhone" :ownerPhone="ownerPhone"
:rentFlag="rentFlag" :rentFlag="rentFlag"
:purpose="purpose"
:remark="remark"
ref="ref_buildingTable" ref="ref_buildingTable"
@refreshTree="refreshTree"></room-table> @refreshTree="refreshTree"></room-table>
@ -138,6 +146,8 @@
:ownerName="ownerName" :ownerName="ownerName"
:ownerPhone="ownerPhone" :ownerPhone="ownerPhone"
:rentFlag="rentFlag" :rentFlag="rentFlag"
:purpose="purpose"
:remark="remark"
ref="ref_communityTable" ref="ref_communityTable"
@refreshTree="refreshTree"></community-table> @refreshTree="refreshTree"></community-table>
@ -174,364 +184,364 @@
staffAgencyId: localStorage.getItem("agencyId"), staffAgencyId: localStorage.getItem("agencyId"),
showImportBtn: false, showImportBtn: false,
rentList: [ rentList: [
{ {
value: '1', value: '1',
label: '出租' label: '出租'
},
{
value: '2',
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: { {
CDialog value: '2',
label: '闲置'
}, },
async mounted () { {
this.treeLoading = true value: '0',
label: '自住'
await this.loadOrgData()
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 () { 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: {
CDialog
},
async mounted () {
this.treeLoading = true
await this.loadOrgData()
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
return this.$store.state.inIframe ? this.clientHeight - 140 + this.iframeHeight + 'px' : this.clientHeight - 140 + 'px' },
computed: {
rowHeight () {
}, return this.$store.state.inIframe ? this.clientHeight - 140 + this.iframeHeight + 'px' : this.clientHeight - 140 + 'px'
treeHeight () {
return this.$store.state.inIframe ? this.clientHeight - 200 + this.iframeHeight + 'px' : this.clientHeight - 200 + 'px'
}, },
treeHeight () {
return this.$store.state.inIframe ? this.clientHeight - 200 + this.iframeHeight + 'px' : this.clientHeight - 200 + 'px'
...mapGetters(['clientHeight', 'iframeHeight']) },
},
methods: {
handleSearch () { ...mapGetters(['clientHeight', 'iframeHeight'])
if (this.ownerName || this.ownerPhone || this.rentFlag || this.purpose || this.remark) { },
this.showRoomTable = true methods: {
this.$nextTick(() => { handleSearch () {
this.$refs['ref_buildingTable'].loadTable('search', this.selTreeObj) if (this.ownerName || this.ownerPhone || this.rentFlag || this.purpose || this.remark) {
}) this.showRoomTable = true
} else {
this.$message.warning('请输入查询条件')
}
this.$nextTick(() => {
this.$refs['ref_buildingTable'].loadTable('search', this.selTreeObj)
})
} else {
this.$message.warning('请输入查询条件')
}
},
// },
resetSearch () {
this.ownerName = ''
this.ownerPhone = ''
this.rentFlag = ''
this.purpose = ''
this.remark = ''
this.pageSize = 10
this.pageNo = 1
this.handleNodeClick(this.selObj)
// this.loadTable()
},
async loadOpenNode () { //
const url = "/gov/org/building/tree-ids" resetSearch () {
let params = {} this.ownerName = ''
this.ownerPhone = ''
const { data, code, msg } = await requestPost(url, params) this.rentFlag = ''
this.purpose = ''
if (code === 0) { this.remark = ''
this.openNodes = data
this.pageSize = 10
this.pageNo = 1
this.handleNodeClick(this.selObj)
// this.loadTable()
},
} else { async loadOpenNode () {
this.$message.error(msg) const url = "/gov/org/building/tree-ids"
} let params = {}
},
async loadTree (isRefresh) { const { data, code, msg } = await requestPost(url, params)
const url = "/gov/org/building/treelist"
let params = {} if (code === 0) {
this.openNodes = data
const { data, code, msg } = await requestPost(url, params)
if (code === 0) { } else {
this.$message.error(msg)
this.treeData = data }
if (!isRefresh && data.length > 0) { },
async loadTree (isRefresh) {
this.selTreeObj = data[0] const url = "/gov/org/building/treelist"
if (!this.selTreeObj.latitude) { let params = {}
this.selTreeObj.latitude = this.centerPoint[0]
} const { data, code, msg } = await requestPost(url, params)
if (!this.selTreeObj.longitude) { if (code === 0) {
this.selTreeObj.longitude = this.centerPoint[1]
} this.treeData = data
} if (!isRefresh && data.length > 0) {
} else { this.selTreeObj = data[0]
this.$message.error(msg) if (!this.selTreeObj.latitude) {
} this.selTreeObj.latitude = this.centerPoint[0]
}, }
// if (!this.selTreeObj.longitude) {
async loadOrgData () { this.selTreeObj.longitude = this.centerPoint[1]
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;
}
.div_tree { } else {
flex: 0 0 280px; this.$message.error(msg)
background-color: #ffffff; }
border-radius: 5px; },
padding: 10px;
overflow-y: hidden;
}
.filter_tree {
overflow-x: auto;
}
.div_table { //
margin-left: 15px; async loadOrgData () {
// flex: 1; const url = "/gov/org/agency/maporg"
width: calc(100% - 300px); // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/maporg"
background-color: #ffffff; let params = {}
border-radius: 5px;
padding: 10px;
}
.div_btn { const { data, code, msg } = await requestPost(url, params)
margin-top: 20px;
} if (code === 0) {
this.centerPoint = []
this.centerPoint.push(data.latitude)
this.centerPoint.push(data.longitude)
} else {
this.$message.error(msg)
}
.row { },
padding: 10px;
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;
}
.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>

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

@ -136,36 +136,36 @@
</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 // let loading //
export default { export default {
data () { data () {
return { return {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
btnDisable: false, btnDisable: false,
unitList: [], unitList: [],
houseId: '', //ID houseId: '', //ID
houseType: '1', houseType: '1',
purpose: '1', purpose: '1',
rentFlag: 0, rentFlag: 0,
dataForm: { dataForm: {
neighborHoodId: '', // ID neighborHoodId: '', // ID
buildingId: '',//ID buildingId: '',//ID
buildingUnitId: '',//ID buildingUnitId: '',//ID
doorName: '',// doorName: '',//
houseType: '',// houseType: '',//
purpose: '',// purpose: '',//
rentFlag: 0,//10 12 0 rentFlag: 0,//10 12 0
ownerPhone: '', // ownerPhone: '', //
ownerName: '', // ownerName: '', //
ownerIdCard: '', // ownerIdCard: '', //
remark: '' remark: '' //
}, },
keyWords: '', keyWords: '',
agencyObj: {}, agencyObj: {},
@ -177,219 +177,219 @@
}, },
methods: { methods: {
async initForm (type, row, agencyObj) { async initForm (type, row, agencyObj) {
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj this.agencyObj = agencyObj
this.formType = type this.formType = type
if (row) { if (row) {
this.houseId = row.houseId this.houseId = row.houseId
await this.loadHouseInfo() await this.loadHouseInfo()
// this.dataForm = JSON.parse(JSON.stringify(row)) // this.dataForm = JSON.parse(JSON.stringify(row))
// this.houseId = this.dataForm.houseId // this.houseId = this.dataForm.houseId
// this.dataForm.buildingUnitId = this.dataForm.unitNumKey // this.dataForm.buildingUnitId = this.dataForm.unitNumKey
// this.dataForm = { ... this.dataForm } // this.dataForm = { ... this.dataForm }
// this.houseType = this.dataForm.houseTypeKey // this.houseType = this.dataForm.houseTypeKey
// this.purpose = this.dataForm.purposeKey // this.purpose = this.dataForm.purposeKey
// this.rentFlag = parseInt(this.dataForm.rentFlagKey) // this.rentFlag = parseInt(this.dataForm.rentFlagKey)
} else { } else {
this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId
this.dataForm.buildingId = this.agencyObj.id this.dataForm.buildingId = this.agencyObj.id
} }
await this.loadUnitList() await this.loadUnitList()
}, },
async loadHouseInfo () { async loadHouseInfo () {
const url = "/gov/org/ichouse/" + this.houseId const url = "/gov/org/ichouse/" + this.houseId
const { data, code, msg } = await requestGet(url) const { data, code, msg } = await requestGet(url)
if (code === 0) { if (code === 0) {
// debugger // debugger
this.dataForm = { ...data } this.dataForm = { ...data }
this.houseType = this.dataForm.houseType this.houseType = this.dataForm.houseType
this.purpose = this.dataForm.purpose this.purpose = this.dataForm.purpose
this.rentFlag = parseInt(this.dataForm.rentFlag) this.rentFlag = parseInt(this.dataForm.rentFlag)
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
}, },
// //
async loadUnitList () { async loadUnitList () {
const url = '/gov/org/building/buildingunitlist' const url = '/gov/org/building/buildingunitlist'
let params = { let params = {
buildingId: this.dataForm.buildingId buildingId: this.dataForm.buildingId
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
this.unitList = data this.unitList = data
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
}, },
async handleComfirm () { async handleComfirm () {
this.btnDisable = true this.btnDisable = true
setTimeout(() => { setTimeout(() => {
this.btnDisable = false this.btnDisable = false
}, 10000) }, 10000)
this.dataForm.houseType = this.houseType this.dataForm.houseType = this.houseType
this.dataForm.purpose = this.purpose this.dataForm.purpose = this.purpose
this.dataForm.rentFlag = this.rentFlag this.dataForm.rentFlag = this.rentFlag
this.$refs['ref_form'].validate((valid, messageObj) => { this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) { if (!valid) {
this.btnDisable = false this.btnDisable = false
app.util.validateRule(messageObj) app.util.validateRule(messageObj)
} else { } else {
this.addRoom() this.addRoom()
} }
}) })
}, },
async addRoom () { async addRoom () {
const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //1518151817X const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //1518151817X
if (this.dataForm.ownerIdCard && regCard.test(this.dataForm.ownerIdCard) === false) { if (this.dataForm.ownerIdCard && regCard.test(this.dataForm.ownerIdCard) === false) {
this.btnDisable = false this.btnDisable = false
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: '请输入正确的身份证号码' message: '请输入正确的身份证号码'
}) })
return false; return false;
} }
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; // const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (this.dataForm.ownerPhone && regPhone.test(this.dataForm.ownerPhone) === false) { if (this.dataForm.ownerPhone && regPhone.test(this.dataForm.ownerPhone) === false) {
this.btnDisable = false this.btnDisable = false
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: '请输入正确的手机号码' message: '请输入正确的手机号码'
}) })
return false; return false;
} }
let url = '' let url = ''
if (this.formType === 'add') { if (this.formType === 'add') {
url = '/gov/org/house/houseadd' url = '/gov/org/house/houseadd'
} else { } else {
url = '/gov/org/house/houseupdate' url = '/gov/org/house/houseupdate'
this.dataForm.houseId = this.houseId this.dataForm.houseId = this.houseId
} }
const { data, code, msg } = await requestPost(url, this.dataForm) const { data, code, msg } = await requestPost(url, this.dataForm)
this.btnDisable = false this.btnDisable = false
if (code === 0) { if (code === 0) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '操作成功' message: '操作成功'
}) })
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
}, },
handleCancle () { handleCancle () {
this.resetData() this.resetData()
this.$emit('dialogCancle') this.$emit('dialogCancle')
}, },
resetData () { resetData () {
this.houseId = '' //ID this.houseId = '' //ID
this.houseType = '1' this.houseType = '1'
this.purpose = '1' this.purpose = '1'
this.rentFlag = 0 this.rentFlag = 0
this.dataForm = { this.dataForm = {
neighborHoodId: '', // ID neighborHoodId: '', // ID
buildingId: '',//ID buildingId: '',//ID
buildingUnitId: '',//ID buildingUnitId: '',//ID
doorName: '',// doorName: '',//
houseType: '1',// houseType: '1',//
purpose: '1',// purpose: '1',//
rentFlag: 0,//10 rentFlag: 0,//10
ownerPhone: '', // ownerPhone: '', //
ownerName: '', // ownerName: '', //
ownerIdCard: '', // ownerIdCard: '', //
remark: '' // remark: '' //
} }
}, },
// //
startLoading () { startLoading () {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: '正在加载……', // text: '正在加载……', //
background: 'rgba(0,0,0,.7)' // background: 'rgba(0,0,0,.7)' //
}) })
}, },
// //
endLoading () { endLoading () {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close() 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 }
],
remark: [
{ 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>

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

@ -622,9 +622,9 @@
gridId: '', gridId: '',
ownerName: this.ownerName, ownerName: this.ownerName,
ownerPhone: this.ownerPhone, ownerPhone: this.ownerPhone,
rentFlag: this.rentFlag,
purpose: this.purpose, purpose: this.purpose,
remark: this.remark, remark: this.remark,
rentFlag: this.rentFlag,
buildingId: '', buildingId: '',
neighborHoodId: '' neighborHoodId: ''
} }

Loading…
Cancel
Save