Przeglądaj źródła

供货商 订单 发 快递

jiangfeng 5 lat temu
rodzic
commit
b9e1be6e80
1 zmienionych plików z 11 dodań i 6 usunięć
  1. 11 6
      ghsApp/src/pagesOrder/shipInfo.vue

+ 11 - 6
ghsApp/src/pagesOrder/shipInfo.vue

@@ -93,6 +93,7 @@ export default {
 		},
 		// 表单验证
 		async formSubmit(e) {
+			console.log(this.selectList)
 			try {
 				// 表单规则
 				let rules = [];
@@ -114,10 +115,13 @@ export default {
 					];
 					rules = rules.concat(temp);
 				}
-				const product = this.selectList.map(ele => {
-					return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
-				});
-				formData.product = JSON.stringify(product);
+				if(!this.$util.isEmpty(this.selectList)){
+					const product = this.selectList.map(ele => {
+						return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
+					});
+					formData.product = JSON.stringify(product);
+				}
+
 				if (!this.getMerchantInfo) {
 					await this.initMerchantInfo();
 				}
@@ -125,8 +129,9 @@ export default {
 				if (this.waySele == 1) {
 					formData.sendCost = "免运费";
 				}
-				console.log(9999, formData);
 				let checkRes = formUtil.validation(formData, rules);
+				console.log(checkRes);
+
 				// 验证通过!
 				if (!checkRes) {
 					this.confirmFn(formData);
@@ -134,7 +139,7 @@ export default {
 					this.$msg(checkRes);
 				}
 			} catch (error) {
-				console.log(999999, error);
+				console.log(999999888, error);
 			}
 		},
 		gobackEvent() {