From 65e40330a1d3acf001a3998cdda4dba0b3b5405c Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 26 十二月 2024 14:33:05 +0800
Subject: [PATCH] 完成7.6测量不确定度的评定

---
 src/components/view/a7-uncertainty-evaluation.vue |  293 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/assets/api/controller.js                      |   10 +
 2 files changed, 303 insertions(+), 0 deletions(-)

diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index d92c739..be435b7 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -58,6 +58,7 @@
     processMethodVerify,
     processSample,
     processTotaldeal,
+    processEvaluate,
   }
 }
 
@@ -753,3 +754,12 @@
   doProcessDeal:'/processDeal/doProcessDeal',//淇敼
   getProcessDeal:'/processDeal/getProcessDeal',// 鏌ョ湅 浼犲弬id
 }
+
+// 7.6娴嬮噺涓嶇‘瀹氬害鐨勮瘎瀹�
+const processEvaluate = {
+  pageProcessEvaluate:'/processEvaluate/pageProcessEvaluate',//鍒嗛〉
+  addProcessEvaluate:'/processEvaluate/addProcessEvaluate',//鏂板(鏂板涓婁紶涓�涓枃浠跺氨濂戒簡)
+  doProcessEvaluate:'/processEvaluate/doProcessEvaluate',//濉啓 (涓昏涓婁紶id鍜屽娉╪ote灏卞ソ浜�)
+  delProcessEvaluate:'/processEvaluate/delProcessEvaluate',//鍒犻櫎  浼犲弬id
+  exportProcessEvaluate:'/processEvaluate/exportProcessEvaluate',//瀵煎嚭
+}
diff --git a/src/components/view/a7-uncertainty-evaluation.vue b/src/components/view/a7-uncertainty-evaluation.vue
new file mode 100644
index 0000000..254da9a
--- /dev/null
+++ b/src/components/view/a7-uncertainty-evaluation.vue
@@ -0,0 +1,293 @@
+<template>
+  <div class="uncertainty-evaluation">
+    <el-row class="title">
+      <el-col :span="20" style="padding-left: 20px;text-align: left;">娴嬮噺涓嶇‘瀹氬害鐨勮瘎瀹�</el-col>
+      <el-col :span="4" style="display: flex;align-items: center;justify-content: end;">
+        <el-button size="medium" type="primary" @click="handleDown0" :loading="outLoading" style="margin-right: 16px;margin-top: 3px;" v-if="outPower">瀵煎嚭</el-button>
+        <el-upload :action="action" :show-file-list="false"
+        accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" :on-change="beforeUpload"
+        :on-error="onError" ref='upload' v-if="addPower" :on-success="handleSuccessUp">
+        <el-button size="medium" type="primary" :loading="upLoading">瀵煎叆</el-button></el-upload>
+      </el-col>
+    </el-row>
+    <div class="search">
+      <div class="search_thing">
+        <div class="search_label">鎶ュ憡鍚嶇О锛�</div>
+        <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.reportName"
+            @keyup.enter.native="refreshTable()"></el-input></div>
+      </div>
+      <div class="search_thing" style="padding-left: 30px;">
+        <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+        <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+      </div>
+    </div>
+    <div class="table">
+      <ValueTable ref="ValueTable" :url="$api.processEvaluate.pageProcessEvaluate"
+        :delUrl="$api.processEvaluate.delProcessEvaluate"
+        :componentData="componentData" :key="upIndex"/>
+    </div>
+    <el-dialog
+      title="璇勪环"
+      :visible.sync="addDialogVisible"
+      width="400px">
+      <el-row>
+        <el-col :span="24" style="margin-bottom: 16px;">
+          <div class="search_thing">
+            <div class="search_label">璇勪环锛�</div>
+            <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addInfo.note"></el-input></div>
+          </div>
+        </el-col>
+        <el-col :span="24" style="margin-bottom: 16px;">
+          <div class="search_thing">
+            <div class="search_label">鏃ユ湡锛�</div>
+            <div class="search_input">
+              <el-date-picker
+                v-model="addInfo.evaluateTime"
+                type="date"
+                size="small"
+                placeholder="閫夋嫨鏃ユ湡"
+                format="yyyy-MM-dd"
+                value-format="yyyy-MM-dd" style="width: 100%;">
+              </el-date-picker>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="addDialogVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="handleAdd" :loading="addLoading">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="鏌ョ湅闄勪欢"
+      :visible.sync="lookDialogVisible"
+      width="800px" top="5vh" fullscreen>
+      <filePreview v-if="lookDialogVisible" :fileUrl="javaApi+'/word/'+currentInfo.reportUrl"
+      :currentFile="{}" style="max-height: 90vh;overflow-y: auto;"/>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import ValueTable from '../tool/value-table.vue'
+import filePreview from '../tool/file-preview.vue'
+export default {
+  components: {
+    ValueTable,
+    filePreview
+  },
+  data() {
+    return {
+      addPower:false,
+      outPower:false,
+      outLoading:false,
+      componentData: {
+          entity: {
+            reportName: null,
+            orderBy: {
+              field: 'createTime',
+              order: 'desc'
+            }
+          },
+          isIndex: true,
+          showSelect: false,
+          select: false,
+          do: [{
+            id: 'handleTell',
+            font: '璇勪环',
+            type: 'text',
+            method: 'handleTell',
+          }, {
+            id: 'delete',
+            font: '鍒犻櫎',
+            type: 'text',
+            method: 'doDiy'
+          }, {
+            id: 'handleDown',
+            font: '涓嬭浇',
+            type: 'text',
+            method: 'handleDown'
+          }, {
+            id: 'handleLook',
+            font: '鏌ョ湅闄勪欢',
+            type: 'text',
+            method: 'handleLook'
+          }],
+          tagField: {},
+          selectField: {},
+          requiredAdd: [],
+          requiredUp: [],
+          needSort: [],
+          inputType:聽''
+      },
+      entityCopy: {},
+      upIndex: 0,
+      upLoading:false,
+      addDialogVisible:false,
+      addInfo:{},
+      addLoading:false,
+      currentInfo:{},
+      lookDialogVisible:false,
+    }
+  },
+  // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+  computed: {
+    headers() {
+      return {
+        'token': sessionStorage.getItem('token')
+      }
+    },
+    action() {
+      return this.javaApi + this.$api.processEvaluate.addProcessEvaluate
+    }
+  },
+  mounted() {
+    this.entityCopy = this.HaveJson(this.componentData.entity);
+    this.getPower()
+  },
+  methods: {
+    getPower(){
+      let power = JSON.parse(sessionStorage.getItem('power'))
+      let up = false
+      let del = false
+      let add = false
+      let out = false
+      for (var i = 0; i < power.length; i++) {
+        if (power[i].menuMethod == 'doProcessEvaluate') {
+          up = true
+        }
+        if (power[i].menuMethod == 'addProcessEvaluate') {
+          add = true
+        }
+        if (power[i].menuMethod == 'delProcessEvaluate') {
+          del = true
+        }
+        if (power[i].menuMethod == 'exportProcessEvaluate') {
+          out = true
+        }
+      }
+      if (!del) {
+        this.componentData.do.splice(1, 1)
+      }
+      if (!up) {
+        this.componentData.do.splice(0, 1)
+      }
+      this.outPower = out
+      this.addPower = add
+    },
+    handleDown0(){
+      this.outLoading = true
+      this.$axios.post(this.$api.processEvaluate.exportProcessEvaluate,{entity:{reportName:this.componentData.entity.reportName}},{responseType: "blob",headers: { 'Content-Type': 'application/json' }}).then(res => {
+        this.outLoading = false
+        if (res.code === 201) return
+        this.$message.success('瀵煎嚭鎴愬姛')
+        const blob = new Blob([res],{ type: 'application/octet-stream' });
+        const url = URL.createObjectURL(blob);
+        const link = document.createElement('a');
+        link.href = url;
+        link.download = '娴嬮噺涓嶇‘瀹氬害鐨勮瘎瀹�.xlsx';
+        link.click();
+      })
+    },
+    handleDown(row) {
+      let url = this.javaApi+'/word/'+row.reportUrl
+      const link = document.createElement('a');
+      link.href = url;
+      link.download = row.reportName;
+      link.click();
+    },
+    beforeUpload(file) {
+      if (file.size > 1024 * 1024 * 10) {
+        this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+        this.$refs.upload.clearFiles()
+        return false;
+      } else {
+        // this.upLoading = true;
+        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.refreshTable()
+      }
+    },
+    handleTell(row){
+      this.addInfo = row;
+      this.addDialogVisible = true;
+    },
+    handleAdd(){
+      this.addLoading = true;
+      this.$axios.post(this.$api.processEvaluate.doProcessEvaluate, {
+        id:this.addInfo.id,
+        note:this.addInfo.note,
+        evaluateTime:this.addInfo.evaluateTime,
+        evaluateUser:JSON.parse(localStorage.getItem("user")).userId
+      },{headers: { 'Content-Type': 'application/json' }}).then((res) => {
+        this.addLoading = false;
+        if(res.code==201){
+          this.$message.error('璇勪环澶辫触');
+          return;
+        }
+        this.$message.success('璇勪环鎴愬姛');
+        this.addDialogVisible = false;
+        this.refreshTable()
+    })
+    },
+    refreshTable() {
+      this.$refs['ValueTable'].selectList()
+    },
+    refresh() {
+      this.componentData.entity = this.HaveJson(this.entityCopy)
+      this.upIndex++
+      this.refreshTable()
+    },
+    handleLook(row){
+      this.currentInfo = row;
+      this.lookDialogVisible = true;
+    }
+  }
+}
+</script>
+
+<style scoped>
+.title {
+    height: 60px;
+    line-height: 60px;
+  }
+  .search {
+    background-color: #fff;
+    height: 80px;
+    display: flex;
+    align-items: center;
+  }
+
+  .search_thing {
+    width: 350px;
+    display: flex;
+    align-items: center;
+  }
+
+  .search_label {
+    width: 80px;
+    font-size: 14px;
+    text-align: right;
+  }
+
+  .search_input {
+    width: calc(100% - 80px);
+  }
+
+  .table {
+    margin-top: 10px;
+    background-color: #fff;
+    width: calc(100% - 40px);
+    height: calc(100% - 60px - 80px - 10px - 40px);
+    padding: 20px;
+  }
+</style>

--
Gitblit v1.9.3