Browse Source

合并分支

test
曲树通 4 years ago
parent
commit
0494c65121
  1. 718
      src/views/modules/base/community/community.vue
  2. 501
      src/views/modules/base/community/roomForm.vue
  3. 1241
      src/views/modules/base/community/roomTable.vue

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

@ -79,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>
@ -99,7 +104,6 @@
</div> </div>
</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"
@ -147,391 +151,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',
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>

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

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

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

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