Browse Source

居民信息采集

origin/bugfix_relocation
jiangyy 3 years ago
parent
commit
39f772a015
  1. 4
      .env.development
  2. 2
      src/assets/scss/pages/caiji.scss
  3. 304
      src/views/pages/caiji.vue

4
.env.development

@ -1,6 +1,6 @@
NODE_ENV=development
# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
VUE_APP_API_SERVER = http://192.168.1.140/api
VUE_APP_API_SERVER = http://epmet-dev.elinkservice.cn:41080/api
# VUE_APP_API_SERVER = http://192.168.1.140/api
#家中开发连级的后端服务
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn:41080/api

2
src/assets/scss/pages/caiji.scss

@ -15,7 +15,7 @@
.content {
border-radius: 5px;
background-border: 5px;
background-color: rgba(255, 255, 255, 0.787);
.member_title {

304
src/views/pages/caiji.vue

@ -9,7 +9,7 @@
<mt-cell title="所属社区">
<span>{{shequName}}</span>
<span style="margin-right:20px">{{shequName}}</span>
</mt-cell>
<div class="line"></div>
@ -18,7 +18,7 @@
<mt-cell title="小区"
is-link>
<span class="picker_content"
v-if="selCommunity">{{selCommunity.label}}</span>
v-if="selVillage">{{selVillage.label}}</span>
<span v-else>请选择</span>
</mt-cell>
</div>
@ -28,7 +28,7 @@
<mt-cell title="楼宇"
is-link>
<span class="picker_content"
v-if="selBuilding">{{selBuilding.label}}</span>
v-if="selBuild">{{selBuild.label}}</span>
<span v-else>请选择</span>
</mt-cell>
</div>
@ -49,7 +49,7 @@
:disableClear="true"
label="单元号"
placeholder="请输入"
v-model="formData.unitContent"></mt-field>
v-model="unitContent"></mt-field>
<div class="line"></div>
<div v-if="!selUnit || selUnit.value!=='else'"
@ -57,18 +57,18 @@
<mt-cell title="房屋"
is-link>
<span class="picker_content"
v-if="selRoom">{{selRoom.label}}</span>
v-if="selHome">{{selHome.label}}</span>
<span v-else>请选择</span>
</mt-cell>
<div class="line"></div>
</div>
<mt-field v-if="(selUnit&&selUnit.value==='else')||(selRoom&&selRoom.value==='else')"
<mt-field v-if="(selUnit&&selUnit.value==='else')||(selHome&&selHome.value==='else')"
class="my-field"
:disableClear="true"
label="房屋"
placeholder="请输入"
v-model="formData.homeContent"></mt-field>
v-model="homeContent"></mt-field>
</div>
<div v-if="formData.origin === 'external'">
@ -76,7 +76,7 @@
:disableClear="true"
label="详细地址"
placeholder="请输入"
v-model="address"></mt-field>
v-model="formData.address"></mt-field>
<div class="line"></div>
</div>
@ -86,7 +86,7 @@
<mt-cell title="房屋类型"
is-link>
<span class="picker_content"
v-if="selRoomType">{{selRoomType.label}}</span>
v-if="selHomeType">{{selHomeType.label}}</span>
<span v-else>请选择</span>
</mt-cell>
</div>
@ -162,6 +162,7 @@
<div class="div-btn">
<mt-button @click="handleSubmit"
type="primary"
:disabled="btnDisabled"
size="small">提交</mt-button>
</div>
@ -195,10 +196,13 @@ let loading // 加载动画
export default {
data () {
return {
btnDisabled: false,
popupVisible: false,
shequName: '其他小区',
shequId: '6e511da6816e53af4cda952365a26eb9',// 1202807601961984002
showAddressField: false,//
//
shequId: '',//id 6e511da6816e53af4cda952365a26eb9 1202807601961984002
shequName: '',//
customerId: '',//id 45687aa479955f9d06204d415238f7cc
communityList: [],
buildingList: [],
@ -208,23 +212,20 @@ export default {
pickerData: [],
selObj: {},
selCommunity: null,
selBuilding: null,
selVillage: null,
selBuild: null,
selUnit: null,
selRoom: null,
selRoomType: null,
selHome: null,
selHomeType: null,
unitContent: '',
homeContent: '',////
formData: {
origin: '',//internal;external
villageId: '',//id
villageContent: '',
buildId: '',//id
buildContent: '',
unitId: '',//id
unitContent: '',//
homeId: '',//id
homeContent: '',////
address: '',//绿10101
houseType: '',//10
houseHolderName: '',//
@ -248,15 +249,13 @@ export default {
}
],
roomTypeList: [
{
value: '1',
label: '自有'
},
{
value: '2',
value: '0',
label: '租住'
},
],
@ -274,7 +273,7 @@ export default {
},
{
label: '未接种',
value: '3'
value: '0'
},
],
@ -293,17 +292,35 @@ export default {
},
created () { },
mounted () {
if (this.shequId === '6e511da6816e53af4cda952365a26eb9') {
console.log(this.$route)
this.shequId = this.$route.params.id
this.customerId = this.$route.query.customerId
this.shequName = this.$route.query.name
let envShow = process.env.VUE_APP_NODE_ENV
let internalShequId = ''
if (envShow === 'dev' || envShow === 'prod:sit') { //
internalShequId = '6e511da6816e53af4cda952365a26eb9'
} else if (envShow === 'prod:uat') { //
internalShequId = '6e511da6816e53af4cda952365a26eb9'
} else if (envShow === 'prod') { //
internalShequId = '1202807601961984002'
}
this.formData.customerId = this.customerId
if (this.shequId === internalShequId) {
this.formData.origin = 'internal'
} else {
this.formData.origin = 'external'
}
this.loadCommunity()
this.loadVillage()
this.detNumList = []
for (let i = 0; i < 11; i++) {
for (let i = 1; i < 11; i++) {
let obj = {
value: i + '',
label: i + '',
label: i + '',
}
this.detNumList.push(obj)
}
@ -339,7 +356,7 @@ export default {
},
//id
async loadCommunity () {
async loadVillage () {
const url = "/gov/org/icneighborhood/open/list"
let params = {
@ -362,15 +379,18 @@ export default {
this.popupSlots = []
this.popupSlots.push(obj)
} else {
this.$message.error(msg)
Toast({
message: msg,
duration: 3000
});
}
},
//
async loadBuilding () {
async loadBuild () {
const url = "/gov/org/icbuilding/buildingoption"
let params = {
neighborHoodId: this.selCommunity.value
neighborHoodId: this.selVillage.value
}
const { data, code, msg } = await requestPost(url, params)
@ -388,7 +408,10 @@ export default {
this.popupSlots = []
this.popupSlots.push(obj)
} else {
this.$message.error(msg)
Toast({
message: msg,
duration: 3000
});
}
},
//
@ -396,7 +419,7 @@ export default {
const url = '/gov/org/icbuildingunit/unitoption'
let params = {
buildingId: this.selBuilding.value
buildingId: this.selBuild.value
}
const { data, code, msg } = await requestPost(url, params)
@ -418,15 +441,18 @@ export default {
this.popupSlots = []
this.popupSlots.push(obj)
} else {
this.$message.error(msg)
Toast({
message: msg,
duration: 3000
});
}
},
//
async loadRoom () {
async loadHome () {
const url = "/gov/org/ichouse/houseoption"
let params = {
buildingId: this.selBuilding.value,
buildingId: this.selBuild.value,
unitId: this.selUnit.value
}
@ -449,7 +475,10 @@ export default {
this.popupSlots = []
this.popupSlots.push(obj)
} else {
this.$message.error(msg)
Toast({
message: msg,
duration: 3000
});
}
},
@ -460,10 +489,10 @@ export default {
}
if (selType === 'building') {
if (!this.selCommunity) {
if (!this.selVillage) {
Toast({
message: '请先选择小区',
duration: 5000
duration: 3000
});
return false
} else {
@ -473,10 +502,10 @@ export default {
}
if (selType === 'unit') {
if (!this.selBuilding) {
if (!this.selBuild) {
Toast({
message: '请先选择楼宇',
duration: 5000
duration: 3000
});
return false
} else {
@ -488,7 +517,7 @@ export default {
if (!this.selUnit) {
Toast({
message: '请先选择单元',
duration: 5000
duration: 3000
});
return false
} else {
@ -509,47 +538,179 @@ export default {
this.pickerData = this.detConditionList
}
let obj = {
values: this.pickerData
}
this.popupSlots = []
this.popupSlots.push(obj)
this.popupVisible = !this.popupBuildingVisibl
this.popupVisible = !this.popupVisible
},
handleSubmit () {
async handleSubmit () {
let message = this.validataFormData()
if (message) {
Toast({
message: message,
duration: 3000
});
return false
}
if (this.formData.origin === 'internal') {
this.formData.address = this.
}
this.formData.villageId = this.selVillage.value
this.formData.buildId = this.selBuild.value
if (this.selUnit.value === 'else') {
this.formData.unitId = this.unitContent
this.formData.homeId = this.homeContent//
} else {
this.formData.unitId = this.selUnit.value
this.unitContent = this.selUnit.label
if (this.selHome.value === 'else') {
this.formData.homeId = this.homeContent
} else {
this.formData.homeId = this.selHome.value
this.homeContent = this.selHome.label
}
}
this.formData.address = this.selVillage.label + this.selBuild.label + this.unitContent + this.homeContent
}
this.formData.houseType = this.selHomeType.value
this.memberList.forEach(element => {
element.customerId = this.customerId
if (element.selDetNum && element.selDetNum.value) {
element.heSuanCount = element.selDetNum.value
}
if (element.selDetCondition && element.selDetCondition.value) {
element.ymjz = element.selDetCondition.value
}
});
this.formData.memberList = this.memberList
console.log(this.formData)
this.btnDisabled = true
const url = "/epmetuser/icresicollect/save"
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
Toast({
message: '提交成功',
duration: 3000
});
this.btnDisabled = false
} else {
Toast({
message: msg,
duration: 3000
});
this.btnDisabled = false
}
},
//
validataFormData () {
let message = ''
if (this.formData.origin === 'internal') {//
if (!this.selVillage) {
message = '请选择小区'
return message
}
if (!this.selBuild) {
message = '请选择楼栋'
return message
}
if (!this.selUnit) {//
message = '请选择单元'
return message
} else {//
if (this.selUnit.value === 'else') {//
if (!this.unitContent) {
message = '请填写单元号'
return message
}
if (!this.homeContent) {//
message = '请填写房屋'
return message
}
} else {//
if (!this.selHome) {
message = '请选择房屋'
return message
} else if (this.selHome.value === 'else' && !this.homeContent) {
message = '请填写房屋'
return message
}
}
}
} else {
if (!this.formData.address) {
message = '请填写地址'
return message
}
}
if (!this.selHomeType) {
message = '请选择房屋类型'
return message
}
if (!this.formData.houseHolderName) {
message = '请填写户主姓名'
return message
}
let member = this.memberList[0]
for (let i = 0; i < this.memberList.length; i++) {
let item = this.memberList[i]
if (!item.name || !item.mobile || !item.idNum || !item.selDetNum.value || !item.selDetCondition.value) {
message = '请完整填写用户' + (i + 1) + '信息'
return message
}
}
},
popupOk () {
if (this.selType === 'community') {
this.selCommunity = this.selObj
this.formData.villageContent = this.selObj.label
this.formData.villageId = this.selObj.value
this.selVillage = this.selObj
this.selBuilding = null
this.selBuild = null
this.selUnit = null
this.selRoom = null
this.selHome = null
this.formData.unitContent = ''
this.formData.homeContent = ''
this.loadBuilding()
this.loadBuild()
}
if (this.selType === 'building') {
this.selBuilding = this.selObj
this.selBuild = this.selObj
this.formData.buildContent = this.selObj.label
this.formData.buildId = this.selObj.value
this.selUnit = null
this.selRoom = null
this.selHome = null
this.formData.unitContent = ''
this.formData.homeContent = ''
this.loadUnit()
@ -558,32 +719,22 @@ export default {
if (this.selType === 'unit') {
this.selUnit = this.selObj
this.selHome = null
this.unitContent = ''
this.homeContent = ''
this.selRoom = null
this.formData.unitContent = ''
this.formData.homeContent = ''
if (this.selUnit && this.selUnit.value === 'else') {
this.showAddressField = true
} else {
this.showAddressField = false
}
this.loadRoom()
this.loadHome()
}
if (this.selType === 'room') {
this.selRoom = this.selObj
this.selHome = this.selObj
this.homeContent = ''
this.formData.homeContent = ''
if (this.selRoom && this.selRoom.value === 'else') {
this.showAddressField = true
} else {
this.showAddressField = false
}
}
if (this.selType === 'roomType') {
this.selRoomType = this.selObj
this.selHomeType = this.selObj
}
if (this.selType === 'detNum') {
@ -591,8 +742,7 @@ export default {
let change = this.memberList[this.selMemberIndex]
change.selDetNum = this.selObj
this.$set(this.memberList, this.selMemberIndex, change)
// this.selMemberIndex = index
// this.pickerData = this.detNumList
}
if (this.selType === 'detCondition') {
let change = this.memberList[this.selMemberIndex]

Loading…
Cancel
Save