lyh
9 天以前 76f83ad33466ea704eec9a121d2e0a22c1828a84
src/views/dnc/base/modules/ProductStructure/Process/ProcessModal.vue
@@ -8,12 +8,11 @@
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <ProcessModalForm ref="realForm" @ok="submitCallback" :allDeviceList="allDeviceList"/>
    <ProcessModalForm ref="realForm" @ok="submitCallback"/>
  </j-modal>
</template>
<script>
  import dncApi from '@/api/dnc'
  import ProcessModalForm from './ProcessModalForm.vue'
  export default {
@@ -31,28 +30,13 @@
        title: '',
        width: 700,
        visible: false,
        allDeviceList: [],
        isAddNextLevel: false // 是否为添加下级,作为树节点是否展开的判断
      }
    },
    watch: {
      visible: {
        handler(value) {
          if (value) this.getAllDeviceListByApi()
        }
      }
    },
    created() {
      this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      getAllDeviceListByApi() {
        dncApi.getAllDeviceListApi()
          .then(res => {
            if (res.success) this.allDeviceList = res.list
          })
      },
      /**
       * 点击部件创建部件下级工序
       */
@@ -64,24 +48,6 @@
            this.$refs.realForm.add({
              productId: this.currentTreeNodeInfo.entity.productId,
              componentId: this.currentTreeNodeInfo.entity.componentId
            })
          }
        })
      },
      /**
       * 点击零件创建零件下级工序
       */
      handlePartsAddRelative() {
        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
            })
          }
        })
@@ -104,6 +70,22 @@
        })
      },
      // 创建工艺规程版本下级工序
      handleVersionAddChild() {
        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,
              psvId: this.currentTreeNodeInfo.id
            })
          }
        })
      },
      /**
       * 编辑工序信息
       */