diff --git a/epmet-oper-web/src/views/components/editResi.vue b/epmet-oper-web/src/views/components/editResi.vue index d218e16..4791cf6 100644 --- a/epmet-oper-web/src/views/components/editResi.vue +++ b/epmet-oper-web/src/views/components/editResi.vue @@ -32,10 +32,8 @@ - + - -
+ + + + + + + + + + + +
-
- + -
-
- -
-
-
+
--> @@ -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; } diff --git a/epmet-oper-web/src/views/components/resiForm.vue b/epmet-oper-web/src/views/components/resiForm.vue index 823ed64..c0b2074 100644 --- a/epmet-oper-web/src/views/components/resiForm.vue +++ b/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) diff --git a/epmet-oper-web/src/views/modules/base/resi.vue b/epmet-oper-web/src/views/modules/base/resi.vue index 9ad44c9..d4e1fa2 100644 --- a/epmet-oper-web/src/views/modules/base/resi.vue +++ b/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) // 多个list合并成一个list子集 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 = {