Crunchy
2025-04-29 e5454b769d44a34af423bf87ac8a740bf8c20341
src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue
@@ -38,18 +38,6 @@
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.raiseResult }}</span>
            </td>
          </tr>
<!--          <tr v-if="showStep === 0">-->
<!--            <td v-if="currentStep === 0" class="td-title">-->
<!--              <p><span class="required-span">* </span>请选择下一步负责人:</p>-->
<!--            </td>-->
<!--            <td v-if="currentStep === 0" class="td-info" colspan="3">-->
<!--              <el-select v-model="form.causeUserId" clearable filterable-->
<!--                         placeholder="请选择" size="small">-->
<!--                <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">-->
<!--                </el-option>-->
<!--              </el-select>-->
<!--            </td>-->
<!--          </tr>-->
          <tr v-if="currentStep !== 0">
            <td class="td-title">
              <p>提出人:</p>
@@ -130,18 +118,6 @@
              {{form.causeTime}}
            </td>
          </tr>
<!--          <tr v-if="showStep === 0">-->
<!--            <td v-if="currentStep === 0" class="td-title">-->
<!--              <p><span class="required-span">* </span>请选择下一步负责人:</p>-->
<!--            </td>-->
<!--            <td v-if="currentStep === 0" class="td-info" colspan="3">-->
<!--              <el-select v-model="form.correctUserId" clearable filterable-->
<!--                         placeholder="请选择" size="small">-->
<!--                <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">-->
<!--                </el-option>-->
<!--              </el-select>-->
<!--            </td>-->
<!--          </tr>-->
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>纠正措施:</p>
@@ -266,7 +242,10 @@
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeRectifyDia">取 消</el-button>
        <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">提 交</el-button>
        <el-button v-if="currentStep === 0 && userId == supervisedUserId" :loading="editLoad" type="primary" @click="handleEdit">提 交</el-button>
        <el-button v-if="currentStep === 1 && userId == approverUserId" :loading="editLoad" @click="handleEdit(0)">不通过</el-button>
        <el-button v-if="currentStep === 1 && userId == approverUserId" :loading="editLoad" type="primary" @click="handleEdit(1)">通
          过</el-button>
      </span>
    </el-dialog>
  </div>
@@ -279,6 +258,7 @@
} from "@/api/cnas/process/ensureResults/qualitySupervise";
import {selectUserCondition} from "@/api/business/inspectionTask";
import {getThisYearTrainingDetailed} from "@/api/cnas/systemManagement/correctiveAction";
import {mapGetters} from "vuex";
export default {
  name: 'rectifyDialog',
@@ -289,7 +269,6 @@
    return {
      formDia: false,
      currentStep: 0,
      showStep: 0,
      form: {
        superviseDetailsId: '',
        raiseResult: '',
@@ -320,7 +299,12 @@
      editLoad: false,
      personList: [],
      yearTrainingDetailed: [],
      supervisedUserId: '',
      approverUserId: ''
    };
  },
  computed: {
    ...mapGetters(["userId"]),
  },
  // 方法集合
  methods: {
@@ -329,6 +313,7 @@
      this.searchInfo(row)
      this.form.superviseDetailsId = row.superviseDetailsId
      this.form.approveId = row.approveId
      this.supervisedUserId = row.supervisedUserId
      this.getAuthorizedPerson() // 获取人员列表
      this.getYearTrainingDetailed() // 获取培训计划
    },
@@ -336,27 +321,24 @@
    searchInfo (row) {
      this.form.qualityMonitorDetailsId = row.qualityMonitorDetailsId
      getSuperviseDetailCorrect({superviseDetailsId: row.superviseDetailsId}).then(res => {
        if (res.data.superviseDetailsCorrectId === null) {
          this.showStep = 0
          this.currentStep = 0
        } else {
          this.form = res.data
          if (res.data.isFinish === 0) {
            if (res.data.approverUserId) {
              this.showStep = 1
              this.currentStep = 1
            }
          } else {
        if (res.data.approverUserId) {
          // 是否结束0:未结束, 1:已结束
          if (res.data.isFinish != 1) {
            this.currentStep = 1
          } else if (res.data.isFinish == 1) {
            this.currentStep = 2
            this.showStep = 1
          }
        } else {
          this.currentStep = 0
        }
        this.form = res.data
        this.approverUserId = res.data.approverUserId
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // 提交
    handleEdit () {
    handleEdit (isFinish) {
      if (this.currentStep === 0) {
        if (!this.form.raiseResult) {
          this.$message.warning('请填写不合格描述')
@@ -387,6 +369,7 @@
          this.editLoad = false
        })
      } else {
        this.form.isFinish = isFinish
        approveEquipSuperviseDetailCorrect(this.form).then(res => {
          this.editLoad = false
          this.$message.success('批准成功')