From 38f01dc619fb9b7326abc345a216793750758c9a Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期五, 14 三月 2025 20:09:45 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev

---
 src/views/performance/manHour/work-time-statistics.vue |  589 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 589 insertions(+), 0 deletions(-)

diff --git a/src/views/performance/manHour/work-time-statistics.vue b/src/views/performance/manHour/work-time-statistics.vue
new file mode 100644
index 0000000..86aac14
--- /dev/null
+++ b/src/views/performance/manHour/work-time-statistics.vue
@@ -0,0 +1,589 @@
+<template>
+  <div class="work-time-statistics">
+    <div class="search">
+      <div class="search_thing">
+        <div class="search_label">鏃ユ湡锛�</div>
+        <div class="search_input" style="display: flex; align-items: center">
+          <el-date-picker
+            v-model="entity.month"
+            type="month"
+            format="yyyy-MM"
+            value-format="yyyy-MM"
+            placeholder="閫夋嫨鏈�"
+            size="small"
+            style="width: 100%"
+            :clearable="false"
+            @change="refreshTable()"
+          >
+          </el-date-picker>
+        </div>
+      </div>
+      <div class="search_thing">
+        <div class="search_label">鍛樺伐锛�</div>
+        <el-input
+          size="small"
+          placeholder="璇疯緭鍏�"
+          clearable
+          v-model="entity.name"
+          @keyup.enter.native="refreshTable()"
+        ></el-input>
+      </div>
+      <div class="search_thing">
+        <div class="search_label">閮ㄩ棬锛�</div>
+        <div class="search_input">
+          <el-select
+            size="small"
+            placeholder="璇烽�夋嫨"
+            clearable
+            v-model="entity.departLims"
+            @change="refreshTable()"
+          >
+            <el-option
+              label="閫氫俊浜у搧瀹為獙瀹�"
+              value="閫氫俊浜у搧瀹為獙瀹�"
+            ></el-option>
+            <el-option
+              label="鐢靛姏浜у搧瀹為獙瀹�"
+              value="鐢靛姏浜у搧瀹為獙瀹�"
+            ></el-option>
+          </el-select>
+        </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="search_thing">
+        <el-button
+          size="small"
+          type="primary"
+          @click="handleDown"
+          v-show="
+            currentTable == 'value0' &&
+            down 
+          "
+          :loading="outLoading"
+          >瀵� 鍑�</el-button
+        >
+        <el-button
+          size="small"
+          type="primary"
+          @click="handleUp"
+          v-show="currentTable == 'value1' && up"
+          >瀵� 鍏�</el-button
+        >
+      </div>
+    </div>
+    <div style="text-align: left">
+      <el-radio-group
+        v-model="currentTable"
+        size="small"
+        :key="'111'"
+        style="margin-top: 10px"
+      >
+        <el-radio-button
+          label="value0"        >
+          鍘熷宸ユ椂
+        </el-radio-button>
+        <el-radio-button
+          label="value1"
+        >
+          淇宸ユ椂
+        </el-radio-button>
+      </el-radio-group>
+    </div>
+    <div class="table">
+      <!-- <ValueTable ref="ValueTable0"
+          v-if="currentTable == 'value0' && isPermission('selectAuxiliaryOriginalHours')" :isColumnWidth="true"
+                    :isShowZero="true"
+                  :url="$api.auxiliaryOriginalHours.selectAuxiliaryOriginalHours"
+                  :componentData="componentData" :key="upIndex" />
+        <ValueTable ref="ValueTable1" :isShowZero="true"
+          v-if="currentTable == 'value1' && isPermission('selectAuxiliaryCorrectionHours')" :isColumnWidth="true"
+                  :url="$api.auxiliaryCorrectionHours.selectAuxiliaryCorrectionHours"
+          :inputUrl="$api.auxiliaryCorrectionHours.upload"
+                  :componentData="componentData0"
+          :key="upIndex1" /> -->
+      <lims-table
+        v-if="currentTable == 'value0'"
+        :tableData="tableData"
+        :column="column"
+        :key="upIndex"
+        :tableLoading="tableLoading"
+        :height="'calc(100vh - 270px)'"
+        :page="page"
+        @pagination="pagination"
+      ></lims-table>
+
+      <lims-table
+        v-if="currentTable == 'value1'"
+        :tableData="tableData1"
+        :column="column1"
+        :key="upIndex1"
+        :tableLoading="tableLoading1"
+        :height="'calc(100vh - 270px)'"
+        :page="page1"
+        @pagination="pagination1"
+      ></lims-table>
+    </div>
+  </div>
+</template>
+  
+  <script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+  obtainItemParameterList,
+  selectAuxiliaryCorrectionHours,
+  selectAuxiliaryOriginalHours
+} from "../../../api/business/manHour";
+import { getDicts } from "@/api/system/dict/data";
+
+import {
+		getYearAndMonthAndDays
+	} from '../../../utils/date'
+
+export default {
+  components: {
+    limsTable,
+  },
+  computed: {},
+  data() {
+    return {
+      column: [
+        {
+          label: "濮撳悕",
+          prop: "name",
+        },
+        {
+          label: "绫诲瀷",
+          prop: "type",
+        },
+        {
+          label: "1",
+          prop: "oneHours",
+        },
+        {
+          label: "2",
+          prop: "twoHours",
+        },
+        {
+          label: "3",
+          prop: "threeHours",
+        },
+        {
+          label: "4",
+          prop: "fourHours",
+        },
+        {
+          label: "5",
+          prop: "fiveHours",
+        },
+        {
+          label: "6",
+          prop: "sixHours",
+        },
+        {
+          label: "7",
+          prop: "sevenHours",
+        },
+        {
+          label: "8",
+          prop: "eightHours",
+        },
+        {
+          label: "9",
+          prop: "nineHours",
+        },
+        {
+          label: "10",
+          prop: "tenHours",
+        },
+        {
+          label: "11",
+          prop: "elevenHours",
+        },
+        {
+          label: "12",
+          prop: "twelveHours",
+        },
+        {
+          label: "13",
+          prop: "thirteenHours",
+        },
+        {
+          label: "14",
+          prop: "fourteenHours",
+        },
+        {
+          label: "15",
+          prop: "fifteenHours",
+        },
+        {
+          label: "16",
+          prop: "sixteenHours",
+        },
+        {
+          label: "17",
+          prop: "seventeenHours",
+        },
+        {
+          label: "18",
+          prop: "eighteenHours",
+        },
+        {
+          label: "19",
+          prop: "nineteenHours",
+        },
+        {
+          label: "20",
+          prop: "twentyHours",
+        },
+        {
+          label: "21",
+          prop: "twentyOneHours",
+        },
+        {
+          label: "22",
+          prop: "twentyTwoHours",
+        },
+        {
+          label: "23",
+          prop: "twentyThreeHours",
+        },
+        {
+          label: "24",
+          prop: "twentyFourHours",
+        },
+        {
+          label: "25",
+          prop: "twentyFiveHours",
+        },
+        {
+          label: "26",
+          prop: "twentySixHours",
+        },
+        {
+          label: "27",
+          prop: "twentySevenHours",
+        },
+        {
+          label: "28",
+          prop: "twentyEightHours",
+        },
+        {
+          label: "29",
+          prop: "twentyNineHours",
+        },
+        {
+          label: "30",
+          prop: "thirtyHours",
+        },
+        {
+          label: "31",
+          prop: "thirtyOneHours",
+        },
+        {
+          label: "鎬诲伐鏃�",
+          prop: "total",
+        },
+        {
+          label: "鏈堜唤",
+          prop: "month",
+        },
+      ],
+      tableData: [],
+      tableLoading: false,
+      page: {
+        current: 1,
+        size: 20,
+        total: 0,
+      },
+      entity: {},
+      column1: [
+        {
+          label: "濮撳悕",
+          prop: "name",
+        },
+        {
+          label: "绫诲瀷",
+          prop: "type",
+        },
+        {
+          label: "1",
+          prop: "oneHours",
+        },
+        {
+          label: "2",
+          prop: "twoHours",
+        },
+        {
+          label: "3",
+          prop: "threeHours",
+        },
+        {
+          label: "4",
+          prop: "fourHours",
+        },
+        {
+          label: "5",
+          prop: "fiveHours",
+        },
+        {
+          label: "6",
+          prop: "sixHours",
+        },
+        {
+          label: "7",
+          prop: "sevenHours",
+        },
+        {
+          label: "8",
+          prop: "eightHours",
+        },
+        {
+          label: "9",
+          prop: "nineHours",
+        },
+        {
+          label: "10",
+          prop: "tenHours",
+        },
+        {
+          label: "11",
+          prop: "elevenHours",
+        },
+        {
+          label: "12",
+          prop: "twelveHours",
+        },
+        {
+          label: "13",
+          prop: "thirteenHours",
+        },
+        {
+          label: "14",
+          prop: "fourteenHours",
+        },
+        {
+          label: "15",
+          prop: "fifteenHours",
+        },
+        {
+          label: "16",
+          prop: "sixteenHours",
+        },
+        {
+          label: "17",
+          prop: "seventeenHours",
+        },
+        {
+          label: "18",
+          prop: "eighteenHours",
+        },
+        {
+          label: "19",
+          prop: "nineteenHours",
+        },
+        {
+          label: "20",
+          prop: "twentyHours",
+        },
+        {
+          label: "21",
+          prop: "twentyOneHours",
+        },
+        {
+          label: "22",
+          prop: "twentyTwoHours",
+        },
+        {
+          label: "23",
+          prop: "twentyThreeHours",
+        },
+        {
+          label: "24",
+          prop: "twentyFourHours",
+        },
+        {
+          label: "25",
+          prop: "twentyFiveHours",
+        },
+        {
+          label: "26",
+          prop: "twentySixHours",
+        },
+        {
+          label: "27",
+          prop: "twentySevenHours",
+        },
+        {
+          label: "28",
+          prop: "twentyEightHours",
+        },
+        {
+          label: "29",
+          prop: "twentyNineHours",
+        },
+        {
+          label: "30",
+          prop: "thirtyHours",
+        },
+        {
+          label: "31",
+          prop: "thirtyOneHours",
+        },
+        {
+          label: "鎬诲伐鏃�",
+          prop: "total",
+        },
+        {
+          label: "鏈堜唤",
+          prop: "month",
+        },
+      ],
+      tableData1: [],
+      tableLoading1: false,
+      page1: {
+        current: 1,
+        size: 20,
+        total: 0,
+      },
+      entity1: {},
+      down: false,
+      up: false,
+    
+      entity: {
+        month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
+        name: "",
+        departLims: "",
+      },
+      entityCopy: {},
+      entityCopy0: {},
+      upIndex: 0,
+      upIndex1: 100,
+      weekList: [],
+      currentTable: "value0",
+      outLoading: false,
+    };
+  },
+  created() {},
+  mounted() {
+    this.entityCopy = this.HaveJson(this.entity);
+    this.entityCopy0 = this.HaveJson(this.entity);
+    this.getData();
+  },
+  watch: {
+    currentTable(val) {
+      this.getData();
+    },
+  },
+  methods: {
+    getData() {
+        if (this.currentTable == "value0") {
+            console.log('value0');
+        this.tableLoading = true;
+        let params = {...this.page, ...this.entity};
+        selectAuxiliaryOriginalHours(params).then((res) => {
+          this.tableData = res.data.records;
+          this.page.total = res.data.total;
+          this.tableLoading = false;
+        });
+      } else {
+        console.log('value1');
+        this.tableLoading1 = true;
+        let params = {...this.page1, ...this.entity1};
+        selectAuxiliaryCorrectionHours(params).then((res) => {
+          this.tableData1 = res.data.records;
+          this.page1.total = res.data.total;
+          this.tableLoading1 = false;
+        });
+      }
+    },
+    // 杩斿洖鍒嗛〉鍊�
+    pagination({ page, limit }) {
+      this.page.current = page;
+      this.page.size = limit;
+      this.getList();
+    },
+   // 杩斿洖鍒嗛〉鍊�
+   pagination1({ page, limit }) {
+      this.page1.current = page;
+      this.page1.size = limit;
+      this.getList();
+    },
+    refresh() {
+      this.entity = {
+        month: getYearAndMonthAndDays(),
+      };
+      if (this.currentTable == "value0") {
+        this.entity = this.HaveJson(this.entityCopy);
+        this.upIndex++;
+      } else {
+        this.entity = this.HaveJson(this.entityCopy0);
+        this.upIndex1++;
+      }
+      this.refreshTable();
+    },
+    refreshTable() {
+      this.getData();
+    },
+    handleDown() {
+      let entity = { ...this.entity };
+      entity.month =
+        entity.month.split("-")[0] + "-" + entity.month.split("-")[1];
+      this.outLoading = true;
+      exportOriginalHours({ ...entity }).then((res) => {
+        this.outLoading = false;
+        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 = entity.month + "宸ユ椂缁熻琛�.xlsx";
+        link.click();
+      });
+    },
+    handleUp() {
+    },
+    
+  },
+};
+</script>
+  
+  <style scoped>
+.work-time-statistics {
+  height: 100%;
+}
+.search {
+  background-color: #fff;
+  height: 80px;
+  display: flex;
+  align-items: center;
+}
+
+.search_thing {
+  width: 270px;
+  display: flex;
+  align-items: center;
+}
+
+.search_label {
+  width: 60px;
+  font-size: 14px;
+  text-align: right;
+}
+
+.search_input {
+  width: calc(100% - 60px);
+}
+.table {
+  margin-top: 10px;
+  background-color: #fff;
+  width: calc(100% - 40px);
+  height: calc(100% - 60px - 80px - 10px - 40px - 25px);
+  padding: 20px;
+}
+</style>
+  
\ No newline at end of file

--
Gitblit v1.9.3