项目预算权限
This commit is contained in:
parent
cf5351273e
commit
eb58367a5b
@ -53,7 +53,9 @@
|
||||
<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.id)">汇总</el-button>
|
||||
<el-button type="text" size="mini" @click="summary(scope.row)" :disabled="scope.row.summarized">
|
||||
{{ scope.row.summarized ? '已汇总' : '汇总' }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -123,6 +125,8 @@
|
||||
showDelete: false,
|
||||
showCheck: true,
|
||||
},
|
||||
sum: false,
|
||||
buttonText: '汇总',
|
||||
searchForm: {
|
||||
projectName: '',
|
||||
week: ''
|
||||
@ -280,15 +284,14 @@
|
||||
params: {id}
|
||||
})
|
||||
},
|
||||
summary (id) {
|
||||
Api.ProjectManagements.insertPermission(id).then(result => {
|
||||
summary (row) {
|
||||
Api.ProjectManagements.insertPermission(row.id).then(result => {
|
||||
if (result.status === 0) {
|
||||
this.$message.success(result.data)
|
||||
this.$router.push({name: 'DepartmentWeeklyList'})
|
||||
} else {
|
||||
this.$message.error(result.data)
|
||||
}
|
||||
})
|
||||
row.summarized = true;
|
||||
},
|
||||
updateWorkload (id) {
|
||||
this.$router.push({
|
||||
@ -313,4 +316,9 @@
|
||||
.page-content {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.el-table .summarized-row {
|
||||
background-color: #f0f9eb; /* 修改行背景色 */
|
||||
color: #67c23a; /* 修改行文本颜色 */
|
||||
}
|
||||
</style>
|
||||
|
@ -76,7 +76,7 @@
|
||||
<el-form-item>
|
||||
<div style="float: right">
|
||||
<el-button @click="cancel()" type="default">取消</el-button>
|
||||
<el-button @click="save('formName')" type="primary" :disabled="!isSave">保存</el-button>
|
||||
<el-button @click="save('formName')" type="primary" :disabled="shouldDisable()">保存</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -108,6 +108,7 @@ export default {
|
||||
thisWeek: '',
|
||||
nextWeek: '',
|
||||
userId: '',
|
||||
roleUserId: [],
|
||||
workload: '',
|
||||
projectName: '',
|
||||
week: '',
|
||||
@ -118,6 +119,7 @@ export default {
|
||||
reimburseId: '',
|
||||
actionUrl: `${baseUrl}/api/common/file-upload`, // 上传路径
|
||||
baseUrl: baseUrl,
|
||||
formAll: [],
|
||||
formModel: {
|
||||
userInfoId: '',
|
||||
witness: '',
|
||||
@ -238,7 +240,9 @@ export default {
|
||||
this.pageLoading = false
|
||||
console.log('预算执行率', result)
|
||||
if (result.status === 0) {
|
||||
let dataAll = result.data
|
||||
let dataList = result.data.ls[0]
|
||||
this.formAll = dataAll
|
||||
this.formModel = dataList
|
||||
// this.tableRowsData.push({
|
||||
// id: dataList.id,
|
||||
@ -412,6 +416,14 @@ export default {
|
||||
cancel () {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
shouldDisable () {
|
||||
const roleUserIds = this.formAll.roleUserId;
|
||||
const userId = this.formAll.userId
|
||||
for (let i = 0; i < roleUserIds.length; i++) {
|
||||
this.isSave = roleUserIds[i] !== userId;
|
||||
}
|
||||
return this.isSave
|
||||
},
|
||||
save (formName) {
|
||||
console.log('formName', formName)
|
||||
this.$refs[formName].validate((valid) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user