licp
2024-12-19 908b78f0a04bbe5787589c6904e2cb243ca3bba0
完成站点工时统计
已修改7个文件
已添加19个文件
369 ■■■■■ 文件已修改
dist.zip 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b4-daily-business-statistics.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b4-inspection-item-statistics.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b4-site-hours-statistics.vue 335 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/index-index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/timer.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/bg-紫色.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/bg-绿色.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/bg-蓝色.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/bg-黄色.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/冲击.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/功率容量.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/振动.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/淋雨.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/电路试验.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/盐雾.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/老化.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/跌落.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/近场.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/远场.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/静压.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/风载.png 补丁 | 查看 | 原始文档 | blame | 历史
static/img/site/高低温.png 补丁 | 查看 | 原始文档 | blame | 历史
static/js/menu.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dist.zip
Binary files differ
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", //查询资质明细列表
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">
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">
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>
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;
src/view/index.vue
@@ -394,7 +394,7 @@
      </span>
    </el-dialog>
    <notice ref="notice" @goNoticeDetail="checkForUnreadData()" />
    <timer></timer>
    <!-- <timer></timer> -->
    </div>
</template>
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
static/img/site/bg-×ÏÉ«.png
static/img/site/bg-ÂÌÉ«.png
static/img/site/bg-À¶É«.png
static/img/site/bg-»ÆÉ«.png
static/img/site/³å»÷.png
static/img/site/¹¦ÂÊÈÝÁ¿.png
static/img/site/Õñ¶¯.png
static/img/site/ÁÜÓê.png
static/img/site/µç·ÊÔÑé.png
static/img/site/ÑÎÎí.png
static/img/site/ÀÏ»¯.png
static/img/site/µøÂä.png
static/img/site/½ü³¡.png
static/img/site/Ô¶³¡.png
static/img/site/¾²Ñ¹.png
static/img/site/·çÔØ.png
static/img/site/¸ßµÍÎÂ.png
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",