DESKTOP-6GG29MI\dell
2025-09-17 665ea1e3e9e674bcf36512b964667c5e71b76b8c
eladmin-web-master/src/views/task/taskUser/index.vue
@@ -339,17 +339,6 @@
              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>
@@ -786,7 +775,7 @@
  // 多选用户id
  userIds: [],
  // 用于新增用户时单选或多选
  selectType: 'single',
  selectType: 'single'
}
export default {
  name: 'TaskUser',
@@ -833,7 +822,6 @@
      taskTotal: {},
      taskDatas: [],
      taskLoading: false,
      downloadTemplateLoading: false,
      defaultProps: { children: 'nodes', label: 'name', isLeaf: 'leaf' },
      permission: {
        list: ['admin', 'taskUser:list'],
@@ -1241,7 +1229,7 @@
          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) + '项的任务结束时间格式不正确')
@@ -1304,17 +1292,23 @@
            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 = []
@@ -1511,19 +1505,6 @@
      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
      )
    }
  }
}