修改收集清单的更新参数列数据
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -58,7 +58,7 @@
|
|||||||
<!-- </span>-->
|
<!-- </span>-->
|
||||||
<!-- </span>-->
|
<!-- </span>-->
|
||||||
<span slot="detailClick" slot-scope="text,record">
|
<span slot="detailClick" slot-scope="text,record">
|
||||||
<collection-type :detailDate='text'/>
|
<collection-type @consolidateData="consolidateData" :detailDate='text'/>
|
||||||
</span>
|
</span>
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
@@ -293,6 +293,7 @@
|
|||||||
detailDateList: [],
|
detailDateList: [],
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRowrowValue: [],
|
selectedRowrowValue: [],
|
||||||
|
description:'',
|
||||||
dataSource: [],
|
dataSource: [],
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
@@ -653,13 +654,24 @@
|
|||||||
if (this.currentPersonRole !== 'dre') {
|
if (this.currentPersonRole !== 'dre') {
|
||||||
res.result.records.forEach((Obj) => {
|
res.result.records.forEach((Obj) => {
|
||||||
Object.keys(Obj).forEach((item) => {
|
Object.keys(Obj).forEach((item) => {
|
||||||
|
|
||||||
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
||||||
Obj[item].list.forEach((itemLi) => {
|
for (const key in Obj[item].paramsConfigData){
|
||||||
itemLi.isLock = 1
|
Obj[item].paramsConfigData[key].forEach((itemLi) =>
|
||||||
if (itemLi.type === 'pull_more') {
|
{
|
||||||
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
|
||||||
}
|
itemLi.isLock = 1
|
||||||
})
|
if (itemLi.type === 'pull_more') {
|
||||||
|
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// Obj[item].list.forEach((itemLi) => {
|
||||||
|
// itemLi.isLock = 1
|
||||||
|
// if (itemLi.type === 'pull_more') {
|
||||||
|
// itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tt.push(Obj)
|
tt.push(Obj)
|
||||||
@@ -668,11 +680,18 @@
|
|||||||
res.result.records.forEach((Obj) => {
|
res.result.records.forEach((Obj) => {
|
||||||
Object.keys(Obj).forEach((item) => {
|
Object.keys(Obj).forEach((item) => {
|
||||||
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
||||||
Obj[item].list.forEach((itemLi) => {
|
for (const key in Obj[item].paramsConfigData){
|
||||||
if (itemLi.type === 'pull_more') {
|
Obj[item].paramsConfigData[key].forEach((itemLi) => {
|
||||||
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
if (itemLi.type === 'pull_more') {
|
||||||
}
|
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// Obj[item].list.forEach((itemLi) => {
|
||||||
|
// if (itemLi.type === 'pull_more') {
|
||||||
|
// itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tt.push(Obj)
|
tt.push(Obj)
|
||||||
@@ -693,6 +712,9 @@
|
|||||||
cancleoperationFailed() {
|
cancleoperationFailed() {
|
||||||
this.selectedRowKeys = []
|
this.selectedRowKeys = []
|
||||||
},
|
},
|
||||||
|
consolidateData(){
|
||||||
|
this.dataSource = [...this.dataSource]
|
||||||
|
},
|
||||||
getTableList(currentPersonRole) {
|
getTableList(currentPersonRole) {
|
||||||
console.log(this.url.tableList)
|
console.log(this.url.tableList)
|
||||||
let paramsManifestid
|
let paramsManifestid
|
||||||
@@ -734,28 +756,56 @@
|
|||||||
// })
|
// })
|
||||||
let tt = []
|
let tt = []
|
||||||
if (this.currentPersonRole !== 'dre') {
|
if (this.currentPersonRole !== 'dre') {
|
||||||
|
|
||||||
|
console.log(res.result.records, 'res.result.records')
|
||||||
res.result.records.forEach((Obj) => {
|
res.result.records.forEach((Obj) => {
|
||||||
Object.keys(Obj).forEach((item) => {
|
Object.keys(Obj).forEach((item) => {
|
||||||
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
||||||
Obj[item].list.forEach((itemLi) => {
|
for (const key in Obj[item].paramsConfigData){
|
||||||
itemLi.isLock = 1
|
Obj[item].paramsConfigData[key].forEach((itemLi) => {
|
||||||
if (itemLi.type === 'pull_more') {
|
console.log(item)
|
||||||
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
if((this.currentPersonRole == 'homo' || this.currentPersonRole == 'admin') && item == 'referencesCol'){
|
||||||
}
|
itemLi.isLock = 0
|
||||||
})
|
}else{
|
||||||
|
itemLi.isLock = 1
|
||||||
|
}
|
||||||
|
if (itemLi.type === 'pull_more') {
|
||||||
|
itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// Obj[item].list.forEach((itemLi) => {
|
||||||
|
// console.log(item)
|
||||||
|
// if((this.currentPersonRole == 'homo' || this.currentPersonRole == 'admin') && item == 'referencesCol'){
|
||||||
|
// itemLi.isLock = 0
|
||||||
|
// }else{
|
||||||
|
// itemLi.isLock = 1
|
||||||
|
// }
|
||||||
|
// if (itemLi.type === 'pull_more') {
|
||||||
|
// itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tt.push(Obj)
|
tt.push(Obj)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
res.result.records.forEach((Obj) => {
|
res.result.records.forEach((Obj) => {
|
||||||
Object.keys(Obj).forEach((item) => {
|
Object.keys(Obj).forEach((item) => {
|
||||||
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
||||||
Obj[item].list.forEach((itemLi) => {
|
for (const key in Obj[item].paramsConfigData){
|
||||||
if (itemLi.type === 'pull_more') {
|
Obj[item].paramsConfigData[key].forEach((itemLi) => {
|
||||||
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
if (itemLi.type === 'pull_more') {
|
||||||
}
|
itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',')
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// Obj[item].list.forEach((itemLi) => {
|
||||||
|
// if (itemLi.type === 'pull_more') {
|
||||||
|
// itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tt.push(Obj)
|
tt.push(Obj)
|
||||||
|
|||||||
@@ -316,34 +316,69 @@
|
|||||||
data.forEach(res => {
|
data.forEach(res => {
|
||||||
selectedRowKeysValue.push(res)
|
selectedRowKeysValue.push(res)
|
||||||
})
|
})
|
||||||
console.log(selectedRowKeysValue)
|
// console.log(selectedRowKeysValue)
|
||||||
for (let i = 0; i < selectedRowKeysValue.length; i++) {
|
// for (let i = 0; i < selectedRowKeysValue.length; i++) {
|
||||||
let postDateobj = {}
|
// let postDateobj = {}
|
||||||
let itemIn = Object.keys(selectedRowKeysValue[i])
|
// let itemIn = Object.keys(selectedRowKeysValue[i])
|
||||||
for (let j = 0; j < itemIn.length; j++) {
|
// for (let j = 0; j < itemIn.length; j++) {
|
||||||
if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) {
|
// if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) {
|
||||||
if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) {
|
// if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) {
|
||||||
postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]]
|
// postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]]
|
||||||
for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) {
|
// for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) {
|
||||||
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue instanceof Array) {
|
// if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue instanceof Array) {
|
||||||
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',')
|
// selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',')
|
||||||
}
|
// }
|
||||||
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) {
|
// if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) {
|
||||||
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString()
|
// selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// postDateobj.id = selectedRowKeysValue[i].id
|
||||||
|
// postDateobj.remarks = selectedRowKeysValue[i].remarks
|
||||||
|
// postDate.push(postDateobj)
|
||||||
|
// }
|
||||||
|
// let configDataList = { configDataList: postDate }
|
||||||
|
if (selectedRowKeysValue && selectedRowKeysValue.length > 0) {
|
||||||
|
let configDataList = []
|
||||||
|
for (let i = 0; i < selectedRowKeysValue.length; i++) {
|
||||||
|
configDataList.push({
|
||||||
|
id: selectedRowKeysValue[i].id
|
||||||
|
})
|
||||||
|
if (selectedRowKeysValue[i].configIds && selectedRowKeysValue[i].configIds.length > 0) {
|
||||||
|
for (let j = 0; j < selectedRowKeysValue[i].configIds.length; j++) {
|
||||||
|
let keyIndex = Object.keys(selectedRowKeysValue[i])
|
||||||
|
for (let k = 0; k < keyIndex.length; k++) {
|
||||||
|
if (keyIndex[k] == selectedRowKeysValue[i].configIds[j]) {
|
||||||
|
let keyName = keyIndex[k]
|
||||||
|
configDataList[i][keyName] = selectedRowKeysValue[i][keyName]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
postDateobj.id = selectedRowKeysValue[i].id
|
// return
|
||||||
postDateobj.remarks = selectedRowKeysValue[i].remarks
|
if (configDataList && configDataList.length > 0) {
|
||||||
postDate.push(postDateobj)
|
configDataList.forEach(res => {
|
||||||
}
|
Object.keys(res).forEach(val => {
|
||||||
let configDataList = { configDataList: postDate }
|
if (res[val] && res[val].paramsConfigData) {
|
||||||
if (selectedRowKeysValue && selectedRowKeysValue.length > 0) {
|
let paramsConfigData = res[val].paramsConfigData
|
||||||
|
Object.keys(paramsConfigData).forEach((ol, index) => {
|
||||||
|
paramsConfigData[ol][0].orderNum = index
|
||||||
|
paramsConfigData[ol].forEach(item => {
|
||||||
|
if (item.type == 'pull_more') {
|
||||||
|
item.dataValue = item.dataValue.join(',')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
this.textLoading = true
|
this.textLoading = true
|
||||||
let query = {
|
let query = {
|
||||||
...configDataList,
|
configDataList: configDataList,
|
||||||
paramsManifestId: this.$route.query.id
|
paramsManifestId: this.$route.query.id
|
||||||
}
|
}
|
||||||
postAction('/report/detail/save', query).then((res) => {
|
postAction('/report/detail/save', query).then((res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user