| | |
| | | <el-row :gutter="15"> |
| | | <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="7"> |
| | | <el-card class="box-card" shadow="never"> |
| | | <el-tabs v-model="activeName" style="height: 200px;" @tab-click="handleClick"> |
| | | <el-tab-pane label="临期任务(10)" name="first">临期任务</el-tab-pane> |
| | | <el-tabs v-model="tobeOver" style="height: 200px;" @tab-click="handleClickTobeTasked"> |
| | | <el-tab-pane :label="tobeTasked" name="first">临期任务</el-tab-pane> |
| | | </el-tabs> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="17"> |
| | | <el-card class="box-card" shadow="never"> |
| | | <el-tabs v-model="activeName" style="height: 200px;" @tab-click="handleClick"> |
| | | <el-tab-pane label="进行中任务(10)" name="first">进行中任务</el-tab-pane> |
| | | <el-tab-pane label="未着手任务(10)" name="second">未着手任务</el-tab-pane> |
| | | <el-tab-pane label="未分配任务(10)" name="third">未分配任务</el-tab-pane> |
| | | <el-tab-pane :label="tasking" name="first"> |
| | | 111 |
| | | </el-tab-pane> |
| | | <el-tab-pane :label="tobeTask" name="second"> |
| | | 222 |
| | | </el-tab-pane> |
| | | <!--<el-tab-pane label="未分配任务" name="third" style=":display: false">未分配任务</el-tab-pane>--> |
| | | </el-tabs> |
| | | </el-card> |
| | | </el-col> |
| | |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | <el-input v-model="query.name" filterable clearable placeholder="任务名称" style="width: 185px;" class="filter-item" /> |
| | | <rrOperation :crud="crud" /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | |
| | | <el-date-picker v-model="form.fillDate" type="date" style="width: 340px;" :disabled="disabledFlagBySettlement" /> |
| | | </el-form-item> |
| | | <el-form-item label="所属员工" prop="userId"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="disabledFlagBySettlement || (userRolesLevelMin != roleLevelSuper && userRolesLevelMin != roleLevelGeneral)" @change="formUserChange"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | <el-input v-model="form.userNickName" style="width: 340px;" :disabled="true" /> |
| | | </el-form-item> |
| | | <el-form-item label="所属项目" prop="projectId"> |
| | | <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="disabledFlagBySettlement || crud.status.edit == crudStatusPrepared" @change="formProjectChange"> |
| | | <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" @change="formProjectChange"> |
| | | <el-option |
| | | v-for="item in formProjects" |
| | | :key="item.id" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="所属任务" prop="taskId"> |
| | | <el-select v-model="form.taskId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="disabledFlagBySettlement" @change="formTaskChange"> |
| | | <el-select v-model="form.taskId" filterable clearable placeholder="请选择" style="width: 340px;" @change="formTaskChange"> |
| | | <el-option |
| | | v-for="item in formTasks" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="分配任务" prop="taskUserId"> |
| | | <el-select v-model="form.taskUserMongo.id" filterable clearable placeholder="请选择" style="width: 340px;"> |
| | | <el-option |
| | | v-for="item in formTaskUserIds" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | |
| | | </el-form-item> |
| | | <el-form-item label="任务进度" prop="taskProgress"> |
| | | <el-input v-model="form.taskProgress" style="width: 340px;" :disabled="disabledFlagBySettlement"> |
| | | <template slot="prepend"><i class="i el-icon-search" @click="showInner" /></template> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | <el-button type="text" @click="crud.cancelCU">取消</el-button> |
| | | <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
| | | </div> |
| | | <el-dialog |
| | | width="30%" |
| | | title="日报详细" |
| | | :visible.sync="innerVisible" |
| | | append-to-body |
| | | > |
| | | <el-table ref="tableInner" v-loading="innerLoading" :data="innerData" size="small" style="width: 100%;"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="fillDate" label="填写日期" fixed="left" min-width="100px"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toDate(scope.row.fillDate) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskHours" label="分配工时" min-width="80px" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="consumedHours" label="消耗工时" min-width="80px" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskProgress" label="任务进度" min-width="80px"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.taskProgress }}% |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | <!--表格渲染--> |
| | | <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
| | |
| | | <el-tag>{{ scope.row.taskName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskUserMongo.name" label="分配任务" min-width="180px"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.taskUserMongo.name }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="consumedHours" label="消耗工时" min-width="80px" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskProgress" label="任务进度" min-width="80px"> |
| | | <template slot-scope="scope"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" min-width="140px" /> |
| | | <el-table-column prop="createTime" label="创建时间" min-width="140px" /> |
| | | <el-table-column v-if="checkPer(['admin','taskDaliy:edit','taskDaliy:del'])" label="操作" width="150px" align="center" fixed="right"> |
| | | <el-table-column v-if="checkPer(['admin','task:divide','task:edit','task:del'])" label="操作" width="180px" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | v-if="userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelGeneral || scope.row.userId == user.id" |
| | | :data="scope.row" |
| | | :permission="permission" |
| | | /> |
| | | <udOperation :data="scope.row" :permission="permission" /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | 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' |
| | | import crudTaskUser from '@/api/task/taskUser' |
| | | |
| | | const defaultForm = { id: null, projectId: null, taskId: null, userId: null, fillDate: null, consumedHours: null, alreadyConsumedHours: 0, taskHours: 0, consumedWorkload: null, consumedWorkloadUnit: null, taskProgress: null, settlementStatus: constant.SETTLEMENT_STATUS_UNSETTLED, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | const defaultForm = { id: null, projectId: null, taskId: null, taskUserMongo: {}, userId: null, fillDate: null, consumedHours: null, alreadyConsumedHours: 0, taskHours: 0, consumedWorkload: null, consumedWorkloadUnit: 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 }, |
| | |
| | | { required: true, message: '所属员工不能为空', trigger: 'change' } |
| | | ], |
| | | projectId: [ |
| | | { required: true, message: '所属项目不能为空', trigger: 'change' } |
| | | { required: true, message: '所属项目不能为空', trigger: 'blur' } |
| | | ], |
| | | taskId: [ |
| | | { required: true, message: '所属任务不能为空', trigger: 'change' } |
| | | { required: true, message: '所属任务不能为空', trigger: 'blur' } |
| | | ], |
| | | consumedHours: [ |
| | | { required: true, message: '消耗工时不能为空', trigger: 'blur' }, |
| | |
| | | queryTypeOptions: [ |
| | | { key: 'userId', display_name: '所属员工' }, |
| | | { key: 'projectId', display_name: '所属项目' }, |
| | | { key: 'taskId', display_name: '所属任务' } |
| | | { key: 'taskId', display_name: '所属任务' }, |
| | | { key: 'TaskUserName', display_name: '任务名称' } |
| | | ], |
| | | // 字典:标准工作量单位 |
| | | standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT, |
| | |
| | | formProjects: [], |
| | | // 表单任务列表 |
| | | formTasks: [], |
| | | // 三级任务 |
| | | formTaskUserIds: [], |
| | | // 表单禁用标记(结算状态) |
| | | disabledFlagBySettlement: false, |
| | | // 内侧弹出框 |
| | | innerVisible: false, |
| | | // 内侧数据 |
| | | innerData: [], |
| | | // 内侧数据加载 |
| | | innerLoading: false, |
| | | // 当前月份 |
| | | currentMonth: new Date(), |
| | | // 当前TAB |
| | | activeName: 'first' |
| | | activeName: 'first', |
| | | tobeOver: 'first', |
| | | tasking: '进行中任务', |
| | | tobeTask: '未着手任务', |
| | | tobeTasked: '临期任务' |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | const userRolesLevel = this.user.roles.map(({ level }) => level) |
| | | // 用户最大角色级别 |
| | | this.userRolesLevelMin = Math.min(...userRolesLevel) |
| | | // 获取用户 |
| | | this.getUser() |
| | | // 获取检索项目 |
| | | this.getQueryProject() |
| | | return true |
| | |
| | | handleClick(tab, event) { |
| | | console.log(tab, event) |
| | | }, |
| | | // 获取用户 |
| | | getUser() { |
| | | // 获取用户 |
| | | crudUser.getAll().then(res => { |
| | | // 用户列表 |
| | | this.users = res |
| | | }) |
| | | handleClickTobeTasked(tab, event) { |
| | | console.log(tab, event) |
| | | }, |
| | | // 获取检索项目 |
| | | getQueryProject() { |
| | |
| | | crudProject.getRelevant().then(res => { |
| | | // 检索项目列表 |
| | | this.queryProjects = res |
| | | this.formProjects = res |
| | | }) |
| | | }, |
| | | // 检索项目变更 |
| | |
| | | // 检索赋值 |
| | | this.$set(this.query, 'taskId', null) |
| | | // 判断检索项目是否为空 |
| | | if (this.query.projectId == null || this.query.projectId === '') { |
| | | if (this.query.projectId === null || this.query.projectId === '') { |
| | | // 检索任务列表 |
| | | this.queryTasks = [] |
| | | } else { |
| | |
| | | if (this.userRolesLevelMin !== this.roleLevelSuper && this.userRolesLevelMin !== this.roleLevelGeneral) { |
| | | // 表单赋值 |
| | | this.form.userId = this.user.id |
| | | this.form.userNickName = this.user.nickName |
| | | // 表单用户变更 |
| | | this.formUserChange() |
| | | this.formTaskChange() |
| | | } |
| | | }, |
| | | // 钩子:编辑 - 之前 |
| | | [CRUD.HOOK.beforeToEdit]() { |
| | | // 获取项目 |
| | | crudProject.getPartake({ taskUserId: this.form.userId, approveStatus: constant.APPROVE_STATUS_ACKNOWLEDGED }).then(res => { |
| | | // 表单项目列表 |
| | | this.formProjects = res |
| | | }) |
| | | // 获取任务 |
| | | crudTask.getPartake({ taskUserId: this.form.userId, projectId: this.form.projectId }).then(res => { |
| | | // 表单任务列表 |
| | | crudTask.getAll({ projectId: this.form.projectId }).then(res => { |
| | | // 检索任务列表 |
| | | this.formTasks = res |
| | | // 表单任务变更 |
| | | this.formTaskChange() |
| | | }) |
| | | |
| | | crudTaskUser.getAll({ taskId: this.form.taskId }).then(res => { |
| | | if (res === []) { |
| | | this.formTaskUserIds = [] |
| | | } |
| | | this.formTaskUserIds = res |
| | | }) |
| | | }, |
| | | // 表单用户变更 |
| | |
| | | this.formTasks = [] |
| | | } else { |
| | | // 获取任务 |
| | | crudTask.getPartake({ taskUserId: this.form.userId, projectId: this.form.projectId }).then(res => { |
| | | // 表单任务列表 |
| | | crudTask.getAll({ projectId: this.form.projectId }).then(res => { |
| | | // 检索任务列表 |
| | | this.formTasks = res |
| | | }) |
| | | } |
| | |
| | | for (let i = 0; i < this.formTasks.length; i++) { |
| | | // 判断是否为选中任务 |
| | | if (this.formTasks[i].id === this.form.taskId) { |
| | | // 表单赋值 |
| | | this.form.consumedWorkloadUnit = this.formTasks[i].planWorkloadUnit |
| | | break |
| | | crudTaskUser.getAll({ taskId: this.formTasks[i].id }).then(res => { |
| | | console.log(res) |
| | | if (res === []) { |
| | | this.formTaskUserIds = [] |
| | | } |
| | | this.formTaskUserIds = res |
| | | }) |
| | | } |
| | | // 判断循环是否结束 |
| | | if (i === this.formTasks.length - 1) { |
| | |
| | | this.form.consumedWorkloadUnit = null |
| | | } |
| | | } |
| | | // 查询任务的总消耗工时 |
| | | crudTaskDaliy.taskTotalConsumedHours({ userId: this.form.userId, projectId: this.form.projectId, taskId: this.form.taskId }).then(res => { |
| | | // 表单赋值 |
| | | this.form.alreadyConsumedHours = res |
| | | }) |
| | | // 查询任务分配 |
| | | crudTaskUser.getAll({ userId: this.form.userId, projectId: this.form.projectId, taskId: this.form.taskId }).then(res => { |
| | | // 表单赋值 |
| | | this.form.taskHours = res[0].taskHours |
| | | }) |
| | | }, |
| | | showInner() { |
| | | // 显示内部对话框 |
| | | this.innerVisible = true |
| | | this.innerLoading = true |
| | | crudTaskDaliy.getTaskDaliyWithHours({ userId: this.form.userId, projectId: this.form.projectId, taskId: this.form.taskId, page: 0, size: 5, sort: 'fillDate,desc' }).then(res => { |
| | | this.innerData = res.content |
| | | this.innerLoading = false |
| | | unPick(e) { |
| | | crudTaskUser.addTaskUser({ 'TaskId': e.id }).then(res => { |
| | | this.pickFlg = false |
| | | if (res === 1) { |
| | | this.$notify({ |
| | | title: '获取成功', |
| | | type: 'success', |
| | | duration: 2500 |
| | | }) |
| | | |
| | | this.crud.toQuery() |
| | | } else { |
| | | this.$notify({ |
| | | title: '获取失败', |
| | | type: 'error', |
| | | duration: 2500 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |