13404089107
2025-05-21 68b080ca87281509c0658ff83c3a94162a1ef656
对接接口
4个文件已添加
9个文件已修改
1605 ■■■■ 已修改文件
laboratory/src/router/index.js 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/feasibilityReport/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/feasibilityStudy/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/processDevelopment/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/processDevelopment/service.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/projectProposalLibrary/add.vue 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/projectProposalLibrary/components/approval/index.vue 166 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/projectProposalLibrary/index.vue 259 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/projectProposalLibrary/service.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/verificationRelease/add.vue 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/verificationRelease/components/approval/index.vue 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/verificationRelease/index.vue 262 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/verificationRelease/service.js 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/router/index.js
@@ -23,8 +23,7 @@
    }
 */
const routes = [
    {
const routes = [{
        path: "/",
        redirect: "/login",
    },
@@ -43,8 +42,7 @@
            title: "系统管理",
        },
        component: Layouts,
        children: [
            {
        children: [{
                path: "user",
                name: "User",
                meta: {
@@ -102,8 +100,7 @@
            title: "项目组管理",
        },
        component: Layouts,
        children: [
            {
        children: [{
                path: "list",
                name: "ProjectList",
                meta: {
@@ -147,8 +144,7 @@
        meta: {
            title: "实验室数据管理",
        },
        children: [
            {
        children: [{
                path: "approvalPlan",
                meta: {
                    title: "项目课题方案审批",
@@ -232,8 +228,7 @@
                    // keepAlive: true,
                },
                component: Parent,
                children: [
                    {
                children: [{
                        path: "manage",
                        meta: {
                            title: "样品管理",
@@ -376,8 +371,7 @@
        meta: {
            title: "专业报告库审批",
        },
        children: [
            {
        children: [{
                path: "feasibilityStudy",
                meta: {
                    title: "可研报告库",
@@ -471,12 +465,48 @@
                component: () => import("../views/reportLibrary/verificationRelease/index.vue"),
            },
            {
                path: "addVerificationRelease",
                meta: {
                    title: "新增验证与发布",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/reportLibrary/verificationRelease/add.vue"),
            },
            {
                path: "editVerificationRelease",
                meta: {
                    title: "新增验证与发布",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/reportLibrary/verificationRelease/add.vue"),
            },
            {
                path: "projectProposalLibrary",
                meta: {
                    title: "立项报告库",
                    keepAlive: true,
                },
                component: () => import("../views/reportLibrary/projectProposalLibrary/index.vue"),
            },
            {
                path: "addProjectProposalLibrary",
                meta: {
                    title: "新增立项报告",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/reportLibrary/projectProposalLibrary/add.vue"),
            },
            {
                path: "editProjectProposalLibrary",
                meta: {
                    title: "编辑立项报告",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/reportLibrary/projectProposalLibrary/add.vue"),
            },
        ],
    },
@@ -486,8 +516,7 @@
        meta: {
            title: "化验师QA专题报告",
        },
        children: [
            {
        children: [{
                path: "projectTesting",
                meta: {
                    title: "项目检测项、检验包列表",
@@ -572,8 +601,7 @@
        meta: {
            title: "工作交付评定",
        },
        children: [
            {
        children: [{
                path: "projectTeamIntegral",
                meta: {
                    title: "项目组总积分",
laboratory/src/views/reportLibrary/feasibilityReport/index.vue
@@ -30,8 +30,10 @@
                    <el-form-item label="状态:">
                        <el-select v-model="form.status" placeholder="请选择">
                            <el-option label="待审核" value="1"></el-option>
                            <el-option label="已通过" value="0"></el-option>
                            <el-option label="已驳回" value="2"></el-option>
                            <el-option label="待评定" value="2"></el-option>
                            <el-option label="已驳回" value="4"></el-option>
                            <el-option label="已评定" value="3"></el-option>
                            <el-option label="已撤回" value="5"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" style="margin-left: 63px;">
@@ -175,7 +177,7 @@
        handleRevoke(row) {
            this.rowId = row.id
            this.changeStatusTitle = '确认要撤销审批吗?'
            this.changeStatusTip = '撤销审批后,可研报告将被撤销。'
            this.changeStatusTip = '撤销审批后,可行报告将被撤销。'
            this.changeStatus = true
        },
        handleDelConfirm() {
laboratory/src/views/reportLibrary/feasibilityStudy/index.vue
@@ -30,8 +30,10 @@
                    <el-form-item label="状态:">
                        <el-select v-model="form.status" placeholder="请选择">
                            <el-option label="待审核" value="1"></el-option>
                            <el-option label="已通过" value="0"></el-option>
                            <el-option label="已驳回" value="2"></el-option>
                            <el-option label="待评定" value="2"></el-option>
                            <el-option label="已驳回" value="4"></el-option>
                            <el-option label="已评定" value="3"></el-option>
                            <el-option label="已撤回" value="5"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" style="margin-left: 63px;">
laboratory/src/views/reportLibrary/processDevelopment/index.vue
@@ -30,8 +30,10 @@
                    <el-form-item label="状态:">
                        <el-select v-model="form.status" placeholder="请选择">
                            <el-option label="待审核" value="1"></el-option>
                            <el-option label="已通过" value="0"></el-option>
                            <el-option label="已驳回" value="2"></el-option>
                            <el-option label="待评定" value="2"></el-option>
                            <el-option label="已驳回" value="4"></el-option>
                            <el-option label="已评定" value="3"></el-option>
                            <el-option label="已撤回" value="5"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" style="margin-left: 63px;">
@@ -148,14 +150,14 @@
        },
        handleEdit(row) {
            this.$router.push({
                path: '/reportLibrary/edit',
                path: '/reportLibrary/editProcessDevelopment',
                query: {
                    id: row.id
                }
            })
        },
        handleAddProject() {
            this.$router.push('/reportLibrary/add')
            this.$router.push('/reportLibrary/addProcessDevelopment')
        },
        changeTab(status) {
            if (status == -1) {
@@ -175,7 +177,7 @@
        handleRevoke(row) {
            this.rowId = row.id
            this.changeStatusTitle = '确认要撤销审批吗?'
            this.changeStatusTip = '撤销审批后,可研报告将被撤销。'
            this.changeStatusTip = '撤销审批后,工艺开发工具将被撤销。'
            this.changeStatus = true
        },
        handleDelConfirm() {
laboratory/src/views/reportLibrary/processDevelopment/service.js
@@ -7,6 +7,7 @@
// 添加
export function addData(data) {
  return axios.post('/api/t-feasibility-study-report/add', { ...data })
}
laboratory/src/views/reportLibrary/projectProposalLibrary/add.vue
New file
@@ -0,0 +1,278 @@
<template>
    <div class="add-container" :loading="loading">
        <Card v-loading="loading">
            <div class="header-title" style="width: 100%;">
                <div class="header-title-left">
                    <img src="@/assets/public/headercard.png" />
                    <div>所属项目组</div>
                </div>
                <div class="header-title-right">
                    <el-button @click="showChoose = true" class="el-icon-circle-plus-outline" type="primary">
                        选择项目组</el-button>
                </div>
            </div>
            <Table :height="null" :data="tableData" :queryForm="queryForm" :total="0">
                <template>
                    <el-table-column prop="teamName" label="项目组名称" />
                    <el-table-column prop="personCharge" label="项目负责人" />
                    <el-table-column prop="staffName" label="项目组成员" />
                    <el-table-column prop="createTime" label="创建时间" />
                </template>
            </Table>
            <el-form ref="form" :model="form" :rules="rules" inline label-position="top" style="margin-top: 38px">
                <div class="header-title" style="width: 100%;">
                    <div class="header-title-left">
                        <img src="@/assets/public/headercard.png" />
                        <div>报告编号</div>
                    </div>
                </div>
                <el-form-item prop="reportCode" style="margin-top: 38px">
                    <el-input v-model="form.reportCode" style="width: 100%;" placeholder="请输入报告编号" />
                </el-form-item>
                <div class="header-title" style="width: 100%;">
                    <div class="header-title-left">
                        <img src="@/assets/public/headercard.png" />
                        <div>报告名称</div>
                    </div>
                </div>
                <el-form-item prop="reportName" style="margin-top: 38px">
                    <el-input v-model="form.reportName" style="width: 100%;" placeholder="请输入报告名称" />
                </el-form-item>
                <div class="header-title" style="width: 100%;">
                    <div class="header-title-left">
                        <img src="@/assets/public/headercard.png" />
                        <div>报告正文</div>
                    </div>
                </div>
                <el-form-item prop="reportText" style="margin-top: 38px">
                    <ai-editor ref="materialEditor" :value="form.reportText" style="width: 100%;"
                        placeholder="请输入报告正文" />
                </el-form-item>
                <div class="header-title" style="width: 100%;">
                    <div class="header-title-left">
                        <img src="@/assets/public/headercard.png" />
                        <div class="noRequire">附件</div>
                    </div>
                </div>
                <el-form-item prop="name" style="margin-top: 38px">
                    <el-upload action="https://jsonplaceholder.typicode.com/posts/" :file-list="fileList">
                        <el-button size="small" type="primary">点击上传</el-button>
                    </el-upload>
                </el-form-item>
                <div class="end-btn" style="margin-top: 38px">
                    <el-button type="primary" @click="submit" :loading="loading">发送</el-button>
                    <el-button type="default" @click="save" :loading="loading">存草稿</el-button>
                </div>
            </el-form>
        </Card>
        <chooseProject @submit="getProjectData" :show="showChoose" @close="showChoose = false"></chooseProject>
    </div>
</template>
<script>
import { Card } from 'element-ui';
import AiEditor from '@/components/AiEditor'
import chooseProject from '@/components/chooseProject'
import { addData, getDetail, editData } from './service'
export default {
    components: {
        AiEditor,
        chooseProject
    },
    data() {
        return {
            loading: false,
            form: {
                reportCode: "",
                reportName: "",
                reportText: ""
            },
            tableData: [],
            fileList: [], // 附件列表
            showChoose: false,
            rules: {
                reportCode: [
                    { required: true, message: '请输入报告编号', trigger: 'blur' }
                ],
                reportName: [
                    { required: true, message: '请输入报告名称', trigger: 'blur' }
                ],
            },
            queryForm: {}
        }
    },
    mounted() {
        if (this.$route.query.id) {
            this.getDetail()
        }
    },
    methods: {
        getDetail() {
            getDetail(this.$route.query.id).then(res => {
                this.form = res
                this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                this.fileList = res.fileList
            })
        },
        //获取选择项目组数据
        getProjectData(data) {
            this.tableData = [data]
            this.$forceUpdate()
            this.showChoose = false
        },
        submit() {
            console.log(this.$refs.materialEditor.getContent());
            if (this.tableData.length == 0) {
                this.$message.error('请选择项目组')
                return
            }
            this.$refs.form.validate((valid) => {
                if (this.$refs.materialEditor.getContent() == '<p></p>') {
                    this.$message.error('请输入报告正文')
                    return
                }
                let data = {
                    ...this.form,
                    status: 1,
                    reportText: this.$refs.materialEditor.getContent(),
                    teamId: this.tableData[0].id
                }
                if (valid) {
                    this.loading = true
                    if (this.$route.query.id) {
                        editData({ ...data, id: this.$route.query.id }).then(res => {
                            if (res.code === 200) {
                                this.$message.success('修改成功')
                                this.$router.back()
                            } else {
                                this.$message.error(res.message)
                            }
                        })
                    } else {
                        addData({ ...data }).then(res => {
                            if (res.code === 200) {
                                this.$message.success('发布成功')
                                this.$router.back()
                            } else {
                                this.$message.error(res.message)
                            }
                        }).finally(() => {
                            this.loading = false
                        })
                    }
                }
            })
        },
        save() {
            this.$refs.form.validate((valid) => {
                let data = {
                    ...this.form,
                    status: -1,
                    reportText: this.$refs.materialEditor.getContent(),
                    teamId: this.tableData[0].id
                }
                delete data.id
                if (valid) {
                    this.loading = true
                    addData({ ...data }).then(res => {
                        if (res.code === 200) {
                            this.$message.success('提交成功')
                            this.$router.back()
                        } else {
                            this.$message.error(res.message)
                        }
                    }).finally(() => {
                        this.loading = false
                    })
                }
            })
        },
    },
}
</script>
<style lang="less" scoped>
.header-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 13px;
    .header-title-left {
        display: flex;
        align-items: center;
        gap: 13px;
        margin-top: 38px;
        img {
            width: 12px;
            height: 19px;
        }
        div {
            flex-shrink: 0;
            font-weight: bold;
            font-size: 18px;
            color: #222222;
            line-height: 27px;
            font-family: "Source Han Sans CN Bold Bold";
            &:before {
                content: "*";
                color: #f56c6c;
                margin-right: 4px;
            }
        }
        .noRequire:before {
            content: unset;
            // color: #f56c6c;
            // margin-right: 4px;
        }
        span {
            flex-shrink: 0;
            font-weight: bold;
            font-size: 18px;
            color: #222222;
            line-height: 27px;
            font-family: "Source Han Sans CN Bold Bold";
        }
    }
    .header-title-left :first-child {
        margin-top: 0;
    }
}
.header-title:first-child {
    .header-title-left {
        margin-top: 0;
    }
}
.end-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    button {
        width: 180px;
        height: 36px;
        // background: #409EFF;
    }
}
</style>
laboratory/src/views/reportLibrary/projectProposalLibrary/components/approval/index.vue
@@ -1,7 +1,7 @@
<template>
    <el-dialog :title="dialogTitle"  :visible.sync="visible" width="80%" po :close-on-click-modal="false"
    <el-dialog :title="dialogTitle" :visible.sync="visible" width="80%" @open="open" po :close-on-click-modal="false"
        @close="handleClose">
        <div class="approval-dialog">
        <div class="approval-dialog" :style="{height: obj.isDetail ? '50vh' : '40vh'}">
            <!-- 左侧审批内容 -->
            <div class="approval-content">
                <Card class="approval-content-card">
@@ -12,13 +12,12 @@
                                <div>所属项目组</div>
                            </div>
                        </div>
                        <Table :height="null" :queryForm="queryForm" :total="0" @currentChange="handleCurrentChange"
                            @sizeChange="handleSizeChange">
                        <Table :height="null" :total="0" :data="tableData">
                            <template>
                                <el-table-column prop="name" label="项目组名称" />
                                <el-table-column prop="age" label="项目负责人" />
                                <el-table-column prop="age" label="项目组成员" />
                                <el-table-column prop="age" label="创建时间" />
                                <el-table-column prop="teamName" label="项目组名称" />
                                <el-table-column prop="personCharge" label="项目负责人" />
                                <el-table-column prop="staffName" label="项目组成员" />
                                <el-table-column prop="createTime" label="创建时间" />
                            </template>
                        </Table>
@@ -31,9 +30,10 @@
                                    <div>报告编号</div>
                                </div>
                            </div>
                            <form-item prop="name" style="margin-top: 38px">
                                <el-input v-model="form.name" style="width: 100%;" placeholder="请输入报告编号" />
                            </form-item>
                            <el-form-item prop="reportCode" style="margin-top: 38px">
                                <el-input disabled v-model="form.reportCode" style="width: 100%;"
                                    placeholder="请输入报告编号" />
                            </el-form-item>
                            <div class="header-title" style="width: 100%;">
                                <div class="header-title-left">
@@ -41,9 +41,10 @@
                                    <div>报告名称</div>
                                </div>
                            </div>
                            <form-item prop="name" style="margin-top: 38px">
                                <el-input v-model="form.name" style="width: 100%;" placeholder="请输入报告编号" />
                            </form-item>
                            <el-form-item prop="reportName" style="margin-top: 38px">
                                <el-input disabled v-model="form.reportName" style="width: 100%;"
                                    placeholder="请输入报告名称" />
                            </el-form-item>
                            <div class="header-title" style="width: 100%;">
                                <div class="header-title-left">
@@ -51,9 +52,10 @@
                                    <div>报告正文</div>
                                </div>
                            </div>
                            <form-item prop="name" style="margin-top: 38px">
                                <ai-editor v-model="form.name" style="width: 100%;" placeholder="请输入报告编号" />
                            </form-item>
                            <el-form-item prop="reportText" style="margin-top: 38px">
                                <ai-editor :readOnly="true" :value="form.reportText" style="width: 100%;"
                                    placeholder="请输入报告正文" />
                            </el-form-item>
                        </el-form>
                    </template>
@@ -63,21 +65,20 @@
            <!-- 右侧审批流程 -->
            <div class="approval-flow">
                <div class="flow-content">
                    <approval-process :status="form.status" :submit-time="form.createTime" :approver="form.approver"
                        :approve-time="form.approveTime" />
                    <approval-process :processData="form.processData" />
                </div>
            </div>
        </div>
        <div class="approval-dialog-approve">
        <div class="approval-dialog-approve" v-if="!obj.isDetail">
            <el-row :span="24">
                <el-col :span="12">
                    <div class="status">
                        <div class="status-title">审批结果</div>
                        <div class="status-content">
                            <div class="resolve" :class="status == '1' && 'activeStatus'" @click.stop="status = 1">
                            <div class="resolve" :class="status == '2' && 'activeStatus'" @click.stop="status = 2">
                                通过
                            </div>
                            <div class="reject" :class="status == '2' && 'activeStatus'" @click.stop="status = 2">
                            <div class="reject" :class="status == '3' && 'activeStatus'" @click.stop="status = 3">
                                驳回
                            </div>
                        </div>
@@ -94,8 +95,8 @@
        </div>
        <div slot="footer" class="dialog-footer">
            <el-button @click="handleClose" >取 消</el-button>
            <el-button type="primary" @click="handleApprove" v-if="type === 'approve'">通过</el-button>
            <el-button @click="handleClose">{{obj.isDetail ? '关闭' : '取 消'}}</el-button>
            <el-button type="primary" @click="handleApprove" v-if="!obj.isDetail">通过</el-button>
        </div>
    </el-dialog>
</template>
@@ -103,6 +104,8 @@
<script>
import ApprovalProcess from '@/components/approvalProcess'
import AiEditor from '@/components/AiEditor'
import { getDetail } from '../../service';
export default {
    name: "ApprovalDialog",
@@ -119,27 +122,33 @@
            type: String,
            default: "approve", // approve-审批,view-查看
        },
        data: {
        obj: {
            type: Object,
            default: () => ({}),
            default: () => { },
        },
    },
    data() {
        return {
            form: {
                planName: "",
                planCode: "",
                stage: "",
                creator: "",
                reportCode: "",
                reportName: "",
                reportText: "",
                teamName: "",
                createBy: "",
                createTime: "",
                status: "",
                approvalComment: "",
                status: "pending",
                approver: "",
                approveTime: ""
                approveTime: "",
                processData: [],
                updateBy: "",
                auditRemark: "",
                auditPersonName: "",
                auditTime: ""
            },
            radio1: 1,
            tableData: [],
            rules: {},
            status: "1",
            status: "2",
            remark: "",
        };
    },
@@ -148,40 +157,81 @@
            return this.type === "approve" ? "审批" : "审批详情";
        },
    },
    watch: {
        data: {
            handler(val) {
                if (val) {
                    this.form = { ...val };
                }
            },
            immediate: true,
        },
    },
    methods: {
        open() {
            if (!this.obj.id) {
                this.$message.error('缺少必要参数');
                return;
            }
            getDetail(this.obj.id).then(res => {
                const data = res.data || res;
                this.form = {
                    ...this.form,
                    ...data,
                    processData: []
                };
                this.tableData = data.projectTeam ?
                    [{ ...data.projectTeam, staffName: data.staffNames || '' }] :
                    [];
                let processData = [];
                // 提交节点
                processData.push({
                    type: "primary",
                    mode: "list",
                    fields: [
                        { label: "提交人:", value: data.updateBy || "" },
                        { label: "提交时间:", value: data.createTime || "" },
                    ]
                });
                if (data.status == 2 || data.status == 3) {
                    processData.push({
                        type: data.status === 2 ? "primary" : "danger",
                        mode: "list",
                        fields: [
                            { label: "审批意见:", value: data.auditRemark || "" },
                            { label: "审核人:", value: data.auditPersonName || "" },
                            { label: "审核时间:", value: data.auditTime || "" },
                        ]
                    });
                } else {
                    processData.push({
                        type: "warning",
                        mode: "list",
                        fields: [
                            { label: "等待审核" },
                        ],
                    });
                }
                this.form.processData = processData;
            }).catch(err => {
                this.$message.error('获取详情失败');
            });
        },
        handleClose() {
            this.$emit("close");
            this.form.approvalComment = "";
        },
        handleApprove() {
            if (!this.form.approvalComment) {
                this.$message.warning("请输入审批意见");
                return;
            }
            this.$emit("approve", {
                ...this.form,
                status: "approved",
                statuss: this.status,
                remark: this.remark
            });
        },
        handleReject() {
            if (!this.form.approvalComment) {
                this.$message.warning("请输入审批意见");
                return;
            }
            this.$emit("reject", {
                ...this.form,
                status: "rejected",
            });
        handleCurrentChange(page) {
            this.form.pageNum = page
            this.getList()
        },
        handleSizeChange(size) {
            this.form.pageSize = size
            this.getList()
        },
    },
};
laboratory/src/views/reportLibrary/projectProposalLibrary/index.vue
@@ -1,14 +1,27 @@
<template>
    <div class="list">
        <TableCustom :queryForm="queryForm" :total="total" @currentChange="handleCurrentChange"
            @sizeChange="handleSizeChange">
        <el-card class="header-box" v-if="roleType == 3">
            <div class="box-title">
                <img src="@/assets/public/notice.png" class="header-icon"> <span>设立课题规则</span>
            </div>
            <div class="header-content">
                <p>1、根据可研报告、产品构思设计的工艺研究路线,一条工艺路线设立一个课题。如果一个课题中有多个化合物需要开发研究,则每个化合物作为一个分题;分题归集到该课题中,最终形成课题报告。不同课题报告中的分题不能重复使用。
                </p>
                <p>2、在可行研究阶段,工艺开发升级,重新规划工艺研究路线,则以新规划的工艺路线方案来设定课题。</p>
            </div>
        </el-card>
        <TableCustom :tableData="tableData" :height="null" :total="total" @handleCurrentChange="handleCurrentChanges"
            @handleSizeChange="handleSizeChanges">
            <template #search>
                <el-form :model="form" :label-width="auto" inline>
                <el-form :model="form" label-width="auto" inline>
                    <el-form-item label="所属项目组:">
                        <el-input v-model="form.name" placeholder="请输入"></el-input>
                        <el-input v-model="form.teamName" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item label="报告名称:">
                        <el-input v-model="form.name" placeholder="请输入"></el-input>
                        <el-input v-model="form.reportName" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item label="报告编号:">
                        <el-input v-model="form.reportCode" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item label="创建日期:">
                        <el-date-picker v-model="form.date" type="daterange" range-separator="至"
@@ -17,42 +30,62 @@
                    <el-form-item label="状态:">
                        <el-select v-model="form.status" placeholder="请选择">
                            <el-option label="待审核" value="1"></el-option>
                            <el-option label="已通过" value="0"></el-option>
                            <el-option label="已驳回" value="2"></el-option>
                            <el-option label="已通过" value="2"></el-option>
                            <el-option label="已驳回" value="3"></el-option>
                            <el-option label="已撤回" value="4"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" style="margin-left: 63px;">
                        <el-button type="default">重置</el-button>
                        <el-button type="default" style="margin-right: 10px;">重置</el-button>
                        <el-button type="primary">查询</el-button>
                    </el-form-item>
                </el-form>
            </template>
            <template #setting>
                <div class="table-title">
                <el-button v-if="roleType == 3" @click="handleAddProject" class="el-icon-plus" type="primary">
                    新增立项报告库</el-button>
                <div class="table-setting">
                    <div :class="!isDraft ? 'table-title' : 'table-tit'" @click="changeTab('')">
                    立项报告库
                </div>
                    <div v-if="roleType == 3" :class="!isDraft ? 'table-tit' : 'table-title'" @click="changeTab('-1')">
                        草稿箱
                    </div>
                </div>
            </template>
            <template #table>
                <el-table-column prop="name" label="所属项目组" />
                <el-table-column prop="age" label="报告编号" />
                <el-table-column prop="age" label="报告名称" />
                <el-table-column prop="age" label="创建人" />
                <el-table-column prop="age" label="创建时间" />
                <el-table-column prop="age" label="状态">
                <el-table-column prop="teamName" label="所属项目组" />
                <el-table-column prop="reportCode" label="报告编号" />
                <el-table-column prop="reportName" label="报告名称" />
                <el-table-column prop="createBy" label="创建人" />
                <el-table-column prop="createTime" label="创建时间" />
                <el-table-column prop="status" label="状态" v-if="!isDraft">
                    <template #default="{ row }">
                        <el-tag v-if="row.status == 1" type="success">待审核</el-tag>
                        <el-tag v-else-if="row.status == 0" type="success">已通过</el-tag>
                        <el-tag v-else type="danger">已驳回</el-tag>
                        <el-tag v-if="row.status == 1">待审核</el-tag>
                        <el-tag v-else-if="row.status == 3" type="danger">已驳回</el-tag>
                        <el-tag v-else-if="row.status == 2" type="success">已通过</el-tag>
                        <el-tag v-else-if="row.status == 4" type="info">已撤回</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="age" label="操作">
                <el-table-column prop="options" label="操作">
                    <template #default="{ row }">
                        <el-button type="text">审核</el-button>
                        <el-button type="text">详情</el-button>
                        <el-button type="text" @click="handleApproval(row)"
                            v-if="row.status == 1 && [1, 2].includes(roleType)">审核</el-button>
                        <el-button type="text" @click="handleDetail(row)">详情</el-button>
                        <el-button type="text" @click="handleDelete(row)"
                            v-if="[4, 5].includes(row.status) && roleType == 3">删除</el-button>
                        <el-button type="text" @click="handleEdit(row)"
                            v-if="[4, 5].includes(row.status) && roleType == 3">编辑</el-button>
                        <el-button type="text" @click="handleRevoke(row)"
                            v-if="row.status == 1 && roleType == 3">撤销审批</el-button>
                    </template>
                </el-table-column>
            </template>
        </TableCustom>
        <Approval :visible="showApproval" @close="showApproval = false" :obj="rowData" @approve="handleApprove" />
        <ShowDelConfirm :show="showDelConfirm" @close="showDelConfirm = false" @confirm="handleDelConfirm" />
        <ShowDelConfirm :title="changeStatusTitle" :tip="changeStatusTip" :show="changeStatus"
            @close="changeStatus = false" @confirm="handleChangeStatusConfirm" />
@@ -60,71 +93,209 @@
</template>
<script>
import Approval from './components/approval'
import { getDataList, audit, revokeAudit, deleteData } from './service'
export default {
    name: 'ProjectList',
    components: {
        Approval
    },
    data() {
        return {
            form: {
                name: ''
            },
            showDelConfirm: false,
            rowId: '',
            changeStatus: false,
            showApproval: false,
            changeStatusTitle: '',
            changeStatusTip: '',
            queryForm: {
            tableData: [],
            isDraft: false,
            rowData: {},
            roleType: '', // 1 超级管理员 2 审批人 3 工艺工程师 4化验师 5实验员
            form: {
                pageSize: 10,
                pageNum: 1
                pageNum: 1,
                teamName: '',
                status: '',
                startTime: '',
                reportName: '',
                reportCode: '',
                endTime: '',
                date: ''
            },
            total: 0
        }
    },
    mounted() {
        this.roleType = JSON.parse(sessionStorage.getItem('userInfo'))?.roleType
        this.getList()
    },
    methods: {
        handleAddProject() {
        handleApproval(row) {
            this.rowData = row
            this.showApproval = true
        },
        handleDetail(row) {
            row.isDetail = true
            this.rowData = row
            this.showApproval = true
        },
        handleEdit(row) {
            this.$router.push({
                path: '/projectList/addProject'
                path: '/reportLibrary/editProjectProposalLibrary',
                query: {
                    id: row.id
                }
            })
        },
        handleDel(row) {
        handleAddProject() {
            this.$router.push('/reportLibrary/addProjectProposalLibrary')
        },
        changeTab(status) {
            if (status == -1) {
                this.isDraft = true
                this.form.pageNum = 1
            } else {
                this.form.pageNum = 1
                this.isDraft = false
                this.form.status = status
            }
            this.getList()
        },
        handleDelete(row) {
            this.rowId = row.id
            this.showDelConfirm = true
        },
        handleDelConfirm() {
            this.showDelConfirm = false
            this.msgsuccess('删除成功')
            this.rowId = ''
            this.getList()
        },
        handleChangeStatus(row, status) {
        handleRevoke(row) {
            this.rowId = row.id
            this.changeStatusTitle = status == 1 ? '确认要封存这个项目组吗?' : '确认要解封该项目组吗?'
            this.changeStatusTip = status == 1 ? '封存后项目组内人员看不到数据,审批人仍然可见数据。' : '解封后项目组内人员数据恢复。'
            this.changeStatusTitle = '确认要撤销审批吗?'
            this.changeStatusTip = '撤销审批后,验证与发布将被撤销。'
            this.changeStatus = true
        },
        handleDelConfirm() {
            deleteData({ id: this.rowId }).then(res => {
                this.showDelConfirm = false
                this.$message.success('删除成功')
                this.rowId = ''
                this.getList()
            })
        },
        handleChangeStatusConfirm() {
            revokeAudit({ id: this.rowId }).then(res => {
            this.changeStatus = false
            this.msgsuccess('操作成功')
                this.$message.success('操作成功')
            this.rowId = ''
            this.changeStatusTitle = ''
            this.changeStatusTip = ''
            this.getList()
            })
        },
        handleCurrentChange(page) {
            this.queryForm.pageNum = page
        handleCurrentChanges(page) {
            this.form.pageNum = page
            this.getList()
        },
        handleSizeChange(size) {
            this.queryForm.pageSize = size
        handleSizeChanges(size) {
            this.form.pageSize = size
            this.getList()
        },
        getList() {
            let data = {}
            if (this.isDraft) {
                data = {
                    ...this.form,
                    status: -1
                }
            } else {
                data = this.form
            }
            getDataList(data).then(res => {
                if (res.code === 200) {
                    this.tableData = res.data.records || []
                    this.total = res.data.total || 0
                }
            })
        },
        handleApprove(data) {
            let params = {
                id: data.id,
                auditStatus: data.statuss,
                auditRemark: data.remark
            }
            audit({ ...params }).then(res => {
                if (res.code === 200) {
                    this.$message.success('审核成功')
                    this.showApproval = false
                    this.getList()
                }
            })
        }
    }
}
</script>
<style scoped lang="less">
.el-icon-plus {
    margin-bottom: 20px;
}
.header-content {
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.88);
    margin-left: 30px;
}
.box-title {
    font-family: SourceHanSansCN, SourceHanSansCN;
    font-weight: bold;
    font-size: 18px;
    color: #222222;
    line-height: 27px;
    display: flex;
    align-items: center;
}
.header-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}
.header-box {
    border-radius: 16px;
    margin-bottom: 30px;
}
.table-setting {
    display: flex;
    gap: 14px;
}
.table-tit {
    background: #FAFAFC;
    border-radius: 8px 8px 0px 0px;
    border: 1px solid #DCDFE6;
    width: 166px;
    height: 50px;
    background: #FFFFFF;
    border-radius: 8px 8px 0px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    // margin-bottom: 21px;
    font-family: SourceHanSansCN, SourceHanSansCN;
    font-weight: bold;
    font-size: 18px;
    color: #606266;
    line-height: 27px;
}
.list {
    height: 100%;
}
@@ -138,7 +309,7 @@
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 21px;
    // margin-bottom: 21px;
    font-family: SourceHanSansCN, SourceHanSansCN;
    font-weight: bold;
    font-size: 18px;
laboratory/src/views/reportLibrary/projectProposalLibrary/service.js
New file
@@ -0,0 +1,44 @@
import axios from '@/utils/request';
// 查询列表
export function getDataList(data) {
  console.log('data11111111', data);
  return axios.post('/api/t-project-approval-report/pageList', { ...data })
}
// 添加
export function addData(data) {
  console.log('data', data);
  return axios.post('/api/t-project-approval-report/add', { ...data })
}
//修改
export function editData(data) {
  return axios.post('/api/t-project-approval-report/update', { ...data })
}
//获取详情
export function getDetail(id) {
  return axios.get(`/open/t-project-approval-report/getDetailById?id=${id}`)
}
//审核
export function audit(data) {
  return axios.post('/api/t-project-approval-report/auditReport', { ...data })
}
//撤销审批
export function revokeAudit(data) {
  return axios.put(`/open/t-project-approval-report/revokedReport?id=${data.id}`)
}
//删除
export function deleteData(data) {
  return axios.delete(`/open/t-project-approval-report/deleteById?id=${data.id}`)
}
laboratory/src/views/reportLibrary/verificationRelease/add.vue
New file
@@ -0,0 +1,278 @@
<template>
    <div class="add-container" :loading="loading">
        <Card v-loading="loading">
            <div class="header-title" style="width: 100%;">
                <div class="header-title-left">
                    <img src="@/assets/public/headercard.png" />
                    <div>所属项目组</div>
                </div>
                <div class="header-title-right">
                    <el-button @click="showChoose = true" class="el-icon-circle-plus-outline" type="primary">
                        选择项目组</el-button>
                </div>
            </div>
            <Table :height="null" :data="tableData" :queryForm="queryForm" :total="0">
                <template>
                    <el-table-column prop="teamName" label="项目组名称" />
                    <el-table-column prop="personCharge" label="项目负责人" />
                    <el-table-column prop="staffName" label="项目组成员" />
                    <el-table-column prop="createTime" label="创建时间" />
                </template>
            </Table>
            <el-form ref="form" :model="form" :rules="rules" inline label-position="top" style="margin-top: 38px">
                <div class="header-title" style="width: 100%;">
                    <div class="header-title-left">
                        <img src="@/assets/public/headercard.png" />
                        <div>报告编号</div>
                    </div>
                </div>
                <el-form-item prop="reportCode" style="margin-top: 38px">
                    <el-input v-model="form.reportCode" style="width: 100%;" placeholder="请输入报告编号" />
                </el-form-item>
                <div class="header-title" style="width: 100%;">
                    <div class="header-title-left">
                        <img src="@/assets/public/headercard.png" />
                        <div>报告名称</div>
                    </div>
                </div>
                <el-form-item prop="reportName" style="margin-top: 38px">
                    <el-input v-model="form.reportName" style="width: 100%;" placeholder="请输入报告名称" />
                </el-form-item>
                <div class="header-title" style="width: 100%;">
                    <div class="header-title-left">
                        <img src="@/assets/public/headercard.png" />
                        <div>报告正文</div>
                    </div>
                </div>
                <el-form-item prop="reportText" style="margin-top: 38px">
                    <ai-editor ref="materialEditor" :value="form.reportText" style="width: 100%;"
                        placeholder="请输入报告正文" />
                </el-form-item>
                <div class="header-title" style="width: 100%;">
                    <div class="header-title-left">
                        <img src="@/assets/public/headercard.png" />
                        <div class="noRequire">附件</div>
                    </div>
                </div>
                <el-form-item prop="name" style="margin-top: 38px">
                    <el-upload action="https://jsonplaceholder.typicode.com/posts/" :file-list="fileList">
                        <el-button size="small" type="primary">点击上传</el-button>
                    </el-upload>
                </el-form-item>
                <div class="end-btn" style="margin-top: 38px">
                    <el-button type="primary" @click="submit" :loading="loading">发送</el-button>
                    <el-button type="default" @click="save" :loading="loading">存草稿</el-button>
                </div>
            </el-form>
        </Card>
        <chooseProject @submit="getProjectData" :show="showChoose" @close="showChoose = false"></chooseProject>
    </div>
</template>
<script>
import { Card } from 'element-ui';
import AiEditor from '@/components/AiEditor'
import chooseProject from '@/components/chooseProject'
import { addData, getDetail, editData } from './service'
export default {
    components: {
        AiEditor,
        chooseProject
    },
    data() {
        return {
            loading: false,
            form: {
                reportCode: "",
                reportName: "",
                reportText: ""
            },
            tableData: [],
            fileList: [], // 附件列表
            showChoose: false,
            rules: {
                reportCode: [
                    { required: true, message: '请输入报告编号', trigger: 'blur' }
                ],
                reportName: [
                    { required: true, message: '请输入报告名称', trigger: 'blur' }
                ],
            },
            queryForm: {}
        }
    },
    mounted() {
        if (this.$route.query.id) {
            this.getDetail()
        }
    },
    methods: {
        getDetail() {
            getDetail(this.$route.query.id).then(res => {
                this.form = res
                this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                this.fileList = res.fileList
            })
        },
        //获取选择项目组数据
        getProjectData(data) {
            this.tableData = [data]
            this.$forceUpdate()
            this.showChoose = false
        },
        submit() {
            console.log(this.$refs.materialEditor.getContent());
            if (this.tableData.length == 0) {
                this.$message.error('请选择项目组')
                return
            }
            this.$refs.form.validate((valid) => {
                if (this.$refs.materialEditor.getContent() == '<p></p>') {
                    this.$message.error('请输入报告正文')
                    return
                }
                let data = {
                    ...this.form,
                    status: 1,
                    reportText: this.$refs.materialEditor.getContent(),
                    teamId: this.tableData[0].id
                }
                if (valid) {
                    this.loading = true
                    if (this.$route.query.id) {
                        editData({ ...data, id: this.$route.query.id }).then(res => {
                            if (res.code === 200) {
                                this.$message.success('修改成功')
                                this.$router.back()
                            } else {
                                this.$message.error(res.message)
                            }
                        })
                    } else {
                        addData({ ...data }).then(res => {
                            if (res.code === 200) {
                                this.$message.success('发布成功')
                                this.$router.back()
                            } else {
                                this.$message.error(res.message)
                            }
                        }).finally(() => {
                            this.loading = false
                        })
                    }
                }
            })
        },
        save() {
            this.$refs.form.validate((valid) => {
                let data = {
                    ...this.form,
                    status: -1,
                    reportText: this.$refs.materialEditor.getContent(),
                    teamId: this.tableData[0].id
                }
                delete data.id
                if (valid) {
                    this.loading = true
                    addData({ ...data }).then(res => {
                        if (res.code === 200) {
                            this.$message.success('提交成功')
                            this.$router.back()
                        } else {
                            this.$message.error(res.message)
                        }
                    }).finally(() => {
                        this.loading = false
                    })
                }
            })
        },
    },
}
</script>
<style lang="less" scoped>
.header-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 13px;
    .header-title-left {
        display: flex;
        align-items: center;
        gap: 13px;
        margin-top: 38px;
        img {
            width: 12px;
            height: 19px;
        }
        div {
            flex-shrink: 0;
            font-weight: bold;
            font-size: 18px;
            color: #222222;
            line-height: 27px;
            font-family: "Source Han Sans CN Bold Bold";
            &:before {
                content: "*";
                color: #f56c6c;
                margin-right: 4px;
            }
        }
        .noRequire:before {
            content: unset;
            // color: #f56c6c;
            // margin-right: 4px;
        }
        span {
            flex-shrink: 0;
            font-weight: bold;
            font-size: 18px;
            color: #222222;
            line-height: 27px;
            font-family: "Source Han Sans CN Bold Bold";
        }
    }
    .header-title-left :first-child {
        margin-top: 0;
    }
}
.header-title:first-child {
    .header-title-left {
        margin-top: 0;
    }
}
.end-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    button {
        width: 180px;
        height: 36px;
        // background: #409EFF;
    }
}
</style>
laboratory/src/views/reportLibrary/verificationRelease/components/approval/index.vue
@@ -1,7 +1,7 @@
<template>
    <el-dialog :title="dialogTitle"  :visible.sync="visible" width="80%" po :close-on-click-modal="false"
    <el-dialog :title="dialogTitle" :visible.sync="visible" width="80%" @open="open" po :close-on-click-modal="false"
        @close="handleClose">
        <div class="approval-dialog">
        <div class="approval-dialog" :style="{height: obj.isDetail ? '50vh' : '40vh'}">
            <!-- 左侧审批内容 -->
            <div class="approval-content">
                <Card class="approval-content-card">
@@ -12,13 +12,12 @@
                                <div>所属项目组</div>
                            </div>
                        </div>
                        <Table :height="null" :queryForm="queryForm" :total="0" @currentChange="handleCurrentChange"
                            @sizeChange="handleSizeChange">
                        <Table :height="null" :total="0" :data="tableData">
                            <template>
                                <el-table-column prop="name" label="项目组名称" />
                                <el-table-column prop="age" label="项目负责人" />
                                <el-table-column prop="age" label="项目组成员" />
                                <el-table-column prop="age" label="创建时间" />
                                <el-table-column prop="teamName" label="项目组名称" />
                                <el-table-column prop="personCharge" label="项目负责人" />
                                <el-table-column prop="staffName" label="项目组成员" />
                                <el-table-column prop="createTime" label="创建时间" />
                            </template>
                        </Table>
@@ -31,9 +30,10 @@
                                    <div>报告编号</div>
                                </div>
                            </div>
                            <form-item prop="name" style="margin-top: 38px">
                                <el-input v-model="form.name" style="width: 100%;" placeholder="请输入报告编号" />
                            </form-item>
                            <el-form-item prop="reportCode" style="margin-top: 38px">
                                <el-input disabled v-model="form.reportCode" style="width: 100%;"
                                    placeholder="请输入报告编号" />
                            </el-form-item>
                            <div class="header-title" style="width: 100%;">
                                <div class="header-title-left">
@@ -41,9 +41,10 @@
                                    <div>报告名称</div>
                                </div>
                            </div>
                            <form-item prop="name" style="margin-top: 38px">
                                <el-input v-model="form.name" style="width: 100%;" placeholder="请输入报告编号" />
                            </form-item>
                            <el-form-item prop="reportName" style="margin-top: 38px">
                                <el-input disabled v-model="form.reportName" style="width: 100%;"
                                    placeholder="请输入报告名称" />
                            </el-form-item>
                            <div class="header-title" style="width: 100%;">
                                <div class="header-title-left">
@@ -51,9 +52,10 @@
                                    <div>报告正文</div>
                                </div>
                            </div>
                            <form-item prop="name" style="margin-top: 38px">
                                <ai-editor v-model="form.name" style="width: 100%;" placeholder="请输入报告编号" />
                            </form-item>
                            <el-form-item prop="reportText" style="margin-top: 38px">
                                <ai-editor :readOnly="true" :value="form.reportText" style="width: 100%;"
                                    placeholder="请输入报告正文" />
                            </el-form-item>
                        </el-form>
                    </template>
@@ -63,21 +65,20 @@
            <!-- 右侧审批流程 -->
            <div class="approval-flow">
                <div class="flow-content">
                    <approval-process :status="form.status" :submit-time="form.createTime" :approver="form.approver"
                        :approve-time="form.approveTime" />
                    <approval-process :processData="form.processData" />
                </div>
            </div>
        </div>
        <div class="approval-dialog-approve">
        <div class="approval-dialog-approve" v-if="!obj.isDetail">
            <el-row :span="24">
                <el-col :span="12">
                    <div class="status">
                        <div class="status-title">审批结果</div>
                        <div class="status-content">
                            <div class="resolve" :class="status == '1' && 'activeStatus'" @click.stop="status = 1">
                            <div class="resolve" :class="status == '2' && 'activeStatus'" @click.stop="status = 2">
                                通过
                            </div>
                            <div class="reject" :class="status == '2' && 'activeStatus'" @click.stop="status = 2">
                            <div class="reject" :class="status == '3' && 'activeStatus'" @click.stop="status = 3">
                                驳回
                            </div>
                        </div>
@@ -94,8 +95,8 @@
        </div>
        <div slot="footer" class="dialog-footer">
            <el-button @click="handleClose" >取 消</el-button>
            <el-button type="primary" @click="handleApprove" v-if="type === 'approve'">通过</el-button>
            <el-button @click="handleClose">{{obj.isDetail ? '关闭' : '取 消'}}</el-button>
            <el-button type="primary" @click="handleApprove" v-if="!obj.isDetail">通过</el-button>
        </div>
    </el-dialog>
</template>
@@ -103,6 +104,8 @@
<script>
import ApprovalProcess from '@/components/approvalProcess'
import AiEditor from '@/components/AiEditor'
import { getDetail } from '../../service';
export default {
    name: "ApprovalDialog",
@@ -119,27 +122,33 @@
            type: String,
            default: "approve", // approve-审批,view-查看
        },
        data: {
        obj: {
            type: Object,
            default: () => ({}),
            default: () => { },
        },
    },
    data() {
        return {
            form: {
                planName: "",
                planCode: "",
                stage: "",
                creator: "",
                reportCode: "",
                reportName: "",
                reportText: "",
                teamName: "",
                createBy: "",
                createTime: "",
                status: "",
                approvalComment: "",
                status: "pending",
                approver: "",
                approveTime: ""
                approveTime: "",
                processData: [],
                updateBy: "",
                auditRemark: "",
                auditPersonName: "",
                auditTime: ""
            },
            radio1: 1,
            tableData: [],
            rules: {},
            status: "1",
            status: "2",
            remark: "",
        };
    },
@@ -148,40 +157,101 @@
            return this.type === "approve" ? "审批" : "审批详情";
        },
    },
    watch: {
        data: {
            handler(val) {
                if (val) {
                    this.form = { ...val };
                }
            },
            immediate: true,
        },
    },
    methods: {
        open() {
            if (!this.obj.id) {
                this.$message.error('缺少必要参数');
                return;
            }
            getDetail(this.obj.id).then(res => {
                const data = res.data || res;
                this.form = {
                    ...this.form,
                    ...data,
                    processData: []
                };
                this.tableData = data.projectTeam ?
                    [{ ...data.projectTeam, staffName: data.staffNames || '' }] :
                    [];
                let processData = [];
                // 提交节点
                processData.push({
                    type: "primary",
                    mode: "list",
                    fields: [
                        { label: "提交人:", value: data.updateBy || "" },
                        { label: "提交时间:", value: data.createTime || "" },
                    ]
                });
                if (data.status == 2 || data.status == 3) {
                    processData.push({
                        type: data.status === 2 ? "primary" : "danger",
                        mode: "list",
                        fields: [
                            { label: "审批意见:", value: data.auditRemark || "" },
                            { label: "审核人:", value: data.auditPersonName || "" },
                            { label: "审核时间:", value: data.auditTime || "" },
                        ]
                    });
                } else {
                    processData.push({
                        type: "warning",
                        mode: "list",
                        fields: [
                            { label: "等待审核" },
                        ],
                    });
                }
                if (data.status == 2) {
                    processData.push({
                        type: "warning",
                        mode: "list",
                        fields: [{ label: "等待评定" }],
                    });
                }
                if (data.status == 3) {
                    processData.push({
                        type: "success",
                        mode: "list",
                        fields: [
                            { label: "已评定" },
                            { label: "评定人:", value: data.evaluatePersonName || "" },
                            { label: "评定时间:", value: data.evaluateTime || "" }
                        ],
                    });
                }
                this.form.processData = processData;
            }).catch(err => {
                this.$message.error('获取详情失败');
            });
        },
        handleClose() {
            this.$emit("close");
            this.form.approvalComment = "";
        },
        handleApprove() {
            if (!this.form.approvalComment) {
                this.$message.warning("请输入审批意见");
                return;
            }
            this.$emit("approve", {
                ...this.form,
                status: "approved",
                statuss: this.status,
                remark: this.remark
            });
        },
        handleReject() {
            if (!this.form.approvalComment) {
                this.$message.warning("请输入审批意见");
                return;
            }
            this.$emit("reject", {
                ...this.form,
                status: "rejected",
            });
        handleCurrentChange(page) {
            this.form.pageNum = page
            this.getList()
        },
        handleSizeChange(size) {
            this.form.pageSize = size
            this.getList()
        },
    },
};
laboratory/src/views/reportLibrary/verificationRelease/index.vue
@@ -1,14 +1,27 @@
<template>
    <div class="list">
        <TableCustom :queryForm="queryForm" :total="total" @currentChange="handleCurrentChange"
            @sizeChange="handleSizeChange">
        <el-card class="header-box" v-if="roleType == 3">
            <div class="box-title">
                <img src="@/assets/public/notice.png" class="header-icon"> <span>设立课题规则</span>
            </div>
            <div class="header-content">
                <p>1、根据可研报告、产品构思设计的工艺研究路线,一条工艺路线设立一个课题。如果一个课题中有多个化合物需要开发研究,则每个化合物作为一个分题;分题归集到该课题中,最终形成课题报告。不同课题报告中的分题不能重复使用。
                </p>
                <p>2、在可行研究阶段,工艺开发升级,重新规划工艺研究路线,则以新规划的工艺路线方案来设定课题。</p>
            </div>
        </el-card>
        <TableCustom :tableData="tableData" :height="null" :total="total" @handleCurrentChange="handleCurrentChanges"
            @handleSizeChange="handleSizeChanges">
            <template #search>
                <el-form :model="form" :label-width="auto" inline>
                <el-form :model="form" label-width="auto" inline>
                    <el-form-item label="所属项目组:">
                        <el-input v-model="form.name" placeholder="请输入"></el-input>
                        <el-input v-model="form.teamName" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item label="报告名称:">
                        <el-input v-model="form.name" placeholder="请输入"></el-input>
                        <el-input v-model="form.reportName" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item label="报告编号:">
                        <el-input v-model="form.reportCode" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item label="创建日期:">
                        <el-date-picker v-model="form.date" type="daterange" range-separator="至"
@@ -17,42 +30,64 @@
                    <el-form-item label="状态:">
                        <el-select v-model="form.status" placeholder="请选择">
                            <el-option label="待审核" value="1"></el-option>
                            <el-option label="已通过" value="0"></el-option>
                            <el-option label="已驳回" value="2"></el-option>
                            <el-option label="待评定" value="2"></el-option>
                            <el-option label="已驳回" value="4"></el-option>
                            <el-option label="已评定" value="3"></el-option>
                            <el-option label="已撤回" value="5"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" style="margin-left: 63px;">
                        <el-button type="default">重置</el-button>
                        <el-button type="default" style="margin-right: 10px;">重置</el-button>
                        <el-button type="primary">查询</el-button>
                    </el-form-item>
                </el-form>
            </template>
            <template #setting>
                <div class="table-title">
                <el-button v-if="roleType == 3" @click="handleAddProject" class="el-icon-plus" type="primary">
                    新增验证与发布</el-button>
                <div class="table-setting">
                    <div :class="!isDraft ? 'table-title' : 'table-tit'" @click="changeTab('')">
                    验证与发布
                </div>
                    <div v-if="roleType == 3" :class="!isDraft ? 'table-tit' : 'table-title'" @click="changeTab('-1')">
                        草稿箱
                    </div>
                </div>
            </template>
            <template #table>
                <el-table-column prop="name" label="所属项目组" />
                <el-table-column prop="age" label="报告编号" />
                <el-table-column prop="age" label="报告名称" />
                <el-table-column prop="age" label="创建人" />
                <el-table-column prop="age" label="创建时间" />
                <el-table-column prop="age" label="状态">
                <el-table-column prop="teamName" label="所属项目组" />
                <el-table-column prop="reportCode" label="报告编号" />
                <el-table-column prop="reportName" label="报告名称" />
                <el-table-column prop="createBy" label="创建人" />
                <el-table-column prop="createTime" label="创建时间" />
                <el-table-column prop="status" label="状态" v-if="!isDraft">
                    <template #default="{ row }">
                        <el-tag v-if="row.status == 1" type="success">待审核</el-tag>
                        <el-tag v-else-if="row.status == 0" type="success">已通过</el-tag>
                        <el-tag v-else type="danger">已驳回</el-tag>
                        <el-tag v-if="row.status == 1">待审核</el-tag>
                        <el-tag v-else-if="row.status == 2">待评定</el-tag>
                        <el-tag v-else-if="row.status == 4" type="danger">已驳回</el-tag>
                        <el-tag v-else-if="row.status == 3" type="success">已评定</el-tag>
                        <el-tag v-else-if="row.status == 5" type="info">已撤回</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="age" label="操作">
                <el-table-column prop="options" label="操作">
                    <template #default="{ row }">
                        <el-button type="text">审核</el-button>
                        <el-button type="text">详情</el-button>
                        <el-button type="text" @click="handleApproval(row)"
                            v-if="row.status == 1 && [1, 2].includes(roleType)">审核</el-button>
                        <el-button type="text" @click="handleDetail(row)">详情</el-button>
                        <el-button type="text" @click="handleDelete(row)"
                            v-if="[4, 5].includes(row.status) && roleType == 3">删除</el-button>
                        <el-button type="text" @click="handleEdit(row)"
                            v-if="[4, 5].includes(row.status) && roleType == 3">编辑</el-button>
                        <el-button type="text" @click="handleRevoke(row)"
                            v-if="row.status == 1 && roleType == 3">撤销审批</el-button>
                    </template>
                </el-table-column>
            </template>
        </TableCustom>
        <Approval :visible="showApproval" @close="showApproval = false" :obj="rowData" @approve="handleApprove" />
        <ShowDelConfirm :show="showDelConfirm" @close="showDelConfirm = false" @confirm="handleDelConfirm" />
        <ShowDelConfirm :title="changeStatusTitle" :tip="changeStatusTip" :show="changeStatus"
            @close="changeStatus = false" @confirm="handleChangeStatusConfirm" />
@@ -60,71 +95,210 @@
</template>
<script>
import Approval from './components/approval'
import { getDataList, audit, revokeAudit, deleteData } from './service'
export default {
    name: 'ProjectList',
    components: {
        Approval
    },
    data() {
        return {
            form: {
                name: ''
            },
            showDelConfirm: false,
            rowId: '',
            changeStatus: false,
            showApproval: false,
            changeStatusTitle: '',
            changeStatusTip: '',
            queryForm: {
            tableData: [],
            isDraft: false,
            rowData: {},
            roleType: '', // 1 超级管理员 2 审批人 3 工艺工程师 4化验师 5实验员
            form: {
                pageSize: 10,
                pageNum: 1
                pageNum: 1,
                teamName: '',
                status: '',
                startTime: '',
                reportType: 4,
                reportName: '',
                reportCode: '',
                endTime: '',
                date: ''
            },
            total: 0
        }
    },
    mounted() {
        this.roleType = JSON.parse(sessionStorage.getItem('userInfo'))?.roleType
        this.getList()
    },
    methods: {
        handleAddProject() {
        handleApproval(row) {
            this.rowData = row
            this.showApproval = true
        },
        handleDetail(row) {
            row.isDetail = true
            this.rowData = row
            this.showApproval = true
        },
        handleEdit(row) {
            this.$router.push({
                path: '/projectList/addProject'
                path: '/reportLibrary/',
                query: {
                    id: row.id
                }
            })
        },
        handleDel(row) {
        handleAddProject() {
            this.$router.push('/reportLibrary/addProjectProposalLibrary')
        },
        changeTab(status) {
            if (status == -1) {
                this.isDraft = true
                this.form.pageNum = 1
            } else {
                this.form.pageNum = 1
                this.isDraft = false
                this.form.status = status
            }
            this.getList()
        },
        handleDelete(row) {
            this.rowId = row.id
            this.showDelConfirm = true
        },
        handleDelConfirm() {
            this.showDelConfirm = false
            this.msgsuccess('删除成功')
            this.rowId = ''
            this.getList()
        },
        handleChangeStatus(row, status) {
        handleRevoke(row) {
            this.rowId = row.id
            this.changeStatusTitle = status == 1 ? '确认要封存这个项目组吗?' : '确认要解封该项目组吗?'
            this.changeStatusTip = status == 1 ? '封存后项目组内人员看不到数据,审批人仍然可见数据。' : '解封后项目组内人员数据恢复。'
            this.changeStatusTitle = '确认要撤销审批吗?'
            this.changeStatusTip = '撤销审批后,验证与发布将被撤销。'
            this.changeStatus = true
        },
        handleDelConfirm() {
            deleteData({ id: this.rowId }).then(res => {
                this.showDelConfirm = false
                this.$message.success('删除成功')
                this.rowId = ''
                this.getList()
            })
        },
        handleChangeStatusConfirm() {
            revokeAudit({ id: this.rowId }).then(res => {
            this.changeStatus = false
            this.msgsuccess('操作成功')
                this.$message.success('操作成功')
            this.rowId = ''
            this.changeStatusTitle = ''
            this.changeStatusTip = ''
            this.getList()
            })
        },
        handleCurrentChange(page) {
            this.queryForm.pageNum = page
        handleCurrentChanges(page) {
            this.form.pageNum = page
            this.getList()
        },
        handleSizeChange(size) {
            this.queryForm.pageSize = size
        handleSizeChanges(size) {
            this.form.pageSize = size
            this.getList()
        },
        getList() {
            let data = {}
            if (this.isDraft) {
                data = {
                    ...this.form,
                    status: -1
                }
            } else {
                data = this.form
            }
            getDataList(data).then(res => {
                if (res.code === 200) {
                    this.tableData = res.data.records || []
                    this.total = res.data.total || 0
                }
            })
        },
        handleApprove(data) {
            let params = {
                id: data.id,
                auditStatus: data.statuss,
                auditRemark: data.remark
            }
            audit({ ...params }).then(res => {
                if (res.code === 200) {
                    this.$message.success('审核成功')
                    this.showApproval = false
                    this.getList()
                }
            })
        }
    }
}
</script>
<style scoped lang="less">
.el-icon-plus {
    margin-bottom: 20px;
}
.header-content {
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.88);
    margin-left: 30px;
}
.box-title {
    font-family: SourceHanSansCN, SourceHanSansCN;
    font-weight: bold;
    font-size: 18px;
    color: #222222;
    line-height: 27px;
    display: flex;
    align-items: center;
}
.header-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}
.header-box {
    border-radius: 16px;
    margin-bottom: 30px;
}
.table-setting {
    display: flex;
    gap: 14px;
}
.table-tit {
    background: #FAFAFC;
    border-radius: 8px 8px 0px 0px;
    border: 1px solid #DCDFE6;
    width: 166px;
    height: 50px;
    background: #FFFFFF;
    border-radius: 8px 8px 0px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    // margin-bottom: 21px;
    font-family: SourceHanSansCN, SourceHanSansCN;
    font-weight: bold;
    font-size: 18px;
    color: #606266;
    line-height: 27px;
}
.list {
    height: 100%;
}
@@ -138,7 +312,7 @@
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 21px;
    // margin-bottom: 21px;
    font-family: SourceHanSansCN, SourceHanSansCN;
    font-weight: bold;
    font-size: 18px;
laboratory/src/views/reportLibrary/verificationRelease/service.js
New file
@@ -0,0 +1,45 @@
import axios from '@/utils/request';
// 查询列表
export function getDataList(data) {
  console.log('data111111', data);
  return axios.post('/api/t-feasibility-study-report/pageList', { ...data })
}
// 添加
export function addData(data) {
  console.log('data', data);
  return axios.post('/api/t-feasibility-study-report/add', { ...data })
}
//修改
export function editData(data) {
  return axios.post('/api/t-feasibility-study-report/update', { ...data })
}
//获取详情
export function getDetail(id) {
  return axios.get(`/open/t-feasibility-study-report/getDetailById?id=${id}`)
}
//审核
export function audit(data) {
  console.log(data)
  return axios.post('/api/t-feasibility-study-report/auditReport', { ...data })
}
//撤销审批
export function revokeAudit(data) {
  return axios.put(`/open/t-feasibility-study-report/revokedReport?id=${data.id}`)
}
//删除
export function deleteData(data) {
  return axios.delete(`/open/t-feasibility-study-report/deleteById?id=${data.id}`)
}