| | |
| | | border-color: #009688 !important; |
| | | background: #e6ffff !important; |
| | | } |
| | | .el-form { |
| | | .el-date-editor--daterange{ |
| | | .el-range-separator{ |
| | | width: 30px; |
| | | } |
| | | .el-input__inner { |
| | | width: 220px !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | .card-custom { |
| | | .el-form { |
| | |
| | | line-height: 14px; |
| | | } |
| | | |
| | | |
| | | .el-input__inner { |
| | | width: 290px !important; |
| | | padding: 0 12px; |
| | | border-radius: 6px; |
| | | border: 1px solid rgba(0, 0, 0, 0.15); |
| | | } |
| | | .el-date-editor{ |
| | | width: 350px !important; |
| | | } |
| | | |
| | | .el-date-editor { |
| | | |
| | | .el-range-editor--small .el-range-separator { |
| | | width: 22px; |
| | | .el-range-separator { |
| | | width: 30px !important; |
| | | } |
| | | |
| | | .el-input__inner { |
| | |
| | | border-radius: 6px; |
| | | border: 1px solid rgba(0, 0, 0, 0.15); |
| | | } |
| | | |
| | | } |
| | | |
| | | .el-pagination__sizes { |
| | |
| | | |
| | | .el-pagination__jump { |
| | | .el-input__inner { |
| | | width: 50px; |
| | | width: 50px !important; |
| | | } |
| | | } |
| | | } |
| | |
| | | width: 200px; |
| | | } |
| | | |
| | | |
| | | .el-pagination__sizes { |
| | | .el-input__inner { |
| | | width: 100px; |
| | |
| | | width: 50px; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | .el-form { |
| | | .el-date-editor--daterange { |
| | | .el-range-separator { |
| | | width: 30px; |
| | | } |
| | | .el-input__inner { |
| | | width: 220px !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .el-dialog { |
| | | border-radius: 16px 16px 6px 6px; |
| | |
| | | background-color: #009688; |
| | | } |
| | | |
| | | .el-button+.el-button, |
| | | .el-checkbox.is-bordered+.el-checkbox.is-bordered { |
| | | .el-button + .el-button, |
| | | .el-checkbox.is-bordered + .el-checkbox.is-bordered { |
| | | margin-left: 0; |
| | | } |
| | | |
| | |
| | | <!-- 标签列表 --> |
| | | <div class="tag-list-container" @wheel.prevent="handleWheel"> |
| | | <div class="tag-list" v-for="tag in tagList" :key="tag.name"> |
| | | <div @click="goTag(tag)" :class="{ 'activeTag': tag.path === $route.path }"> |
| | | <div |
| | | @click="goTag(tag)" |
| | | :class="{ activeTag: tag.path === $route.path }" |
| | | > |
| | | {{ tag.meta.title }} |
| | | </div> |
| | | <i @click="closeTag(tag)" v-if="tagList.length > 1" class="el-icon-close"></i> |
| | | <i |
| | | @click="closeTag(tag)" |
| | | v-if="tagList.length > 1" |
| | | class="el-icon-close" |
| | | ></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | top="40vh" |
| | | :visible.sync="show" |
| | | :show-close="false" |
| | | :append-to-body="true" |
| | | :close-on-click-modal="false" |
| | | width="433px" |
| | | > |
| | | <div class="top-con a-center" slot="title"> |
| | | <div class="left"> |
| | | <img |
| | | src="@/assets/public/notice@2x.png" |
| | | style="width: 24px; height: 24px; margin-right: 14px" |
| | | /> |
| | | <div class="title">{{ "提示" }}</div> |
| | | </div> |
| | | </div> |
| | | <div class="lh--32 fs--20"> |
| | | {{ "当前页面可能有未保存数据,确认关闭么" }} |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="show = false">取消</el-button> |
| | | <el-button type='danger' @click="submitClose">{{ "确认" }}</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapState } from 'vuex' |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | userInfo: '', |
| | | userInfo: "", |
| | | scrollTimer: null, |
| | | scrollAmount: 0 |
| | | } |
| | | scrollAmount: 0, |
| | | show: false, |
| | | pendingCloseTag: null, |
| | | }; |
| | | }, |
| | | props: { |
| | | logo: { |
| | | type: String, |
| | | default: '' |
| | | default: "", |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapState(['tagList', 'isFold']) |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | mounted() { |
| | | // 获取用户信息 |
| | | this.getUserInfo() |
| | | this.getUserInfo(); |
| | | }, |
| | | methods: { |
| | | // 点击折叠按钮 |
| | | clickFold() { |
| | | this.$store.commit('SET_ISFOLD', !this.isFold) |
| | | this.$store.commit("SET_ISFOLD", !this.isFold); |
| | | }, |
| | | // 获取用户信息 |
| | | getUserInfo() { |
| | | this.userInfo = JSON.parse(sessionStorage.getItem('userInfo')) |
| | | this.userInfo = JSON.parse(sessionStorage.getItem("userInfo")); |
| | | }, |
| | | // 退出登录 |
| | | outLogin() { |
| | | sessionStorage.clear() |
| | | sessionStorage.clear(); |
| | | this.$router.replace({ path: "/" }); |
| | | }, |
| | | // 关闭标签 |
| | | closeTag(tag) { |
| | | this.$store.commit('SET_TAGLIST', this.tagList.filter(item => item.path !== tag.path)) |
| | | if (tag.path && tag.path.includes('add')) { |
| | | this.pendingCloseTag = tag; |
| | | this.show = true; |
| | | return; |
| | | } |
| | | this._doCloseTag(tag); |
| | | }, |
| | | // 真正执行关闭标签的逻辑 |
| | | _doCloseTag(tag) { |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== tag.path) |
| | | ); |
| | | // 判断是否是当前标签 |
| | | if (tag.path === this.$route.path) { |
| | | // if (this.tagList.length > 1) { |
| | | this.$router.push(this.tagList[this.tagList.length - 1].path) |
| | | // } else { |
| | | // // this.$router.push('/welcome') |
| | | // } |
| | | this.$router.push(this.tagList[this.tagList.length - 1].path); |
| | | } |
| | | }, |
| | | submitClose() { |
| | | this.show = false; |
| | | if (this.pendingCloseTag) { |
| | | this._doCloseTag(this.pendingCloseTag); |
| | | this.pendingCloseTag = null; |
| | | } |
| | | }, |
| | | // 跳转标签 |
| | | goTag(tag) { |
| | | this.$router.push({ |
| | | path: tag.path, |
| | | query: tag.query |
| | | }) |
| | | query: tag.query, |
| | | }); |
| | | }, |
| | | handleWheel(e) { |
| | | if (this.scrollTimer) { |
| | |
| | | }; |
| | | |
| | | this.scrollTimer = setTimeout(scroll, 8); // 减少延迟时间 |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | |
| | | cursor: pointer; |
| | | font-weight: 400; |
| | | font-size: 18px; |
| | | color: rgba(0, 0, 0, .6); |
| | | color: rgba(0, 0, 0, 0.6); |
| | | margin-right: 40px; |
| | | |
| | | div:hover { |
| | | font-weight: bold; |
| | | color: #049C9A; |
| | | color: #049c9a; |
| | | } |
| | | |
| | | i { |
| | | margin-left: 10px; |
| | | |
| | | &:hover { |
| | | color: #049C9A; |
| | | color: #049c9a; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .activeTag { |
| | | font-weight: bold; |
| | | color: #049C9A; |
| | | color: #049c9a; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | .user-info { |
| | |
| | | cursor: pointer; |
| | | |
| | | &::before { |
| | | content: ''; |
| | | content: ""; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | |
| | | bottom: 0; |
| | | border-radius: 12px; |
| | | padding: 1px; |
| | | background: linear-gradient(180deg, rgba(10, 203, 202, 1), rgba(4, 156, 154, 1)); |
| | | -webkit-mask: |
| | | linear-gradient(#fff 0 0) content-box, |
| | | background: linear-gradient( |
| | | 180deg, |
| | | rgba(10, 203, 202, 1), |
| | | rgba(4, 156, 154, 1) |
| | | ); |
| | | -webkit-mask: linear-gradient(#fff 0 0) content-box, |
| | | linear-gradient(#fff 0 0); |
| | | -webkit-mask-composite: xor; |
| | | mask-composite: exclude; |
| | |
| | | .user-info-out-text { |
| | | font-weight: 400; |
| | | font-size: 14px; |
| | | color: #049C9A; |
| | | color: #049c9a; |
| | | line-height: 21px; |
| | | position: relative; |
| | | z-index: 1; |
| | |
| | | } |
| | | } |
| | | } |
| | | .left { |
| | | display: flex; |
| | | } |
| | | |
| | | ::v-deep .el-dialog { |
| | | border-radius: 12px; |
| | | |
| | | .el-dialog__header { |
| | | padding-top: 28px; |
| | | padding-right: 27px; |
| | | padding-left: 34px; |
| | | padding-bottom: 11px; |
| | | } |
| | | |
| | | .el-dialog__body { |
| | | padding: unset; |
| | | padding-left: 73px; |
| | | padding-right: 20px; |
| | | } |
| | | |
| | | .el-dialog__footer { |
| | | padding-top: 18px; |
| | | padding-right: 27px; |
| | | padding-bottom: 29px; |
| | | } |
| | | } |
| | | |
| | | .bgcolor1 { |
| | | background: rgba(22, 119, 255, 1); |
| | | } |
| | | |
| | | .top-con { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .title { |
| | | font-family: PingFangSC, PingFang SC; |
| | | font-weight: 600; |
| | | font-size: 16px; |
| | | color: rgba(0, 0, 0, 1); |
| | | margin-bottom: 13px; |
| | | } |
| | | } |
| | | |
| | | .dialog-footer { |
| | | display: flex; |
| | | justify-content: end; |
| | | gap: 10px; |
| | | } |
| | | </style> |
| | |
| | | |
| | | if (config.method == 'get') { |
| | | if (!config.params) config.params = {}; |
| | | console.log('请求数据',config.params) |
| | | config.params = { |
| | | ...config.params, |
| | | } |
| | | } |
| | | if (config.method == 'post') { |
| | | if (!config.data) config.data = {}; |
| | | console.log('请求数据',config.data) |
| | | if (needEncrypt) { |
| | | config.data = { param: encryptBySM4(config.data) }; |
| | | } |
| | |
| | | <div>所属项目组</div> |
| | | </div> |
| | | <div class="header-title-right"> |
| | | <el-button @click="showChoose = true" class="el-icon-circle-plus-outline" type="primary"> |
| | | 选择项目组</el-button> |
| | | <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"> |
| | |
| | | <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-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-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 |
| | | 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-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 |
| | | 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> |
| | | </div> |
| | | <el-form-item prop="reportText" style="margin-top: 18px"> |
| | | <ai-editor ref="materialEditor" :value="form.reportText" style="width: 100%" placeholder="请输入报告正文" /> |
| | | <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"> |
| | |
| | | </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-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> |
| | | <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> |
| | | <chooseProject |
| | | @submit="getProjectData" |
| | | :show="showChoose" |
| | | @close="showChoose = false" |
| | | ></chooseProject> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import AiEditor from "@/components/AiEditor"; |
| | | import chooseProject from "@/components/chooseProject"; |
| | | import { addData, getDetail, editData } from "./service"; |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | import { customUploadRequest, getFullUrl } from "@/utils/utils"; |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | this.getDetail(); |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | |
| | | }, |
| | | ]; |
| | | if (res.qaReportFileList && res.qaReportFileList.length > 0) { |
| | | this.fileList = res.qaReportFileList.map(file => ({ |
| | | this.fileList = res.qaReportFileList.map((file) => ({ |
| | | name: file.fileName, |
| | | url: getFullUrl(file.fileUrl), |
| | | uid: file.id |
| | | })) |
| | | this.form.qaReportFiles = res.qaReportFileList |
| | | uid: file.id, |
| | | })); |
| | | this.form.qaReportFiles = res.qaReportFileList; |
| | | } else { |
| | | this.fileList = [] |
| | | this.form.qaReportFiles = [] |
| | | this.fileList = []; |
| | | this.form.qaReportFiles = []; |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | getProjectData(data) { |
| | |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("修改成功"); |
| | | this.$router.back(); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("发布成功"); |
| | | this.$router.back(); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | |
| | | } |
| | | }); |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | save() { |
| | | this.$refs.form.validate((valid) => { |
| | | let data = { |
| | |
| | | status: -1, // 草稿箱状态 |
| | | commitPersonId: JSON.parse(sessionStorage.getItem("userInfo")).userId, |
| | | }; |
| | | console.log('qaReportFiles qaReportFiles', this.form.qaReportFiles) |
| | | console.log("qaReportFiles qaReportFiles", this.form.qaReportFiles); |
| | | // if (this.form.qaReportFiles && this.form.qaReportFiles.length > 0) { |
| | | // // const prefix = apiConfig.showImgUrl; |
| | | // console.log('0000000000000000') |
| | |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("草稿保存成功"); |
| | | this.$router.back(); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("草稿保存成功"); |
| | | this.$router.back(); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | |
| | | customUploadRequest({ |
| | | file, |
| | | onSuccess: (res) => { |
| | | console.log() |
| | | console.log(); |
| | | if (res.code === 200) { |
| | | const fileObj = { |
| | | id: new Date().getTime(), |
| | | reportId: this.$route.query.id ? this.$route.query.id : '', |
| | | fileUrl: res.msg || res.data || '', |
| | | 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: getFullUrl(fileObj.fileUrl), |
| | | uid: fileObj.id |
| | | uid: fileObj.id, |
| | | }); |
| | | |
| | | // 添加到表单数据 |
| | | this.form.qaReportFiles.push(fileObj); |
| | | |
| | | this.$message.success('文件上传成功'); |
| | | this.$message.success("文件上传成功"); |
| | | onSuccess(res); |
| | | } else { |
| | | this.$message.error(res.message || '文件上传失败'); |
| | | this.$message.error(res.message || "文件上传失败"); |
| | | onError(); |
| | | } |
| | | }, |
| | | onError: (err) => { |
| | | this.$message.error('文件上传失败'); |
| | | this.$message.error("文件上传失败"); |
| | | onError(err); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | // 删除文件 |
| | | handleRemove(file) { |
| | | const index = this.fileList.findIndex(item => item.name === file.name); |
| | | const index = this.fileList.findIndex((item) => item.name === file.name); |
| | | if (index !== -1) { |
| | | this.fileList.splice(index, 1); |
| | | this.form.qaReportFiles.splice(index, 1); |
| | |
| | | }, |
| | | handleDelConfirm() { |
| | | // 调用删除API |
| | | console.log('1222222222222') |
| | | deleteById({ id: this.rowId }).then(res => { |
| | | if (res.code == 200) { |
| | | if (res) { |
| | | this.$message.success('删除成功'); |
| | | this.showDelConfirm = false; |
| | | this.getList(); |
| | |
| | | } |
| | | |
| | | //删除 |
| | | export function deleteData(data) { |
| | | export function deleteById(data) { |
| | | return axios.delete(`/open/t-qa-produce-report/deleteById?id=${data.id}`) |
| | | } |
| | | |
| | |
| | | <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"> |
| | | <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-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 { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | 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"; |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | | chooseProject |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | form: { |
| | | reportCode: "", |
| | | reportTitle: "", |
| | | reportText: "", |
| | | developPerson: "", |
| | | developPersonName: "", |
| | | developDate: "", |
| | | reportType: 3, |
| | | 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: 3, |
| | | 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() |
| | | } |
| | | }, |
| | | 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]; |
| | | |
| | | 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 => ({ |
| | | if (this.$route.query.id) { |
| | | this.getDetail(); |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | 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 |
| | | uid: file.id, |
| | | })); |
| | | this.form.qaReportFiles = res.qaReportFileList; |
| | | } else { |
| | | this.fileList = [] |
| | | this.form.qaReportFiles = [] |
| | | 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 |
| | | } |
| | | }); |
| | | }, |
| | | 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 |
| | | } |
| | | this.$refs.form.validate((valid) => { |
| | | if (this.$refs.materialEditor.getContent() == "<p></p>") { |
| | | 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 |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | 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 |
| | | } |
| | | 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 |
| | | }) |
| | | } |
| | | 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.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | | }) |
| | | }, |
| | | // 上传前校验 |
| | | beforeUpload(file) { |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | } else { |
| | | addData(data) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("发布成功"); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | 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.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | } else { |
| | | // 新增草稿 |
| | | addData(data) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("草稿保存成功"); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // 上传前校验 |
| | | beforeUpload(file) { |
| | | return true; |
| | | }, |
| | | // 自定义上传处理 |
| | |
| | | customUploadRequest({ |
| | | file, |
| | | onSuccess: (res) => { |
| | | console.log() |
| | | console.log(); |
| | | if (res.code === 200) { |
| | | const fileObj = { |
| | | id: new Date().getTime(), |
| | | reportId: this.$route.query.id ? this.$route.query.id : '', |
| | | fileUrl: res.msg || res.data || '', |
| | | 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: getFullUrl(fileObj.fileUrl), |
| | | uid: fileObj.id |
| | | uid: fileObj.id, |
| | | }); |
| | | |
| | | // 添加到表单数据 |
| | | this.form.qaReportFiles.push(fileObj); |
| | | |
| | | this.$message.success('文件上传成功'); |
| | | this.$message.success("文件上传成功"); |
| | | onSuccess(res); |
| | | } else { |
| | | this.$message.error(res.message || '文件上传失败'); |
| | | this.$message.error(res.message || "文件上传失败"); |
| | | onError(); |
| | | } |
| | | }, |
| | | onError: (err) => { |
| | | this.$message.error('文件上传失败'); |
| | | this.$message.error("文件上传失败"); |
| | | onError(err); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | // 删除文件 |
| | | handleRemove(file) { |
| | | const index = this.fileList.findIndex(item => item.name === file.name); |
| | | 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; |
| | | } |
| | | button { |
| | | width: 180px; |
| | | height: 36px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | import chooseProject from '@/components/chooseProject' |
| | | import { addDetail, getDetailInfo, updateDetail, getDetail } from './service' |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | |
| | | this.form.commitPersonId = JSON.parse(sessionStorage.getItem('userInfo')).userId |
| | | this.form.developDate = new Date().toISOString().split('T')[0]; |
| | | |
| | | this.form.itemId = this.$route.query.itemId |
| | | if (this.form.itemId) { |
| | | getDetail(this.form.itemId).then(res => { |
| | | // this.form.itemId = this.$route.query.itemId |
| | | if (this.$route.query.itemId) { |
| | | getDetail(this.$route.query.itemId).then(res => { |
| | | if (res) { |
| | | let item = { |
| | | teamName: res.projectTeamVO.teamName, |
| | |
| | | createBy: res.createBy, |
| | | createTime: res.createTime |
| | | } |
| | | this.form.itemId = res.teamId |
| | | this.tableData = [{ ...item }] |
| | | } |
| | | }) |
| | |
| | | this.getDetail() |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | |
| | | console.log('res',res) |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message || '修改失败') |
| | | } |
| | |
| | | console.log('res',res) |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message || '发布失败') |
| | | } |
| | |
| | | updateDetail({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('草稿保存成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message || '保存失败') |
| | | } |
| | |
| | | addDetail(data).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('草稿保存成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message || '保存失败') |
| | | } |
| | |
| | | } |
| | | }) |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | // 上传前校验 |
| | | beforeUpload(file) { |
| | | return true; |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="developPerson" label="制订人" /> |
| | | <el-table-column prop="developDate" label="制订日期" /> |
| | | <el-table-column prop="auditPersonId" label="审批人" /> |
| | | <el-table-column prop="auditPersonName" label="审批人" /> |
| | | <el-table-column prop="auditTime" label="审批时间" /> |
| | | <el-table-column prop="status" label="状态"> |
| | | <template #default="{ row }"> |
| | |
| | | import chooseProject from "@/components/chooseProject"; |
| | | import { addData, getDetail, editData } from "./service"; |
| | | import { customUploadRequest, getFullUrl } from "@/utils/utils"; |
| | | |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | |
| | | this.getDetail(); |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | |
| | | this.$forceUpdate(); |
| | | this.showChoose = false; |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | submit() { |
| | | if (this.tableData.length == 0) { |
| | | this.$message.error("请选择项目组"); |
| | |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("修改成功"); |
| | | this.$router.back(); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("发布成功"); |
| | | this.$router.back(); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("草稿保存成功"); |
| | | this.$router.back(); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("草稿保存成功"); |
| | | this.$router.back(); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | |
| | | handleDelConfirm() { |
| | | // 调用删除API |
| | | deleteById({ id: this.rowId }).then(res => { |
| | | if (res.code == 200) { |
| | | if (res) { |
| | | this.$message.success('删除成功'); |
| | | this.showDelConfirm = false; |
| | | this.getList(); |
| | |
| | | } |
| | | |
| | | //删除 |
| | | export function deleteData(data) { |
| | | export function deleteById(data) { |
| | | return axios.delete(`/open/t-qa-produce-report/deleteById?id=${data.id}`) |
| | | } |
| | | |
| | |
| | | placeholder="请输入注意事项..." |
| | | /> |
| | | <div class="add-project-footer"> |
| | | <el-button type="primary" class="save-btn" @click="handleSave">保存</el-button> |
| | | <el-button type="primary" class="save-btn" @click="handleSave" |
| | | >保存</el-button |
| | | > |
| | | <el-button @click="handleSaveDraft">存草稿</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import AiEditor from '@/components/AiEditor' |
| | | import { addProposal, updateProposal, getDetailById } from './service' |
| | | import AiEditor from "@/components/AiEditor"; |
| | | import { addProposal, updateProposal, getDetailById } from "./service"; |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddProject", |
| | | components: { |
| | | AiEditor |
| | | AiEditor, |
| | | }, |
| | | data() { |
| | | return { |
| | | id: '', // 用于编辑时存储id |
| | | id: "", // 用于编辑时存储id |
| | | form: { |
| | | projectName: '', |
| | | projectStage: '', |
| | | projectCode: '', |
| | | experimentObjective: '', |
| | | experimentMaterial: '', |
| | | experimentDevice: '', |
| | | experimentTestMethod: '', |
| | | experimentProcedure: '', |
| | | dataAcquisition: '', |
| | | resultEvaluation: '', |
| | | precautions: '', |
| | | projectName: "", |
| | | projectStage: "", |
| | | projectCode: "", |
| | | experimentObjective: "", |
| | | experimentMaterial: "", |
| | | experimentDevice: "", |
| | | experimentTestMethod: "", |
| | | experimentProcedure: "", |
| | | dataAcquisition: "", |
| | | resultEvaluation: "", |
| | | precautions: "", |
| | | auditStatus: 1, // 默认为审批中 |
| | | }, |
| | | editorContents: { |
| | | experimentObjective: '', |
| | | experimentMaterial: '', |
| | | experimentDevice: '', |
| | | experimentTestMethod: '', |
| | | experimentProcedure: '', |
| | | dataAcquisition: '', |
| | | resultEvaluation: '', |
| | | precautions: '' |
| | | experimentObjective: "", |
| | | experimentMaterial: "", |
| | | experimentDevice: "", |
| | | experimentTestMethod: "", |
| | | experimentProcedure: "", |
| | | dataAcquisition: "", |
| | | resultEvaluation: "", |
| | | precautions: "", |
| | | }, |
| | | rules: { |
| | | projectName: [ |
| | | { required: true, message: "请输入项目课题方案名称", trigger: "blur" }, |
| | | { |
| | | required: true, |
| | | message: "请输入项目课题方案名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | projectStage: [ |
| | | { required: true, message: "请选择项目阶段", trigger: "change" }, |
| | |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | methods: { |
| | | // 获取所有编辑器的内容 |
| | | getAllEditorContent() { |
| | |
| | | experimentProcedure: this.$refs.stepsEditor.getContent(), |
| | | dataAcquisition: this.$refs.dataAnalysisEditor.getContent(), |
| | | resultEvaluation: this.$refs.evaluationEditor.getContent(), |
| | | precautions: this.$refs.notesEditor.getContent() |
| | | } |
| | | precautions: this.$refs.notesEditor.getContent(), |
| | | }; |
| | | }, |
| | | // 统一处理方法 |
| | | handleSubmit(type) { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | // 获取所有编辑器内容 |
| | | const editorContents = this.getAllEditorContent() |
| | | |
| | | const editorContents = this.getAllEditorContent(); |
| | | |
| | | // 检查编辑器内容是否为空 |
| | | const emptyFields = [] |
| | | console.log('editorContents', editorContents) |
| | | |
| | | const emptyFields = []; |
| | | console.log("editorContents", editorContents); |
| | | |
| | | // 判断内容是否为空(排除<p></p>) |
| | | const isEmptyContent = (content) => { |
| | | return !content || content === '<p></p>' || content.trim() === '<p></p>' |
| | | } |
| | | return ( |
| | | !content || content === "<p></p>" || content.trim() === "<p></p>" |
| | | ); |
| | | }; |
| | | |
| | | if (isEmptyContent(editorContents.experimentObjective)) emptyFields.push('实验目的') |
| | | if (isEmptyContent(editorContents.experimentMaterial)) emptyFields.push('实验材料') |
| | | if (isEmptyContent(editorContents.experimentDevice)) emptyFields.push('实验设备') |
| | | if (isEmptyContent(editorContents.experimentTestMethod)) emptyFields.push('检测方法及开发') |
| | | if (isEmptyContent(editorContents.experimentProcedure)) emptyFields.push('实验步骤') |
| | | if (isEmptyContent(editorContents.dataAcquisition)) emptyFields.push('数据采集及分析') |
| | | if (isEmptyContent(editorContents.resultEvaluation)) emptyFields.push('结果评估') |
| | | if (isEmptyContent(editorContents.experimentObjective)) |
| | | emptyFields.push("实验目的"); |
| | | if (isEmptyContent(editorContents.experimentMaterial)) |
| | | emptyFields.push("实验材料"); |
| | | if (isEmptyContent(editorContents.experimentDevice)) |
| | | emptyFields.push("实验设备"); |
| | | if (isEmptyContent(editorContents.experimentTestMethod)) |
| | | emptyFields.push("检测方法及开发"); |
| | | if (isEmptyContent(editorContents.experimentProcedure)) |
| | | emptyFields.push("实验步骤"); |
| | | if (isEmptyContent(editorContents.dataAcquisition)) |
| | | emptyFields.push("数据采集及分析"); |
| | | if (isEmptyContent(editorContents.resultEvaluation)) |
| | | emptyFields.push("结果评估"); |
| | | // if (isEmptyContent(editorContents.precautions)) emptyFields.push('注意事项') |
| | | |
| | | if (emptyFields.length > 0) { |
| | | this.$message.warning(`请填写${emptyFields.join('、')}`) |
| | | return false |
| | | this.$message.warning(`请填写${emptyFields.join("、")}`); |
| | | return false; |
| | | } |
| | | |
| | | const formData = { |
| | | ...this.form, |
| | | ...editorContents, |
| | | auditStatus: type === 'draft' ? -1 : 1 // 草稿箱:-1, 审批中:1 |
| | | } |
| | | |
| | | const request = this.id ? updateProposal : addProposal |
| | | auditStatus: type === "draft" ? -1 : 1, // 草稿箱:-1, 审批中:1 |
| | | }; |
| | | |
| | | const request = this.id ? updateProposal : addProposal; |
| | | if (this.id) { |
| | | formData.id = this.id |
| | | formData.id = this.id; |
| | | } |
| | | |
| | | console.log('请求参数:', { |
| | | formData |
| | | }) |
| | | console.log("请求参数:", { |
| | | formData, |
| | | }); |
| | | |
| | | request(formData).then(res => { |
| | | console.log('接口返回:', res) |
| | | if (res.code === 200) { |
| | | const successMsg = type === 'draft' ? '草稿保存成功' : (this.id ? '更新成功' : '保存成功') |
| | | this.$message.success(successMsg) |
| | | this.$router.back() |
| | | } else { |
| | | const errorMsg = type === 'draft' ? '草稿保存失败' : (this.id ? '更新失败' : '保存失败') |
| | | this.$message.error(res.msg || errorMsg) |
| | | } |
| | | }).catch(err => { |
| | | console.error('接口错误:', err) |
| | | const errorMsg = type === 'draft' ? '草稿保存失败' : (this.id ? '更新失败' : '保存失败') |
| | | this.$message.error(errorMsg) |
| | | }) |
| | | request(formData) |
| | | .then((res) => { |
| | | console.log("接口返回:", res); |
| | | if (res.code === 200) { |
| | | const successMsg = |
| | | type === "draft" |
| | | ? "草稿保存成功" |
| | | : this.id |
| | | ? "更新成功" |
| | | : "保存成功"; |
| | | this.$message.success(successMsg); |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | } else { |
| | | const errorMsg = |
| | | type === "draft" |
| | | ? "草稿保存失败" |
| | | : this.id |
| | | ? "更新失败" |
| | | : "保存失败"; |
| | | this.$message.error(res.msg || errorMsg); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error("接口错误:", err); |
| | | const errorMsg = |
| | | type === "draft" |
| | | ? "草稿保存失败" |
| | | : this.id |
| | | ? "更新失败" |
| | | : "保存失败"; |
| | | this.$message.error(errorMsg); |
| | | }); |
| | | } else { |
| | | this.$message.warning('请填写必填项') |
| | | return false |
| | | this.$message.warning("请填写必填项"); |
| | | return false; |
| | | } |
| | | }) |
| | | }); |
| | | }, |
| | | // 保存 |
| | | handleSave() { |
| | | this.handleSubmit('save') |
| | | this.handleSubmit("save"); |
| | | }, |
| | | // 保存草稿 |
| | | handleSaveDraft() { |
| | | this.handleSubmit('draft') |
| | | this.handleSubmit("draft"); |
| | | }, |
| | | // 获取详情 |
| | | getDetail() { |
| | | if (this.id) { |
| | | console.log('获取详情参数:', { id: this.id }) |
| | | getDetailById({ id: this.id }).then(res => { |
| | | console.log('详情接口返回:', res) |
| | | if (res) { |
| | | const data = res |
| | | // 设置表单数据 |
| | | this.form = { |
| | | projectName: data.projectName, |
| | | projectStage: data.projectStage, |
| | | projectCode: data.projectCode, |
| | | auditStatus: data.auditStatus |
| | | console.log("获取详情参数:", { id: this.id }); |
| | | getDetailById({ id: this.id }) |
| | | .then((res) => { |
| | | console.log("详情接口返回:", res); |
| | | if (res) { |
| | | const data = res; |
| | | // 设置表单数据 |
| | | this.form = { |
| | | projectName: data.projectName, |
| | | projectStage: data.projectStage, |
| | | projectCode: data.projectCode, |
| | | auditStatus: data.auditStatus, |
| | | }; |
| | | // 设置编辑器内容 |
| | | this.editorContents = { |
| | | experimentObjective: data.experimentObjective, |
| | | experimentMaterial: data.experimentMaterial, |
| | | experimentDevice: data.experimentDevice, |
| | | experimentTestMethod: data.experimentTestMethod, |
| | | experimentProcedure: data.experimentProcedure, |
| | | dataAcquisition: data.dataAcquisition, |
| | | resultEvaluation: data.resultEvaluation, |
| | | precautions: data.precautions, |
| | | }; |
| | | } |
| | | // 设置编辑器内容 |
| | | this.editorContents = { |
| | | experimentObjective: data.experimentObjective, |
| | | experimentMaterial: data.experimentMaterial, |
| | | experimentDevice: data.experimentDevice, |
| | | experimentTestMethod: data.experimentTestMethod, |
| | | experimentProcedure: data.experimentProcedure, |
| | | dataAcquisition: data.dataAcquisition, |
| | | resultEvaluation: data.resultEvaluation, |
| | | precautions: data.precautions |
| | | } |
| | | } |
| | | }).catch(err => { |
| | | console.error('获取详情失败:', err) |
| | | }) |
| | | }) |
| | | .catch((err) => { |
| | | console.error("获取详情失败:", err); |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | // 从路由参数中获取id |
| | | this.id = this.$route.query.id |
| | | this.id = this.$route.query.id; |
| | | if (this.id) { |
| | | this.getDetail() |
| | | this.getDetail(); |
| | | } |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | <template> |
| | | <div class="list"> |
| | | <TableCustom :queryForm="form" :tableData="tableData" :total="total" :height="null"> |
| | | <TableCustom :queryForm="form" |
| | | :tableData="tableData" |
| | | :total="total" |
| | | @handleCurrentChange="handleCurrentChange" |
| | | @handleSizeChange="handleSizeChange" |
| | | :height="null"> |
| | | <template #search> |
| | | <el-form :model="form" labelWidth="auto" inline> |
| | | <el-form-item label="项目课题方案名称:"> |
| | |
| | | this.updateTimeRange(); |
| | | this.getTableData(); |
| | | }, |
| | | // 处理页码改变 |
| | | handleCurrentChange(val) { |
| | | this.form.pageNum = val; |
| | | this.getTableData(); |
| | | }, |
| | | // 处理每页条数改变 |
| | | handleSizeChange(val) { |
| | | this.form.pageSize = val; |
| | | this.form.pageNum = 1; |
| | | this.getTableData(); |
| | | }, |
| | | updateTimeRange() { |
| | | if (this.form.createTime?.length === 2) { |
| | | [this.form.startTime, this.form.endTime] = this.form.createTime; |
| | |
| | | type="textarea" |
| | | v-model="form.sampleRequire" |
| | | :rows="4" |
| | | maxlength="100" |
| | | show-word-limit |
| | | placeholder="请输入收样要求..." |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | import AddTestItem from './add-test-item.vue' |
| | | import ConfirmDialog from './confirm-dialog.vue' |
| | | import { add, update, getDetail } from '../service' |
| | | |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | name: 'AddConfirmationSheet', |
| | | components: { |
| | |
| | | this.getDetailData(id) |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | mounted() { }, |
| | | methods: { |
| | | setSelectedScheduling(data) { |
| | |
| | | planCode: selectedData.projectName || '', // 所属项目课题方案 |
| | | planName: selectedData.experimentCode || '', // 实验编号 |
| | | testName: selectedData.experimentName || '', // 实验名称 |
| | | notifyTime: selectedData.experimentDate || '', // 通知时间 |
| | | notifyTime: selectedData.createTime || '', // 通知时间 |
| | | startTime: selectedData.experimentStartTime || '', // 实验开始时间 |
| | | endTime: selectedData.experimentEndTime || '', // 实验结束时间 |
| | | participants: selectedData.participantsName || '', // 参加人员 |
| | |
| | | obj.roleId = this.$route.query.roleId |
| | | edit(obj).then(() => { |
| | | this.msgsuccess('保存成功') |
| | | this.$router.go(-1) |
| | | this.back() |
| | | }) |
| | | } else { |
| | | add(obj).then(() => { |
| | |
| | | remark: "", |
| | | } |
| | | this.menu = [] |
| | | this.$router.go(-1) |
| | | this.back() |
| | | }) |
| | | } |
| | | } |
| | |
| | | testId: item.testId |
| | | })) |
| | | } |
| | | |
| | | // 打印提交参数 |
| | | console.log('提交确认单参数:', JSON.stringify(submitData, null, 2)) |
| | | |
| | | // 根据是否有 id 决定调用新增还是更新接口 |
| | | if (this.formData.id) { |
| | | submitData.id = this.formData.id |
| | | console.log('调用更新接口,参数:', JSON.stringify(submitData, null, 2)) |
| | | await update(submitData) |
| | | this.$message.success('更新成功') |
| | | } else { |
| | | console.log('调用新增接口,参数:', JSON.stringify(submitData, null, 2)) |
| | | await add(submitData) |
| | | this.$message.success('提交成功') |
| | | } |
| | | |
| | | this.confirmDialogVisible = false // 关闭弹窗 |
| | | this.$router.go(-1) |
| | | this.back() |
| | | } catch (error) { |
| | | this.$message.error((this.formData.id ? '更新' : '提交') + '失败:' + (error.message || '未知错误')) |
| | | } |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | async handleSaveDraft() { |
| | | try { |
| | | if (!this.selectedScheduling) { |
| | |
| | | <el-table-column prop="projectName" label="所属项目课题方案"></el-table-column> |
| | | <el-table-column prop="experimentCode" label="实验编号"></el-table-column> |
| | | <el-table-column prop="experimentName" label="实验名称"></el-table-column> |
| | | <el-table-column prop="experimentDate" label="通知时间"></el-table-column> |
| | | <el-table-column prop="createTime" label="通知时间"></el-table-column> |
| | | <el-table-column prop="experimentStartTime" label="实验开始时间"></el-table-column> |
| | | <el-table-column prop="experimentEndTime" label="实验结束时间"></el-table-column> |
| | | <el-table-column prop="participantsName" label="参加人员"></el-table-column> |
| | |
| | | getDispatchList(params).then(res => { |
| | | console.log('222222222222',res) |
| | | if (res) { |
| | | this.tableData = res || []; |
| | | this.total = res.length || 0; |
| | | this.tableData = res.data.records || []; |
| | | this.total = res.data.total || 0; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | getStatusText(status) { |
| | | const statusMap = { |
| | | 1: "待确认", |
| | | 2: "已通过", |
| | | 2: "已确认", |
| | | 3: "已驳回", |
| | | 4: "已撤回", |
| | | 5: "已封存", |
| | |
| | | } |
| | | // 获取实验调度列表 |
| | | export const getDispatchList = (data) => { |
| | | return axios.get('/open/t-experiment-dispatch/chemistSignList', { params:data }) |
| | | return axios.post('/api/t-experiment-dispatch/chemistSignList', { ...data }) |
| | | } |
| | | // 撤销 |
| | | export const revokedSheet = (data) => { |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item prop="projectStage" label="项目阶段"> |
| | | <el-select v-model="form.projectStage" disabled placeholder="请选择"> |
| | | <el-select |
| | | v-model="form.projectStage" |
| | | disabled |
| | | placeholder="请选择" |
| | | > |
| | | <el-option label="实验室开发阶段" :value="1" /> |
| | | <el-option label="中式试验阶段" :value="2" /> |
| | | <el-option label="生产验证试验阶段" :value="3" /> |
| | |
| | | </el-form-item> |
| | | </div> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <span>二 、实验信息</span> |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <span>二 、实验信息</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="padding-left: 25px"> |
| | | <el-form-item prop="experimentDate" label="试验日期"> |
| | | <el-date-picker |
| | | name="data-test" |
| | | v-model="form.experimentDate" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | @change="handleDateChange" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item prop="experimentName" label="实验名称"> |
| | | <el-input v-model="form.experimentName" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item prop="experimentCode" label="实验编号"> |
| | | <el-input v-model="form.experimentCode" placeholder="请输入" disabled/> |
| | | </el-form-item> |
| | | </div> |
| | | |
| | | <div class="add-group"> |
| | | <span>实验分组</span> |
| | | <el-button type="primary" class="el-icon-plus" @click="handleAddGroup">添加组别</el-button> |
| | | </div> |
| | | <Table |
| | | :data="groupTableData" |
| | | :total="0" |
| | | :height="null" |
| | | class="groupTable" |
| | | > |
| | | <el-table-column type="index" label="序号" width="80"></el-table-column> |
| | | <el-table-column prop="groupName" label="组别"></el-table-column> |
| | | <el-table-column prop="remark" label="备注"></el-table-column> |
| | | <el-table-column label="操作" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleEditGroup(scope.row)">编辑</el-button> |
| | | <el-button type="text" @click="handleDeleteGroup(scope.row)">移除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </Table> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <span>三 、计划时间及人员</span> |
| | | <div style="padding-left: 25px"> |
| | | <el-form-item prop="experimentDate" label="试验日期"> |
| | | <el-date-picker |
| | | name="data-test" |
| | | v-model="form.experimentDate" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | @change="handleDateChange" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item prop="experimentName" label="实验名称"> |
| | | <el-input v-model="form.experimentName" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item prop="experimentCode" label="实验编号"> |
| | | <el-input |
| | | v-model="form.experimentCode" |
| | | placeholder="请输入" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | <div style="padding-left: 25px"> |
| | | <el-form-item prop="experimentTime" label="试验时间"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.experimentTime" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | :default-time="['00:00:00', '23:59:59']" |
| | | @change="handleTimeRangeChange" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="add-group"> |
| | | <div>*</div> |
| | | <span>参加人员</span> |
| | | <el-button type="primary" class="el-icon-plus" @click="addMember">选择参加人员</el-button> |
| | | </div> |
| | | <div class="member-list"> |
| | | <div v-for="item in [3,4,5]" :key="item" class="member-list-card"> |
| | | <div class="member-item"> |
| | | <div class="member-title"> |
| | | {{ ["工艺工程师", "化验师","实验员"][item - 3] }} |
| | | </div> |
| | | <div |
| | | :class="item == 3 ? 'member-name-box' : 'flex1'" |
| | | > |
| | | <div |
| | | :class=" |
| | | item == 3 |
| | | ? 'member-name-box' |
| | | : 'member-name-box-2' |
| | | " |
| | | |
| | | <div class="add-group"> |
| | | <span>实验分组</span> |
| | | <el-button type="primary" class="el-icon-plus" @click="handleAddGroup" |
| | | >添加组别</el-button |
| | | > |
| | | </div> |
| | | <Table |
| | | :data="groupTableData" |
| | | :total="0" |
| | | :height="null" |
| | | class="groupTable" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | width="80" |
| | | ></el-table-column> |
| | | <el-table-column prop="groupName" label="组别"></el-table-column> |
| | | <el-table-column prop="remark" label="备注"></el-table-column> |
| | | <el-table-column label="操作" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleEditGroup(scope.row)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button type="text" @click="handleDeleteGroup(scope.row)" |
| | | >移除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </Table> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <span>三 、计划时间及人员</span> |
| | | </div> |
| | | </div> |
| | | <div style="padding-left: 25px"> |
| | | <el-form-item prop="experimentTime" label="试验时间"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.experimentTime" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | :default-time="['00:00:00', '23:59:59']" |
| | | @change="handleTimeRangeChange" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="add-group"> |
| | | <div>*</div> |
| | | <span>参加人员</span> |
| | | <el-button type="primary" class="el-icon-plus" @click="addMember" |
| | | >选择参加人员</el-button |
| | | > |
| | | </div> |
| | | <div class="member-list"> |
| | | <div v-for="item in [3, 4, 5]" :key="item" class="member-list-card"> |
| | | <div class="member-item"> |
| | | <div class="member-title"> |
| | | {{ ["工艺工程师", "化验师", "实验员"][item - 3] }} |
| | | </div> |
| | | <div :class="item == 3 ? 'member-name-box' : 'flex1'"> |
| | | <div |
| | | v-for="i in memberList(item)" |
| | | :key="i.userId" |
| | | class="member-name" |
| | | :class="item == 3 ? 'member-name-box' : 'member-name-box-2'" |
| | | > |
| | | {{ i.nickName }} |
| | | <div |
| | | v-for="i in memberList(item)" |
| | | :key="i.userId" |
| | | class="member-name" |
| | | > |
| | | {{ i.nickName }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="member-change"> |
| | | <div |
| | | class="member-change-btn" |
| | | @click="editUserList(item)" |
| | | v-if="item == 4 || item == 5" |
| | | > |
| | | 修改 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="member-change"> |
| | | <div class="member-change-btn" @click="editUserList(item)" v-if="item == 4 || item == 5">修改</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <span>四 、任务分解</span> |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <span>四 、任务分解</span> |
| | | </div> |
| | | <el-button type="primary" class="el-icon-plus" @click="handleAddTask" |
| | | >新增任务</el-button |
| | | > |
| | | </div> |
| | | <el-button type="primary" class="el-icon-plus" @click="handleAddTask">新增任务</el-button> |
| | | </div> |
| | | |
| | | <Table |
| | | :data="taskTableData" |
| | | :total="allTaskTableData.length" |
| | | :height="null" |
| | | :queryForm="{ pageNum: taskPageNum, pageSize: taskPageSize }" |
| | | :disAblePagination="true" |
| | | @handleCurrentChange="handleCurrentChange" |
| | | class="rwuTable" |
| | | > |
| | | <el-table-column type="index" label="序号" width="80"></el-table-column> |
| | | <el-table-column prop="taskName" label="任务名称"></el-table-column> |
| | | <el-table-column prop="personCharge" label="负责人"></el-table-column> |
| | | <el-table-column prop="startTime" label="开始时间"></el-table-column> |
| | | <el-table-column label="操作" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleEditTask(scope.row)">编辑</el-button> |
| | | <el-button type="text" @click="handleDeleteTask(scope.row)">移除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </Table> |
| | | <Table |
| | | :data="taskTableData" |
| | | :total="allTaskTableData.length" |
| | | :height="null" |
| | | :queryForm="{ pageNum: taskPageNum, pageSize: taskPageSize }" |
| | | :disAblePagination="true" |
| | | @handleCurrentChange="handleCurrentChange" |
| | | class="rwuTable" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | width="80" |
| | | ></el-table-column> |
| | | <el-table-column prop="taskName" label="任务名称"></el-table-column> |
| | | <el-table-column prop="personCharge" label="负责人"></el-table-column> |
| | | <el-table-column prop="startTime" label="开始时间"></el-table-column> |
| | | <el-table-column label="操作" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleEditTask(scope.row)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button type="text" @click="handleDeleteTask(scope.row)" |
| | | >移除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </Table> |
| | | |
| | | <div class="header-title"> |
| | | <div class="header-title-left"> |
| | |
| | | </div> |
| | | |
| | | <div class="add-project-footer"> |
| | | <el-button type="primary" class="save-btn" @click="sendDispatch">保存</el-button> |
| | | <el-button type="primary" class="save-btn" @click="sendDispatch" |
| | | >保存</el-button |
| | | > |
| | | <el-button @click="saveDraft">存草稿</el-button> |
| | | </div> |
| | | </el-form> |
| | | </template> |
| | | <SelectMember ref="selectMember" @submit="selectUser" /> |
| | | <SelectMember ref="selectMember" @submit="selectUser" /> |
| | | <AddGroupDialog ref="addGroupDialog" @submit="handleGroupSubmit" /> |
| | | <AddTaskDialog ref="addTaskDialog" @submit="handleTaskSubmit" /> |
| | | </Card> |
| | | </template> |
| | | |
| | | <script> |
| | | import SelectMember from '@/components/SelectMember/index.vue' |
| | | import AddGroupDialog from './components/AddGroupDialog' |
| | | import AddTaskDialog from './components/AddTaskDialog' |
| | | import AIEditor from '@/components/AiEditor' |
| | | import { getProposalList, addDispatch, updateDispatch,getDetailById } from './service' |
| | | |
| | | import SelectMember from "@/components/SelectMember/index.vue"; |
| | | import AddGroupDialog from "./components/AddGroupDialog"; |
| | | import AddTaskDialog from "./components/AddTaskDialog"; |
| | | import AIEditor from "@/components/AiEditor"; |
| | | import { |
| | | getProposalList, |
| | | addDispatch, |
| | | updateDispatch, |
| | | getDetailById, |
| | | } from "./service"; |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | name: "AddProject", |
| | | components: { |
| | | SelectMember, |
| | | AddGroupDialog, |
| | | AddTaskDialog, |
| | | AIEditor |
| | | AIEditor, |
| | | }, |
| | | data() { |
| | | return { |
| | | id: '', // 用于编辑时存储id |
| | | id: "", // 用于编辑时存储id |
| | | form: { |
| | | projectName: '', // 课题方案名称 |
| | | proposalId: '', // 项目课题方案id |
| | | projectStage: '', // 项目阶段 |
| | | experimentName: '', // 实验名称 |
| | | experimentCode: '', // 实验编号 |
| | | experimentDate: '', // 实验日期 |
| | | projectName: "", // 课题方案名称 |
| | | proposalId: "", // 项目课题方案id |
| | | projectStage: "", // 项目阶段 |
| | | experimentName: "", // 实验名称 |
| | | experimentCode: "", // 实验编号 |
| | | experimentDate: "", // 实验日期 |
| | | experimentTime: [], // 实验时间范围 |
| | | status: -1, // 状态 -1=草稿箱 1=待确认 2=已确认 3=已封存 |
| | | experimentDispatchGroups: [], // 组别列表 |
| | | experimentDispatchParticipants: [], // 参与人员 |
| | | experimentDispatchTasks: [], // 任务列表 |
| | | keyNodes: '' // 关键节点 |
| | | keyNodes: "", // 关键节点 |
| | | }, |
| | | rules: { |
| | | projectName: [ |
| | | { required: true, message: "请输入项目课题方案名称", trigger: "blur" }, |
| | | { |
| | | required: true, |
| | | message: "请输入项目课题方案名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | proposalId: [ |
| | | { required: true, message: "请输入项目课题方案编号", trigger: "blur" }, |
| | | { |
| | | required: true, |
| | | message: "请输入项目课题方案编号", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | experimentName: [ |
| | | { required: true, message: "请输入实验名称", trigger: "blur" }, |
| | |
| | | members: { |
| | | processEngineer: [], // 工艺工程师 |
| | | experimenter: [], // 实验员 |
| | | analyst: [] // 化验师 |
| | | analyst: [], // 化验师 |
| | | }, |
| | | selectMemberData: [], |
| | | ROLE_CONFIG: { |
| | | "3": { label: "工艺工程师", limit: 1, default: true }, // 工艺工程师 |
| | | "5": { label: "实验员", limit: 8 }, // 实验员 |
| | | "4": { label: "化验师", limit: 8 } // 化验师 |
| | | 3: { label: "工艺工程师", limit: 1, default: true }, // 工艺工程师 |
| | | 5: { label: "实验员", limit: 8 }, // 实验员 |
| | | 4: { label: "化验师", limit: 8 }, // 化验师 |
| | | }, |
| | | currentEditRoleId: null, |
| | | // 下拉框数据 |
| | |
| | | projectDataMap: new Map(), // 缓存方案数据,key为方案ID |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | methods: { |
| | | // 获取当前用户信息 |
| | | getCurrentUser() { |
| | | const userInfo = sessionStorage.getItem('userInfo'); |
| | | const userInfo = sessionStorage.getItem("userInfo"); |
| | | return userInfo ? JSON.parse(userInfo) : null; |
| | | }, |
| | | addMember() { |
| | | // 判断是否选择了项目课题方案 |
| | | if (!this.form.proposalId) { |
| | | this.$message.warning('请先选择项目课题方案'); |
| | | this.$message.warning("请先选择项目课题方案"); |
| | | return; |
| | | } |
| | | |
| | |
| | | const currentUser = this.getCurrentUser(); |
| | | // 如果当前用户是工艺工程师,则自动添加到工艺工程师列表中 |
| | | if (currentUser && !this.members.processEngineer.length) { |
| | | this.members.processEngineer = [{ |
| | | userId: currentUser.userId, |
| | | nickName: currentUser.nickName, |
| | | avatar: currentUser.avatar, |
| | | roleId: 3, |
| | | roleName: '工艺工程师' |
| | | }]; |
| | | this.members.processEngineer = [ |
| | | { |
| | | userId: currentUser.userId, |
| | | nickName: currentUser.nickName, |
| | | avatar: currentUser.avatar, |
| | | roleId: 3, |
| | | roleName: "工艺工程师", |
| | | }, |
| | | ]; |
| | | // 同时更新selectMemberData |
| | | this.selectMemberData = [...this.members.processEngineer]; |
| | | } |
| | | |
| | | |
| | | // 设置当前编辑角色为null,表示是新增操作 |
| | | this.currentEditRoleId = null; |
| | | |
| | | |
| | | // 打开选择弹窗,并传入项目ID |
| | | this.$refs.selectMember.open(); |
| | | // 设置项目ID |
| | |
| | | const selectedMembers = [ |
| | | ...this.members.processEngineer, |
| | | ...this.members.experimenter, |
| | | ...this.members.analyst |
| | | ...this.members.analyst, |
| | | ]; |
| | | this.$refs.selectMember.setSelection(selectedMembers); |
| | | }); |
| | |
| | | editUserList(roleId) { |
| | | // 判断是否选择了项目课题方案 |
| | | if (!this.form.proposalId) { |
| | | this.$message.warning('请先选择项目课题方案'); |
| | | this.$message.warning("请先选择项目课题方案"); |
| | | return; |
| | | } |
| | | |
| | | // 如果是工艺工程师,不允许修改 |
| | | if (roleId === 3) { |
| | | this.$message.warning('工艺工程师不可修改'); |
| | | this.$message.warning("工艺工程师不可修改"); |
| | | return; |
| | | } |
| | | |
| | |
| | | this.$refs.selectMember.open(); |
| | | // 设置项目ID |
| | | this.$refs.selectMember.projectId = this.form.proposalId; |
| | | |
| | | |
| | | // 设置已选中的成员(只设置当前角色的成员) |
| | | this.$nextTick(() => { |
| | | let selectedMembers = []; |
| | |
| | | selectUser(data) { |
| | | // 检查每个角色的选择数量限制 |
| | | for (const [roleId, config] of Object.entries(this.ROLE_CONFIG)) { |
| | | const members = data.filter(item => item.roleId === parseInt(roleId)); |
| | | const members = data.filter((item) => item.roleId === parseInt(roleId)); |
| | | if (members.length > config.limit) { |
| | | this.$message.error(`${config.label}最多只能选择${config.limit}个`); |
| | | return; |
| | |
| | | // 如果是新增操作,更新所有角色的数据 |
| | | this.members = { |
| | | processEngineer: this.members.processEngineer, // 保持工艺工程师不变 |
| | | experimenter: data.filter(item => item.roleId === 5), // 实验员 |
| | | analyst: data.filter(item => item.roleId === 4) // 化验师 |
| | | experimenter: data.filter((item) => item.roleId === 5), // 实验员 |
| | | analyst: data.filter((item) => item.roleId === 4), // 化验师 |
| | | }; |
| | | } else { |
| | | // 如果是编辑操作,只更新当前编辑的角色数据 |
| | | if (currentRoleId === 5) { // 实验员 |
| | | this.members.experimenter = data.filter(item => item.roleId === 5); |
| | | } else if (currentRoleId === 4) { // 化验师 |
| | | this.members.analyst = data.filter(item => item.roleId === 4); |
| | | if (currentRoleId === 5) { |
| | | // 实验员 |
| | | this.members.experimenter = data.filter((item) => item.roleId === 5); |
| | | } else if (currentRoleId === 4) { |
| | | // 化验师 |
| | | this.members.analyst = data.filter((item) => item.roleId === 4); |
| | | } |
| | | } |
| | | |
| | |
| | | this.selectMemberData = [ |
| | | ...this.members.processEngineer, |
| | | ...this.members.experimenter, |
| | | ...this.members.analyst |
| | | ...this.members.analyst, |
| | | ]; |
| | | |
| | | this.$refs.selectMember.close(); |
| | |
| | | // 构建提交数据 |
| | | const submitData = { |
| | | ...this.form, |
| | | experimentDispatchGroups: this.groupTableData.map(item => ({ |
| | | experimentDispatchGroups: this.groupTableData.map((item) => ({ |
| | | groupName: item.groupName, |
| | | remark: item.remark |
| | | remark: item.remark, |
| | | })), |
| | | experimentDispatchTasks: this.taskTableData.map(item => ({ |
| | | experimentDispatchTasks: this.taskTableData.map((item) => ({ |
| | | taskName: item.taskName, |
| | | personCharge: item.leader, |
| | | startTime: item.startTime |
| | | startTime: item.startTime, |
| | | })), |
| | | experimentDispatchParticipants: [ |
| | | ...this.members.processEngineer.map(userId => ({ |
| | | ...this.members.processEngineer.map((userId) => ({ |
| | | userId, |
| | | roleType: 3, // 工艺工程师 |
| | | status: 1 // 待确认 |
| | | status: 1, // 待确认 |
| | | })), |
| | | ...this.members.experimenter.map(userId => ({ |
| | | ...this.members.experimenter.map((userId) => ({ |
| | | userId, |
| | | roleType: 5, // 实验员 |
| | | status: 1 // 待确认 |
| | | status: 1, // 待确认 |
| | | })), |
| | | ...this.members.analyst.map(userId => ({ |
| | | ...this.members.analyst.map((userId) => ({ |
| | | userId, |
| | | roleType: 4, // 化验师 |
| | | status: 1 // 待确认 |
| | | })) |
| | | ] |
| | | status: 1, // 待确认 |
| | | })), |
| | | ], |
| | | }; |
| | | |
| | | |
| | | // TODO: 调用接口提交数据 |
| | | console.log('提交数据:', submitData); |
| | | console.log("提交数据:", submitData); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | handleAddGroup() { |
| | | this.$refs.addGroupDialog.open() |
| | | this.$refs.addGroupDialog.open(); |
| | | }, |
| | | handleEditGroup(row) { |
| | | this.$refs.addGroupDialog.open(row) |
| | | this.$refs.addGroupDialog.open(row); |
| | | }, |
| | | handleDeleteGroup(row) { |
| | | this.$confirm('确认删除该组别吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const index = this.groupTableData.findIndex(item => item === row) |
| | | if (index > -1) { |
| | | this.groupTableData.splice(index, 1) |
| | | this.$message.success('删除成功') |
| | | } |
| | | }).catch(() => {}) |
| | | this.$confirm("确认删除该组别吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | const index = this.groupTableData.findIndex((item) => item === row); |
| | | if (index > -1) { |
| | | this.groupTableData.splice(index, 1); |
| | | this.$message.success("删除成功"); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | handleGroupSubmit(form) { |
| | | console.log('11111111',form ,'2222222',this.groupTableData) |
| | | const index = this.groupTableData.findIndex(item => item.id === form.id) |
| | | console.log("11111111", form, "2222222", this.groupTableData); |
| | | const index = this.groupTableData.findIndex( |
| | | (item) => item.id === form.id |
| | | ); |
| | | if (index > -1) { |
| | | this.groupTableData.splice(index, 1, form) |
| | | this.groupTableData.splice(index, 1, form); |
| | | } else { |
| | | this.groupTableData.push(form) |
| | | this.groupTableData.push(form); |
| | | } |
| | | // 更新表单数据 |
| | | this.form.experimentDispatchGroups = this.groupTableData; |
| | |
| | | const allParticipants = [ |
| | | ...this.members.processEngineer, |
| | | ...this.members.experimenter, |
| | | ...this.members.analyst |
| | | ...this.members.analyst, |
| | | ]; |
| | | this.$refs.addTaskDialog.open(null, allParticipants); |
| | | }, |
| | |
| | | const allParticipants = [ |
| | | ...this.members.processEngineer, |
| | | ...this.members.experimenter, |
| | | ...this.members.analyst |
| | | ...this.members.analyst, |
| | | ]; |
| | | this.$refs.addTaskDialog.open(row, allParticipants); |
| | | }, |
| | | handleDeleteTask(row) { |
| | | this.$confirm('确认删除该任务吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const index = this.allTaskTableData.findIndex(item => item === row) |
| | | if (index > -1) { |
| | | this.allTaskTableData.splice(index, 1) |
| | | // 删除后判断是否需要跳页 |
| | | const maxPage = Math.ceil(this.allTaskTableData.length / this.taskPageSize) || 1; |
| | | if (this.taskPageNum > maxPage) { |
| | | this.taskPageNum = maxPage; |
| | | this.$confirm("确认删除该任务吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | const index = this.allTaskTableData.findIndex((item) => item === row); |
| | | if (index > -1) { |
| | | this.allTaskTableData.splice(index, 1); |
| | | // 删除后判断是否需要跳页 |
| | | const maxPage = |
| | | Math.ceil(this.allTaskTableData.length / this.taskPageSize) || 1; |
| | | if (this.taskPageNum > maxPage) { |
| | | this.taskPageNum = maxPage; |
| | | } |
| | | this.updateTaskTableData(); |
| | | this.$message.success("删除成功"); |
| | | } |
| | | this.updateTaskTableData(); |
| | | this.$message.success('删除成功') |
| | | } |
| | | }).catch(() => {}) |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | handleTaskSubmit(form) { |
| | | const index = this.allTaskTableData.findIndex(item => item.taskName === form.taskName); |
| | | const index = this.allTaskTableData.findIndex( |
| | | (item) => item.taskName === form.taskName |
| | | ); |
| | | const taskData = { |
| | | id: form.id || '', |
| | | id: form.id || "", |
| | | taskName: form.taskName, |
| | | personCharge: form.leader, |
| | | startTime: form.startTime, |
| | | dispatchId: this.id || '', |
| | | selectedUsers: form.selectedUsers |
| | | dispatchId: this.id || "", |
| | | selectedUsers: form.selectedUsers, |
| | | }; |
| | | if (index > -1) { |
| | | this.allTaskTableData.splice(index, 1, taskData); |
| | |
| | | // 获取所有编辑器的内容 |
| | | getAllEditorContent() { |
| | | return { |
| | | keyNodes: this.$refs.keyNodesEditor.getContent() |
| | | } |
| | | keyNodes: this.$refs.keyNodesEditor.getContent(), |
| | | }; |
| | | }, |
| | | // 统一处理方法 |
| | | handleSubmit(type) { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | // 获取所有编辑器内容 |
| | | const editorContents = this.getAllEditorContent() |
| | | |
| | | const editorContents = this.getAllEditorContent(); |
| | | |
| | | // 检查编辑器内容是否为空 |
| | | const isEmptyContent = (content) => { |
| | | return !content || content === '<p></p>' || content.trim() === '<p></p>' |
| | | } |
| | | return ( |
| | | !content || content === "<p></p>" || content.trim() === "<p></p>" |
| | | ); |
| | | }; |
| | | |
| | | if (isEmptyContent(editorContents.keyNodes)) { |
| | | this.$message.warning('请填写关键节点') |
| | | return false |
| | | this.$message.warning("请填写关键节点"); |
| | | return false; |
| | | } |
| | | |
| | | // 构建提交数据 |
| | |
| | | keyNodes: editorContents.keyNodes, |
| | | // 移除不需要传递给后端的字段 |
| | | projectStage: undefined, |
| | | experimentDispatchGroups: this.groupTableData.map(item => ({ |
| | | experimentDispatchGroups: this.groupTableData.map((item) => ({ |
| | | groupName: item.groupName, |
| | | remark: item.remark, |
| | | dispatchId: this.id || '', |
| | | id: item.id || '' |
| | | dispatchId: this.id || "", |
| | | id: item.id || "", |
| | | })), |
| | | experimentDispatchTasks: this.taskTableData.map(item => ({ |
| | | experimentDispatchTasks: this.taskTableData.map((item) => ({ |
| | | taskName: item.taskName, |
| | | personCharge: item.personCharge, |
| | | startTime: item.startTime, |
| | | dispatchId: this.id || '', |
| | | id: item.id || '' |
| | | dispatchId: this.id || "", |
| | | id: item.id || "", |
| | | })), |
| | | experimentDispatchParticipants: [ |
| | | ...this.members.processEngineer.map(user => ({ |
| | | ...this.members.processEngineer.map((user) => ({ |
| | | userId: user.userId, |
| | | roleType: 3, // 工艺工程师 |
| | | status: 1, // 待确认 |
| | | dispatchId: this.id || '', |
| | | id: user.id || '', |
| | | dispatchId: this.id || "", |
| | | id: user.id || "", |
| | | nickName: user.nickName, |
| | | avatar: user.avatar |
| | | avatar: user.avatar, |
| | | })), |
| | | ...this.members.experimenter.map(user => ({ |
| | | ...this.members.experimenter.map((user) => ({ |
| | | userId: user.userId, |
| | | roleType: 5, // 实验员 |
| | | status: 1, // 待确认 |
| | | dispatchId: this.id || '', |
| | | id: user.id || '', |
| | | dispatchId: this.id || "", |
| | | id: user.id || "", |
| | | nickName: user.nickName, |
| | | avatar: user.avatar |
| | | avatar: user.avatar, |
| | | })), |
| | | ...this.members.analyst.map(user => ({ |
| | | ...this.members.analyst.map((user) => ({ |
| | | userId: user.userId, |
| | | roleType: 4, // 化验师 |
| | | status: 1, // 待确认 |
| | | dispatchId: this.id || '', |
| | | id: user.id || '', |
| | | dispatchId: this.id || "", |
| | | id: user.id || "", |
| | | nickName: user.nickName, |
| | | avatar: user.avatar |
| | | })) |
| | | avatar: user.avatar, |
| | | })), |
| | | ], |
| | | status: type === 'draft' ? -1 : 1, // 草稿箱:-1, 待确认:1 |
| | | experimentStartTime: this.form.experimentTime ? this.form.experimentTime[0] : '', |
| | | experimentEndTime: this.form.experimentTime ? this.form.experimentTime[1] : '' |
| | | status: type === "draft" ? -1 : 1, // 草稿箱:-1, 待确认:1 |
| | | experimentStartTime: this.form.experimentTime |
| | | ? this.form.experimentTime[0] |
| | | : "", |
| | | experimentEndTime: this.form.experimentTime |
| | | ? this.form.experimentTime[1] |
| | | : "", |
| | | }; |
| | | |
| | | if (this.id) { |
| | |
| | | |
| | | const request = this.id ? updateDispatch : addDispatch; |
| | | |
| | | request(formData).then(res => { |
| | | if (res.code === 200) { |
| | | const successMsg = type === 'draft' ? '草稿保存成功' : (this.id ? '更新成功' : '保存成功'); |
| | | this.$message.success(successMsg); |
| | | this.$router.back(); |
| | | } else { |
| | | const errorMsg = type === 'draft' ? '草稿保存失败' : (this.id ? '更新失败' : '保存失败'); |
| | | this.$message.error(res.msg || errorMsg); |
| | | } |
| | | }).catch(err => { |
| | | console.error('接口错误:', err); |
| | | const errorMsg = type === 'draft' ? '草稿保存失败' : (this.id ? '更新失败' : '保存失败'); |
| | | this.$message.error(errorMsg); |
| | | }); |
| | | request(formData) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | const successMsg = |
| | | type === "draft" |
| | | ? "草稿保存成功" |
| | | : this.id |
| | | ? "更新成功" |
| | | : "保存成功"; |
| | | this.$message.success(successMsg); |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | } else { |
| | | const errorMsg = |
| | | type === "draft" |
| | | ? "草稿保存失败" |
| | | : this.id |
| | | ? "更新失败" |
| | | : "保存失败"; |
| | | this.$message.error(res.msg || errorMsg); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error("接口错误:", err); |
| | | const errorMsg = |
| | | type === "draft" |
| | | ? "草稿保存失败" |
| | | : this.id |
| | | ? "更新失败" |
| | | : "保存失败"; |
| | | this.$message.error(errorMsg); |
| | | }); |
| | | } else { |
| | | this.$message.warning('请填写必填项'); |
| | | this.$message.warning("请填写必填项"); |
| | | return false; |
| | | } |
| | | }); |
| | |
| | | |
| | | // 保存 |
| | | sendDispatch() { |
| | | this.handleSubmit('save'); |
| | | this.handleSubmit("save"); |
| | | }, |
| | | |
| | | // 保存草稿 |
| | | saveDraft() { |
| | | this.handleSubmit('draft'); |
| | | this.handleSubmit("draft"); |
| | | }, |
| | | handleDateChange(value) { |
| | | // 处理日期变化后的逻辑 |
| | |
| | | this.form.experimentStartTime = value[0]; |
| | | this.form.experimentEndTime = value[1]; |
| | | } else { |
| | | this.form.experimentStartTime = ''; |
| | | this.form.experimentEndTime = ''; |
| | | this.form.experimentStartTime = ""; |
| | | this.form.experimentEndTime = ""; |
| | | } |
| | | }, |
| | | // 统一的搜索方法 |
| | |
| | | try { |
| | | // 根据当前激活的输入框决定使用哪个参数 |
| | | const params = {}; |
| | | if (this.$refs.projectNameSelect && this.$refs.projectNameSelect.$el.contains(document.activeElement)) { |
| | | if ( |
| | | this.$refs.projectNameSelect && |
| | | this.$refs.projectNameSelect.$el.contains(document.activeElement) |
| | | ) { |
| | | params.projectName = query; |
| | | } else if (this.$refs.proposalIdSelect && this.$refs.proposalIdSelect.$el.contains(document.activeElement)) { |
| | | } else if ( |
| | | this.$refs.proposalIdSelect && |
| | | this.$refs.proposalIdSelect.$el.contains(document.activeElement) |
| | | ) { |
| | | params.projectCode = query; |
| | | } |
| | | |
| | | const res = await getProposalList(params); |
| | | if (res) { |
| | | this.projectOptions = res.map(item => ({ |
| | | this.projectOptions = res.map((item) => ({ |
| | | id: item.id, |
| | | projectName: item.projectName, |
| | | projectCode: item.projectCode, |
| | | projectStage: item.projectStage |
| | | projectStage: item.projectStage, |
| | | })); |
| | | // 更新缓存 |
| | | this.projectOptions.forEach(item => { |
| | | this.projectOptions.forEach((item) => { |
| | | this.projectDataMap.set(item.id, item); |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | console.error('获取方案列表失败:', error); |
| | | this.$message.error('获取方案列表失败'); |
| | | console.error("获取方案列表失败:", error); |
| | | this.$message.error("获取方案列表失败"); |
| | | } finally { |
| | | this.projectLoading = false; |
| | | } |
| | |
| | | |
| | | // 方案名称选择变化 |
| | | handleProjectNameChange(value) { |
| | | const selectedProject = this.projectOptions.find(item => item.id === value); |
| | | const selectedProject = this.projectOptions.find( |
| | | (item) => item.id === value |
| | | ); |
| | | if (selectedProject) { |
| | | this.updateFormWithProject(selectedProject); |
| | | } |
| | |
| | | |
| | | // 方案编号选择变化 |
| | | handleProposalIdChange(value) { |
| | | const selectedProject = this.projectOptions.find(item => item.id === value); |
| | | const selectedProject = this.projectOptions.find( |
| | | (item) => item.id === value |
| | | ); |
| | | if (selectedProject) { |
| | | this.updateFormWithProject(selectedProject); |
| | | } |
| | |
| | | // 获取详情 |
| | | getDetail() { |
| | | if (this.id) { |
| | | getDetailById({ id: this.id }).then(res => { |
| | | if (res) { |
| | | const data = res |
| | | // 设置表单数据 |
| | | this.form = { |
| | | projectName: data.projectName, |
| | | proposalId: data.proposalId, |
| | | projectStage: data.projectStage, |
| | | experimentName: data.experimentName, |
| | | experimentCode: data.experimentCode, |
| | | experimentDate: data.experimentDate, |
| | | experimentTime: [data.experimentStartTime, data.experimentEndTime], |
| | | status: data.status, |
| | | experimentDispatchGroups: data.experimentDispatchGroups || [], |
| | | experimentDispatchParticipants: data.experimentDispatchParticipants || [], |
| | | experimentDispatchTasks: data.experimentDispatchTasks || [], |
| | | keyNodes: data.keyNodes || '' |
| | | getDetailById({ id: this.id }) |
| | | .then((res) => { |
| | | if (res) { |
| | | const data = res; |
| | | // 设置表单数据 |
| | | this.form = { |
| | | projectName: data.projectName, |
| | | proposalId: data.proposalId, |
| | | projectStage: data.projectStage, |
| | | experimentName: data.experimentName, |
| | | experimentCode: data.experimentCode, |
| | | experimentDate: data.experimentDate, |
| | | experimentTime: [ |
| | | data.experimentStartTime, |
| | | data.experimentEndTime, |
| | | ], |
| | | status: data.status, |
| | | experimentDispatchGroups: data.experimentDispatchGroups || [], |
| | | experimentDispatchParticipants: |
| | | data.experimentDispatchParticipants || [], |
| | | experimentDispatchTasks: data.experimentDispatchTasks || [], |
| | | keyNodes: data.keyNodes || "", |
| | | }; |
| | | // 设置表格数据 |
| | | this.groupTableData = data.experimentDispatchGroups || []; |
| | | this.allTaskTableData = data.experimentDispatchTasks || []; |
| | | this.updateTaskTableData(); |
| | | |
| | | // 处理参与人员数据 |
| | | this.members = { |
| | | processEngineer: |
| | | data.experimentDispatchParticipants.filter( |
| | | (p) => p.roleType === 3 |
| | | ) || [], |
| | | experimenter: |
| | | data.experimentDispatchParticipants.filter( |
| | | (p) => p.roleType === 5 |
| | | ) || [], |
| | | analyst: |
| | | data.experimentDispatchParticipants.filter( |
| | | (p) => p.roleType === 4 |
| | | ) || [], |
| | | }; |
| | | |
| | | // 更新selectMemberData |
| | | this.selectMemberData = [ |
| | | ...this.members.processEngineer, |
| | | ...this.members.experimenter, |
| | | ...this.members.analyst, |
| | | ]; |
| | | } |
| | | // 设置表格数据 |
| | | this.groupTableData = data.experimentDispatchGroups || [] |
| | | this.allTaskTableData = data.experimentDispatchTasks || [] |
| | | this.updateTaskTableData(); |
| | | |
| | | // 处理参与人员数据 |
| | | this.members = { |
| | | processEngineer: data.experimentDispatchParticipants.filter(p => p.roleType === 3) || [], |
| | | experimenter: data.experimentDispatchParticipants.filter(p => p.roleType === 5) || [], |
| | | analyst: data.experimentDispatchParticipants.filter(p => p.roleType === 4) || [] |
| | | }; |
| | | |
| | | // 更新selectMemberData |
| | | this.selectMemberData = [ |
| | | ...this.members.processEngineer, |
| | | ...this.members.experimenter, |
| | | ...this.members.analyst |
| | | ]; |
| | | } |
| | | }).catch(err => { |
| | | console.error('获取详情失败:', err) |
| | | }) |
| | | }) |
| | | .catch((err) => { |
| | | console.error("获取详情失败:", err); |
| | | }); |
| | | } |
| | | }, |
| | | |
| | |
| | | try { |
| | | const res = await getProposalList({}); |
| | | if (res) { |
| | | this.projectOptions = res.map(item => ({ |
| | | this.projectOptions = res.map((item) => ({ |
| | | id: item.id, |
| | | projectName: item.projectName, |
| | | projectCode: item.projectCode, |
| | | projectStage: item.projectStage |
| | | projectStage: item.projectStage, |
| | | })); |
| | | // 更新缓存 |
| | | this.projectOptions.forEach(item => { |
| | | this.projectOptions.forEach((item) => { |
| | | this.projectDataMap.set(item.id, item); |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | console.error('获取方案列表失败:', error); |
| | | this.$message.error('获取方案列表失败'); |
| | | console.error("获取方案列表失败:", error); |
| | | this.$message.error("获取方案列表失败"); |
| | | } finally { |
| | | this.projectLoading = false; |
| | | } |
| | |
| | | this.taskPageNum = page; |
| | | this.updateTaskTableData(); |
| | | }, |
| | | |
| | | }, |
| | | created() { |
| | | // 从路由参数中获取id |
| | |
| | | // 初始化时自动添加当前用户为工艺工程师(如果是工艺工程师角色) |
| | | const currentUser = this.getCurrentUser(); |
| | | if (currentUser) { |
| | | this.members.processEngineer = [{ |
| | | userId: currentUser.userId, |
| | | nickName: currentUser.nickName, |
| | | avatar: currentUser.avatar, |
| | | roleId: 3, |
| | | roleName: '工艺工程师' |
| | | }]; |
| | | this.members.processEngineer = [ |
| | | { |
| | | userId: currentUser.userId, |
| | | nickName: currentUser.nickName, |
| | | avatar: currentUser.avatar, |
| | | roleId: 3, |
| | | roleName: "工艺工程师", |
| | | }, |
| | | ]; |
| | | // 同时更新selectMemberData |
| | | this.selectMemberData = [...this.members.processEngineer]; |
| | | } |
| | | this.updateTaskTableData(); // 初始化时同步一次 |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | .data-test{ |
| | | .el-input__inner{ |
| | | background-color: #F5F7FA; |
| | | .data-test { |
| | | .el-input__inner { |
| | | background-color: #f5f7fa; |
| | | padding-left: 20px !important; |
| | | } |
| | | } |
| | |
| | | <el-input v-model="form.taskName" placeholder="请输入任务名称" class="custom-input"></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="负责人" prop="leader" required> |
| | | <el-form-item label="负责人" prop="leader"> |
| | | <!-- <div class="required-label">负责人</div> --> |
| | | <Table |
| | | ref="table" |
| | |
| | | taskName: [ |
| | | { required: true, message: "请输入任务名称", trigger: "blur" } |
| | | ], |
| | | leader: [ |
| | | { required: true, message: "请选择负责人", trigger: "blur" } |
| | | ], |
| | | startTime: [ |
| | | { required: true, message: "请选择开始时间", trigger: "change" } |
| | | ] |
| | |
| | | <div style="padding-left: 25px"> |
| | | <el-form-item prop="experimentTime" label="试验时间"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.experimentTime" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | |
| | | <template> |
| | | <div class="list"> |
| | | <TableCustom :queryForm="form" :tableData="tableData" :total="total" @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"> |
| | | <TableCustom :queryForm="form" |
| | | :tableData="tableData" |
| | | :total="total" |
| | | @handleCurrentChange="handleCurrentChange" |
| | | @handleSizeChange="handleSizeChange"> |
| | | <template #search> |
| | | <el-form :model="form" labelWidth="auto" inline> |
| | | <el-form-item label="所属项目课题方案:"> |
| | |
| | | @change="handleDateChange" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="状态" > |
| | | <el-form-item label="状态" v-if="(userRole==3||userRole==2||userRole==1)"> |
| | | <el-select v-model="form.status" placeholder="请选择"> |
| | | <el-option label="全部" value=""></el-option> |
| | | <el-option label="草稿箱" value="-1"></el-option> |
| | | <el-option label="待确认" value="1"></el-option> |
| | | <el-option label="已确认" value="2"></el-option> |
| | | <el-option label="已封存" value="3"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="状态" v-else> |
| | | <el-select v-model="form.otherStatus" placeholder="请选择"> |
| | | <el-option label="待确认" value="1"></el-option> |
| | | <el-option label="已确认" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label=""> |
| | |
| | | label="状态" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="getStatusType(scope.row.status)"> |
| | | {{ getStatusText(scope.row.status) }} |
| | | <el-tag :type="getStatusType((userRole==3||userRole==2||userRole==1)?scope.row.status:scope.row.otherStatus)"> |
| | | {{ getStatusText((userRole==3||userRole==2||userRole==1)?scope.row.status:scope.row.otherStatus) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <template v-if="userRole == '4' || userRole == '5'"> |
| | | <el-button type="text" @click="handleDetail(scope.row)">详情</el-button> |
| | | <el-button |
| | | v-if="scope.row.status == 1" |
| | | v-if="scope.row.otherStatus == 1" |
| | | type="text" |
| | | @click="handleConfirm(scope.row)" |
| | | >确认</el-button> |
| | |
| | | inline |
| | | label-position="top" |
| | | > |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>所属实验调度</div> |
| | | </div> |
| | | <el-button type="primary" class="el-icon-plus" @click="handleAddTask" v-if="pageType !== 'view'">选择实验调度</el-button> |
| | | <el-button |
| | | type="primary" |
| | | class="el-icon-plus" |
| | | @click="handleAddTask" |
| | | v-if="pageType !== 'view'" |
| | | >选择实验调度</el-button |
| | | > |
| | | </div> |
| | | |
| | | <Table :data="taskTableData" :total="0" :height="null" class="rwuTable"> |
| | | <el-table-column prop="projectName" label="所属项目课题方案" width="200"></el-table-column> |
| | | <el-table-column prop="experimentCode" label="实验编号"></el-table-column> |
| | | <el-table-column prop="experimentName" label="实验名称"></el-table-column> |
| | | <el-table-column prop="experimentDate" label="通知时间"></el-table-column> |
| | | <el-table-column prop="experimentStartTime" label="实验开始时间"></el-table-column> |
| | | <el-table-column prop="experimentEndTime" label="实验结束时间"></el-table-column> |
| | | <el-table-column prop="participantsName" label="参加人员"></el-table-column> |
| | | <el-table-column |
| | | prop="projectName" |
| | | label="所属项目课题方案" |
| | | width="200" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="experimentCode" |
| | | label="实验编号" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="experimentName" |
| | | label="实验名称" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="experimentDate" |
| | | label="通知时间" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="experimentStartTime" |
| | | label="实验开始时间" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="experimentEndTime" |
| | | label="实验结束时间" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="participantsName" |
| | | label="参加人员" |
| | | ></el-table-column> |
| | | <el-table-column prop="status" label="状态"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="getStatusType(scope.row.status)"> |
| | |
| | | ref="totalResultEditor" |
| | | :value="editorContents.totalResult" |
| | | height="200px" |
| | | style="margin: 20px 0;" |
| | | style="margin: 20px 0" |
| | | placeholder="请输入本次检验结果总表..." |
| | | :readOnly="pageType === 'view'" |
| | | /> |
| | |
| | | ref="resultEditor" |
| | | :value="editorContents.result" |
| | | height="200px" |
| | | style="margin: 20px 0;" |
| | | style="margin: 20px 0" |
| | | placeholder="请输入本次检验结果..." |
| | | :readOnly="pageType === 'view'" |
| | | /> |
| | | |
| | | <div class="add-project-footer" v-if="pageType !== 'view'"> |
| | | <el-button type="primary" class="save-btn" @click="handleSave">提交</el-button> |
| | | <el-button type="primary" class="save-btn" @click="handleSave" |
| | | >提交</el-button |
| | | > |
| | | <el-button @click="handleSaveDraft">存草稿</el-button> |
| | | </div> |
| | | </el-form> |
| | |
| | | :visible.sync="dialogVisible" |
| | | @success="handleTaskSubmit" |
| | | /> --> |
| | | <experimentalScheduling :show="dialogVisible" @close="handleSchedulingClose" @submit="handleSchedulingSubmit" /> |
| | | <experimentalScheduling |
| | | :show="dialogVisible" |
| | | @close="handleSchedulingClose" |
| | | @submit="handleSchedulingSubmit" |
| | | /> |
| | | </Card> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddDialog from './components/addDialog.vue' |
| | | import moment from 'moment' |
| | | import AddDialog from "./components/addDialog.vue"; |
| | | import moment from "moment"; |
| | | import experimentalScheduling from "../sampleManage/components/experimental-scheduling.vue"; |
| | | import AiEditor from '@/components/AiEditor' |
| | | import { getDetail,add,update } from './service' |
| | | import AiEditor from "@/components/AiEditor"; |
| | | import { getDetail, add, update } from "./service"; |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddProject", |
| | | components: { |
| | | AddDialog, |
| | | experimentalScheduling, |
| | | AiEditor |
| | | AiEditor, |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | isEdit: false, |
| | | currentEditIndex: -1, |
| | | pageType: 'add', // 页面类型:add-新增,edit-编辑,view-详情 |
| | | pageType: "add", // 页面类型:add-新增,edit-编辑,view-详情 |
| | | form: { |
| | | id: '', |
| | | dispatchId: '', // 实验调度id |
| | | testReason: '', // 检验说明 |
| | | testResult: '', // 检验结果 |
| | | status: 1 // 状态:1=待提交 |
| | | id: "", |
| | | dispatchId: "", // 实验调度id |
| | | testReason: "", // 检验说明 |
| | | testResult: "", // 检验结果 |
| | | status: 1, // 状态:1=待提交 |
| | | }, |
| | | editorContents: { |
| | | totalResult: '', |
| | | result: '' |
| | | totalResult: "", |
| | | result: "", |
| | | }, |
| | | rules: { |
| | | dispatchId: [{ required: true, message: "请选择实验调度", trigger: "change" }] |
| | | dispatchId: [ |
| | | { required: true, message: "请选择实验调度", trigger: "change" }, |
| | | ], |
| | | }, |
| | | taskTableData: [], |
| | | // 状态映射表 |
| | | statusTypeMap: { |
| | | "-1": "info", |
| | | "1": "warning", |
| | | "2": "success", |
| | | "3": "info" |
| | | 1: "warning", |
| | | 2: "success", |
| | | 3: "info", |
| | | }, |
| | | statusTextMap: { |
| | | "-1": "草稿箱", |
| | | "1": "待确认", |
| | | "2": "已确认", |
| | | "3": "已封存" |
| | | } |
| | | 1: "待确认", |
| | | 2: "已确认", |
| | | 3: "已封存", |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | // 从路由参数中获取id和type |
| | | const { id, type } = this.$route.query; |
| | | if (id) { |
| | | this.pageType = type || 'view'; |
| | | this.pageType = type || "view"; |
| | | this.getDetail(id); |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | methods: { |
| | | handleAddTask() { |
| | |
| | | }, |
| | | handleEditTask(row) { |
| | | this.isEdit = true; |
| | | this.currentEditIndex = this.taskTableData.findIndex(item => item === row); |
| | | |
| | | this.currentEditIndex = this.taskTableData.findIndex( |
| | | (item) => item === row |
| | | ); |
| | | |
| | | const editData = { |
| | | sampleCode: row.sampleCode, |
| | | testData: row.testData, |
| | | testTypes: [], |
| | | photos: [], |
| | | spectrums: [] |
| | | spectrums: [], |
| | | }; |
| | | |
| | | if (row.photos && row.photos.length > 0) { |
| | | editData.testTypes.push('photo'); |
| | | editData.photos = row.photos.map(photo => ({ |
| | | editData.testTypes.push("photo"); |
| | | editData.photos = row.photos.map((photo) => ({ |
| | | name: photo.name, |
| | | url: photo.url, |
| | | raw: null |
| | | raw: null, |
| | | })); |
| | | } |
| | | if (row.spectrums && row.spectrums.length > 0) { |
| | | editData.testTypes.push('spectrum'); |
| | | editData.spectrums = row.spectrums.map(spectrum => ({ |
| | | editData.testTypes.push("spectrum"); |
| | | editData.spectrums = row.spectrums.map((spectrum) => ({ |
| | | name: spectrum.name, |
| | | url: spectrum.url, |
| | | raw: null |
| | | raw: null, |
| | | })); |
| | | } |
| | | |
| | |
| | | if (index > -1) { |
| | | const item = this.taskTableData[index]; |
| | | if (item.photos) { |
| | | item.photos.forEach(photo => { |
| | | if (photo.url.startsWith('blob:')) { |
| | | item.photos.forEach((photo) => { |
| | | if (photo.url.startsWith("blob:")) { |
| | | URL.revokeObjectURL(photo.url); |
| | | } |
| | | }); |
| | | } |
| | | if (item.spectrums) { |
| | | item.spectrums.forEach(spectrum => { |
| | | if (spectrum.url.startsWith('blob:')) { |
| | | item.spectrums.forEach((spectrum) => { |
| | | if (spectrum.url.startsWith("blob:")) { |
| | | URL.revokeObjectURL(spectrum.url); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.taskTableData.splice(index, 1); |
| | | this.$message.success("删除成功"); |
| | | } |
| | |
| | | .catch(() => {}); |
| | | }, |
| | | handleTaskSubmit(formData) { |
| | | const photos = formData.photos.map(file => ({ |
| | | const photos = formData.photos.map((file) => ({ |
| | | name: file.name, |
| | | url: file.url || URL.createObjectURL(file.raw) |
| | | url: file.url || URL.createObjectURL(file.raw), |
| | | })); |
| | | |
| | | const spectrums = formData.spectrums.map(file => ({ |
| | | const spectrums = formData.spectrums.map((file) => ({ |
| | | name: file.name, |
| | | url: file.url || URL.createObjectURL(file.raw) |
| | | url: file.url || URL.createObjectURL(file.raw), |
| | | })); |
| | | |
| | | const newData = { |
| | | sampleCode: formData.sampleCode, |
| | | testData: formData.testData, |
| | | testResult: '', |
| | | testResult: "", |
| | | photos, |
| | | spectrums, |
| | | createTime: this.isEdit ? this.taskTableData[this.currentEditIndex].createTime : moment().format('YYYY-MM-DD HH:mm:ss') |
| | | createTime: this.isEdit |
| | | ? this.taskTableData[this.currentEditIndex].createTime |
| | | : moment().format("YYYY-MM-DD HH:mm:ss"), |
| | | }; |
| | | |
| | | if (this.isEdit && this.currentEditIndex > -1) { |
| | | const oldData = this.taskTableData[this.currentEditIndex]; |
| | | if (oldData.photos) { |
| | | oldData.photos.forEach(photo => { |
| | | if (photo.url.startsWith('blob:') && !photos.find(p => p.url === photo.url)) { |
| | | oldData.photos.forEach((photo) => { |
| | | if ( |
| | | photo.url.startsWith("blob:") && |
| | | !photos.find((p) => p.url === photo.url) |
| | | ) { |
| | | URL.revokeObjectURL(photo.url); |
| | | } |
| | | }); |
| | | } |
| | | if (oldData.spectrums) { |
| | | oldData.spectrums.forEach(spectrum => { |
| | | if (spectrum.url.startsWith('blob:') && !spectrums.find(s => s.url === spectrum.url)) { |
| | | oldData.spectrums.forEach((spectrum) => { |
| | | if ( |
| | | spectrum.url.startsWith("blob:") && |
| | | !spectrums.find((s) => s.url === spectrum.url) |
| | | ) { |
| | | URL.revokeObjectURL(spectrum.url); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.taskTableData.splice(this.currentEditIndex, 1, newData); |
| | | this.$message.success('更新成功'); |
| | | this.$message.success("更新成功"); |
| | | } else { |
| | | this.taskTableData.push(newData); |
| | | this.$message.success('添加成功'); |
| | | this.$message.success("添加成功"); |
| | | } |
| | | |
| | | |
| | | this.dialogVisible = false; |
| | | this.isEdit = false; |
| | | this.currentEditIndex = -1; |
| | | }, |
| | | getPhotoUrls(photos) { |
| | | return photos.map(photo => photo.url); |
| | | return photos.map((photo) => photo.url); |
| | | }, |
| | | handleSchedulingClose() { |
| | | this.dialogVisible = false; |
| | |
| | | this.taskTableData = data || []; |
| | | }, |
| | | getStatusType(status) { |
| | | return this.statusTypeMap[status] || 'info'; |
| | | return this.statusTypeMap[status] || "info"; |
| | | }, |
| | | getStatusText(status) { |
| | | return this.statusTextMap[status] || '未知状态'; |
| | | return this.statusTextMap[status] || "未知状态"; |
| | | }, |
| | | // 获取所有编辑器的内容 |
| | | getAllEditorContent() { |
| | | return { |
| | | totalResult: this.$refs.totalResultEditor.getContent(), |
| | | result: this.$refs.resultEditor.getContent() |
| | | } |
| | | result: this.$refs.resultEditor.getContent(), |
| | | }; |
| | | }, |
| | | // 统一处理方法 |
| | | handleSubmit(type) { |
| | | // 如果是存草稿,不进行校验 |
| | | if (type === 'draft') { |
| | | if (type === "draft") { |
| | | this.submitData(type); |
| | | return; |
| | | } |
| | |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | // 获取所有编辑器内容 |
| | | const editorContents = this.getAllEditorContent() |
| | | |
| | | const editorContents = this.getAllEditorContent(); |
| | | |
| | | // 检查编辑器内容是否为空 |
| | | const emptyFields = [] |
| | | |
| | | const emptyFields = []; |
| | | |
| | | // 判断内容是否为空(排除<p></p>) |
| | | const isEmptyContent = (content) => { |
| | | return !content || content === '<p></p>' || content.trim() === '<p></p>' |
| | | } |
| | | return ( |
| | | !content || content === "<p></p>" || content.trim() === "<p></p>" |
| | | ); |
| | | }; |
| | | |
| | | // 检查实验调度是否选择 |
| | | if (!this.taskTableData || this.taskTableData.length === 0) { |
| | | this.$message.warning('请选择实验调度') |
| | | return false |
| | | this.$message.warning("请选择实验调度"); |
| | | return false; |
| | | } |
| | | |
| | | // 检查检验结果总表是否填写 |
| | | if (isEmptyContent(editorContents.totalResult)) { |
| | | this.$message.warning('请填写本次检验结果总表') |
| | | return false |
| | | this.$message.warning("请填写本次检验结果总表"); |
| | | return false; |
| | | } |
| | | |
| | | this.submitData(type); |
| | | } else { |
| | | this.$message.warning('请填写必填项') |
| | | return false |
| | | this.$message.warning("请填写必填项"); |
| | | return false; |
| | | } |
| | | }) |
| | | }); |
| | | }, |
| | | |
| | | // 提交数据 |
| | | async submitData(type) { |
| | | try { |
| | | // 获取所有编辑器内容 |
| | | const editorContents = this.getAllEditorContent() |
| | | |
| | | const editorContents = this.getAllEditorContent(); |
| | | |
| | | // 构建提交数据 |
| | | const submitData = { |
| | | ...this.form, |
| | | dispatchId: this.taskTableData[0]?.id || '', |
| | | dispatchId: this.taskTableData[0]?.id || "", |
| | | testReason: editorContents.totalResult, |
| | | testResult: editorContents.result, |
| | | status: type === 'draft' ? -1 : 1 // 草稿箱:-1, 待提交:1 |
| | | } |
| | | status: type === "draft" ? -1 : 1, // 草稿箱:-1, 待提交:1 |
| | | }; |
| | | |
| | | // 如果是编辑模式,添加id |
| | | if (this.pageType === 'edit') { |
| | | submitData.id = this.form.id |
| | | if (this.pageType === "edit") { |
| | | submitData.id = this.form.id; |
| | | } |
| | | |
| | | console.log('提交数据:', submitData) |
| | | |
| | | // 调用接口 |
| | | const request = this.pageType === 'edit' ? update : add |
| | | const res = await request(submitData) |
| | | const request = this.pageType === "edit" ? update : add; |
| | | const res = await request(submitData); |
| | | |
| | | if (res.code === 200) { |
| | | const successMsg = type === 'draft' ? '草稿保存成功' : (this.pageType === 'edit' ? '更新成功' : '保存成功') |
| | | this.$message.success(successMsg) |
| | | this.$router.back() |
| | | const successMsg = |
| | | type === "draft" |
| | | ? "草稿保存成功" |
| | | : this.pageType === "edit" |
| | | ? "更新成功" |
| | | : "保存成功"; |
| | | this.$message.success(successMsg); |
| | | |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | } else { |
| | | const errorMsg = type === 'draft' ? '草稿保存失败' : (this.pageType === 'edit' ? '更新失败' : '保存失败') |
| | | this.$message.error(res.msg || errorMsg) |
| | | const errorMsg = |
| | | type === "draft" |
| | | ? "草稿保存失败" |
| | | : this.pageType === "edit" |
| | | ? "更新失败" |
| | | : "保存失败"; |
| | | this.$message.error(res.msg || errorMsg); |
| | | } |
| | | } catch (error) { |
| | | console.error('保存失败:', error) |
| | | const errorMsg = type === 'draft' ? '草稿保存失败' : (this.pageType === 'edit' ? '更新失败' : '保存失败') |
| | | this.$message.error(errorMsg) |
| | | console.error("保存失败:", error); |
| | | const errorMsg = |
| | | type === "draft" |
| | | ? "草稿保存失败" |
| | | : this.pageType === "edit" |
| | | ? "更新失败" |
| | | : "保存失败"; |
| | | this.$message.error(errorMsg); |
| | | } |
| | | }, |
| | | |
| | |
| | | dispatchId: data.dispatchId, |
| | | testReason: data.testReason, |
| | | testResult: data.testResult, |
| | | status: data.status |
| | | status: data.status, |
| | | }; |
| | | // 设置编辑器内容 |
| | | this.editorContents = { |
| | | totalResult: data.testReason || '', |
| | | result: data.testResult || '' |
| | | totalResult: data.testReason || "", |
| | | result: data.testResult || "", |
| | | }; |
| | | // 设置实验调度数据 |
| | | if (data.experimentDispatch) { |
| | |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('获取详情失败:', error); |
| | | this.$message.error('获取详情失败,请重试'); |
| | | console.error("获取详情失败:", error); |
| | | this.$message.error("获取详情失败,请重试"); |
| | | } |
| | | }, |
| | | |
| | | // 保存 |
| | | handleSave() { |
| | | this.handleSubmit('save') |
| | | this.handleSubmit("save"); |
| | | }, |
| | | // 保存草稿 |
| | | handleSaveDraft() { |
| | | this.handleSubmit('draft') |
| | | } |
| | | } |
| | | this.handleSubmit("draft"); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | flex-wrap: wrap; |
| | | gap: 13px; |
| | | margin-top: 38px; |
| | | |
| | | |
| | | .header-title-left { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | .spectrum-link { |
| | | display: block; |
| | | margin-bottom: 5px; |
| | | |
| | | |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | |
| | | import AiEditor from '@/components/AiEditor' |
| | | import moment from 'moment' |
| | | import { getDetail, update } from './service' |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddProject", |
| | |
| | | allTaskTableData: [], |
| | | taskTableData: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | methods: { |
| | | // 获取详情 |
| | |
| | | } |
| | | // 返回上一页 |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | } else { |
| | | this.$message.error(res.msg || '提交失败'); |
| | | } |
| | |
| | | import ReceiveConfirmDialog from "./components/receiveConfirmDialog.vue"; |
| | | import { add, getDetail, update, batchCollectSamples } from "./service"; |
| | | import {getFullUrl} from '@/utils/utils.js' |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddSample", |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | isEngineer() { |
| | | return this.userRole == '3'; // 工艺工程师 |
| | | }, |
| | |
| | | |
| | | // 设置取样操作记录 |
| | | if (detail.samplingRecordOperations && detail.samplingRecordOperations.length > 0) { |
| | | console.log('原始取样操作记录:', detail.samplingRecordOperations); |
| | | |
| | | // 如果是化验师角色,需要将数据分为待接收和已接收 |
| | | if (this.isAssayer) { |
| | | // 确保status是字符串类型 |
| | | this.pendingSamples = detail.samplingRecordOperations |
| | | .filter(item => { |
| | | const status = String(item.status); |
| | | console.log('过滤待接收样品:', item.id, status); |
| | | return status == '2'; |
| | | }) |
| | | .map(item => ({ |
| | | ...item, |
| | | status: String(item.status) |
| | | })); |
| | | console.log('处理后的待接收样品:', this.pendingSamples); |
| | | this.pendingSamplesTotal = this.pendingSamples.length; |
| | | |
| | | this.receivedSamples = detail.samplingRecordOperations |
| | | .filter(item => String(item.status) == '3') |
| | | .map(item => ({ |
| | |
| | | })); |
| | | } |
| | | } |
| | | |
| | | // 如果是详情模式,禁用所有输入 |
| | | // if (this.pageType == 'detail') { |
| | | // this.$nextTick(() => { |
| | | // const inputs = document.querySelectorAll('input, textarea, select'); |
| | | // inputs.forEach(input => { |
| | | // input.disabled = true; |
| | | // }); |
| | | // }); |
| | | // } |
| | | } |
| | | } catch (error) { |
| | | console.error('获取详情失败:', error); |
| | |
| | | samplingCode: this.form.sampleCode, |
| | | id: this.form.id, |
| | | }; |
| | | |
| | | // 打印提交数据 |
| | | console.log('保存提交数据:',submitData); |
| | | |
| | | let res; |
| | | if (this.pageType == 'edit') { |
| | | // 编辑模式调用update接口 |
| | |
| | | |
| | | if (res.code == 200) { |
| | | this.$message.success(this.pageType == 'edit' ? '编辑成功' : '保存成功'); |
| | | this.$router.go(-1); |
| | | this.back(); |
| | | } else { |
| | | this.$message.error(res.msg || (this.pageType == 'edit' ? '编辑失败' : '保存失败')); |
| | | } |
| | |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | // 添加存草稿方法 |
| | | async handleSaveDraft() { |
| | |
| | | |
| | | if (res.code == 200) { |
| | | this.$message.success(this.pageType == 'edit' ? '草稿保存成功' : '存草稿成功'); |
| | | this.$router.go(-1); |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.msg || (this.pageType == 'edit' ? '草稿保存失败' : '存草稿失败')); |
| | | } |
| | |
| | | } |
| | | }, |
| | | handlePendingSelectionChange(selection) { |
| | | console.log("pending samples data:", this.pendingSamples); |
| | | this.selectedSamples = selection; |
| | | // 强制更新视图 |
| | | this.$nextTick(() => { |
| | | this.$forceUpdate(); |
| | | }); |
| | |
| | | import { getDetail, add, update, commitRecord } from './service'; |
| | | import moment from 'moment'; |
| | | import { getFullUrl } from '@/utils/utils' |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "ChangeRecord", |
| | |
| | | if (this.id) { |
| | | this.getDetailData(); |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | methods: { |
| | | getFullUrl, |
| | |
| | | }, |
| | | async submitForm(params) { |
| | | try { |
| | | console.log(params, 'params') |
| | | const res = await commitRecord(params); |
| | | console.log(res, 'res') |
| | | if (res.code === 200) { |
| | | this.$message.success('提交成功'); |
| | | this.showConfirmDialog = false; |
| | | this.$router.go(-1); |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | } else { |
| | | this.$message.error(res.msg || '提交失败'); |
| | | } |
| | |
| | | } from "./service"; |
| | | import moment from "moment"; |
| | | import { add, update, updateTester } from "./service"; |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddProject", |
| | |
| | | this.editId = this.$route.query.id; |
| | | await this.loadEditData(); |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | methods: { |
| | | // ===== 人员相关方法 ===== |
| | |
| | | this.$message.success( |
| | | status === 1 ? "保存成功" : "草稿保存成功" |
| | | ); |
| | | this.$router.go(-1); |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | } else { |
| | | this.$message.error( |
| | | res.msg || (status === 1 ? "保存失败" : "草稿保存失败") |
| | |
| | | }); |
| | | getParticipantsByDispatchId({ dispatchId: data[0].id }) |
| | | .then((res) => { |
| | | console.log("获取参加人员列表:", res); |
| | | if (res) { |
| | | this.participantsData = res || []; |
| | | } else { |
| | |
| | | return; |
| | | } |
| | | |
| | | console.log("编辑数据", res); |
| | | const data = res; |
| | | |
| | | // 填充基本表单数据 |
| | |
| | | // 填充实验调度信息 |
| | | if (data.experimentDispatch?.id) { |
| | | this.form.dispatchId = data.experimentDispatch.id; |
| | | console.log( |
| | | "experimentStepRecord experimentStepRecord", |
| | | JSON.parse(data.experimentStepRecord) |
| | | ); |
| | | this.groupTableData = [{ ...data.experimentDispatch }]; |
| | | |
| | | // 获取组别信息 |
| | |
| | | <el-form-item label="实验编号:"> |
| | | <el-input v-model="form.experimentCode" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="实验名称:"> |
| | | <!-- <el-form-item label="实验名称:"> |
| | | <el-input v-model="form.experimentName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="通知时间:"> |
| | | <el-date-picker v-model="form.createTime" type="daterange" range-separator="至" |
| | | start-placeholder="开始日期" end-placeholder="结束日期" |
| | |
| | | import { getDetail, applicationTermination } from './service' |
| | | import {queryDetail} from '@/components/service.js' |
| | | import {getFullUrl} from '@/utils/utils.js' |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: 'StopExperiment', |
| | |
| | | } else { |
| | | this.$message.error('参数错误,缺少实验ID') |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | methods: { |
| | | getFullUrl, |
| | |
| | | this.$message.success('提交成功') |
| | | this.handleDialogClose() |
| | | // 提交成功后返回列表页 |
| | | this.$router.go(-1) |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | } catch (error) { |
| | | this.$message.error('提交失败') |
| | | } finally { |
| | |
| | | import AiEditor from "@/components/AiEditor"; |
| | | // import AddComponentDialog from "@/components/AddComponentDialog"; |
| | | import { getOtherInfoByDispatchId, add, update, getDetail,evaluateProcess } from './service' |
| | | |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | name: "AddProject", |
| | | components: { |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | created() { |
| | | // 默认选中第一个人员 |
| | | this.selectedLabTechnician = this.labTechnicians[0]; |
| | |
| | | this.getDetailData(id); |
| | | } |
| | | const userInfo = JSON.parse(sessionStorage.getItem("userInfo")); |
| | | console.log('userInfo',userInfo) |
| | | this.userRole = userInfo.roleType || ''; |
| | | }, |
| | | methods: { |
| | |
| | | }, |
| | | // 去评价 |
| | | handleEvaluate(type) { |
| | | if(this.$route.query.type == 'view' && type !='processEngineer'){ |
| | | if(this.$route.query.type == 'view' && type !='processEngineer' && this.userRole!=3){ |
| | | this.$message.warning('当前为查看模式,无法进行评价'); |
| | | return; |
| | | } |
| | |
| | | } |
| | | } else if (type == 'processEngineer') { |
| | | // 工艺工程师评定直接调用接口 |
| | | console.log('11111111111111111111',{ |
| | | ...evaluateData, |
| | | resultReportId: this.form.id // 添加实验报告ID |
| | | }) |
| | | evaluateProcess({ |
| | | ...evaluateData, |
| | | resultReportId: this.form.id // 添加实验报告ID |
| | |
| | | status: status, |
| | | resultWorkEvaluates: evaluates |
| | | }; |
| | | console.log('111111111111',submitData) |
| | | |
| | | // 如果有ID,则是编辑 |
| | | if (this.form.id) { |
| | |
| | | } |
| | | |
| | | this.$message.success(status == 1 ? '提交成功' : '保存草稿成功'); |
| | | this.$router.go(-1); |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | } catch (error) { |
| | | this.$message.error('提交失败,请重试'); |
| | | } |
| | |
| | | <template> |
| | | <el-dialog :visible.sync="dialogVisible" title="化验师工作评定" width="79.17%" @close="handleClose"> |
| | | <EvaluateTable ref="evaluateTable" /> |
| | | <el-dialog :visible.sync="dialogVisible" :title="roleType==4? '化验师工作评定':'实验员工作评定'" width="79.17%" @close="handleClose"> |
| | | <EvaluateTable ref="evaluateTable" :viewJson="reportData.resultEvaluateJson" :isReadonly="true" :type="roleType-3" /> |
| | | <div class="assessed"> |
| | | <div>评定时间:2025-2-20 11:08:00</div> |
| | | <div>评定人:张三</div> |
| | | <div>评定时间:{{reportData.evaluateTime}}</div> |
| | | <div>评定人:{{reportData.processEngineerName}}</div> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <!-- resultEvaluateJson --> |
| | | <script> |
| | | export default { |
| | | name: 'Detail', |
| | |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | roleType:{ |
| | | type: [String,Number], |
| | | default: ()=>'4' |
| | | }, |
| | | reportData: { |
| | | type: Object, |
| | |
| | | }, |
| | | methods: { |
| | | handleClose() { |
| | | console.log(this.$refs.evaluateTable.total); |
| | | console.log(this.$refs.evaluateTable.activeIndex); |
| | | this.$emit('close',false) |
| | | }, |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div class="list"> |
| | | <TableCustom :queryForm="queryForm" :tableData="tableData" :total="total" @currentChange="handleCurrentChange" |
| | | @sizeChange="handleSizeChange"> |
| | | <TableCustom :queryForm="queryForm" |
| | | :tableData="tableData" :total="total" |
| | | @handleCurrentChange="handleCurrentChange" |
| | | @handleSizeChange="handleSizeChange"> |
| | | <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.projectName" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="所属实验编号:"> |
| | | <el-input v-model="form.name" placeholder="请输入" /> |
| | | <el-input v-model="form.experimentCode" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="实验名称:"> |
| | | <el-input v-model="form.name" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间:"> |
| | | <el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | <el-input v-model="form.experimentName" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="项目阶段:"> |
| | | <el-select v-model="form.status" placeholder="请选择"> |
| | | <el-option label="是" value="1"></el-option> |
| | | <el-option label="否" value="0"></el-option> |
| | | <el-select v-model="form.projectStage" placeholder="请选择"> |
| | | <el-option label="实验室开发阶段" value="1"></el-option> |
| | | <el-option label="中式试验阶段" value="2"></el-option> |
| | | <el-option label="生产验证试验阶段" value="3"></el-option> |
| | | </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 #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="是否评定"> |
| | | <template #default="{ row }"> |
| | | <span :style="{ color: ['green', 'red'][row.status - 1] }">{{ ['是', '否'][row.status - 1] |
| | | }}</span> |
| | | </template> |
| | | <el-table-column prop="projectName" label="所属项目课题方案" /> |
| | | <el-table-column prop="projectStage" label="项目阶段"> |
| | | <template #default="{ row }"> |
| | | <span v-if="row.projectStage === 1">实验室开发阶段</span> |
| | | <span v-else-if="row.projectStage === 2">中式试验阶段</span> |
| | | <span v-else-if="row.projectStage === 3">生产验证试验阶段</span> |
| | | <span v-else>--</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="age" label="创建日期" /> |
| | | <el-table-column prop="age" label="操作"> |
| | | <el-table-column prop="experimentCode" label="实验编号" /> |
| | | <el-table-column prop="experimentName" label="实验名称" /> |
| | | <el-table-column prop="processEngineerName" label="工艺工程师" /> |
| | | <el-table-column prop="laboratoryChemistName" label="化验师" v-if="roleType == 4" /> |
| | | <el-table-column prop="laboratoryTesterName" label="实验员" v-if="roleType == 5"/> |
| | | <el-table-column prop="isEvaluate" label="是否评定"> |
| | | <template #default="{ row }"> |
| | | <span :style="{ color: row.isEvaluate === 1 ? 'green' : 'red' }">{{ row.isEvaluate === 1 ? '是' : '否' }}</span> |
| | | </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)" v-if="row.isEvaluate === 1">评定详情</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </TableCustom> |
| | | |
| | | <Detail :modelValue="assessmentVisible" :reportData="currentReport" /> |
| | | <Detail :modelValue="assessmentVisible" :reportData="currentReport" @close="assessmentVisible=false" :roleType="roleType" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Detail from './components/detail.vue' |
| | | import { getEvaluateChemistPageList, getEvaluateTesterPageList } from './service.js' |
| | | |
| | | export default { |
| | | name: 'ExperimentResults', |
| | |
| | | data() { |
| | | return { |
| | | form: { |
| | | projectName: '', |
| | | experimentCode: '', |
| | | experimentName: '', |
| | | projectStage: '' |
| | | }, |
| | | tableData: [], |
| | | queryForm: { |
| | |
| | | }, |
| | | total: 0, |
| | | assessmentVisible: false, |
| | | currentReport: {} |
| | | currentReport: {}, |
| | | loading: false, |
| | | roleType:'', |
| | | } |
| | | }, |
| | | methods: { |
| | | async getList() { |
| | | this.loading = true; |
| | | const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}'); |
| | | this.roleType = userInfo.roleType; |
| | | const params = { |
| | | ...this.queryForm, |
| | | projectName: this.form.projectName, |
| | | experimentCode: this.form.experimentCode, |
| | | experimentName: this.form.experimentName, |
| | | projectStage: this.form.projectStage |
| | | }; |
| | | let res = { data: { records: [], total: 0 } }; |
| | | try { |
| | | if (this.roleType == 4) { |
| | | res = await getEvaluateChemistPageList(params); |
| | | } else if (this.roleType == 5) { |
| | | res = await getEvaluateTesterPageList(params); |
| | | } |
| | | this.tableData = res.data?.records || []; |
| | | this.total = res.data?.total || 0; |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | handleSearch() { |
| | | this.queryForm.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | handleReset() { |
| | | this.form = { |
| | | projectName: '', |
| | | experimentCode: '', |
| | | experimentName: '', |
| | | projectStage: '' |
| | | }; |
| | | this.queryForm.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | handleCurrentChange(page) { |
| | | this.queryForm.pageNum = page |
| | | this.getList() |
| | | this.queryForm.pageNum = page; |
| | | this.getList(); |
| | | }, |
| | | handleSizeChange(size) { |
| | | this.queryForm.pageSize = size |
| | | this.getList() |
| | | }, |
| | | getList() { |
| | | |
| | | this.queryForm.pageSize = size; |
| | | this.getList(); |
| | | }, |
| | | handleDetail(row) { |
| | | // 处理详情 |
| | | this.currentReport = row; |
| | | this.assessmentVisible = true; |
| | | }, |
| | | handleAssessment(row) { |
| | | this.currentReport = row; |
| | | this.assessmentVisible = true; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getList(); |
| | | } |
| | | } |
| | | </script> |
| | |
| | | :queryForm="queryForm" |
| | | :tableData="tableData" |
| | | :total="total" |
| | | @currentChange="handleCurrentChange" |
| | | @sizeChange="handleSizeChange" |
| | | @handleCurrentChange="handleCurrentChange" |
| | | @handleSizeChange="handleSizeChange" |
| | | > |
| | | <template #search> |
| | | <el-form :model="form" label-width="140px" inline> |
| | |
| | | dispatchId: this.tableData[0]?.id, |
| | | status: 1, |
| | | }; |
| | | |
| | | console.log("11111111111", evaluateTable.activeIndex); |
| | | console.log("2222222222222222", evaluateData); |
| | | add(evaluateData).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("保存成功"); |
| | |
| | | toDetail(item){ |
| | | console.log('item item',item) |
| | | read({id:item.id}).then(res=>{ |
| | | console.log('res',res) |
| | | |
| | | let urlList=['/dataManagement/approvalPlan','/dataManagement/suspendExperiment','/dataManagement/testResultReport' |
| | | ,'/reportLibrary/feasibilityStudy','/deliveryAssessment/reportEvaluation','/dataManagement/confirmation-sheet', |
| | | '/dataManagement/inspectionReport','/dataManagement/scheme-management','/chemistQa/projectTesting', |
| | | '/deliveryAssessment/reportEvaluation','/dataManagement/dispatching','/dataManagement/confirmation-sheet', |
| | | '/sampleManage/manage','/dataManagement/dispatching' |
| | | ] |
| | | let url=urlList[item.noticeType *1] |
| | | this.$router.push({ |
| | | path: url, |
| | | }); |
| | | }) |
| | | |
| | | } |
| | |
| | | return |
| | | } |
| | | } |
| | | console.log('data data data',data) |
| | | this.selectMemberData = data; |
| | | this.$refs.selectMember.close(); |
| | | }, |
| | |
| | | import chooseProject from '@/components/chooseProject' |
| | | import { addData, getDetail, editData } from './service' |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | this.getDetail() |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | } |
| | | }) |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | save() { |
| | | this.$refs.form.validate((valid) => { |
| | | let data = { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | |
| | | mounted() { |
| | | this.roleType = JSON.parse(sessionStorage.getItem('userInfo'))?.roleType |
| | | console.log('adwqedwqeqwe', this.roleType); |
| | | |
| | | this.getList() |
| | | }, |
| | | |
| | |
| | | |
| | | // 添加 |
| | | export function addData(data) { |
| | | console.log('adwqedwqeqwe//////////////',data); |
| | | return axios.post('/api/t-feasibility-study-report/add', { ...data }) |
| | | } |
| | | |
| | |
| | | |
| | | //审核 |
| | | export function audit(data) { |
| | | console.log(data) |
| | | return axios.post('/api/t-feasibility-study-report/auditReport', { ...data }) |
| | | } |
| | | |
| | |
| | | import chooseProject from '@/components/chooseProject' |
| | | import { addData, getDetail, editData } from './service' |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | this.getDetail() |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | |
| | | customUploadRequest({ |
| | | file, |
| | | onSuccess: (res) => { |
| | | console.log() |
| | | if (res.code === 200) { |
| | | const fileObj = { |
| | | id: new Date().getTime(), |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | } |
| | | }) |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | save() { |
| | | this.$refs.form.validate((valid) => { |
| | | let data = { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | import chooseProject from '@/components/chooseProject' |
| | | import { addData, getDetail, editData } from './service' |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | |
| | | this.getDetail() |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | } |
| | | }) |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | save() { |
| | | this.$refs.form.validate((valid) => { |
| | | let data = { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | import chooseProject from '@/components/chooseProject' |
| | | import { addData, getDetail, editData } from './service' |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | |
| | | this.getDetail() |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | } |
| | | }) |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | save() { |
| | | this.$refs.form.validate((valid) => { |
| | | let data = { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | import chooseProject from '@/components/chooseProject' |
| | | import { addData, getDetail, editData } from './service' |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | |
| | | this.getDetail() |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | }, |
| | | |
| | | methods: { |
| | | getDetail() { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | } |
| | | }) |
| | | }, |
| | | back() { |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }, |
| | | save() { |
| | | this.$refs.form.validate((valid) => { |
| | | let data = { |
| | |
| | | editData({ ...data, id: this.$route.query.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('修改成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | addData({ ...data }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('发布成功') |
| | | this.$router.back() |
| | | this.back() |
| | | } else { |
| | | this.$message.error(res.message) |
| | | } |
| | |
| | | ] |
| | | }); |
| | | |
| | | if (data.status == 2 || data.status == 4) { |
| | | if (data.status == 2 || data.status == 4|| data.status==3) { |
| | | processData.push({ |
| | | type: "primary", |
| | | mode: "list", |
| | |
| | | |
| | | <script> |
| | | import { roleInfoFromUserId, getRoleInfo, add, edit } from './service.js' |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | name: 'add-role', |
| | | components: {}, |
| | |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | height() { |
| | | return this.$baseTableHeight() |
| | | }, |
| | |
| | | obj.roleId = this.$route.query.roleId |
| | | edit(obj).then(() => { |
| | | this.msgsuccess('保存成功') |
| | | this.$router.go(-1) |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }) |
| | | } else { |
| | | add(obj).then(() => { |
| | |
| | | remark: "", |
| | | } |
| | | this.menu = [] |
| | | this.$router.go(-1) |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }) |
| | | } |
| | | } |
| | |
| | | |
| | | <script> |
| | | import { roleInfoFromUserId, getRoleInfo, add, edit } from './service.js' |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | name: 'EditRole', |
| | | components: {}, |
| | |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(["tagList", "isFold"]), |
| | | height() { |
| | | return this.$baseTableHeight() |
| | | }, |
| | |
| | | obj.roleId = this.$route.query.roleId |
| | | edit(obj).then(() => { |
| | | this.msgsuccess('保存成功') |
| | | this.$router.go(-1) |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }) |
| | | } else { |
| | | add(obj).then(() => { |
| | | this.msgsuccess('保存成功') |
| | | this.$router.go(-1) |
| | | this.$router.back(); |
| | | this.$store.commit( |
| | | "SET_TAGLIST", |
| | | this.tagList.filter((item) => item.path !== this.$route.path) |
| | | ); |
| | | }) |
| | | } |
| | | } |
| | |
| | | <el-dialog :visible.sync="dialogVisible" @close="$emit('close')" title="账号继承" :show-close="false"> |
| | | <div class="inherit-title">当前账号</div> |
| | | <div class="inherit-content"> |
| | | <div>姓名:张三</div> |
| | | <div>电话:102929292929</div> |
| | | <div>角色:工艺工程师</div> |
| | | <div>登录账号:328746378</div> |
| | | <div>姓名:{{row.nickName||''}}</div> |
| | | <div>电话:{{row.phonenumber||''}}</div> |
| | | <div>角色:{{row.roleName||''}}</div> |
| | | <div>登录账号:{{row.userName||''}}</div> |
| | | </div> |
| | | <div class="inherit-table-title"> |
| | | <div class="inherit-title">继承账号</div> |
| | | <el-button type="primary" @click="selectMember">选择人员</el-button> |
| | | </div> |
| | | <Table :data="tableData" :total="0"> |
| | | <Table :data="tableData" :total="0" :height='null'> |
| | | <el-table-column label="姓名" prop="role" /> |
| | | <el-table-column label="联系电话" prop="name" /> |
| | | <el-table-column label="角色" prop="createTime" /> |
| | |
| | | <el-button type="primary" @click="submit">保存</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <SelectMember ref="selectMember" /> |
| | | <SelectMember ref="selectMember" @submit='submitChoose'/> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | tableData:[] |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | selectMember() { |
| | | this.$refs.selectMember.open() |
| | | }, |
| | | submitChoose(data){ |
| | | if(data.length==0){ |
| | | this.$message.error('请选择一个继承账号') |
| | | return |
| | | } |
| | | if(data.length>1){ |
| | | this.$message.error('只能选择一个继承账号') |
| | | return |
| | | } |
| | | this.$refs.selectMember.close() |
| | | this.tableData=data |
| | | |
| | | }, |
| | | submit() { |
| | | } |
| | | }, |
| | |
| | | <div class="status_class"> |
| | | <div :class="row.status == 0 ? 'green' : 'red'"></div> |
| | | <div>{{ row.status == 0 ? '正常' : '禁用' }}</div> |
| | | <el-popover trigger="hover" placement="top" v-if="row.status != 0"> |
| | | <div v-html="row.disableRemark"></div> |
| | | <template #reference> |
| | | <el-icon class="el-icon-question"></el-icon> |
| | | </template> |
| | | </el-popover> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |