Browse Source

房主电话修改

shibei_master
jiangyy 3 years ago
parent
commit
a687ef97e3
  1. 2
      src/views/modules/base/community/community.vue
  2. 504
      src/views/modules/base/community/roomForm.vue
  3. 2
      src/views/modules/base/community/roomTable.vue

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

@ -48,7 +48,7 @@
</el-input>
</el-form-item>
<el-form-item label="房主手机"
<el-form-item label="联系方式"
prop="ownerPhone">
<el-input v-model="ownerPhone"
class="item_width_2"

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

@ -91,13 +91,13 @@
v-model="dataForm.ownerName">
</el-input>
</el-form-item>
<el-form-item label="房主电话"
<el-form-item label="联系方式"
prop="ownerPhone"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type='number'
placeholder="请输入房主电话"
placeholder="请输入联系方式"
v-model="dataForm.ownerPhone">
</el-input>
</el-form-item>
@ -136,260 +136,260 @@
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost, requestGet } from '@/js/dai/request'
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
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
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 () {
},
methods: {
async initForm (type, row, agencyObj) {
this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj
this.formType = type
if (row) {
this.houseId = row.houseId
await this.loadHouseInfo()
// this.dataForm = JSON.parse(JSON.stringify(row))
// this.houseId = this.dataForm.houseId
// this.dataForm.buildingUnitId = this.dataForm.unitNumKey
// this.dataForm = { ... this.dataForm }
// this.houseType = this.dataForm.houseTypeKey
// this.purpose = this.dataForm.purposeKey
// this.rentFlag = parseInt(this.dataForm.rentFlagKey)
} else {
this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId
this.dataForm.buildingId = this.agencyObj.id
}
await this.loadUnitList()
},
async loadHouseInfo () {
const url = "/gov/org/ichouse/" + this.houseId
const { data, code, msg } = await requestGet(url)
if (code === 0) {
// debugger
this.dataForm = { ...data }
this.houseType = this.dataForm.houseType
this.purpose = this.dataForm.purpose
this.rentFlag = parseInt(this.dataForm.rentFlag)
} else {
this.$message.error(msg)
}
},
//
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)
}
},
async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
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
app.util.validateRule(messageObj)
} else {
this.addRoom()
}
})
},
async addRoom () {
const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //1518151817X
if (this.dataForm.ownerIdCard && regCard.test(this.dataForm.ownerIdCard) === false) {
this.btnDisable = false
this.$message({
type: 'warning',
message: '请输入正确的身份证号码'
})
return false;
}
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (this.dataForm.ownerPhone && regPhone.test(this.dataForm.ownerPhone) === false) {
this.btnDisable = false
this.$message({
type: 'warning',
message: '请输入正确的手机号码'
})
return false;
}
let url = ''
if (this.formType === 'add') {
url = '/gov/org/house/houseadd'
} else {
url = '/gov/org/house/houseupdate'
this.dataForm.houseId = this.houseId
}
const { data, code, msg } = await requestPost(url, this.dataForm)
this.btnDisable = false
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
} else {
this.$message.error(msg)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
resetData () {
this.houseId = '' //ID
this.houseType = '1'
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: {}
methods: {
async initForm (type, row, agencyObj) {
this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj
this.formType = type
if (row) {
this.houseId = row.houseId
await this.loadHouseInfo()
// this.dataForm = JSON.parse(JSON.stringify(row))
// this.houseId = this.dataForm.houseId
// this.dataForm.buildingUnitId = this.dataForm.unitNumKey
// this.dataForm = { ... this.dataForm }
// this.houseType = this.dataForm.houseTypeKey
// this.purpose = this.dataForm.purposeKey
// this.rentFlag = parseInt(this.dataForm.rentFlagKey)
} else {
this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId
this.dataForm.buildingId = this.agencyObj.id
}
await this.loadUnitList()
},
async loadHouseInfo () {
const url = "/gov/org/ichouse/" + this.houseId
const { data, code, msg } = await requestGet(url)
if (code === 0) {
// debugger
this.dataForm = { ...data }
this.houseType = this.dataForm.houseType
this.purpose = this.dataForm.purpose
this.rentFlag = parseInt(this.dataForm.rentFlag)
} else {
this.$message.error(msg)
}
},
//
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)
}
},
async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
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
app.util.validateRule(messageObj)
} else {
this.addRoom()
}
})
},
async addRoom () {
const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //1518151817X
if (this.dataForm.ownerIdCard && regCard.test(this.dataForm.ownerIdCard) === false) {
this.btnDisable = false
this.$message({
type: 'warning',
message: '请输入正确的身份证号码'
})
return false;
}
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (this.dataForm.ownerPhone && regPhone.test(this.dataForm.ownerPhone) === false) {
this.btnDisable = false
this.$message({
type: 'warning',
message: '请输入正确的手机号码'
})
return false;
}
let url = ''
if (this.formType === 'add') {
url = '/gov/org/house/houseadd'
} else {
url = '/gov/org/house/houseupdate'
this.dataForm.houseId = this.houseId
}
const { data, code, msg } = await requestPost(url, this.dataForm)
this.btnDisable = false
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
} else {
this.$message.error(msg)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
resetData () {
this.houseId = '' //ID
this.houseType = '1'
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: {}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>

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

@ -102,7 +102,7 @@
width="90">
</el-table-column>
<el-table-column prop="ownerPhone"
label="房主电话"
label="联系方式"
width="110">
</el-table-column>
<el-table-column prop="ownerIdCard"

Loading…
Cancel
Save