Z 2 år sedan
förälder
incheckning
b1fe1c5efe
1 ändrade filer med 6 tillägg och 9 borttagningar
  1. 6 9
      src/views/bpm/handleTask/components/businessOpportunity/submit.vue

+ 6 - 9
src/views/bpm/handleTask/components/businessOpportunity/submit.vue

@@ -232,7 +232,7 @@
           let arr = await this.getTableValue();
           let singlePrice = true;
           let totalCount = true;
-          let arrList = arr.map((item) => {
+          let arrList = arr?.productList.map((item) => {
             if (!item.singlePrice) {
               singlePrice = false;
             }
@@ -246,7 +246,7 @@
               totalCount:item.totalCount,
               totalPrice:item.totalPrice
             };
-          });
+          })||[];
          if(this.taskDefinitionKey === 'salesmanApprove'){
          if (!singlePrice) {
             this.$message.warning(`请输入单价`);
@@ -256,15 +256,12 @@
             this.$message.warning(`请输入数量`);
             return;
           }
-}
-          
-          if (!arr) {
-            return;
-          }
-          let data = await updateProduct(arrList);
-          if (data.code != '0') {
+        }
+          if (!arrList.length) {
             return;
           }
+         
+          await updateProduct(arrList);
         }
         this._approveTaskWithVariables(status);
       },