戴艳蓉 3 anni fa
parent
commit
4617347b4c

+ 11 - 10
src/apis/service/goodStore/active/index.js

@@ -5,20 +5,21 @@ export default {
     // 列表
     list: (data, params) => http(api + "activitylist", data, "post", params),
     // 新建
-    add: (data, params) => http(api + "customarcreate", data, "post", params),
-    // 删除
-    delete: (data, params) => http(api + "customardelete", data, "post", params),
-    
+    add: (data, params) => http(api + "actcreate", data, "post", params),
     // 详情
-    detail: (data, params) => http(api + "customarinfo", data, "post", params),
+    detail: (data, params) => http(api + "actinfo", data, "post", params),
+    // 采购定成本
+    actcost: (data, params) => http(api + "actcost", data, "post", params),
+    // 财务定活动价
+    setActivity: (data, params) => http(api + "activity", data, "post", params),
+    // 状态
+    status: (data, params) => http(api + "actexam", data, "post", params),
+    
     // 更新
     update: (data, params) => http(api + "customaredit", data, "post", params),
+    // 删除
+    delete: (data, params) => http(api + "customardelete", data, "post", params),
 
 
 
-    
-    // 状态
-    status: (data, params) => http(api + "resultstatu", data, "post", params),
-
-
 };

+ 41 - 45
src/views/goodStore/active/components/baseForm.vue

@@ -392,51 +392,47 @@ export default {
             this.loading = false;
             return;
           }
-          // if (this.ladder_tableData.length === 0) {
-          //   this.$message.warning("请录入阶梯成本!");
-          //   this.loading = false;
-          // }
-          // let model = JSON.parse(JSON.stringify(this.ruleForm));
-          // model.cat_id = model.cat_id[model.cat_id.length - 1];
-          // model.brandid = model.brandid.toString();
-          // model.supplierNo = model.supplierNo.toString();
-          // model.delivery_place = model.delivery_place.toString();
-          // model.origin_place = model.origin_place.toString();
-          // model.good_info_img = model.good_info_img.toString();
-          // model.unit = model.unit.toString();
-          // model.speclist = JSON.parse(JSON.stringify(this.setResData(1)));
-          // model.good_ladder = JSON.parse(JSON.stringify(this.setResData(2)));
-          // let res = {};
-          // delete model["id"];
-          // if (this.type === "add") {
-          //   delete model["id"];
-          //   delete model["spuCode"];
-          //   res = await asyncRequest.add(model);
-          // } else if (this.type === "editBase") {
-          //   let item1 = this.setModel(model, "1");
-          //   res = await asyncRequest.update(item1);
-          // } else {
-          //   let item2 = this.setModel(model, "2");
-          //   res = await asyncRequest.updateP(item2);
-          // }
-          // console.log(res);
-          // this.loading = false;
-          // if (res && res.code === 0) {
-          //   const { spuCode } = res.data;
-          //   const title =
-          //     this.type === "add"
-          //       ? "新建成功!"
-          //       : this.type === "editBase"
-          //       ? "基础信息修改成功!"
-          //       : "成本信息修改成功!";
-          //   this.$notify.success({
-          //     title: title,
-          //     message: "",
-          //   });
-          //   this.showModelThis = false;
-          //   // 刷新
-          //   this.$emit("refresh", { spuCode: spuCode });
-          // }
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          model.cat_id = model.cat_id[model.cat_id.length - 1];
+          model.brandid = model.brandid.toString();
+          model.supplierNo = model.supplierNo.toString();
+          model.delivery_place = model.delivery_place.toString();
+          model.origin_place = model.origin_place.toString();
+          model.good_info_img = model.good_info_img.toString();
+          model.unit = model.unit.toString();
+          model.speclist = JSON.parse(JSON.stringify(this.setResData(1)));
+          model.good_ladder = JSON.parse(JSON.stringify(this.setResData(2)));
+          let res = {};
+          delete model["id"];
+          if (this.type === "add") {
+            delete model["id"];
+            delete model["spuCode"];
+            res = await asyncRequest.add(model);
+          } else if (this.type === "editBase") {
+            let item1 = this.setModel(model, "1");
+            res = await asyncRequest.update(item1);
+          } else {
+            let item2 = this.setModel(model, "2");
+            res = await asyncRequest.updateP(item2);
+          }
+          console.log(res);
+          this.loading = false;
+          if (res && res.code === 0) {
+            const { spuCode } = res.data;
+            const title =
+              this.type === "add"
+                ? "新建成功!"
+                : this.type === "editBase"
+                ? "基础信息修改成功!"
+                : "成本信息修改成功!";
+            this.$notify.success({
+              title: title,
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh", { spuCode: spuCode });
+          }
         } else {
           console.log("error submit!!");
           return false;