1、产品结构树页面新增工步功能
2、产品结构树页面新增导入文档或NC程序功能
已重命名2个文件
已添加2个文件
已修改19个文件
734 ■■■■ 文件已修改
src/api/dnc.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/ProductStructure.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Component/ComponentModal.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Component/ComponentModalForm.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/DocumentModalForm.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Part/PartModal.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Part/PartModalForm.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Process/ProcessInfo.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Process/ProcessModal.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Process/ProcessModalForm.vue 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepInfo.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModal.vue 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModalForm.vue 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Product/ProductModal.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Product/ProductModalForm.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/ImportFileModal.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/TableContextMenu.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/dnc.js
@@ -1,7 +1,13 @@
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
import { getAction, deleteAction, putAction, postAction, httpAction, uploadAction } from '@/api/manage'
import querystring from 'querystring'
export default {
  //-------------------------产品结构树------------------------------------------------
  getProductStructureTreeApi: () => getAction('/nc/product/load/tree'),
  // å¯¼å…¥æ–‡æ¡£
  importDocumentFromLocalApi: (params, formData) => {
    const paramsStringify = querystring.stringify(params)
    return uploadAction(`/nc/doc/add?${paramsStringify}`, formData)
  }
}
src/views/dnc/base/ProductStructure.vue
@@ -15,7 +15,7 @@
</template>
<script>
  import ProductStructureTree from '../common/ProductStructureTree'
  import ProductStructureTree from './modules/ProductStructure/ProductStructureTree'
  import ProductStructureMain from './modules/ProductStructure/ProductStructureMain'
  import ImportFileModal from '../common/ImportFileModal'
src/views/dnc/base/modules/ProductStructure/Component/ComponentModal.vue
@@ -44,7 +44,9 @@
        this.visible = true
        this.isAddNextLevel = true
        this.$nextTick(() => {
          this.$refs.realForm.add({ productId: this.currentTreeNodeInfo.id })
          if (this.$refs.realForm) {
            this.$refs.realForm.add({ productId: this.currentTreeNodeInfo.entity.productId })
          }
        })
      },
@@ -55,10 +57,12 @@
        this.visible = true
        this.isAddNextLevel = true
        this.$nextTick(() => {
          if (this.$refs.realForm) {
          this.$refs.realForm.add({
            productId: this.currentTreeNodeInfo.parentId,
            parentId: this.currentTreeNodeInfo.id
              productId: this.currentTreeNodeInfo.entity.productId,
              parentId: this.currentTreeNodeInfo.entity.componentId
          })
          }
        })
      },
@@ -69,7 +73,9 @@
        this.visible = true
        this.isAddNextLevel = false
        this.$nextTick(() => {
          if (this.$refs.realForm) {
          this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity })
          }
        })
      },
src/views/dnc/base/modules/ProductStructure/Component/ComponentModalForm.vue
@@ -117,11 +117,6 @@
        }
      }
    },
    computed: {
      formDisabled() {
        return this.disabled
      }
    },
    created() {
      //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model))
src/views/dnc/base/modules/ProductStructure/Document/DocumentModalForm.vue
@@ -66,11 +66,6 @@
        }
      }
    },
    computed: {
      formDisabled() {
        return this.disabled
      }
    },
    created() {
      //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model))
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue
@@ -68,10 +68,12 @@
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) this.ipagination.current = 1
        var params = this.getQueryParams()//查询条件
        console.log('currentTreeNodeInfo', this.currentTreeNodeInfo)
        params.attributionId = this.currentTreeNodeInfo.id
        params.attributionType = this.currentTreeNodeInfo.type
        params.docClassCode = 'NC'
        if (!params) return false
        this.dataSource = []
        this.loading = true
        getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => {
          if (res.success) {
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue
@@ -65,10 +65,12 @@
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) this.ipagination.current = 1
        var params = this.getQueryParams()//查询条件
        console.log('currentTreeNodeInfo', this.currentTreeNodeInfo)
        params.attributionId = this.currentTreeNodeInfo.id
        params.attributionType = this.currentTreeNodeInfo.type
        params.docClassCode = 'OTHER'
        if (!params) return false
        this.dataSource = []
        this.loading = true
        getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => {
          if (res.success) {
src/views/dnc/base/modules/ProductStructure/Part/PartModal.vue
@@ -44,10 +44,12 @@
        this.visible = true
        this.isAddNextLevel = true
        this.$nextTick(() => {
          if (this.$refs.realForm) {
          this.$refs.realForm.add({
            productId: this.currentTreeNodeInfo.rfield,
            componentId: this.currentTreeNodeInfo.id
              productId: this.currentTreeNodeInfo.entity.productId,
              componentId: this.currentTreeNodeInfo.entity.componentId
          })
          }
        })
      },
@@ -58,10 +60,12 @@
        this.visible = true
        this.isAddNextLevel = false
        this.$nextTick(() => {
          if (this.$refs.realForm) {
          this.$refs.realForm.add({
            productId: this.currentTreeNodeInfo.rfield,
            componentId: this.currentTreeNodeInfo.parentId
              productId: this.currentTreeNodeInfo.productId,
              componentId: this.currentTreeNodeInfo.componentId
          })
          }
        })
      },
@@ -72,7 +76,9 @@
        this.visible = true
        this.isAddNextLevel = false
        this.$nextTick(() => {
          if (this.$refs.realForm) {
          this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity })
          }
        })
      },
src/views/dnc/base/modules/ProductStructure/Part/PartModalForm.vue
@@ -117,11 +117,6 @@
        }
      }
    },
    computed: {
      formDisabled() {
        return this.disabled
      }
    },
    created() {
      //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model))
src/views/dnc/base/modules/ProductStructure/Process/ProcessInfo.vue
@@ -4,11 +4,9 @@
    <a-descriptions-item label="工序号">{{currentLevelDetails.processCode}}</a-descriptions-item>
    <a-descriptions-item label="工艺编号    ">{{currentLevelDetails.craftNo}}</a-descriptions-item>
    <a-descriptions-item label="工序类型">{{currentLevelDetails.processType}}</a-descriptions-item>
    <a-descriptions-item label="加工设备型号">{{currentLevelDetails.processingEquipmentModel}}
    </a-descriptions-item>
    <a-descriptions-item label="加工设备类型">{{currentLevelDetails.processingEquipmentOs}}</a-descriptions-item>
    <a-descriptions-item label="加工设备编号">{{currentLevelDetails.processingEquipmentCode}}
    </a-descriptions-item>
    <a-descriptions-item label="加工设备型号">{{currentLevelDetails.processingEquipmentModel}}</a-descriptions-item>
    <!--<a-descriptions-item label="加工设备类型">{{currentLevelDetails.processingEquipmentOs}}</a-descriptions-item>-->
    <a-descriptions-item label="加工设备编号">{{currentLevelDetails.processingEquipmentCode}}</a-descriptions-item>
    <a-descriptions-item label="工装编号">{{currentLevelDetails.assembleStep}}</a-descriptions-item>
    <a-descriptions-item label="工装名称    ">{{currentLevelDetails.assembleName}}</a-descriptions-item>
    <a-descriptions-item label="描述" :span="3">{{currentLevelDetails.description}}</a-descriptions-item>
src/views/dnc/base/modules/ProductStructure/Process/ProcessModal.vue
@@ -29,7 +29,8 @@
      return {
        title: '',
        width: 700,
        visible: false
        visible: false,
        isAddNextLevel: false // æ˜¯å¦ä¸ºæ·»åŠ ä¸‹çº§ï¼Œä½œä¸ºæ ‘èŠ‚ç‚¹æ˜¯å¦å±•å¼€çš„åˆ¤æ–­
      }
    },
    created() {
@@ -37,38 +38,66 @@
    },
    methods: {
      /**
       * åˆ›å»º
       * @param modalTitle
       * ç‚¹å‡»éƒ¨ä»¶åˆ›å»ºéƒ¨ä»¶ä¸‹çº§å·¥åº
       */
      handleComponentAddRelative(modalTitle) {
        this.title = modalTitle
      handleComponentAddRelative() {
        this.isAddNextLevel = true
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
          if (this.$refs.realForm) {
            this.$refs.realForm.add({
              productId: this.currentTreeNodeInfo.entity.productId,
              componentId: this.currentTreeNodeInfo.entity.componentId
            })
          }
        })
      },
      handleProcessAdd(modalTitle) {
        this.title = modalTitle
      /**
       * ç‚¹å‡»é›¶ä»¶åˆ›å»ºé›¶ä»¶ä¸‹çº§å·¥åº
       */
      handlePartsAddRelative() {
        this.isAddNextLevel = true
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
          if (this.$refs.realForm) {
            this.$refs.realForm.add({
              productId: this.currentTreeNodeInfo.entity.productId,
              componentId: this.currentTreeNodeInfo.entity.componentId,
              partsId: this.currentTreeNodeInfo.entity.partsId
            })
          }
        })
      },
      handlePartsAddRelative(modalTitle) {
        this.title = modalTitle
      /**
       * ç‚¹å‡»å·¥åºæ·»åŠ åŒçº§å·¥åº
       */
      handleProcessAdd() {
        this.isAddNextLevel = false
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
          if (this.$refs.realForm) {
            this.$refs.realForm.add({
              productId: this.currentTreeNodeInfo.entity.productId,
              componentId: this.currentTreeNodeInfo.entity.componentId,
              partsId: this.currentTreeNodeInfo.entity.partsId
            })
          }
        })
      },
      handleProcessEdit(modalTitle) {
        this.title = modalTitle
      /**
       * ç¼–辑工序信息
       */
      handleProcessEdit() {
        this.isAddNextLevel = false
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.edit(this.currentTreeNodeInfo.entity)
          if (this.$refs.realForm) {
            this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity })
          }
        })
      },
@@ -77,7 +106,7 @@
      },
      submitCallback() {
        this.$emit('submitSuccess')
        this.$emit('submitSuccess', this.isAddNextLevel)
        this.visible = false
      },
@@ -87,7 +116,10 @@
      },
      triggerCorrespondingMethod({ methodName, modalTitle }) {
        if (this[methodName]) this[methodName](modalTitle)
        if (this[methodName]) {
          this[methodName]()
          this.title = modalTitle
        }
      }
    }
  }
src/views/dnc/base/modules/ProductStructure/Process/ProcessModalForm.vue
@@ -61,22 +61,19 @@
        </a-col>
      </a-row>
    </a-form-model>
    <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: 'ProcessModalForm',
    components: { SelectDeviceDrawer },
    components: {},
    data() {
      return {
        model: {
          passCount: 0
          processType: 0
        },
        labelCol: {
          xs: { span: 24 },
@@ -104,14 +101,9 @@
          ]
        },
        url: {
          add: '/mdc/mdcPartProcessInfo/add',
          edit: '/mdc/mdcPartProcessInfo/edit'
          add: '/nc/stream/process/add',
          edit: '/nc/stream/process/edit'
        }
      }
    },
    computed: {
      formDisabled() {
        return this.disabled
      }
    },
    created() {
@@ -119,13 +111,12 @@
      this.modelDefault = JSON.parse(JSON.stringify(this.model))
    },
    methods: {
      add() {
        this.edit(this.modelDefault)
      add(params) {
        this.edit({ ...this.modelDefault, ...params })
      },
      edit(record) {
        this.model = Object.assign({}, { equipmentIds: record.equipmentId }, record)
        this.model = Object.assign({}, record)
        console.log('model', this.model)
        this.visible = true
      },
      submitForm() {
        const that = this
@@ -134,11 +125,13 @@
          if (valid) {
            that.confirmLoading = true
            let httpUrl = ''
            let method = 'post'
            let method = ''
            if (!this.model.id) {
              httpUrl += this.url.add
              method = 'post'
            } else {
              httpUrl += this.url.edit
              httpUrl += this.url.edit + `/${this.model.id}`
              method = 'put'
            }
            httpAction(httpUrl, this.model, method).then((res) => {
              if (res.success) {
@@ -159,20 +152,6 @@
          }
        })
      },
      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')
      }
    }
  }
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepInfo.vue
@@ -1,14 +1,10 @@
<template>
  <a-descriptions bordered :size="size">
    <a-descriptions-item label="工步名称">{{currentLevelDetails.processName}}</a-descriptions-item>
    <a-descriptions-item label="工步号">{{currentLevelDetails.processCode}}</a-descriptions-item>
    <a-descriptions-item label="工步名称">{{currentLevelDetails.stepName}}</a-descriptions-item>
    <a-descriptions-item label="工步号">{{currentLevelDetails.stepCode}}</a-descriptions-item>
    <a-descriptions-item label="工艺编号    ">{{currentLevelDetails.craftNo}}</a-descriptions-item>
    <a-descriptions-item label="工序类型">{{currentLevelDetails.processType}}</a-descriptions-item>
    <a-descriptions-item label="加工设备型号">{{currentLevelDetails.processingEquipmentModel}}
    </a-descriptions-item>
    <a-descriptions-item label="加工设备类型">{{currentLevelDetails.processingEquipmentOs}}</a-descriptions-item>
    <a-descriptions-item label="加工设备编号">{{currentLevelDetails.processingEquipmentCode}}
    </a-descriptions-item>
    <a-descriptions-item label="工步类型">{{currentLevelDetails.stepType}}</a-descriptions-item>
    <a-descriptions-item label="加工设备编号">{{currentLevelDetails.deviceNo}}</a-descriptions-item>
    <a-descriptions-item label="工装编号">{{currentLevelDetails.assembleStep}}</a-descriptions-item>
    <a-descriptions-item label="工装名称    ">{{currentLevelDetails.assembleName}}</a-descriptions-item>
    <a-descriptions-item label="描述" :span="3">{{currentLevelDetails.description}}</a-descriptions-item>
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,112 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    :maskClosable="false"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <ProcessStepModalForm ref="realForm" @ok="submitCallback"/>
  </j-modal>
</template>
<script>
  import ProcessStepModalForm from './ProcessStepModalForm.vue'
  export default {
    name: 'ProcessStepModal',
    components: {
      ProcessStepModalForm
    },
    props: {
      currentTreeNodeInfo: {
        type: Object
      }
    },
    data() {
      return {
        title: '',
        width: 700,
        visible: false,
        isAddNextLevel: false // æ˜¯å¦ä¸ºæ·»åŠ ä¸‹çº§ï¼Œä½œä¸ºæ ‘èŠ‚ç‚¹æ˜¯å¦å±•å¼€çš„åˆ¤æ–­
      }
    },
    created() {
      this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      /**
       * ç‚¹å‡»å·¥åºåˆ›å»ºå·¥åºä¸‹çº§å·¥æ­¥
       */
      handleProcessAddChild() {
        this.isAddNextLevel = true
        this.visible = true
        this.$nextTick(() => {
          if (this.$refs.realForm) {
            this.$refs.realForm.add({
              productId: this.currentTreeNodeInfo.entity.productId,
              componentId: this.currentTreeNodeInfo.entity.componentId,
              partsId: this.currentTreeNodeInfo.entity.partsId,
              processId: this.currentTreeNodeInfo.entity.processId
            })
          }
        })
      },
      /**
       * ç‚¹å‡»å·¥æ­¥æ·»åŠ åŒçº§å·¥æ­¥
       */
      handleProcessStepAdd() {
        this.isAddNextLevel = false
        this.visible = true
        this.$nextTick(() => {
          if (this.$refs.realForm) {
            this.$refs.realForm.add({
              productId: this.currentTreeNodeInfo.entity.productId,
              componentId: this.currentTreeNodeInfo.entity.componentId,
              partsId: this.currentTreeNodeInfo.entity.partsId,
              processId: this.currentTreeNodeInfo.entity.processId
            })
          }
        })
      },
      /**
       * ç¼–辑工序信息
       */
      handleProcessStepEdit() {
        this.isAddNextLevel = false
        this.visible = true
        this.$nextTick(() => {
          if (this.$refs.realForm) {
            this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity })
          }
        })
      },
      handleOk() {
        this.$refs.realForm.submitForm()
      },
      submitCallback() {
        this.$emit('submitSuccess', this.isAddNextLevel)
        this.visible = false
      },
      handleCancel() {
        this.$emit('close')
        this.visible = false
      },
      triggerCorrespondingMethod({ methodName, modalTitle }) {
        if (this[methodName]) {
          this[methodName]()
          this.title = modalTitle
        }
      }
    }
  }
</script>
src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModalForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,158 @@
<template>
  <a-spin :spinning="confirmLoading">
    <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
      <a-row>
        <a-col :span="12">
          <a-form-model-item label="工步号" prop="stepCode">
            <a-input v-model="model.stepCode" placeholder="请输入工序号"></a-input>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="工步名称" prop="stepName">
            <a-input v-model="model.stepName" placeholder="请输入工序名称"></a-input>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :span="24">
          <a-form-model-item label="加工设备编号" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
            <a-select v-model="model.deviceNo" placeholder="请选择加工设备编号"></a-select>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :span="12">
          <a-form-model-item label="工艺编号">
            <a-input v-model="model.craftNo" placeholder="请输入工艺编号"></a-input>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="工艺规程版本">
            <a-input v-model="model.craftVersion" placeholder="请输入工艺规程版本"></a-input>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :span="12">
          <a-form-model-item label="工步类型">
            <a-input v-model="model.stepType" placeholder="请输入工步类型"></a-input>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="工步描述">
            <a-input v-model="model.description" placeholder="请输入工步描述"></a-input>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :span="12">
          <a-form-model-item label="工装编号">
            <a-input v-model="model.assembleNo" placeholder="请输入工装编号"></a-input>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="工装名称">
            <a-input v-model="model.assembleName" placeholder="请输入工装名称"></a-input>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
  </a-spin>
</template>
<script>
  import { httpAction } from '@/api/manage'
  export default {
    name: 'ProcessStepModalForm',
    components: {},
    data() {
      return {
        model: {
          stepType: 0
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 8 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 14 }
        },
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 4 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 19 }
        },
        confirmLoading: false,
        validatorRules: {
          stepCode: [
            { required: true, message: '请输入工步号!' }
          ],
          stepName: [
            { required: true, message: '请输入工步名称!' }
          ]
        },
        url: {
          add: '/nc/workStep/add',
          edit: '/nc/workStep/edit'
        }
      }
    },
    created() {
      //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model))
    },
    methods: {
      add(params) {
        this.edit({ ...this.modelDefault, ...params })
      },
      edit(record) {
        this.model = Object.assign({}, record)
        console.log('model', this.model)
      },
      submitForm() {
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true
            let httpUrl = ''
            let method = ''
            if (!this.model.id) {
              httpUrl += this.url.add
              method = 'post'
            } else {
              httpUrl += this.url.edit + `/${this.model.id}`
              method = 'put'
            }
            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
            })
          }
        })
      }
    }
  }
</script>
src/views/dnc/base/modules/ProductStructure/Product/ProductModal.vue
@@ -29,7 +29,7 @@
      return {
        title: '',
        width: 500,
        visible: false,
        visible: false
      }
    },
    created() {
@@ -42,7 +42,7 @@
      handleProductAdd() {
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
          if (this.$refs.realForm) this.$refs.realForm.add()
        })
      },
@@ -52,7 +52,9 @@
      handleProductEdit() {
        this.visible = true
        this.$nextTick(() => {
          if (this.$refs.realForm) {
          this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity })
          }
        })
      },
src/views/dnc/base/modules/ProductStructure/Product/ProductModalForm.vue
@@ -69,11 +69,6 @@
        }
      }
    },
    computed: {
      formDisabled() {
        return this.disabled
      }
    },
    created() {
      //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model))
src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue
@@ -12,12 +12,12 @@
      <PartInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/>
    </a-tab-pane>
    <a-tab-pane :key="1" tab="工序属性" v-if="currentLevelInfo.type===4">
      <ProcessInfo :currentLevelDetails="currentLevelInfo" :size="descriptionsContainerSize"/>
    <a-tab-pane :key="1" tab="工序属性" v-if="currentLevelInfo.type===5">
      <ProcessInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/>
    </a-tab-pane>
    <a-tab-pane :key="1" tab="工步属性" v-if="currentLevelInfo.type===5">
      <ProcessStepInfo :currentLevelDetails="currentLevelInfo" :size="descriptionsContainerSize"/>
    <a-tab-pane :key="1" tab="工步属性" v-if="currentLevelInfo.type===6">
      <ProcessStepInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/>
    </a-tab-pane>
    <template v-if="currentLevelInfo.hasOwnProperty('attributionType')">
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue
@@ -1,12 +1,12 @@
<template>
  <a-tabs v-model="activeTabKey" @change="handleTabChange" @contextmenu.native="e=>e.preventDefault()"
  <a-tabs v-model="activeTabKey" @contextmenu.native="e=>e.preventDefault()"
          v-if="Object.keys(currentTreeNodeInfo).length!==0">
    <a-tab-pane :key="1" tab="NC文档" v-if="currentTreeNodeInfo.type!==1">
    <a-tab-pane :key="1" tab="NC文档" v-if="currentTreeNodeInfo.type===5||currentTreeNodeInfo.type===6">
      <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo"
                           @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/>
    </a-tab-pane>
    <a-tab-pane :key="2" tab="其他文档">
    <a-tab-pane :key="1" tab="其他文档" v-else>
      <OtherDocumentTableList ref="otherDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo"
                              @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/>
    </a-tab-pane>
@@ -25,8 +25,7 @@
    components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList },
    data() {
      return {
        activeTabKey: null,
        hasLoadingDataTabKey: [],
        activeTabKey: 1,
        tableContainerSize: 'small',
        currentRightClickedTableRowInfo: {},
        currentTreeNodeInfo: {}
@@ -34,19 +33,7 @@
    },
    created() {
      this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo)
    },
    watch: {
      activeTabKey: {
        handler(value) {
          // tab切换时加载对应文档列表,当前树节点下已经加载过的文档列表不再重复加载
          if (!this.hasLoadingDataTabKey.includes(value)) {
            if (value === 1) this.$nextTick(() => this.$refs.ncDocumentTableListRef.loadData(1))
            else this.$nextTick(() => this.$refs.otherDocumentTableListRef.loadData(1))
            this.hasLoadingDataTabKey.push(value)
          }
        },
        deep: true
      }
      this.$bus.$on('importFileSuccess', this.reloadDocumentListData)
    },
    methods: {
      /**
@@ -70,23 +57,29 @@
        // ä»Žæ ‘组件接受树节点信息后从父组件流入子组件
        this.currentTreeNodeInfo = treeNodeInfo
        // æ¸…空上一节点已经加载过得文档列表tabKey
        this.hasLoadingDataTabKey = []
        if (treeNodeInfo.type !== 1) {
          this.activeTabKey = 1
          this.$nextTick(() => this.$refs.ncDocumentTableListRef.loadData(1))
        if (treeNodeInfo.type === 5 || treeNodeInfo.type === 6) {
          this.$nextTick(() => {
            if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1)
          })
        } else {
          this.activeTabKey = 2
          this.$nextTick(() => this.$refs.otherDocumentTableListRef.loadData(1))
          this.$nextTick(() => {
            if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1)
          })
        }
        this.hasLoadingDataTabKey.push(this.activeTabKey)
      },
      handleTabChange(activeTabKey) {
        // tab切换时加载对应文档列表,当前树节点下已经加载过的文档列表不再重复加载
        if (!this.hasLoadingDataTabKey.includes(activeTabKey)) {
          if (activeTabKey === 1) this.$nextTick(() => this.$refs.ncDocumentTableListRef.loadData(1))
          else this.$nextTick(() => this.$refs.otherDocumentTableListRef.loadData(1))
          this.hasLoadingDataTabKey.push(activeTabKey)
      /**
       * ä¸Šä¼ æ–‡ä»¶æˆåŠŸåŽè§¦å‘
       * @param docClassCode æ–‡æ¡£ç±»åˆ«
       * @param attributionId èŠ‚ç‚¹Id
       */
      reloadDocumentListData({ docClassCode, attributionId }) {
        // å¦‚果上传的文档不是所属于当前所展示节点的文档则不重新获取文档列表
        if (this.currentTreeNodeInfo.id !== attributionId) return
        if (docClassCode === 'NC') {
          if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1)
        } else {
          if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1)
        }
      },
src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
ÎļþÃû´Ó src/views/dnc/common/ProductStructureTree.vue ÐÞ¸Ä
@@ -2,7 +2,6 @@
  <a-card class="tree_con" :loading="cardLoading" :bordered="false" @contextmenu.native="e=>e.preventDefault()">
    <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"/>
@@ -24,7 +23,7 @@
        </div>
        <!--产品结构树-->
        <div style="flex: 1;overflow:auto;margin-top: 10px">
        <div class="" style="flex: 1;overflow:auto;margin-top: 10px">
          <a-tree ref="tree" show-icon :checkStrictly="checkStrictly" :expandedKeys.sync="expandedKeys"
                  :selectedKeys="selectedKeys" :treeData="treeDataSource" :autoExpandParent="autoExpandParent"
                  @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick">
@@ -53,21 +52,25 @@
    <PartModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--工序弹窗-->
    <ProcessModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--工步弹窗-->
    <ProcessStepModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
  </a-card>
</template>
<script>
  import dncApi from '@/api/dnc'
  import { deleteAction } from '@/api/manage'
  import ProductStructureTreeContextMenu from './modules/ProductStructureTree/ProductStructureTreeContextMenu'
  import ProductModal from '../base/modules/ProductStructure/Product/ProductModal'
  import ComponentModal from '../base/modules/ProductStructure/Component/ComponentModal'
  import PartModal from '../base/modules/ProductStructure/Part/PartModal'
  import ProcessModal from '../base/modules/ProductStructure/Process/ProcessModal'
  import ProductStructureTreeContextMenu from './ProductStructureTreeContextMenu'
  import ProductModal from './Product/ProductModal'
  import ComponentModal from './Component/ComponentModal'
  import PartModal from './Part/PartModal'
  import ProcessModal from './Process/ProcessModal'
  import ProcessStepModal from './ProcessStep/ProcessStepModal'
  export default {
    name: 'ProductStructureTree',
    components: {
      ProcessStepModal,
      ProcessModal,
      PartModal,
      ComponentModal,
@@ -274,10 +277,10 @@
          case 3:
            treeNode.slots = { icon: 'part' }
            break
          case 4:
          case 5:
            treeNode.slots = { icon: 'process' }
            break
          case 5:
          case 6:
            treeNode.slots = { icon: 'processStep' }
            break
          default:
@@ -288,7 +291,6 @@
</script>
<style lang="less" scoped>
  /deep/ .ant-card-body {
    padding: 0 12px 0 0;
  }
@@ -306,8 +308,8 @@
    width: calc(100% - 24px) !important;
  }
  .tree_con {
    overflow: hidden;
  ::-webkit-scrollbar {
    width: 8px;
  }
  @media screen and (min-width: 1920px) {
src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue
ÎļþÃû´Ó src/views/dnc/common/modules/ProductStructureTree/ProductStructureTreeContextMenu.vue ÐÞ¸Ä
@@ -6,12 +6,10 @@
    <template #overlay>
      <a-menu @click="({ key: menuKey }) => onContextMenuClick(treeParams.treeKey, menuKey)"
              @contextmenu="event=>event.preventDefault()">
        <template v-for="item in defaultContextMenuList[getCurrentMenuLevel]">
          <a-menu-item :key="item.code" v-if="item.show">
        <a-menu-item v-for="item in defaultContextMenuList[getCurrentMenuLevel]" :key="item.code" v-has="item.code">
            <a-icon :type="item.icon"/>
            {{item.label}}
          </a-menu-item>
        </template>
      </a-menu>
    </template>
  </a-dropdown>
@@ -63,10 +61,19 @@
          //工序
          process: [
            { show: true, label: '创建工序', code: 'process_add', icon: 'plus', isCommonMethod: false },
            { show: true, label: '创建工步', code: 'process_add_child', icon: 'plus', isCommonMethod: false },
            { show: true, label: '编辑工序信息', code: 'process_edit', icon: 'edit', isCommonMethod: false },
            { show: true, label: '删除', code: 'process_delete', icon: 'delete', isCommonMethod: true },
            { show: false, label: '导出NC程序', code: 'process_export', icon: 'import', isCommonMethod: true },
            { show: true, label: '导入NC程序', code: 'process_import', icon: 'export', isCommonMethod: true }
          ],
          //工步
          processStep: [
            { show: true, label: '创建工步', code: 'processStep_add', icon: 'plus', isCommonMethod: false },
            { show: true, label: '编辑工步信息', code: 'processStep_edit', icon: 'edit', isCommonMethod: false },
            { show: true, label: '删除', code: 'processStep_delete', icon: 'delete', isCommonMethod: true },
            { show: false, label: '导出NC程序', code: 'processStep_export', icon: 'import', isCommonMethod: true },
            { show: true, label: '导入NC程序', code: 'processStep_import', icon: 'export', isCommonMethod: true }
          ]
        }
      }
@@ -80,9 +87,9 @@
            return 'component'
          case 3:
            return 'part'
          case 4:
            return 'process'
          case 5:
            return 'process'
          case 6:
            return 'processStep'
        }
      }
@@ -90,6 +97,7 @@
    methods: {
      onContextMenuClick(treeKey, menuKey) {
        const level = this.getCurrentMenuLevel
        console.log('level---------------------', level)
        const menuKeyArray = menuKey.split('_')
        const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod
        // product_add => handleAdd è§¦å‘对应组件事件
@@ -101,8 +109,9 @@
          methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('')
        }
        console.log('methodName------------------------------------', methodName)
        console.log('treeParams------------------------------------', this.treeParams)
        const modalTitle = this.defaultContextMenuList[level].find(item => item.code === menuKey).label
        this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle })
        this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle, treeNodeInfo: this.treeParams })
      }
    }
  }
src/views/dnc/common/ImportFileModal.vue
@@ -1,7 +1,7 @@
<template>
  <a-modal :title="title" :visible="visible" @cancel="handleModalClose" :maskClosable="false">
    <a-upload :multiple="true" :file-list="fileList" :remove="handleRemove" :before-upload="beforeUpload">
      <a-button type="primary">
      <a-button type="primary" :disabled="uploading">
        <a-icon type="import"/>
        é€‰å–文件
      </a-button>
@@ -26,6 +26,8 @@
</template>
<script>
  import dncApi from '@/api/dnc'
  export default {
    name: 'ImportFileModal',
    components: {},
@@ -34,6 +36,7 @@
        visible: false,
        title: '',
        fileList: [],
        uploadParams: {},
        uploading: false
      }
    },
@@ -42,8 +45,26 @@
      this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      handleImport(modalTitle) {
        this.handleModalOpen(modalTitle)
      /**
       * ç‚¹å‡»å¯¼å…¥æ–‡æ¡£æˆ–NC程序时触发
       * @param treeNodeInfo ç‚¹å‡»æ ‘节点右键菜单导入程序时传入树节点信息
       * @param tableRowInfo ç‚¹å‡»è¡¨æ ¼è¡Œå³é”®èœå•导入程序时传入行信息
       */
      handleImport(treeNodeInfo, tableRowInfo) {
        let attributionId // æ–‡æ¡£æ‰€å±žå±‚级Id
        let attributionType  // æ–‡æ¡£æ‰€å±žå±‚级类型
        let docClassCode // æ–‡æ¡£ç±»åž‹
        if (treeNodeInfo) {
          attributionId = treeNodeInfo.treeKey
          attributionType = treeNodeInfo.type
        } else {
          attributionId = tableRowInfo.attributionId
          attributionType = tableRowInfo.attributionType
        }
        if (attributionType === 5 || attributionType === 6) docClassCode = 'NC'
        else docClassCode = 'OTHER'
        this.uploadParams = Object.assign({}, { attributionId, attributionType, docClassCode })
        this.visible = true
      },
      handleRemove(file) {
@@ -54,43 +75,48 @@
      },
      beforeUpload(file) {
        this.fileList = [...this.fileList, file]
        if (!this.fileList.find(item => item.name === file.name)) this.fileList = [...this.fileList, file]
        return false
      },
      handleUpload() {
        const { fileList } = this
        const formData = new FormData()
        fileList.forEach(file => {
          formData.append('files[]', file)
        })
        const { fileList, $notification } = this
        this.uploading = true
        // You can use any AJAX library you like
        request({
          url: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
          method: 'post',
          processData: false,
          data: formData,
          success: () => {
            this.fileList = []
            this.uploading = false
            this.$message.success('upload successfully.')
          },
          error: () => {
            this.uploading = false
            this.$message.error('upload failed.')
        let uploadedFileCount = 0
        let uploadSuccessFileCount = 0
        fileList.forEach((file, index) => {
          const formData = new FormData()
          formData.append('file', file)
          file.status = 'uploading'
          dncApi.importDocumentFromLocalApi(this.uploadParams, formData)
            .then(res => {
              if (res.success) {
                file.status = 'done'
                uploadSuccessFileCount++
                $notification.success({
                  message: '消息',
                  description: res.message
                })
              } else {
                file.status = 'error'
                $notification.error({
                  message: '消息',
                  description: res.message
                })
          }
        })
      },
      /**
       * æŽ§åˆ¶æ–‡ä»¶ä¸Šä¼ çª—口开启并设置窗口标题
       * @param modalTitle çª—口标题
       */
      handleModalOpen(modalTitle) {
        this.title = modalTitle
        this.visible = true
            .catch(err => {
              file.status = 'error'
            })
            .finally(() => {
              uploadedFileCount++
              fileList.splice(index, 1, file)
              if (uploadedFileCount === fileList.length) {
                if (uploadSuccessFileCount > 0) this.$bus.$emit('importFileSuccess', this.uploadParams)
                this.uploading = false
              }
            })
        })
      },
      /**
@@ -101,8 +127,12 @@
        this.fileList = []
      },
      triggerCorrespondingMethod({ methodName, modalTitle }) {
        if (this[methodName]) this[methodName](modalTitle)
      triggerCorrespondingMethod({ methodName, modalTitle, treeNodeInfo, tableRowInfo }) {
        if (this[methodName]) {
          this[methodName](treeNodeInfo, tableRowInfo)
          this.title = modalTitle
        }
      }
    }
  }
src/views/dnc/common/TableContextMenu.vue
@@ -43,51 +43,40 @@
        defaultContextMenuList: {
          //文档
          document: [
            { show: true, label: '编辑文档信息', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false },
            { label: '编辑文档信息', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false },
            { label: '指派到设备', code: 'document_assign', subMenu: [], icon: 'cluster', isCommonMethod: false },
            { label: '导出NC程序', code: 'document_export', subMenu: [], icon: 'export', isCommonMethod: true },
            { label: '导入NC程序', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true },
            { label: '下载', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true },
            { label: '删除', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true },
            { label: '批量删除', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false },
            {
              show: true,
              label: '指派到设备',
              code: 'document_assign',
              subMenu: [],
              icon: 'cluster',
              isCommonMethod: false
            },
            {
              show: false,
              label: '导出NC程序',
              code: 'document_export',
              subMenu: [],
              icon: 'export',
              isCommonMethod: true
            },
            { show: true, label: '导入NC程序', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true },
            { show: true, label: '下载', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true },
            { show: true, label: '删除', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true },
            {
              show: true,
              label: '批量删除',
              code: 'document_batch_remove',
              subMenu: [],
              icon: 'delete',
              isCommonMethod: false
            },
            {
              show: true,
              label: '生命周期',
              subMenu: [
                { show: true, label: '出库', code: 'document_pull', icon: 'export', isCommonMethod: false },
                { show: true, label: '取消出库', code: 'document_cancel_pull', icon: 'stop', isCommonMethod: false },
                { show: true, label: '入库', code: 'document_push', icon: 'import', isCommonMethod: true },
                { show: true, label: '发布', code: 'document_publish', icon: 'flag', isCommonMethod: false },
                { show: true, label: '重新发布', code: 'document_republish', icon: 'reload', isCommonMethod: false },
                { show: true, label: '归档', code: 'document_pigeonhole', icon: 'database', isCommonMethod: false }
                { label: '出库', code: 'document_pull', icon: 'export', isCommonMethod: false },
                { label: '取消出库', code: 'document_cancel_pull', icon: 'stop', isCommonMethod: false },
                { label: '入库', code: 'document_push', icon: 'import', isCommonMethod: true },
                { label: '发布', code: 'document_publish', icon: 'flag', isCommonMethod: false },
                { label: '重新发布', code: 'document_republish', icon: 'reload', isCommonMethod: false },
                { label: '归档', code: 'document_pigeonhole', icon: 'database', isCommonMethod: false }
              ],
              icon: 'hourglass'
            }
          ],
          //文件
          file: [
            { label: '指定当前版本', code: 'file_assign', isCommonMethod: false },//文件-指定当前版本
            { label: '比对', code: 'file_add_relative', isCommonMethod: false }//比对
          ]
        }
      }
    },
    computed: {
      getCurrentDocumentType() {
        if (this.tableRowInfo.attributionType === 5 || this.tableRowInfo.attributionType === 6) return 'NC'
        else return 'OTHER'
      }
    },
    methods: {
      menuItemClick({ item, key }) {
        const menuKeyArray = key.split('_')