|
|
|
@ -34,9 +34,14 @@ |
|
|
|
align="center" |
|
|
|
width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button> |
|
|
|
<el-button @click="handleLook(scope.row)" type="text" size="small">查看</el-button> |
|
|
|
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">编辑</el-button> |
|
|
|
<el-button type="text" size="small" class="btn-color-del">删除</el-button> |
|
|
|
<el-popconfirm |
|
|
|
title="删除之后无法回复,确认删除?" |
|
|
|
@onConfirm="handleDel(scope.row)" |
|
|
|
> |
|
|
|
<el-button slot="reference" type="text" size="small" class="btn-color-del">删除</el-button> |
|
|
|
</el-popconfirm> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -86,7 +91,7 @@ |
|
|
|
append-to-body |
|
|
|
:close-on-click-modal="false" |
|
|
|
:before-close="handlerEditCancle"> |
|
|
|
<edit-resi v-if="dialogEditVisible" ref="baseForm" :form-info="editForm" :fixed="true" :form-list="formList" @changegroup="handleChangeGroup" /> |
|
|
|
<edit-resi v-if="dialogEditVisible" ref="baseForm" :disabled="disabled" :form-info="editForm" :fixed="true" :form-list="formList" @changegroup="handleChangeGroup" /> |
|
|
|
<div v-if="dialogEditVisible" class="resi-other"> |
|
|
|
<div class="resi-other-title">其他</div> |
|
|
|
<div class="tabs-other-info"> |
|
|
|
@ -94,14 +99,14 @@ |
|
|
|
<el-tab-pane v-for="item in tabsList" :key="item.columnName" |
|
|
|
:label="item.label" :name="'group' + item.groupId"> |
|
|
|
<edit-resi :ref="'group' + item.groupId" :columns="3" :support-add="item.supportAdd" |
|
|
|
:form-id="item.columnName" :muti-list="item.mutiList" :form-list=" item.itemList" /> |
|
|
|
:form-id="item.columnName" :muti-list="item.mutiList" :form-list=" item.itemList" :disabled="disabled" /> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="resi-btns"> |
|
|
|
<el-button size="small" @click="handlerEditCancle">取消</el-button> |
|
|
|
<el-button type="primary" size="small" @click="handleEditSUbmit">提交</el-button> |
|
|
|
<el-button v-if="!disabled" type="primary" size="small" @click="handleEditSUbmit">提交</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
@ -120,6 +125,7 @@ export default { |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
disabled: false, |
|
|
|
pageLoading: false, |
|
|
|
dialogEditVisible: false, |
|
|
|
dialogVisible: false, |
|
|
|
@ -224,7 +230,13 @@ export default { |
|
|
|
handleClick (tab, event) { |
|
|
|
console.log(tab, event) |
|
|
|
}, |
|
|
|
async handleLook (row) { |
|
|
|
this.disabled = true |
|
|
|
await this.getFormList() |
|
|
|
this.getrowInfo(row.icResiUserId) |
|
|
|
}, |
|
|
|
async handleEdit (row) { |
|
|
|
this.disabled = false |
|
|
|
await this.getFormList() |
|
|
|
this.getrowInfo(row.icResiUserId) |
|
|
|
}, |
|
|
|
@ -262,18 +274,15 @@ export default { |
|
|
|
if (hasT) this.tabsList.splice(i, 1) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleEditSUbmit () { |
|
|
|
formetForm () { |
|
|
|
const _baseForm = this.$refs.baseForm.handleForm() |
|
|
|
let arr = [] |
|
|
|
// let arr1 = [] |
|
|
|
if (_baseForm.length === 0) return false |
|
|
|
arr.push([ ..._baseForm ]) |
|
|
|
this.tabsList.forEach(item => { |
|
|
|
// console.log('groupInfo', this.$refs['group' + item.groupId][0].handleForm()) |
|
|
|
arr.push([ ...this.$refs['group' + item.groupId][0].handleForm() ]) |
|
|
|
}) |
|
|
|
let arr2 = arr.reduce(function (a, b) { return a.concat(b) }) |
|
|
|
// console.log('arrr555-----sub', arr2) |
|
|
|
let noChange = true |
|
|
|
arr2.forEach(item => { |
|
|
|
if (item.list.length !== 0) noChange = false |
|
|
|
@ -285,11 +294,9 @@ export default { |
|
|
|
let res = [] |
|
|
|
let finalArr = [] |
|
|
|
arr2.forEach(function (item) { |
|
|
|
// console.log('arrr666-----sub', item) |
|
|
|
let name = item.tableName |
|
|
|
if (hash[name]) { |
|
|
|
res[hash[name] - 1].list.push(...item.list) |
|
|
|
// console.log('hash[name]---', hash[name], res, res[hash[name] - 1], item) |
|
|
|
} else { |
|
|
|
hash[name] = ++i |
|
|
|
res.push({ |
|
|
|
@ -297,12 +304,10 @@ export default { |
|
|
|
supportAdd: item.supportAdd, |
|
|
|
tableName: name |
|
|
|
}) |
|
|
|
// console.log('hash[name]0000---', hash[name], res) |
|
|
|
} |
|
|
|
}) |
|
|
|
// 多个list合并成一个list子集 |
|
|
|
res.forEach(item => { |
|
|
|
// console.log('arrr777-----sub', item) |
|
|
|
let _form = {} |
|
|
|
item.list.forEach(n => { |
|
|
|
_form = { ..._form, ...n } |
|
|
|
@ -312,57 +317,34 @@ export default { |
|
|
|
list: item.supportAdd ? [...item.list] : [{ ..._form }] |
|
|
|
}) |
|
|
|
}) |
|
|
|
// console.log('editInfo---', res, finalArr) |
|
|
|
this.submitEdit(finalArr) |
|
|
|
return finalArr |
|
|
|
}, |
|
|
|
handleSUbmit () { |
|
|
|
console.log('baseform', this.$refs.baseForm.handleForm()) |
|
|
|
const _baseForm = this.$refs.baseForm.handleForm() |
|
|
|
let arr = [] |
|
|
|
// let arr1 = [] |
|
|
|
if (_baseForm.length === 0) return false |
|
|
|
arr.push([ ..._baseForm ]) |
|
|
|
this.tabsList.forEach(item => { |
|
|
|
// console.log('groupInfo', this.$refs['group' + item.groupId][0].handleForm()) |
|
|
|
arr.push([ ...this.$refs['group' + item.groupId][0].handleForm() ]) |
|
|
|
}) |
|
|
|
let arr2 = arr.reduce(function (a, b) { return a.concat(b) }) |
|
|
|
// console.log('arrr555-----sub', arr2) |
|
|
|
// 合并相同tableName的多个数组 |
|
|
|
let hash = {} |
|
|
|
let i = 0 |
|
|
|
let res = [] |
|
|
|
let finalArr = [] |
|
|
|
arr2.forEach(function (item) { |
|
|
|
// console.log('arrr666-----sub', item) |
|
|
|
let name = item.tableName |
|
|
|
if (hash[name]) { |
|
|
|
res[hash[name] - 1].list.push(...item.list) |
|
|
|
// console.log('hash[name]---', hash[name], res, res[hash[name] - 1], item) |
|
|
|
} else { |
|
|
|
hash[name] = ++i |
|
|
|
res.push({ |
|
|
|
list: [...item.list], |
|
|
|
supportAdd: item.supportAdd, |
|
|
|
tableName: name |
|
|
|
}) |
|
|
|
// console.log('hash[name]0000---', hash[name], res) |
|
|
|
} |
|
|
|
}) |
|
|
|
// 多个list合并成一个list子集 |
|
|
|
res.forEach(item => { |
|
|
|
// console.log('arrr777-----sub', item) |
|
|
|
let _form = {} |
|
|
|
item.list.forEach(n => { |
|
|
|
_form = { ..._form, ...n } |
|
|
|
async handleEditSUbmit () { |
|
|
|
const arr = await this.formetForm() |
|
|
|
this.submitEdit(arr) |
|
|
|
}, |
|
|
|
async handleSUbmit () { |
|
|
|
const arr = await this.formetForm() |
|
|
|
this.submitAdd(arr) |
|
|
|
}, |
|
|
|
handleDel (row) { |
|
|
|
let params = { |
|
|
|
formCode: 'resi_base_info', |
|
|
|
icResiUserId: row.icResiUserId |
|
|
|
} |
|
|
|
this.$http |
|
|
|
.post('/epmetuser/icresiuser/delete', params) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.getTableData() |
|
|
|
} |
|
|
|
}) |
|
|
|
finalArr.push({ |
|
|
|
tableName: item.tableName, |
|
|
|
list: item.supportAdd ? [...item.list] : [{ ..._form }] |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}) |
|
|
|
// console.log('arrr999-----sub', finalArr) |
|
|
|
this.submitAdd(finalArr) |
|
|
|
}, |
|
|
|
handleFormatUrl (url) { |
|
|
|
return url.includes('?') |
|
|
|
@ -445,7 +427,7 @@ export default { |
|
|
|
conditions: this.conditions |
|
|
|
} |
|
|
|
this.$http |
|
|
|
.post('/data/aggregator/icresiuser/listresi', params) |
|
|
|
.post('/epmetuser/icresiuser/listresi', params) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
@ -464,7 +446,7 @@ export default { |
|
|
|
icResiUserId: id |
|
|
|
} |
|
|
|
this.$http |
|
|
|
.post('/data/aggregator/icresiuser/detail', params) |
|
|
|
.post('/epmetuser/icresiuser/detail', params) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
@ -633,6 +615,7 @@ export default { |
|
|
|
} |
|
|
|
.resi-card-table { |
|
|
|
.btn-color-del { |
|
|
|
margin-left: 10px; |
|
|
|
color: rgba(213, 16, 16, 1); |
|
|
|
} |
|
|
|
.btn-color-edit { |
|
|
|
|