董国庆
2025-06-21 43d41f83451a4038c72f20442a78a3b02174c567
化验师Qa 修改bug
10个文件已修改
241 ■■■■■ 已修改文件
laboratory/src/router/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/utils/utils.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/projectTesting/add.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/projectTesting/addDetectionReport.vue 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/projectTesting/components/approval/index.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/projectTesting/index.vue 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/projectTesting/service.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/inspectionReport/detail.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/suspendExperiment/list.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/testResultReport/list.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/router/index.js
@@ -256,7 +256,8 @@
                        meta: {
                            title: "样品管理",
                            keepAlive: true,
                              privilege:'sampleManage_manage'
                            privilege:'sampleManage'
                            //   privilege:'sampleManage_manage'
                        },
                        component: () => import("../views/dataManagement/sampleManage/list.vue"),
                    },
@@ -274,7 +275,8 @@
                        meta: {
                            title: "取样操作记录列表",
                            keepAlive: true,
                              privilege:'sampleManage_record'
                            privilege:'sampleManage'
                            //   privilege:'sampleManage_record'
                        },
                        component: () => import("../views/dataManagement/sampleRecordList/list.vue"),
                    },
@@ -292,7 +294,8 @@
                        meta: {
                            title: "送样单列表",
                            keepAlive: true,
                              privilege:'sampleManage_submissionList'
                            privilege:'sampleManage'
                            //   privilege:'sampleManage_submissionList'
                        },
                        component: () => import("../views/dataManagement/sampleSubmissionList/list.vue"),
                    },
laboratory/src/utils/utils.js
@@ -25,9 +25,11 @@
  axios.post(uploadUrl, formData, { headers: uploadHeaders })
    .then(res => {
      console.log('22222',res)
      onSuccess(res.data);
    })
    .catch(err => {
      console.log('222222222222',err)
      onError(err);
    });
};
laboratory/src/views/chemistQa/projectTesting/add.vue
@@ -17,7 +17,7 @@
                    <el-table-column prop="personCharge" label="项目负责人" />
                    <el-table-column prop="staffName" label="项目组成员">
                                    <template #default="{ row }">
                                        <span>{{row.staffs.map(item => item.nickName).join(',')}}</span>
                                        <span>{{row.staffName?row.staffName:row.staffs.map(item => item.nickName).join(',')}}</span>
                                    </template>
                                </el-table-column>
                    <el-table-column prop="createTime" label="创建时间" />
laboratory/src/views/chemistQa/projectTesting/addDetectionReport.vue
@@ -40,7 +40,8 @@
                    </el-col>
                    <el-col :span="24">
                        <el-form-item prop="developPersonName" label="制定人">
                            <el-input v-model="form.developPersonName" style="width: 100%;" placeholder="请输入制定人" disabled />
                            <el-input v-model="form.developPersonName" style="width: 100%;" placeholder="请输入制定人"
                                disabled />
                        </el-form-item>
                        <el-form-item prop="developDate" label="制定日期" style="margin-left: 100px;">
                            <el-date-picker :prefix-icon="null" v-model="form.developDate" type="date" disabled
@@ -66,12 +67,17 @@
                    </div>
                </div>
                <el-form-item prop="name" style="margin-top: 18px">
                    <el-upload
                    <!-- <el-upload
                        action="#" 
                        :file-list="fileList"
                        :http-request="handleUpload"
                        :before-upload="beforeUpload"
                        :on-remove="handleRemove">
                        <el-button size="small" type="primary">点击上传</el-button>
                        <div slot="tip" class="el-upload__tip">支持任意格式文件上传</div>
                    </el-upload> -->
                    <el-upload action="#" :file-list="fileList" :http-request="handleUpload"
                        :before-upload="beforeUpload" :on-remove="handleRemove">
                        <el-button size="small" type="primary">点击上传</el-button>
                        <div slot="tip" class="el-upload__tip">支持任意格式文件上传</div>
                    </el-upload>
@@ -91,7 +97,8 @@
import { Card } from 'element-ui';
import AiEditor from '@/components/AiEditor'
import chooseProject from '@/components/chooseProject'
import { addDetail, getDetailInfo,updateDetail,getDetail  } from './service'
import { addDetail, getDetailInfo, updateDetail, getDetail } from './service'
import { customUploadRequest, getFullUrl } from '@/utils/utils'
export default {
    components: {
@@ -111,7 +118,7 @@
                itemId: "",
                status: 1,
                itemId: "",
                qaReportFiles: [],
                qaReportFileList: [],
                commitPersonId: null,
            },
            tableData: [],
@@ -135,26 +142,26 @@
        this.form.commitPersonId = JSON.parse(sessionStorage.getItem('userInfo')).userId
        this.form.developDate = new Date().toISOString().split('T')[0];
        this.form.itemId=this.$route.query.itemId
        if(this.form.itemId){
            getDetail(this.form.itemId).then(res=>{
                if(res){
                    let item={
                        teamName:res.projectTeamVO.teamName,
                        teamId:res.teamId,
                        remark:res.remark,
        this.form.itemId = this.$route.query.itemId
        if (this.form.itemId) {
            getDetail(this.form.itemId).then(res => {
                if (res) {
                    let item = {
                        teamName: res.projectTeamVO.teamName,
                        teamId: res.teamId,
                        remark: res.remark,
                        itemName:res.itemName,
                        itemCode:res.itemCode,
                        createBy:res.createBy,
                        createTime:res.createTime
                        itemName: res.itemName,
                        itemCode: res.itemCode,
                        createBy: res.createBy,
                        createTime: res.createTime
                    }
                   this.tableData = [{ ...item }]
                    this.tableData = [{ ...item }]
                }
            })
        }
        console.log('this.$route.query.itemId',this.$route.query)
        console.log('this.$route.query.itemId', this.$route.query)
        if (this.$route.query.id) {
            this.getDetail()
        }
@@ -162,14 +169,25 @@
    methods: {
        getDetail() {
            getDetailInfo({id:this.$route.query.id}).then(res => {
            getDetailInfo({ id: this.$route.query.id }).then(res => {
                if (res) {
                    this.form = {
                        ...res,
                        reportContent: Number(res.reportContent)
                    }
                    // this.tableData = [{ ...res.data.projectTeam, staffName: res.data.staffNames }]
                    this.fileList = res.qaReportFiles || []
                    // this.fileList = res.qaReportFileList || []
                    if (res.qaReportFileList && res.qaReportFileList.length > 0) {
                        this.fileList = res.qaReportFileList.map(file => ({
                            name: file.fileName,
                            url: getFullUrl(file.fileUrl),
                            uid: file.id
                        }))
                        this.form.qaReportFileList = res.fileList
                    } else {
                        this.fileList = []
                        this.form.qaReportFileList = []
                    }
                } else {
                    this.$message.error(res.message || '获取详情失败')
                }
@@ -183,12 +201,12 @@
        submit() {
            this.$refs.form.validate((valid) => {
                if (!valid) return
                if (this.$refs.materialEditor.getContent() == '<p></p>') {
                    this.$message.error('请输入报告正文')
                    return
                }
                let data = {
                    ...this.form,
                    reportText: this.$refs.materialEditor.getContent(),
@@ -197,8 +215,9 @@
                this.loading = true
                if (this.$route.query.id) {
                    console.log('data updateDetail',data)
                    console.log('data updateDetail', data)
                    updateDetail({ ...data, id: this.$route.query.id }).then(res => {
                        console.log('res',res)
                        if (res.code === 200) {
                            this.$message.success('修改成功')
                            this.$router.back()
@@ -209,8 +228,9 @@
                        this.loading = false
                    })
                } else {
                    console.log('data addDetail',data)
                    console.log('data addDetail', data)
                    addDetail(data).then(res => {
                        console.log('res',res)
                        if (res.code === 200) {
                            this.$message.success('发布成功')
                            this.$router.back()
@@ -226,7 +246,7 @@
        save() {
            this.$refs.form.validate((valid) => {
                if (!valid) return
                let data = {
                    ...this.form,
                    reportText: this.$refs.materialEditor.getContent(),
@@ -261,36 +281,56 @@
                }
            })
        },
        beforeUpload(file) {
                 // 上传前校验
                 beforeUpload(file) {
            return true;
        },
        // 自定义上传处理
        handleUpload(options) {
            const file = options.file;
            const fileObj = {
                fileName: file.name,
                fileSize: file.size,
                createTime: new Date().toISOString(),
                createBy: JSON.parse(sessionStorage.getItem('userInfo')).userId,
                reportType: 1,
                status: 1,
                id: Date.now().toString(),
                fileUrl: 'https://example.com/default-file-url'
            };
            this.fileList.push({
                name: file.name,
                url: fileObj.fileUrl
            const { file, onSuccess, onError } = options;
            // 使用封装的customUploadRequest方法
            customUploadRequest({
                file,
                onSuccess: (res) => {
                    console.log()
                    if (res.code === 200) {
                        const fileObj = {
                            id: new Date().getTime(),
                            reportId: this.$route.query.id ? this.$route.query.id : '',
                            fileUrl: res.msg || res.data || '',
                            fileName: file.name,
                            fileSize: file.size,
                        };
                        // 添加到文件列表显示
                        this.fileList.push({
                            name: file.name,
                            url: getFullUrl(fileObj.fileUrl),
                            uid: fileObj.id
                        });
                        // 添加到表单数据
                        this.form.qaReportFileList.push(fileObj);
                        this.$message.success('文件上传成功');
                        onSuccess(res);
                    } else {
                        this.$message.error(res.message || '文件上传失败');
                        onError();
                    }
                },
                onError: (err) => {
                    this.$message.error('文件上传失败');
                    onError(err);
                }
            });
            this.form.qaReportFiles.push(fileObj);
            this.$message.success('文件上传成功');
        },
        handleRemove(file) {
            const index = this.fileList.findIndex(item => item.name === file.name);
            if (index !== -1) {
                this.fileList.splice(index, 1);
                this.form.qaReportFiles.splice(index, 1);
                this.form.qaReportFileList.splice(index, 1);
            }
        },
    },
laboratory/src/views/chemistQa/projectTesting/components/approval/index.vue
@@ -72,7 +72,7 @@
                </div>
            </div>
        </div>
        <div class="approval-dialog-approve" v-if="type === 'approve'">
        <div class="approval-dialog-approve" v-if="type === 'approve'">
            <el-row :span="24">
                <el-col :span="12">
                    <div class="status">
@@ -107,7 +107,7 @@
<script>
import ApprovalProcess from '@/components/approvalProcess'
import AiEditor from '@/components/AiEditor'
import { getDetailInfo, getDetail,detailAuditReport } from '../../service'
import { getDetailInfo, getDetail, detailAuditReport } from '../../service'
export default {
    name: "ApprovalDialog",
@@ -142,7 +142,7 @@
                processData: [],
            },
            tableData: [],
            fileList:[],
            fileList: [],
            radio1: 1,
            rules: {},
            status: "1",
@@ -172,7 +172,17 @@
            getDetailInfo({ id: this.data.id }).then(res => {
                if (res) {
                    this.form = { ...res, reportContent: Number(res.reportContent), processData: [] }
                    this.fileList = res.qaReportFileList
                    if (res.qaReportFileList && res.qaReportFileList.length > 0) {
                        this.fileList = res.qaReportFileList.map(file => ({
                            name: file.fileName,
                            url: getFullUrl(file.fileUrl),
                            uid: file.id
                        }))
                        this.form.qaReportFileList = res.fileList
                    } else {
                        this.fileList = []
                        this.form.qaReportFileList = []
                    }
                    // 组装流程数据
                    let processData = [];
                    // 提交节点
@@ -228,13 +238,13 @@
        getDetail() {
            getDetail(this.data.itemId).then(res => {
                if (res) {
                    this.tableData = [{...res,teamName:res.projectTeamVO.teamName}]
                    this.tableData = [{ ...res, teamName: res.projectTeamVO.teamName }]
                }
            })
        },
        handleClose() {
            this.$emit("close");
            this.form.approvalComment = "";
        },
        handleApprove() {
laboratory/src/views/chemistQa/projectTesting/index.vue
@@ -75,8 +75,8 @@
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="developPerson" label="制订人" />
                                    <el-table-column prop="developDate" label="制订日期" />
                                    <el-table-column prop="auditPersonId" label="审批人" />
                                    <el-table-column prop="createTime" label="制订日期" />
                                    <el-table-column prop="auditPersonName" label="审批人" />
                                    <el-table-column prop="auditTime" label="审批时间" />
                                    <el-table-column prop="status" label="状态">
                                        <template #default="{ row }">
@@ -119,16 +119,16 @@
                    <el-table-column prop="createBy" label="创建人" />
                    <el-table-column prop="createTime" label="创建时间" />
                    <el-table-column prop="auditTime" label="审批时间" v-if="!isChemist" />
                    <el-table-column prop="age" label="状态">
                    <el-table-column prop="age" label="状态" v-if="isApprovaler">
                        <template #default="{ row }">
                            <!-- 化验师的状态显示 -->
                            <template v-if="isChemist">
                                <el-tag v-if="row.status == -1" type="info" color="#fff">草稿箱</el-tag>
                                <el-tag v-else-if="row.status == 1" type="warning">已提交</el-tag>
                                <el-tag v-else-if="row.status == 2" type="primary">待评定</el-tag>
                                <el-tag v-else-if="row.status == 3" type="success">已评定</el-tag>
                            </template>
                            <!-- 其他角色的状态显示 -->
                            <template v-else>
                                <el-tag v-if="row.status == -1" type="info" color="#fff">草稿箱</el-tag>
                                <el-tag v-else-if="row.status == 1" type="warning">待审核</el-tag>
@@ -244,6 +244,10 @@
        isProcessEngineer() {
            const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}');
            return userInfo.roleType == 3; // 3是工艺工程师
        },
        isApprovaler() {
            const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}');
            return userInfo.roleType == 2; // 2是审批人
        }
    },
    methods: {
@@ -354,18 +358,24 @@
                if (this.currentAction === 'delete') {
                    if (this.confirmType === 'deleteReport') {
                        const res = await deleteDetail({ id: this.currentRow.id });
                        if (res.code === 200) {
                        if (res) {
                            this.loading = false;
                            this.$message.success('删除成功');
                            const parentItemId = this._getParentItemId(this.currentRow.id);
                            await this._refreshReportList(parentItemId);
                            this.closeConfirm();
                            await this.getList();
                        } else {
                            this.$message.error(res.msg || '删除失败');
                        }
                    } else if (this.confirmType === 'deleteItem') {
                        const res = await deleteData({ id: this.currentRow.id });
                        if (res.code === 200) {
                        if (res) {
                            this.loading = false;
                            this.$message.success('删除成功');
                            this.closeConfirm();
                            await this.getList();
                        } else {
                            this.$message.error(res.msg || '删除失败');
@@ -374,9 +384,13 @@
                } else if (this.currentAction === 'revoke') {
                    const res = await revokedReport({ id: this.currentRow.id });
                    if (res.code === 200) {
                        this.loading = false;
                        this.$message.success('撤销审批成功');
                        const parentItemId = this._getParentItemId(this.currentRow.id);
                        await this._refreshReportList(parentItemId);
                         this.loading = false;
                        this.closeConfirm();
                        await this.getList();
                    } else {
                        this.$message.error(res.msg || '撤销审批失败');
                    }
@@ -386,6 +400,23 @@
                this.$message.error('操作失败,请重试');
            } finally {
                this.loading = false;
            }
        },
        _getParentItemId(reportId) {
            return Object.keys(this.reportList).find(key =>
                this.reportList[key].some(report => report.id === reportId)
            );
        },
        async _refreshReportList(itemId) {
            if (!itemId) return;
            try {
                const res = await getListByItemId({ id: itemId });
                if (res) {
                    this.$set(this.reportList, itemId, res || []);
                }
            } catch (error) {
                console.error('刷新报告列表失败:', error);
                this.$message.error('刷新报告列表失败');
            }
        },
        handleCurrentChange(page) {
@@ -471,7 +502,7 @@
        async handleSubmitConfirm() {
            if (!this.rowId) return;
            try {
                this.loading = true;
                // this.loading = true;
                const res = await commitEvaluate({ id: this.rowId });
                if (res.code === 200) {
                    this.$message.success('提交评定成功');
@@ -490,14 +521,14 @@
        },
        async handleSearch() {
            try {
                this.loading = true;
                console.log('111111111')
                // this.loading = true;
                await this.$refs.searchForm.validate();
                this.queryForm.pageNum = 1;
                await this.getList();
            } catch (error) {
                if (error === false) {
                    this.$message.warning('请检查表单填写是否正确');
                } else {
                // 如果是校验失败,error会是false,此时不做任何处理,因为el-form会展示错误信息
                if (error !== false) {
                    this.$message.error('查询失败,请重试');
                }
            } finally {
@@ -506,8 +537,9 @@
        },
        async handleReset() {
            try {
                this.loading = true;
                // this.loading = true;
                this.$refs.searchForm.resetFields();
                // resetFields会把status也置为初始值'',需要根据当前tab重新设置
                this.form = {
                    itemCode: '',
                    itemName: '',
@@ -517,6 +549,7 @@
                    pageNum: 1,
                    pageSize: 10
                };
                this.form.status = this.currentType === 'draft' ? '-1' : '';
                this.queryForm.pageNum = 1;
                await this.getList();
            } catch (error) {
laboratory/src/views/chemistQa/projectTesting/service.js
@@ -63,5 +63,5 @@
}
// 撤销QA检测项报告管理状态
export function revokedReport(data) {
  return axios.get(`/open/t-qa-test-item-report/revokedReport?id=${data.id}`)
  return axios.put(`/open/t-qa-test-item-report/revokedReport?id=${data.id}`)
}
laboratory/src/views/dataManagement/inspectionReport/detail.vue
@@ -61,7 +61,7 @@
      />
      <div class="add-project-footer" v-if="pageType !== 'view'">
        <el-button type="primary" class="save-btn" @click="handleSave">发送</el-button>
        <el-button type="primary" class="save-btn" @click="handleSave">提交</el-button>
        <el-button @click="handleSaveDraft">存草稿</el-button>
      </div>
    </el-form>
laboratory/src/views/dataManagement/suspendExperiment/list.vue
@@ -57,8 +57,8 @@
        <el-table-column prop="experimentName" label="实验名称"></el-table-column>
        <el-table-column prop="experimentDate" label="实验日期"></el-table-column>
        <el-table-column prop="schemePersonName" label="实验员"></el-table-column>
        <el-table-column prop="createTime" label="创建日期"></el-table-column>
        <el-table-column prop="createBy" label="创建人"></el-table-column>
        <el-table-column prop="createTime" label="提交日期"></el-table-column>
        <el-table-column prop="createBy" label="提交人"></el-table-column>
        <el-table-column prop="status" label="当前状态">
          <template slot-scope="scope">
            <el-tag :type="getStatusType(scope.row.status)">
laboratory/src/views/dataManagement/testResultReport/list.vue
@@ -205,6 +205,7 @@
        pageSize: 10
      };
      this.dateRange = [];
      this.getTableData();
    },
    handleSearch() {
      this.getTableData();