methods: { | methods: { | ||||
reduceData(data) { | reduceData(data) { | ||||
try { | try { | ||||
let arr = data; | |||||
let arr = JSON.parse(JSON.stringify(data)); | |||||
let year, code, quota1; | let year, code, quota1; | ||||
return arr.map((item, index) => { | return arr.map((item, index) => { | ||||
if (item.quota1.trim() != quota1 && (code == undefined || item.code.trim() == code) && (item.year.trim() == year || year == undefined)) { | if (item.quota1.trim() != quota1 && (code == undefined || item.code.trim() == code) && (item.year.trim() == year || year == undefined)) { |
}, | }, | ||||
mixins: [ | mixins: [ | ||||
mergeSpan([ | mergeSpan([ | ||||
// {name:"specialPowerId",col:[]}, | |||||
{ name: "quota1", col: [1] }, | { name: "quota1", col: [1] }, | ||||
{ name: "quota2", col: [2] }, | { name: "quota2", col: [2] }, | ||||
{ name: "content", col: [3, 13] }, | { name: "content", col: [3, 13] }, |
"points", | "points", | ||||
"leaderDept", | "leaderDept", | ||||
"leaderPrincipal", | "leaderPrincipal", | ||||
"otherDept", | |||||
"otherPrincipal", | |||||
"cooperateDept", | |||||
"cooperatePrincipal", | |||||
// "otherDept", | |||||
// "otherPrincipal", | |||||
// "cooperateDept", | |||||
// "cooperatePrincipal", | |||||
]; | ]; | ||||
for (let param of params) { | for (let param of params) { | ||||
if (Array.isArray(form[param])) { | if (Array.isArray(form[param])) { | ||||
editApi | editApi | ||||
.editItem(Object.assign({}, form)) | .editItem(Object.assign({}, form)) | ||||
.then((res) => { | .then((res) => { | ||||
this.showEdit = false; | |||||
this.$message({ | |||||
type: "success", | |||||
message: "提交申请成功", | |||||
}); | |||||
this.getDataList(); | |||||
if (res.data.code == 0) { | |||||
this.showEdit = false; | |||||
this.$message({ | |||||
type: "success", | |||||
message: "提交申请成功", | |||||
}); | |||||
this.getDataList(); | |||||
} else { | |||||
this.$message({ | |||||
type: "error", | |||||
message: res.data.msg | |||||
}); | |||||
} | |||||
}) | }) | ||||
.catch((e) => { | .catch((e) => { | ||||
this.showEdit = false; | this.showEdit = false; |
"points", | "points", | ||||
"leaderDept", | "leaderDept", | ||||
"leaderPrincipal", | "leaderPrincipal", | ||||
"otherDept", | |||||
"otherPrincipal", | |||||
"cooperateDept", | |||||
"cooperatePrincipal", | |||||
// "otherDept", | |||||
// "otherPrincipal", | |||||
// "cooperateDept", | |||||
// "cooperatePrincipal", | |||||
]; | ]; | ||||
for (let param of params) { | for (let param of params) { | ||||
if (Array.isArray(form[param])) { | if (Array.isArray(form[param])) { | ||||
editApi | editApi | ||||
.editItem(Object.assign({}, form)) | .editItem(Object.assign({}, form)) | ||||
.then((res) => { | .then((res) => { | ||||
this.showEdit = false; | |||||
this.$message({ | |||||
type: "success", | |||||
message: "提交申请成功", | |||||
}); | |||||
this.getDataList(); | |||||
if (res.data.code == 0) { | |||||
this.showEdit = false; | |||||
this.$message({ | |||||
type: "success", | |||||
message: "提交申请成功", | |||||
}); | |||||
this.getDataList(); | |||||
} else { | |||||
this.$message({ | |||||
type: "error", | |||||
message: res.data.msg, | |||||
}); | |||||
} | |||||
}) | }) | ||||
.catch((e) => { | .catch((e) => { | ||||
this.showEdit = false; | this.showEdit = false; |
"points", | "points", | ||||
"leaderDept", | "leaderDept", | ||||
"leaderPrincipal", | "leaderPrincipal", | ||||
"otherDept", | |||||
"otherPrincipal", | |||||
"cooperateDept", | |||||
"cooperatePrincipal", | |||||
// "otherDept", | |||||
// "otherPrincipal", | |||||
// "cooperateDept", | |||||
// "cooperatePrincipal", | |||||
]; | ]; | ||||
for (let param of params) { | for (let param of params) { | ||||
if (Array.isArray(form[param])) { | if (Array.isArray(form[param])) { | ||||
editApi | editApi | ||||
.editItem(Object.assign({}, form)) | .editItem(Object.assign({}, form)) | ||||
.then((res) => { | .then((res) => { | ||||
this.showEdit = false; | |||||
this.$message({ | |||||
type: "success", | |||||
message: "提交申请成功", | |||||
}); | |||||
this.getDataList(); | |||||
if (res.data.code == 0) { | |||||
this.showEdit = false; | |||||
this.$message({ | |||||
type: "success", | |||||
message: "提交申请成功", | |||||
}); | |||||
this.getDataList(); | |||||
} else { | |||||
this.$message({ | |||||
type: "error", | |||||
message: res.data.msg, | |||||
}); | |||||
} | |||||
}) | }) | ||||
.catch((e) => { | .catch((e) => { | ||||
this.showEdit = false; | this.showEdit = false; |