| | |
| | | <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: 18px"> |
| | | <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: 18px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="reportTitle" label="报告标题"> |
| | | <el-input v-model="form.reportTitle" style="width: 100%" placeholder="请输入报告标题" /> |
| | | </el-form-item> |
| | | <el-form-item prop="reportCode" label="报告编号" style="margin-left: 100px"> |
| | | <el-input v-model="form.reportCode" style="width: 100%" placeholder="请输入报告编号" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="developPersonName" label="制定人"> |
| | | <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 placeholder="请选择日期" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="reportTitle" label="报告标题"> |
| | | <el-input v-model="form.reportTitle" style="width: 100%;" placeholder="请输入报告标题" /> |
| | | </el-form-item> |
| | | <el-form-item prop="reportCode" label="报告编号" style="margin-left: 100px;"> |
| | | <el-input v-model="form.reportCode" style="width: 100%;" placeholder="请输入报告编号" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="developPersonName" label="制定人"> |
| | | <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 |
| | | placeholder="请选择日期" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <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: 18px"> |
| | | <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: 18px"> |
| | | <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-form-item> |
| | | |
| | | </el-row> |
| | | |
| | | <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: 18px"> |
| | | <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: 18px"> |
| | | <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-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> |
| | | <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' |
| | | import { Card } from "element-ui"; |
| | | import AiEditor from "@/components/AiEditor"; |
| | | import chooseProject from "@/components/chooseProject"; |
| | | import { addData, getDetail, editData } from "./service"; |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | | chooseProject |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | form: { |
| | | reportCode: "", |
| | | reportTitle: "", |
| | | reportText: "", |
| | | developPerson: "", |
| | | developPersonName: "", |
| | | developDate: "", |
| | | reportType: 1, |
| | | status: 1, |
| | | teamId: "", |
| | | qaReportFiles: [], |
| | | commitPersonId: null, |
| | | }, |
| | | tableData: [], |
| | | fileList: [], // 附件列表 |
| | | showChoose: false, |
| | | rules: { |
| | | reportTitle: [ |
| | | { required: true, message: '请输入报告标题', trigger: 'blur' } |
| | | ], |
| | | }, |
| | | queryForm: {} |
| | | components: { |
| | | AiEditor, |
| | | chooseProject, |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | form: { |
| | | reportCode: "", |
| | | reportTitle: "", |
| | | reportText: "", |
| | | developPerson: "", |
| | | developPersonName: "", |
| | | developDate: "", |
| | | reportType: 1, |
| | | status: 1, |
| | | teamId: "", |
| | | qaReportFiles: [], |
| | | commitPersonId: null, |
| | | }, |
| | | tableData: [], |
| | | fileList: [], // 附件列表 |
| | | showChoose: false, |
| | | rules: { |
| | | reportTitle: [ |
| | | { required: true, message: "请输入报告标题", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | queryForm: {}, |
| | | }; |
| | | }, |
| | | |
| | | mounted() { |
| | | console.log( |
| | | "JSON.parse(sessionStorage.getItem(", |
| | | JSON.parse(sessionStorage.getItem("userInfo")) |
| | | ); |
| | | this.form.developPerson = JSON.parse( |
| | | sessionStorage.getItem("userInfo") |
| | | ).nickName; |
| | | this.form.developPersonName = JSON.parse( |
| | | sessionStorage.getItem("userInfo") |
| | | ).nickName; |
| | | this.form.commitPersonId = JSON.parse( |
| | | sessionStorage.getItem("userInfo") |
| | | ).userId; |
| | | this.form.developDate = new Date().toISOString().split("T")[0]; |
| | | |
| | | if (this.$route.query.id) { |
| | | this.getDetail(); |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | | getDetail(this.$route.query.id).then((res) => { |
| | | this.form = res; |
| | | this.tableData = [ |
| | | { |
| | | ...res.projectTeamVO, |
| | | staffName: res.projectTeamVO.staffs |
| | | .map((item) => item.nickName) |
| | | .join(","), |
| | | }, |
| | | ]; |
| | | 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.qaReportFiles = res.qaReportFileList |
| | | } else { |
| | | this.fileList = [] |
| | | this.form.qaReportFiles = [] |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | getProjectData(data) { |
| | | this.tableData = [data]; |
| | | this.$forceUpdate(); |
| | | this.showChoose = false; |
| | | }, |
| | | submit() { |
| | | if (this.tableData.length == 0) { |
| | | this.$message.error("请选择项目组"); |
| | | return; |
| | | } |
| | | |
| | | mounted() { |
| | | |
| | | console.log('JSON.parse(sessionStorage.getItem(',JSON.parse(sessionStorage.getItem('userInfo'))) |
| | | this.form.developPerson = JSON.parse(sessionStorage.getItem('userInfo')).nickName; |
| | | this.form.developPersonName = JSON.parse(sessionStorage.getItem('userInfo')).nickName; |
| | | this.form.commitPersonId= JSON.parse(sessionStorage.getItem('userInfo')).userId |
| | | this.form.developDate = new Date().toISOString().split('T')[0]; |
| | | |
| | | if (this.$route.query.id) { |
| | | this.getDetail() |
| | | this.$refs.form.validate((valid) => { |
| | | if (this.$refs.materialEditor.getContent() == "<p></p>") { |
| | | this.$message.error("请输入报告正文"); |
| | | return; |
| | | } |
| | | // const prefix = apiConfig.showImgUrl; |
| | | |
| | | let data = { |
| | | ...this.form, |
| | | reportText: this.$refs.materialEditor.getContent(), |
| | | teamId: this.tableData[0].id, |
| | | status: 1, // 待审核状态 |
| | | commitPersonId: JSON.parse(sessionStorage.getItem("userInfo")).userId, |
| | | // qaReportFiles: this.form.qaReportFiles.map((file) => { |
| | | // if (file.fileUrl && file.fileUrl.startsWith(prefix)) { |
| | | // return { |
| | | // ...file, |
| | | // fileUrl: file.fileUrl.substring(prefix.length), |
| | | // }; |
| | | // } |
| | | // return file; |
| | | // }), |
| | | }; |
| | | |
| | | 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); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | } 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, |
| | | reportText: this.$refs.materialEditor.getContent(), |
| | | teamId: this.tableData[0].id, |
| | | status: -1, // 草稿箱状态 |
| | | commitPersonId: JSON.parse(sessionStorage.getItem("userInfo")).userId, |
| | | }; |
| | | console.log('qaReportFiles qaReportFiles', this.form.qaReportFiles) |
| | | // if (this.form.qaReportFiles && this.form.qaReportFiles.length > 0) { |
| | | // // const prefix = apiConfig.showImgUrl; |
| | | // console.log('0000000000000000') |
| | | // this.form = { |
| | | // ...this.form, |
| | | // qaReportFiles: this.form.qaReportFiles.map((file) => { |
| | | // if (file.fileUrl && file.fileUrl.startsWith(prefix)) { |
| | | // file.fileUrl = file.fileUrl.substring(prefix.length) |
| | | // } |
| | | // console.log('1111111111111', file) |
| | | // return file; |
| | | // }), |
| | | // }; |
| | | // } |
| | | console.log("data", data); |
| | | 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); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | } 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; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // 上传前校验 |
| | | beforeUpload(file) { |
| | | return true; |
| | | }, |
| | | // 自定义上传处理 |
| | | handleUpload(options) { |
| | | const { file, onSuccess, onError } = options; |
| | | |
| | | methods: { |
| | | getDetail() { |
| | | getDetail(this.$route.query.id).then(res => { |
| | | this.form = res |
| | | this.tableData = [{ ...res.projectTeamVO,staffName:res.projectTeamVO.staffs.map(item=>item.nickName).join(',')}] |
| | | this.fileList = res.fileList || [] |
| | | }) |
| | | }, |
| | | getProjectData(data) { |
| | | this.tableData = [data] |
| | | this.$forceUpdate() |
| | | this.showChoose = false |
| | | }, |
| | | submit() { |
| | | 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, |
| | | reportText: this.$refs.materialEditor.getContent(), |
| | | teamId: this.tableData[0].id, |
| | | status: 1, // 待审核状态 |
| | | commitPersonId: JSON.parse(sessionStorage.getItem('userInfo')).userId |
| | | } |
| | | |
| | | 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) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | } 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, |
| | | reportText: this.$refs.materialEditor.getContent(), |
| | | teamId: this.tableData[0].id, |
| | | status: -1, // 草稿箱状态 |
| | | commitPersonId: JSON.parse(sessionStorage.getItem('userInfo')).userId |
| | | } |
| | | console.log('data',data) |
| | | 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) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | } 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 |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | beforeUpload(file) { |
| | | return true; |
| | | }, |
| | | handleUpload(options) { |
| | | const file = options.file; |
| | | // 使用封装的customUploadRequest方法 |
| | | customUploadRequest({ |
| | | file, |
| | | onSuccess: (res) => { |
| | | console.log() |
| | | if (res.code === 200) { |
| | | const fileObj = { |
| | | fileName: file.name, |
| | | fileSize: file.size, |
| | | createTime: new Date().toISOString(), |
| | | createBy: '当前用户', |
| | | reportType: 2, |
| | | status: 1, |
| | | id: Date.now().toString(), |
| | | fileUrl: 'https://example.com/default-file-url' |
| | | id: new Date().getTime(), |
| | | reportId: this.$route.query.id ? this.$route.query.id : '', |
| | | fileUrl: res.msg || res.data || '', |
| | | reportType: 2, // 可行性研究报告类型 |
| | | fileName: file.name, |
| | | fileSize: file.size, |
| | | }; |
| | | |
| | | |
| | | // 添加到文件列表显示 |
| | | this.fileList.push({ |
| | | name: file.name, |
| | | url: fileObj.fileUrl |
| | | name: file.name, |
| | | url: getFullUrl(fileObj.fileUrl), |
| | | uid: fileObj.id |
| | | }); |
| | | |
| | | |
| | | // 添加到表单数据 |
| | | this.form.qaReportFiles.push(fileObj); |
| | | |
| | | |
| | | this.$message.success('文件上传成功'); |
| | | onSuccess(res); |
| | | } else { |
| | | this.$message.error(res.message || '文件上传失败'); |
| | | onError(); |
| | | } |
| | | }, |
| | | 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); |
| | | } |
| | | }, |
| | | onError: (err) => { |
| | | this.$message.error('文件上传失败'); |
| | | onError(err); |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | // 删除文件 |
| | | 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); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </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; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 20px; |
| | | gap: 13px; |
| | | margin-top: 38px; |
| | | |
| | | .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; |
| | | } |
| | | |
| | | span { |
| | | flex-shrink: 0; |
| | | font-weight: bold; |
| | | font-size: 18px; |
| | | color: #222222; |
| | | line-height: 27px; |
| | | font-family: "Source Han Sans CN Bold Bold"; |
| | | } |
| | | img { |
| | | width: 12px; |
| | | height: 19px; |
| | | } |
| | | |
| | | .header-title-left :first-child { |
| | | margin-top: 0; |
| | | 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; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | .header-title-left { |
| | | margin-top: 0; |
| | | } |
| | | } |
| | | |
| | | .end-btn { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 10px; |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 10px; |
| | | |
| | | button { |
| | | width: 180px; |
| | | height: 36px; |
| | | } |
| | | button { |
| | | width: 180px; |
| | | height: 36px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <span class="noRequire">附件</span> |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="name" style="margin-top: 18px"> |
| | | <el-form-item prop="name" style="margin-top: -18px"> |
| | | <el-upload action="#" :file-list="fileList" disabled> |
| | | <el-button size="small" type="primary" disabled>点击上传</el-button> |
| | | <!-- <el-button size="small" type="primary" disabled>点击上传</el-button> --> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <el-table-column prop="reportCode" label="报告编号" /> |
| | | <el-table-column prop="createBy" label="制定人" /> |
| | | <el-table-column prop="createTime" label="制定日期" /> |
| | | <el-table-column prop="status" label="状态"> |
| | | <el-table-column prop="status" label="状态" v-if="!isChemist"> |
| | | <template #default="{ row }"> |
| | | <el-tag :type="getStatusType(row.status)"> |
| | | {{ getStatusText(row.status) }} |
| | |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="name" style="margin-top: 18px"> |
| | | <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> |
| | | </el-form-item> |
| | | |
| | | <div class="end-btn" style="margin-top: 38px"> |
| | |
| | | import AiEditor from '@/components/AiEditor' |
| | | import chooseProject from '@/components/chooseProject' |
| | | import { addData, getDetail, editData } from './service' |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | getDetail(this.$route.query.id).then(res => { |
| | | this.form = res |
| | | this.tableData = [{ ...res.projectTeamVO,staffName:res.projectTeamVO.staffs.map(item=>item.nickName).join(',')}] |
| | | this.fileList = res.fileList || [] |
| | | 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.qaReportFiles = res.qaReportFileList |
| | | } else { |
| | | this.fileList = [] |
| | | this.form.qaReportFiles = [] |
| | | } |
| | | }) |
| | | }, |
| | | getProjectData(data) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | beforeUpload(file) { |
| | | return true; |
| | | }, |
| | | handleUpload(options) { |
| | | const file = options.file; |
| | | // 上传前校验 |
| | | beforeUpload(file) { |
| | | return true; |
| | | }, |
| | | // 自定义上传处理 |
| | | handleUpload(options) { |
| | | const { file, onSuccess, onError } = options; |
| | | |
| | | // 使用封装的customUploadRequest方法 |
| | | customUploadRequest({ |
| | | file, |
| | | onSuccess: (res) => { |
| | | console.log() |
| | | if (res.code === 200) { |
| | | const fileObj = { |
| | | fileName: file.name, |
| | | fileSize: file.size, |
| | | createTime: new Date().toISOString(), |
| | | createBy: '当前用户', |
| | | reportType: 4, |
| | | status: 1, |
| | | id: Date.now().toString(), |
| | | fileUrl: 'https://example.com/default-file-url' |
| | | id: new Date().getTime(), |
| | | reportId: this.$route.query.id ? this.$route.query.id : '', |
| | | fileUrl: res.msg || res.data || '', |
| | | reportType: 4, // 可行性研究报告类型 |
| | | fileName: file.name, |
| | | fileSize: file.size, |
| | | }; |
| | | |
| | | |
| | | // 添加到文件列表显示 |
| | | this.fileList.push({ |
| | | name: file.name, |
| | | url: fileObj.fileUrl |
| | | name: file.name, |
| | | url: getFullUrl(fileObj.fileUrl), |
| | | uid: fileObj.id |
| | | }); |
| | | |
| | | |
| | | // 添加到表单数据 |
| | | this.form.qaReportFiles.push(fileObj); |
| | | |
| | | |
| | | this.$message.success('文件上传成功'); |
| | | onSuccess(res); |
| | | } else { |
| | | this.$message.error(res.message || '文件上传失败'); |
| | | onError(); |
| | | } |
| | | }, |
| | | 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); |
| | | } |
| | | }, |
| | | onError: (err) => { |
| | | this.$message.error('文件上传失败'); |
| | | onError(err); |
| | | } |
| | | }); |
| | | }, |
| | | // 删除文件 |
| | | 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); |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | </div> |
| | | <el-form-item prop="name" style="margin-top: 18px"> |
| | | <el-upload action="#" :file-list="fileList" disabled> |
| | | <el-button size="small" type="primary" disabled>点击上传</el-button> |
| | | <!-- <el-button size="small" type="primary" disabled>点击上传</el-button> --> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | }] |
| | | } |
| | | if(res.qaTestItemReportList.length > 0){ |
| | | this.reportTableData = res.qaTestItemReportList |
| | | this.allReportTableData = res.qaTestItemReportList |
| | | this.reportTableData = res.qaTestItemReportList.filter(item => item.status != '-1') |
| | | } |
| | | } else { |
| | | this.$message.error(res.msg || '获取详情失败') |
| | |
| | | }, |
| | | handleTypeChange(type) { |
| | | this.currentType = type; |
| | | this.getReportList(); |
| | | this.getReportList(type); |
| | | }, |
| | | handleReportRowClick(row, column, event) { |
| | | if (column.label === '操作') return |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getReportList() { |
| | | getReportList(type) { |
| | | // 获取报告列表数据 |
| | | // TODO: 调用接口获取数据 |
| | | if(type=='list'){ |
| | | this.reportTableData = this.allReportTableData.filter(item => item.status != '-1'); |
| | | }else{ |
| | | this.reportTableData = this.allReportTableData.filter(item => item.status == '-1'); |
| | | } |
| | | |
| | | }, |
| | | handleRevokeApproval(row) { |
| | | this.currentRow = row; |
| | |
| | | </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 type="primary" @click="handleApprove" v-if="type === 'approve'">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | <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="状态" v-if="isApprovaler"> |
| | | <el-table-column prop="age" label="状态" v-if="!isChemist"> |
| | | <template #default="{ row }"> |
| | | |
| | | <template v-if="isChemist"> |
| | |
| | | <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: 18px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="reportTitle" label="报告标题"> |
| | | <el-input v-model="form.reportTitle" style="width: 100%;" placeholder="请输入报告标题" /> |
| | | </el-form-item> |
| | | <el-form-item prop="reportCode" label="报告编号" style="margin-left: 100px;"> |
| | | <el-input v-model="form.reportCode" style="width: 100%;" placeholder="请输入报告编号" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="developPersonName" label="制定人"> |
| | | <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 |
| | | placeholder="请选择日期" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <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: 18px" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="reportTitle" label="报告标题"> |
| | | <el-input |
| | | v-model="form.reportTitle" |
| | | style="width: 100%" |
| | | placeholder="请输入报告标题" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | prop="reportCode" |
| | | label="报告编号" |
| | | style="margin-left: 100px" |
| | | > |
| | | <el-input |
| | | v-model="form.reportCode" |
| | | style="width: 100%" |
| | | placeholder="请输入报告编号" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="developPersonName" label="制定人"> |
| | | <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 |
| | | placeholder="请选择日期" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <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: 18px"> |
| | | <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: 18px"> |
| | | <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-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: 18px"> |
| | | <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: 18px"> |
| | | <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-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> |
| | | <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' |
| | | import { Card } from "element-ui"; |
| | | import AiEditor from "@/components/AiEditor"; |
| | | import chooseProject from "@/components/chooseProject"; |
| | | import { addData, getDetail, editData } from "./service"; |
| | | import { customUploadRequest, getFullUrl } from "@/utils/utils"; |
| | | |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | | chooseProject |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | form: { |
| | | reportCode: "", |
| | | reportTitle: "", |
| | | reportText: "", |
| | | developPerson: "", |
| | | developPersonName: "", |
| | | developDate: "", |
| | | reportType: 2, |
| | | status: 1, |
| | | teamId: "", |
| | | qaReportFiles: [], |
| | | commitPersonId: null, |
| | | }, |
| | | tableData: [], |
| | | fileList: [], // 附件列表 |
| | | showChoose: false, |
| | | rules: { |
| | | reportTitle: [ |
| | | { required: true, message: '请输入报告标题', trigger: 'blur' } |
| | | ], |
| | | }, |
| | | queryForm: {} |
| | | components: { |
| | | AiEditor, |
| | | chooseProject, |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | form: { |
| | | reportCode: "", |
| | | reportTitle: "", |
| | | reportText: "", |
| | | developPerson: "", |
| | | developPersonName: "", |
| | | developDate: "", |
| | | reportType: 2, |
| | | status: 1, |
| | | teamId: "", |
| | | qaReportFiles: [], |
| | | commitPersonId: null, |
| | | }, |
| | | tableData: [], |
| | | fileList: [], // 附件列表 |
| | | showChoose: false, |
| | | rules: { |
| | | reportTitle: [ |
| | | { required: true, message: "请输入报告标题", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | queryForm: {}, |
| | | }; |
| | | }, |
| | | |
| | | mounted() { |
| | | this.form.developPerson = JSON.parse( |
| | | sessionStorage.getItem("userInfo") |
| | | ).nickName; |
| | | this.form.developPersonName = JSON.parse( |
| | | sessionStorage.getItem("userInfo") |
| | | ).nickName; |
| | | this.form.commitPersonId = JSON.parse( |
| | | sessionStorage.getItem("userInfo") |
| | | ).userId; |
| | | this.form.developDate = new Date().toISOString().split("T")[0]; |
| | | |
| | | if (this.$route.query.id) { |
| | | this.getDetail(); |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | | getDetail(this.$route.query.id).then((res) => { |
| | | this.form = res; |
| | | this.tableData = [ |
| | | { |
| | | ...res.projectTeamVO, |
| | | staffName: res.projectTeamVO.staffs |
| | | .map((item) => item.nickName) |
| | | .join(","), |
| | | }, |
| | | ]; |
| | | 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.qaReportFiles = res.qaReportFileList; |
| | | } else { |
| | | this.fileList = []; |
| | | this.form.qaReportFiles = []; |
| | | } |
| | | }); |
| | | }, |
| | | getProjectData(data) { |
| | | this.tableData = [data]; |
| | | this.$forceUpdate(); |
| | | this.showChoose = false; |
| | | }, |
| | | submit() { |
| | | if (this.tableData.length == 0) { |
| | | this.$message.error("请选择项目组"); |
| | | return; |
| | | } |
| | | |
| | | mounted() { |
| | | this.form.developPerson = JSON.parse(sessionStorage.getItem('userInfo')).nickName; |
| | | this.form.developPersonName = JSON.parse(sessionStorage.getItem('userInfo')).nickName; |
| | | this.form.commitPersonId = JSON.parse(sessionStorage.getItem('userInfo')).userId |
| | | this.form.developDate = new Date().toISOString().split('T')[0]; |
| | | |
| | | if (this.$route.query.id) { |
| | | this.getDetail() |
| | | this.$refs.form.validate((valid) => { |
| | | if (this.$refs.materialEditor.getContent() == "<p></p>") { |
| | | this.$message.error("请输入报告正文"); |
| | | return; |
| | | } |
| | | |
| | | let data = { |
| | | ...this.form, |
| | | reportText: this.$refs.materialEditor.getContent(), |
| | | teamId: this.tableData[0].id, |
| | | status: 1, // 待审核状态 |
| | | commitPersonId: JSON.parse(sessionStorage.getItem("userInfo")).userId, |
| | | }; |
| | | |
| | | 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); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | } 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, |
| | | reportText: this.$refs.materialEditor.getContent(), |
| | | teamId: this.tableData[0].id, |
| | | status: -1, // 草稿箱状态 |
| | | commitPersonId: JSON.parse(sessionStorage.getItem("userInfo")).userId, |
| | | }; |
| | | |
| | | methods: { |
| | | getDetail() { |
| | | getDetail(this.$route.query.id).then(res => { |
| | | this.form = res |
| | | this.tableData = [{ ...res.projectTeamVO,staffName:res.projectTeamVO.staffs.map(item=>item.nickName).join(',')}] |
| | | this.fileList = res.fileList || [] |
| | | }) |
| | | }, |
| | | getProjectData(data) { |
| | | this.tableData = [data] |
| | | this.$forceUpdate() |
| | | this.showChoose = false |
| | | }, |
| | | submit() { |
| | | if (this.tableData.length == 0) { |
| | | this.$message.error('请选择项目组') |
| | | return |
| | | } |
| | | 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); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | } 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; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // 上传前校验 |
| | | beforeUpload(file) { |
| | | return true; |
| | | }, |
| | | // 自定义上传处理 |
| | | handleUpload(options) { |
| | | const { file, onSuccess, onError } = options; |
| | | |
| | | this.$refs.form.validate((valid) => { |
| | | if (this.$refs.materialEditor.getContent() == '<p></p>') { |
| | | this.$message.error('请输入报告正文') |
| | | return |
| | | } |
| | | |
| | | let data = { |
| | | ...this.form, |
| | | reportText: this.$refs.materialEditor.getContent(), |
| | | teamId: this.tableData[0].id, |
| | | status: 1, // 待审核状态 |
| | | commitPersonId: JSON.parse(sessionStorage.getItem('userInfo')).userId |
| | | } |
| | | |
| | | 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) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | } 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, |
| | | reportText: this.$refs.materialEditor.getContent(), |
| | | teamId: this.tableData[0].id, |
| | | status: -1, // 草稿箱状态 |
| | | commitPersonId: JSON.parse(sessionStorage.getItem('userInfo')).userId |
| | | } |
| | | |
| | | 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) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | } 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 |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | beforeUpload(file) { |
| | | return true; |
| | | }, |
| | | handleUpload(options) { |
| | | const file = options.file; |
| | | // 使用封装的customUploadRequest方法 |
| | | customUploadRequest({ |
| | | file, |
| | | onSuccess: (res) => { |
| | | console.log() |
| | | if (res.code === 200) { |
| | | const fileObj = { |
| | | fileName: file.name, |
| | | fileSize: file.size, |
| | | createTime: new Date().toISOString(), |
| | | createBy: '当前用户', |
| | | reportType: 3, |
| | | status: 1, |
| | | id: Date.now().toString(), |
| | | fileUrl: 'https://example.com/default-file-url' |
| | | id: new Date().getTime(), |
| | | reportId: this.$route.query.id ? this.$route.query.id : '', |
| | | fileUrl: res.msg || res.data || '', |
| | | reportType: 3, // 可行性研究报告类型 |
| | | fileName: file.name, |
| | | fileSize: file.size, |
| | | }; |
| | | |
| | | |
| | | // 添加到文件列表显示 |
| | | this.fileList.push({ |
| | | name: file.name, |
| | | url: fileObj.fileUrl |
| | | name: file.name, |
| | | url: getFullUrl(fileObj.fileUrl), |
| | | uid: fileObj.id |
| | | }); |
| | | |
| | | |
| | | // 添加到表单数据 |
| | | this.form.qaReportFiles.push(fileObj); |
| | | |
| | | |
| | | this.$message.success('文件上传成功'); |
| | | onSuccess(res); |
| | | } else { |
| | | this.$message.error(res.message || '文件上传失败'); |
| | | onError(); |
| | | } |
| | | }, |
| | | 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); |
| | | } |
| | | }, |
| | | onError: (err) => { |
| | | this.$message.error('文件上传失败'); |
| | | onError(err); |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | // 删除文件 |
| | | 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); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </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; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 20px; |
| | | gap: 13px; |
| | | margin-top: 38px; |
| | | |
| | | .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; |
| | | } |
| | | } |
| | | |
| | | span { |
| | | flex-shrink: 0; |
| | | font-weight: bold; |
| | | font-size: 18px; |
| | | color: #222222; |
| | | line-height: 27px; |
| | | font-family: "Source Han Sans CN Bold Bold"; |
| | | } |
| | | img { |
| | | width: 12px; |
| | | height: 19px; |
| | | } |
| | | |
| | | .header-title-left :first-child { |
| | | margin-top: 0; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | .header-title-left { |
| | | margin-top: 0; |
| | | } |
| | | } |
| | | |
| | | .end-btn { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 10px; |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 10px; |
| | | |
| | | button { |
| | | width: 180px; |
| | | height: 36px; |
| | | // background: #409EFF; |
| | | } |
| | | button { |
| | | width: 180px; |
| | | height: 36px; |
| | | // background: #409EFF; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" :close-on-click-modal="false" |
| | | @close="handleClose"> |
| | | <div class="approval-dialog"> |
| | | <!-- 左侧审批内容 --> |
| | | <div class="approval-content"> |
| | | <Card class="approval-content-card"> |
| | | <template style="position: relative"> |
| | | <div class="header-title" style="width: 100%;"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>所属项目组</div> |
| | | </div> |
| | | </div> |
| | | <Table :height="null" :total="0" :data="tableData"> |
| | | <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: 18px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="reportTitle" label="报告标题"> |
| | | <el-input v-model="form.reportTitle" style="width: 100%;" placeholder="请输入报告标题" |
| | | disabled /> |
| | | </el-form-item> |
| | | <el-form-item prop="reportCode" label="报告编号" style="margin-left: 100px;"> |
| | | <el-input v-model="form.reportCode" style="width: 100%;" placeholder="请输入报告编号" |
| | | disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="developPerson" label="制定人"> |
| | | <el-input v-model="form.developPerson" 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 placeholder="请选择日期" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <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: 18px"> |
| | | <ai-editor :value="form.reportText" style="width: 100%;" placeholder="请输入报告正文" |
| | | :readOnly="true" /> |
| | | </el-form-item> |
| | | <div class="header-title" style="width: 100%;"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <span class="noRequire">附件</span> |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="name" style="margin-top: 18px"> |
| | | <el-upload action="#" :file-list="fileList" disabled> |
| | | <el-button size="small" type="primary" disabled>点击上传</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | </Card> |
| | | <el-dialog |
| | | :title="dialogTitle" |
| | | :visible.sync="dialogVisible" |
| | | width="80%" |
| | | :close-on-click-modal="false" |
| | | @close="handleClose" |
| | | > |
| | | <div class="approval-dialog"> |
| | | <!-- 左侧审批内容 --> |
| | | <div class="approval-content"> |
| | | <Card class="approval-content-card"> |
| | | <template style="position: relative"> |
| | | <div class="header-title" style="width: 100%"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>所属项目组</div> |
| | | </div> |
| | | </div> |
| | | <!-- 右侧审批流程 --> |
| | | <div class="approval-flow"> |
| | | <div class="flow-content"> |
| | | <approval-process :processData="form.processData" /> |
| | | <Table :height="null" :total="0" :data="tableData"> |
| | | <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: 18px" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="reportTitle" label="报告标题"> |
| | | <el-input |
| | | v-model="form.reportTitle" |
| | | style="width: 100%" |
| | | placeholder="请输入报告标题" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | prop="reportCode" |
| | | label="报告编号" |
| | | style="margin-left: 100px" |
| | | > |
| | | <el-input |
| | | v-model="form.reportCode" |
| | | style="width: 100%" |
| | | placeholder="请输入报告编号" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="developPerson" label="制定人"> |
| | | <el-input |
| | | v-model="form.developPerson" |
| | | 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 |
| | | placeholder="请选择日期" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <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: 18px"> |
| | | <ai-editor |
| | | :value="form.reportText" |
| | | style="width: 100%" |
| | | placeholder="请输入报告正文" |
| | | :readOnly="true" |
| | | /> |
| | | </el-form-item> |
| | | <div class="header-title" style="width: 100%"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <span class="noRequire">附件</span> |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="name" style="margin-top: 18px"> |
| | | <el-upload action="#" :file-list="fileList" disabled> |
| | | <!-- <el-button size="small" type="primary" disabled |
| | | >点击上传</el-button |
| | | > --> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | </Card> |
| | | </div> |
| | | <!-- 右侧审批流程 --> |
| | | <div class="approval-flow"> |
| | | <div class="flow-content"> |
| | | <approval-process :processData="form.processData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="approval-dialog-approve" v-if="type == 'approve'"> |
| | | <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> |
| | | <div |
| | | class="reject" |
| | | :class="status == '2' && 'activeStatus'" |
| | | @click.stop="status = 2" |
| | | > |
| | | 驳回 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="approval-dialog-approve" v-if="type == 'approve'"> |
| | | <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> |
| | | <div class="reject" :class="status == '2' && 'activeStatus'" @click.stop="status = 2"> |
| | | 驳回 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="remark"> |
| | | <div class="remark-title">审批意见</div> |
| | | <el-input type="textarea" v-model="remark" placeholder="请输入审批意见" /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </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> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="remark"> |
| | | <div class="remark-title">审批意见</div> |
| | | <el-input |
| | | type="textarea" |
| | | v-model="remark" |
| | | placeholder="请输入审批意见" |
| | | /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </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 |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import ApprovalProcess from '@/components/approvalProcess' |
| | | import AiEditor from '@/components/AiEditor' |
| | | import { getDetail, audit } from '../../service' |
| | | import ApprovalProcess from "@/components/approvalProcess"; |
| | | import AiEditor from "@/components/AiEditor"; |
| | | import { getDetail, audit } from "../../service"; |
| | | |
| | | export default { |
| | | name: "ApprovalDialog", |
| | | components: { |
| | | ApprovalProcess, |
| | | AiEditor |
| | | name: "ApprovalDialog", |
| | | components: { |
| | | ApprovalProcess, |
| | | AiEditor, |
| | | }, |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | type: { |
| | | type: String, |
| | | default: "approve", // approve-审批,view-查看 |
| | | }, |
| | | data: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | type: { |
| | | type: String, |
| | | default: "approve", // approve-审批,view-查看 |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | form: { |
| | | reportCode: "", |
| | | reportTitle: "", |
| | | reportText: "", |
| | | developPerson: "", |
| | | developPersonName: "", |
| | | developDate: "", |
| | | reportType: 2, |
| | | status: 1, |
| | | teamId: "", |
| | | qaReportFiles: [], |
| | | commitPersonId: null, |
| | | processData:[] |
| | | }, |
| | | tableData: [], |
| | | fileList: [], // 附件列表 |
| | | rules: {}, |
| | | status: "1", |
| | | remark: "", |
| | | }; |
| | | data: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | computed: { |
| | | dialogTitle() { |
| | | return this.type == "approve" ? "审批" : "审批详情"; |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | form: { |
| | | reportCode: "", |
| | | reportTitle: "", |
| | | reportText: "", |
| | | developPerson: "", |
| | | developPersonName: "", |
| | | developDate: "", |
| | | reportType: 2, |
| | | status: 1, |
| | | teamId: "", |
| | | qaReportFiles: [], |
| | | commitPersonId: null, |
| | | processData: [], |
| | | }, |
| | | tableData: [], |
| | | fileList: [], // 附件列表 |
| | | rules: {}, |
| | | status: "1", |
| | | remark: "", |
| | | }; |
| | | }, |
| | | computed: { |
| | | dialogTitle() { |
| | | return this.type == "approve" ? "审批" : "审批详情"; |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(val) { |
| | | this.dialogVisible = val; |
| | | if (val && this.data.id) { |
| | | this.getDetail(); |
| | | } |
| | | }, |
| | | immediate: true |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(val) { |
| | | this.dialogVisible = val; |
| | | if (val && this.data.id) { |
| | | this.getDetail(); |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | methods: { |
| | | getDetail() { |
| | | getDetail(this.data.id).then(res => { |
| | | if (res) { |
| | | this.form = { ...res, processData: [] }; |
| | | // 组装流程数据 |
| | | let processData = []; |
| | | // 提交节点 |
| | | processData.push({ |
| | | type: "primary", |
| | | mode: "list", |
| | | fields: [ |
| | | { label: "提交人:", value: res.updateBy || "" }, |
| | | { label: "提交时间:", value: res.createTime || "" }, |
| | | ], |
| | | }); |
| | | if (res.status == 2 || res.status == 4) { |
| | | processData.push({ |
| | | type: |
| | | res.status == 2 |
| | | ? "primary" |
| | | : res.status == 4 |
| | | ? "primary" |
| | | : "warning", |
| | | mode: "list", |
| | | fields: [ |
| | | { |
| | | label: "审核结果:", |
| | | value: |
| | | res.status == 2 |
| | | ? "通过" |
| | | : res.status == 4 |
| | | ? "驳回" |
| | | : "待审批", |
| | | }, |
| | | { label: "审批意见:", value: res.auditRemark || "" }, |
| | | { label: "审核人:", value: res.auditPersonName || res.auditPersonId||"" }, |
| | | { label: "审核时间:", value: res.auditTime || "" }, |
| | | ], |
| | | }); |
| | | } else { |
| | | processData.push({ |
| | | type: "warning", |
| | | mode: "list", |
| | | fields: [ |
| | | { label: "等待审核" }, |
| | | ], |
| | | }); |
| | | } |
| | | |
| | | this.tableData = [{ ...res.projectTeamVO,staffName:res.projectTeamVO.staffs.map(item=>item.nickName).join(',')}] |
| | | this.fileList = res.qaReportFileList.map(item => { |
| | | return { |
| | | ...item, |
| | | name: item.fileName, |
| | | url: item.fileUrl |
| | | } |
| | | }) || []; |
| | | this.$nextTick(() => { |
| | | this.form.processData = processData; |
| | | }) |
| | | } else { |
| | | this.$message.error(res.message || '获取详情失败'); |
| | | } |
| | | }).catch(err => { |
| | | console.error('获取详情失败:', err); |
| | | this.$message.error('获取详情失败'); |
| | | }, |
| | | methods: { |
| | | getDetail() { |
| | | getDetail(this.data.id) |
| | | .then((res) => { |
| | | if (res) { |
| | | this.form = { ...res, processData: [] }; |
| | | // 组装流程数据 |
| | | let processData = []; |
| | | // 提交节点 |
| | | processData.push({ |
| | | type: "primary", |
| | | mode: "list", |
| | | fields: [ |
| | | { label: "提交人:", value: res.updateBy || "" }, |
| | | { label: "提交时间:", value: res.createTime || "" }, |
| | | ], |
| | | }); |
| | | }, |
| | | handleClose() { |
| | | this.$emit("close"); |
| | | this.form.approvalComment = ""; |
| | | }, |
| | | handleApprove() { |
| | | if (this.status == "2" && !this.remark) { |
| | | this.$message.warning("请输入审批意见"); |
| | | return; |
| | | if (res.status == 2 || res.status == 4) { |
| | | processData.push({ |
| | | type: |
| | | res.status == 2 |
| | | ? "primary" |
| | | : res.status == 4 |
| | | ? "primary" |
| | | : "warning", |
| | | mode: "list", |
| | | fields: [ |
| | | { |
| | | label: "审核结果:", |
| | | value: |
| | | res.status == 2 |
| | | ? "通过" |
| | | : res.status == 4 |
| | | ? "驳回" |
| | | : "待审批", |
| | | }, |
| | | { label: "审批意见:", value: res.auditRemark || "" }, |
| | | { |
| | | label: "审核人:", |
| | | value: res.auditPersonName || res.auditPersonId || "", |
| | | }, |
| | | { label: "审核时间:", value: res.auditTime || "" }, |
| | | ], |
| | | }); |
| | | } else { |
| | | processData.push({ |
| | | type: "warning", |
| | | mode: "list", |
| | | fields: [{ label: "等待审核" }], |
| | | }); |
| | | } |
| | | const params = { |
| | | id: this.data.id, |
| | | auditStatus: this.status == "1" ? 2 : 4, // 1=通过(2),2=驳回(4) |
| | | auditRemark: this.remark |
| | | }; |
| | | audit(params).then(res => { |
| | | if (res) { |
| | | this.$message.success("审批成功"); |
| | | this.$emit("close"); |
| | | } else { |
| | | this.$message.error(res.message || "审批失败"); |
| | | } |
| | | }).catch(err => { |
| | | console.error("审批失败:", err); |
| | | this.$message.error("审批失败"); |
| | | |
| | | this.tableData = [ |
| | | { |
| | | ...res.projectTeamVO, |
| | | staffName: res.projectTeamVO.staffs |
| | | .map((item) => item.nickName) |
| | | .join(","), |
| | | }, |
| | | ]; |
| | | if (res.qaReportFileList && res.qaReportFileList.length > 0) { |
| | | this.fileList = res.qaReportFileList.map((item) => { |
| | | return { |
| | | ...item, |
| | | name: item.fileName, |
| | | url: item.fileUrl, |
| | | }; |
| | | }); |
| | | } else { |
| | | this.fileList = []; |
| | | } |
| | | |
| | | this.$nextTick(() => { |
| | | this.form.processData = processData; |
| | | }); |
| | | } |
| | | } else { |
| | | this.$message.error(res.message || "获取详情失败"); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error("获取详情失败:", err); |
| | | this.$message.error("获取详情失败"); |
| | | }); |
| | | }, |
| | | handleClose() { |
| | | this.$emit("close"); |
| | | this.form.approvalComment = ""; |
| | | }, |
| | | handleApprove() { |
| | | if (this.status == "2" && !this.remark) { |
| | | this.$message.warning("请输入审批意见"); |
| | | return; |
| | | } |
| | | const params = { |
| | | id: this.data.id, |
| | | auditStatus: this.status == "1" ? 2 : 4, // 1=通过(2),2=驳回(4) |
| | | auditRemark: this.remark, |
| | | }; |
| | | audit(params) |
| | | .then((res) => { |
| | | if (res) { |
| | | this.$message.success("审批成功"); |
| | | this.$emit("close"); |
| | | } else { |
| | | this.$message.error(res.message || "审批失败"); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error("审批失败:", err); |
| | | this.$message.error("审批失败"); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | ::v-deep .el-dialog__header { |
| | | border-bottom: 1px solid #e4e7ed; |
| | | border-bottom: 1px solid #e4e7ed; |
| | | } |
| | | |
| | | .approval-dialog { |
| | | display: flex; |
| | | height: 40vh; |
| | | display: flex; |
| | | height: 40vh; |
| | | |
| | | .approval-content { |
| | | flex: 3; |
| | | margin-right: 20px; |
| | | background: #ffffff; |
| | | box-shadow: 0px 4px 12px 4px rgba(0, 0, 0, 0.08); |
| | | border-radius: 10px; |
| | | .approval-content { |
| | | flex: 3; |
| | | margin-right: 20px; |
| | | background: #ffffff; |
| | | box-shadow: 0px 4px 12px 4px rgba(0, 0, 0, 0.08); |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | .approval-flow { |
| | | padding: 40px 20px; |
| | | // width: 405px; |
| | | flex: 2; |
| | | background: #ffffff; |
| | | box-shadow: 0px 4px 12px 4px rgba(0, 0, 0, 0.08); |
| | | border-radius: 10px; |
| | | |
| | | .flow-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin-bottom: 20px; |
| | | color: #303133; |
| | | } |
| | | |
| | | .approval-flow { |
| | | padding: 40px 20px; |
| | | // width: 405px; |
| | | flex: 2; |
| | | background: #ffffff; |
| | | box-shadow: 0px 4px 12px 4px rgba(0, 0, 0, 0.08); |
| | | border-radius: 10px; |
| | | .flow-content { |
| | | height: calc(100% - 40px); |
| | | overflow-y: auto; |
| | | |
| | | .flow-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin-bottom: 20px; |
| | | color: #303133; |
| | | } |
| | | |
| | | .flow-content { |
| | | height: calc(100% - 40px); |
| | | overflow-y: auto; |
| | | |
| | | .el-form--inline .el-form-item { |
| | | margin-right: 83px; |
| | | } |
| | | } |
| | | .el-form--inline .el-form-item { |
| | | margin-right: 83px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .approval-content-card { |
| | | height: calc(100% - 100px) !important; |
| | | box-shadow: none !important; |
| | | height: calc(100% - 100px) !important; |
| | | box-shadow: none !important; |
| | | } |
| | | |
| | | .header-title { |
| | | // display: flex; |
| | | // display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 20px; |
| | | gap: 13px; |
| | | |
| | | .header-title-left { |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 20px; |
| | | gap: 13px; |
| | | margin-top: 38px; |
| | | |
| | | .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; |
| | | } |
| | | } |
| | | |
| | | span { |
| | | flex-shrink: 0; |
| | | font-weight: bold; |
| | | font-size: 18px; |
| | | color: #222222; |
| | | line-height: 27px; |
| | | font-family: "Source Han Sans CN Bold Bold"; |
| | | } |
| | | img { |
| | | width: 12px; |
| | | height: 19px; |
| | | } |
| | | |
| | | .header-title-left :first-child { |
| | | margin-top: 0; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | .header-title-left { |
| | | margin-top: 0; |
| | | } |
| | | } |
| | | |
| | | .item-title { |
| | | padding-left: 25px; |
| | | padding-left: 25px; |
| | | |
| | | span { |
| | | flex-shrink: 0; |
| | | font-weight: bold; |
| | | font-size: 14px; |
| | | color: #222222; |
| | | line-height: 27px; |
| | | font-family: "Source Han Sans CN Bold Bold"; |
| | | margin: 18px 0; |
| | | span { |
| | | flex-shrink: 0; |
| | | font-weight: bold; |
| | | font-size: 14px; |
| | | color: #222222; |
| | | line-height: 27px; |
| | | font-family: "Source Han Sans CN Bold Bold"; |
| | | margin: 18px 0; |
| | | |
| | | &:before { |
| | | content: "*"; |
| | | color: #f56c6c; |
| | | margin-right: 4px; |
| | | } |
| | | &:before { |
| | | content: "*"; |
| | | color: #f56c6c; |
| | | margin-right: 4px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .approval-dialog-approve { |
| | | padding: 38px 20px; |
| | | // display: flex; |
| | | align-content: center; |
| | | padding: 38px 20px; |
| | | // display: flex; |
| | | align-content: center; |
| | | |
| | | .status { |
| | | margin-right: 40px; |
| | | max-width: 60%; |
| | | .status { |
| | | margin-right: 40px; |
| | | max-width: 60%; |
| | | } |
| | | |
| | | // align-items: center; |
| | | .status-title { |
| | | color: #222222; |
| | | font-family: "SourceHanSansCN-Medium"; |
| | | line-height: 14px; |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .status-content { |
| | | display: flex; |
| | | align-items: center; |
| | | width: 100%; |
| | | gap: 16px; |
| | | background: #ffffff; |
| | | border-radius: 10px; |
| | | border: 1px solid rgba(4, 156, 154, 0.5); |
| | | |
| | | .resolve { |
| | | border-radius: 10px; |
| | | flex: 1; |
| | | font-size: 16px; |
| | | // padding: 5px 55px; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | cursor: pointer; |
| | | line-height: 32px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | // align-items: center; |
| | | .status-title { |
| | | color: #222222; |
| | | font-family: "SourceHanSansCN-Medium"; |
| | | line-height: 14px; |
| | | margin-bottom: 16px; |
| | | .reject { |
| | | flex: 1; |
| | | border-radius: 10px; |
| | | font-size: 16px; |
| | | line-height: 32px; |
| | | // padding: 5px 55px; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | cursor: pointer; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .status-content { |
| | | display: flex; |
| | | align-items: center; |
| | | width: 100%; |
| | | gap: 16px; |
| | | background: #ffffff; |
| | | border-radius: 10px; |
| | | border: 1px solid rgba(4, 156, 154, 0.5); |
| | | |
| | | .resolve { |
| | | border-radius: 10px; |
| | | flex: 1; |
| | | font-size: 16px; |
| | | // padding: 5px 55px; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | cursor: pointer; |
| | | line-height: 32px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center |
| | | } |
| | | |
| | | .reject { |
| | | flex: 1; |
| | | border-radius: 10px; |
| | | font-size: 16px; |
| | | line-height: 32px; |
| | | // padding: 5px 55px; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | cursor: pointer; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center |
| | | } |
| | | |
| | | .activeStatus { |
| | | background: #ebfefd; |
| | | color: #049c9a; |
| | | box-shadow: 0px 0px 6px 0px rgba(10, 109, 108, 0.25); |
| | | border-radius: 10px; |
| | | } |
| | | .activeStatus { |
| | | background: #ebfefd; |
| | | color: #049c9a; |
| | | box-shadow: 0px 0px 6px 0px rgba(10, 109, 108, 0.25); |
| | | border-radius: 10px; |
| | | } |
| | | } |
| | | |
| | | .remark-title { |
| | | color: #222222; |
| | | font-family: "SourceHanSansCN-Medium"; |
| | | line-height: 14px; |
| | | margin-bottom: 16px; |
| | | } |
| | | .remark-title { |
| | | color: #222222; |
| | | font-family: "SourceHanSansCN-Medium"; |
| | | line-height: 14px; |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | |
| | | .dialog-footer { |
| | | align-items: center; |
| | | display: flex; |
| | | justify-content: center; |
| | | gap: 20px; |
| | | align-items: center; |
| | | display: flex; |
| | | justify-content: center; |
| | | gap: 20px; |
| | | |
| | | button { |
| | | width: 150px; |
| | | } |
| | | button { |
| | | width: 150px; |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | |
| | | |
| | | import axios from '@/utils/request'; |
| | | |
| | | // 获取中试、生产验证分析报告;辅料;产品报告管理评定列表 |
| | | export function evaluateList(data) { |
| | | return axios.post('/api/t-qa-produce-report/evaluateList', { ...data }) |
| | | } |
| | | |
| | | // 查看中试、生产验证分析报告;辅料;产品报告管理详情 |
| | | export function getDetailById(data) { |
| | | return axios.post('/open/t-qa-produce-report/getDetailById', { ...data }) |
| | | } |
New file |
| | |
| | | import axios from '@/utils/request'; |
| | | |
| | | // 项目组总积分分页列表 |
| | | export const pageList = (data) => { |
| | | return axios.post('/api/t-clinical-trial-points/pageList', { ...data }) |
| | | } |
| | | |
| | | export const add = (data) => { |
| | | return axios.post('/api/t-clinical-trial-points/add', { ...data }) |
| | | } |
| | | export const update = (data) => { |
| | | return axios.post('/api/t-clinical-trial-points/update', { ...data }) |
| | | } |
| | | export const deleteById = (data) => { |
| | | return axios.delete('/open/t-clinical-trial-points/deleteById', { params:data }) |
| | | } |
| | | export const deleteByIds = (data) => { |
| | | return axios.delete('/open/t-clinical-trial-points/deleteByIds', { params:data }) |
| | | } |
| | | export const getDetailById = (data) => { |
| | | return axios.get('/open/t-clinical-trial-points/getDetailById', { params:data }) |
| | | } |
New file |
| | |
| | | import axios from '@/utils/request'; |
| | | |
| | | // 获取实验结果汇报评定列表-审批人使用 |
| | | export const evaluatePageList = (data) => { |
| | | return axios.post('/api/t-experiment-result-report/evaluatePageList', { ...data }) |
| | | } |
| | | |
| | | export const add = (data) => { |
| | | return axios.post('/api/t-tester-other-task/add', { ...data }) |
| | | } |
| | | export const update = (data) => { |
| | | return axios.post('/api/t-tester-other-task/update', { ...data }) |
| | | } |
| | | export const deleteById = (data) => { |
| | | return axios.delete('/open/t-tester-other-task/deleteById', { params:data }) |
| | | } |
| | | export const deleteByIds = (data) => { |
| | | return axios.delete('/open/t-tester-other-task/deleteByIds', { params:data }) |
| | | } |
| | | export const getDetailById = (data) => { |
| | | return axios.get('/open/t-tester-other-task/getDetailById', { params:data }) |
| | | } |
| | |
| | | <template #search> |
| | | <el-form :model="form" label-width="140px" 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-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期" |
| | |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="状态:"> |
| | | <el-select placeholder="请选择"></el-select> |
| | | <el-select v-model="form.status" placeholder="请选择"> |
| | | <el-option label="全部" value="" /> |
| | | <el-option label="草稿箱" value="-1" /> |
| | | <el-option label="已提交" value="1" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item class="search-btn-box"> |
| | | <el-button>重置</el-button> |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button @click="handleReset">重置</el-button> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {pageList} from './service.js' |
| | | export default { |
| | | name: 'ProjectTeamIntegral', |
| | | data() { |
| | | return { |
| | | form: { |
| | | teamName: '', // 项目组名称 |
| | | status: '', // 状态 |
| | | date: [], // 日期范围 |
| | | }, |
| | | value1: [], // 用于日期选择器 |
| | | tableData: [], |
| | | queryForm: { |
| | | pageSize: 10, |
| | |
| | | methods: { |
| | | goDetail() { |
| | | this.$router.push({ |
| | | path: '/projectList/addProject' |
| | | path: '/deliveryAssessment/projectTeamIntegral-detail' |
| | | }) |
| | | }, |
| | | handleCurrentChange(page) { |
| | |
| | | this.queryForm.pageSize = size |
| | | this.getList() |
| | | }, |
| | | getList() { |
| | | |
| | | // 查询按钮 |
| | | async handleSearch() { |
| | | this.queryForm.pageNum = 1 |
| | | await this.getList() |
| | | }, |
| | | // 重置按钮 |
| | | handleReset() { |
| | | this.form = { |
| | | teamName: '', |
| | | status: '', |
| | | date: [], |
| | | } |
| | | this.value1 = [] |
| | | this.queryForm.pageNum = 1 |
| | | this.getList() |
| | | }, |
| | | async getList() { |
| | | // 参数组装 |
| | | const params = { |
| | | ...this.queryForm, |
| | | teamName: this.form.teamName, |
| | | status: this.form.status === '' ? undefined : Number(this.form.status), |
| | | } |
| | | // 日期处理 |
| | | if (this.value1 && this.value1.length === 2) { |
| | | params.startTime = this.value1[0] |
| | | params.endTime = this.value1[1] |
| | | } else { |
| | | params.startTime = undefined |
| | | params.endTime = undefined |
| | | } |
| | | try { |
| | | const res = await pageList(params) |
| | | this.tableData = res.records || [] |
| | | this.total = res.total || 0 |
| | | } catch (e) { |
| | | this.tableData = [] |
| | | this.total = 0 |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getList() |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | import axios from '@/utils/request'; |
| | | |
| | | // 项目组总积分分页列表 |
| | | export const pageList = (data) => { |
| | | return axios.post('/api/t-result-work-evaluate/pageList', { ...data }) |
| | | } |
| | |
| | | <template> |
| | | <el-dialog :visible.sync="dialogVisible" title="其他任务详情" width="70%" @close="handleClose"> |
| | | <div class="content-box"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>所属项目组</div> |
| | | </div> |
| | | <Table :data="criteriaList" :height="null"> |
| | | <el-table-column prop="name" label="项目组名称" /> |
| | | <el-table-column prop="name" label="项目负责人" /> |
| | | <el-table-column prop="name" label="项目组成员" /> |
| | | <el-table-column prop="name" label="创建时间" /> |
| | | </Table> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>任务内容</div> |
| | | </div> |
| | | <div>清理</div> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>任务时间</div> |
| | | </div> |
| | | <div>2020-12-31 12:00:00</div> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>评定积分</div> |
| | | </div> |
| | | <div>2</div> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | :visible.sync="dialogVisible" |
| | | :title="type === 'add' ? '新增其他任务' : '其他任务详情'" |
| | | width="70%" |
| | | @close="handleClose" |
| | | > |
| | | <div class="content-box"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>所属项目组</div> |
| | | </div> |
| | | <Table :data="criteriaList" :height="null"> |
| | | <el-table-column prop="name" label="项目组名称" /> |
| | | <el-table-column prop="name" label="项目负责人" /> |
| | | <el-table-column prop="name" label="项目组成员" /> |
| | | <el-table-column prop="name" label="创建时间" /> |
| | | </Table> |
| | | |
| | | <el-row> |
| | | <el-col :span="2"> </el-col> |
| | | <el-col :span="12" :offset="1"> |
| | | <el-form |
| | | :model="form" |
| | | :rules="rules" |
| | | ref="formRef" |
| | | label-width="100px" |
| | | :span="12" |
| | | label-position="top" |
| | | style="margin-top: 20px" |
| | | > |
| | | <el-form-item label="任务人" prop="assignee" required> |
| | | <el-select |
| | | v-model="form.assignee" |
| | | placeholder="请选择" |
| | | :disabled="type === 'detail'" |
| | | > |
| | | <el-option |
| | | v-for="member in memberList" |
| | | :key="member.id" |
| | | :label="member.name" |
| | | :value="member.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="任务内容" prop="taskContent" required> |
| | | <el-input |
| | | v-model="form.taskContent" |
| | | placeholder="请输入" |
| | | :disabled="type === 'detail'" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="任务时间" prop="taskTime" required> |
| | | <el-date-picker |
| | | v-model="form.taskTime" |
| | | type="datetime" |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | :disabled="type === 'detail'" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="评定积分" prop="score" required> |
| | | <el-input |
| | | v-model="form.score" |
| | | placeholder="请输入" |
| | | :disabled="type === 'detail'" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'Detail', |
| | | props: { |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | reportData: { |
| | | type: Object, |
| | | default: () => { } |
| | | } |
| | | name: "Detail", |
| | | props: { |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | form: {}, |
| | | rules: { |
| | | reportName: [ |
| | | { required: true, message: '请输入报告名称', trigger: 'blur' } |
| | | ], |
| | | }, |
| | | criteriaList: [] |
| | | } |
| | | reportData: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | watch: { |
| | | modelValue: { |
| | | handler(val) { |
| | | this.dialogVisible = val; |
| | | }, |
| | | immediate: true |
| | | }, |
| | | reportData: { |
| | | handler(val) { |
| | | if (val) { |
| | | this.form = val || {}; |
| | | } |
| | | }, |
| | | immediate: true |
| | | } |
| | | type: { |
| | | type: String, |
| | | default: "detail", // 'add' 或 'detail' |
| | | }, |
| | | methods: { |
| | | handleClose() { |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | form: { |
| | | assignee: "", |
| | | taskContent: "", |
| | | taskTime: "", |
| | | score: "", |
| | | }, |
| | | rules: { |
| | | assignee: [ |
| | | { required: true, message: "请选择任务人", trigger: "change" }, |
| | | ], |
| | | taskContent: [ |
| | | { required: true, message: "请输入任务内容", trigger: "blur" }, |
| | | ], |
| | | taskTime: [ |
| | | { required: true, message: "请选择任务时间", trigger: "change" }, |
| | | ], |
| | | score: [{ required: true, message: "请输入评定积分", trigger: "blur" }], |
| | | }, |
| | | criteriaList: [], |
| | | memberList: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | | modelValue: { |
| | | handler(val) { |
| | | this.dialogVisible = val; |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | reportData: { |
| | | handler(val) { |
| | | if (val) { |
| | | this.form = { |
| | | assignee: val.assignee || "", |
| | | taskContent: val.taskContent || "", |
| | | taskTime: val.taskTime || "", |
| | | score: val.score || "", |
| | | }; |
| | | this.memberList = val.memberList || []; |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleClose() { |
| | | this.$emit("update:modelValue", false); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .header-title-left { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 13px; |
| | | margin: 10px 0; |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 13px; |
| | | margin: 10px 0; |
| | | |
| | | img { |
| | | width: 12px; |
| | | height: 19px; |
| | | } |
| | | 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'; |
| | | } |
| | | |
| | | |
| | | div { |
| | | flex-shrink: 0; |
| | | font-weight: bold; |
| | | font-size: 18px; |
| | | color: #222222; |
| | | line-height: 27px; |
| | | font-family: "Source Han Sans CN Bold Bold"; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template #search> |
| | | <el-form :model="form" label-width="140px" inline> |
| | | <el-form-item label="项目组名称:"> |
| | | <el-input v-model="form.name" placeholder="请输入" /> |
| | | <el-input v-model="form.groupName" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="任务内容:"> |
| | | <el-input v-model="form.name" placeholder="请输入" /> |
| | | <el-input v-model="form.taskContent" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item class="search-btn-box"> |
| | | <el-button>重置</el-button> |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button @click="handleReset">重置</el-button> |
| | | <el-button type="primary" @click="getList">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | <!-- 工艺工程师 --> |
| | | <template #setting> |
| | | <el-button @click="assessmentVisible = true, currentReport = {}" class="el-icon-plus" type="primary"> |
| | | 新增其他任务</el-button> |
| | | <el-button v-if="roleType==3" @click="handleAdd" class="el-icon-plus" type="primary">新增其他任务</el-button> |
| | | </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="age" label="评定时间" /> |
| | | <el-table-column prop="age" label="操作"> |
| | | <el-table-column :prop="'projectTeam.teamName'" label="所属项目组" /> |
| | | <el-table-column prop="taskContent" label="任务内容" /> |
| | | <el-table-column prop="taskTime" label="任务时间" /> |
| | | <el-table-column prop="testerName" label="添加人" /> |
| | | <el-table-column prop="evaluateScore" label="评定积分" /> |
| | | <el-table-column label="累计分数"> |
| | | <template #default> |
| | | <!-- 累计分数接口未返回,留空或后端补充 --> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="evaluateTime" label="评定时间" /> |
| | | <el-table-column label="操作"> |
| | | <template #default="{ row }"> |
| | | <el-button type="text">详情</el-button> |
| | | <el-button type="text" @click="handleDetail(row)">详情</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </TableCustom> |
| | | |
| | | <Detail :modelValue="assessmentVisible" :reportData="currentReport" /> |
| | | <Detail :modelValue="assessmentVisible" :reportData="currentReport" :type="detailType" @close="assessmentVisible = false" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Detail from './components/detail.vue' |
| | | import { pageList, getDetailById } from './service.js' |
| | | |
| | | export default { |
| | | name: 'RestsTask', |
| | |
| | | data() { |
| | | return { |
| | | form: { |
| | | groupName: '', |
| | | taskContent: '' |
| | | }, |
| | | tableData: [], |
| | | queryForm: { |
| | |
| | | }, |
| | | total: 0, |
| | | assessmentVisible: false, |
| | | currentReport: {} |
| | | currentReport: {}, |
| | | detailType: 'detail', |
| | | loading: false, |
| | | roleType:'', |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getList(); |
| | | const userInfo = JSON.parse(sessionStorage.getItem('userInfo')); |
| | | this.roleType = userInfo?.roleType; |
| | | }, |
| | | methods: { |
| | | handleCurrentChange(page) { |
| | |
| | | this.getList() |
| | | }, |
| | | getList() { |
| | | |
| | | this.loading = true; |
| | | const params = { |
| | | ...this.form, |
| | | ...this.queryForm |
| | | }; |
| | | pageList(params).then(res => { |
| | | if (res && res.data) { |
| | | this.tableData = res.data.records || []; |
| | | this.total = res.data.total || 0; |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | handleReset() { |
| | | this.form = { |
| | | groupName: '', |
| | | taskContent: '' |
| | | }; |
| | | this.queryForm.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | handleAdd() { |
| | | this.currentReport = { |
| | | assignee: '', |
| | | taskContent: '', |
| | | taskTime: '', |
| | | score: '', |
| | | memberList: [] // 这里需要你根据实际情况传入项目组成员 |
| | | }; |
| | | this.detailType = 'add'; |
| | | this.assessmentVisible = true; |
| | | }, |
| | | handleDetail(row) { |
| | | // 处理详情 |
| | | if (!row || !row.id) return; |
| | | getDetailById({ id: row.id }).then(res => { |
| | | if (res && res.data) { |
| | | this.currentReport = res.data; |
| | | this.detailType = 'detail'; |
| | | this.assessmentVisible = true; |
| | | } |
| | | }); |
| | | }, |
| | | handleAssessment(row) { |
| | | this.currentReport = row; |
New file |
| | |
| | | import axios from '@/utils/request'; |
| | | |
| | | // 项目组总积分分页列表 |
| | | export const pageList = (data) => { |
| | | return axios.post('/api/t-tester-other-task/pageList', { ...data }) |
| | | } |
| | | |
| | | export const add = (data) => { |
| | | return axios.post('/api/t-tester-other-task/add', { ...data }) |
| | | } |
| | | export const update = (data) => { |
| | | return axios.post('/api/t-tester-other-task/update', { ...data }) |
| | | } |
| | | export const deleteById = (data) => { |
| | | return axios.delete('/open/t-tester-other-task/deleteById', { params:data }) |
| | | } |
| | | export const deleteByIds = (data) => { |
| | | return axios.delete('/open/t-tester-other-task/deleteByIds', { params:data }) |
| | | } |
| | | export const getDetailById = (data) => { |
| | | return axios.get('/open/t-tester-other-task/getDetailById', { params:data }) |
| | | } |
New file |
| | |
| | | import axios from '@/utils/request'; |
| | | |
| | | // 项目组总积分分页列表 |
| | | export const pageList = (data) => { |
| | | return axios.post('/api/t-result-work-evaluate/testerEvaluateList', { ...data }) |
| | | } |
| | | |
| | | export const add = (data) => { |
| | | return axios.post('/api/t-result-work-evaluate/add', { ...data }) |
| | | } |
| | | export const update = (data) => { |
| | | return axios.post('/api/t-tester-other-task/update', { ...data }) |
| | | } |
| | | export const deleteById = (data) => { |
| | | return axios.delete('/open/t-tester-other-task/deleteById', { params:data }) |
| | | } |
| | | export const deleteByIds = (data) => { |
| | | return axios.delete('/open/t-tester-other-task/deleteByIds', { params:data }) |
| | | } |
| | | export const getDetailById = (data) => { |
| | | return axios.delete('/open/t-tester-other-task/getDetailById', { params:data }) |
| | | } |
New file |
| | |
| | | import axios from '@/utils/request'; |
| | | |
| | | // 查询列表 |
| | | export function getDataList(data) { |
| | | return axios.post('/api/t-qa-test-item/pageList', { ...data }) |
| | | } |
| | | |
| | | |
| | | //获取详情 |
| | | export function getDetail(id) { |
| | | return axios.get(`/open/t-qa-test-item/getDetailById?id=${id}`) |
| | | } |
| | | |
| | | |
| | | //评定QA检测项管理 |
| | | export function evaluate(data) { |
| | | return axios.put(`/api/t-qa-test-item/evaluate`, { ...data }) |
| | | } |
| | | |
| | | |
| | | // 下面的是二级的接口 |
| | | |
| | | export function detailPageList(data) { |
| | | return axios.post(`/api/t-qa-test-item-report/pageList`,{...data}) |
| | | } |
| | | export function detailAuditReport(data) { |
| | | return axios.post(`/api/t-qa-test-item-report/auditReport`,{...data}) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | export function getDetailInfo(data) { |
| | | return axios.get(`/open/t-qa-test-item-report/getDetailById?id=${data.id}`) |
| | | } |
| | | // 获取QA检测项报告管理下拉列表-化验师使用、评定使用 |
| | | export function getListByItemId(data) { |
| | | return axios.get(`/open/t-qa-test-item-report/getListByItemId?itemId=${data.id}`) |
| | | } |
| | |
| | | <div>报告编号</div> |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="reportCode" style="margin-top: 38px"> |
| | | <el-form-item prop="reportCode" style="margin-top: 18px"> |
| | | <el-input disabled v-model="form.reportCode" style="width: 100%;" |
| | | placeholder="请输入报告编号" /> |
| | | </el-form-item> |
| | |
| | | <div>报告名称</div> |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="reportName" style="margin-top: 38px"> |
| | | <el-form-item prop="reportName" style="margin-top: 18px"> |
| | | <el-input disabled v-model="form.reportName" style="width: 100%;" |
| | | placeholder="请输入报告名称" /> |
| | | </el-form-item> |
| | |
| | | <div>报告正文</div> |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="reportText" style="margin-top: 38px"> |
| | | <el-form-item prop="reportText" style="margin-top: 18px"> |
| | | <ai-editor :readOnly="true" :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>附件</div> |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="feasibilityReportFiles" style="margin-top: -18px"> |
| | | <el-upload |
| | | disabled |
| | | :file-list="form.feasibilityReportFiles" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | |
| | | this.form = { |
| | | ...this.form, |
| | | ...data, |
| | | feasibilityReportFiles:data.feasibilityReportFiles.map(item => ({ |
| | | name: item.fileName, |
| | | url: item.fileUrl |
| | | })) || [], |
| | | processData: [] |
| | | }; |
| | | |
| | |
| | | ] |
| | | }); |
| | | |
| | | if (data.status == 2 || data.status == 3) { |
| | | if (data.status == 2 || data.status == 4) { |
| | | processData.push({ |
| | | type: "primary", |
| | | mode: "list", |
| | |
| | | // display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 20px; |
| | | margin-bottom: 10px; |
| | | gap: 13px; |
| | | |
| | | .header-title-left { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 13px; |
| | | margin-top: 38px; |
| | | margin-top: 18px; |
| | | |
| | | img { |
| | | width: 12px; |