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