|
@@ -1,25 +1,26 @@
|
|
|
<template>
|
|
|
- <div class="statistics-panel">
|
|
|
- <div class="stat-item" v-for="(item, index) in statisticsData" :key="index">
|
|
|
- <div class="icon-wrapper">
|
|
|
- <svg-icon :icon-class="item.icon" class="icon" />
|
|
|
- </div>
|
|
|
- <div class="stat-info">
|
|
|
- <count-to
|
|
|
- :start-val="0"
|
|
|
- :end-val="item.value"
|
|
|
- :duration="2000"
|
|
|
- class="num"
|
|
|
- />
|
|
|
- <div class="text">{{ item.text }}</div>
|
|
|
- </div>
|
|
|
+<div class="statistics-panel">
|
|
|
+ <div class="stat-item" v-for="(item, index) in statisticsData" :key="index">
|
|
|
+ <div class="icon-wrapper">
|
|
|
+ <svg-icon :icon-class="item.icon" class="icon" />
|
|
|
+ </div>
|
|
|
+ <div class="stat-info" @click="handleClick(item)">
|
|
|
+ <count-to
|
|
|
+ :start-val="0"
|
|
|
+ :end-val="item.value"
|
|
|
+ :duration="2000"
|
|
|
+ class="num"
|
|
|
+ />
|
|
|
+ <div class="text">{{ item.text }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import CountTo from "vue-count-to";
|
|
|
import { GetDataByName, GetDataByNames } from "@/api/common";
|
|
|
+import StaffInstallationTable from "./StaffInstallationTable.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "StatisticsPanel",
|
|
@@ -28,12 +29,13 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+
|
|
|
+ tableData:[],
|
|
|
statisticsData: [
|
|
|
{ icon: "order-completed", text: "未接单", value: 0 },
|
|
|
- { icon: "order-unproduced", text: "未开始", value: 0 },
|
|
|
- { icon: "order-total-count", text: "进行中", value: 0 },
|
|
|
+ { icon: "order-unproduced", text: "已接单", value: 0 },
|
|
|
+ { icon: "order-total-count", text: "处理中", value: 0 },
|
|
|
{ icon: "order-producing", text: "已完成未验收", value: 0 },
|
|
|
-
|
|
|
{ icon: "order-produced", text: "已完成", value: 0 },
|
|
|
{ icon: "order-uncompleted", text: "已超期", value: 0 },
|
|
|
],
|
|
@@ -50,6 +52,45 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleClick(item) {
|
|
|
+ console.log("22222222222222222222222222222222222");
|
|
|
+ console.log(item);
|
|
|
+ this.getTableData();
|
|
|
+ },
|
|
|
+ updateCurrentTime() {
|
|
|
+ const now = new Date();
|
|
|
+ const year = now.getFullYear();
|
|
|
+ const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
|
+ const day = String(now.getDate()).padStart(2, "0");
|
|
|
+ const hours = String(now.getHours()).padStart(2, "0");
|
|
|
+ const minutes = String(now.getMinutes()).padStart(2, "0");
|
|
|
+ const seconds = String(now.getSeconds()).padStart(2, "0");
|
|
|
+ const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
+ this.updateTime = formattedTime;
|
|
|
+ },
|
|
|
+ async getTableData() {
|
|
|
+ const send_select_list = {
|
|
|
+ name: "getInstallStaffOverview",
|
|
|
+ offset: 0,
|
|
|
+ pagecount: 0,
|
|
|
+ parammaps: {
|
|
|
+ personnelId: this.selectedPersonnel || "",
|
|
|
+ },
|
|
|
+ };
|
|
|
+
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ const response = await GetDataByName(send_select_list);
|
|
|
+ this.tableData = response.data.list || [];
|
|
|
+ this.updateCurrentTime();
|
|
|
+ this.$emit("data-loaded");
|
|
|
+ } catch (error) {
|
|
|
+ console.error("获取表格数据失败:", error);
|
|
|
+ this.$message.error("获取表格数据失败");
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
async initData() {
|
|
|
const send_select_list = [
|
|
|
{
|