From 908b78f0a04bbe5787589c6904e2cb243ca3bba0 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 19 十二月 2024 10:03:20 +0800
Subject: [PATCH] 完成站点工时统计

---
 static/img/site/bg-蓝色.png                             |    0 
 static/img/site/近场.png                                |    0 
 dist.zip                                              |    0 
 src/components/view/b4-daily-business-statistics.vue  |    6 
 static/img/site/高低温.png                               |    0 
 static/img/site/功率容量.png                              |    0 
 static/img/site/冲击.png                                |    0 
 src/view/index.vue                                    |    2 
 static/img/site/远场.png                                |    0 
 static/img/site/盐雾.png                                |    0 
 static/img/site/静压.png                                |    0 
 src/components/view/b4-inspection-item-statistics.vue |    6 
 static/img/site/电路试验.png                              |    0 
 static/img/site/bg-黄色.png                             |    0 
 src/components/view/b4-site-hours-statistics.vue      |  335 +++++++++++++++++++++++++++++++++++++++++++++++
 static/img/site/淋雨.png                                |    0 
 static/img/site/振动.png                                |    0 
 static/img/site/跌落.png                                |    0 
 static/img/site/老化.png                                |    0 
 src/view/timer.vue                                    |    8 +
 static/js/menu.js                                     |    5 
 src/assets/api/controller.js                          |    1 
 static/img/site/bg-绿色.png                             |    0 
 static/img/site/风载.png                                |    0 
 static/img/site/bg-紫色.png                             |    0 
 src/components/view/index-index.vue                   |    6 
 26 files changed, 359 insertions(+), 10 deletions(-)

diff --git a/dist.zip b/dist.zip
new file mode 100644
index 0000000..815b44d
--- /dev/null
+++ b/dist.zip
Binary files differ
diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index aeec3b6..d81f442 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -321,6 +321,7 @@
   testProductByDay: "/report/testProductByDay", //棣栨娴嬮」鐩粺璁�
   manHourByStation: "/report/manHourByStation", //棣栭〉宸ユ椂缁熻
   manHourByPerson: "/report/manHourByPerson", //棣栭〉宸ユ椂缁熻
+  timeByStation: "/report/timeByStation", //绔欑偣宸ユ椂缁熻
 }
 const certification = {
   getCertificationDetail: "/certification/getCertificationDetail", //鏌ヨ璧勮川鏄庣粏鍒楄〃
diff --git a/src/components/view/b4-daily-business-statistics.vue b/src/components/view/b4-daily-business-statistics.vue
index 72f33f0..19673d5 100644
--- a/src/components/view/b4-daily-business-statistics.vue
+++ b/src/components/view/b4-daily-business-statistics.vue
@@ -10,18 +10,18 @@
       <el-date-picker
         v-model="time.week"
         type="week"
-        format="yyyy-MM-dd"
+        format="yyyy 绗� WW 鍛�"
         placeholder="閫夋嫨鍛�" size="small" v-if="type=='鍛�'" @change="m=>changeTime(type,m)">
       </el-date-picker>
       <el-date-picker
         v-model="time.month"
         type="month"
-        placeholder="閫夋嫨鏈�" format="yyyy-MM-dd" size="small" v-if="type=='鏈�'" @change="m=>changeTime(type,m)">
+        placeholder="閫夋嫨鏈�" size="small" v-if="type=='鏈�'" @change="m=>changeTime(type,m)">
       </el-date-picker>
       <el-date-picker
         v-model="time.year"
         type="year"
-        placeholder="閫夋嫨骞�" format="yyyy-MM-dd" size="small" v-if="type=='骞�'" @change="m=>changeTime(type,m)">
+        placeholder="閫夋嫨骞�" size="small" v-if="type=='骞�'" @change="m=>changeTime(type,m)">
       </el-date-picker>
     </div>
     <el-row :gutter="20">
diff --git a/src/components/view/b4-inspection-item-statistics.vue b/src/components/view/b4-inspection-item-statistics.vue
index 3c0e4a5..901b544 100644
--- a/src/components/view/b4-inspection-item-statistics.vue
+++ b/src/components/view/b4-inspection-item-statistics.vue
@@ -10,18 +10,18 @@
         <el-date-picker
           v-model="time.week"
           type="week"
-          format="yyyy-MM-dd"
+          format="yyyy 绗� WW 鍛�"
           placeholder="閫夋嫨鍛�" size="small" v-if="type=='鍛�'" @change="m=>changeTime(type,m)">
         </el-date-picker>
         <el-date-picker
           v-model="time.month"
           type="month"
-          placeholder="閫夋嫨鏈�" format="yyyy-MM-dd" size="small" v-if="type=='鏈�'" @change="m=>changeTime(type,m)">
+          placeholder="閫夋嫨鏈�" size="small" v-if="type=='鏈�'" @change="m=>changeTime(type,m)">
         </el-date-picker>
         <el-date-picker
           v-model="time.year"
           type="year"
-          placeholder="閫夋嫨骞�" format="yyyy-MM-dd" size="small" v-if="type=='骞�'" @change="m=>changeTime(type,m)">
+          placeholder="閫夋嫨骞�" size="small" v-if="type=='骞�'" @change="m=>changeTime(type,m)">
         </el-date-picker>
       </div>
       <el-row :gutter="20">
diff --git a/src/components/view/b4-site-hours-statistics.vue b/src/components/view/b4-site-hours-statistics.vue
new file mode 100644
index 0000000..f14c36f
--- /dev/null
+++ b/src/components/view/b4-site-hours-statistics.vue
@@ -0,0 +1,335 @@
+<template>
+  <div>
+    <div class="title">
+      <span>绔欑偣宸ユ椂缁熻</span>
+      <el-date-picker
+        v-model="month"
+        type="month"
+        placeholder="閫夋嫨鏈�" style="margin-right: 20px;" @change="changeTime">
+      </el-date-picker>
+    </div>
+    <el-row :gutter="20" class="card" v-loading="loading">
+      <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" v-for="(item,index) in siteList" :key="index">
+        <div class="card-item" :style="`background: url(../../../static/img/site/bg-${item.bg}.png) no-repeat;background-size:100% 100%;margin-bottom:16px`">
+          <h3 :style="`color:${item.color};font-weight: 500;font-size: 28px;`" class="card-item-title">
+            <img :src="`../../../static/img/site/${item.name}.png`" alt="" style="width: 30px;height: 30px;margin-right: 10px;">
+            <span>{{ item.name }}绔欑偣</span>
+          </h3>
+          <el-table
+            :data="item.tableData"
+            style="width: 100%;margin-bottom: 14px;" height="410px" size="mini"border v-loading="item.loading">
+            <el-table-column
+              type="index"
+              label="搴忓彿"
+              width="60">
+              <template #default="scope">
+              <!-- 璁$畻搴忓彿 -->
+              {{ (item.page.current - 1) * item.page.size + scope.$index + 1 }}
+            </template>
+            </el-table-column>
+            <el-table-column
+              prop="sampleName"
+              label="鏍峰搧鍚嶇О"
+              width="90">
+              <template #default="scope">
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  :content="scope.row.sampleName"
+                  placement="top"
+                >
+                  <div class="single-line-ellipsis">{{ scope.row.sampleName }}</div>
+                </el-tooltip>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="sampleCode"
+              label="鏍峰搧缂栧彿">
+              <template #default="scope">
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  :content="scope.row.sampleCode"
+                  placement="top"
+                >
+                  <div class="single-line-ellipsis">{{ scope.row.sampleCode }}</div>
+                </el-tooltip>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="num"
+              label="娆℃暟" width="70">
+            </el-table-column>
+            <el-table-column
+              prop="hours"
+              label="妫�楠屾椂闀�" width="100">
+            </el-table-column>
+          </el-table>
+          <el-pagination
+            background
+            :page-size="item.page.size"
+            :current-page="item.page.current"
+            layout="prev, pager, next"
+            :total="item.page.total" small style="text-align: right;" @current-change="m=>changePage(m,item)">
+          </el-pagination>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  data(){
+    return {
+      month:'',
+      siteList:[
+        {
+          name:'鐢佃矾璇曢獙',
+          color:'#FABE63',
+          bg:'榛勮壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'杩滃満',
+          color:'#6F83FF',
+          bg:'绱壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'杩戝満',
+          color:'#53B3F9',
+          bg:'钃濊壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'鎸姩',
+          color:'#6F83FF',
+          bg:'绱壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'娣嬮洦',
+          color:'#53B3F9',
+          bg:'钃濊壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'楂樹綆娓�',
+          color:'#80CD62',
+          bg:'缁胯壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'鐩愰浘',
+          color:'#6F83FF',
+          bg:'绱壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'椋庤浇',
+          color:'#53B3F9',
+          bg:'钃濊壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'璺岃惤',
+          color:'#FABE63',
+          bg:'榛勮壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'鑰佸寲',
+          color:'#80CD62',
+          bg:'缁胯壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'闈欏帇',
+          color:'#53B3F9',
+          bg:'钃濊壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'鍐插嚮',
+          color:'#6F83FF',
+          bg:'绱壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+        {
+          name:'鍔熺巼瀹归噺',
+          color:'#80CD62',
+          bg:'缁胯壊',
+          tableData:[],
+          page:{
+            current: 1,
+            size: 9,
+            total:0
+          },
+          loading:false,
+        },
+      ],
+      startTime:null,
+      endTime:null,
+      loading:false,
+    }
+  },
+  mounted(){
+    const year = new Date().getFullYear();
+    const month = new Date().getMonth();
+    // 璁剧疆璧峰鏃ユ湡鍜岀粨鏉熸棩鏈�
+    this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 鏈堝垵
+    this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 鏈堟湯
+    this.init()
+  },
+  methods:{
+    init(){
+      this.loading = true
+      this.$axios.post(this.$api.report.timeByStation, {
+        startTime:this.startTime,
+        endTime:this.endTime,
+        current: 1,
+        size: 9
+      }).then(res => {
+        this.loading = false
+        if (res.code === 201) {
+          return
+        }
+        for(let m in res.data){
+          this.siteList.forEach(item=>{
+            if(item.name==m){
+              item.page.total = res.data[m].total
+              item.tableData = res.data[m].records
+            }
+          })
+        }
+      })
+    },
+    changePage(current,row){
+      row.page.current = current
+      row.loading = true
+      this.$axios.post(this.$api.report.timeByStation, {
+        startTime:this.startTime,
+        endTime:this.endTime,
+        current: current,
+        size: row.page.size,
+        sonLaboratory:row.name
+      }).then(res => {
+        row.loading = false
+        if (res.code === 201) {
+          return
+        }
+        row.tableData = res.data[row.name].records
+        row.page.total = res.data[row.name].total
+      })
+    },
+    changeTime(){
+      const year = new Date(this.month).getFullYear();
+      const month = new Date(this.month).getMonth();
+      // 璁剧疆璧峰鏃ユ湡鍜岀粨鏉熸棩鏈�
+      this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 鏈堝垵
+      this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 鏈堟湯
+      this.siteList.forEach(item=>{
+        item.page.current = 1
+      })
+      this.init()
+    }
+  }
+}
+</script>
+
+<style scoped>
+.title{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 16px;
+}
+.card{
+  height: calc(100vh - 156px);
+  overflow-y: auto;
+}
+.card-item{
+  height: 540px;
+  box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.05);
+  padding: 20px 10px 10px 20px;
+  box-sizing: border-box;
+}
+.card-item-title{
+  display: flex;
+  align-items: center;
+  margin-bottom: 20px;
+}
+</style>
diff --git a/src/components/view/index-index.vue b/src/components/view/index-index.vue
index 62edac6..bfe5816 100644
--- a/src/components/view/index-index.vue
+++ b/src/components/view/index-index.vue
@@ -372,18 +372,18 @@
               <el-date-picker
                 v-model="time.week"
                 type="week"
-                format="yyyy-MM-dd"
+                format="yyyy 绗� WW 鍛�"
                 placeholder="閫夋嫨鍛�" size="mini" v-if="type=='鍛�'" @change="m=>changeTime(type,m)" style="width: 130px;">
               </el-date-picker>
               <el-date-picker
                 v-model="time.month"
                 type="month"
-                placeholder="閫夋嫨鏈�" format="yyyy-MM-dd" size="mini" v-if="type=='鏈�'" @change="m=>changeTime(type,m)" style="width: 130px;">
+                placeholder="閫夋嫨鏈�" size="mini" v-if="type=='鏈�'" @change="m=>changeTime(type,m)" style="width: 130px;">
               </el-date-picker>
               <el-date-picker
                 v-model="time.year"
                 type="year"
-                placeholder="閫夋嫨骞�" format="yyyy-MM-dd" size="mini" v-if="type=='骞�'" @change="m=>changeTime(type,m)" style="width: 130px;">
+                placeholder="閫夋嫨骞�" size="mini" v-if="type=='骞�'" @change="m=>changeTime(type,m)" style="width: 130px;">
               </el-date-picker>
             </div>
             <!-- <span style="cursor: pointer;font-size: 12px;
diff --git a/src/view/index.vue b/src/view/index.vue
index 3716b4c..bf6e4d7 100644
--- a/src/view/index.vue
+++ b/src/view/index.vue
@@ -394,7 +394,7 @@
       </span>
     </el-dialog>
     <notice ref="notice" @goNoticeDetail="checkForUnreadData()" />
-    <timer></timer>
+    <!-- <timer></timer> -->
 	</div>
 </template>
 
diff --git a/src/view/timer.vue b/src/view/timer.vue
index a34b8f9..89650b5 100644
--- a/src/view/timer.vue
+++ b/src/view/timer.vue
@@ -1,3 +1,11 @@
+<!--
+ * @Author: licp lichunping@guanfang.com.cn
+ * @Date: 2024-08-20 09:31:20
+ * @LastEditors: licp lichunping@guanfang.com.cn
+ * @LastEditTime: 2024-12-19 09:57:53
+ * @FilePath: \tx-lims-before\src\view\timer.vue
+ * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+-->
 <template>
   <div>
     <el-dialog
diff --git "a/static/img/site/bg-\347\264\253\350\211\262.png" "b/static/img/site/bg-\347\264\253\350\211\262.png"
new file mode 100644
index 0000000..5bdc87b
--- /dev/null
+++ "b/static/img/site/bg-\347\264\253\350\211\262.png"
Binary files differ
diff --git "a/static/img/site/bg-\347\273\277\350\211\262.png" "b/static/img/site/bg-\347\273\277\350\211\262.png"
new file mode 100644
index 0000000..2483666
--- /dev/null
+++ "b/static/img/site/bg-\347\273\277\350\211\262.png"
Binary files differ
diff --git "a/static/img/site/bg-\350\223\235\350\211\262.png" "b/static/img/site/bg-\350\223\235\350\211\262.png"
new file mode 100644
index 0000000..f403223
--- /dev/null
+++ "b/static/img/site/bg-\350\223\235\350\211\262.png"
Binary files differ
diff --git "a/static/img/site/bg-\351\273\204\350\211\262.png" "b/static/img/site/bg-\351\273\204\350\211\262.png"
new file mode 100644
index 0000000..152ac63
--- /dev/null
+++ "b/static/img/site/bg-\351\273\204\350\211\262.png"
Binary files differ
diff --git "a/static/img/site/\345\206\262\345\207\273.png" "b/static/img/site/\345\206\262\345\207\273.png"
new file mode 100644
index 0000000..698411f
--- /dev/null
+++ "b/static/img/site/\345\206\262\345\207\273.png"
Binary files differ
diff --git "a/static/img/site/\345\212\237\347\216\207\345\256\271\351\207\217.png" "b/static/img/site/\345\212\237\347\216\207\345\256\271\351\207\217.png"
new file mode 100644
index 0000000..8226f60
--- /dev/null
+++ "b/static/img/site/\345\212\237\347\216\207\345\256\271\351\207\217.png"
Binary files differ
diff --git "a/static/img/site/\346\214\257\345\212\250.png" "b/static/img/site/\346\214\257\345\212\250.png"
new file mode 100644
index 0000000..3c29e6a
--- /dev/null
+++ "b/static/img/site/\346\214\257\345\212\250.png"
Binary files differ
diff --git "a/static/img/site/\346\267\213\351\233\250.png" "b/static/img/site/\346\267\213\351\233\250.png"
new file mode 100644
index 0000000..b458a8c
--- /dev/null
+++ "b/static/img/site/\346\267\213\351\233\250.png"
Binary files differ
diff --git "a/static/img/site/\347\224\265\350\267\257\350\257\225\351\252\214.png" "b/static/img/site/\347\224\265\350\267\257\350\257\225\351\252\214.png"
new file mode 100644
index 0000000..e9d5613
--- /dev/null
+++ "b/static/img/site/\347\224\265\350\267\257\350\257\225\351\252\214.png"
Binary files differ
diff --git "a/static/img/site/\347\233\220\351\233\276.png" "b/static/img/site/\347\233\220\351\233\276.png"
new file mode 100644
index 0000000..0bd26c6
--- /dev/null
+++ "b/static/img/site/\347\233\220\351\233\276.png"
Binary files differ
diff --git "a/static/img/site/\350\200\201\345\214\226.png" "b/static/img/site/\350\200\201\345\214\226.png"
new file mode 100644
index 0000000..d2ce3ff
--- /dev/null
+++ "b/static/img/site/\350\200\201\345\214\226.png"
Binary files differ
diff --git "a/static/img/site/\350\267\214\350\220\275.png" "b/static/img/site/\350\267\214\350\220\275.png"
new file mode 100644
index 0000000..0bcf923
--- /dev/null
+++ "b/static/img/site/\350\267\214\350\220\275.png"
Binary files differ
diff --git "a/static/img/site/\350\277\221\345\234\272.png" "b/static/img/site/\350\277\221\345\234\272.png"
new file mode 100644
index 0000000..da5855a
--- /dev/null
+++ "b/static/img/site/\350\277\221\345\234\272.png"
Binary files differ
diff --git "a/static/img/site/\350\277\234\345\234\272.png" "b/static/img/site/\350\277\234\345\234\272.png"
new file mode 100644
index 0000000..d09f82a
--- /dev/null
+++ "b/static/img/site/\350\277\234\345\234\272.png"
Binary files differ
diff --git "a/static/img/site/\351\235\231\345\216\213.png" "b/static/img/site/\351\235\231\345\216\213.png"
new file mode 100644
index 0000000..e05c367
--- /dev/null
+++ "b/static/img/site/\351\235\231\345\216\213.png"
Binary files differ
diff --git "a/static/img/site/\351\243\216\350\275\275.png" "b/static/img/site/\351\243\216\350\275\275.png"
new file mode 100644
index 0000000..fb1797f
--- /dev/null
+++ "b/static/img/site/\351\243\216\350\275\275.png"
Binary files differ
diff --git "a/static/img/site/\351\253\230\344\275\216\346\270\251.png" "b/static/img/site/\351\253\230\344\275\216\346\270\251.png"
new file mode 100644
index 0000000..c2f0f41
--- /dev/null
+++ "b/static/img/site/\351\253\230\344\275\216\346\270\251.png"
Binary files differ
diff --git a/static/js/menu.js b/static/js/menu.js
index 1a26e90..60d2bae 100644
--- a/static/js/menu.js
+++ b/static/js/menu.js
@@ -135,6 +135,11 @@
 			u: "b4-inspection-item-statistics",
 			p: "testProductByDay"
 		}, {
+			v: "绔欑偣宸ユ椂缁熻",
+			i: "font icon-erjidaohang",
+			u: "b4-site-hours-statistics",
+			p: "timeByStation"
+		}, {
 			v: "鏍峰搧缂洪櫡鎸囨暟",
 			i: "font icon-erjidaohang",
 			u: "b4-sample-defects",

--
Gitblit v1.9.3