From 1a09e4c1f2eef787ed9e5826f16a587185e364b1 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 26 十二月 2024 14:33:06 +0800
Subject: [PATCH] 完成7.8报告结果搬迁

---
 src/components/view/a7-report-results.vue |  431 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/assets/api/controller.js              |   11 +
 2 files changed, 442 insertions(+), 0 deletions(-)

diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index 778c836..6bc3b9c 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -61,6 +61,7 @@
     processEvaluate,
     qualityMonitor,
     measuresAddressRisksOpportunities,
+    processReport,
   }
 }
 
@@ -805,4 +806,14 @@
   removeRiskFactors: "/manageRiskAssessmentResults/removeRiskFactors", // 鍗遍櫓鍥犵礌杈ㄨ瘑涓庨闄╄瘎浠风粨鏋滀竴瑙� 鍒犻櫎
   exportHazardFactorIdentification: "/manageRiskAssessmentResults/exportHazardFactorIdentification", // 鍗遍櫓鍥犵礌杈ㄨ瘑涓庨闄╄瘎浠风粨鏋滀竴瑙� 瀵煎嚭
   exportSignificantRiskFactors: "/manageControlPlanList/exportSignificantRiskFactors", // 閲嶅ぇ椋庨櫓鍥犵礌鍒嗘瀽鍙婃帶鍒惰鍒掓竻鍗� 瀵煎嚭
+}
+
+// 7.8鎶ュ憡缁撴灉
+const processReport = {
+  pageProcessReport:'/processReport/pageProcessReport',// 鍒嗛〉
+  addProcessReport:'/processReport/addProcessReport',//鏂板
+  delProcessReport:'/processReport/delProcessReport',//鍒犻櫎
+  getProcessReport:'/processReport/getProcessReport',//鏌ョ湅
+  doProcessReport:'/processReport/doProcessReport',//淇敼
+  exportProcessReport:'/processReport/exportProcessReport',//瀵煎嚭
 }
\ No newline at end of file
diff --git a/src/components/view/a7-report-results.vue b/src/components/view/a7-report-results.vue
new file mode 100644
index 0000000..54264cf
--- /dev/null
+++ b/src/components/view/a7-report-results.vue
@@ -0,0 +1,431 @@
+<template>
+  <div class="report-results">
+    <el-row class="title">
+      <el-col :span="12" style="padding-left: 20px;text-align: left;">鎶ュ憡缁撴灉</el-col>
+      <el-col :span="12" style="text-align: right;">
+        <el-button size="medium" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower">瀵煎嚭</el-button>
+        <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">鏂板</el-button>
+      </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.insReportCode"
+            @keyup.enter.native="refreshTable()"></el-input></div>
+      </div>
+      <!-- <div class="search_thing">
+        <div class="search_label">鍙戦�佷汉锛�</div>
+        <div class="search_input">
+          <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.sendUserName"
+            @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.processReport.pageProcessReport"
+        :delUrl="$api.processReport.delProcessReport"
+        :componentData="componentData" :key="upIndex"/>
+    </div>
+    <el-dialog
+      :title="title"
+      :visible.sync="addDialogVisible"
+      width="400px" top="6vh">
+      <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.insReportCode"></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-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addInfo.pages"></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-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addInfo.number"></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-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addInfo.send"></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-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addInfo.method"></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.sendTime"
+                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-col :span="24" style="margin-bottom: 16px;">
+          <div class="search_thing">
+            <div class="search_label">鍙戦�佷汉锛�</div>
+            <div class="search_input">
+              <el-select v-model="addInfo.sendUser" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+                <el-option
+                  v-for="item in personList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </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-select v-model="addInfo.signatory" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" multiple>
+                <el-option
+                  v-for="item in personList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </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-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addInfo.remark" type="textarea"
+              :rows="2"></el-input></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>
+    <!-- html瀵煎嚭涓簑ord锛屾牱瀛愬お涓戜簡锛屼唬鐮佸厛鏀剧潃鍚� -->
+    <!-- <div style="position: fixed;top: 0;width: 1050px;height: 80vh;overflow-y: auto;z-index: 0;opacity: 0;">
+      <div ref="content">
+        <h4 style="display: flex;align-items: center;flex-direction: column;justify-content: center;">
+          <span style="font-size: 20px;">妫�楠屾姤鍛婂彂鏀剧櫥璁拌〃</span>
+          <span>Registration form for the issuance of inspection reports</span>
+        </h4>
+        <table border="1" class="tables" cellpadding="10">
+          <tr>
+            <td>
+              <p>搴忓彿</p>
+              <p class="en">No.</p>
+            </td>
+            <td>
+              <p>妫�楠屾姤鍛婄紪鍙�</p>
+              <p class="en">Inspection report number</p>
+            </td>
+            <td>
+              <p>椤垫暟</p>
+              <p class="en">Pages</p>
+            </td>
+            <td>
+              <p>鍙戦�佷唤鏁�</p>
+              <p class="en">Number of copies sent</p>
+            </td>
+            <td>
+              <p>鍙戝線浣曞</p>
+              <p class="en">Where to send to</p>
+            </td>
+            <td>
+              <p>鍙戦�佹柟寮�</p>
+              <p class="en">Send method</p>
+            </td>
+            <td>
+              <p>鍙戦�佹棩鏈�</p>
+              <p class="en">Date sent</p>
+            </td>
+            <td>
+              <p>鍙戦�佷汉</p>
+              <p class="en">Sender</p>
+            </td>
+            <td>
+              <p>绛炬敹浜�</p>
+              <p class="en">Signatory</p>
+            </td>
+            <td>
+              <p>澶囨敞</p>
+              <p class="en">Remark</p>
+            </td>
+          </tr>
+          <tr v-for="(item,index) in mutilSelect" :key="index">
+            <td>{{ index+1 }}</td>
+            <td>{{ item.insReportCode }}</td>
+            <td>{{ item.pages }}</td>
+            <td>{{ item.number }}</td>
+            <td>{{ item.send }}</td>
+            <td>{{ item.method }}</td>
+            <td>{{ item.sendTime }}</td>
+            <td>{{ item.sendUserName }}</td>
+            <td>
+              <img :src="javaApi+'/img/'+item.signatoryUrl" :alt="item.signatory" style="width: 100px;">
+            </td>
+            <td>{{ item.remark }}</td>
+          </tr>
+        </table>
+      </div>
+    </div> -->
+  </div>
+</template>
+
+<script>
+import ValueTable from '../tool/value-table.vue'
+export default {
+  components: {
+    ValueTable
+  },
+  data() {
+    return {
+      outLoading:false,
+      addPower:true,
+      outPower:true,
+      componentData: {
+        entity: {
+          insReportCode: null,
+          // sendUserName: null,
+          orderBy: {
+            field: 'createTime',
+            order: 'desc'
+          }
+        },
+        isIndex: true,
+        showSelect: true,
+        select: true,
+        selectMethod: 'handleChangeTask',
+        do: [{
+          id: 'delete',
+          font: '鍒犻櫎',
+          type: 'text',
+          method: 'doDiy'
+        }, {
+          id: 'handleWork',
+          font: '淇敼',
+          type: 'text',
+          method: 'handleWork'
+        }],
+        tagField: {},
+        selectField: {
+          sendUser:{
+            select: []
+          },
+          signatory:{
+            select: []
+          },
+        },
+        // addUpload:['signatoryUrl'],
+        requiredAdd: [],
+        requiredUp: [],
+        needSort: [],
+        inputType:聽''
+      },
+      entityCopy: {},
+      upIndex: 0,
+      personList:[],
+      title:'鏂板',
+      addDialogVisible:false,
+      addInfo:{
+        signatory:[]
+      },
+      addLoading:false,
+      mutilSelect:[]
+    }
+  },
+  mounted() {
+    this.entityCopy = this.HaveJson(this.componentData.entity);
+    this.getPower()
+    this.getAuthorizedPerson()
+  },
+  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 == 'doProcessReport') {
+          up = true
+        }
+        if (power[i].menuMethod == 'addProcessReport') {
+          add = true
+        }
+        if (power[i].menuMethod == 'delProcessReport') {
+          del = true
+        }
+        if (power[i].menuMethod == 'exportProcessReport') {
+          out = true
+        }
+      }
+      if (!up) {
+        this.componentData.do.splice(1, 1)
+      }
+      if (!del) {
+        this.componentData.do.splice(0, 1)
+      }
+      this.outPower = out
+      this.addPower = add
+    },
+    handleDown() {
+      if(this.mutilSelect.length==0){
+        this.$message.warning('璇烽�夋嫨瑕佸鍑虹殑鏁版嵁')
+        return
+      }
+      // html瀵煎嚭涓簑ord锛屾牱瀛愬お涓戜簡锛屼唬鐮佸厛鏀剧潃鍚�
+      // exportHtmlToWord(this.$refs.content,'妫�楠屾姤鍛婂彂鏀剧櫥璁拌〃')
+      this.outLoading = true
+      this.$axios.post(this.$api.processReport.exportProcessReport,{"ids":this.mutilSelect.map(m=>m.id)},{headers: { 'Content-Type': 'application/json' },noQs:true}).then(res => {
+        this.outLoading = false
+        if (res.code === 201) return
+        this.$message.success('瀵煎嚭鎴愬姛')
+        const url = this.javaApi+'/word/'+res.message;
+        const link = document.createElement('a');
+        link.href = url;
+        link.download = '鎶ュ憡缁撴灉';
+        link.click();
+      })
+    },
+    openAdd() {
+      this.title = '鏂板'
+      this.addInfo = {
+        signatory:[]
+      }
+      this.addDialogVisible = true;
+    },
+    refreshTable() {
+      this.$refs['ValueTable'].selectList()
+    },
+    refresh() {
+      this.componentData.entity = this.HaveJson(this.entityCopy)
+      this.upIndex++
+      this.refreshTable()
+    },
+    getAuthorizedPerson() {
+      this.$axios.get(this.$api.user.getUserMenu).then(res => {
+        let data = []
+        res.data.forEach(a => {
+          data.push({
+            label: a.name,
+            value: a.id
+          })
+        })
+        this.personList = data
+      })
+    },
+    handleAdd(){
+      this.addLoading = true
+      delete this.addInfo.createTime
+      delete this.addInfo.createUser
+      delete this.addInfo.updateTime
+      delete this.addInfo.signatoryUrl
+      delete this.addInfo.updateUserer
+      delete this.addInfo.sendUserName
+      let addInfo = this.HaveJson(this.addInfo)
+      addInfo.signatory = addInfo.signatory.join(',')
+      this.$axios.post(this.$api.processReport[this.title=='鏂板'?'addProcessReport':'doProcessReport'], addInfo,{headers: { 'Content-Type': 'application/json' }}).then(res => {
+          this.addLoading = false
+          if (res.code == 201) {
+            return
+          }
+          this.addDialogVisible = false
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!'
+          });
+          this.refreshTable()
+        }).catch(err => {})
+    },
+    handleWork(row){
+      this.title = '淇敼'
+      this.addInfo = row
+      console.log(this.addInfo)
+      this.addInfo.signatory = this.addInfo.signatory?this.addInfo.signatory.split(',').map(m=>Number(m)):[]
+      this.addDialogVisible = true;
+    },
+    handleChangeTask(list){
+      this.mutilSelect = list
+    }
+  }
+}
+</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: 110px;
+    font-size: 14px;
+    text-align: right;
+  }
+
+  .search_input {
+    width: calc(100% - 110px);
+  }
+
+  .table {
+    margin-top: 10px;
+    background-color: #fff;
+    width: calc(100% - 40px);
+    height: calc(100% - 60px - 80px - 10px - 40px);
+    padding: 20px;
+  }
+  .tables {
+    table-layout: fixed;
+    width: 100%;
+    margin-top: 10px;
+  }
+
+  .tables td {
+    height: 40px;
+    width: 100px;
+    text-align: center;
+    font-size: 14px;
+    word-wrap: break-word;
+    white-space: normal;
+  }
+  .en{
+    font-size: 12px;
+    word-break: break-word; /* 鑷姩鏂 */
+    overflow-wrap: break-word; /* 闃叉婧㈠嚭 */
+    white-space: normal; /* 榛樿鎹㈣ */
+  }
+</style>

--
Gitblit v1.9.3