Quellcode durchsuchen

fix(核价管理): 修复生成合同条件判断中的用户ID字段错误、

liujt vor 2 Monaten
Ursprung
Commit
ea3d556677
1 geänderte Dateien mit 12 neuen und 9 gelöschten Zeilen
  1. 12 9
      src/views/purchasingManage/inquiryManage/index.vue

+ 12 - 9
src/views/purchasingManage/inquiryManage/index.vue

@@ -97,7 +97,7 @@
               v-if="
                 [2].includes(row.status) &&
                 ((isAddContract == 1 && row.genContractNum == 0) ||
-                  isAddContract == 0) && row.createUserId == userInfo.id
+                  isAddContract == 0) && row.createUserId == userInfo.userId
               "
             >
               生成合同
@@ -346,7 +346,6 @@
           }
         ],
         cacheKeyUrl: 'eos-151ba34e-inquiryManage',
-        // userInfo: {}
       };
     },
     computed: {
@@ -356,8 +355,6 @@
       },
     },
     created() {
-      // this.userInfo = this.$store.getters;
-      // console.log('userInfo~~~', userInfo);
       this.getTreeData();
       //是否可以重复生成合同//0否 1是
       parameterGetByCode({
@@ -397,6 +394,7 @@
       async addGenerateContract(row = []) {
         let list = row.length ? row : this.selection;
         let { verify, text, ids, isOnly } = this.verify(list);
+        console.log('verify~~~', verify, text, ids, isOnly);
         if (!verify) {
           this.$message.warning(text);
           return;
@@ -479,12 +477,17 @@
           verify = false;
           text = '请至少选择一条数据';
         }
+
+        if (list.some((item) => item.status != 2)) {
+          verify = false;
+          text = '已审核数据才能生成合同';
+        }
+        // 检查是否有创建人不是当前用户的
+        if (list.some((item) => item.createUserId != this.userInfo.userId)) {
+          verify = false;
+          text = '只能自己创建的核价单生成合同';
+        }
         if (list.length > 1) {
-          // 检查是否有创建人不是当前用户的
-          if (list.some((item) => item.createUserId != this.userInfo.id)) {
-            verify = false;
-            text = '只能自己创建的核价单生成合同';
-          }
           if (list.some((item) => item.winnerSuppleIds.split(',').length > 1)) {
             verify = false;
             text = '多核价单且含有多个核价清单的数据不允许批量生成合同';