From e888346ebcd8e3e099a15c7edd7bf367c057193a Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 04 三月 2025 15:33:33 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev'

---
 src/views/CNAS/systemManagement/internalAuditManagement/components/correctiveActionDIa.vue |  409 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 409 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/systemManagement/internalAuditManagement/components/correctiveActionDIa.vue b/src/views/CNAS/systemManagement/internalAuditManagement/components/correctiveActionDIa.vue
new file mode 100644
index 0000000..b68c4c7
--- /dev/null
+++ b/src/views/CNAS/systemManagement/internalAuditManagement/components/correctiveActionDIa.vue
@@ -0,0 +1,409 @@
+<template>
+  <div>
+    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="formDia" title="绾犳鎺柦澶勭悊鍗�"
+      width="60%" @close="closeRectifyDia">
+      <el-steps :active="currentStep" align-center finish-status="success">
+        <el-step title="涓嶅悎鏍兼垨鍋忕浜嬪疄鐨勬弿杩�" @click.native="setStep(0)"></el-step>
+        <el-step title="鍘熷洜鍒嗘瀽" @click.native="setStep(1)"></el-step>
+        <el-step title="绾犳鎺柦" @click.native="setStep(2)"></el-step>
+        <el-step title="瀹炴柦楠岃瘉缁撴灉" @click.native="setStep(3)"></el-step>
+      </el-steps>
+      <div>
+        <table border="1" cellspacing="10" class="tables">
+          <tr v-if="showStep === 0">
+            <td class="td-title">
+              <p><span class="required-span">* </span>涓嶅悎鏍兼垨鍋忕浜嬪疄鐨勬弿杩帮細</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-input v-if="showStep === 0 && currentStep === 0" v-model="form.raiseResult" :rows="4"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea">
+              </el-input>
+              <span v-if="showStep === 0 && 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>璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉锛�</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="showStep === 0 && currentStep !== 0">
+            <td class="td-title">
+              <p>鎻愬嚭浜猴細</p>
+            </td>
+            <td class="td-info">
+              {{ form.raiseUserName }}
+            </td>
+            <td class="td-title">
+              <p>鎻愬嚭閮ㄩ棬锛�</p>
+            </td>
+            <td class="td-info">
+              {{ form.raiseDepartment }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 0 && currentStep !== 0">
+            <td class="td-title">
+              <p>鏃ユ湡锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              {{ form.raiseTime }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 1">
+            <td class="td-title">
+              <p><span class="required-span">* </span>鍘熷洜鍒嗘瀽锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-input v-if="showStep === 1 && currentStep === 1" v-model="form.causeResult" :rows="5"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea">
+              </el-input>
+              <span v-if="showStep === 1 && currentStep !== 1" class="td-info1"> {{ form.causeResult }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 1 && currentStep !== 1">
+            <td class="td-title">
+              <p>鍘熷洜鍒嗘瀽浜猴細</p>
+            </td>
+            <td class="td-info">
+              {{ form.causeUserName }}
+            </td>
+            <td class="td-title">
+              <p>璐d换閮ㄩ棬锛�</p>
+            </td>
+            <td class="td-info">
+              {{ form.causeDepartment }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 1 && currentStep !== 1">
+            <td class="td-title">
+              <p>鍘熷洜鍒嗘瀽鏃ユ湡锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              {{ form.causeTime }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 1">
+            <td v-if="currentStep === 1" class="td-title">
+              <p><span class="required-span">* </span>璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉锛�</p>
+            </td>
+            <td v-if="currentStep === 1" 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 v-if="showStep === 2">
+            <td class="td-title">
+              <p><span class="required-span">* </span>绾犳鎺柦锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-input v-if="showStep === 2 && currentStep === 2" v-model="form.correctResult" :rows="5"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea">
+              </el-input>
+              <span v-if="showStep === 2 && currentStep !== 2" class="td-info1"> {{ form.correctResult }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 2">
+            <td class="td-title">
+              <p>鎻愬嚭瑕佹眰閮ㄩ棬纭锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-input v-if="showStep === 2 && currentStep === 2" v-model="form.raiseDepartmentAffirm" :rows="5"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea">
+              </el-input>
+              <span v-if="showStep === 2 && currentStep !== 2" class="td-info1"> {{ form.raiseDepartmentAffirm }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 2 && currentStep !== 2">
+            <td class="td-title">
+              <p>绾犳浜猴細</p>
+            </td>
+            <td class="td-info">
+              {{ form.correctUserName }}
+            </td>
+            <td class="td-title">
+              <p>璐d换閮ㄩ棬锛�</p>
+            </td>
+            <td class="td-info">
+              {{ form.correctDepartment }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 2 && currentStep !== 2">
+            <td class="td-title">
+              <p>绾犳鏃ユ湡锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              {{ form.correctTime }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 2">
+            <td v-if="currentStep === 2" class="td-title">
+              <p><span class="required-span">* </span>璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉锛�</p>
+            </td>
+            <td v-if="currentStep === 2" class="td-info" colspan="3">
+              <el-select v-model="form.validationUserId" 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="showStep === 3">
+            <td class="td-title">
+              <p><span class="required-span">* </span>瀹炴柦楠岃瘉缁撴灉锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-input v-if="showStep === 3 && currentStep === 3" v-model="form.validationResult" :rows="5"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea">
+              </el-input>
+              <span v-if="showStep === 3 && currentStep !== 3" class="td-info1"> {{ form.validationResult }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 3 && currentStep !== 3">
+            <td class="td-title">
+              <p>楠岃瘉浜猴細</p>
+            </td>
+            <td class="td-info">
+              {{ form.validationUserName }}
+            </td>
+            <td class="td-title">
+              <p>璐d换閮ㄩ棬锛�</p>
+            </td>
+            <td class="td-info">
+              {{ form.validationDepartment }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 3 && currentStep !== 3">
+            <td class="td-title">
+              <p>楠岃瘉鏃ユ湡锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              {{ form.validationTime }}
+            </td>
+          </tr>
+        </table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeRectifyDia">鍙� 娑�</el-button>
+        <el-button v-if="currentStep !== 4" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  getInternalCorrect,
+  addInternalCorrect,
+} from '@/api/cnas/systemManagement/internalAuditManagement.js'
+import {
+  selectUserCondition,
+} from "@/api/system/user.js";
+export default {
+  name: 'correctiveActionDIa',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: {},
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      formDia: false,
+      currentStep: 0,
+      showStep: 0,
+      form: {
+        superviseDetailsId: '',
+        raiseResult: '',
+        vdeRaiseResult: '',
+        causeUserId: '',
+        raiseUserName: '',
+        raiseDepartment: '',
+        raiseTime: '',
+        causeResult: '',
+        causeUserName: '',
+        causeDepartment: '',
+        causeTime: '',
+        correctUserId: '',
+        correctResult: '',
+        raiseDepartmentAffirm: '',
+        correctUserName: '',
+        correctDepartment: '',
+        correctTime: '',
+        validationUserId: '',
+        validationResult: '',
+        validationUserName: '',
+        validationDepartment: '',
+        validationTime: '',
+      },
+      editLoad: false,
+      personList: [],
+      supervisedUserList: [],
+    };
+  },
+  mounted() {
+
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    openDia(type, row) {
+      this.formDia = true
+      if (type !== 'add') {
+        this.searchInfo(row)
+        this.form.superviseDetailsId = row.superviseDetailsId
+      }
+      this.getAuthorizedPerson() // 鑾峰彇浜哄憳鍒楄〃
+      this.getSupervisedUserList() // 鑾峰彇褰撳墠閮ㄩ棬浜哄憳
+    },
+    // 鏌ヨ鐩戞帶璁″垝璇︽儏瀹炴柦淇℃伅
+    searchInfo(row) {
+      this.form.qualityMonitorDetailsId = row.qualityMonitorDetailsId
+      getInternalCorrect({ correctId: row.correctId }).then(res => {
+        if (res.code === 201) return
+        if (res.data.superviseDetailsCorrectId === null) {
+          this.showStep = 0
+          this.currentStep = 0
+        } else {
+          this.form = res.data
+          if (res.data.isFinish === 0) {
+            if (res.data.causeUserId) {
+              this.showStep = 1
+              this.currentStep = 1
+            }
+            if (res.data.correctUserId) {
+              this.showStep = 2
+              this.currentStep = 2
+            }
+            if (res.data.validationUserId) {
+              this.showStep = 3
+              this.currentStep = 3
+            }
+          } else {
+            this.currentStep = 4
+            this.showStep = 3
+          }
+        }
+      }).catch(err => {
+        console.log('err---', err);
+      })
+    },
+    // 鎻愪氦
+    handleEdit() {
+      if (this.currentStep === 0) {
+        if (!this.form.raiseResult) {
+          this.$message.warning('璇峰~鍐欎笉鍚堟牸鎻忚堪')
+          return
+        }
+        if (!this.form.causeUserId) {
+          this.$message.warning('璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉')
+          return
+        }
+      } else if (this.currentStep === 1) {
+        if (!this.form.causeResult) {
+          this.$message.warning('璇峰~鍐欏師鍥犲垎鏋�')
+          return
+        }
+        if (!this.form.correctUserId) {
+          this.$message.warning('璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉')
+          return
+        }
+      } else if (this.currentStep === 2) {
+        if (!this.form.correctResult) {
+          this.$message.warning('璇峰~鍐欑籂姝f帾鏂�')
+          return
+        }
+        if (!this.form.validationUserId) {
+          this.$message.warning('璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉')
+          return
+        }
+      } else if (this.currentStep === 3) {
+        if (!this.form.validationResult) {
+          this.$message.warning('璇峰~鍐欏疄鏂介獙璇佺粨鏋�')
+          return
+        }
+      }
+      this.editLoad = true
+      this.form.supervisedTime = ''
+      this.form.flowType = this.currentStep
+      addInternalCorrect(this.form).then(res => {
+        this.editLoad = false
+        if (res.code === 201) return
+        this.$message.success('鎻愪氦鎴愬姛')
+        this.closeRectifyDia()
+      }).catch(err => {
+        console.log('err---', err);
+        this.editLoad = false
+      })
+    },
+    // 鍏抽棴寮规
+    closeRectifyDia() {
+      this.formDia = false
+      this.$emit('closeRectifyDia')
+    },
+    setStep(step) {
+      this.showStep = step
+    },
+    getAuthorizedPerson() {
+      selectUserCondition().then(res => {
+        let data = []
+        res.data.forEach(a => {
+          data.push({
+            label: a.name,
+            value: a.id
+          })
+        })
+        this.personList = data
+      })
+    },
+    getSupervisedUserList() {
+      selectUserCondition({ type: 2 }).then(res => {
+        let data = []
+        res.data.forEach(a => {
+          data.push({
+            label: a.name,
+            value: a.id
+          })
+        })
+        this.supervisedUserList = data
+      })
+    },
+  }
+};
+</script>
+
+<style scoped>
+>>>.el-dialog {
+  margin: 10vh auto 50px !important;
+}
+
+.tables {
+  table-layout: fixed;
+  width: 100%;
+  margin-top: 10px;
+}
+
+.td-title {
+  height: 40px;
+  width: 170px;
+  text-align: center;
+  font-size: 14px;
+  word-wrap: break-word;
+  white-space: normal;
+  padding: 6px;
+}
+
+.td-info {
+  padding: 6px;
+}
+
+.td-info1 {
+  display: inline-block;
+  width: 100%;
+  text-align: left;
+  font-size: 14px;
+  word-wrap: break-word;
+  white-space: normal;
+}
+</style>

--
Gitblit v1.9.3