Explorar el Código

添加秒杀管理、添加分销设置

chengjunhui hace 1 mes
padre
commit
5d74c01837

+ 20 - 0
src/router/index.js

@@ -142,6 +142,26 @@ export const constantRoutes = [
       }
     ]
   },
+  {
+    path: '/marketing',
+    component: Layout,
+    hidden: true,
+    redirect: 'noredirect',
+    children: [
+      {
+        path: 'seckillPd',
+        component: () => import('@/views/marketing/seckill/seckillPd'),
+        name: 'seckillPd',
+        meta: { title: '秒杀活动', icon: 'user' }
+      },
+      {
+        path: 'seckillPdAddUpdate',
+        component: () => import('@/views/marketing/seckill/seckillPdAddUpdate'),
+        name: 'seckillPdAddUpdate',
+        meta: { title: '秒杀活动新增', icon: 'user' }
+      }
+    ]
+  },
 ]
 
 // 动态路由,基于用户权限动态去加载

+ 582 - 0
src/views/marketing/discountsSet.vue

@@ -0,0 +1,582 @@
+<template>
+  <div class="app-container">
+    <el-form :model="form" :rules="rules" ref="form">
+      <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+        <el-tab-pane label="自营商品分佣设置" name="1" v-loading="loading">
+          <el-form-item label="是否开启分佣">
+            <el-switch
+              v-model="form.open"
+              active-color="#13ce66"
+              :active-value="true"
+              :inactive-value="false"
+            ></el-switch>
+          </el-form-item>
+          <div v-if="form.open">
+            <el-form-item label="分润方式" prop="compute_mode">
+              <el-radio v-model="form.compute_mode" :label="0"
+                >固定价格</el-radio
+              >
+              <el-radio v-model="form.compute_mode" :label="1"
+                >固定比例</el-radio
+              >
+            </el-form-item>
+            <div v-if="form.compute_mode === 0">
+              <el-form-item label="一级固定价格" prop="first_level_price">
+                <el-input
+                  placeholder="请输入一级固定价格"
+                  class="input"
+                  maxlength="8"
+                  @input="limitInput($event, 'first_level_price')"
+                  v-model="form.first_level_price"
+                >
+                  <template slot="append">元</template>
+                </el-input>
+              </el-form-item>
+              <el-form-item label="二级固定价格" prop="second_level_price">
+                <el-input
+                  placeholder="请输入二级固定价格"
+                  class="input"
+                  maxlength="8"
+                  @input="limitInput($event, 'second_level_price')"
+                  v-model="form.second_level_price"
+                >
+                  <template slot="append">元</template>
+                </el-input>
+              </el-form-item>
+            </div>
+            <div v-if="form.compute_mode === 1">
+              <el-form-item label="一级固定比例" prop="first_level_ratio">
+                <el-input
+                  placeholder="请输入一级固定比例"
+                  class="input"
+                  maxlength="8"
+                  @input="limitInput($event, 'first_level_ratio')"
+                  v-model="form.first_level_ratio"
+                >
+                  <template slot="append">%</template>
+                </el-input>
+              </el-form-item>
+              <el-form-item label="二级固定比例" prop="second_level_ratio">
+                <el-input
+                  placeholder="请输入二级固定比例"
+                  class="input"
+                  maxlength="8"
+                  @input="limitInput($event, 'second_level_ratio')"
+                  v-model="form.second_level_ratio"
+                >
+                  <template slot="append">%</template>
+                </el-input>
+              </el-form-item>
+            </div>
+          </div>
+        </el-tab-pane>
+        <el-tab-pane
+          label="代销商品小程序分佣设置"
+          name="2"
+          v-if="platform_shop && false"
+        >
+          <el-form-item label="是否开启分佣">
+            <el-switch
+              v-model="form.open"
+              active-color="#13ce66"
+              :active-value="true"
+              :inactive-value="false"
+            ></el-switch>
+          </el-form-item>
+          <!-- form.open&&form.proxy_goods_rule -->
+          <el-form-item label="分佣方式" v-if="0">
+            <br />
+            <div>
+              <div class="title">282礼包</div>
+              <div class="content">
+                <el-input
+                  class="input"
+                  maxlength="8"
+                  @input="limitInputtwo($event, 'oneVal')"
+                  v-model="oneVal"
+                >
+                  <template slot="prepend">一级</template>
+                  <template slot="append">元</template>
+                </el-input>
+                <el-input
+                  class="input"
+                  maxlength="8"
+                  @input="limitInputtwo($event, 'twoVal')"
+                  v-model="twoVal"
+                >
+                  <template slot="prepend">二级</template>
+                  <template slot="append">元</template>
+                </el-input>
+                <div>
+                  <el-input
+                    class="input m"
+                    maxlength="8"
+                    @input="limitInputtwo($event, 'threeVal')"
+                    v-model="threeVal"
+                  >
+                    <template slot="prepend">市级代理</template>
+                    <template slot="append">元</template>
+                  </el-input>
+                </div>
+              </div>
+            </div>
+            <div>
+              <div class="title">6750礼包</div>
+              <div class="content">
+                <el-input
+                  class="input m"
+                  maxlength="8"
+                  @input="limitInputtwo($event, 'cardVal1')"
+                  v-model="cardVal1"
+                >
+                  <template slot="prepend">平台合伙人</template>
+                  <template slot="append">元</template>
+                </el-input>
+                <el-input
+                  class="input b"
+                  maxlength="8"
+                  @input="limitInputtwo($event, 'cardVal2')"
+                  v-model="cardVal2"
+                >
+                  <template slot="prepend"
+                    >【间接】市级代理 / 县级代理</template
+                  >
+                  <template slot="append">元</template>
+                </el-input>
+                <div>
+                  <el-input
+                    class="input b"
+                    maxlength="8"
+                    @input="limitInputtwo($event, 'cardVal3')"
+                    v-model="cardVal3"
+                  >
+                    <template slot="prepend">
+                      【直接】市级代理 / 县级代理</template
+                    >
+                    <template slot="append">元</template>
+                  </el-input>
+                </div>
+                <el-input
+                  class="input b"
+                  maxlength="5"
+                  @input="limitInputtwo($event, 'cardVal4')"
+                  v-model="cardVal4"
+                >
+                  <template slot="prepend"> 市级代理 / 县级代理</template>
+                  <template slot="append">%实际销售价</template>
+                </el-input>
+                <el-input
+                  class="input b"
+                  maxlength="5"
+                  @input="limitInputtwo($event, 'cardVal5')"
+                  v-model="cardVal5"
+                >
+                  <template slot="prepend"> 市级代理 / 县级代理</template>
+                  <template slot="append">%实际销售价</template>
+                </el-input>
+              </div>
+            </div>
+
+            <div>
+              <div class="title">差价分佣</div>
+              <div class="content">
+                <el-input class="input b" maxlength="8" value="折扣差" disabled>
+                  <template slot="prepend"> 平台合伙人</template>
+                  <template slot="append">* 实际销售价</template>
+                </el-input>
+                <el-input class="input b" maxlength="8" value="折扣差" disabled>
+                  <template slot="prepend"
+                    >【间接】市级代理 / 县级代理</template
+                  >
+                  <template slot="append">* 实际销售价</template>
+                </el-input>
+                <div>
+                  <el-input
+                    class="input b"
+                    maxlength="8"
+                    value="折扣差"
+                    disabled
+                  >
+                    <template slot="prepend"
+                      >【直接】市级代理 / 县级代理</template
+                    >
+                    <template slot="append">* 实际销售价</template>
+                  </el-input>
+                </div>
+                <div>
+                  <el-input
+                    class="input b"
+                    maxlength="5"
+                    @input="limitInputtwo($event, 'lastVal1')"
+                    v-model="lastVal1"
+                  >
+                    <template slot="prepend"> 市级代理 / 县级代理</template>
+                    <template slot="append">% 实际销售价</template>
+                  </el-input>
+                  <el-input
+                    class="input b"
+                    maxlength="5"
+                    @input="limitInputtwo($event, 'lastVal2')"
+                    v-model="lastVal2"
+                  >
+                    <template slot="prepend"> 市级代理 / 县级代理</template>
+                    <template slot="append">% 实际销售价</template>
+                  </el-input>
+                </div>
+              </div>
+            </div>
+          </el-form-item>
+        </el-tab-pane>
+        <el-tab-pane
+          label="商家分享设置"
+          name="3"
+          v-loading="loading"
+          v-if="false"
+        >
+          <el-form-item label="是否开启分享">
+            <el-switch
+              v-model="form.is_share"
+              @change="switchTrue"
+              :active-value="true"
+              :inactive-value="false"
+            ></el-switch>
+          </el-form-item>
+          <!-- <el-form-item label="是否开启App分享" v-if="form.is_share">
+						<el-switch  v-model="form.is_app_share"   :active-value="true" :inactive-value="false"></el-switch>
+					</el-form-item> -->
+          <el-form-item label="是否开启小程序分享" v-if="form.is_share">
+            <el-switch
+              v-model="form.is_applets_share"
+              :active-value="true"
+              :inactive-value="false"
+            ></el-switch>
+          </el-form-item>
+          <el-form-item
+            label="会员分享提成比例(%)"
+            :rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
+          >
+            <el-input-number
+              placeholder="请输入"
+              class="input"
+              :min="0"
+              :max="100"
+              :controls="false"
+              :precision="0"
+              v-model="form.user_share_ratio"
+            >
+            </el-input-number>
+          </el-form-item>
+          <el-form-item
+            label="网红分享提成比例(%)"
+            :rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
+          >
+            <el-input-number
+              placeholder="请输入"
+              class="input"
+              maxlength="8"
+              :min="0"
+              :max="100"
+              :controls="false"
+              :precision="0"
+              v-model="form.net_red_share_ratio"
+            >
+            </el-input-number>
+          </el-form-item>
+          <el-form-item
+            label="会员打开分享商品链接的有效时间(天)"
+            :rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
+          >
+            <el-input-number
+              placeholder="请输入"
+              class="input"
+              maxlength="8"
+              :min="0"
+              :controls="false"
+              :max="10000"
+              :precision="0"
+              v-model="form.user_share_valid_time"
+            >
+            </el-input-number>
+          </el-form-item>
+        </el-tab-pane>
+      </el-tabs>
+      <el-form-item>
+        <el-button type="primary" @click="onSubmit('form')">提交</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+// import serviceApione from "@/api/serviceApione.js";
+export default {
+  data() {
+    return {
+      activeName: "1",
+      form: {
+        open: false,
+      },
+      loading: false,
+      platform_shop: false,
+      oneVal: "",
+      twoVal: "",
+      threeVal: "",
+      cardVal1: "",
+      cardVal2: "",
+      cardVal3: "",
+      cardVal4: "",
+      cardVal5: "",
+      lastVal1: "",
+      lastVal2: "",
+      rules: {
+        compute_mode: [
+          {
+            required: true,
+            message: "请选择分润方式",
+            trigger: "blur",
+          },
+        ],
+        first_level_price: [
+          {
+            required: true,
+            message: "请输入一级固定价格",
+            trigger: "blur",
+          },
+        ],
+        second_level_price: [
+          {
+            required: true,
+            message: "请输入二级固定价格",
+            trigger: "blur",
+          },
+        ],
+        first_level_ratio: [
+          {
+            required: true,
+            message: "请输入一级固定比例",
+            trigger: "blur",
+          },
+        ],
+        second_level_ratio: [
+          {
+            required: true,
+            message: "请输入二级固定比例",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+
+  mounted() {
+    // this.searchSetting();
+    // this.getShopInfoAdmin();
+  },
+
+  methods: {
+    switchTrue(e) {
+      if (e == false) {
+        this.form.is_app_share = false;
+        this.form.is_applets_share = false;
+      }
+    },
+    limitInput(value, name) {
+      this.form[name] =
+        ("" + value) // 第一步:转成字符串
+          .replace(/[^\d^\.]+/g, "") // 第二步:把不是数字,不是小数点的过滤掉
+          .replace(/^0+(\d)/, "$1") // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字
+          .replace(/^\./, "0.") // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全
+          .match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数
+    },
+    limitInputtwo(value, name) {
+      this[name] =
+        ("" + value) // 第一步:转成字符串
+          .replace(/[^\d^\.]+/g, "") // 第二步:把不是数字,不是小数点的过滤掉
+          .replace(/^0+(\d)/, "$1") // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字
+          .replace(/^\./, "0.") // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全
+          .match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数
+    },
+    getShopInfoAdmin() {
+      serviceApione.getShopInfoAdmin().then((res) => {
+        if (res.data.data) {
+          this.platform_shop = res.data.data.platform_shop;
+        }
+      });
+    },
+    handleClick(e) {
+      this.loading = true;
+      if (e.name == 1) {
+        this.form = {};
+        this.searchSetting();
+      } else if (e.name == 2) {
+        this.form = {
+          proxy_goods_rule: {
+            gift_one_rule: {},
+            gift_two_rule: {},
+            spread_price_rule: {},
+          },
+          open: false,
+        };
+        this.searchShopproxyconfig();
+      } else {
+        this.getShare();
+      }
+    },
+
+    /**
+     * 查询自营商品分佣设置
+     * */
+    searchSetting() {
+      serviceApione.getGoodsSalesConfig().then((res) => {
+        if (res.data && res.data.code == 200) {
+          if (res.data.data) {
+            this.form = res.data.data;
+          }
+        }
+        this.loading = false;
+      });
+    },
+    getShare() {
+      serviceApione.getShare().then((res) => {
+        if (res.data && res.data.code == 200) {
+          if (res.data.config) {
+            this.form = res.data.config;
+          }
+        }
+        this.loading = false;
+      });
+    },
+    // 保存
+    onSubmit(e) {
+      if (this.activeName == 1) {
+        this.$refs["form"].validate((valid) => {
+          if (valid) {
+            serviceApione.setGoodsSalesConfig(this.form).then((res) => {
+              if (res.data && res.data.code == 200) {
+                this.$message.success("保存成功!");
+              }
+            });
+          } else {
+            console.log("error submit!!");
+            return false;
+          }
+        });
+      } else if (this.activeName == 2) {
+        this.form.proxy_goods_rule.gift_one_rule.one_level = this.oneVal;
+        this.form.proxy_goods_rule.gift_one_rule.two_level = this.twoVal;
+        this.form.proxy_goods_rule.gift_one_rule.city_proxy = this.threeVal;
+
+        this.form.proxy_goods_rule.gift_two_rule.direct_partner = this.cardVal1;
+        this.form.proxy_goods_rule.gift_two_rule.indirect_county_city =
+          this.cardVal2;
+        this.form.proxy_goods_rule.gift_two_rule.direct_county_city =
+          this.cardVal3;
+        this.form.proxy_goods_rule.gift_two_rule.ten_county_city =
+          this.cardVal4;
+        this.form.proxy_goods_rule.gift_two_rule.seven_county_city =
+          this.cardVal5;
+
+        this.form.proxy_goods_rule.spread_price_rule.ten_county_city =
+          this.lastVal1;
+        this.form.proxy_goods_rule.spread_price_rule.seven_county_city =
+          this.lastVal2;
+        serviceApione.setShopproxyconfig(this.form).then((res) => {
+          if (res.data && res.data.code == 200) {
+            this.$message.success("保存成功!");
+          }
+        });
+      } else {
+        serviceApione
+          .shareSave({
+            is_share: this.form.is_share,
+            is_app_share: this.form.is_app_share,
+            is_applets_share: this.form.is_applets_share,
+            user_share_ratio: this.form.user_share_ratio,
+            net_red_share_ratio: this.form.net_red_share_ratio,
+            user_share_valid_time: this.form.user_share_valid_time,
+          })
+          .then((res) => {
+            if (res.data && res.data.code == 200) {
+              this.$message.success("保存成功!");
+            }
+          });
+      }
+    },
+
+    /**
+     * 查询平台商家代销商品小程序分佣配置
+     * */
+    searchShopproxyconfig() {
+      serviceApione.getShopproxyconfig().then((res) => {
+        if (res.data && res.data.code == 200) {
+          if (res.data.data) {
+            let keys = res.data.data;
+            this.oneVal = keys.proxy_goods_rule.gift_one_rule.one_level;
+            this.twoVal = keys.proxy_goods_rule.gift_one_rule.two_level;
+            this.threeVal = keys.proxy_goods_rule.gift_one_rule.city_proxy;
+
+            this.cardVal1 = keys.proxy_goods_rule.gift_two_rule.direct_partner;
+            this.cardVal2 =
+              keys.proxy_goods_rule.gift_two_rule.indirect_county_city;
+            this.cardVal3 =
+              keys.proxy_goods_rule.gift_two_rule.direct_county_city;
+            this.cardVal4 = keys.proxy_goods_rule.gift_two_rule.ten_county_city;
+            this.cardVal5 =
+              keys.proxy_goods_rule.gift_two_rule.seven_county_city;
+
+            this.lastVal1 =
+              keys.proxy_goods_rule.spread_price_rule.ten_county_city;
+            this.lastVal2 =
+              keys.proxy_goods_rule.spread_price_rule.seven_county_city;
+
+            this.form.open = keys.open;
+          }
+        }
+        this.loading = false;
+      });
+    },
+  },
+};
+</script>
+
+<style>
+.el-flex {
+  display: flex;
+}
+
+.mt30 {
+  margin-top: 30px;
+}
+
+.wt80 {
+  width: 80px;
+}
+
+.ml10 {
+  margin-left: 10px;
+}
+
+.input {
+  width: 222px;
+  margin-right: 10px;
+}
+
+.m {
+  width: 333px !important;
+}
+
+.b {
+  width: 444px !important;
+}
+
+.content > div {
+  margin-bottom: 15px;
+}
+
+.title {
+  margin: 25px 0 10px 0;
+  padding-left: 15px;
+  border-left: 4px solid #17b3a3;
+  line-height: 14px;
+}
+</style>

+ 355 - 0
src/views/marketing/seckill/components/SeckillAddUpdate.vue

@@ -0,0 +1,355 @@
+<template>
+  <el-drawer
+    :title="!dataForm.id ? '新增' : '修改'"
+    size="900px"
+    :visible.sync="visible"
+    :wrapperClosable="false"
+  >
+    <el-form
+      :model="dataForm"
+      :rules="dataRule"
+      ref="dataForm"
+      @keyup.enter.native="dataFormSubmit()"
+      label-width="200px"
+      style="padding-right: 30px"
+    >
+      <el-form-item label="活动名称" prop="name">
+        <el-input
+          placeholder="活动名称"
+          v-model="dataForm.name"
+          maxlength="15"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="起止时间" prop="start_time" class="date-lable">
+        <el-form-item prop="start_time" label-width="0px">
+          <el-date-picker
+            v-model="dataForm.start_time"
+            type="date"
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <span style="padding: 0 20px">——</span>
+        <el-form-item prop="end_time" label-width="0px">
+          <el-date-picker
+            v-model="dataForm.end_time"
+            type="date"
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-form-item>
+      <el-form-item label="周期" prop="cycle_mode">
+        <el-radio-group v-model="dataForm.cycle_mode">
+          <el-radio :label="0">每天</el-radio>
+          <el-radio :label="1">每周</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="" v-show="dataForm.cycle_mode == 1">
+        <el-checkbox-group v-model="dataForm.week_list">
+          <el-checkbox-button
+            v-for="(item, i) in weeklist"
+            :label="item.label"
+            :key="i"
+            >{{ item.name }}</el-checkbox-button
+          >
+        </el-checkbox-group>
+      </el-form-item>
+
+      <div class="mt10 timeQuantum-box">
+        <el-form-item label="时间段" prop="start_hour">
+          <el-radio-group v-model="timeQuantum" @change="selectTimeQuantum">
+            <el-radio
+              :label="item.id"
+              v-for="item in timeQuantumList"
+              :key="item.id"
+            >
+              {{ item.start_hour }}-{{ item.end_hour }}</el-radio
+            >
+          </el-radio-group>
+        </el-form-item>
+      </div>
+
+      <el-form-item label="活动图片" prop="img_url">
+        <ImageUpload v-model="imgArr" :fileSize="0" :limit="1" :isShowTip="false" :fileType="['jpg', 'png']"/>
+        <div>上传jpg/png文件;尺寸建议750x268</div>
+      </el-form-item>
+      <el-form-item label="活动说明" prop="explain">
+        <el-input
+          type="textarea"
+          placeholder=""
+          v-model="dataForm.explain"
+          :maxlength="200"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="订单自动关闭时间(分钟)" prop="close_time">
+        <el-input-number
+          v-model="dataForm.close_time"
+          :min="3"
+          :precision="0"
+          :controls="false"
+          :max="360"
+        ></el-input-number>
+        可输入3-360分钟
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="visible = false">取消</el-button>
+        <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
+      </el-form-item>
+    </el-form>
+  </el-drawer>
+</template>
+
+<script>
+// import seviceApi from "@/api/serviceApi.js";
+// import sysService from "@/api/sysService.js";
+export default {
+  data() {
+    return {
+      visible: false,
+      value: 1,
+      week: "", // 选择星期
+      timeQuantum: "", // 选择时间段
+      dialogVisible: false,
+      dataForm: {},
+      imgArr: [],
+      weeklist: [
+        {
+          label: 1,
+          name: "周一",
+        },
+        {
+          label: 2,
+          name: "周二",
+        },
+        {
+          label: 3,
+          name: "周三",
+        },
+        {
+          label: 4,
+          name: "周四",
+        },
+        {
+          label: 5,
+          name: "周五",
+        },
+        {
+          label: 6,
+          name: "周六",
+        },
+        {
+          label: 0,
+          name: "周日",
+        },
+      ],
+      dataRule: {
+        name: [
+          {
+            required: true,
+            message: "菜单名称不能为空",
+            trigger: "blur",
+          },
+        ],
+        start_time: [
+          {
+            required: true,
+            message: "起止时间不能为空",
+            trigger: "blur",
+          },
+        ],
+        end_time: [
+          {
+            required: true,
+            message: "起止时间不能为空",
+            trigger: "blur",
+          },
+        ],
+        img_url: [
+          {
+            required: true,
+            message: "活动图片不能为空",
+            trigger: "blur",
+          },
+        ],
+        close_time: [
+          {
+            required: true,
+            message: "订单自动关闭时间(小时)不能为空",
+            trigger: "blur",
+          },
+        ],
+        start_hour: [
+          {
+            required: true,
+            message: "时间段不能为空",
+            trigger: "blur",
+          },
+        ],
+        cycle_mode: [
+          {
+            required: true,
+            message: "周期不能为空",
+            trigger: "change",
+          },
+        ],
+      },
+      timeQuantumList: [],
+    };
+  },
+
+  methods: {
+    init(id) {
+      //   this.resetData();
+      //   this.getAllKillConfig();
+      //   this.dataForm.id = id || null;
+      this.visible = true;
+
+      if (id != undefined) {
+        seviceApi.getSeckillactivityInfo(id).then((res) => {
+          if (res && res.data.code == 200) {
+            res.data.data.week_list = res.data.data.week_list || [];
+            this.dataForm = res.data.data;
+
+            this.imgArr = this.dataForm.img_url.split(";");
+            for (let item of this.timeQuantumList) {
+              if (item.start_hour == res.data.data.start_hour) {
+                this.timeQuantum = item.id;
+                return false;
+              }
+            }
+            console.log(this.dataForm);
+          }
+        });
+      }
+    },
+    /** 重置表单数据 */
+    resetData() {
+      this.dataForm = {
+        name: "",
+        start_hour: "",
+        end_hour: "",
+        start_time: "",
+        end_time: "",
+        img_url: "",
+        explain: "",
+        close_time: "",
+        cycle_mode: "",
+        week_list: [],
+      };
+      this.resetForm("dataForm");
+      this.imgArr = [];
+      this.timeQuantum = "";
+      this.timeQuantumList = [];
+    },
+    // 选择周几
+    selectWeek() {
+      // console.log(this.dataForm.week_list)
+    },
+    // 选择时间段
+    selectTimeQuantum(e) {
+      for (let item of this.timeQuantumList) {
+        if (item.id == e) {
+          this.dataForm.start_hour = item.start_hour;
+          this.dataForm.end_hour = item.end_hour;
+          return false;
+        }
+      }
+      this.$refs["dataForm"].clearValidate(["start_hour"]);
+    },
+    getAllKillConfig() {
+      sysService.seckillConfigInfo().then((res) => {
+        this.timeQuantumList = res.data.list || [];
+      });
+    },
+    // 提交
+    dataFormSubmit() {
+      this.$refs["dataForm"].validate((valid) => {
+        if (valid) {
+          if (
+            Object.prototype.toString.call(this.dataForm.img_url) ===
+            "[object Array]"
+          ) {
+            this.dataForm.img_url = this.dataForm.img_url.join(",");
+          } else {
+            this.dataForm.img_url = this.dataForm.img_url;
+          }
+          if (
+            new Date(this.dataForm.end_time).getTime() -
+              new Date(this.dataForm.start_time).getTime() <
+            0
+          ) {
+            this.$message({
+              showClose: true,
+              message: "结束时间不能小于开始时间",
+              type: "error",
+            });
+            return false;
+          }
+          if (this.dataForm.id == null || undefined) {
+            delete this.dataForm.id;
+            seviceApi.saveSeckillactivity(this.dataForm).then((res) => {
+              if (res && res.data.code == 200) {
+                this.$message({
+                  showClose: true,
+                  message: "添加成功",
+                  type: "success",
+                });
+                this.visible = false;
+                this.$emit("updataList", 1);
+              }
+            });
+          } else {
+            delete this.dataForm.discard;
+            seviceApi.updateSeckillactivity(this.dataForm).then((res) => {
+              if (res && res.data.code == 200) {
+                this.$message({
+                  showClose: true,
+                  message: "修改成功",
+                  type: "success",
+                });
+                this.visible = false;
+                this.$emit("updataList", 1);
+              }
+            });
+          }
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.el-radio__label {
+  border: 1px solid #dcdfe6;
+  padding: 8px 12px;
+  margin-left: 10px;
+  border-radius: 4px;
+}
+
+.mt10 {
+  margin-top: 10px;
+}
+
+.mt30 {
+  margin-top: 30px;
+}
+.date-lable {
+  ::v-deep .el-form-item__content {
+    display: flex;
+    justify-content: flex-start;
+  }
+}
+
+.timeQuantum-box {
+  .el-radio-group {
+    .el-radio {
+      margin-left: 0;
+      margin-bottom: 20px;
+    }
+  }
+}
+</style>

+ 253 - 0
src/views/marketing/seckill/list.vue

@@ -0,0 +1,253 @@
+<template>
+  <div class="app-container">
+    <el-form :inline="true" :model="search" ref="queryForm">
+      <el-form-item label="活动名称" prop="name">
+        <el-input
+          v-model="search.name"
+          placeholder="活动名称"
+          clearable
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="活动状态" prop="active_state">
+        <el-select v-model="search.active_state" clearable placeholder="请选择">
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-plus" :size="ELsize" @click="addOrUpdateHandle()">新增</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <el-table :data="dataList" row-key="Id" border style="width: 100%">
+      <el-table-column prop="name" align="center" label="活动名称">
+      </el-table-column>
+      <el-table-column prop="goods_num" align="center" label="活动商品">
+      </el-table-column>
+      <el-table-column
+        prop="start_time,end_time,start_hour,end_hour,week_transform"
+        align="center"
+        label="活动时间"
+        width="400"
+      >
+        <template slot-scope="scope">
+          <div>{{ scope.row.start_time }}至{{ scope.row.end_time }}</div>
+          <div v-if="scope.row.cycle_mode == 0">
+            每天 {{ scope.row.start_hour }}—{{ scope.row.end_hour }}
+          </div>
+          <div v-if="scope.row.cycle_mode == 1">
+            每周
+            <span v-for="(item, index) in scope.row.week_list" :key="item.id">
+              <template v-if="item == 1">一</template>
+              <template v-if="item == 2">二</template>
+              <template v-if="item == 3">三</template>
+              <template v-if="item == 4">四</template>
+              <template v-if="item == 5">五</template>
+              <template v-if="item == 6">六</template>
+              <template v-if="item == 0">日</template>
+              <template v-if="index < scope.row.week_list.length - 1"
+                >,</template
+              >
+            </span>
+
+            {{ scope.row.start_hour }}—{{ scope.row.end_hour }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="active_state"
+        align="center"
+        :formatter="activeState"
+        label="活动状态"
+      >
+        <template slot-scope="scope">
+          <template v-if="scope.row.discard">
+            <el-tag type="danger">已终止</el-tag>
+          </template>
+          <template v-else>
+            <el-tag type="info" v-if="scope.row.active_state === 0"
+              >未开始</el-tag
+            >
+            <el-tag type="success" v-else-if="scope.row.active_state == 1"
+              >进行中</el-tag
+            >
+            <el-tag type="danger" v-else>已结束</el-tag>
+          </template>
+        </template>
+      </el-table-column>
+      <el-table-column
+        fixed="right"
+        header-align="center"
+        align="center"
+        label="操作"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="text"
+            size="small"
+            v-if="
+              scope.row.active_time_state != 1 &&
+              scope.row.active_time_state != 2
+            "
+            @click="addOrUpdateHandle(scope.row.id)"
+            >修改</el-button
+          >
+          <el-button type="text" size="small" @click="goSeckillPd(scope.row.id)"
+            >管理商品</el-button
+          >
+          <el-button
+            type="text"
+            size="small"
+            class="c-error"
+            v-if="scope.row.active_time_state != 1"
+            @click="deleteHandle(scope.row.id)"
+            >删除</el-button
+          >
+          <el-button
+            type="text"
+            size="small"
+            @click="goSeckillStop(scope.row.id)"
+            v-if="scope.row.active_state == 1 && !scope.row.discard"
+            >终止</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 弹窗, 新增 / 修改 -->
+    <SeckillAddUpdate
+      v-if="addOrUpdateVisible"
+      ref="seckillAddUpdate"
+      @updataList="updataList"
+    ></SeckillAddUpdate>
+  </div>
+</template>
+
+<script>
+// import seviceApi from "@/api/serviceApi.js";
+// import sysService from "@/api/sysService.js";
+import getListApi from "@/mixins/getListApi";
+import SeckillAddUpdate from "./components/SeckillAddUpdate";
+
+export default {
+  mixins: [getListApi],
+  data() {
+    return {
+      //   listURL: agentAccountCodeApplyWaitPage,
+
+      options: [
+        {
+          label: "未开始",
+          value: 0,
+        },
+        {
+          label: "进行中",
+          value: 1,
+        },
+        {
+          label: "已结束",
+          value: 2,
+        },
+        {
+          label: "已终止",
+          value: 3,
+        },
+      ],
+      dataListLoading: false,
+      addOrUpdateVisible: false,
+    };
+  },
+
+  components: {
+    SeckillAddUpdate,
+  },
+  mounted() {},
+  methods: {
+    updataList(e) {
+      if (e == 1) {
+        this.getList();
+      }
+    },
+    // 活动状态
+    activeState(row, column) {
+      let status = row.active_state;
+      if (status === 0) {
+        return "未开始";
+      } else if (status === 1) {
+        return "进行中";
+      } else {
+        return "已结束";
+      }
+    },
+    // 新增 / 修改
+    addOrUpdateHandle(id) {
+      this.addOrUpdateVisible = true;
+      this.$nextTick(() => {
+        this.$refs.seckillAddUpdate.init(id);
+      });
+    },
+    // 管理商品页
+    goSeckillPd(id) {
+      // this.$router.push({name:'seckill-pd'},);
+      this.$router.push({ path: "/marketing/seckillPd", query: { id: id } });
+    },
+    // 删除
+    deleteHandle(id) {
+      this.$confirm(`确定要删除该条数据?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          seviceApi.delSeckillactivity(id).then((res) => {
+            if (res && res.data.code == 200) {
+              this.$message({
+                message: "删除成功",
+                type: "success",
+              });
+              this.getList();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+    goSeckillStop(id) {
+      this.$confirm(`确定要终止该秒杀活动吗?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          sysService.seckillStop(id).then((res) => {
+            if (res && res.data.code == 200) {
+              this.$message({
+                message: "终止成功",
+                type: "success",
+              });
+              this.getList();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+  },
+};
+</script>

+ 182 - 0
src/views/marketing/seckill/seckillPd.vue

@@ -0,0 +1,182 @@
+<template>
+  <div class="app-container">
+    <div class="mb10">
+      <el-button @click="getBack">返回秒杀列表</el-button>
+    </div>
+    <el-form :inline="true" :model="search">
+      <el-form-item label="商品名称">
+        <el-input
+          v-model="search.title"
+          placeholder="商品名称"
+          clearable
+        ></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          :size="ELsize"
+          @click="addOrUpdateHandle()"
+          >新增</el-button
+        >
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+    <el-table :data="dataList" row-key="Id" border style="width: 100%">
+      <el-table-column prop="title" align="center" label="商品名称">
+      </el-table-column>
+      <el-table-column prop="min_sale_price" align="center" label="销售价格">
+      </el-table-column>
+      <el-table-column prop="min_price" align="center" label="活动价格">
+      </el-table-column>
+      <el-table-column prop="limit_buy_num" align="center" label="限购">
+        <template slot-scope="scope">
+          <span v-if="scope.row.limit_buy_num == 0">不限购</span>
+          <span v-else>{{ scope.row.limit_buy_num }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="real_stock_total" align="center" label="可售数量">
+      </el-table-column>
+      <el-table-column prop="result_sale_num" align="center" label="已售数量">
+      </el-table-column>
+      <el-table-column prop="sort" align="center" label="商品排序">
+      </el-table-column>
+      <el-table-column
+        fixed="right"
+        header-align="center"
+        align="center"
+        label="操作"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="text"
+            size="small"
+            @click="updateHandle(scope.row.id, scope.row.goods_id)"
+            >编辑</el-button
+          >
+          <el-button
+            type="text"
+            size="small"
+            @click="deleteHandle(scope.row.id)"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+    <!-- 弹窗, 新增 -->
+    <seckill-pd-add-update
+      v-if="addOrUpdateVisible"
+      ref="seckillPdAddUpdate"
+    ></seckill-pd-add-update>
+    <!-- 弹窗,  修改 -->
+    <activity-pd-add
+      v-if="activityPdAdd"
+      ref="activityPdAdd"
+      @updataList="updataList"
+    ></activity-pd-add>
+  </div>
+</template>
+
+<script>
+import getListApi from "@/mixins/getListApi";
+
+// import seckillPdAddUpdate from "./seckill-pd-add-update";
+// import activityPdAdd from "./activity-pd-add";
+// import seviceApi from "@/api/serviceApi.js";
+
+export default {
+  mixins: [getListApi],
+  data() {
+    return {
+      //   listURL: agentAccountCodeApplyWaitPage,
+      dataForm: {},
+      totalPage: 0,
+      dataListLoading: false,
+      addOrUpdateVisible: false, // 添加
+      activityPdAdd: false, // 修改
+    };
+  },
+  components: {
+    // seckillPdAddUpdate,
+    // activityPdAdd,
+  },
+  mounted() {
+    this.search.seckill_id = this.$route.query.id;
+  },
+  watch: {
+    $route() {
+      this.getList();
+    },
+  },
+  methods: {
+    updataList() {
+      debugger;
+      this.getList();
+    },
+    // 新增
+    addOrUpdateHandle() {
+      this.$router.push({
+        path: "/marketing/seckillPdAddUpdate",
+        query: {
+          seckill_id: this.search.seckill_id,
+        },
+      });
+    },
+    // 修改
+    updateHandle(id, goodsId) {
+      this.activityPdAdd = true;
+      this.$nextTick(() => {
+        this.$refs.activityPdAdd.init(id, this.search.id, goodsId);
+      });
+    },
+    // 删除
+    deleteHandle(id) {
+      this.$confirm(`确定要删除该条数据?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          seviceApi.delSeckillActivityGoods(id).then((res) => {
+            if (res && res.data.code == 200) {
+              this.$message({
+                message: "删除成功",
+                type: "success",
+              });
+              this.getList();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+    // 返回秒杀列表
+    getBack() {
+      this.$router.go(-1);
+    },
+  },
+};
+</script>
+<style>
+.mb10 {
+  margin-bottom: 10px;
+}
+</style>

+ 140 - 0
src/views/marketing/seckill/seckillPdAddUpdate.vue

@@ -0,0 +1,140 @@
+<template>
+  <div class="app-container">
+    <div class="mb10">
+      <el-button @click="getBack">返回管理商品</el-button>
+    </div>
+    <el-form :inline="true" :model="search">
+      <el-form-item label="商品名称">
+        <el-input
+          v-model="search.title"
+          placeholder="商品名称"
+          clearable
+        ></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+    <el-table :data="dataList" row-key="Id" border style="width: 100%">
+      <el-table-column prop="title" align="center" label="商品名称">
+      </el-table-column>
+
+      <el-table-column
+        prop="added"
+        align="center"
+        :formatter="added"
+        label="商品状态"
+      >
+      </el-table-column>
+      <el-table-column prop="real_sale_num" align="center" label="实际销量">
+      </el-table-column>
+      <el-table-column prop="is_join" align="center" label="是否已参加秒杀">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.is_join">是</el-tag>
+          <el-tag v-else type="success">否</el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        fixed="right"
+        header-align="center"
+        align="center"
+        label="操作"
+      >
+        <template slot-scope="scope" v-if="scope.row.is_join == false">
+          <el-button
+            type="text"
+            size="small"
+            @click="addOrUpdateHandle(scope.row.id)"
+            >添加</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+    <!-- 弹窗, 新增 / 修改 -->
+    <activity-pd-add
+      v-if="addOrUpdateVisible"
+      ref="activityPdAdd"
+      @updataList="updataList"
+    ></activity-pd-add>
+  </div>
+</template>
+
+<script>
+import getListApi from "@/mixins/getListApi";
+// import activityPdAdd from "./activity-pd-add";
+// import seviceApi from "@/api/serviceApi.js";
+
+export default {
+  mixins: [getListApi],
+  data() {
+    return {
+      //   listURL: agentAccountCodeApplyWaitPage,
+
+      seckill_id: "",
+      dataListLoading: false,
+      addOrUpdateVisible: false,
+    };
+  },
+  components: {
+    // activityPdAdd,
+  },
+  watch: {
+    $route() {
+      this.getList();
+    },
+  },
+  mounted() {
+    console.log(this.$route.query.seckill_id);
+
+    this.seckill_id = this.$route.query.seckill_id;
+    // this.search.seckill_id = this.seckill_id;
+    // this.getList();
+  },
+  methods: {
+    updataList() {
+      this.$router.go(-1);
+    },
+    added(row, column) {
+      let status = row.added;
+      if (status === true) {
+        return "上架";
+      } else {
+        return "下架";
+      }
+    },
+    // 新增
+    addOrUpdateHandle(goodsId) {
+      this.addOrUpdateVisible = true;
+      this.$nextTick(() => {
+        this.$refs.activityPdAdd.init("", this.seckill_id, goodsId);
+      });
+    },
+    // 返回管理商品
+    getBack() {
+      this.$router.go(-1);
+    },
+  },
+};
+</script>
+<style>
+.mb10 {
+  margin-bottom: 10px;
+}
+</style>

+ 1 - 2
src/views/merchandiseAudit/product/index.vue

@@ -114,8 +114,7 @@
             <el-radio :label="AuditStatusEnum.AUDIT_REJECTED">审核不通过</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="理由" prop="auditRemark"
-          :prop="form.auditStatus === AuditStatusEnum.AUDIT_REJECTED ? 'auditRemark' : ''">
+        <el-form-item label="理由" :prop="form.auditStatus === AuditStatusEnum.AUDIT_REJECTED ? 'auditRemark' : ''">
           <el-input type="textarea" :rows="3" maxlength="50" placeholder="" v-model="form.auditRemark"></el-input>
         </el-form-item>
       </el-form>