| | |
| | | meta: { |
| | | title: "样品管理", |
| | | keepAlive: true, |
| | | privilege:'sampleManage_manage' |
| | | privilege:'sampleManage' |
| | | // privilege:'sampleManage_manage' |
| | | }, |
| | | component: () => import("../views/dataManagement/sampleManage/list.vue"), |
| | | }, |
| | |
| | | meta: { |
| | | title: "取样操作记录列表", |
| | | keepAlive: true, |
| | | privilege:'sampleManage_record' |
| | | privilege:'sampleManage' |
| | | // privilege:'sampleManage_record' |
| | | }, |
| | | component: () => import("../views/dataManagement/sampleRecordList/list.vue"), |
| | | }, |
| | |
| | | meta: { |
| | | title: "送样单列表", |
| | | keepAlive: true, |
| | | privilege:'sampleManage_submissionList' |
| | | privilege:'sampleManage' |
| | | // privilege:'sampleManage_submissionList' |
| | | }, |
| | | component: () => import("../views/dataManagement/sampleSubmissionList/list.vue"), |
| | | }, |
| | |
| | | |
| | | axios.post(uploadUrl, formData, { headers: uploadHeaders }) |
| | | .then(res => { |
| | | console.log('22222',res) |
| | | onSuccess(res.data); |
| | | }) |
| | | .catch(err => { |
| | | console.log('222222222222',err) |
| | | onError(err); |
| | | }); |
| | | }; |
| | |
| | | <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="创建时间" /> |
| | |
| | | </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 |
| | |
| | | </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> |
| | |
| | | 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: { |
| | |
| | | itemId: "", |
| | | status: 1, |
| | | itemId: "", |
| | | qaReportFiles: [], |
| | | qaReportFileList: [], |
| | | commitPersonId: null, |
| | | }, |
| | | tableData: [], |
| | |
| | | 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() |
| | | } |
| | |
| | | |
| | | 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 || '获取详情失败') |
| | | } |
| | |
| | | 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(), |
| | |
| | | |
| | | 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() |
| | |
| | | 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() |
| | |
| | | save() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) return |
| | | |
| | | |
| | | let data = { |
| | | ...this.form, |
| | | reportText: this.$refs.materialEditor.getContent(), |
| | |
| | | } |
| | | }) |
| | | }, |
| | | 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); |
| | | } |
| | | }, |
| | | }, |
| | |
| | | </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"> |
| | |
| | | <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", |
| | |
| | | processData: [], |
| | | }, |
| | | tableData: [], |
| | | fileList:[], |
| | | fileList: [], |
| | | radio1: 1, |
| | | rules: {}, |
| | | status: "1", |
| | |
| | | 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 = []; |
| | | // 提交节点 |
| | |
| | | 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() { |
| | |
| | | </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 }"> |
| | |
| | | <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> |
| | |
| | | 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: { |
| | |
| | | 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 || '删除失败'); |
| | |
| | | } 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 || '撤销审批失败'); |
| | | } |
| | |
| | | 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) { |
| | |
| | | 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('提交评定成功'); |
| | |
| | | }, |
| | | 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 { |
| | |
| | | }, |
| | | async handleReset() { |
| | | try { |
| | | this.loading = true; |
| | | // this.loading = true; |
| | | this.$refs.searchForm.resetFields(); |
| | | // resetFields会把status也置为初始值'',需要根据当前tab重新设置 |
| | | this.form = { |
| | | itemCode: '', |
| | | itemName: '', |
| | |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }; |
| | | this.form.status = this.currentType === 'draft' ? '-1' : ''; |
| | | this.queryForm.pageNum = 1; |
| | | await this.getList(); |
| | | } catch (error) { |
| | |
| | | } |
| | | // 撤销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}`) |
| | | } |
| | |
| | | /> |
| | | |
| | | <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> |
| | |
| | | <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)"> |
| | |
| | | pageSize: 10 |
| | | }; |
| | | this.dateRange = []; |
| | | this.getTableData(); |
| | | }, |
| | | handleSearch() { |
| | | this.getTableData(); |