|
|
@ -466,7 +466,7 @@ |
|
|
|
<el-button v-show="!scope.row.isDisabled" |
|
|
|
<el-button v-show="!scope.row.isDisabled" |
|
|
|
size="mini" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
@click="handleSave(scope.row, scope.$index)">保存 |
|
|
|
@click="handleSave(scope.row)">保存 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
<!-- <el-button v-show="!scope.row.isDisabled" |
|
|
|
<!-- <el-button v-show="!scope.row.isDisabled" |
|
|
|
size="mini" |
|
|
|
size="mini" |
|
|
@ -1176,53 +1176,51 @@ export default { |
|
|
|
row.isDisabled = false; |
|
|
|
row.isDisabled = false; |
|
|
|
row.isSave = false; |
|
|
|
row.isSave = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSave (row, index) { // 处理保存规则 |
|
|
|
handleSave (row, i) { // 处理保存规则 |
|
|
|
|
|
|
|
const pre = typeof i === 'number' ? `第${i + 1}项,` : '' |
|
|
|
if (!row.operationIds) { |
|
|
|
if (!row.operationIds) { |
|
|
|
this.$message.warning(`请选择操作点`); |
|
|
|
this.$message.warning(pre + `请选择操作点`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//题目类型(1选择 2判断 3填空 4问答 5指标结果) |
|
|
|
//题目类型(1选择 2判断 3填空 4问答 5指标结果) |
|
|
|
if (row.type == 1 || row.type == 2) { |
|
|
|
if (row.type == 1 || row.type == 2) { |
|
|
|
if (row.type == 1 && this.isSt) { |
|
|
|
if (row.type == 1 && this.isSt) { |
|
|
|
if (!row.value1.length) { |
|
|
|
if (!row.value1.length) { |
|
|
|
this.$message.warning(`请选择正确答案`); |
|
|
|
this.$message.warning(pre + `请选择正确答案`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (!row.value1) { |
|
|
|
} else if (!row.value1) { |
|
|
|
this.$message.warning(`请选择正确答案`); |
|
|
|
this.$message.warning(pre + `请选择正确答案`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (row.type == 3) { |
|
|
|
} else if (row.type == 3) { |
|
|
|
if (!row.value1) { |
|
|
|
if (!row.value1) { |
|
|
|
this.$message.warning(`请输入字段要求`); |
|
|
|
this.$message.warning(pre + `请输入字段要求`); |
|
|
|
return; |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (row.type == 4) { |
|
|
|
} else if (row.type == 4) { |
|
|
|
if (!row.value1) { |
|
|
|
if (!row.value1) { |
|
|
|
this.$message.warning(`请选择字数要求`); |
|
|
|
this.$message.warning(pre + `请选择字数要求`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} else if (row.value1 !== "无限制" && !row.value2) { |
|
|
|
} else if (row.value1 !== "无限制" && !row.value2) { |
|
|
|
this.$message.warning(`请输入字数要求`); |
|
|
|
this.$message.warning(pre + `请输入字数要求`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} else if (!row.value3) { |
|
|
|
} else if (!row.value3) { |
|
|
|
this.$message.warning(`请输入字段要求`); |
|
|
|
this.$message.warning(pre + `请输入字段要求`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (row.type == 5) { |
|
|
|
} else if (row.type == 5) { |
|
|
|
if ((!row.value2 || !row.value5) && !this.isSt) { |
|
|
|
if (!row.value2 && !row.value3 && !row.value4 && !row.value5 && !row.value6 && !row.value7) { |
|
|
|
this.$message.warning(`请选择交易指标区间`); |
|
|
|
this.$message.warning(pre + `请输入交易指标区间`); |
|
|
|
return; |
|
|
|
|
|
|
|
} else if ((!row.value3 || !row.value5) && !this.isSt) { |
|
|
|
|
|
|
|
this.$message.warning(`请输入交易指标区间`); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} else if (row.value3 && row.value5 && !isNaN(row.value3) && !isNaN(row.value5) && +row.value3 > +row.value5) { |
|
|
|
} else if (row.value3 && row.value5 && !isNaN(row.value3) && !isNaN(row.value5) && +row.value3 > +row.value5) { |
|
|
|
this.$message.warning(`第一个指标必须小于第二个指标`); |
|
|
|
this.$message.warning(pre + `第一个指标必须小于第二个指标`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (row.type == 6) { |
|
|
|
} else if (row.type == 6) { |
|
|
|
for (let i = 1; i < 9; i++) { |
|
|
|
for (let i = 1; i < 9; i++) { |
|
|
|
if (row['check' + i] && row['val' + i] === '') { |
|
|
|
if (row['check' + i] && row['val' + i] === '') { |
|
|
|
this.$message.warning(`请输入数量`) |
|
|
|
this.$message.warning(pre + `请输入数量`) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1231,6 +1229,7 @@ export default { |
|
|
|
row.isSave = true; |
|
|
|
row.isSave = true; |
|
|
|
row.isDisabled = true; |
|
|
|
row.isDisabled = true; |
|
|
|
this.isAddRule = false; |
|
|
|
this.isAddRule = false; |
|
|
|
|
|
|
|
return true |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCancel (row, index) { // 处理取消编辑规则 |
|
|
|
handleCancel (row, index) { // 处理取消编辑规则 |
|
|
|
if (this.judgePoints == true) { |
|
|
|
if (this.judgePoints == true) { |
|
|
@ -1314,10 +1313,14 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 一键保存 |
|
|
|
// 一键保存 |
|
|
|
saveAll () { |
|
|
|
saveAll () { |
|
|
|
this.tableData.forEach(e => { |
|
|
|
for (const e of this.tableData) { |
|
|
|
e.isDisabled = true |
|
|
|
if (e.isSubject) { |
|
|
|
e.isSave = true |
|
|
|
const result = this.handleSave(e, e.index) |
|
|
|
}) |
|
|
|
if (!result) break |
|
|
|
|
|
|
|
e.isDisabled = true |
|
|
|
|
|
|
|
e.isSave = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 表头样式设置 |
|
|
|
// 表头样式设置 |
|
|
|
headClass () { |
|
|
|
headClass () { |
|
|
|