1
李喆(开发组)
2025-07-10 d4c4a585e4179cb9e0b4f099c71bcadae63bf010
1
已修改2个文件
50 ■■■■■ 文件已修改
src/views/basesetting/machine.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wel/index.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basesetting/machine.vue
@@ -46,6 +46,7 @@
export default {
  data() {
    var that = this;
    var aurl = "/blade-system/dept/lazy-list";
    return {
      machineTitle: "新增",
      isAdd: true,
@@ -174,7 +175,7 @@
              label: 'deptName',
              value: 'id'
            },
            dicUrl: `/blade-system/dept/lazy-list`
            dicUrl: aurl
          },
          {
            label: '生产商',
src/views/wel/index.vue
@@ -73,7 +73,7 @@
        emptyText: "取消",
        menuPosition: "right",
        column: [{
          label: '升版',
          label: '工序版次',
          prop: 'processEdition',
          labelWidth: "80",
          span: 22
@@ -381,12 +381,13 @@
      axios({
        url: '/blade-mdm/program/ncfile/upgrade-process-edition',
        method: 'post',
        data: {id:row.id,newProcessEdition: row.processEdition},
        params: {bindNcNodeId:row.id,newProcessEdition: row.processEdition},
      }).then(
        res => {
            done();
            this.upgradeModal = false;
            //this.$message.success('操作成功');
            this.$message.success('操作成功');
            this.addLocalTreeNode(row.parentId);
        }
      );
    },
@@ -407,7 +408,7 @@
      );
    },
    upgrade(row) {  //升版
      this.upgradeModalForm = row;
      this.upgradeModalForm = {...row};
      this.upgradeModal = true;
    },
    delFile(item) {
@@ -481,15 +482,15 @@
    tabsHandleChange(tabs) {
      this.tabsType = tabs.prop;
    },
    showUpload(row) {
    showUpload(row) {//获取文件内容
      this.fileList = [];
      this.uploadmodalForm = row;
      //获取文件内容
      this.loading = true;
      var obj = {parentId: row.id}
      axios({
        url: '/blade-mdm/program/ncfile/list-by-node',
        url: '/blade-mdm/program/node/lazy-list',
        method: 'get',
        params: {nodeId: row.id},
        params: obj,
      }).then(
        res => {
          this.loading = false;
@@ -531,9 +532,7 @@
        }).then(
          res => {
            this.loading = false;
            var nodeArr = this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[row.parentId];
            var arr = nodeArr.filter(item => item.id !== row.id);
            this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[row.parentId] = arr;
            this.addLocalTreeNode(row.parentId);
          }
        );
      })
@@ -574,7 +573,7 @@
          this.modalBox = false;
          // 修改,更新本地数据
          if (this.modalTitle === "修改") {
            this.updateLocalTreeNode(this.modalForm);
            this.addLocalTreeNode(row.parentId);
          }else {
            // 如果是新增操作,可能需要重新加载数据
            //this.$refs.crud.refreshTable();
@@ -601,28 +600,14 @@
      }).then(
        res => {
          var children = res.data.data || [];
          this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[parentId] = [...children];
          if(parentId == 0) {
            this.data = [...children];
          }else {
            this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[parentId] = [...children];
          }
          this.loading = false;
        }
      );
    },
    updateLocalTreeNode(nodeData) {   //修改的方法
      const updateNode = (nodes) => {
        for (let i = 0; i < nodes.length; i++) {
          if (nodes[i].id === nodeData.id) {
            // 更新节点数据
            Object.assign(nodes[i], nodeData);
            return true;
          }
          if (Array.isArray(nodes[i].children) && nodes[i].children.length > 0) {
            if (updateNode(nodes[i].children)) {
              return true;
            }
          }
        }
        return false;
      };
      updateNode(this.data);
    },
    modalCancel() {
      this.modalBox = false;