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/nonconformingWork/nonconformingDistribution/components/formDia.vue |  232 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 232 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/process/nonconformingWork/nonconformingDistribution/components/formDia.vue b/src/views/CNAS/process/nonconformingWork/nonconformingDistribution/components/formDia.vue
new file mode 100644
index 0000000..84509e0
--- /dev/null
+++ b/src/views/CNAS/process/nonconformingWork/nonconformingDistribution/components/formDia.vue
@@ -0,0 +1,232 @@
+<template>
+  <div>
+    <el-dialog v-loading="diaLoading" :close-on-click-modal="false" :close-on-press-escape="false"
+      :visible.sync="formDia" title="涓嶇鍚堥」鐨勫垎甯�" width="90%" @close="closeDia">
+      <table border="1" cellspacing="10" class="table">
+        <tr>
+          <td>绔犺妭鍙�</td>
+          <th class="div-with-line">
+            <span style="float: left;">瑕佺礌</span>
+            <span style="float: right;">閮ㄩ棬</span>
+          </th>
+          <th>涓讳换</th>
+          <th>鎶�鏈礋璐d汉</th>
+          <th>璐ㄩ噺璐熻矗浜�</th>
+          <th>缁煎悎瀹�</th>
+          <th>璇曢獙瀹�</th>
+          <th>鍚堣</th>
+          <th>鍗�%</th>
+        </tr>
+        <tr v-for="(item, index) in distributionDetailList" :key="item.value">
+          <td>{{ item.chapterNumber }}</td>
+          <th>{{ item.essentials }}</th>
+          <th>
+            <el-input-number v-model="item.director" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+            <el-input-number v-model="item.technology" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+            <el-input-number v-model="item.quality" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+            <el-input-number v-model="item.comprehensive" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+            <el-input-number v-model="item.testing" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+            {{ item.total }}
+          </th>
+          <th>
+            {{ (item.proportion ? item.proportion : 0) + '%' }}
+          </th>
+        </tr>
+        <tr>
+          <td> </td>
+          <th>
+            鍗犳瘮
+          </th>
+          <th>
+            {{ (distributionProportion.director ? distributionProportion.director : 0) + '%' }}
+          </th>
+          <th>
+            {{ (distributionProportion.technology ? distributionProportion.technology : 0) + '%' }}
+          </th>
+          <th>
+            {{ (distributionProportion.quality ? distributionProportion.quality : 0) + '%' }}
+          </th>
+          <th>
+            {{ (distributionProportion.comprehensive ? distributionProportion.comprehensive : 0) + '%' }}
+          </th>
+          <th>
+            {{ (distributionProportion.testing ? distributionProportion.testing : 0) + '%' }}
+          </th>
+          <th>
+            {{ distributionProportion.total ? distributionProportion.total : 0 }}
+          </th>
+          <th> </th>
+        </tr>
+      </table>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDia">鍙� 娑�</el-button>
+        <el-button :loading="loading" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  getInconsistentDistributionOne,
+  addInconsistentDistribution,
+  updateInconsistentDistribution
+} from '@/api/cnas/process/nonconformingWork.js'
+export default {
+  name: 'formDia',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: {},
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      formDia: false,
+      diaLoading: false,
+      loading: false,
+      distributionDetailList: [],
+      form: {
+
+      },
+      distributionProportion: {}
+    };
+  },
+  mounted() {
+
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    // 鎵撳紑寮规
+    openDia(type, row) {
+      this.formDia = true
+      this.operationType = type
+      if (type !== 'add') {
+        this.searchInfo(row)
+      } else {
+        this.selectEnumByCategory()
+      }
+    },
+    // 鏌ヨ璇︽儏
+    searchInfo(row) {
+      this.diaLoading = true
+      getInconsistentDistributionOne({ distributionId: row.distributionId }).then(res => {
+        this.diaLoading = false
+        if (res.code === 201) return
+        this.form = res.data
+        this.distributionDetailList = this.form.distributionDetailList
+        this.distributionProportion = this.form.distributionProportion
+      }).catch(err => {
+        console.log(err)
+        this.diaLoading = false
+      })
+    },
+    // 鎻愪氦寮规鏁版嵁
+    handleEdit() {
+      const date = new Date();
+      const year = date.getFullYear();
+      this.loading = true
+      const internalPlan = this.HaveJson(this.form)
+      internalPlan.distributionYear = year
+      internalPlan.distributionDetailList = this.HaveJson(this.distributionDetailList)
+      if (this.operationType === 'add') {
+        addInconsistentDistribution(internalPlan).then(res => {
+          this.loading = false
+          if (res.code === 201) return
+          this.$message.success('鎿嶄綔鎴愬姛')
+          this.closeDia()
+        }).catch(err => {
+          console.log('err---', err);
+          this.loading = false
+        })
+      } else if (this.operationType === 'edit') {
+        updateInconsistentDistribution(internalPlan).then(res => {
+          this.loading = false
+          if (res.code === 201) return
+          this.$message.success('鎿嶄綔鎴愬姛')
+          this.closeDia()
+        }).catch(err => {
+          console.log('err---', err);
+          this.loading = false
+        })
+      }
+    },
+    closeDia() {
+      this.formDia = false
+      this.$emit('closeDia')
+    },
+    selectEnumByCategory() {
+      this.distributionDetailList = []
+      // 瑕佺礌
+      this.getDicts("essential").then((response) => {
+        let arr = this.dictToValue(response.data)
+        arr.map((item) => {
+          const obj = Object.assign({
+            essentials: item.label,
+            chapterNumber: item.value,
+          })
+          this.distributionDetailList.push(obj)
+        })
+      });
+    },
+  }
+};
+</script>
+
+<style scoped>
+>>>.el-dialog {
+  margin: 6vh auto 50px !important;
+}
+
+>>>.el-dialog__body {
+  max-height: 68vh;
+  overflow-y: auto;
+}
+
+>>>.is-required {
+  margin-bottom: 6px;
+}
+
+.table {
+  width: 100%;
+  margin-top: 20px;
+}
+
+.table td {
+  width: 30px;
+  text-align: center;
+}
+
+.table th {
+  width: 70px;
+  height: 70px;
+  text-align: center;
+}
+
+.div-with-line {
+  width: 70px;
+  height: 70px;
+  position: relative;
+  /*overflow: hidden; /* 闅愯棌婧㈠嚭鍐呭 */
+}
+
+.div-with-line::after {
+  content: '';
+  position: absolute;
+  bottom: 0;
+  height: 1px;
+  background-color: #000000;
+  left: 50%;
+  transform: translateX(-50%) rotate(45deg);
+  transform-origin: center 50%;
+  top: 50%;
+  width: 100px;
+}
+</style>

--
Gitblit v1.9.3