Procházet zdrojové kódy

fix(仓库管理): 添加盘点报工权限验证

liujt před 5 měsíci
rodič
revize
96d5371da6

+ 14 - 1
src/views/warehouseManagement/stocktaking/work/index.vue

@@ -141,11 +141,24 @@
         ],
         // 加载状态
         loading: false,
-        planOrderId: ''
+        planOrderId: '',
+        userInfo: {}
       };
     },
+    created() {
+      let info = JSON.parse(localStorage.getItem('info'));
+      this.userInfo = info;
+    },
     methods: {
       control(row) {
+        console.log(row, this.userInfo);
+        if (row.executorId != this.userInfo.userId) {
+          this.$message({
+            type: 'error',
+            message: '您不是盘点人员,不能报工!',
+          });
+          return;
+        }
         this.$refs.disposeDialogRef.open(row.id);
       },
       /* 表格数据源 */