董国庆
2025-05-09 4614d2ec1bc32eab5f0332176a3ecac7598e3f5c
项目课题方案模块完成
4个文件已修改
122 ■■■■■ 已修改文件
laboratory/src/views/dataManagement/approvalPlan/addPlan.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/approvalPlan/components/approvalDialog.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/approvalPlan/list.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/approvalPlan/service.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/approvalPlan/addPlan.vue
@@ -37,7 +37,7 @@
      </div>
      <AiEditor
        ref="purposeEditor"
        v-model="editorContents.experimentObjective"
        :value="editorContents.experimentObjective"
        height="200px"
        placeholder="请输入实验目的..."
      />
@@ -52,7 +52,7 @@
      </div>
      <AiEditor
        ref="materialEditor"
        v-model="editorContents.experimentMaterial"
        :value="editorContents.experimentMaterial"
        height="200px"
        placeholder="请输入实验材料..."
      />
@@ -61,7 +61,7 @@
      </div>
      <AiEditor
        ref="equipmentEditor"
        v-model="editorContents.experimentDevice"
        :value="editorContents.experimentDevice"
        height="200px"
        placeholder="请输入实验设备..."
      />
@@ -73,7 +73,7 @@
      </div>
      <AiEditor
        ref="methodEditor"
        v-model="editorContents.experimentTestMethod"
        :value="editorContents.experimentTestMethod"
        height="200px"
        placeholder="请输入检测方法及开发..."
      />
@@ -85,7 +85,7 @@
      </div>
      <AiEditor
        ref="stepsEditor"
        v-model="editorContents.experimentProcedure"
        :value="editorContents.experimentProcedure"
        height="200px"
        placeholder="请输入实验步骤..."
      />
@@ -97,7 +97,7 @@
      </div>
      <AiEditor
        ref="dataAnalysisEditor"
        v-model="editorContents.dataAcquisition"
        :value="editorContents.dataAcquisition"
        height="200px"
        placeholder="请输入数据采集及分析..."
      />
@@ -109,7 +109,7 @@
      </div>
      <AiEditor
        ref="evaluationEditor"
        v-model="editorContents.resultEvaluation"
        :value="editorContents.resultEvaluation"
        height="200px"
        placeholder="请输入结果评估..."
      />
@@ -121,7 +121,7 @@
      </div>
      <AiEditor
        ref="notesEditor"
        v-model="editorContents.precautions"
        :value="editorContents.precautions"
        height="200px"
        placeholder="请输入注意事项..."
      />
@@ -198,9 +198,9 @@
        resultEvaluation: [
          { required: true, message: "请输入结果评估", trigger: "blur" },
        ],
        precautions: [
          { required: true, message: "请输入注意事项", trigger: "blur" },
        ],
        // precautions: [
        //   { required: true, message: "请输入注意事项", trigger: "blur" },
        // ],
      },
    };
  },
@@ -241,7 +241,7 @@
          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 (isEmptyContent(editorContents.precautions)) emptyFields.push('注意事项')
          if (emptyFields.length > 0) {
            this.$message.warning(`请填写${emptyFields.join('、')}`)
laboratory/src/views/dataManagement/approvalPlan/components/approvalDialog.vue
@@ -157,7 +157,7 @@
        </div>
      </div>
    </div>
    <div class="approval-dialog-approve">
    <div class="approval-dialog-approve" v-if="type === 'approve'">
      <div class="status">
        <div class="status-title">审批结果</div>
        <div class="status-content">
@@ -242,6 +242,7 @@
        createTime: "",
        approver: "",
        approveTime: "",
        processData: [],
      },
      rules: {},
      status: "1",
@@ -272,9 +273,9 @@
        .then((res) => {
          console.log("获取详情:", res);
          if (res) {
            this.form = { ...res };
            this.form = { ...res, processData: [] };
            // 组装流程数据
            const processData = [];
            let processData = [];
            // 提交节点
            processData.push({
              type: "primary",
@@ -287,39 +288,41 @@
            if (res.auditStatus == 2 || res.auditStatus == 3) {
              processData.push({
                type:
                  audit.status === 2
                    ? "success"
                    : audit.status === 3
                  res.auditStatus === 2
                    ? "primary"
                    : res.auditStatus === 3
                    ? "danger"
                    : "warning",
                mode: "list",
                fields: [
                  {
                    label: "审核结果",
                    label: "审核结果:",
                    value:
                      audit.status === 2
                      res.auditStatus === 2
                        ? "通过"
                        : audit.status === 3
                        : res.auditStatus === 3
                        ? "驳回"
                        : "待审批",
                  },
                  { label: "审批意见:", value: audit.auditRemark || "" },
                  { label: "审核人:", value: audit.auditPersonName || "" },
                  { label: "审核时间:", value: audit.auditTime || "" },
                  { label: "审批意见:", value: res.auditRemark || "" },
                  { label: "审核人:", value: res.auditPersonName || "" },
                  { label: "审核时间:", value: res.auditTime || "" },
                ],
              });
            }else{
              processData.push({
              type: "primary",
              mode: "list",
              fields: [
                { label: "等待审核"},
              ],
            });
                type: "warning",
                mode: "list",
                fields: [
                  { label: "等待审核"},
                ],
              });
            }
            // 如有卡片模式,按前述结构 push
            this.form.processData = processData;
            this.$nextTick(() => {
              this.form.processData = processData;
            })
          }
        })
        .catch((err) => {
@@ -339,11 +342,13 @@
      }
      const params = {
        id: this.form.id,
        auditStatus: this.status === "1" ? 2 : 3, // 2-通过,3-驳回
        auditComment: this.remark,
        auditStatus: this.status === "1" ? 2 : 3, // 2-已通过,3-已驳回
        auditRemark: this.remark,
      };
      console.log('审批请求参数:', params);
      audit(params)
        .then((res) => {
          console.log('审批返回结果:', res);
          if (res.code === 200) {
            this.$message.success("审批成功");
            this.$emit("update:visible", false);
laboratory/src/views/dataManagement/approvalPlan/list.vue
@@ -89,7 +89,7 @@
<script>
import ShowDelConfirm from "@/components/showDelConfirm/index.vue";
import ApprovalDialog from "./components/approvalDialog.vue";
import { getProposalList } from "./service";
import { getProposalList, upAndDown, deleteById } from "./service";
export default {
  name: "ProjectList",
@@ -106,7 +106,7 @@
        createBy: "",
        createTime: [],
        auditPersonName: "",
        auditStatus: 1,
        auditStatus: '',
        pageNum: 1,
        pageSize: 10,
        startTime: "",
@@ -182,9 +182,8 @@
  },
  computed: {
    isProcessEngineer() {
      return false;
      // 这里需要根据实际的用户角色判断逻辑来修改
      return this.$store.state.user.role === 'processEngineer';
      const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}');
      return userInfo.roleType === 3; // 3是工艺工程师
    }
  },
  created() {
@@ -198,12 +197,13 @@
        createBy: "",
        createTime: [],
        auditPersonName: "",
        auditStatus: this.currentType === "draft" ? -1 : 1,
        auditStatus: this.currentType === "draft" ? -1 : '',
        pageNum: 1,
        pageSize: 10,
        startTime: "",
        endTime: "",
      };
      this.getTableData();
    },
    handleSearch() {
      if (this.form.createTime && this.form.createTime.length === 2) {
@@ -277,8 +277,12 @@
      this.changeStatus = true;
    },
    handleEdit(row) {
      // 实现编辑逻辑
      console.log("编辑数据:", row);
      this.$router.push({
        path: "/dataManagement/addPlan",
        query: {
          id: row.id
        }
      });
    },
    handleDelete(row) {
      this.currentOperationType = "delete";
@@ -318,17 +322,28 @@
    handleChangeStatusConfirm() {
      if (this.currentOperationType === "revoke") {
        // 处理撤销审批逻辑
        console.log("撤销审批数据:", this.currentOperationRow);
        // TODO: 调用撤销审批接口
        this.$message.success("撤销审批成功");
        upAndDown({
          id: this.currentOperationRow.id,
          status: 4 // 已撤销状态
        }).then(() => {
          this.$message.success("撤销审批成功");
          this.changeStatus = false;
          this.getTableData();
        }).catch(error => {
          this.$message.error("撤销审批失败");
        });
      } else if (this.currentOperationType === "delete") {
        // 处理删除逻辑
        console.log("删除数据:", this.currentOperationRow);
        // TODO: 调用删除接口
        this.$message.success("删除成功");
        deleteById({
          id: this.currentOperationRow.id
        }).then(() => {
          this.$message.success("删除成功");
          this.changeStatus = false;
          this.getTableData();
        }).catch(error => {
          this.$message.error("删除失败");
        });
      }
      this.changeStatus = false;
      this.getTableData();
    },
  },
};
laboratory/src/views/dataManagement/approvalPlan/service.js
@@ -23,12 +23,12 @@
//删除
export function deleteById(data) {
  return axios.delete('/open/t-project-proposal/deleteById', { ...data })
  return axios.delete('/open/t-project-proposal/deleteById', { params:data })
}
//批量删除
export function deleteByIds(data) {
  return axios.delete('/open/t-project-proposal/deleteByIds', { ...data })
  return axios.delete('/open/t-project-proposal/deleteByIds', { params:data })
}
//根据id查询方案详情
export function getDetailById(data) {