From 42f135086753fc6784e1b4894a4fcc6164a06669 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 05 三月 2025 11:20:26 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev'

---
 src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue |  384 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 384 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue
new file mode 100644
index 0000000..d66ced2
--- /dev/null
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue
@@ -0,0 +1,384 @@
+<template>
+  <div>
+    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="formDia" title="妫�娴嬪伐浣滅洃鐫h褰曡〃"
+      width="70%" @close="closeRecordsDia">
+      <el-steps :active="currentStep" align-center finish-status="success">
+        <el-step title="瀹炴柦"></el-step>
+        <el-step title="鎵瑰噯"></el-step>
+      </el-steps>
+      <div style="height: 570px;overflow-y: auto">
+        <table border="1" cellspacing="10" class="tables">
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>妫�娴嬩汉鍛橈細</p>
+            </td>
+            <td colspan="2">
+              <el-input v-if="currentStep === 0" v-model="form.testMember" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.testMember }}</span>
+            </td>
+            <td class="td-title">
+              <p><span class="required-span">* </span>鐩戠潱鍛橈細</p>
+            </td>
+            <td colspan="2">
+              <el-input v-if="currentStep === 0" v-model="form.supervisor" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.supervisor }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>妫�娴嬮」鐩細</p>
+            </td>
+            <td>
+              <el-input v-if="currentStep === 0" v-model="form.testItem" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.testItem }}</span>
+            </td>
+            <td class="td-title">
+              <p><span class="required-span">* </span>鏍峰搧缂栧彿锛�</p>
+            </td>
+            <td>
+              <el-input v-if="currentStep === 0" v-model="form.sampleNumber" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.sampleNumber }}</span>
+            </td>
+            <td class="td-title">
+              <p><span class="required-span">* </span>妫�娴嬫棩鏈燂細</p>
+            </td>
+            <td>
+              <el-input v-if="currentStep === 0" v-model="form.testDate" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.testDate }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>浜哄憳锛�</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.personnel" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.personnel }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>浠櫒璁惧锛�</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.device" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.device }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>宸ヤ綔鐜锛�</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.environment" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.environment }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>鏍峰搧閲囬泦锛�</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.sampleCollection" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.sampleCollection }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>鏍峰搧鐨勫噯澶囷細</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.samplePreparation" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.samplePreparation }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>妫�娴嬫柟娉曪細</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.detectionMethod" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.detectionMethod }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>妫�娴嬭褰曪細</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.inspectionRecord" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.inspectionRecord }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>妫�娴嬫姤鍛婏細</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.examiningReport" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-else class="td-info"> {{ form.examiningReport }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>鐩戠潱鎯呭喌璇勪环锛�</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.supervisionEvaluation" :rows="4" placeholder="璇疯緭鍏ュ唴瀹�"
+                size="small" type="textarea">
+              </el-input>
+              <span v-else class="td-info"> {{ form.supervisionEvaluation }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="td-title">
+              <p><span class="required-span">* </span>涓嶇鍚堝鐞嗘剰瑙侊細</p>
+            </td>
+            <td colspan="5">
+              <el-input v-if="currentStep === 0" v-model="form.handlingAdvice" :rows="4" placeholder="璇疯緭鍏ュ唴瀹�"
+                size="small" type="textarea">
+              </el-input>
+              <span v-else class="td-info"> {{ form.handlingAdvice }}</span>
+            </td>
+          </tr>
+          <tr>
+            <td v-if="currentStep === 0" class="td-title">
+              <p><span class="required-span">* </span>璇烽�夋嫨涓嬩竴姝ユ壒鍑嗕汉锛�</p>
+            </td>
+            <td v-if="currentStep === 0" colspan="5">
+              <el-select v-model="form.ratifyUserId" 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>
+            <td v-if="currentStep === 1" class="td-title">
+              <p>鎵瑰噯璐熻矗浜猴細</p>
+            </td>
+            <td v-if="currentStep === 1" class="td-info" colspan="5">
+              {{ form.ratifyUserName }}
+            </td>
+          </tr>
+          <tr v-if="currentStep === 1 || currentStep === 2">
+            <td class="td-title">
+              <p><span class="required-span">* </span>瀹℃壒缁撹锛�</p>
+            </td>
+            <td colspan="2">
+              <el-input v-if="currentStep === 1" v-model="form.ratifyOpinion" :rows="4" placeholder="璇疯緭鍏ュ唴瀹�" size="small"
+                type="textarea">
+              </el-input>
+              <span v-if="currentStep === 2" class="td-info"> {{ form.ratifyOpinion }}</span>
+            </td>
+            <td class="td-title">
+              <p v-if="currentStep === 1">璇烽�夋嫨鏄惁绗﹀悎锛�</p>
+              <p v-if="currentStep === 2">鏄惁绗﹀悎锛�</p>
+            </td>
+            <td colspan="2">
+              <el-radio-group v-if="currentStep === 1" v-model="form.isAccording">
+                <el-radio :label="0">涓嶇鍚�</el-radio>
+                <el-radio :label="1">绗﹀悎</el-radio>
+              </el-radio-group>
+              <span v-if="currentStep === 2" class="td-info"> {{ form.isAccording === 0 ? '涓嶇鍚�' : '绗﹀悎' }}</span>
+            </td>
+          </tr>
+        </table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeRecordsDia">鍙� 娑�</el-button>
+        <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  getSuperviseDetailRecord,
+  addSuperviseDetailRecord,
+  addSuperviseRecordOpinion,
+} from '@/api/cnas/process/ensureResults/qualityControlPlan.js'
+import { selectUserCondition } from "@/api/system/user";
+export default {
+  name: 'recordsDialog',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: {},
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      formDia: false,
+      form: {
+        superviseDetailsId: '',
+        superviseDetailsRecordId: '',
+        testMember: '',
+        supervisor: '',
+        testItem: '',
+        sampleNumber: '',
+        testDate: '',
+        personnel: '',
+        device: '',
+        environment: '',
+        sampleCollection: '',
+        samplePreparation: '',
+        detectionMethod: '',
+        inspectionRecord: '',
+        examiningReport: '',
+        supervisionEvaluation: '',
+        handlingAdvice: '',
+        ratifyUserId: '',
+        ratifyUserName: '',
+        ratifyOpinion: '',
+        isAccording: '',
+      },
+      currentStep: 0,
+      editLoad: false,
+      personList: [],
+    };
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    openDia(row) {
+      this.formDia = true
+      this.searchInfo(row)
+      this.getAuthorizedPerson()
+    },
+    // 鏌ヨ鐩戠潱璁″垝璇︽儏璁板綍娴佺▼淇℃伅
+    searchInfo(row) {
+      getSuperviseDetailRecord({ superviseDetailsId: row.superviseDetailsId }).then(res => {
+        if (res.code === 201) return
+        // 鏈塻uperviseDetailsRecordId璇存槑鎻愪氦杩囪褰�
+        if (res.data.superviseDetailsRecordId) {
+          // 鏄惁缁撴潫0:鏈粨鏉�, 1:宸茬粨鏉�
+          if (res.data.isFinish === 0) {
+            this.currentStep = 1
+          } else if (res.data.isFinish === 1) {
+            this.currentStep = 2
+          }
+        } else {
+          this.currentStep = 0
+        }
+        this.form = res.data
+        this.form.superviseDetailsId = row.superviseDetailsId
+      }).catch(err => {
+        console.log('err---', err);
+      })
+    },
+    // 鎻愪氦娴佺▼
+    handleEdit() {
+      if (!this.form.testMember || !this.form.supervisor || !this.form.testItem || !this.form.sampleNumber
+        || !this.form.testDate) {
+        this.$message.warning('璇峰~鍐欏畬鏁�')
+        return
+      }
+      if (this.currentStep === 0) {
+        this.addInfo()
+      } else {
+        this.editInfo()
+      }
+    },
+    // 鎻愪氦璁板綍
+    addInfo() {
+      if (!this.form.ratifyUserId) {
+        this.$message.warning('璇烽�夋嫨涓嬩竴姝ユ壒鍑嗕汉')
+        return
+      }
+      this.editLoad = true
+      addSuperviseDetailRecord(this.form).then(res => {
+        this.editLoad = false
+        if (res.code === 201) return
+        this.$message.success('鎿嶄綔鎴愬姛')
+        this.closeRecordsDia()
+      }).catch(err => {
+        console.log('err---', err);
+        this.editLoad = false
+      })
+    },
+    // 鎻愪氦鎵瑰噯
+    editInfo() {
+      if (!this.form.ratifyOpinion) {
+        this.$message.warning('璇峰~鍐欏鎵规剰瑙�')
+        return
+      }
+      console.log('this.form.isAccording---', this.form.isAccording);
+      if (this.form.isAccording === null) {
+        this.$message.warning('璇烽�夋嫨鏄惁绗﹀悎')
+        return
+      }
+      this.editLoad = true
+      addSuperviseRecordOpinion(this.form).then(res => {
+        this.editLoad = false
+        if (res.code === 201) return
+        this.$message.success('鎿嶄綔鎴愬姛')
+        this.closeRecordsDia()
+      }).catch(err => {
+        console.log('err---', err);
+        this.editLoad = false
+      })
+    },
+    // 鍏抽棴寮规
+    closeRecordsDia() {
+      this.formDia = false
+      this.$emit('closeRecordsDia')
+    },
+    getAuthorizedPerson() {
+      selectUserCondition().then(res => {
+        let data = []
+        res.data.forEach(a => {
+          data.push({
+            label: a.name,
+            value: a.id
+          })
+        })
+        this.personList = data
+      })
+    },
+  }
+};
+</script>
+
+<style scoped>
+>>>.el-dialog {
+  margin: 20px auto 50px !important;
+}
+
+.tables {
+  table-layout: fixed;
+  width: 100%;
+  margin-top: 10px;
+}
+
+.td-title {
+  height: 40px;
+  text-align: center;
+  font-size: 14px;
+  word-wrap: break-word;
+  white-space: normal;
+  padding: 6px;
+}
+
+.td-info {
+  text-align: center;
+  font-size: 14px;
+  word-wrap: break-word;
+  white-space: normal;
+}
+
+.tables td {
+  height: 40px;
+  font-size: 14px;
+  word-wrap: break-word;
+  white-space: normal;
+  padding: 6px;
+}
+</style>

--
Gitblit v1.9.3