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

diff --git a/src/views/CNAS/process/ensureResults/ensureResultsValidity/index.vue b/src/views/CNAS/process/ensureResults/ensureResultsValidity/index.vue
new file mode 100644
index 0000000..98fafe1
--- /dev/null
+++ b/src/views/CNAS/process/ensureResults/ensureResultsValidity/index.vue
@@ -0,0 +1,670 @@
+<template>
+  <!--  7.7璐ㄩ噺鐩戞帶璁″垝-->
+  <div>
+    <div class="table-card">
+      <TableCard title="骞村害璁″垝琛�" style="margin-top: 10px;">
+        <template v-slot:form>
+          <div class="items_center">
+            <span>璁″垝鍚嶇О锛�</span>
+            <el-input v-model="yearForm.monitorName" class="search" placeholder="璇疯緭鍏�" size="small"></el-input>
+            <el-button size="small" type="primary" @click="getYearPlanList">鏌ヨ</el-button>
+            <el-button size="small" @click="clearYear">閲嶇疆</el-button>
+          </div>
+          <div>
+            <el-upload ref='upload' :action="action" :before-upload="beforeUpload" :headers="uploadHeader"
+              :on-error="onError" :data="uploadData" :on-success="handleSuccessUp" :show-file-list="false"
+              accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'>
+              <el-button :loading="upLoading" size="small" type="primary">瀵煎叆</el-button>
+            </el-upload>
+          </div>
+        </template>
+        <template v-slot:table>
+          <limsTable ref="yearTable" :column="yearColumnData" :height="'28vh'" :highlightCurrentRow="true"
+            :rowClick="rowClick" :table-data="yearTableData" :table-loading="yearLoading"
+            style="margin-top: 0.5em;padding: 0 15px;" :page="yearPage">
+          </limsTable>
+        </template>
+      </TableCard>
+    </div>
+    <div class="table-card">
+      <TableCard title="骞村害璁″垝鏄庣粏琛�" style="margin-top: 10px;">
+        <template v-slot:form>
+          <div class="items_center">
+            <span>鐩戞帶鐩殑锛�</span>
+            <el-input v-model="yearDetailForm.monitorPurpose" class="search" placeholder="璇疯緭鍏�" size="small"></el-input>
+            <span>鐩戞帶椤圭洰锛�</span>
+            <el-input v-model="yearDetailForm.monitorProject" class="search" placeholder="璇疯緭鍏�" size="small"></el-input>
+            <el-button size="small" type="primary" @click="getYearDetailPlanList">鏌ヨ</el-button>
+            <el-button size="small" @click="clearDetail">閲嶇疆</el-button>
+          </div>
+          <div>
+            <el-button size="small" type="primary" @click="showDialog('add')">鏂板</el-button>
+          </div>
+        </template>
+        <template v-slot:table>
+          <limsTable :column="yearDetailColumnData" :height="'28vh'" :table-data="yearDetailTableData"
+            :table-loading="yearDetailLoading" style="margin-top: 18px; padding: 0 15px;" :page="yearDetailPage">
+          </limsTable>
+        </template>
+      </TableCard>
+    </div>
+    <!--鏂板淇敼寮规-->
+    <detail-form-dialog v-if="formDia" ref="formDia" :qualityMonitorId="qualityMonitorId"
+      @closeDia="closeDia"></detail-form-dialog>
+    <!--瀹炴柦娴佺▼寮规-->
+    <carry-out-dialog v-if="carryOutDia" ref="carryOutDia" :qualityMonitorId="qualityMonitorId"
+      @closeDia="closeCarryOutDia"></carry-out-dialog>
+    <!--璇勪环娴佺▼寮规-->
+    <evaluate-dialog v-if="evaluateDialog" ref="evaluateDialog" @closeEvaDia="closeEvaDia"></evaluate-dialog>
+    <el-dialog :visible.sync="examineDialog" title="瀹℃牳" width="30%" @close="closeExamineDia">
+      <span>
+        瀹℃牳澶囨敞锛�
+        <el-input v-model="examineInfo.examineRemark" type="textarea"></el-input>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button :loading="examineLoading" @click="handleReview(0)">涓嶉�氳繃</el-button>
+        <el-button :loading="examineLoading" type="primary" @click="handleReview(1)">閫� 杩�</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog :visible.sync="ratifyDialog" title="鎵瑰噯" width="30%" @close="closeRatifyDia">
+      <span>
+        鎵瑰噯澶囨敞锛�
+        <el-input v-model="ratifyInfo.ratifyRemark" type="textarea"></el-input>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button :loading="ratifyLoading" @click="handleRatify(0)">涓嶆壒鍑�</el-button>
+        <el-button :loading="ratifyLoading" type="primary" @click="handleRatify(1)">鎵� 鍑�</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog :visible.sync="downloadDialog" title="瀵煎嚭" width="600px">
+      <span>
+        <el-button plain type="primary" @click="controlDown">瀹炴柦璁″垝瀵煎嚭</el-button>
+        <el-button plain type="primary" @click="processingDown">璇勪环瀵煎嚭</el-button>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="downloadDialog = false">鍙� 娑�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import TableCard from '@/components/TableCard/index.vue';
+import limsTable from "@/components/Table/lims-table.vue";
+import DetailFormDialog from './components/detailFormDialog.vue';
+import CarryOutDialog from './components/carryOutDialog.vue';
+import EvaluateDialog from './components/evaluateDialog.vue';
+import {
+  pageQualityMonitor,
+  examineQualityMonitor,
+  ratifyQualityMonitor,
+  exportQualityMonitorDetail,
+  delQualitySupervise,
+  pageQualityMonitorDetail,
+  exportQualityMonitorRatify,
+  exportQualityMonitorEvaluate,
+  delQualityMonitorDetail,
+} from '@/api/cnas/process/ensureResults/ensureResultsValidity.js'
+
+export default {
+  name: 'a7-Ensure-results-validity',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: { EvaluateDialog, CarryOutDialog, DetailFormDialog, limsTable, TableCard },
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      uploadData: {},
+      yearForm: {
+        monitorName: '',
+      },
+      yearPage: {
+        current: 1,
+        size: 20,
+        total: 0
+      },
+      yearColumnData: [
+        {
+          label: '璁″垝鍚嶇О',
+          prop: 'monitorName',
+          minWidth: '150px'
+        }, {
+          label: '缂栧埗浜�',
+          prop: 'writeName',
+          minWidth: '100'
+        }, {
+          label: '缂栧埗鏃ユ湡',
+          prop: 'writeTime',
+          minWidth: '160'
+        }, {
+          dataType: 'tag',
+          label: '瀹℃牳鐘舵��',
+          prop: 'examineStatus',
+          minWidth: '100',
+          formatData: (params) => {
+            if (params === 0) {
+              return '涓嶉�氳繃';
+            } else if (params === 1) {
+              return '閫氳繃';
+            } else {
+              return null;
+            }
+          },
+          formatType: (params) => {
+            if (params === 0) {
+              return 'danger';
+            } else if (params === 1) {
+              return 'success';
+            } else {
+              return null;
+            }
+          }
+        }, {
+          label: '瀹℃牳鍐呭',
+          prop: 'examineRemark',
+          minWidth: '100'
+        }, {
+          label: '瀹℃牳浜�',
+          prop: 'examineName',
+          minWidth: '100'
+        }, {
+          label: '瀹℃牳鏃ユ湡',
+          prop: 'examineTime',
+          minWidth: '160'
+        }, {
+          dataType: 'tag',
+          label: '鎵瑰噯鐘舵��',
+          prop: 'ratifyStatus',
+          minWidth: '100',
+          formatData: (params) => {
+            if (params === 0) {
+              return '涓嶆壒鍑�';
+            } else if (params === 1) {
+              return '鎵瑰噯';
+            } else {
+              return null;
+            }
+          },
+          formatType: (params) => {
+            if (params === 0) {
+              return 'danger';
+            } else if (params === 1) {
+              return 'success';
+            } else {
+              return null;
+            }
+          }
+        }, {
+          label: '鎵瑰噯鍐呭',
+          prop: 'ratifyRemark',
+          minWidth: '100'
+        }, {
+          label: '鎵瑰噯浜�',
+          prop: 'ratifyName',
+          minWidth: '100'
+        }, {
+          label: '鎵瑰噯鏃ユ湡',
+          prop: 'ratifyTime',
+          minWidth: '160'
+        }, {
+          label: '鍒涘缓鏃ユ湡',
+          prop: 'createTime',
+          minWidth: '160'
+        }, {
+          label: '鍒涘缓浜�',
+          prop: 'createUser',
+          minWidth: '100'
+        }, {
+          dataType: 'action',
+          minWidth: '170',
+          label: '鎿嶄綔',
+          fixed: 'right',
+          operation: [
+            {
+              name: '瀹℃牳',
+              type: 'text',
+              disabled: (row) => {
+                if (row.examineStatus === 1) {
+                  return true
+                } else {
+                  return false
+                }
+              },
+              clickFun: (row) => {
+                this.examinePlan(row)
+              }
+            },
+            {
+              name: '鎵瑰噯',
+              type: 'text',
+              disabled: (row) => {
+                if (row.ratifyStatus === 1 || row.examineStatus !== 1) {
+                  return true
+                } else {
+                  return false
+                }
+              },
+              clickFun: (row) => {
+                this.approvalPlan(row)
+              }
+            },
+            {
+              name: '瀵煎嚭',
+              type: 'text',
+              clickFun: (row) => {
+                this.handleDown(row)
+              }
+            },
+            {
+              name: '鍒犻櫎',
+              type: 'text',
+              color: '#f56c6c',
+              clickFun: (row) => {
+                this.delPlan(row)
+              }
+            }
+          ]
+        }],
+      yearTableData: [],  // 骞磋〃
+      yearLoading: false,
+      yearDetailForm: {
+        monitorPurpose: '',
+        monitorProject: ''
+      },
+      yearDetailColumnData: [
+        {
+          label: '鐩戞帶鐩殑',
+          prop: 'monitorPurpose',
+          width: '150px',
+          showOverflowTooltip: true,
+        }, {
+          label: '璁″垝寮�灞曟椂闂�',
+          prop: 'plannedTime',
+          minWidth: '150px'
+        }, {
+          label: '鐩戞帶椤圭洰',
+          prop: 'monitorProject',
+          minWidth: '150px'
+        }, {
+          label: '鍙傚姞鍗曚綅锛堜汉鍛橈級',
+          prop: 'participant',
+          minWidth: '150px'
+        }, {
+          label: '棰勭畻锛堝厓锛�',
+          prop: 'budget',
+          minWidth: '150px'
+        }, {
+          label: '缁勭粐浜哄憳',
+          prop: 'organization',
+          minWidth: '150px'
+        }, {
+          label: '鐩戞帶鏂瑰紡',
+          prop: 'monitorWay',
+          minWidth: '150px'
+        }, {
+          dataType: 'action',
+          width: '180',
+          label: '鎿嶄綔',
+          fixed: 'right',
+          operation: [
+            {
+              name: '缂栬緫',
+              type: 'text',
+              clickFun: (row) => {
+                this.showDialog('edit', row)
+              }
+            },
+            {
+              name: '瀹炴柦',
+              type: 'text',
+              clickFun: (row) => {
+                this.carryOut(row)
+              }
+            },
+            {
+              name: '璇勪环',
+              type: 'text',
+              clickFun: (row) => {
+                this.evaluate(row)
+              }
+            },
+            {
+              name: '瀵煎嚭',
+              type: 'text',
+              clickFun: (row) => {
+                this.downLoadPost(row);
+              },
+            },
+            {
+              name: '鍒犻櫎',
+              type: 'text',
+              color: '#f56c6c',
+              clickFun: (row) => {
+                this.delYearPlanDetail(row)
+              }
+            }
+          ]
+        }
+      ],
+      yearDetailTableData: [], // 骞存槑缁嗚〃
+      yearDetailLoading: false,
+      yearDetailPage: {
+        current: 1,
+        size: 20,
+        total: 0
+      },
+      formDia: false,
+      qualityMonitorId: '',
+      carryOutDia: false,
+      evaluateDialog: false,
+      examineDialog: false,
+      examineLoading: false,
+      ratifyDialog: false,
+      ratifyLoading: false,
+      examineInfo: {},
+      ratifyInfo: {},
+      upLoading: false,
+      downloadDialog: false,
+      download: {},
+    };
+  },
+  mounted() {
+    this.getYearPlanList()
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    // 鏌ヨ骞村害璁″垝琛�
+    getYearPlanList() {
+      const entity = {
+        monitorName: this.yearForm.monitorName,
+      }
+      const page = this.yearPage
+      this.yearLoading = true
+      pageQualityMonitor({ ...entity, ...page }).then(res => {
+        this.yearLoading = false
+        if (res.code === 201) return
+        this.yearTableData = res.data.records
+        this.yearPage.total = res.data.total
+        if (this.yearTableData.length > 0) {
+          this.rowClick(this.yearTableData[0])
+        }
+      }).catch(err => {
+        console.log('err---', err);
+        this.yearLoading = false
+      })
+    },
+    clearYear() {
+      this.yearForm.monitorName = ''
+      this.getYearPlanList()
+    },
+    // 瀵煎叆娴佺▼
+    beforeUpload(file) {
+      if (file.size > 1024 * 1024 * 10) {
+        this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+        this.$refs.upload.clearFiles()
+        return false;
+      } else {
+        this.upLoading = true;
+        let list = file.name.split(".")
+        let suffix = list[list.length - 1]
+        this.$set(this.uploadData, 'suffix', suffix)
+        return true;
+      }
+    },
+    onError(err, file, fileList) {
+      this.$message.error('涓婁紶澶辫触')
+      this.$refs.upload.clearFiles()
+    },
+    handleSuccessUp(response) {
+      this.upLoading = false;
+      if (response.code == 200) {
+        this.$message.success('涓婁紶鎴愬姛');
+        this.getYearPlanList()
+      }
+    },
+    // 瀹℃牳
+    examinePlan(row) {
+      this.examineDialog = true
+      this.examineInfo = row
+    },
+    handleReview(examineStatus) {
+      // 瀹℃牳鐘舵�� , 0 涓嶉�氳繃, 1閫氳繃
+      this.examineInfo.examineStatus = examineStatus
+      this.examineLoading = true
+      examineQualityMonitor(this.examineInfo).then(res => {
+        this.examineLoading = false
+        if (res.code === 201) return
+        this.$message.success('鎿嶄綔鎴愬姛')
+        this.closeExamineDia()
+      }).catch(err => {
+        console.log('err---', err);
+        this.examineLoading = false
+      })
+    },
+    closeExamineDia() {
+      this.examineDialog = false
+      this.examineInfo.examineRemark = ''
+      this.getYearPlanList()
+    },
+    // 鎵瑰噯
+    approvalPlan(row) {
+      this.ratifyDialog = true
+      this.ratifyInfo = row
+    },
+    handleRatify(ratifyStatus) {
+      // 鎵瑰噯鐘舵�� , 0 涓嶉�氳繃, 1閫氳繃
+      this.ratifyInfo.ratifyStatus = ratifyStatus
+      this.ratifyLoading = true
+      ratifyQualityMonitor(this.ratifyInfo).then(res => {
+        this.ratifyLoading = false
+        if (res.code === 201) return
+        this.$message.success('鎿嶄綔鎴愬姛')
+        this.closeRatifyDia()
+      }).catch(err => {
+        console.log('err---', err);
+        this.ratifyLoading = false
+      })
+    },
+    closeRatifyDia() {
+      this.ratifyDialog = false
+      this.ratifyInfo.ratifyRemark = ''
+      this.getYearPlanList()
+    },
+    // 瀵煎嚭
+    handleDown(row) {
+      exportQualityMonitorDetail({ qualityMonitorId: row.qualityMonitorId }).then(res => {
+        this.outLoading = false
+        const blob = new Blob([res], { type: 'application/msword' });
+        this.$download.saveAs(blob, row.monitorName + '.docx')
+      })
+    },
+    // 鍒犻櫎杩涘害璁″垝琛�
+    delPlan(row) {
+      this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        this.yearLoading = true
+        delQualitySupervise({ qualityMonitorId: row.qualityMonitorId }).then(res => {
+          this.yearLoading = false
+          if (res.code === 201) return
+          this.$message.success('鍒犻櫎鎴愬姛')
+          this.getYearPlanList();
+
+        }).catch(err => {
+          this.yearLoading = false
+          console.log('err---', err);
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑堝垹闄�'
+        });
+      });
+    },
+    // 骞村害璁″垝琛ㄦ牸锛岀偣鍑昏鏁版嵁鍚庡埛鏂拌鎯�
+    rowClick(row) {
+      this.qualityMonitorId = row.qualityMonitorId
+      this.getYearDetailPlanList()
+    },
+    // 鑾峰彇骞村害鏄庣粏琛�
+    getYearDetailPlanList() {
+      const entity = {
+        qualityMonitorId: this.qualityMonitorId,
+        monitorPurpose: this.yearDetailForm.monitorPurpose,
+        monitorProject: this.yearDetailForm.monitorProject,
+      }
+      const page = this.yearDetailPage
+      this.yearDetailLoading = true
+      pageQualityMonitorDetail({ ...entity, ...page }).then(res => {
+        this.yearDetailLoading = false
+        if (res.code === 201) return
+        this.yearDetailTableData = res.data.records
+        this.yearDetailPage.total = res.data.total
+      }).catch(err => {
+        console.log('err---', err);
+        this.yearDetailLoading = false
+      })
+    },
+    // 閲嶇疆鏄庣粏琛�
+    clearDetail() {
+      this.yearDetailForm = {
+        monitorPurpose: '',
+        monitorProject: ''
+      }
+      this.getYearDetailPlanList()
+    },
+    // 鏄庣粏琛ㄥ疄鏂�
+    carryOut(row) {
+      this.carryOutDia = true
+      this.$nextTick(() => {
+        this.$refs.carryOutDia.openDia(row)
+      })
+    },
+    closeCarryOutDia() {
+      this.carryOutDia = false
+      this.getYearDetailPlanList()
+    },
+    // 鎵撳紑璇勪环寮规
+    evaluate(row) {
+      this.evaluateDialog = true
+      this.$nextTick(() => {
+        this.$refs.evaluateDialog.openDia(row)
+      })
+    },
+    closeEvaDia() {
+      this.evaluateDialog = false
+      this.getYearDetailPlanList()
+    },
+    // 鎵撳紑瀵煎嚭寮规
+    downLoadPost(row) {
+      this.downloadDialog = true
+      this.download = row
+    },
+    // 鎵撳紑骞村害鏄庣粏鏂板銆佷慨鏀瑰脊妗�
+    showDialog(type, row) {
+      this.formDia = true
+      this.$nextTick(() => {
+        this.$refs.formDia.openDia(type, row)
+      })
+    },
+    closeDia() {
+      this.formDia = false
+      this.getYearDetailPlanList()
+    },
+    // 鎺у埗鍗曞鍑�
+    controlDown() {
+      exportQualityMonitorRatify({
+        qualityMonitorDetailsId: this.download.qualityMonitorDetailsId
+      }).then(res => {
+        this.outLoading = false
+        const blob = new Blob([res], { type: 'application/msword' });
+        this.$download.saveAs(blob, '璐ㄩ噺鐩戞帶瀹炴柦璁″垝.docx')
+      })
+    },
+    // 澶勭悊鍗曞鍑�
+    processingDown() {
+      exportQualityMonitorEvaluate({ qualityMonitorDetailsId: this.download.qualityMonitorDetailsId }).then(res => {
+        this.outLoading = false
+        const blob = new Blob([res], { type: 'application/msword' });
+        this.$download.saveAs(blob, '璐ㄩ噺鐩戞帶璇勪环.docx')
+      })
+    },
+    delYearPlanDetail(row) {
+      this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        this.yearDetailLoading = true
+        delQualityMonitorDetail({ qualityMonitorDetailsId: row.qualityMonitorDetailsId }).then(res => {
+          this.yearDetailLoading = false
+          if (res.code === 201) return
+          this.$message.success('鍒犻櫎鎴愬姛')
+          this.getYearDetailPlanList()
+        }).catch(err => {
+          this.yearDetailLoading = false
+          console.log('err---', err);
+        })
+      })
+    },
+    // 骞磋鍒掑垎椤�
+    handleYearCurrent(page) {
+      this.yearPage.current = page
+      this.getYearPlanList()
+    },
+    handleYearSizeChange(size) {
+      this.yearPage.size = size
+      this.getYearPlanList()
+    },
+    // 骞存槑缁嗚鍒掑垎椤�
+    handleYearDetailCurrent(page) {
+      this.yearDetailPage.current = page
+      this.getYearDetailPlanList()
+    },
+    handleYearDetailSizeChange(size) {
+      this.yearDetailPage.size = size
+      this.getYearDetailPlanList()
+    },
+  },
+  // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+  computed: {
+    action() {
+      return this.javaApi + '/qualityMonitor/importQualityMonitor'
+    }
+  },
+};
+</script>
+
+<style scoped>
+.table-card {
+  background-color: #ffffff;
+}
+
+.flex_column {
+  display: flex;
+  height: 80vh;
+  flex-direction: column;
+  overflow: auto;
+  justify-content: space-between;
+}
+
+.pagination {
+  display: flex;
+  justify-content: space-between
+}
+
+.items_center {
+  display: flex;
+  align-items: center;
+}
+
+.date_box {
+  margin: 0 5px;
+}
+
+.search {
+  width: 150px;
+  padding: 0 16px;
+}
+</style>

--
Gitblit v1.9.3