1、MDC零件加工管理和OEE页面开发100%
2、DNC结构树取消搜索框侧边下拉菜单改为树组件空白处右键菜单
已添加9个文件
已修改10个文件
1458 ■■■■■ 文件已修改
src/api/mdc.js 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/DeviceStructureBaseContextMenu.vue 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/UseDeviceCustomTypeEquipmentTableList.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureBaseContextMenu.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/ImportFileModal.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/OEEAnalysis.vue 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/PartsMatchingManagement.vue 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OEEAnalysis/ComputeOeeModal.vue 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue 304 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingForm.vue 191 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingList.vue 321 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingModal.vue 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mdc.js
@@ -20,16 +20,6 @@
  addWorkshopApi: params => postAction('/mdc/mdcWorkshopInfo/add', params),
  // ç¼–辑车间信息
  editWorkshopApi: params => putAction('/mdc/mdcWorkshopInfo/edit', params),
  // åˆ é™¤å•个车间信息
  deleteSingleWorkshopApi: id => deleteAction('/mdc/mdcWorkshopInfo/delete', { id }),
  // æ‰¹é‡åˆ é™¤è½¦é—´ä¿¡æ¯
  deleteBatchWorkshopApi: ids => deleteAction('/mdc/mdcWorkshopInfo/deleteBatch', { ids }),
  // æ–°å¢žå¤§å±è½¦é—´å’Œè®¾å¤‡å…³ç³»
  addDeviceInWorkshopApi: params => postAction('/mdc/mdcWorkshopInfo/addWorkshopEquipment', params),
  // åˆ é™¤å•个大屏车间和设备关系
  deleteSingleDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipment', params),
  // æ‰¹é‡åˆ é™¤å¤§å±è½¦é—´å’Œè®¾å¤‡å…³ç³»
  deleteBatchDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch', params),
  // -------------------------------------设备参数阈值管理页面--------------------------------------------
  // æ ¹æ®é©±åŠ¨ç±»åž‹èŽ·å–å‚æ•°
  getParamListByDriveTypeApi: controlSystemType => getAction(`/mdc/mdcDriveTypeParamConfig/getDriveParamOptionsByType?controlSystemType=${controlSystemType}`),
@@ -37,8 +27,7 @@
  addParamThresholdApi: params => postAction('/mdc/mdcEquipmentThreshold/add', params),
  // ç¼–辑设备参数阈值
  editParamThresholdApi: params => postAction('/mdc/mdcEquipmentThreshold/edit', params),
  // åˆ é™¤è®¾å¤‡å‚数阈值
  deleteParamThresholdApi: id => deleteAction('/mdc/mdcEquipmentThreshold/delete', { id }),
  // åˆ é™¤è®¾å¤‡å‚数阈值
  deleteBatchParamThresholdApi: ids => deleteAction('/mdc/mdcEquipmentThreshold/deleteBatch', { ids })
  // -------------------------------------OEE页面--------------------------------------------
  // è®¡ç®—OEE
  computeOeeApi: params => postAction('/mdc/mdcOeeInfo/computeOee', params),
}
src/views/dnc/base/modules/DeviceStructure/DeviceStructureBaseContextMenu.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
<template>
  <a-menu :style="menuStyle" @click="menuItemClick" v-if="menuVisible" mode="vertical">
    <template v-for="menuItem in baseContextMenuList">
      <a-menu-item :key="menuItem.code" v-has="menuItem.code" v-if="menuItem.isHasPermission">
        <a-icon :type="menuItem.icon"/>
        {{ menuItem.label }}
      </a-menu-item>
      <a-menu-item :key="menuItem.code" v-else>
        <a-icon :type="menuItem.icon"/>
        {{ menuItem.label }}
      </a-menu-item>
    </template>
  </a-menu>
</template>
<script>
export default {
  name: 'DeviceStructureBaseContextMenu',
  components: {},
  props: {
    tableRowInfo: {
      type: Object
    }
  },
  data() {
    return {
      menuVisible: false,
      menuStyle: {
        position: 'fixed',
        top: 0,
        left: 0,
        border: '1px solid #eee',
        boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)',
        zIndex: 999
      },
      currentMenuLevel: '',
      baseContextMenuList: [
        { label: '刷新', code: 'tree_reload', icon: 'reload', isHasPermission: false, isCommonMethod: false },
      ]
    }
  },
  methods: {
    menuItemClick({ key }) {
      console.log('menuKey', key)
      const isCommonMethod = this.baseContextMenuList.find(item => item.code === key).isCommonMethod
      const modalTitle = this.baseContextMenuList.find(item => item.code === key).label
      const menuKeyArray = key.split('_')
      // product_add => handleAdd è§¦å‘对应组件事件
      let methodName
      // åˆ¤æ–­æ˜¯å¦ä¸ºå…¬å…±æ–¹æ³•,如果为公共方法则截取专有属性product/component/part/process等字段
      if (isCommonMethod) {
        methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).slice(1).join('')
      } else {
        methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('')
      }
      this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle })
    }
  }
}
</script>
<style scoped>
/deep/ .ant-menu-item {
  height: 32px;
  line-height: 32px;
}
</style>
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue
@@ -1,24 +1,24 @@
<template>
  <a-card class="tree_con" :loading="cardLoading" :bordered="false" @contextmenu.native="e=>e.preventDefault()">
  <a-card class="tree_con" :loading="cardLoading" :bordered="false" @contextmenu.native.stop="openBaseContextMenu">
    <a-spin :spinning="loading">
      <div style="display: flex;flex-direction: column;height: 100%">
        <div style="display: flex">
          <a-input placeholder="输入关键字进行搜索" allowClear v-model="searchInput"
                   @change="handleSearchInputChange"/>
          <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px">
            <a-menu slot="overlay">
              <a-menu-item key="1" @click="expandedKeys = allTreeKeys">展开所有</a-menu-item>
              <a-menu-item key="2" @click="expandedKeys = ['-1']">合并所有</a-menu-item>
              <a-menu-item key="3" @click="getTreeDataByApi">刷新</a-menu-item>
            </a-menu>
            <a-button>
              <a-icon type="bars"/>
            </a-button>
          </a-dropdown>
          <!--          <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px">-->
          <!--            <a-menu slot="overlay">-->
          <!--              <a-menu-item key="1" @click="expandedKeys = allTreeKeys">展开所有</a-menu-item>-->
          <!--              <a-menu-item key="2" @click="expandedKeys = ['-1']">合并所有</a-menu-item>-->
          <!--              <a-menu-item key="3" @click="getTreeDataByApi">刷新</a-menu-item>-->
          <!--            </a-menu>-->
          <!--            <a-button>-->
          <!--              <a-icon type="bars"/>-->
          <!--            </a-button>-->
          <!--          </a-dropdown>-->
        </div>
        <!--设备结构树-->
        <div style="flex: 1;overflow:auto;margin-top: 10px">
        <div id="tree-container" style="flex: 1;overflow:auto;margin-top: 10px">
          <a-tree blockNode show-icon :expandedKeys.sync="expandedKeys"
                  :selectedKeys="selectedKeys" :treeData="treeDataSource" :autoExpandParent="autoExpandParent"
                  @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick">
@@ -37,6 +37,8 @@
    <!--权限配置弹窗-->
    <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="getTreeDataByApi"/>
    <!--产品结构树基本右键菜单(空白处触发)-->
    <DeviceStructureBaseContextMenu ref="baseContextmenuRef"/>
  </a-card>
</template>
@@ -44,10 +46,13 @@
  import dncApi from '@/api/dnc'
  import DeviceStructureTreeContextMenu from './DeviceStructureTreeContextMenu'
  import AssignPermissionModal from './Permission/AssignPermissionModal'
import DeviceStructureBaseContextMenu
  from '@views/dnc/base/modules/DeviceStructure/DeviceStructureBaseContextMenu.vue'
  export default {
    name: 'DeviceStructureTree',
    components: {
    DeviceStructureBaseContextMenu,
      AssignPermissionModal,
      DeviceStructureTreeContextMenu
    },
@@ -83,6 +88,7 @@
      this.$bus.$off('handleSwitchDeviceDocClassCode', this.setCurrentDeviceDocClassCode)
    },
    methods: {
    // è°ƒç”¨æŽ¥å£èŽ·å–æ ‘çš„æ•°æ®
      getTreeDataByApi() {
        this.loading = true
        this.cardLoading = true
@@ -106,6 +112,10 @@
          })
      },
    /**
     * é€šè¿‡å³ä¾§tab栏所在activeKey设置当前设备的NC文档类型
     * @param documentActiveTabKey å³ä¾§tab栏的activeKey
     */
      setCurrentDeviceDocClassCode(documentActiveTabKey) {
        if (documentActiveTabKey === 1) this.currentDeviceDocClassCode = 'SEND'
        else this.currentDeviceDocClassCode = 'REC'
@@ -131,6 +141,7 @@
       * @param node èŠ‚ç‚¹å¯¹è±¡
       */
      handleTreeRightClick({ event, node }) {
      if (this.$refs.baseContextmenuRef) this.$refs.baseContextmenuRef.menuVisible = false
        const record = node.dataRef
        // è‹¥å³é”®æ—¶å½“前右侧展示层级为设备层级且当前右键树层级同为设备层级时则在触发右键菜单功能时同时触发左键选中功能
        if (this.currentSelected.type === 2 && record.type === 2) this.handleTreeSelect([record.key], { node })
@@ -213,8 +224,17 @@
        }
      },
      triggerCorrespondingMethod({ methodName }) {
        if (this[methodName]) this[methodName]()
    /**
     * æ ‘所在父元素的右键事件
     * @param event äº‹ä»¶å¯¹è±¡
     */
    openBaseContextMenu(event) {
      event.preventDefault()
      if (event.target.id !== 'tree-container') return
      this.$refs.baseContextmenuRef.menuStyle.top = event.clientY + 'px'
      this.$refs.baseContextmenuRef.menuStyle.left = event.clientX + 'px'
      this.$refs.baseContextmenuRef.menuVisible = true
      document.body.addEventListener('click', this.handleBaseContextMenuClose)
      },
      /**
@@ -227,6 +247,21 @@
        } else {
          treeNode.slots = { icon: 'device' }
        }
    },
    // æŽ§åˆ¶åŸºç¡€å³é”®èœå•关闭
    handleBaseContextMenuClose() {
      this.$refs.baseContextmenuRef.menuVisible = false
      document.body.removeEventListener('click', this.handleBaseContextMenuClose)
    },
    // åˆ·æ–°é‡æ–°èŽ·å–æ ‘çš„æ•°æ®
    handleTreeReload() {
      this.getTreeDataByApi()
    },
    triggerCorrespondingMethod({ methodName }) {
      if (this[methodName]) this[methodName]()
      }
    }
  }
src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue
@@ -1,6 +1,6 @@
<template>
  <div>
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination"
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading"
             :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
    </a-table>
src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue
@@ -1,6 +1,6 @@
<template>
  <div>
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination"
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading"
             :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
    </a-table>
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/UseDeviceCustomTypeEquipmentTableList.vue
@@ -1,5 +1,6 @@
<template>
  <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" :size="size" rowKey="id" :scroll="{y:189}">
  <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" :loading="loading" :size="size"
           rowKey="id" :scroll="{y:189}">
  </a-table>
</template>
@@ -73,7 +74,7 @@
        const { deviceManagementId } = this.currentLevelDetails
        this.queryParam = Object.assign({}, { id: deviceManagementId })
        this.loadData()
      },
    }
    }
  }
</script>
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue
@@ -1,6 +1,6 @@
<template>
  <div style="flex: 1">
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination"
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading"
             :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
    </a-table>
@@ -94,7 +94,7 @@
  watch: {
    currentNCDocumentAttributionInfo: {
      handler(value) {
        this.currentClickedDocumentInfo = {}
        this.currentClickedDocumentInfo = this.currentRightClickedDocumentInfo = {}
      },
      immediate: true
    }
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue
@@ -1,6 +1,6 @@
<template>
  <div>
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination"
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading"
             :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
    </a-table>
src/views/dnc/base/modules/ProductStructure/ProductStructureBaseContextMenu.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
<template>
  <a-menu :style="menuStyle" @click="menuItemClick" v-if="menuVisible" mode="vertical">
    <template v-for="menuItem in baseContextMenuList">
      <a-menu-item :key="menuItem.code" v-has="menuItem.code" v-if="menuItem.isHasPermission">
        <a-icon :type="menuItem.icon"/>
        {{ menuItem.label }}
      </a-menu-item>
      <a-menu-item :key="menuItem.code" v-else>
        <a-icon :type="menuItem.icon"/>
        {{ menuItem.label }}
      </a-menu-item>
    </template>
  </a-menu>
</template>
<script>
export default {
  name: 'ProductStructureBaseContextMenu',
  components: {},
  props: {
    tableRowInfo: {
      type: Object
    }
  },
  data() {
    return {
      menuVisible: false,
      menuStyle: {
        position: 'fixed',
        top: 0,
        left: 0,
        border: '1px solid #eee',
        boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)',
        zIndex: 999
      },
      currentMenuLevel: '',
      baseContextMenuList: [
        { label: '刷新', code: 'tree_reload', icon: 'reload', isHasPermission: false, isCommonMethod: false },
        { label: '添加产品', code: 'product_add', icon: 'plus', isHasPermission: true, isCommonMethod: false }
      ]
    }
  },
  methods: {
    menuItemClick({ key }) {
      console.log('menuKey', key)
      const isCommonMethod = this.baseContextMenuList.find(item => item.code === key).isCommonMethod
      const modalTitle = this.baseContextMenuList.find(item => item.code === key).label
      const menuKeyArray = key.split('_')
      // product_add => handleAdd è§¦å‘对应组件事件
      let methodName
      // åˆ¤æ–­æ˜¯å¦ä¸ºå…¬å…±æ–¹æ³•,如果为公共方法则截取专有属性product/component/part/process等字段
      if (isCommonMethod) {
        methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).slice(1).join('')
      } else {
        methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('')
      }
      this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle })
    }
  }
}
</script>
<style scoped>
/deep/ .ant-menu-item {
  height: 32px;
  line-height: 32px;
}
</style>
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue
@@ -96,15 +96,16 @@
    receiveCurrentTreeNodeInfo(treeNodeInfo) {
      console.log('treeNodeInfo', treeNodeInfo)
      const { id, type } = treeNodeInfo
      // ä»Žæ ‘组件接受树节点信息后从父组件流入子组件
      // ä»Žæ ‘组件接受树节点信息后从父组件流入子组件并重置数据
      this.currentClickedTypeInfo = this.currentRightClickedTableRowInfo = {}
      this.currentTreeNodeInfo = treeNodeInfo
      this.currentNCDocumentAttributionInfo = Object.assign({}, {
        attributionId: id,
        attributionType: type,
        docClassCode: 'NC'
      })
      // æ¸…空上一节点已经加载过得文档列表tabKey
      this.hasLoadedDataTabKeyArray = []
      if (+type === 5 || +type === 6) {
        this.activeTabKey = 1
        this.$nextTick(() => {
@@ -123,6 +124,10 @@
      this.hasLoadedDataTabKeyArray.push(this.activeTabKey)
    },
    /**
     * æŽ¥å—当前点击的设备类信息
     * @param record å½“前点击的设备类行信息
     */
    receiveCurrentClickedTypeInfo(record) {
      const { id, attributionType } = record
      this.currentClickedTypeInfo = Object.assign({}, record)
@@ -142,7 +147,6 @@
     */
    handleTableContextMenuOpen(record) {
      this.currentRightClickedTableRowInfo = Object.assign({}, record)
      console.log('currentRightClickedTableRowInfo', this.currentRightClickedTableRowInfo)
      this.$refs.tableContextMenuRef.currentMenuLevel = record.param
      this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px'
      this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px'
@@ -163,8 +167,9 @@
        this.hasLoadedDataTabKeyArray.push(activeTabKey)
      }
    },
    /**
     * æ–‡æ¡£ä»¥åŠNC程序导入/出库/入库成功后触发重新加载文档列表
     * æ–‡æ¡£ä»¥åŠNC程序导入/出库/入库/取消出库/发布/归档成功后触发重新加载文档列表
     * @param docClassCode æ–‡æ¡£ç±»åˆ«
     * @param attributionType æ–‡æ¡£çˆ¶çº§type类型
     * @param attributionId æ–‡æ¡£çˆ¶çº§Id
@@ -173,12 +178,19 @@
      console.log('docClassCode, attributionType, attributionId', docClassCode, attributionType, attributionId)
      // åœ¨æ­¤å¤„设备NC文档父级参数是可此方法是结构树以及设备类两种不同导入方式的共同出口
      this.currentNCDocumentAttributionInfo = Object.assign({}, { docClassCode, attributionId, attributionType })
      // è‹¥å¼•入设备类则只需要判断当前出现的文档所属是否是当前左键选中的文档,若不是当前选中的文档则不刷新文档列表(避免无效刷新)
      // åˆ¤æ–­å½“前右侧展示的文档的所属是否是当前左键选中树节点或设备类,若不是当前左键选中的则在导入后不刷新右侧的文档列表(避免无效刷新)
      // åˆ¤æ–­æ˜¯å¦æ˜¯åœ¨æ–‡æ¡£åˆ—表中进行出库/入库/发布/归档等操作,若是在文档列表中操作则操作成功后直接刷新文档列表
      if (!this.currentRightClickedTableRowInfo.hasOwnProperty('docId')) {
      if (this.currentRightClickedTableRowInfo.hasOwnProperty('deviceManagementId')) {
          // æ­¤ç§æƒ…况是在引入设备类并在设备类列表中进行NC文档导入
        if (this.currentClickedTypeInfo.id !== attributionId) return
      } else {
          // æ­¤ç§æƒ…况是在结构树节点上进行文档导入
        if (this.currentTreeNodeInfo.id !== attributionId) return
      }
      }
      if (docClassCode === 'NC') {
        this.$nextTick(() => {
          if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1)
@@ -432,7 +444,7 @@
    },
    /**
     * é‡å½’档当前右键选中文档且后续无法继续发布或归档
     * å½’档当前右键选中文档且后续无法继续发布或归档
     * @param menuLabel
     */
    handlePigeonhole(menuLabel) {
src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
@@ -1,17 +1,17 @@
<template>
  <a-card class="tree_con" :loading="cardLoading" :bordered="false" @contextmenu.native="e=>e.preventDefault()">
  <a-card class="tree_con" :loading="cardLoading" :bordered="false" @contextmenu.native.stop="openBaseContextMenu">
    <a-spin :spinning="loading">
      <div style="display: flex;flex-direction: column;height: 100%">
        <div style="display: flex;justify-content: space-between">
          <a-input placeholder="输入关键字进行搜索" allowClear v-model="searchInput"
                   @change="handleSearchInputChange"/>
          <a-tooltip title="刷新">
            <a-button icon="reload" @click="getTreeDataByApi" style="width: 18%;margin-left: 8px"></a-button>
          </a-tooltip>
          <a-button type="primary" v-has="'product_add'" icon="plus" style="margin-left: 8px"
                    @click="$refs.productModalFormRef.triggerCorrespondingMethod({modalTitle:'添加产品',methodName:'handleProductAdd'})">
            äº§å“
          </a-button>
          <!--          <a-tooltip title="刷新">-->
          <!--            <a-button icon="reload" @click="handleTreeReload" style="width: 18%;margin-left: 8px"></a-button>-->
          <!--          </a-tooltip>-->
          <!--          <a-button type="primary" v-has="'product_add'" icon="plus" style="margin-left: 8px"-->
          <!--                    @click="$refs.productModalFormRef.triggerCorrespondingMethod({modalTitle:'添加产品',methodName:'handleProductAdd'})">-->
          <!--            äº§å“-->
          <!--          </a-button>-->
          <!--          <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px">-->
          <!--            <a-menu slot="overlay">-->
          <!--              <a-menu-item key="1" @click="expandedKeys = allTreeKeys">展开所有</a-menu-item>-->
@@ -25,7 +25,7 @@
        </div>
        <!--产品结构树-->
        <div style="flex: 1;overflow:auto;margin-top: 10px">
        <div id="tree-container" style="flex: 1;overflow:auto;margin-top: 10px">
          <a-tree blockNode show-icon :expandedKeys.sync="expandedKeys"
                  :selectedKeys="selectedKeys" :treeData="treeDataSource" :autoExpandParent="autoExpandParent"
                  @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick">
@@ -61,6 +61,8 @@
    <ProcessStepModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--权限配置弹窗-->
    <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--产品结构树基本右键菜单(空白处触发)-->
    <ProductStructureBaseContextMenu ref="baseContextmenuRef"/>
  </a-card>
</template>
@@ -76,10 +78,13 @@
import ProcessStepModal from './ProcessStep/ProcessStepModal'
import AssignPermissionModal from './Permission/AssignPermissionModal'
import DeviceCustomTypeModal from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue'
import ProductStructureBaseContextMenu
  from '@views/dnc/base/modules/ProductStructure/ProductStructureBaseContextMenu.vue'
export default {
  name: 'ProductStructureTree',
  components: {
    ProductStructureBaseContextMenu,
    DeviceCustomTypeModal,
    AssignPermissionModal,
    ProcessStepModal,
@@ -118,6 +123,7 @@
    this.$bus.$off('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
  },
  methods: {
    // è°ƒç”¨æŽ¥å£èŽ·å–æ ‘çš„æ•°æ®
    getTreeDataByApi() {
      this.loading = true
      this.cardLoading = true
@@ -180,6 +186,7 @@
     * @param node èŠ‚ç‚¹å¯¹è±¡
     */
    handleTreeRightClick({ node }) {
      if (this.$refs.baseContextmenuRef) this.$refs.baseContextmenuRef.menuVisible = false
      const that = this
      const record = node.dataRef
      const { id, type } = record
@@ -339,8 +346,17 @@
      }
    },
    triggerCorrespondingMethod({ methodName }) {
      if (this[methodName]) this[methodName]()
    /**
     * æ ‘所在父元素的右键事件
     * @param event äº‹ä»¶å¯¹è±¡
     */
    openBaseContextMenu(event) {
      event.preventDefault()
      if (event.target.id !== 'tree-container') return
      this.$refs.baseContextmenuRef.menuStyle.top = event.clientY + 'px'
      this.$refs.baseContextmenuRef.menuStyle.left = event.clientX + 'px'
      this.$refs.baseContextmenuRef.menuVisible = true
      document.body.addEventListener('click', this.handleBaseContextMenuClose)
    },
    /**
@@ -369,7 +385,23 @@
          break
        default:
      }
    },
    // æŽ§åˆ¶åŸºç¡€å³é”®èœå•关闭
    handleBaseContextMenuClose() {
      this.$refs.baseContextmenuRef.menuVisible = false
      document.body.removeEventListener('click', this.handleBaseContextMenuClose)
    },
    // åˆ·æ–°é‡æ–°èŽ·å–æ ‘çš„æ•°æ®
    handleTreeReload() {
      this.getTreeDataByApi()
    },
    triggerCorrespondingMethod({ methodName }) {
      if (this[methodName]) this[methodName]()
    }
  }
}
</script>
src/views/dnc/common/ImportFileModal.vue
@@ -82,11 +82,12 @@
       */
      handlePush(_, tableRowInfo) {
        this.isUploadMultiple = false
        console.log('tableRowInfo', tableRowInfo)
      const { docId, attributionId, attributionType, param } = tableRowInfo
        this.uploadParams = Object.assign({}, {
          docId: tableRowInfo.docId,
          attributionId: tableRowInfo.attributionId,
          docClassCode: tableRowInfo.param
        docId,
        attributionId,
        attributionType,
        docClassCode: param
        })
        this.visible = true
      },
@@ -98,8 +99,7 @@
      beforeUpload(file) {
        if (this.isUploadMultiple) {
          if (!this.fileList.find(item => item.name === file.name)) this.fileList = [...this.fileList, file]
        }
        else this.fileList.splice(0, 1, file)
      } else this.fileList.splice(0, 1, file)
        return false
      },
@@ -109,8 +109,7 @@
        this.uploading = true
        let uploadedFileCount = 0
        let uploadSuccessFileCount = 0
        let apiMethod
        let params
      let apiMethod,params
        fileList.forEach((file, index) => {
          const formData = new FormData()
@@ -129,7 +128,6 @@
              if (res.success) {
                file.status = 'done'
                uploadSuccessFileCount++
                console.log('uploadSuccessFileCount++', uploadSuccessFileCount)
                $notification.success({
                  message: '消息',
                  description: res.message
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/PartsMatchingManagement.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">
          <PartsMatchingList :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 PartsMatchingList from './modules/PartsMatchingManagement/PartsMatchingList'
  import DepartTree from './modules/DepartList/DepartListTree/DepartTree'
  import { mapActions } from 'vuex'
  export default {
    name: 'PartsMatchingManagement',
    components: {
      BaseTree,
      DepartTree,
      PartsMatchingList
    },
    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/OEEAnalysis/ComputeOeeModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
<template>
  <a-modal title="计算OEE" :visible="visible" :width="550" @cancel="handleModalClose" @ok="handleComputeOee"
           :maskClosable="false">
    <a-form-model :model="model" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
      <a-row>
        <a-col :span="24">
          <a-form-model-item label="日期">
            <a-range-picker v-model="dates" style="width: 100%" value-format="YYYY-MM-DD"
                            @change="dateParamChange"></a-range-picker>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
  </a-modal>
</template>
<script>
  import mdcApi from '@/api/mdc'
  export default {
    name: 'ComputeOeeModal',
    components: {},
    data() {
      return {
        visible: false,
        model: {},
        dates: [],
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 3 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 21 }
        }
      }
    },
    methods: {
      handleComputeOee() {
        console.log('model', this.model)
        if (this.dates.length === 0) {
          this.$notification.warning({
            message: '消息',
            description: '请选择时间'
          })
          return
        }
        mdcApi.computeOeeApi(this.model)
          .then(res => {
            if (res.success) {
              this.$notification.success({
                message: '消息',
                description: res.message
              })
              this.visible = false
            } else {
              this.$notification.error({
                message: '消息',
                description: '计算失败'
              })
            }
          })
          .catch(err => {
            this.$notification.error({
              message: '消息',
              description: '计算失败'
            })
          })
      },
      dateParamChange(value1, value2) {
        this.model.startTime = value2[0]
        this.model.endTime = value2[1]
      },
      handleModalClose() {
        this.visible = false
        this.model = {}
        this.dates = []
      }
    }
  }
</script>
<style scoped>
</style>
src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,304 @@
<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>
      <a-button type="primary" icon="edit" @click="handleComputeModalOpen">计算</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>
    <ComputeOeeModal ref="computeOeeModalRef"/>
  </div>
</template>
<script>
  import moment from 'moment'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ComputeOeeModal from './ComputeOeeModal'
  export default {
    name: 'OEEAnalysisList',
    mixins: [JeecgListMixin],
    components: { ComputeOeeModal },
    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: {
      handleComputeModalOpen() {
        this.$refs.computeOeeModalRef.visible = true
      },
      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/PartsMatchingForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,191 @@
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="24">
            <a-form-model-item label="设备组" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentIds">
              <a-input-search :readOnly="true" v-model="model.equipmentIds"
                              @search="deviceSearch" :disabled="disableSelectDevice" enter-button
                              placeholder="请选择设备"></a-input-search>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="零件号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partId">
              <a-input placeholder="请输入零件号" v-model="model.partId" allowClear/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="标准加工工时(min)" :labelCol="labelCol" :wrapperCol="wrapperCol"
                               prop="standardProcessLong">
              <a-input-number :min="0" placeholder="请输入标准加工工时(min)" v-model="model.standardProcessLong"
                              @change="inputNumberChange"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="加工零件数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processCount">
              <a-input-number :min="0" v-model="model.processCount" placeholder="请输入加工零件数量"
                              @change="inputNumberChange"></a-input-number>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="合格零件数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="passCount">
              <a-input-number :min="0" v-model="model.passCount" placeholder="请输入合格零件数量"></a-input-number>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="加工总时长" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-model="model.totalProcessLong" placeholder="加工零件数量 X æ ‡å‡†åŠ å·¥å·¥æ—¶" readOnly></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="theDate">
              <a-date-picker v-model="model.theDate" :disabled="disabled" format="YYYY-MM-DD"
                             value-format="YYYY-MM-DD" style="width: 100%"></a-date-picker>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
    <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/>
  </a-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import SelectDeviceDrawer from '@/views/system/modules/SelectDeviceDrawer'
  export default {
    name: 'PartsMatchingForm',
    components: { SelectDeviceDrawer },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      },
      disableSelectDevice: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        model: {
          passCount: 0
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },
        confirmLoading: false,
        validatorRules: {
          equipmentIds: [
            { required: true, message: '请选择设备!' }
          ],
          partId: [
            { required: true, message: '请输入零件号!' }
          ],
          standardProcessLong: [
            { required: true, message: '请输入标准加工工时(min)!' }
          ],
          processCount: [
            { required: true, message: '请输入加工零件数量!' }
          ],
          passCount: [
            { required: true, message: '请输入合格零件数量!' }
          ],
          theDate: [
            { required: true, message: '请选择日期!' }
          ]
        },
        url: {
          add: '/mdc/mdcPartProcessInfo/add',
          edit: '/mdc/mdcPartProcessInfo/edit'
        }
      }
    },
    computed: {
      formDisabled() {
        return this.disabled
      }
    },
    created() {
      //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model))
    },
    methods: {
      add() {
        this.edit(this.modelDefault)
      },
      edit(record) {
        this.model = Object.assign({}, { equipmentIds: record.equipmentId }, record)
        console.log('model', this.model)
        this.visible = true
      },
      inputNumberChange() {
        if (this.model.standardProcessLong && this.model.processCount) {
          this.model.totalProcessLong = this.model.standardProcessLong * this.model.processCount
        }
      },
      submitForm() {
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true
            let httpUrl = ''
            let method = 'post'
            if (!this.model.id) {
              httpUrl += this.url.add
            } else {
              httpUrl += this.url.edit
            }
            httpAction(httpUrl, this.model, method).then((res) => {
              if (res.success) {
                that.$notification.success({
                  message: '消息',
                  description: res.message
                })
                that.$emit('ok')
              } else {
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                })
              }
            }).finally(() => {
              that.confirmLoading = false
            })
          }
        })
      },
      deviceSearch() {
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : []
      },
      /**
       * é€‰æ‹©å·²æœ‰è®¾å¤‡åŽç‚¹å‡»ç¡®å®šæ—¶è§¦å‘
       * @param data å·²é€‰æ‹©çš„设备
       */
      selectOK(data) {
        this.$set(this.model, 'equipmentIds', data.join(','))
        if (this.model.equipmentIds) this.$refs.form.clearValidate('equipmentIds')
      }
    }
  }
</script>
<style scoped lang="less">
  /deep/ .ant-input-number {
    width: 100% !important;
  }
</style>
src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,321 @@
<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-input placeholder="请输入零件号" v-model="queryParam.partId" allowClear/>
            </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 @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="handleExportXls('零件加工管理')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
                @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel">
            <a-icon type="delete"/>
            åˆ é™¤
          </a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> æ‰¹é‡æ“ä½œ
          <a-icon type="down"/>
        </a-button>
      </a-dropdown>
    </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"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical"/>
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
    <PartsMatchingModal ref="modalForm" @ok="modalFormOk"/>
  </div>
</template>
<script>
  import moment from 'moment'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import PartsMatchingModal from './PartsMatchingModal'
  export default {
    name: 'PartsMatchingList',
    mixins: [JeecgListMixin],
    components: {
      PartsMatchingModal
    },
    props: { nodeTree: '', Type: '', nodePeople: '' },
    data() {
      return {
        description: 'partsMatching管理页面',
        /* åˆ†é¡µå‚æ•° */
        ipagination: {
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['30', '50', '100'],
          showTotal: (total, range) => {
            return range[0] + '-' + range[1] + ' å…±' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        queryParam: {},
        disableMixinCreated: true,
        dates: [moment().subtract(1, 'day'), moment()],
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '日期',
            align: 'center',
            dataIndex: 'theDate',
            width: 200
          },
          {
            title: '设备编号',
            align: 'center',
            dataIndex: 'equipmentId',
            width: 230
          },
          {
            title: '零件号',
            align: 'center',
            dataIndex: 'partId',
            width: 150
          },
          {
            title: '标准加工工时(min)',
            align: 'center',
            dataIndex: 'standardProcessLong',
            width: 150
          },
          {
            title: '加工零件数量',
            align: 'center',
            dataIndex: 'processCount',
            width: 150
          },
          {
            title: '合格零件数量',
            align: 'center',
            dataIndex: 'passCount',
            width: 150
          },
          {
            title: '加工总时长',
            align: 'center',
            dataIndex: 'totalProcessLong',
            width: 150
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            fixed: 'right',
            width: 150,
            scopedSlots: { customRender: 'action' }
          }
        ],
        scrollY: 465,
        url: {
          list: '/mdc/mdcPartProcessInfo/list',
          delete: '/mdc/mdcPartProcessInfo/delete',
          deleteBatch: '/mdc/mdcPartProcessInfo/deleteBatch',
          exportXlsUrl: '/mdc/mdcPartProcessInfo/exportXls',
          importExcelUrl: '/mdc/mdcPartProcessInfo/importExcel'
        }
      }
    },
    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()
        }
      }
    },
    computed: {
      importExcelUrl: function() {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    },
    methods: {
      dateParamChange(v1, v2) {
        this.queryParam.startTime = v2[0]
        this.queryParam.endTime = v2[1]
        this.dates = [v1[0], v1[1]]
      },
      importTemplate(fileName) {
        var a = document.createElement('a')
        a.href = `/static/${fileName}.xls`
        a.download = `${fileName}.xls`
        a.style.display = 'none'
        document.body.appendChild(a)
        a.click()
        a.remove()
      },
      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/PartsMatchingModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <PartsMatchingForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit"
                      :disableSelectDevice="disableSelectDevice"/>
  </j-modal>
</template>
<script>
  import PartsMatchingForm from './PartsMatchingForm'
  export default {
    name: 'PartsMatchingModal',
    components: {
      PartsMatchingForm
    },
    data() {
      return {
        title: '',
        width: 800,
        visible: false,
        disableSubmit: false,
        disableSelectDevice: false
      }
    },
    methods: {
      add() {
        this.visible = true
        this.disableSelectDevice = false
        this.$nextTick(() => {
          this.$refs.realForm.add()
        })
      },
      edit(record) {
        this.visible = true
        this.disableSelectDevice = true
        this.$nextTick(() => {
          this.$refs.realForm.edit(record)
        })
      },
      close() {
        this.$emit('close')
        this.visible = false
      },
      handleOk() {
        this.$refs.realForm.submitForm()
      },
      submitCallback() {
        this.$emit('ok')
        this.visible = false
      },
      handleCancel() {
        this.close()
      }
    }
  }
</script>