Bladeren bron

修改计划删除按钮的判断

695593266@qq.com 1 maand geleden
bovenliggende
commit
b405fcea65
1 gewijzigde bestanden met toevoegingen van 24 en 3 verwijderingen
  1. 24 3
      src/views/productionPlan/index.vue

+ 24 - 3
src/views/productionPlan/index.vue

@@ -217,6 +217,7 @@
         :row-class-name="rowClassName"
         @update:selection="handleSelectionChange"
         @columns-change="handleColumnChange"
+        @expand-change="handleExpandChange"
         height="calc(100vh - 390px)"
         full-height="calc(100vh - 116px)"
         :page-size="20"
@@ -360,7 +361,9 @@
               row.joinPlanCode &&
               activeName == 'first' &&
               row.status != 4 &&
-              $hasPermission('aps:productionplan:delete')
+              $hasPermission('aps:productionplan:delete') &&
+              (row.status == 3 || row.status == 2) &&
+              row.approvalStatus != 1
             "
             type="danger"
             :underline="false"
@@ -375,7 +378,9 @@
               activeName == 'first' &&
               isLineNumbre &&
               row.status != 4 &&
-              $hasPermission('aps:productionplan:delete')
+              $hasPermission('aps:productionplan:delete') &&
+              (row.status == 3 || row.status == 2) &&
+              row.approvalStatus != 1
             "
             type="danger"
             :underline="false"
@@ -1246,6 +1251,10 @@
           return this.$message.error('请先选择工艺路线!');
         }
 
+        if (this.planDotLineEnabled && row.dotLineStatus != 1) {
+          return this.$message.error('请先完成布点!');
+        }
+
         const titleText = this.isReview
           ? '是否发起流程'
           : '发布工单后不可撤回,确定发布吗?';
@@ -1365,7 +1374,7 @@
             privateColumn.push({
               columnKey: 'action',
               label: '操作',
-              width: 240,
+              width: 380,
               align: 'center',
               resizable: false,
               fixed: 'right',
@@ -1443,6 +1452,18 @@
         this.selection = this.flattenPlanRows(list);
       },
 
+      handleExpandChange() {
+        this.$nextTick(() => {
+          const table = this.$refs.table;
+          if (!table) return;
+          if (typeof table.doLayout === 'function') {
+            table.doLayout();
+          } else if (table.$refs && table.$refs.table && typeof table.$refs.table.doLayout === 'function') {
+            table.$refs.table.doLayout();
+          }
+        });
+      },
+
       process(row) {
         if (row.approvalStatus == 0) {
           this.$message.info('未提交没有审核流程');