代码更新

This commit is contained in:
2022-12-14 14:38:02 +08:00
parent 3b02fd79b9
commit ac1f546767

View File

@@ -142,7 +142,7 @@
<template scope="scope">
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="delOne(scope.$index, form.tableData)" />
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button v-show="scope.row.edit" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
<el-button v-show="scope.row.edit" :disabled="crud.status.edit && !scope.row.canDo" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
</template>
</el-table-column>
</el-table>
@@ -258,7 +258,9 @@ export default {
},
handleEdit(index, row) {
// 判断是否可以关闭编辑状态
console.log(row.canDo)
if (!row.edit) {
row.canDo = true
if (parseFloat(row.standard_rate) <= 0) {
this.crud.notify('标准值必须大于0', CRUD.NOTIFICATION_TYPE.INFO)
return false
@@ -272,7 +274,8 @@ export default {
return false
}
if (row.is_need_manage === '1') {
if ((this.form.total_value + parseFloat(row.standard_rate)) > 100) {
debugger
if ((parseFloat(this.form.total_value) + parseFloat(row.standard_rate)) > 100) {
this.crud.notify('标准合计值不能超过100', CRUD.NOTIFICATION_TYPE.INFO)
return false
}