Browse Source

审核

feature
zhaoyongnian 3 years ago
parent
commit
5ecdcdb82d
  1. 474
      src/views/modules/sys/icvaccineprarmeter-check.vue
  2. 61
      src/views/modules/sys/icvaccineprarmeter.vue
  3. 461
      src/views/modules/sys/roomForm.vue

474
src/views/modules/sys/icvaccineprarmeter-check.vue

@ -1,86 +1,255 @@
<template>
<el-dialog :visible.sync="visible" title="审核" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="网格名称" prop="gridName">
<el-input v-model="dataForm.gridName" placeholder="网格名称" disabled></el-input>
</el-form-item>
<el-form-item label="所属小区名称" prop="villageName">
<el-input v-model="dataForm.villageName" placeholder="所属小区名称" disabled></el-input>
</el-form-item>
<el-form-item label="所属楼宇名称" prop="buildName">
<el-input v-model="dataForm.buildName" placeholder="所属楼宇名称" disabled></el-input>
</el-form-item>
<el-form-item label="单元名" prop="unitName">
<el-input v-model="dataForm.unitName" placeholder="单元名" disabled></el-input>
<div>
<div v-if="!formShow" class="dialog-h-content scroll-h">
<el-form ref="icvaccineprarmeter_check"
:inline="false"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="网格名称"
prop="gridName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.gridName"
disabled>
</el-input>
</el-form-item>
<el-form-item label="房间名" prop="homeName">
<el-input v-model="dataForm.homeName" placeholder="房间名" disabled></el-input>
<el-form-item label="所属小区名称"
prop="villageName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.villageName"
disabled>
</el-input>
</el-form-item>
<el-form-item label="户口性质:0户籍 1外来" prop="householdType">
<el-input v-model="dataForm.householdType" placeholder="户口性质:0户籍 1外来" disabled></el-input>
<el-form-item label="所属楼宇名称"
prop="buildName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.buildName"
disabled>
</el-input>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="dataForm.name" placeholder="姓名" disabled></el-input>
<el-form-item label="单元名"
prop="unitName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.unitName"
disabled>
</el-input>
</el-form-item>
<el-form-item label="联系电话" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="联系电话" disabled></el-input>
<el-form-item label="房间名"
prop="homeName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.homeName"
disabled>
</el-input>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="dataForm.idCard" placeholder="身份证号" disabled></el-input>
<el-form-item label="户口性质"
prop="householdType"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.householdType"
disabled>
</el-input>
</el-form-item>
<el-form-item label="是否接种:0否1是" prop="isVaccination">
<el-input v-model="dataForm.isVaccination" placeholder="是否接种:0否1是" disabled></el-input>
<el-form-item label="姓名"
prop="name"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.name"
disabled>
</el-input>
</el-form-item>
<el-form-item label="第一次接种时间" prop="firstVacTime">
<el-input v-model="dataForm.firstVacTime" placeholder="第一次接种时间" disabled></el-input>
<el-form-item label="联系电话"
prop="mobile"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.mobile"
disabled>
</el-input>
</el-form-item>
<el-form-item label="第一次接种地点" prop="firstVacSite">
<el-input v-model="dataForm.firstVacSite" placeholder="第一次接种地点" disabled></el-input>
<el-form-item label="身份证号"
prop="idCard"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.idCard"
disabled>
</el-input>
</el-form-item>
<el-form-item label="第二次接种时间" prop="secondVacTime">
<el-input v-model="dataForm.secondVacTime" placeholder="第二次接种时间" disabled></el-input>
<el-form-item label="是否接种"
prop="isVaccination"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.isVaccination"
disabled>
</el-input>
</el-form-item>
<el-form-item label="第二次接种地点" prop="secondVacSite">
<el-input v-model="dataForm.secondVacSite" placeholder="第二次接种地点" disabled></el-input>
<el-form-item label="第一次接种时间"
prop="firstVacTime"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.firstVacTime"
disabled>
</el-input>
</el-form-item>
<el-form-item label="第三次接种时间" prop="thirdVacTime">
<el-input v-model="dataForm.thirdVacTime" placeholder="第三次接种时间" disabled></el-input>
<el-form-item label="第一次接种地点"
prop="firstVacSite"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.firstVacSite"
disabled>
</el-input>
</el-form-item>
<el-form-item label="第三次接种地点" prop="thirdVacSite">
<el-input v-model="dataForm.thirdVacSite" placeholder="第三次接种地点" disabled></el-input>
<el-form-item label="第二次接种时间"
prop="secondVacTime"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.secondVacTime"
disabled>
</el-input>
</el-form-item>
<el-form-item label="原因" prop="reason">
<el-input v-model="dataForm.reason" placeholder="原因" disabled></el-input>
<el-form-item label="第二次接种地点"
prop="secondVacSite"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.secondVacSite"
disabled>
</el-input>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="dataForm.note" placeholder="备注" disabled></el-input>
<el-form-item label="第三次接种时间"
prop="thirdVacTime"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.thirdVacTime"
disabled>
</el-input>
</el-form-item>
<el-form-item label="审核状态" prop="checkState">
<el-input v-model="dataForm.checkState" placeholder="审核状态"></el-input>
<el-form-item label="第三次接种地点"
prop="thirdVacSite"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.thirdVacSite"
disabled>
</el-input>
</el-form-item>
<el-form-item label="审核理由" prop="checkReason">
<el-input v-model="dataForm.checkReason" placeholder="审核理由"></el-input>
<el-form-item label="原因"
prop="reason"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.reason"
disabled>
</el-input>
</el-form-item>
<el-form-item label="备注"
prop="note"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入"
v-model="dataForm.note"
disabled>
</el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="danger" @click="checkHandle('1')">{{ $t('checkBTGBtn') }}</el-button>
<el-button type="danger" @click="showAddHouse">{{ $t('checkTGBtn') }}</el-button>
</template>
</el-dialog>
</div>
<div v-if="!formShow" class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
@click="showAddHouse">通过</el-button>
<el-button size="small"
v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
@click="checkHandle('1')">不通过</el-button>
</div>
<room-form
v-if="formShow"
ref="ref_form"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"
></room-form>
</div>
</template>
<script>
import debounce from 'lodash/debounce'
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost, requestGet } from '@/js/dai/request'
import roomForm from "./roomForm";
export default {
let loading //
export default {
data () {
return {
visible: false,
formType: 'add', // addeditdetail
btnDisable: false,
dataForm: {
id: '',
isAdd: '',
customerId: '',
gridId: '',
gridName: '',
agencyId: '',
@ -109,25 +278,47 @@
checkState: '',
checkReason: ''
},
isAdd: '',
unitId: ''
isAdd: '',
unitId: '',
//
formShow: false,
agencyObj: {}
// end
}
},
computed: {
dataRule () {
return {}
}
components: {
roomForm
},
mounted () {
},
methods: {
init () {
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id); {
this.getInfo()
}
})
// s
diaClose() {
this.formShow = false;
},
addFormCancle() {
this.formShow = false;
},
addFormOk() {
this.formShow = false;
this.checkHandle('2')
// this.loadTable();
},
// end
async initForm (type, id, isAdd, unitId, data) {
console.log('isAdd>>>>>>>>>>>', isAdd)
// this.$refs.icvaccineprarmeter_check.resetFields();
this.dataForm.id = id
this.isAdd = isAdd
this.unitId = unitId
this.agencyObj = data
if (this.dataForm.id); {
this.getInfo()
}
},
//
getInfo () {
this.$http.get(`/epmetuser/icVaccinePrarmeter/${this.dataForm.id}`).then(({ data: res }) => {
@ -140,53 +331,102 @@
}
}).catch(() => {})
},
showAddHouse () {
if (this.isAdd === '1') {
//
// todo
// this.addHouseShow = true
// this.$nextTick(() => {
// this.$refs.ref_form.initForm('add', null, this.dataForm.id)
// })
} else {
this.checkHandle('2')
}
},
//
checkHandle (type) {
const params = {
id: this.dataForm.id,
checkState: type, // 0- 1- 2-
checkReason: '',
buildingUnitId: this.unitId || '',
doorName: this.dataForm.homeName || ''
}
if (type == '1') {
this.$prompt('请输入不通过的原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
params.checkReason = value
this.$http.post('/epmetuser/icVaccinePrarmeter/vaccineCheck', params).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.visible = false;
this.$emit('refreshDataList')
}).catch(() => {})
}).catch(() => {
//
})
} else {
this.$http.post('/epmetuser/icVaccinePrarmeter/vaccineCheck', params).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.visible = false;
this.$emit('refreshDataList')
}).catch(() => {})
}
//
showAddHouse () {
console.log('111111isAdd', this.isAdd)
if (this.isAdd === '1') {
console.log('111111')
this.formShow = true;
this.$nextTick(() => {
let agencyObj = {
neighborHoodId: this.agencyObj.villageId,
id: this.agencyObj.buildId,
neighborHoodName: this.agencyObj.villageName,
buildingUnitId: this.agencyObj.unitId,
doorName: this.agencyObj.homeName
}
this.$refs.ref_form.initForm("add", null, agencyObj);
});
//
// todo
// this.addHouseShow = true
// this.$nextTick(() => {
// this.$refs.icvaccineprarmeter_check.initForm('add', null, this.dataForm.id)
// })
} else {
this.checkHandle('2')
}
},
//
checkHandle (type) {
const params = {
id: this.dataForm.id,
checkState: type, // 0- 1- 2-
checkReason: '',
unitId: this.unitId || '',
homeName: this.dataForm.homeName || ''
}
if (type == '1') {
this.$prompt('请输入不通过的原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
params.checkReason = value
this.$http.post('/epmetuser/icVaccinePrarmeter/vaccineCheck', params).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
console.log('审核不通过')
this.$emit('dialogOk')
// this.visible = false;
// this.$emit('refreshDataList')
}).catch(() => {})
}).catch(() => {
//
})
} else {
this.$http.post('/epmetuser/icVaccinePrarmeter/vaccineCheck', params).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$emit('dialogOk')
// this.visible = false;
// this.$emit('refreshDataList')
}).catch(() => {})
}
},
handleCancle () {
this.$emit('dialogCancle')
this.formShow = false;
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
}
}
},
},
props: {}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>

61
src/views/modules/sys/icvaccineprarmeter.vue

@ -237,6 +237,23 @@
@dialogOk="addFormOk">
</add-or-update>
</el-dialog>
<!-- 审核 -->
<el-dialog
:visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle_shenhe"
width="900px"
top="5vh"
class="dialog-h"
@closed="diaClose"
>
<icvaccineprarmeter-check
ref="icvaccineprarmeter_check"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk_shenhe"
></icvaccineprarmeter-check>
</el-dialog>
</div>
</template>
@ -279,7 +296,11 @@ export default {
optionsD: [],
optionsG: [],
checkVisible: false,
formTitle:"新增"
formTitle:"新增",
//
formShow: false,
formTitle_shenhe: "审核",
// end
}
},
components: {
@ -308,6 +329,19 @@ export default {
this.getValiheList()
},
methods:{
// s
diaClose() {
// this.$refs.icvaccineprarmeter_check.resetData();
this.formShow = false;
},
addFormCancle() {
this.formShow = false;
},
addFormOk_shenhe() {
this.formShow = false;
this.getDataList();
},
// end
//
handleAdd() {
this.formTitle = "新增";
@ -371,14 +405,25 @@ export default {
this.$message.success(data.msg);
}else{
//
this.checkVisible = true
// this.checkVisible = true
// this.$nextTick(() => {
// this.$refs.checkPage.dataForm.id = row.id
// // 01
// this.$refs.checkPage.isAdd = data.isAdd
// // ID
// this.$refs.checkPage.unitId = data.unitId
// this.$refs.checkPage.init()
// })
//
this.formShow = true;
this.$nextTick(() => {
this.$refs.checkPage.dataForm.id = row.id
// 01
this.$refs.checkPage.isAdd = data.isAdd
// ID
this.$refs.checkPage.unitId = data.unitId
this.$refs.checkPage.init()
this.$refs.icvaccineprarmeter_check.initForm("add", row.id, data.isAdd, data.unitId, data);
// this.$refs.checkPage.dataForm.id = row.id
// // 01
// this.$refs.checkPage.isAdd = data.isAdd
// // ID
// this.$refs.checkPage.unitId = data.unitId
// this.$refs.checkPage.init()
})
}

461
src/views/modules/sys/roomForm.vue

@ -0,0 +1,461 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="false"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="所属楼栋"
label-width="150px"
style="display: block">
<span>{{ agencyObj.neighborHoodName }}-{{agencyObj.label}}</span>
</el-form-item>
<el-form-item label="单元号"
prop="buildingUnitId"
label-width="150px"
style="display: block">
<el-select class="item_width_1"
v-model="dataForm.buildingUnitId"
placeholder="请选择"
clearable>
<el-option v-for="item in unitList"
:key="item.id"
:label="item.unitName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="门牌号"
prop="doorName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入门牌号"
v-model="dataForm.doorName">
</el-input>
</el-form-item>
<el-form-item v-if="formType != 'detail'" label="房屋编码"
prop="coding"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
maxlength="50"
placeholder="请输入楼栋编码"
v-model="dataForm.coding">
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="small"
@click="handleCode">生成</el-button>
</el-form-item>
<div v-if="formType === 'detail'">
<el-form-item label="房屋编码"
prop="houseCode"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="30"
v-model="dataForm.houseCode">
</el-input>
</el-form-item>
<div v-if="dataForm.houseQrcodeUrl"
style="display: flex;flex-direction: column;">
<img style="margin-left: 70px;width: 200px;"
:src="dataForm.houseQrcodeUrl">
<a style="margin-left: 80px"
:href="dataForm.houseQrcodeUrl"
target="_blank">下载</a>
</div>
</div>
<!-- <el-form-item label="居住人数"
style="display: block"
prop="realPerson"
label-width="150px">
<el-input-number class="item_width_4"
v-model="dataForm.realPerson"
:min="0"
:max="9999"
label="居住人数"></el-input-number>
</el-form-item> -->
<el-form-item label="房屋类型"
prop="houseType"
label-width="150px"
style="display: block">
<el-radio-group v-model="houseType">
<el-radio :label="'1'">楼房</el-radio>
<el-radio :label="'2'">平房</el-radio>
<el-radio :label="'3'">别墅</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="房屋用途"
prop="purpose"
label-width="150px"
style="display: block">
<el-radio-group v-model="purpose">
<el-radio :label="'1'">住宅</el-radio>
<el-radio :label="'2'">商业</el-radio>
<el-radio :label="'3'">办公</el-radio>
<el-radio :label="'4'">工业</el-radio>
<el-radio :label="'5'">仓储</el-radio>
<el-radio :label="'6'">商住混用</el-radio>
<el-radio :label="'7'">其他</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="房屋状态"
prop="rentFlag"
label-width="150px"
style="display: block">
<el-radio-group v-model="rentFlag">
<el-radio :label="1">出租</el-radio>
<el-radio :label="2">闲置</el-radio>
<el-radio :label="0">自住</el-radio>
<el-radio :label="3">未出售</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="房主姓名"
prop="ownerName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="30"
placeholder="请输入房主姓名"
v-model="dataForm.ownerName">
</el-input>
</el-form-item>
<el-form-item label="联系方式"
prop="ownerPhone"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type='number'
placeholder="请输入联系方式"
v-model="dataForm.ownerPhone">
</el-input>
</el-form-item>
<el-form-item label="房主身份证"
prop="ownerIdCard"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入房主身份证"
v-model="dataForm.ownerIdCard">
</el-input>
</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>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
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: '',
// realPerson: 0,
coding: '',
sysCoding: ''
},
keyWords: '',
agencyObj: {},
}
},
components: {},
mounted () {
},
methods: {
async initForm (type, row, agencyObj) {
console.log('>>>>>>>>>>>>>>>>:::::::::::::')
this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj
this.formType = type
console.log('agencyObj-----', agencyObj)
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
this.dataForm.buildingUnitId = this.agencyObj.buildingUnitId
this.dataForm.doorName = this.agencyObj.doorName
}
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 handleCode() {
if (!this.dataForm.buildingUnitId) return this.$message.error('请选择单元')
const { data, code, msg } = await requestPost(
"/gov/org/houseInformation/getHouseCoding/" + this.dataForm.buildingUnitId);
if (msg == "success" && code == 0) {
this.dataForm.coding = data.coding
this.dataForm.sysCoding = data.sysCoding
}
},
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: '', //
coding: '',
sysCoding: ''
}
},
//
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' }
],
coding: [
{ 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";
</style>
Loading…
Cancel
Save