Ver código fonte

提工时成功统计bug

Lijy 7 meses atrás
pai
commit
e53c096029

+ 9 - 1
fhKeeper/formulahousekeeper/timesheet/src/components/echartsEchar.vue

@@ -56,6 +56,7 @@ export default {
   },
   created() {
     this.uuid = this.idGen();
+    console.log(this.uuid, '<===== uuId')
   },
   mounted() {
     this.myChart = echarts.init(document.getElementById(this.uuid));
@@ -67,8 +68,15 @@ export default {
     }
   },
   methods: {
+    // idGen() {
+    //   return new Date().getTime();
+    // },
     idGen() {
-      return new Date().getTime();
+      const arr = new Uint8Array(16);
+      window.crypto.getRandomValues(arr);
+      arr[6] = (arr[6] & 0x0f) | 0x40; // 设置版本为 0100
+      arr[8] = (arr[8] & 0x3f) | 0x80; // 设置变体为 10xx
+      return [...arr].map((b) => ('00' + b.toString(16)).slice(-2)).join('').match(/.{1,8}/g).join('-');
     },
   },
   beforeDestroy() {

+ 8 - 4
fhKeeper/formulahousekeeper/timesheet/src/components/selectPersonnel.vue

@@ -11,7 +11,8 @@
               <span class="pleaseChoose">请选择</span>
             </template>
             <template v-else>
-              {{ getSelectedLabel }}
+              <!-- {{ getSelectedLabel }} -->
+              <TranslationOpenDataText type='userName' :openid="getSelectedLabel"></TranslationOpenDataText>
             </template>
           </div>
         </template>
@@ -22,9 +23,12 @@
               <span class="textSpan pleaseChoose">请选择</span>
             </template>
             <template v-else>
-              <el-tag closable type="info" :size="size" class="narrow" style="margin: 0;" @close="userTagClose">{{
+              <el-tag closable type="info" :size="size" class="narrow" style="margin: 0;" @close="userTagClose">
+                {{
                 getSelectedLabel
-              }}</el-tag>
+              }}
+              <TranslationOpenDataText type='userName' :openid="getSelectedLabel"></TranslationOpenDataText>
+            </el-tag>
               <el-tag type="info" :size="size" v-if="value.length > 1" class="narrow" style="margin: 0;">+ {{
                 value.length - 1 }}</el-tag>
             </template>
@@ -295,7 +299,7 @@ export default {
       }
 
       this.$emit('input', value);
-      this.$emit('change', value);
+      this.$emit('change', value, this.getSelectedLabel);
     },
   },
   mounted() {

+ 26 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -44,12 +44,14 @@
                     </div>
 
                     <select-project v-model="chartProjectId" :size="'small'" :placeholder="'请选择项目'" clearable
-                        v-if="singleChoiceType == '项目' || singleChoiceType == '设备' || singleChoiceType == namess"></select-project>
-                    <select-personnel v-model="chartUserId" v-if="singleChoiceType == '人员'"></select-personnel>
+                        v-if="singleChoiceType == '项目' || singleChoiceType == '设备' || singleChoiceType == namess"
+                        @change="filterConditionSwitching"></select-project>
+                    <select-personnel v-model="chartUserId" v-if="singleChoiceType == '人员'"
+                        @change="filterPersonnel"></select-personnel>
                 </el-col>
                 <el-col :span="2" style="display: flex;justify-content: flex-end;">
-                    <el-button @click="exportTheCustomListFlg" size="small"
-                        :loading="theCustomListFlgBtnLoading" v-if="theCustomListFlg">报表导</el-button>
+                    <el-button @click="exportTheCustomListFlg" size="small" :loading="theCustomListFlgBtnLoading"
+                        v-if="theCustomListFlg">报表导</el-button>
                     <el-button @click="showExportDialog" size="small" v-else>报表导出</el-button>
                 </el-col>
             </el-row>
@@ -92,7 +94,7 @@ import selectProject from "../../components/selectProject.vue";
 import selectPersonnel from "../../components/selectPersonnel.vue";
 import EchartsEchar from "../../components/echartsEchar.vue"
 import costReportExport from "./costReportExport.vue";
-import { barChartOptions } from "./costData";
+import { barChartOptions } from "./project";
 export default {
     components: {
         selectProject,
@@ -143,6 +145,24 @@ export default {
     },
 
     methods: {
+        filterPersonnel(id, name) {
+            this.pageIndex = 1
+            if (this.chartUserId) {
+                let arrList = JSON.parse(JSON.stringify(this.personnelAllPlly))
+                const arr = arrList.list.filter(item => item.name == name)
+                arrList.list = arr
+                this.allListData = arrList
+                if (this.user.userNameNeedTranslate === 1) {
+                    const dealWithList = arr.map(item => ({
+                        type: item.type,
+                        id: item.name
+                    }));
+                    this.dealWithTranslationPlone(dealWithList);
+                } else {
+                    this.initialChartData();
+                }
+            }
+        },
         async exportTheCustomListFlg() {
             this.theCustomListFlgBtnLoading = true;
             try {
@@ -959,7 +979,7 @@ export default {
 
             const { query } = this.$route;
             const today = this.dayjs();
-            
+
             if (fixMonthcost === 0) {
                 this.chartDate = query.startDate
                     ? [query.startDate, query.endDate]

+ 0 - 29
fhKeeper/formulahousekeeper/timesheet/src/views/project/costData.js

@@ -1,29 +0,0 @@
-/**
- * 柱状图图表数据
- * 初始化数据,使用时使用 解构赋值:如:xxx.xAxis = { ...xxx.xAxis, data: xxxxx }
- */
-export const barChartOptions = {
-  grid: {
-    top: "10%", // 上间距
-    right: "5%", // 右间距
-    bottom: "10%", // 下间距
-    left: "5%", // 左间距
-  },
-  xAxis: {
-    type: "category",
-    data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
-    axisLabel: {
-      interval: 0,
-      rotate: 20,
-    },
-  },
-  yAxis: {
-    type: "value",
-  },
-  series: [
-    {
-      data: [120, 200, 150, 80, 70, 110, 130],
-      type: "bar",
-    },
-  ],
-};

+ 45 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/project.js

@@ -0,0 +1,45 @@
+/**
+ * 柱状图图表数据
+ * 初始化数据,使用时使用 解构赋值:如:xxx.xAxis = { ...xxx.xAxis, data: xxxxx }
+ */
+export const barChartOptions = {
+  grid: {
+    top: "10%", // 上间距
+    right: "5%", // 右间距
+    bottom: "10%", // 下间距
+    left: "5%", // 左间距
+  },
+  xAxis: {
+    type: "category",
+    data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
+    axisLabel: {
+      interval: 0,
+      rotate: 20,
+    },
+  },
+  yAxis: {
+    type: "value",
+  },
+  series: [
+    {
+      data: [120, 200, 150, 80, 70, 110, 130],
+      type: "bar",
+    },
+  ],
+};
+
+/**
+ * summary.vue 文件
+ * 项目概览表数据
+ */
+
+export const summaryOverviewList = [
+  { label: "全部", filed: 'total', style: 'color: black;' },
+  { label: "已完成", filed: 'finishCount', style: 'color: green;' },
+  { label: "未完成", filed: 'unfinishCount', style: 'color: blue;' },
+  { label: "已逾期", filed: 'timeupCount', style: 'color: red;' },
+  { label: "待认领", filed: 'unassignCount', style: 'color: orange;' },
+  { label: "今日到期", filed: 'todayTimeupCount', style: 'color: pink;' },
+  { label: "预期完成", filed: 'timeupFinishCount', style: 'color: gray;' },
+  { label: "时间待定", filed: 'timeunsetCount', style: 'color: black;' },
+]