修改汇总样式
This commit is contained in:
parent
eb58367a5b
commit
bfdab9e283
@ -53,9 +53,8 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" size="mini" @click="showById(scope.row.id)">查看工作量</el-button>
|
<el-button type="text" size="mini" @click="showById(scope.row.id)">查看工作量</el-button>
|
||||||
<el-button type="text" size="mini" @click="updateById(scope.row.id)">修改</el-button>
|
<el-button type="text" size="mini" @click="updateById(scope.row.id)">修改</el-button>
|
||||||
<el-button type="text" size="mini" @click="summary(scope.row)" :disabled="scope.row.summarized">
|
<el-button v-if="isButtonDisabled(scope.row.id)" type="text" size="mini" disabled>已汇总</el-button>
|
||||||
{{ scope.row.summarized ? '已汇总' : '汇总' }}
|
<el-button v-else type="text" size="mini" @click="summary(scope.row)">汇总</el-button>
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -141,6 +140,7 @@
|
|||||||
total: null,
|
total: null,
|
||||||
tableTotalPage: 1,
|
tableTotalPage: 1,
|
||||||
tableColumnsData: [],
|
tableColumnsData: [],
|
||||||
|
disabledButtons: [], // 存储已禁用按钮的 ID
|
||||||
tableRowsData: [],
|
tableRowsData: [],
|
||||||
isSuper: false
|
isSuper: false
|
||||||
}
|
}
|
||||||
@ -149,6 +149,13 @@
|
|||||||
this.initTableColumns();
|
this.initTableColumns();
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
// 页面加载时从本地存储中恢复已禁用按钮的状态
|
||||||
|
const disabledButtons = JSON.parse(localStorage.getItem('disabledButtons'));
|
||||||
|
if (disabledButtons) {
|
||||||
|
this.disabledButtons = disabledButtons;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init () {
|
init () {
|
||||||
let userId = getItem('userId');
|
let userId = getItem('userId');
|
||||||
@ -291,7 +298,11 @@
|
|||||||
this.$router.push({name: 'DepartmentWeeklyList'})
|
this.$router.push({name: 'DepartmentWeeklyList'})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
row.summarized = true;
|
this.disabledButtons.push(row.id);
|
||||||
|
localStorage.setItem('disabledButtons', JSON.stringify(this.disabledButtons));
|
||||||
|
},
|
||||||
|
isButtonDisabled (id) {
|
||||||
|
return this.disabledButtons.includes(id);
|
||||||
},
|
},
|
||||||
updateWorkload (id) {
|
updateWorkload (id) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user