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/auditInspectionDia.vue |  231 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 231 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/systemManagement/internalAuditManagement/components/auditInspectionDia.vue b/src/views/CNAS/systemManagement/internalAuditManagement/components/auditInspectionDia.vue
new file mode 100644
index 0000000..a1f1e58
--- /dev/null
+++ b/src/views/CNAS/systemManagement/internalAuditManagement/components/auditInspectionDia.vue
@@ -0,0 +1,231 @@
+<template>
+  <div>
+    <el-dialog v-loading="diaLoading" :close-on-click-modal="false" :close-on-press-escape="false"
+      :visible.sync="formDia" title="鍐呴儴瀹℃牳瀹炴柦璁″垝" width="80%" @close="closeImplementDia">
+      <el-form ref="form" :model="form" :rules="rules" label-width="auto">
+        <el-col :span="12">
+          <el-form-item label="鍙楀閮ㄩ棬" prop="department">
+            <el-input v-model="form.department" :disabled="operationType === 'ratify'" clearable
+              size="small"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="閮ㄩ棬璐熻矗浜�" prop="departmentHead">
+            <el-input v-model="form.departmentHead" :disabled="operationType === 'ratify'" clearable
+              size="small"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="瀹℃牳鍛�" prop="auditor">
+            <el-input v-model="form.auditor" :disabled="operationType === 'ratify'" clearable size="small"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="瀹℃牳鏃ユ湡" prop="reviewDate">
+            <el-date-picker v-model="form.reviewDate" :disabled="operationType === 'ratify'" clearable
+              format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small" style="width: 100%" type="date"
+              value-format="yyyy-MM-dd">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+      </el-form>
+      <div v-if="operationType !== 'ratify'" style="text-align: right;margin-bottom: 10px">
+        <el-button size="small" type="primary" @click="addRow">娣诲姞</el-button>
+        <el-button size="small" type="danger" @click="clearTable">娓呯┖</el-button>
+      </div>
+      <el-table :data="checkDetailList" border height="300" style="width: 100%">
+        <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+        <el-table-column header-align="center" label="娑夊強瑕佺礌鍜岃川閲忎綋绯绘枃浠舵潯娆�" prop="element">
+          <template slot-scope="{row}">
+            <el-input v-model="row.element" :disabled="operationType === 'ratify'" size="small" />
+          </template>
+        </el-table-column>
+        <el-table-column header-align="center" label="瀹℃牳鍐呭" prop="content">
+          <template slot-scope="{row}">
+            <el-input v-model="row.content" :disabled="operationType === 'ratify'" size="small" />
+          </template>
+        </el-table-column>
+        <el-table-column header-align="center" label="瀹℃牳鏂瑰紡" prop="method">
+          <template slot-scope="{row}">
+            <el-input v-model="row.method" :disabled="operationType === 'ratify'" size="small" />
+          </template>
+        </el-table-column>
+        <el-table-column header-align="center" label="瀹℃牳缁撴灉璁板綍" prop="resultRecords" width="180">
+          <template slot-scope="{row}">
+            <el-input v-model="row.resultRecords" :disabled="operationType === 'ratify'" size="small" />
+          </template>
+        </el-table-column>
+        <el-table-column header-align="center" label="涓嶇鍚堟�ц川" prop="nonNature" width="180">
+          <template slot-scope="{row}">
+            <el-input v-model="row.nonNature" :disabled="operationType === 'ratify'" size="small" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <span slot="footer" class="dialog-footer">
+        <el-button v-if="operationType === 'ratify'" :loading="loading" @click="ratify(0)">涓嶆壒鍑�</el-button>
+        <el-button v-if="operationType === 'ratify'" :loading="loading" type="primary" @click="ratify(1)">鎵�
+          鍑�</el-button>
+        <el-button v-if="operationType !== 'ratify'" @click="closeImplementDia">鍙� 娑�</el-button>
+        <el-button v-if="operationType !== 'ratify'" :loading="loading" type="primary" @click="handleEdit">鎻�
+          浜�</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog :visible.sync="approvalDialog" title="鎵瑰噯" width="30%" @close="approvalDialog = false">
+      <span>
+        鎵瑰噯澶囨敞锛�
+        <el-input v-model="ratifyRemark" type="textarea"></el-input>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button :loading="approvalLoading" @click="approvalDialog = false">鍙� 娑�</el-button>
+        <el-button :loading="approvalLoading" type="primary" @click="handleApproval(0)">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  getInternalCheckOne,
+  addInternalCheck,
+  updateInternalCheck,
+  ratifyInternalCheck,
+} from '@/api/cnas/systemManagement/internalAuditManagement.js'
+export default {
+  name: 'auditInspectionDia',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: {},
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      formDia: false,
+      diaLoading: false,
+      loading: false,
+      form: {
+        department: '',
+        departmentHead: '',
+        auditor: '',
+        reviewDate: '',
+      },
+      rules: {
+        department: [{ required: true, message: '璇峰~鍐欏彈瀹¢儴闂�', trigger: 'blur' }],
+        departmentHead: [{ required: true, message: '璇峰~鍐欓儴闂ㄨ礋璐d汉', trigger: 'blur' }],
+        auditor: [{ required: true, message: '璇峰~鍐欏鏍稿憳', trigger: 'blur' }],
+        reviewDate: [{ required: true, message: '璇峰~鍐欏鏍告棩鏈�', trigger: 'blur' }],
+      },
+      checkDetailList: [],
+      operationType: '',
+      approvalDialog: false,
+      approvalLoading: false,
+      ratifyRemark: '',
+    };
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    // 鎵撳紑寮规
+    openDia(type, row) {
+      this.formDia = true
+      this.operationType = type
+      if (type !== 'add') {
+        this.searchInfo(row)
+      }
+    },
+    // 鏌ヨ璇︽儏
+    searchInfo(row) {
+      this.diaLoading = true
+      getInternalCheckOne({ checkId: row.checkId }).then(res => {
+        this.diaLoading = false
+        if (res.code === 201) return
+        this.form = res.data
+        this.checkDetailList = this.form.checkDetailList
+      }).catch(err => {
+        console.log(err)
+        this.diaLoading = false
+      })
+    },
+    // 鎻愪氦寮规鏁版嵁
+    handleEdit() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.checkDetailList.length === 0) {
+            this.$message.warning('璇锋坊鍔犺〃鏍兼暟鎹�')
+            return
+          }
+          this.loading = true
+          const internalCheckDto = this.HaveJson(this.form)
+          internalCheckDto.checkDetailList = this.HaveJson(this.checkDetailList)
+          if (this.operationType === 'add') {
+            addInternalCheck(internalCheckDto).then(res => {
+              this.loading = false
+              if (res.code === 201) return
+              this.$message.success('鎿嶄綔鎴愬姛')
+              this.closeImplementDia()
+            }).catch(err => {
+              console.log('err---', err);
+              this.loading = false
+            })
+          } else if (this.operationType === 'edit') {
+            updateInternalCheck(internalCheckDto).then(res => {
+              this.loading = false
+              if (res.code === 201) return
+              this.$message.success('鎿嶄綔鎴愬姛')
+              this.closeImplementDia()
+            }).catch(err => {
+              console.log('err---', err);
+              this.loading = false
+            })
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    ratify(ratifyStatus) {
+      // 涓嶆壒鍑嗛渶瑕佸~鍐欐壒鍑嗗唴瀹�
+      if (ratifyStatus === 0) {
+        this.approvalDialog = true
+      } else {
+        this.handleApproval(ratifyStatus)
+      }
+    },
+    // 鎻愪氦鎵瑰噯淇℃伅
+    handleApproval(ratifyStatus) {
+      this.approvalLoading = true
+      const internalCheckDto = this.HaveJson(this.form)
+      internalCheckDto.ratifyStatus = ratifyStatus
+      internalCheckDto.ratifyRemark = ratifyStatus === 0 ? this.ratifyRemark : ''
+      ratifyInternalCheck(internalCheckDto).then(res => {
+        if (res.code === 200) {
+          this.$message.success('鎻愪氦鎴愬姛锛�');
+          this.approvalDialog = false
+          this.closeImplementDia(this.departId);
+        }
+        this.approvalLoading = false
+      }).catch(() => {
+        this.approvalLoading = false
+      })
+    },
+    // 澧炲姞琛ㄦ牸琛屾暟鎹�
+    addRow() {
+      this.checkDetailList.push({
+        element: '',
+        content: '',
+        method: '',
+        resultRecords: '',
+        nonNature: '',
+      })
+    },
+    // 娓呯┖琛ㄦ牸鏁版嵁
+    clearTable() {
+      this.checkDetailList = []
+    },
+    closeImplementDia() {
+      this.$refs.form.resetFields();
+      this.formDia = false
+      this.$emit('closeImplementDia')
+    },
+  }
+};
+</script>
+
+<style scoped></style>

--
Gitblit v1.9.3