马宇豪
2023-04-25 0c0fa2483fd431104f6498e40fffd983d913dce2
src/views/experiment/project/index.vue
@@ -82,9 +82,11 @@
                        <el-table-column label="操作" width="250" fixed="right">
                            <template #default="scope">
                                <el-button size="small" text type="primary" :icon="View" @click="openProjectDialog('查看', scope.row)">查看</el-button>
                                <el-button size="small" text type="primary" :icon="Edit" @click="applyStart('申请开展', scope.row)">申请开展</el-button>
                                <el-button size="small" text type="primary" :icon="View" v-if="scope.row.stage == 4" @click="openReportDialog('查看',scope.row)">查看评估报告</el-button>
                                <el-button size="small" text type="primary" :icon="Edit" @click="applyStart('申请开展', scope.row)">转为已开展</el-button>
                                <el-button size="small" :disabled="scope.row.status == 2 ? true : false" text type="primary" :icon="Edit" @click="applyAccess( scope.row)">申请评估</el-button>
                                <el-button size="small" type="warning" v-if="scope.row.rectifyStatus == 1" text :icon="Edit" @click="openProjectDialog('整改', scope.row)">整改</el-button>
                                <el-button size="small" text type="danger" :icon="Delete" @click="onDelProject(scope.row)">删除</el-button>
                                <el-button size="small" text type="danger" :icon="Delete" :disabled="scope.row.stage !== 1" @click="onDelProject(scope.row)">删除</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
@@ -97,6 +99,7 @@
        <project-dialog ref="ProjectDialogRef" @refresh="getProjectData"></project-dialog>
<!--        <apply-start ref="ApplyStartRef"></apply-start>-->
        <test ref="ApplyStartRef" @refresh="getProjectData"></test>
        <report-dialog ref="ReportDialogRef"></report-dialog>
    </div>
</template>
@@ -106,13 +109,12 @@
import {ElMessage, ElMessageBox} from "element-plus";
import { View,Edit, Plus, Delete } from '@element-plus/icons-vue';
import {roomApi} from "/@/api/basic/room";
const ReportDialog = defineAsyncComponent(() => import('../../analyse/assessApply/components/reportDialog.vue'));
const ProjectDialog = defineAsyncComponent(() => import('./components/projectDialog.vue'));
const Test = defineAsyncComponent(() => import('./components/applyDialog.vue'))
const ProjectDialogRef = ref();
const ApplyStartRef = ref();
const ProjectDialogRef = ref()
const ApplyStartRef = ref()
const ReportDialogRef = ref()
const projectState = reactive<ProjectStateType>({
    projectData: [],
    searchQuery: {
@@ -152,10 +154,40 @@
    ProjectDialogRef.value.showProjectDialog(title, value, projectState.allRoomList);
};
const openReportDialog = (title: string,value: ProjectType) =>{
  ReportDialogRef.value.showReportDialog(title, value, projectState.allRoomList);
}
const applyStart = (title: string, value: ProjectType) => {
    ApplyStartRef.value.showApplyStartDialog(value);
};
const applyAccess = (val: ProjectType) => {
  ElMessageBox.confirm(`此操作将申请评估该实验:“${val.experimentName}”,是否继续?`, '提示', {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: 'warning'
  })
      .then(async () => {
        let res = await projectApi().accessProject([val.id]);
        if (res.data.code === 100) {
          ElMessage({
            type: 'success',
            duration: 2000,
            message: '申请成功'
          });
          await getProjectData();
        } else {
          ElMessage({
            type: 'warning',
            message: res.data.msg
          });
        }
      })
      .catch((error) => {
      });
}
const onDelProject = (val: ProjectType) => {
    ElMessageBox.confirm(`此操作将永久删除该实验:“${val.experimentName}”,是否继续?`, '提示', {
        confirmButtonText: '确认',