| | |
| | | style="margin-right: 6px;" |
| | | @click="toReviewTask()" |
| | | >新建复核</el-button> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.download" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-download" |
| | | style="margin-right: 6px;" |
| | | :loading="downloadTemplateLoading" |
| | | @click="downloadTemplate" |
| | | >下载模板</el-button> |
| | | </crudOperation> |
| | | <div> |
| | | <span> |
| | |
| | | // 多选用户id |
| | | userIds: [], |
| | | // 用于新增用户时单选或多选 |
| | | selectType: 'single', |
| | | selectType: 'single' |
| | | } |
| | | export default { |
| | | name: 'TaskUser', |
| | |
| | | taskTotal: {}, |
| | | taskDatas: [], |
| | | taskLoading: false, |
| | | downloadTemplateLoading: false, |
| | | defaultProps: { children: 'nodes', label: 'name', isLeaf: 'leaf' }, |
| | | permission: { |
| | | list: ['admin', 'taskUser:list'], |
| | |
| | | this.$message.warning('第' + (this.generateForm.indexOf(item) + 1) + '项的任务开始时间格式不正确') |
| | | return false |
| | | } |
| | | if ('任务结束时间' in newItem && Number.isFinite(newItem['任务结束时间'])) { |
| | | if ('任务结束时间' in newItem && Number.isFinite(newItem['任务结束时间'])) { |
| | | newItem['任务结束时间'] = formatExcelDate(newItem['任务结束时间']) |
| | | } else { |
| | | this.$message.warning('第' + (this.generateForm.indexOf(item) + 1) + '项的任务结束时间格式不正确') |
| | |
| | | this.generateForm = [] |
| | | return false |
| | | } |
| | | // 任务状态判断 |
| | | if (!( |
| | | item.taskStatus === constant.TASK_STATUS_NOT_STARTED || |
| | | item.taskStatus === constant.TASK_STATUS_IN_HAND || |
| | | item.taskStatus === constant.TASK_STATUS_TEST || |
| | | item.taskStatus === constant.TASK_STATUS_STOP || |
| | | item.taskStatus === constant.TASK_STATUS_UNRECOGNIZED || |
| | | item.taskStatus === constant.TASK_STATUS_COMPLETED |
| | | )) { |
| | | // 状态转换 |
| | | if (item.taskStatus === '未开始') { |
| | | item.taskStatus = constant.TASK_STATUS_NOT_STARTED |
| | | } else if (item.taskStatus === '进行中') { |
| | | item.taskStatus = constant.TASK_STATUS_IN_HAND |
| | | } else if (item.taskStatus === '待测试') { |
| | | item.taskStatus = constant.TASK_STATUS_TEST |
| | | } else if (item.taskStatus === '已暂停') { |
| | | item.taskStatus = constant.TASK_STATUS_STOP |
| | | } else if (item.taskStatus === '未承认') { |
| | | item.taskStatus = constant.TASK_STATUS_UNRECOGNIZED |
| | | } else if (item.taskStatus === '已完成') { |
| | | item.taskStatus = constant.TASK_STATUS_COMPLETED |
| | | } |
| | | if (item.taskStartDate > item.taskEndDate) { |
| | | this.$message({ |
| | | message: `第${i + 1}项的任务状态不正确`, |
| | | message: `第${i + 1}项的任务开始时间大于任务结束时间`, |
| | | type: 'warning' |
| | | }) |
| | | this.generateFormTwo = [] |
| | |
| | | const that = this |
| | | that.$set(that.form, 'userId', null) |
| | | that.$set(that.form, 'userIds', []) |
| | | }, |
| | | |
| | | // 下载模板 |
| | | downloadTemplate() { |
| | | const that = this |
| | | that.downloadTemplateLoading = true |
| | | that.crud.crudMethod.templateDownload().then(res => { |
| | | downloadFile(res, '任务分配模板', 'xlsx') |
| | | }).catch(e => { |
| | | that.$message.error(e.message) |
| | | }).finally( |
| | | that.downloadTemplateLoading = false |
| | | ) |
| | | } |
| | | } |
| | | } |