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

diff --git a/src/views/CNAS/process/reportResults/index.vue b/src/views/CNAS/process/reportResults/index.vue
new file mode 100644
index 0000000..66ae2ea
--- /dev/null
+++ b/src/views/CNAS/process/reportResults/index.vue
@@ -0,0 +1,409 @@
+<template>
+  <div class="report-results">
+    <div class="search">
+      <div class="search_thing">
+        <div class="search_label">妫�楠屾姤鍛婄紪鍙凤細</div>
+        <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.insReportCode"
+            @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 class="btn">
+        <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>
+      </div>
+    </div>
+    <div class="table">
+      <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 270px)'"
+        :page="page" @pagination="pagination" :isSelection="true"
+        :handleSelectionChange="handleSelectionChange"></lims-table>
+    </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>
+  </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+  exportProcessReport,
+  doProcessReport,
+  addProcessReport,
+  pageProcessReport,
+  delProcessReport
+} from '@/api/cnas/process/reportResults.js'
+import {
+  selectUserCondition,
+} from "@/api/system/user.js";
+export default {
+  components: {
+    limsTable
+  },
+  data() {
+    return {
+      outLoading: false,
+      addPower: true,
+      outPower: true,
+      personList: [],
+      title: '鏂板',
+      addDialogVisible: false,
+      addInfo: {
+        signatory: []
+      },
+      addLoading: false,
+      mutilSelect: [],
+      queryParams: {},
+      tableData: [],
+      column: [
+        { label: "妫�楠屾姤鍛婄紪鍙�", prop: "insReportCode" },
+        { label: "椤垫暟", prop: "pages", width: "120px" },
+        {
+          label: "鍙戦�佷唤鏁�",
+          prop: "number",
+        },
+        { label: "鍙戝線浣曞", prop: "send" },
+        { label: "鍙戦�佹柟寮�", prop: "method" },
+        { label: "鍙戦�佹棩鏈�", prop: "sendTime" },
+        { label: "鍙戦�佷汉", prop: "sendUserName" },
+        { label: "绛炬敹浜�", prop: "signatoryName" },
+        { label: "澶囨敞", prop: "remark" },
+        {
+          dataType: "action",
+          fixed: "right",
+          label: "鎿嶄綔",
+          operation: [
+            {
+              name: "缂栬緫",
+              type: "text",
+              clickFun: (row) => {
+                this.handleWork(row);
+              },
+            },
+            {
+              name: "鍒犻櫎",
+              type: "text",
+              clickFun: (row) => {
+                this.handleDelete(row);
+              },
+            },
+          ],
+        },
+      ],
+      page: {
+        total: 0,
+        size: 10,
+        current: 0,
+      },
+      tableLoading: false,
+    }
+  },
+  mounted() {
+    // this.entityCopy = this.HaveJson(this.componentData.entity);
+    this.getList()
+    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
+      }
+      this.outLoading = true
+      exportProcessReport({ ids: this.mutilSelect.map(m => m.id) }).then(res => {
+        this.outLoading = false
+        if (res.code === 201) return
+        const url = this.javaApi + '/word/' + res.data;
+        this.$download.saveAs(url, "鎶ュ憡缁撴灉");
+      })
+    },
+    openAdd() {
+      this.title = '鏂板'
+      this.addInfo = {
+        signatory: []
+      }
+      this.addDialogVisible = true;
+    },
+    getList() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams, ...this.page };
+      delete param.total;
+      pageProcessReport({ ...param })
+        .then((res) => {
+          this.tableLoading = false;
+          if (res.code === 200) {
+            this.tableData = res.data.records;
+            this.page.total = res.data.total;
+          }
+        })
+        .catch((err) => {
+          this.tableLoading = false;
+        });
+    },
+    pagination({ page, limit }) {
+      this.page.current = page;
+      this.page.size = limit;
+      this.getList();
+    },
+    refresh() {
+      this.queryParams = {};
+      this.page.current = 1;
+      this.getList();
+    },
+    refreshTable() {
+      this.page.current = 1;
+      this.getList();
+    },
+    handleSelectionChange(val) {
+      this.mutilSelect = val
+    },
+    getAuthorizedPerson() {
+      selectUserCondition().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(',')
+      if (this.title == '鏂板') {
+        addProcessReport(addInfo).then(res => {
+          this.addLoading = false
+          if (res.code == 201) {
+            return
+          }
+          this.addDialogVisible = false
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!'
+          });
+          this.refreshTable()
+        }).catch(err => { })
+      } else {
+        doProcessReport(addInfo).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
+    },
+    handleDelete(row) {
+      this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+      })
+        .then(() => {
+          delProcessReport({ id: row.id }).then((res) => {
+            if (res.code == 201) return;
+            this.$message.success("鍒犻櫎鎴愬姛");
+            this.refresh();
+          });
+        })
+        .catch(() => { });
+    },
+  }
+}
+</script>
+
+<style scoped>
+.search {
+  background-color: #fff;
+  height: 80px;
+  display: flex;
+  align-items: center;
+  position: relative;
+}
+
+.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 {
+  background-color: #fff;
+  height: calc(100% - 60px - 80px - 10px - 40px);
+  padding: 20px;
+}
+
+.tables {
+  table-layout: fixed;
+  width: 100%;
+}
+
+.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;
+  /* 榛樿鎹㈣ */
+}
+
+.btn {
+  position: absolute;
+  top: 16px;
+  right: 20px;
+}
+</style>

--
Gitblit v1.9.3