Browse Source

保存订阅价格

natasha 1 year ago
parent
commit
f224bf55be
1 changed files with 35 additions and 33 deletions
  1. 35 33
      src/views/system_config/OrderSetting.vue

+ 35 - 33
src/views/system_config/OrderSetting.vue

@@ -21,7 +21,7 @@
                 size="small"
                 @click="onSubmit()"
                 :loading="loading"
-                >保存</el-button
+                >保存本页</el-button
               >
             </div>
           </div>
@@ -178,39 +178,41 @@ export default {
       this.loading = true;
       let MethodName =
         "/OrgServer/Manager/ReservationPriceManager/SaveReservationPriceList";
-      let index = 0;
-      Object.getOwnPropertyNames(_this.tableObj).forEach(function (key) {
-        // if(_this.tableObj&&_this.tableObj[key]&&_this.tableObj[key].length>0){
-        let table =
-          _this.tableObj[key].length > 0
-            ? JSON.parse(JSON.stringify(_this.tableObj[key]))
-            : [];
-        table.forEach((item) => {
-          item.comb_count = item.comb_count ? item.comb_count * 1 : 1;
-          item.price = item.price * 1;
-        });
-        let data = {
-          goods_type: key == 1 ? 4 : 2,
-          goods_study_phase: key * 1,
-          reservation_price_list: table,
-        };
-        getLogin(MethodName, data)
-          .then((res) => {
-            // this.loading = false
-            if (res.status === 1) {
-              index++;
-              if (index === Object.keys(_this.tableObj).length + 1) {
-                _this.$message.success("保存成功");
-                _this.loading = false;
-              }
-              // this.$message.success("保存成功")
-            }
-          })
-          .catch((res) => {
-            _this.loading = false;
-          });
-        // }
+      // let index = 0;
+
+      let key = this.typeValue;
+      // Object.getOwnPropertyNames(_this.tableObj).forEach(function (key) {
+      // if(_this.tableObj&&_this.tableObj[key]&&_this.tableObj[key].length>0){
+      let table =
+        _this.tableObj[key].length > 0
+          ? JSON.parse(JSON.stringify(_this.tableObj[key]))
+          : [];
+      table.forEach((item) => {
+        item.comb_count = item.comb_count ? item.comb_count * 1 : 1;
+        item.price = item.price * 1;
       });
+      let data = {
+        goods_type: key == 1 ? 4 : 2,
+        goods_study_phase: key * 1,
+        reservation_price_list: table,
+      };
+      getLogin(MethodName, data)
+        .then((res) => {
+          // this.loading = false
+          if (res.status === 1) {
+            // index++;
+            // if (index === Object.keys(_this.tableObj).length + 1) {
+            _this.$message.success("保存成功");
+            _this.loading = false;
+            // }
+            // this.$message.success("保存成功")
+          }
+        })
+        .catch((res) => {
+          _this.loading = false;
+        });
+      // }
+      // });
     },
     // 取消 恢复到修改前状态
     onCancel() {},