| | |
| | | <el-date-picker v-model="form.fillDate" type="date" style="width: 340px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="所属用户" prop="userId"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 340px;" @change="formUserChange"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="userRolesLevelMin == roleLevelOrdinary" @change="formUserChange"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="结算状态" prop="settlementStatus"> |
| | | <el-form-item v-if="(userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelSystem) && crud.status.edit == crudStatusPrepared" label="结算状态" prop="settlementStatus"> |
| | | <el-select v-model="form.settlementStatus" filterable placeholder="请选择" style="width: 340px;"> |
| | | <el-option |
| | | v-for="item in dict[settlementStatus]" |
| | |
| | | <el-table-column v-if="checkPer(['admin','taskDaliy:edit','taskDaliy:del'])" label="操作" width="150px" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | v-if="userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelSystem || scope.row.userId == user.id" |
| | | :data="scope.row" |
| | | :permission="permission" |
| | | /> |
| | |
| | | import crudOperation from '@crud/CRUD.operation' |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import { mapGetters } from 'vuex' |
| | | import constant from '../../../utils/constant' |
| | | import crudUser from '@/api/system/user' |
| | | import crudProject from '@/api/project/project' |
| | | import crudTask from '@/api/task/task' |
| | | |
| | | const defaultForm = { id: null, projectId: null, taskId: null, userId: null, fillDate: null, consumedHours: null, consumedWorkload: null, taskProgress: null, settlementStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | const defaultForm = { id: null, projectId: null, taskId: null, userId: null, fillDate: null, consumedHours: null, consumedWorkload: null, taskProgress: null, settlementStatus: constant.SETTLEMENT_STATUS_UNSETTLED, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'TaskDaliy', |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | |
| | | standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT, |
| | | // 字典:结算状态 |
| | | settlementStatus: constant.SETTLEMENT_STATUS, |
| | | // 角色级别:超级管理员 |
| | | roleLevelSuper: constant.ROLE_LEVEL_SUPER, |
| | | // 角色级别:系统管理员 |
| | | roleLevelSystem: constant.ROLE_LEVEL_SYSTEM, |
| | | // 角色级别:普通用户 |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY, |
| | | // CRUD状态 |
| | | crudStatusPrepared: CRUD.STATUS.PREPARED, |
| | | // 用户最大角色级别 |
| | | userRolesLevelMin: null, |
| | | // 用户列表 |
| | | users: [], |
| | | // 检索项目列表 |
| | |
| | | formTasks: [] |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'user' |
| | | ]) |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | // 用户角色级别数组 |
| | | const userRolesLevel = this.user.roles.map(({ level }) => level) |
| | | // 用户最大角色级别 |
| | | this.userRolesLevelMin = Math.min(...userRolesLevel) |
| | | // 获取用户 |
| | | this.getUser() |
| | | // 获取检索项目 |
| | |
| | | [CRUD.HOOK.beforeToAdd]() { |
| | | // 表单赋值 |
| | | this.form.consumedWorkloadUnit = null |
| | | // 判断用户最大角色级别是否是角色级别:普通用户 |
| | | if (this.userRolesLevelMin === this.roleLevelOrdinary) { |
| | | // 表单赋值 |
| | | this.form.userId = this.user.id |
| | | // 表单用户变更 |
| | | this.formUserChange() |
| | | } |
| | | }, |
| | | // 钩子:编辑 - 之前 |
| | | [CRUD.HOOK.beforeToEdit]() { |