zhaowei
2024-12-13 fb1e6ab905adea16f680d4eb5ead8d0d517777d9
新增OEE页面
已添加2个文件
已修改3个文件
421 ■■■■■ 文件已修改
src/views/mdc/base/OEEAnalysis.vue 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue 294 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingList.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/OEEAnalysis.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,82 @@
<template>
  <div style="width: 100%; height: 100%;">
    <a-card :bordered="false">
      <a-row type="flex" :gutter="16">
        <a-col :md="5">
          <a-tabs :activeKey="activeKey" @change="tabChange">
            <a-tab-pane key="1" tab="车间层级" force-render>
              <base-tree @getCurrSelected="changeSelectionNode"></base-tree>
            </a-tab-pane>
            <a-tab-pane v-if="isDepartType == 0" key="2" tab="部门层级">,
              <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree>
            </a-tab-pane>
          </a-tabs>
        </a-col>
        <a-col :md="19">
          <OEEAnalysisList :nodePeople='selectPeople' :nodeTree='selectEquipment' :Type="selectTypeTree"/>
        </a-col>
      </a-row>
    </a-card>
  </div>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import BaseTree from '../common/BaseTree'
  import OEEAnalysisList from './modules/OEEAnalysis/OEEAnalysisList'
  import DepartTree from './modules/DepartList/DepartListTree/DepartTree'
  import { mapActions } from 'vuex'
  export default {
    name: 'OEEAnalysis',
    components: {
      BaseTree,
      DepartTree,
      OEEAnalysisList
    },
    data() {
      return {
        activeKey: '1',
        selectEquipmentId: '',
        selectEquipment: {},
        selectPeople: {},
        selectTypeTree: '',
        isDepartType: ''
      }
    },
    created() {
      this.queryTreeData()
    },
    methods: {
      ...mapActions(['QueryDepartTree']),
      queryTreeData() {
        this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
              message: '消息',
              description: res.message
            })
          }
        }).finally(() => {
        })
      },
      tabChange(val) {
        this.activeKey = val
        this.selectTypeTree = val
      },
      changeSelectionNode(val) {
        this.selectEquipment = val
        this.selectTypeTree = '1'
      },
      changeSelectionNodedd(val) {
        this.selectPeople = val
        this.selectTypeTree = '2'
      }
    }
  }
</script>
src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue
@@ -6,7 +6,7 @@
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId" allowClear/>
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -21,10 +21,10 @@
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
@@ -34,7 +34,7 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="importTemplate('计划停机模板')">导入模板</a-button>
      <a-button type="primary" icon="download" @click="importTemplate('计划停机管理')">导入模板</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('计划停机管理')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
                @change="handleImportExcel">
@@ -58,7 +58,6 @@
    <!-- table区域-begin -->
    <div id="DeviceList" style="flex: 1;overflow: hidden">
      <a-table
        id="planClose"
        ref="table"
        size="middle"
        :scroll="{x:'max-content',y:scrollY}"
@@ -188,8 +187,6 @@
          exportXlsUrl: '/mdc/mdcPlanClose/exportXls',
          importExcelUrl: 'mdc/mdcPlanClose/importExcel'
        },
        dictOptions: {},
        superFieldList: []
      }
    },
    watch: {
@@ -236,8 +233,8 @@
      },
      importTemplate(fileName) {
        var a = document.createElement('a')
        a.href = '/static/计划停机管理.xls'
        a.download = '计划停机管理.xls'
        a.href = `/static/${fileName}.xls`
        a.download = `${fileName}.xls`
        a.style.display = 'none'
        document.body.appendChild(a)
        a.click()
src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue
@@ -6,7 +6,7 @@
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId" allowClear/>
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -21,10 +21,10 @@
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
@@ -34,7 +34,7 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="importTemplate('非计划停机模板')">导入模板</a-button>
      <a-button type="primary" icon="download" @click="importTemplate('非计划停机管理')">导入模板</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('非计划停机管理')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
                @change="handleImportExcel">
@@ -58,7 +58,6 @@
    <!-- table区域-begin -->
    <div id="DeviceList" style="flex: 1;overflow: hidden">
      <a-table
        id="planClose"
        ref="table"
        size="middle"
        :scroll="{x:'max-content',y:scrollY}"
@@ -188,8 +187,6 @@
          exportXlsUrl: '/mdc/mdcPlanClose/exportXls',
          importExcelUrl: 'mdc/mdcPlanClose/importExcel'
        },
        dictOptions: {},
        superFieldList: []
      }
    },
    watch: {
@@ -236,8 +233,8 @@
      },
      importTemplate(fileName) {
        var a = document.createElement('a')
        a.href = '/static/非计划停机管理.xls'
        a.download = '非计划停机管理.xls'
        a.href = `/static/${fileName}.xls`
        a.download = `${fileName}.xls`
        a.style.display = 'none'
        document.body.appendChild(a)
        a.click()
src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,294 @@
<template>
  <div class="device_list">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="日期">
              <a-range-picker v-model="dates" style="width: 100%" @change="dateParamChange"></a-range-picker>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button type="primary" icon="download" @click="handleExportXls('OEE')">导出</a-button>
    </div>
    <!-- table区域-begin -->
    <div id="DeviceList" style="flex: 1;overflow: hidden">
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:'max-content',y:scrollY}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading">
        <template slot="percent" slot-scope="text">
          {{text+'%'}}
        </template>
      </a-table>
    </div>
  </div>
</template>
<script>
  import moment from 'moment'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  export default {
    name: 'OEEAnalysisList',
    mixins: [JeecgListMixin],
    components: {},
    props: { nodeTree: '', Type: '', nodePeople: '' },
    data() {
      return {
        description: 'OEE页面',
        disableMixinCreated: true,
        /* åˆ†é¡µå‚æ•° */
        ipagination: {
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['30', '50', '100'],
          showTotal: (total, range) => {
            return range[0] + '-' + range[1] + ' å…±' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        dates: [moment().subtract(1, 'day'), moment()],
        queryParam: {},
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '设备编号',
            align: 'center',
            dataIndex: 'equipmentId',
            width: 230
          },
          {
            title: '日期',
            align: 'center',
            dataIndex: 'theDate',
            width: 150
          },
          {
            title: '日历工作时间(min)',
            align: 'center',
            dataIndex: 'calendarLong',
            width: 150
          },
          {
            title: '计划停机时间(min)',
            align: 'center',
            dataIndex: 'planCloseLong',
            width: 150
          },
          {
            title: '负荷时间(min)',
            align: 'center',
            dataIndex: 'loadLong',
            width: 150
          },
          {
            title: '非计划停机时间(min)',
            align: 'center',
            dataIndex: 'noplanCloseLong',
            width: 150
          },
          {
            title: '开动时间(min)',
            align: 'center',
            dataIndex: 'actuateLong',
            width: 150
          },
          {
            title: '时间开动率',
            align: 'center',
            dataIndex: 'timeActuationRate',
            width: 150,
            scopedSlots: { customRender: 'percent' }
          },
          {
            title: '有效运行时间(min)',
            align: 'center',
            dataIndex: 'effectiveRunLong',
            width: 150
          },
          {
            title: '性能开动率',
            align: 'center',
            dataIndex: 'performanceRate',
            width: 150,
            scopedSlots: { customRender: 'percent' }
          },
          {
            title: '加工零件数量',
            align: 'center',
            dataIndex: 'processCount',
            width: 150
          },
          {
            title: '合格零件数量',
            align: 'center',
            dataIndex: 'passCount',
            width: 150
          },
          {
            title: '一次合格率',
            align: 'center',
            dataIndex: 'passRate',
            width: 150,
            scopedSlots: { customRender: 'percent' }
          },
          {
            title: 'OEE',
            align: 'center',
            dataIndex: 'oee',
            width: 150,
            scopedSlots: { customRender: 'percent' }
          }
        ],
        scrollY: 465,
        url: {
          list: '/mdc/mdcOeeInfo/list',
          exportXlsUrl: '/mdc/mdcOeeInfo/exportXls'
        }
      }
    },
    watch: {
      Type(valmath) {
        this.dataList = []
        this.queryParam.typeTree = valmath
        // console.log(this.queryParam.typeTree)
      },
      nodeTree(val) { //监听currSelected å˜åŒ–,将变化后的数值传递给 getCurrSelected äº‹ä»¶
        if (JSON.stringify(val) != '{}') {
          if (val.equipmentId) {
            this.queryParam.parentId = ''
            this.queryParam.equipmentId = val.equipmentId
          } else {
            this.queryParam.parentId = val.key
            this.queryParam.equipmentId = ''
          }
          this.searchQuery()
        }
      },
      nodePeople(val) {
        if (JSON.stringify(val) != '{}') {
          if (val.equipmentId) {
            this.queryParam.parentId = ''
            this.queryParam.equipmentId = val.equipmentId
          } else {
            this.queryParam.parentId = val.key
            this.queryParam.equipmentId = ''
          }
          this.searchQuery()
        }
      }
    },
    methods: {
      dateParamChange(v1, v2) {
        this.queryParam.startTime = v2[0]
        this.queryParam.endTime = v2[1]
        this.dates = [v1[0], v1[1]]
      },
      searchReset() {
        this.dates = [moment().subtract(1, 'day'), moment()]
        this.queryParam = {
          startTime: this.dates[0].format('YYYY-MM-DD'),
          endTime: this.dates[1].format('YYYY-MM-DD')
        }
        this.loadData(1)
      },
      /**
       * å½“浏览器可视窗口尺寸发生改变时触发
       */
      handleWindowResize() {
        const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0, -2)
        const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2)
        this.scrollY = boxHeight - tableHeadHeight - 50
      }
    },
    created() {
      this.queryParam.startTime = this.dates[0].format('YYYY-MM-DD')
      this.queryParam.endTime = this.dates[1].format('YYYY-MM-DD')
      this.loadData()
    },
    mounted() {
      window.addEventListener('resize', this.handleWindowResize)
      this.handleWindowResize()
    },
    beforeDestroy() {
      window.removeEventListener('resize', this.handleWindowResize)
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
  .device_list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  @media screen and (min-width: 1920px) {
    .device_list {
      height: 811px !important;
    }
  }
  @media screen and (min-width: 1680px) and (max-width: 1920px) {
    .device_list {
      height: 811px !important;
    }
  }
  @media screen and (min-width: 1400px) and (max-width: 1680px) {
    .device_list {
      height: 663px !important;
    }
  }
  @media screen and (min-width: 1280px) and (max-width: 1400px) {
    .device_list {
      height: 564px !important;
    }
  }
  @media screen and (max-width: 1280px) {
    .device_list {
      height: 564px !important;
    }
  }
</style>
src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingList.vue
@@ -6,7 +6,7 @@
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId" allowClear/>
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -20,10 +20,10 @@
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
@@ -56,7 +56,6 @@
    <!-- table区域-begin -->
    <div id="DeviceList" style="flex: 1;overflow: hidden">
      <a-table
        id="planClose"
        ref="table"
        size="middle"
        :scroll="{x:'max-content',y:scrollY}"
@@ -196,7 +195,7 @@
          deleteBatch: '/mdc/mdcPartProcessInfo/deleteBatch',
          exportXlsUrl: '/mdc/mdcPartProcessInfo/exportXls',
          importExcelUrl: '/mdc/mdcPartProcessInfo/importExcel'
        },
        }
      }
    },
    watch: {