zouyu
2023-12-21 a48ded866d223f581944ea9043df1b296b3425e3
src/views/plan/masterproductionschedule/index.vue
@@ -591,38 +591,7 @@
          } */
        ],
        toolbar: [],
        operator: [
          // {
          //   text: '订单预留',
          //   type: 'text',
          //   size: 'small',
          //   fun: this.customReserved
          // },
          // {
          //   text: '查看库存',
          //   type: 'text',
          //   size: 'small',
          //   fun: this.stockHandle
          // },
          {
            text: '来源',
            type: 'text',
            size: 'small',
            fun: this.searchMasterPlanSourceHandle
          },
          {
            text: '作废',
            type: 'text',
            size: 'small',
            fun: this.deleteMainPlan
          },
          // {
          //   text: '订单',
          //   type: 'text',
          //   size: 'small',
          //   fun: this.searchOrderHandle
          // }
        ],
        operator: null,
        operatorConfig: {
          fixed: 'right',
          label: '操作',
@@ -668,40 +637,25 @@
  },
  created() {
    this.getManufactureAttrs()
    /*
          {
            text: '新增',
            type: 'primary',
            fun: this.addMasterProductionSchedule,
            disabled: false,
            permitArr: []
          },
          {
            text: '创建委外订单',
            fun: this.createOutsourcingOrder
          } */
    if (this.permissions.plan_masterproductionschedule_add) {
      /* this.table.toolbar.push({
        text: '新增',
        type: 'primary',
        fun: this.addMasterProductionSchedule,
        disabled: false,
        permitArr: []
      }) */
    let optionList = []
    if(this.permissions.masterproductionschedule_view_source){
      optionList.push({
            text: '来源',
            type: 'text',
            size: 'small',
            fun: this.searchMasterPlanSourceHandle
          })
    }
    if (this.permissions.masterproductionschedule_create_outsourcing) {
      // this.table.toolbar.push({
      //   text: '创建委外订单',
      //   fun: this.createOutsourcingOrder
      // })
    if(this.permissions.plan_masterproductionschedule_del){
      optionList.push({
            text: '作废',
            type: 'text',
            size: 'small',
            fun: this.deleteMainPlan
          })
    }
    if (this.permissions.masterproductionschedule_create_order_manual) {
      // this.orderTypeArr.push({
      //   label: '手动新增',
      //   command: 'MANUAL',
      //   disabled: false,
      //   permitArr: ['02processed']
      // })
    if(optionList.length>0){
      this.table.operator = optionList
    }
    if (this.permissions.masterproductionschedule_create_order_auto) {
      this.orderTypeArr.push({
@@ -714,7 +668,6 @@
    this.getSysParam(sysParam.IS_REPORT_OPERATION)
  },
  methods: {
    deleteMainPlan(row){},
    getSysParam(paramKey) {
      getSysParam(paramKey).then((response) => {
        var paramVal = response.data.data
@@ -756,6 +709,10 @@
    },
    // 修改
    addOrUpdateHandle(row) {
      if(!this.permissions.plan_masterproductionschedule_edit && row.id!=null){
        this.$message.error("该角色没有操作权限");
        return
      }
      this.addOrUpdateVisible = true
      this.$nextTick(() => {
        this.$refs.addOrUpdate.init(row ? row.id : row, row ? row.state : row)