| | |
| | | <div class="head-container"> |
| | | <div> |
| | | <!-- 搜索 --> |
| | | <el-select v-model="curProject" value-key="id" filterable placeholder="所属项目" style="width: 400px;" class="filter-item" @change="queryByProjectId"> |
| | | <el-select v-model="curProject" value-key="id" clearable filterable placeholder="所属项目" style="width: 400px;" class="filter-item" @change="queryByProjectId"> |
| | | <el-option |
| | | v-for="item in projects" |
| | | :key="item.id" |
| | |
| | | </el-select> |
| | | <div class="block"> |
| | | <el-cascader |
| | | v-model="query.userIds" |
| | | v-model="queryUser" |
| | | :filterable="true" |
| | | :options="options" |
| | | :props="props" |
| | | clearable |
| | | placeholder="任务负责人" |
| | | :show-all-levels="false" |
| | |
| | | :disabled="taskDetailDisabled" |
| | | @click="draw" |
| | | >任务详情</el-button> |
| | | <el-button |
| | | slot="right" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | :disabled="this.crud.selections.length === 0" |
| | | @click="doTaskCompleted" |
| | | >任务完结</el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="任务状态" v-if="isShow"> |
| | | <el-form-item v-if="isShow" label="任务状态"> |
| | | <el-select v-model="form.taskStatus" filterable clearable placeholder="请选择" style="width: 340px;"> |
| | | <el-option |
| | | v-for="item in filteredDict" |
| | |
| | | <el-date-picker v-model="form.planEndTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" :picker-options="planEndTimePickerOptions" style="width: 340px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="计划工作量" prop="planWorkload"> |
| | | <el-input v-model="form.planWorkload" style="width: 340px;"> |
| | | </el-input> |
| | | <el-input v-model="form.planWorkload" style="width: 340px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="计划工作量单位"> |
| | | <el-select v-model="form.planWorkloadUnit" filterable clearable placeholder="请选择" style="width: 340px;"> |
| | |
| | | <el-select v-if="form.containUserList" v-model="form.userIdList" :no-data-text=" '没有任务成员' " multiple filterable clearable placeholder="请选择" style="width: 340px;"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-show="form.containUserList != undefined && form.containUserList.some(animal => animal === item.id)" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | </el-dialog> |
| | | <!--表格渲染--> |
| | | <el-table |
| | | ref="table" |
| | | v-loading="crud.loading" |
| | | :data="crud.data" |
| | | size="small" |
| | |
| | | @row-click="getTaskUser" |
| | | > |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="projectName" label="项目" fixed="left" width="180" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="name" label="名称" fixed="left" width="180" /> |
| | | <el-table-column :show-overflow-tooltip="true" label="计划工时" width="80"> |
| | | <template slot-scope="scope"> |
| | |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskStatus" label="任务状态" width="80"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label[taskStatus][scope.row.taskStatus] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" label="消耗工时" width="80"> |
| | | <template slot-scope="scope"> |
| | | <el-tag v-if="scope.row.consumedHours > scope.row.sumPlanHours" type="info">{{ scope.row.consumedHours }}</el-tag> |
| | | <el-tag v-else type="error">{{ scope.row.consumedHours }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="performanceType" label="绩效类型" width="80"> |
| | |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="tagList" label="任务负责人" width="240"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="userIdList" label="任务负责人" width="240"> |
| | | <template slot-scope="scope"> |
| | | <el-tag v-for="userId in scope.row.userIdList" :key="userId">{{ getUserNameById(userId) }}</el-tag> |
| | | </template> |
| | |
| | | isShow: false |
| | | } |
| | | }, |
| | | computed: { |
| | | filteredDict() { |
| | | return this.dict[this.taskStatus] |
| | | } |
| | | }, |
| | | watch: { |
| | | 'selectedValue': function(newVal) { |
| | | this.form.containUserList = [] |
| | |
| | | } |
| | | }, |
| | | 'queryUser': function(newVal) { |
| | | // this.query.userId = newVal[newVal.length - 1] |
| | | this.query.userIds = [] |
| | | for (let i = 0; i < newVal.length; i++) { |
| | | var temp = [] |
| | | temp = newVal[i] |
| | | if (!this.query.userIds.includes(temp[newVal[i].length - 1])) { |
| | | // 如果不在 |
| | | this.query.userIds.push(temp[newVal[i].length - 1]) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.crud.optShow.reset = false |
| | | }, |
| | | computed: { |
| | | filteredDict() { |
| | | return this.dict[this.taskStatus].filter(item => item.value !== 'task_status_unrecognized'); |
| | | } |
| | | }, |
| | | mounted() { |
| | | // 获取项目 |
| | |
| | | }, |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | if (!this.crud.query.projectId) { |
| | | return false |
| | | } |
| | | // if (!this.crud.query.projectId) { |
| | | // return false |
| | | // } |
| | | // 用户角色级别数组 |
| | | const userRolesLevel = this.$store.state.user.user.roles.map(({ level }) => level) |
| | | // 用户最大角色级别 |
| | | this.userRolesLevelMin = Math.min(...userRolesLevel) |
| | | |
| | | return true |
| | | }, |
| | | [CRUD.HOOK.beforeToEdit]() { |
| | | crudUser.getUserPidDept(this.form.containUserList).then(res => { |
| | | this.selectedValue = res |
| | | }) |
| | | }, |
| | | [CRUD.HOOK.beforeSubmit]() { |
| | | if (!this.form.taskStatus) { |
| | |
| | | // 编辑之前 |
| | | [CRUD.HOOK.beforeToEdit]() { |
| | | this.isShow = true |
| | | crudUser.getUserPidDept(this.form.containUserList).then(res => { |
| | | this.selectedValue = res |
| | | }) |
| | | }, |
| | | doTaskCompleted() { |
| | | const selectData = this.$refs.table.selection |
| | | var changesId = [] |
| | | for (var i = 0; i < selectData.length; i++) { |
| | | changesId.push(selectData[i].id) |
| | | } |
| | | crudTask.changeStatus(changesId).then(res => { |
| | | this.crud.toQuery() |
| | | this.$notify.success({ |
| | | title: '任务关闭成功' |
| | | }) |
| | | }) |
| | | }, |
| | | // 日期点击 |
| | | handleDateClick(selectInfo) { |
| | | console.log('handleDateClick.info:', selectInfo) |
| | | }, |
| | | handleEventClick(info) { |
| | | if (info.event._def.extendedProps.type === 1) { |
| | |
| | | return obj |
| | | }) |
| | | setTimeout(() => { |
| | | console.log(this.calendarOptions.events) |
| | | }, 1000) |
| | | }) |
| | | }, |
| | | queryByProjectId(project) { |
| | | this.crud.resetQuery(false) |
| | | this.crud.query.projectId = project.id |
| | | this.crud.query.flag = project.flag |
| | | // this.crud.resetQuery(false) |
| | | if (project) { |
| | | this.crud.query.projectId = project.id |
| | | this.crud.query.flag = project.flag |
| | | } else { |
| | | this.crud.query.projectId = undefined |
| | | this.crud.query.flag = undefined |
| | | } |
| | | this.query.taskStatuses = ['task_status_not_started', 'task_status_in_hand', 'task_status_test', 'task_status_stop', 'task_status_unrecognized'] |
| | | this.crud.toQuery() |
| | | this.getProjectTotal() |
| | | }, |
| | |
| | | }, |
| | | handleInputConfirm() { |
| | | const inputValue = this.inputValue |
| | | console.log(inputValue) |
| | | if (inputValue !== '' && inputValue !== null && inputValue !== ' ') { |
| | | this.form.tagList.push(inputValue) |
| | | } |