参数收集清单 更新参考列功能
This commit is contained in:
@@ -1365,4 +1365,5 @@ module.exports = {
|
|||||||
historicalrecord:'historical Record',
|
historicalrecord:'historical Record',
|
||||||
Referenceparametercolumn:'Reference Parameter Column',
|
Referenceparametercolumn:'Reference Parameter Column',
|
||||||
Updateparametercolumn:'Update The Parameter Column',
|
Updateparametercolumn:'Update The Parameter Column',
|
||||||
|
columnfirst:'Reference the parameter column first',
|
||||||
}
|
}
|
||||||
@@ -1466,4 +1466,5 @@ module.exports = {
|
|||||||
historicalrecord:'历史记录',
|
historicalrecord:'历史记录',
|
||||||
Referenceparametercolumn:'引用参数列',
|
Referenceparametercolumn:'引用参数列',
|
||||||
Updateparametercolumn:'更新参数列',
|
Updateparametercolumn:'更新参数列',
|
||||||
|
columnfirst:'请先引用参数列',
|
||||||
}
|
}
|
||||||
@@ -1339,7 +1339,54 @@
|
|||||||
this.parametercolumn = true
|
this.parametercolumn = true
|
||||||
},
|
},
|
||||||
Updateparametercolumn() {
|
Updateparametercolumn() {
|
||||||
|
let data = JSON.parse(JSON.stringify(this.$refs.CollectionTabel.dataSource))
|
||||||
|
console.log(data)
|
||||||
|
let referencesCol = []
|
||||||
|
let postDate = []
|
||||||
|
data.forEach((item,index) => {
|
||||||
|
if(!item.dutyTerritory){
|
||||||
|
this.$message.warning(this.$t('columnfirst'))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
referencesCol.push({
|
||||||
|
referencesCol: item.referencesCol,
|
||||||
|
id: item.id
|
||||||
|
})
|
||||||
|
})
|
||||||
|
for (let i = 0; i < referencesCol.length; i++) {
|
||||||
|
let postDateobj = {}
|
||||||
|
let itemIn = Object.keys(referencesCol[i])
|
||||||
|
for (let j = 0; j < itemIn.length; j++) {
|
||||||
|
if (itemIn[j] !== 'sdt' && referencesCol[i][itemIn[j]].list) {
|
||||||
|
if (referencesCol[i][itemIn[j]] instanceof Object && !(referencesCol[i][itemIn[j]] instanceof Array)) {
|
||||||
|
postDateobj[itemIn[j]] = referencesCol[i][itemIn[j]]
|
||||||
|
for (let k = 0; k < referencesCol[i][itemIn[j]].list.length; k++) {
|
||||||
|
if (referencesCol[i][itemIn[j]].list[k].type == 'pull_more') {
|
||||||
|
referencesCol[i][itemIn[j]].list[k].dataValue = referencesCol[i][itemIn[j]].list[k].dataValue.join(',')
|
||||||
|
}
|
||||||
|
if (referencesCol[i][itemIn[j]].list[k].type == 'text' && referencesCol[i][itemIn[j]].list[k].dataValue !== null) {
|
||||||
|
referencesCol[i][itemIn[j]].list[k].dataValue = referencesCol[i][itemIn[j]].list[k].dataValue.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
postDateobj.id = referencesCol[i].id
|
||||||
|
postDate.push(postDateobj)
|
||||||
|
}
|
||||||
|
let configDataList = { configDataList: postDate }
|
||||||
|
let query = {
|
||||||
|
...configDataList,
|
||||||
|
paramsManifestId: this.paramsManifest.id
|
||||||
|
}
|
||||||
|
postAction('/params/collectManifest/updateReferencesCol', query).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.GetgetTableList()
|
||||||
|
this.$message.success(this.$t('OperationSuccessful'))
|
||||||
|
} else {
|
||||||
|
this.$message.warning(this.$t('operationFailed'))
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// // 下发收集---请求接口
|
// // 下发收集---请求接口
|
||||||
// distributionAndCollection() {
|
// distributionAndCollection() {
|
||||||
@@ -1453,8 +1500,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
postDateobj.id = selectedRowKeysValue[i].id
|
postDateobj.id = selectedRowKeysValue[i].id
|
||||||
|
delete postDateobj.referencesCol
|
||||||
postDate.push(postDateobj)
|
postDate.push(postDateobj)
|
||||||
}
|
}
|
||||||
|
console.log(postDate)
|
||||||
let configDataList = { configDataList: postDate }
|
let configDataList = { configDataList: postDate }
|
||||||
if (selectedRowKeysValue && selectedRowKeysValue.length > 0) {
|
if (selectedRowKeysValue && selectedRowKeysValue.length > 0) {
|
||||||
if (num && num == 1) {
|
if (num && num == 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user