zouyu
2023-12-26 3b22e9ac778bfc3d3ab8ea9abbb4838f03e80794
	modified:   src/views/technology/completeproductstructure/index.vue
modified: src/views/technology/routing/index.vue
已修改2个文件
100 ■■■■■ 文件已修改
src/views/technology/completeproductstructure/index.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/technology/routing/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/technology/completeproductstructure/index.vue
@@ -10,21 +10,7 @@
        :ajaxFun="ajaxFun"
        ref="completeProductStructureTable"
      >
        <template #toolbar>
          <el-button type="primary" @click="addByStructureHandle"
          v-if="permissions.technology_completeproductstructure_bom">产品结构生成BOM</el-button>
          <el-button @click="() => {this.approveHandle('ACCEPT')}"
          :disabled="uniqueStateArr.includes('01draft')"
          v-if="permissions.technology_completeproductstructure_accept">批准</el-button>
          <el-button @click="() => {this.approveHandle('REVOKE')}"
          :disabled="uniqueStateArr.includes('02accepted')"
          v-if="permissions.technology_completeproductstructure_revoke">撤回</el-button>
          <el-button @click="() => {this.approveHandle('CANCEL')}"
          :disabled="uniqueStateArr.includes('02accepted')"
          v-if="permissions.technology_completeproductstructure_cancel">拒绝</el-button>
          <el-button @click="() => {this.deleteAll()}" type="primary"
          v-if="permissions.technology_completeproductstructure_batch_delete">批量删除</el-button>
        </template>
        <template #toolbar></template>
      </ttable>
    </basic-container>
  </div>
@@ -265,6 +251,48 @@
    this.getData()
  },
  created() {
    if(this.permissions.technology_completeproductstructure_bom){
      this.table.toolbar.push({
        text: '产品结构生成BOM',
        disabled: false,
        type: 'primary',
        fun: ()=>{this.addByStructureHandle()},
        permitArr: [],
      })
    }
    if(this.permissions.technology_completeproductstructure_accept){
      this.table.toolbar.push({
        text: '批准',
        disabled: true,
        fun: ()=>{this.approveHandle('ACCEPT')},
        permitArr: ['01draft'],
      })
    }
    if(this.permissions.technology_completeproductstructure_revoke){
      this.table.toolbar.push({
        text: '撤回',
        disabled: true,
        fun: () => {this.approveHandle('REVOKE')},
        permitArr: ['02accepted'],
      })
    }
    if(this.permissions.technology_completeproductstructure_cancel){
      this.table.toolbar.push({
        text: '拒绝',
        disabled: true,
        fun: ()=>{this.approveHandle('CANCEL')},
        permitArr: ['02accepted'],
      })
    }
    if(this.permissions.technology_completeproductstructure_batch_delete){
      this.table.toolbar.push({
        text: '批量删除',
        type:'primary',
        disabled: false,
        permitArr: [],
        fun: ()=>{this.deleteAll()},
      })
    }
    if(this.permissions.technology_completeproductstructure_del){
        this.table.operator = [
          {
@@ -276,6 +304,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() {
@@ -422,22 +461,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
@@ -465,7 +465,7 @@
        type:'primary',
        disabled: false,
        permitArr: [],
        fun: ()=>{this.copyRouting()},
        fun: ()=>{this.deleteAll()},
      })
    }
    if(this.permissions.technology_routing_del){