ソースを参照

fix:5357【盘点工单】计划下发来,点击去报工,提示我不是盘点人员,此校验基本都复现,时而又会好

mlchen 1 日 前
コミット
ae993abcdf
1 ファイル変更6 行追加8 行削除
  1. 6 8
      src/views/warehouseManagement/stocktaking/work/index.vue

+ 6 - 8
src/views/warehouseManagement/stocktaking/work/index.vue

@@ -141,18 +141,16 @@
         ],
         // 加载状态
         loading: false,
-        planOrderId: '',
-        userInfo: {}
+        planOrderId: ''
       };
     },
-    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) {
+        const currentUserId = localStorage.getItem('userId');
+        if (
+          !currentUserId ||
+          String(row.executorId) !== String(currentUserId)
+        ) {
           this.$message({
             type: 'error',
             message: '您不是盘点人员,不能报工!',