|
@@ -488,16 +488,16 @@ export default {
|
|
|
// this.addRowList = filteredData.map(row => row.reduce((p, c) => (p[c.__vModel__] = c.value, p), {}))
|
|
|
// }
|
|
|
// const formMethod = primaryId ? NewupdateModel : NewAddModel
|
|
|
- NewupdateModel(this.modeId, params, primaryId, this.config.dbLinkId, 2).then((res) => {
|
|
|
- this.$message({
|
|
|
- message: res.data.msg,
|
|
|
- type: 'success',
|
|
|
- duration: 1500,
|
|
|
- onClose: () => {
|
|
|
- this.getInData()
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ // NewupdateModel(this.modeId, params, primaryId, this.config.dbLinkId, 2).then((res) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: res.data.msg,
|
|
|
+ // type: 'success',
|
|
|
+ // duration: 1500,
|
|
|
+ // onClose: () => {
|
|
|
+ // this.getInData()
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // })
|
|
|
}
|
|
|
|
|
|
if (['JNPF-Amount', 'el-input-number'].includes(tag)) {
|
|
@@ -614,8 +614,21 @@ export default {
|
|
|
const checkCol = (col) => col.required && !this.checkData(col) && (res = col.valid = false)
|
|
|
filteredData.forEach((row) => row.forEach(checkCol))
|
|
|
// 将新增数据过滤出来返回给主表
|
|
|
- let filterData = this.filterAddData(filteredData)
|
|
|
- return res ? filterData.map((row) => row.reduce((p, c) => ((p[c.__vModel__] = c.value), p), {})) : false
|
|
|
+ // let filterData = this.filterAddData(filteredData)
|
|
|
+ return res ? filteredData.map((row, index) => {
|
|
|
+ // 初始化一个空对象用于存储结果
|
|
|
+ let resultObj = {};
|
|
|
+ // 遍历每一行的数据
|
|
|
+ row.forEach(item => {
|
|
|
+ // 如果 resultObj 为空,则初始化 idKey
|
|
|
+ if (Object.keys(resultObj).length === 0) {
|
|
|
+ resultObj.idKey = item.idKey || null ;
|
|
|
+ }
|
|
|
+ // 将 value 与 __vModel__ 关联
|
|
|
+ resultObj[item.__vModel__] = item.value;
|
|
|
+ });
|
|
|
+ return resultObj;
|
|
|
+ }) : false
|
|
|
},
|
|
|
/**
|
|
|
* 根据formid获取完整组件配置
|
|
@@ -760,7 +773,7 @@ export default {
|
|
|
if (!Array.isArray(this.tableFormData)) {
|
|
|
this.tableFormData = []
|
|
|
}
|
|
|
- this.tableFormData.unshift(this.getEmptyRow(val, flag,relationFlag))
|
|
|
+ this.tableFormData.push(this.getEmptyRow(val, flag,relationFlag))
|
|
|
if (!createFlag){
|
|
|
this.clearAddRowFlag(index)
|
|
|
}
|