zouyu
2023-12-26 154ef0e4c3dbb483d55e9b2b242021f627bee451
	modified:   src/views/technology/document/index.vue
modified: src/views/technology/routing/index.vue
已修改2个文件
55 ■■■■■ 文件已修改
src/views/technology/document/index.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/technology/routing/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/technology/document/index.vue
@@ -79,7 +79,6 @@
  data() {
    return {
      ids: [],
      uniqueStateArr: [],
      ajaxFun: fetchList,
      multipleSelection: [],
      isShowQuery: false,
@@ -390,7 +389,7 @@
      this.table.toolbar.push({
        text: '新增',
        type: 'primary',
        disabled: true,
        disabled: false,
        fun: ()=>{this.addOrUpdateHandle()},
        permitArr: [],
      })
@@ -441,6 +440,17 @@
      }]
    } 
    this.getBomTypeDbOptions()
  },
  watch:{
    multipleSelection(newVal){
      if(newVal.length==0){
        this.table.toolbar.forEach(ele=>{
          if(ele.text=='拒绝' || ele.text=='批准' || ele.text=='撤销'){
            ele.disabled = true
          }
        })
      }
    }
  },
  methods: {
    getBomTypeDbOptions() {
@@ -548,22 +558,21 @@
          uniqueStateArr.push(stateArr[i])
        }
      }
      this.uniqueStateArr = uniqueStateArr
      // 循环表头按钮,判断每个按钮的permitArr是否完全包含选中状态,若完全包含,则按钮亮,否则按钮灰
      // var toolbar = this.table.toolbar
      // for (var j = 0; j < toolbar.length; j++) {
      //   if (
      //     uniqueStateArr.every((val) =>
      //       toolbar[j].permitArr.length <= 0
      //         ? true
      //         : toolbar[j].permitArr.includes(val)
      //     )
      //   ) {
      //     toolbar[j].disabled = false
      //   } else {
      //     toolbar[j].disabled = true
      //   }
      // }
      var toolbar = this.table.toolbar
      for (var j = 0; j < toolbar.length; j++) {
        if (
          uniqueStateArr.every((val) =>
            toolbar[j].permitArr.length <= 0
              ? true
              : toolbar[j].permitArr.includes(val)
          )
        ) {
          toolbar[j].disabled = false
        } else {
          toolbar[j].disabled = true
        }
      }
      // 将选中记录赋值给multipleSelection
      this.multipleSelection = val
    },
src/views/technology/routing/index.vue
@@ -464,6 +464,7 @@
        text: '批量删除',
        type:'primary',
        disabled: false,
        permitArr: [],
        fun: ()=>{this.copyRouting()},
      })
    }
@@ -483,6 +484,17 @@
    }
    this.getBomTypeDbOptions()
  },
  watch:{
    multipleSelection(newVal){
      if(newVal.length==0){
        this.table.toolbar.forEach(ele=>{
          if(ele.text=='拒绝' || ele.text=='批准' || ele.text=='撤回'){
            ele.disabled = true
          }
        })
      }
    }
  },
  methods: {
    getData() {
      if (this.$refs.routingTable !== undefined) {