| | |
| | | <template> |
| | | <Card> |
| | | <template style="position: relative"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | :rules="rules" |
| | | inline |
| | | label-position="top" |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" inline label-position="top"> |
| | | <div v-if="!isEdit"> |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div style="display: flex; align-items: center; gap: 13px"> |
| | |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>所属实验调度</div> |
| | | </div> |
| | | <el-button |
| | | @click="showScheduling = true" |
| | | class="el-icon-plus" |
| | | type="primary" |
| | | > |
| | | 选择实验调度</el-button |
| | | > |
| | | <el-button @click="showScheduling = true" class="el-icon-plus" type="primary"> |
| | | 选择实验调度</el-button> |
| | | </div> |
| | | </div> |
| | | <!-- //换到详情弹窗 --> |
| | | <!-- <el-button @click="handleStopExperiment" type="danger"> |
| | | 申请终止实验</el-button> --> |
| | | <Table |
| | | :data="groupTableData" |
| | | :total="0" |
| | | :height="null" |
| | | class="groupTable" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | width="80" |
| | | ></el-table-column> |
| | | <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="experimentStartTime" |
| | | label="实验开始时间" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="experimentEndTime" |
| | | label="实验结束时间" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="participantsName" |
| | | label="参加人员" |
| | | ></el-table-column> |
| | | <Table :data="groupTableData" :total="0" :height="null" class="groupTable"> |
| | | <el-table-column type="index" label="序号" width="80"></el-table-column> |
| | | <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="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)"> |
| | |
| | | <span>组别列表</span> |
| | | </div> |
| | | |
| | | <Table |
| | | :data="groupData" |
| | | :total="0" |
| | | :height="null" |
| | | class="groupTable" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | width="80" |
| | | ></el-table-column> |
| | | <Table :data="groupData" :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> |
| | | </Table> |
| | |
| | | |
| | | <div style="padding-left: 25px; margin-top: 28px"> |
| | | <el-form-item prop="experimentDate" label="试验日期"> |
| | | <el-date-picker |
| | | v-model="form.experimentDate" |
| | | type="datetime" |
| | | :disabled="isEdit" |
| | | placeholder="选择日期时间" |
| | | > |
| | | <el-date-picker v-model="form.experimentDate" type="datetime" :disabled="isEdit" placeholder="选择日期时间"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </div> |
| | |
| | | <div class="add-group" v-if="!isEdit"> |
| | | <div>*</div> |
| | | <span>参加人员</span> |
| | | <el-button type="primary" class="el-icon-plus" @click="addMember" |
| | | >选择参加人员</el-button |
| | | > |
| | | <el-button type="primary" class="el-icon-plus" @click="addMember">选择参加人员</el-button> |
| | | </div> |
| | | <div class="add-group" v-else><span>实验人员</span></div> |
| | | <div class="member-list"> |
| | |
| | | <div class="member-title">实验员</div> |
| | | <div class="flex"> |
| | | <div class="member-name-box-2"> |
| | | <div |
| | | v-for="i in selectedParticipants" |
| | | :key="i.id" |
| | | class="member-name" |
| | | > |
| | | <div v-for="i in selectedParticipants" :key="i.id" class="member-name"> |
| | | {{ i.nickName }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="member-change"> |
| | | <div |
| | | class="member-change-btn" |
| | | @click="handleEditMember" |
| | | v-if="!isEdit" |
| | | > |
| | | <div class="member-change-btn" @click="handleEditMember" v-if="!isEdit"> |
| | | 修改 |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <Table :data="groupData" :total="0" :height="null" class="groupTable"> |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | width="80" |
| | | ></el-table-column> |
| | | <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> |
| | | </Table> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="content-box"> |
| | | <AiEditor |
| | | ref="purposeEditor" |
| | | :readOnly="isEdit" |
| | | :value="editorContents.purpose" |
| | | height="400px" |
| | | placeholder="请输入实验目的..." |
| | | /> |
| | | <AiEditor ref="purposeEditor" :readOnly="isEdit" :value="editorContents.purpose" height="400px" |
| | | placeholder="请输入实验目的..." /> |
| | | </div> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="content-box"> |
| | | <AiEditor |
| | | ref="processEditor" |
| | | :readOnly="isEdit" |
| | | :value="editorContents.process" |
| | | height="400px" |
| | | placeholder="请输入工艺参数及路线..." |
| | | /> |
| | | <AiEditor ref="processEditor" :readOnly="isEdit" :value="editorContents.process" height="400px" |
| | | placeholder="请输入工艺参数及路线..." /> |
| | | </div> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | |
| | | <div>三、实验材料及设备</div> |
| | | </div> |
| | | </div> |
| | | <DynamicComponent |
| | | ref="materialComponent" |
| | | title="实验材料" |
| | | :participants="participantsData" |
| | | @submit="handleMaterialSubmit" |
| | | :dataSource="form.experimentMaterial" |
| | | :editable="!isEdit" |
| | | /> |
| | | <DynamicComponent |
| | | ref="equipmentComponent" |
| | | title="实验所用设备" |
| | | :participants="participantsData" |
| | | @submit="handleEquipmentSubmit" |
| | | :dataSource="form.experimentDevice" |
| | | :editable="!isEdit" |
| | | /> |
| | | <DynamicComponent ref="materialComponent" title="实验材料" :participants="participantsData" |
| | | @submit="handleMaterialSubmit" :dataSource="form.experimentMaterial" :editable="!isEdit" /> |
| | | <DynamicComponent ref="equipmentComponent" title="实验所用设备" :participants="participantsData" |
| | | @submit="handleEquipmentSubmit" :dataSource="form.experimentDevice" :editable="!isEdit" /> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>四、实验操作步骤记录</div> |
| | | </div> |
| | | <el-button |
| | | @click="handleAddStep" |
| | | class="el-icon-plus" |
| | | type="primary" |
| | | v-if="!isEdit" |
| | | > |
| | | 添加步骤</el-button |
| | | > |
| | | <el-button @click="handleAddStep" class="el-icon-plus" type="primary" v-if="!isEdit"> |
| | | 添加步骤</el-button> |
| | | </div> |
| | | |
| | | <div class="step-list" v-for="(item, idx) in stepList" :key="idx"> |
| | |
| | | 步骤{{ idx + 1 }}:{{ item.stepName }} |
| | | </div> |
| | | <div class="step-list-item-control"> |
| | | <div |
| | | class="controlBtn edit" |
| | | @click="handleEditStep(idx)" |
| | | v-if="!isEdit" |
| | | > |
| | | <img |
| | | src="@/assets/public/edit.png" |
| | | alt="编辑" |
| | | class="edit-icon" |
| | | /> |
| | | <div class="controlBtn edit" @click="handleEditStep(idx)" v-if="!isEdit"> |
| | | <img src="@/assets/public/edit.png" alt="编辑" class="edit-icon" /> |
| | | 编辑 |
| | | </div> |
| | | <div |
| | | class="controlBtn delete" |
| | | @click="handleDeleteStep(idx)" |
| | | v-if="!isEdit" |
| | | > |
| | | <img |
| | | src="@/assets/public/delete.png" |
| | | alt="删除" |
| | | class="delete-icon" |
| | | /> |
| | | <div class="controlBtn delete" @click="handleDeleteStep(idx)" v-if="!isEdit"> |
| | | <img src="@/assets/public/delete.png" alt="删除" class="delete-icon" /> |
| | | 删除 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <DynamicComponent |
| | | :participants="participantsData" |
| | | :ref="'stepContent' + idx" |
| | | @submit="(content) => handleStepContentSubmit(idx, content)" |
| | | :dataSource="item.content" |
| | | :editable="!isEdit" |
| | | /> |
| | | <DynamicComponent :participants="participantsData" :ref="'stepContent' + idx" |
| | | @submit="(content) => handleStepContentSubmit(idx, content)" :dataSource="item.content" |
| | | :editable="!isEdit" /> |
| | | </div> |
| | | |
| | | <div class="add-project-footer"> |
| | | <el-button type="primary" class="save-btn" @click="handleSave">{{ |
| | | userRole == 3 ? "发送" : "提交" |
| | | }}</el-button> |
| | | <el-button @click="handleSaveDraft" v-if="userRole == 3" |
| | | >存草稿</el-button |
| | | > |
| | | <el-button @click="handleSaveDraft" v-if="userRole == 3 || userRole == 5">存草稿</el-button> |
| | | </div> |
| | | </el-form> |
| | | </template> |
| | | <SelectMemberSimple ref="selectMember" @submit="handleMemberSubmit" /> |
| | | <experimentalScheduling |
| | | :show="showScheduling" |
| | | @submit="handleSchedulingSubmit" |
| | | @close="handleSchedulingClose" |
| | | /> |
| | | <experimentalScheduling :show="showScheduling" @submit="handleSchedulingSubmit" @close="handleSchedulingClose" /> |
| | | <AddStep ref="addStepDialog" @submit="handleStepSubmit" /> |
| | | </Card> |
| | | </template> |
| | |
| | | 2: "已确认", |
| | | 3: "已封存", |
| | | }, |
| | | holdInfo: {}, |
| | | }; |
| | | }, |
| | | async created() { |
| | |
| | | |
| | | // ===== 保存提交相关方法 ===== |
| | | handleSave() { |
| | | this.submitData(1); |
| | | const draftStatus = this.userRole == 5 ? 6 : 1; |
| | | this.submitData(draftStatus); |
| | | }, |
| | | handleSaveDraft() { |
| | | this.submitData(-1); |
| | | // 工艺工程师存草稿状态为-1,实验员存草稿状态为-2 |
| | | const draftStatus = this.userRole == 5 ? -2 : -1; |
| | | this.submitData(draftStatus); |
| | | }, |
| | | submitData(status) { |
| | | // 先获取所有动态组件的数据 |
| | |
| | | formData.experimentMaterial = JSON.stringify( |
| | | this.form.experimentMaterial |
| | | ); |
| | | |
| | | // 如果是实验员保存草稿(status=-2),需要额外添加new字段 |
| | | if (this.userRole == 5 && status === -2) { |
| | | formData.newExperimentMaterial = JSON.stringify( |
| | | this.form.experimentMaterial |
| | | ); |
| | | formData.newExperimentDevice = JSON.stringify( |
| | | this.form.experimentDevice |
| | | ); |
| | | formData.newExperimentStepRecord = JSON.stringify(experimentStepRecord); |
| | | |
| | | formData.experimentStepRecord = JSON.stringify(this.holdInfo.stepList); |
| | | formData.experimentDevice = this.holdInfo.experimentDevice; |
| | | formData.experimentMaterial = this.holdInfo.experimentMaterial; |
| | | } |
| | | console.log('holdInfo holdInfo',this.holdInfo) |
| | | console.log('params params',formData) |
| | | // return |
| | | // 编辑模式下添加id参数 |
| | | if (this.editId) { |
| | | formData.id = this.editId; |
| | |
| | | this.editorContents.process = data.experimentParamRoute || ""; |
| | | |
| | | // 填充实验材料和设备 |
| | | // 如果是实验员角色,优先使用new字段的数据 |
| | | try { |
| | | let materialData = data.experimentMaterial; |
| | | if (this.userRole == 5 && data.newExperimentMaterial) { |
| | | materialData = data.newExperimentMaterial; |
| | | } |
| | | this.form.experimentMaterial = |
| | | typeof data.experimentMaterial === "string" |
| | | ? JSON.parse(data.experimentMaterial) |
| | | : data.experimentMaterial; |
| | | typeof materialData === "string" |
| | | ? JSON.parse(materialData) |
| | | : materialData; |
| | | this.holdInfo.experimentMaterial = materialData |
| | | } catch (err) { |
| | | console.error("解析实验材料数据失败:", err); |
| | | this.form.experimentMaterial = []; |
| | | } |
| | | |
| | | try { |
| | | let deviceData = data.experimentDevice; |
| | | if (this.userRole == 5 && data.newExperimentDevice) { |
| | | deviceData = data.newExperimentDevice; |
| | | } |
| | | this.form.experimentDevice = |
| | | typeof data.experimentDevice === "string" |
| | | ? JSON.parse(data.experimentDevice) |
| | | : data.experimentDevice; |
| | | typeof deviceData === "string" |
| | | ? JSON.parse(deviceData) |
| | | : deviceData; |
| | | this.holdInfo.experimentDevice = deviceData |
| | | } catch (err) { |
| | | console.error("解析实验设备数据失败:", err); |
| | | this.form.experimentDevice = []; |
| | |
| | | |
| | | // 填充实验步骤 |
| | | try { |
| | | const stepsData = |
| | | typeof data.experimentStepRecord === "string" |
| | | ? JSON.parse(data.experimentStepRecord) |
| | | : data.experimentStepRecord; |
| | | let stepsData = data.experimentStepRecord; |
| | | if (this.userRole == 5 && data.newExperimentStepRecord) { |
| | | stepsData = data.newExperimentStepRecord; |
| | | } |
| | | const parsedStepsData = |
| | | typeof stepsData === "string" |
| | | ? JSON.parse(stepsData) |
| | | : stepsData; |
| | | |
| | | this.stepList = (stepsData || []).map((step) => ({ |
| | | this.stepList = (parsedStepsData || []).map((step) => ({ |
| | | stepName: step.stepName, |
| | | content: step.content, |
| | | })); |
| | | this.holdInfo.stepList = this.stepList |
| | | } catch (err) { |
| | | console.error("解析实验步骤数据失败:", err); |
| | | this.stepList = []; |
| | |
| | | border: 1px solid #dcdfe6; |
| | | |
| | | &:nth-child(1) { |
| | | background: linear-gradient( |
| | | to bottom, |
| | | background: linear-gradient(to bottom, |
| | | rgba(4, 156, 154, 0.2) 0%, |
| | | rgba(5, 242, 194, 0) 70% |
| | | ); |
| | | rgba(5, 242, 194, 0) 70%); |
| | | } |
| | | |
| | | &:nth-child(2) { |
| | | background: linear-gradient( |
| | | to bottom, |
| | | background: linear-gradient(to bottom, |
| | | rgba(5, 160, 193, 0.2) 0%, |
| | | rgba(5, 242, 194, 0) 70% |
| | | ); |
| | | rgba(5, 242, 194, 0) 70%); |
| | | } |
| | | |
| | | &:nth-child(3) { |
| | | background: linear-gradient( |
| | | to bottom, |
| | | background: linear-gradient(to bottom, |
| | | rgba(255, 77, 79, 0.2) 0%, |
| | | rgba(255, 242, 194, 0) 70% |
| | | ); |
| | | rgba(255, 242, 194, 0) 70%); |
| | | } |
| | | |
| | | &:nth-child(4) { |
| | | background: linear-gradient( |
| | | to bottom, |
| | | background: linear-gradient(to bottom, |
| | | rgba(250, 199, 20, 0.21) 0%, |
| | | rgba(255, 242, 194, 0) 70% |
| | | ); |
| | | rgba(255, 242, 194, 0) 70%); |
| | | } |
| | | |
| | | .member-item { |