Browse Source

居民信息(完善,未完待续)

master
13176889840 4 years ago
parent
commit
b3a58c90cb
  1. 118
      epmet-oper-web/src/views/components/editResi.vue
  2. 2
      epmet-oper-web/src/views/components/resiForm.vue
  3. 24
      epmet-oper-web/src/views/modules/base/resi.vue

118
epmet-oper-web/src/views/components/editResi.vue

@ -32,10 +32,8 @@
<!-- </div> -->
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="18">
<el-form-item :prop="form.VILLAGE_ID" label="所属小区">
<!-- <div class="resi-cell"> -->
<!-- <div class="resi-cell-label">{{n.label}}</div> -->
<div class="resi-cell-value">
<el-select v-model="form.VILLAGE_ID" :disabled="disabled" placeholder="请选择小区" size="small"
clearable class="resi-cell-select"
@ -47,14 +45,41 @@
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small"
clearable class="resi-cell-select" @change="handleChangeB"
>
<el-option
v-for="item in optionsB"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.UNIT_ID" :disabled="disabled" placeholder="请选择单元" size="small"
clearable class="resi-cell-select" @change="handleChangeD"
>
<el-option
v-for="item in optionsD"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.HOME_ID" :disabled="disabled" placeholder="请选择房号" size="small"
clearable class="resi-cell-select"
>
<el-option
v-for="item in optionsH"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<!-- </div> -->
</el-form-item>
</el-col>
<el-col :span="6">
<!-- <el-col :span="6">
<el-form-item :prop="form.BUILD_ID" label="所属楼宇">
<!-- <div class="resi-cell"> -->
<!-- <div class="resi-cell-label">{{n.label}}</div> -->
<div class="resi-cell-value">
<el-select v-model="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small"
clearable class="resi-cell-select"
@ -67,13 +92,10 @@
</el-option>
</el-select>
</div>
<!-- </div> -->
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :prop="form.HOME_ID" label="所属家庭">
<!-- <div class="resi-cell"> -->
<!-- <div class="resi-cell-label">{{n.label}}</div> -->
<div class="resi-cell-value">
<el-select v-model="form.HOME_ID" :disabled="disabled" placeholder="请选择" size="small"
clearable class="resi-cell-select"
@ -86,9 +108,8 @@
</el-option>
</el-select>
</div>
<!-- </div> -->
</el-form-item>
</el-col>
</el-col> -->
</el-row>
<el-row v-for="(item, index) in sliceList(formList, columns)" :key="index" class="resi-row">
<!-- <el-col v-for="n in item" :key="n.id" :span="n.itemType === 'textarea'&&24 || (24/columns)"> -->
@ -341,6 +362,7 @@ export default {
GRID_ID: '',
VILLAGE_ID: '',
BUILD_ID: '',
UNIT_ID: '',
HOME_ID: ''
},
fixedList: {},
@ -357,6 +379,7 @@ export default {
optionsB: [],
optionsH: [],
optionsG: [],
optionsD: [],
pickerOptions: {
shortcuts: [{
text: '最近一周',
@ -453,6 +476,7 @@ export default {
this.getValiheList()
this.getBuildList()
this.getUniList()
this.getHouseList()
}
},
methods: {
@ -516,28 +540,32 @@ export default {
console.log('val', val)
this.form.VILLAGE_ID = ''
this.form.BUILD_ID = ''
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.getValiheList()
if (!val) {
this.getBuildList()
this.getValiheList()
this.getUniList()
}
this.getBuildList()
this.getUniList()
this.getHouseList()
},
handleChangeV (val) {
console.log('val', val)
this.form.BUILD_ID = ''
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.getBuildList()
if (!val) {
this.getValiheList()
this.getUniList()
}
this.getUniList()
this.getHouseList()
},
handleChangeB (val) {
console.log('val', val)
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.getUniList()
this.getHouseList()
},
handleChangeD () {
this.form.HOME_ID = ''
this.getHouseList()
},
handlerMuscForm () {
let arr = []
@ -575,6 +603,7 @@ export default {
var hash = {}
var i = 0
var res = []
let ID = this.tempFormList[0].ID
this.tempFormList.forEach(function (item) {
var name = item.tableName
hash[name] ? res[hash[name] - 1].list.push(item) : hash[name] = ++i && res.push({
@ -586,7 +615,6 @@ export default {
// console.log('resssssss', res)
res.forEach(item => {
let _form = {}
// let ID = item.list[0].ID
item.list.filter(n => n.isChange).forEach(r => {
_form[r.columnName] = r.multiSelect || r.itemType === 'cascader' ? this.form[r.columnName].toString() : this.form[r.columnName]
if (r.ID) {
@ -599,10 +627,11 @@ export default {
_form[n] = this.fixedList[n]
}
if (Object.keys(_form).length > 0) {
_form.AGENCY_ID = this.$store.state.user.agencyId
if (!_form.AGENCY_ID) _form.AGENCY_ID = this.$store.state.user.agencyId
if (!_form.ID) _form.ID = ID
}
}
// console.log('objeckeyssss', Object.keys(_form), _form, this.form)
console.log('objeckeyssss', Object.keys(_form), _form)
newForm.push({
tableName: item.tableName,
supportAdd: this.supportAdd,
@ -610,7 +639,7 @@ export default {
list: Object.keys(_form).length > 0 ? [{ ..._form }] : []
})
})
// console.log('newFormhhhhh', newForm)
console.log('newFormhhhhh', newForm)
return newForm
} else {
console.log('error submit!!')
@ -686,7 +715,22 @@ export default {
},
getUniList () {
this.$http
.post('/gov/org/ichouse/houseoption', { buildingId: this.form.BUILD_ID })
.post('/gov/org/icbuildingunit/unitoption', { buildingId: this.form.BUILD_ID })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsD = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
getHouseList () {
this.$http
.post('/gov/org/ichouse/houseoption', { unitId: this.form.UNIT_ID })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
@ -741,17 +785,17 @@ export default {
.resi-cell-value .resi-cell-textarea {
width: 300px;
}
// .resi-cell-select {
// width: 180px;
// box-sizing: border-box;
// margin-right: 10px;
// &-middle {
// width: 130px;
// }
// &-small {
// width: 88px;
// }
// }
.resi-cell-select {
width: 180px;
box-sizing: border-box;
margin-right: 10px;
&-middle {
width: 130px;
}
&-small {
width: 88px;
}
}
.resi-cell-select:last-child {
margin-right: 0;
}

2
epmet-oper-web/src/views/components/resiForm.vue

@ -701,7 +701,7 @@ export default {
},
getHouseList () {
this.$http
.post('/gov/org/ichouse/houseoption', { buildingId: this.form.BUILD_ID, unitId: this.form.UNIT_ID })
.post('/gov/org/ichouse/houseoption', { unitId: this.form.UNIT_ID })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)

24
epmet-oper-web/src/views/modules/base/resi.vue

@ -288,7 +288,11 @@ export default {
arr2.forEach(item => {
if (item.list.length !== 0) noChange = false
})
if (noChange) return this.$message.warning('您还没有做任何修改')
console.log('arr2', arr2)
if (noChange) {
this.$message.warning('您还没有做任何修改')
return false
}
// tableName
let hash = {}
let i = 0
@ -307,26 +311,30 @@ export default {
})
}
})
console.log('res', res)
// listlist
res.forEach(item => {
let _form = {}
item.list.forEach(n => {
item.list.length > 0 && item.list.forEach(n => {
_form = { ..._form, ...n }
})
finalArr.push({
tableName: item.tableName,
list: item.supportAdd ? [...item.list] : [{ ..._form }]
})
if (item.list.length > 0) {
finalArr.push({
tableName: item.tableName,
list: item.supportAdd ? [...item.list] : [{ ..._form }]
})
}
})
console.log('finalArr', finalArr)
return finalArr
},
async handleEditSUbmit () {
const arr = await this.formetForm()
this.submitEdit(arr)
if (arr) this.submitEdit(arr)
},
async handleSUbmit () {
const arr = await this.formetForm()
this.submitAdd(arr)
if (arr) this.submitAdd(arr)
},
handleDel (row) {
let params = {

Loading…
Cancel
Save