From 0d11525aa58ec5e35ea22ff4b0d6d5863d73649b Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 04 三月 2025 16:43:52 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before-ruoyi

---
 src/views/CNAS/process/ensureResults/ensureResultsValidity/components/detailFormDialog.vue |  150 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 150 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/detailFormDialog.vue b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/detailFormDialog.vue
new file mode 100644
index 0000000..9d99c93
--- /dev/null
+++ b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/detailFormDialog.vue
@@ -0,0 +1,150 @@
+<template>
+  <div>
+    <el-dialog title="缂栬緫" :visible.sync="formDia" :close-on-click-modal="false" :close-on-press-escape="false"
+      width="80%" @close="closeDia">
+      <el-form :model="form" :rules="rules" ref="form" label-width="140px">
+        <el-col :span="12">
+          <el-form-item label="鐩戞帶鐩殑" prop="monitorPurpose">
+            <el-input v-model="form.monitorPurpose" size="small" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="璁″垝寮�灞曟椂闂�" prop="plannedTime">
+            <el-input v-model="form.plannedTime" size="small" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="鐩戞帶椤圭洰" prop="monitorProject">
+            <el-input v-model="form.monitorProject" size="small" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="鍙傚姞鍗曚綅锛堜汉鍛橈級" prop="participant">
+            <el-input v-model="form.participant" size="small" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="棰勭畻锛堝厓锛�" prop="budget">
+            <el-input v-model="form.budget" size="small" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="缁勭粐浜哄憳" prop="organization">
+            <el-input v-model="form.organization" size="small" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="鐩戞帶鏂瑰紡" prop="monitorWay">
+            <el-input v-model="form.monitorWay" size="small" clearable></el-input>
+          </el-form-item>
+        </el-col>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDia">鍙� 娑�</el-button>
+        <el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  addQualityMonitorDetail,
+  updateQualityMonitorDetail,
+} from '@/api/cnas/process/ensureResults/ensureResultsValidity.js'
+export default {
+  name: 'detailFormDialog',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: {},
+  props: ['qualityMonitorId'],
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      formDia: false,
+      form: {
+        qualityMonitorDetailsId: '',
+        monitorPurpose: '',
+        plannedTime: '',
+        monitorProject: '',
+        participant: '',
+        budget: '',
+        organization: '',
+        monitorWay: '',
+      },
+      rules: {
+        monitorPurpose: [{ required: true, message: '璇疯緭鍏ョ洃鎺х洰鐨�', trigger: 'blur' }],
+        monitorProject: [{ required: true, message: '璇疯緭鍏ョ洃鎺ч」鐩�', trigger: 'blur' }],
+      },
+      upLoad: false,
+      operationType: '',
+    };
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    openDia(type, row) {
+      this.formDia = true
+      this.operationType = type
+      if (type === 'edit') {
+        this.searchInfo(row)
+      }
+    },
+    searchInfo(row) {
+      this.form = { ...row }
+    },
+    // 鎻愪氦琛ㄥ崟
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.operationType === 'add') {
+            this.handleAdd()
+          } else {
+            this.handleEdit()
+          }
+        }
+      })
+    },
+    // 鎻愪氦鏂板
+    handleAdd() {
+      let entity = this.HaveJson(this.form)
+      entity.qualityMonitorId = this.qualityMonitorId
+      this.upLoad = true
+      addQualityMonitorDetail(entity).then(res => {
+        this.upLoad = false
+        if (res.code === 201) return
+        this.$message.success('鏂板鎴愬姛')
+        this.closeDia()
+      }).catch(err => {
+        console.log('err---', err);
+        this.upLoad = false
+      })
+    },
+    // 鎻愪氦淇敼
+    handleEdit() {
+      const entity = this.HaveJson(this.form)
+      this.upLoad = true
+      updateQualityMonitorDetail(entity).then(res => {
+        this.upLoad = false
+        if (res.code === 201) return
+        this.$message.success('淇敼鎴愬姛')
+        this.closeDia()
+      }).catch(err => {
+        console.log('err---', err);
+        this.upLoad = false
+      })
+    },
+    // 鍏抽棴寮规
+    closeDia() {
+      this.$refs.form.resetFields();
+      this.formDia = false
+      this.$emit('closeDia')
+    },
+  }
+};
+</script>
+
+<style scoped>
+>>>.el-dialog__body {
+  max-height: 720px;
+  overflow-y: auto;
+}
+</style>

--
Gitblit v1.9.3