This commit is contained in:
xuyucheng 2022-04-22 14:50:41 +08:00
parent 72a1d56e6e
commit 5c7ed555a3
1 changed files with 26 additions and 20 deletions

View File

@ -148,9 +148,7 @@
>确定</el-button >确定</el-button
> >
</div> </div>
<el-button slot="reference" type="primary"> <el-button slot="reference" type="primary"> </el-button>
</el-button>
</el-popover> </el-popover>
</el-footer> </el-footer>
</el-container> </el-container>
@ -346,16 +344,17 @@ export default {
result.result[key]["其他类型问卷"].forEach((item, index) => { result.result[key]["其他类型问卷"].forEach((item, index) => {
if (this.question[key][index].options) { if (this.question[key][index].options) {
for (let i in this.question[key][index].options) { for (let i in this.question[key][index].options) {
if(Array.isArray(item)){ if (Array.isArray(item)) {
this.question[key][index].options[i][0] === item[0] this.question[key][index].options[i][0] === item[0]
? (this.question[key][index].answer = ? ((this.question[key][index].answer =
this.question[key][index].options[i],this.question[key][index].des = item[1]) this.question[key][index].options[i]),
: null; (this.question[key][index].des = item[1]))
}else{ : null;
} else {
this.question[key][index].options[i][0] === item this.question[key][index].options[i][0] === item
? (this.question[key][index].answer = ? (this.question[key][index].answer =
this.question[key][index].options[i]) this.question[key][index].options[i])
: null; : null;
} }
} }
} else { } else {
@ -437,7 +436,7 @@ export default {
}, },
getColumns(value) { getColumns(value) {
if(value.length !== 0) { if (value.length !== 0) {
return Object.keys(value[0]).map((key) => { return Object.keys(value[0]).map((key) => {
return key; return key;
}); });
@ -449,14 +448,17 @@ export default {
input_form: this.data, input_form: this.data,
}).then((res) => { }).then((res) => {
this.$message.success(res.info); this.$message.success(res.info);
this.$router.push("/company")
}); });
}, },
submit() { submit() {
get("/esg/submit_esg_rating_input", {}).then((res) => { get("/esg/submit_esg_rating_input", {}).then((res) => {
this.$message.success(res.info); if (res.info === "执行成功") {
this.visible = false; this.$message.success(res.info);
this.$router.push("/company");
} else {
this.$message.warning(res.info);
}
}); });
}, },
}, },
@ -468,7 +470,7 @@ export default {
list.forEach((key) => { list.forEach((key) => {
this.data[key]["其他类型问卷"] = val[key].map((item) => { this.data[key]["其他类型问卷"] = val[key].map((item) => {
if (item.options) { if (item.options) {
if (Object.prototype.hasOwnProperty.call(item,'des')) { if (Object.prototype.hasOwnProperty.call(item, "des")) {
if (item.answer[0] === "A") { if (item.answer[0] === "A") {
return [item.answer[0], item.des]; return [item.answer[0], item.des];
} else { } else {
@ -492,7 +494,7 @@ export default {
this.submitStatus = !val["所属行业"] ? true : false; this.submitStatus = !val["所属行业"] ? true : false;
Object.keys(val["公司当年收入(万元)"]).forEach((key) => { Object.keys(val["公司当年收入(万元)"]).forEach((key) => {
state.push( state.push(
val["公司当年收入(万元)"][key]!==null && val["公司当年收入(万元)"][key] !== null &&
val["公司当年收入(万元)"][key] !== "" val["公司当年收入(万元)"][key] !== ""
? true ? true
: false : false
@ -502,14 +504,18 @@ export default {
array.forEach((key) => { array.forEach((key) => {
val[key]["近三年公司数据"].forEach((item) => { val[key]["近三年公司数据"].forEach((item) => {
Object.keys(item).forEach((keys) => { Object.keys(item).forEach((keys) => {
state.push(item[keys] !== null && item[keys] !== ""? true : false); state.push(
item[keys] !== null && item[keys] !== "" ? true : false
);
}); });
}); });
val[key]["其他类型问卷"].forEach((item) => { val[key]["其他类型问卷"].forEach((item) => {
state.push(item !== null && item !== "" &&item !==undefined ? true : false); state.push(
item !== null && item !== "" && item !== undefined ? true : false
);
}); });
}); });
console.log(state) console.log(state);
this.submitStatus = state.every((item) => { this.submitStatus = state.every((item) => {
return item; return item;
}); });