砍价第一版本
This commit is contained in:
		
							parent
							
								
									726b11eb82
								
							
						
					
					
						commit
						953320526e
					
				@ -64,6 +64,33 @@ export const closePintuan = pintuanId => {
 | 
				
			|||||||
  return putRequest(`/promotion/pintuan/close/${pintuanId}`);
 | 
					  return putRequest(`/promotion/pintuan/close/${pintuanId}`);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 修改砍价活动商品
 | 
				
			||||||
 | 
					export const saveKanJiaActivityGoods = params => {
 | 
				
			||||||
 | 
					  return postRequest("/promotion/kan-jia-goods", params, {
 | 
				
			||||||
 | 
					    "Content-type": "application/json"
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					// 修改砍价活动商品
 | 
				
			||||||
 | 
					export const editKanJiaActivityGoods = params => {
 | 
				
			||||||
 | 
					  return putRequest("/promotion/kan-jia-goods", params, {
 | 
				
			||||||
 | 
					    "Content-type": "application/json"
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					// 获取砍价活动商品
 | 
				
			||||||
 | 
					export const getKanJiaGoodsList = params => {
 | 
				
			||||||
 | 
					  return getRequest(`/promotion/kan-jia-goods`, params);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//删除砍价活动商品
 | 
				
			||||||
 | 
					export const delKanJiaGoods = ids => {
 | 
				
			||||||
 | 
					  return deleteRequest(`/promotion/kan-jia-goods/${ids}`);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 砍价活动商品详情
 | 
				
			||||||
 | 
					export const getKanJiaActivityGoodsById = id => {
 | 
				
			||||||
 | 
					  return getRequest(`/promotion/kan-jia-goods/${id}`);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 保存平台优惠券
 | 
					// 保存平台优惠券
 | 
				
			||||||
export const savePlatformCoupon = params => {
 | 
					export const savePlatformCoupon = params => {
 | 
				
			||||||
  return postRequest("/promotion/coupon", params, {
 | 
					  return postRequest("/promotion/coupon", params, {
 | 
				
			||||||
 | 
				
			|||||||
@ -212,6 +212,18 @@ export const otherRouter = {
 | 
				
			|||||||
      component: () =>
 | 
					      component: () =>
 | 
				
			||||||
        import("@/views/promotion/pointsGoodsCategory/pointsGoodsCategory.vue")
 | 
					        import("@/views/promotion/pointsGoodsCategory/pointsGoodsCategory.vue")
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      path: "promotion/add-kanJia-activity-goods",
 | 
				
			||||||
 | 
					      title: "添加砍价活动",
 | 
				
			||||||
 | 
					      name: "add-kanJia-activity-goods",
 | 
				
			||||||
 | 
					      component: () => import("@/views/promotion/kanjia/kanjiaActivityAddGoods.vue")
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      path: "promotion/edit-kanJia-activity-goods",
 | 
				
			||||||
 | 
					      title: "修改砍价活动",
 | 
				
			||||||
 | 
					      name: "edit-kanJia-activity-goods",
 | 
				
			||||||
 | 
					      component: () => import("@/views/promotion/kanjia/kanjiaActivityEditGoods.vue")
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      path: "promotion/manager-coupon",
 | 
					      path: "promotion/manager-coupon",
 | 
				
			||||||
      title: "平台优惠券",
 | 
					      title: "平台优惠券",
 | 
				
			||||||
 | 
				
			|||||||
@ -90,15 +90,14 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
  import {
 | 
					  import {
 | 
				
			||||||
    saveKanjiaActivityGoods,
 | 
					    saveKanJiaActivityGoods,
 | 
				
			||||||
    getPlatformCoupon,
 | 
					    editKanJiaActivityGoods
 | 
				
			||||||
    editPlatformCoupon,
 | 
					 | 
				
			||||||
  } from "@/api/promotion";
 | 
					  } from "@/api/promotion";
 | 
				
			||||||
  import {regular} from "@/utils";
 | 
					  import {regular} from "@/utils";
 | 
				
			||||||
  import skuSelect from "@/views/lili-dialog";
 | 
					  import skuSelect from "@/views/lili-dialog";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  export default {
 | 
					  export default {
 | 
				
			||||||
    name: "addCoupon",
 | 
					    name: "addKanJiaActivityGoods",
 | 
				
			||||||
    components: {
 | 
					    components: {
 | 
				
			||||||
      skuSelect,
 | 
					      skuSelect,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
@ -210,11 +209,6 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
      getCoupon() {
 | 
					 | 
				
			||||||
        getPlatformCoupon(this.id).then((res) => {
 | 
					 | 
				
			||||||
          let data = res.result;
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      openSkuList() { // 显示商品选择器
 | 
					      openSkuList() { // 显示商品选择器
 | 
				
			||||||
        this.$refs.skuSelect.open("goods");
 | 
					        this.$refs.skuSelect.open("goods");
 | 
				
			||||||
@ -302,35 +296,19 @@
 | 
				
			|||||||
              return;
 | 
					              return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            this.submitLoading = true;
 | 
					            this.submitLoading = true;
 | 
				
			||||||
            if (this.modalType === 0) {
 | 
					            saveKanJiaActivityGoods(params).then((res) => {
 | 
				
			||||||
              // 添加 避免编辑后传入id等数据 记得删除
 | 
					 | 
				
			||||||
              delete params.id;
 | 
					 | 
				
			||||||
              saveKanjiaActivityGoods(params).then((res) => {
 | 
					 | 
				
			||||||
              this.submitLoading = false;
 | 
					              this.submitLoading = false;
 | 
				
			||||||
              if (res.success) {
 | 
					              if (res.success) {
 | 
				
			||||||
                  this.$Message.success("砍价活动添加成功");
 | 
					                this.$Message.success("砍价活动修改成功");
 | 
				
			||||||
                this.closeCurrentPage();
 | 
					                this.closeCurrentPage();
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
              // 编辑
 | 
					 | 
				
			||||||
              delete params.consumeLimit;
 | 
					 | 
				
			||||||
              delete params.updateTime;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
              editPlatformCoupon(params).then((res) => {
 | 
					 | 
				
			||||||
                this.submitLoading = false;
 | 
					 | 
				
			||||||
                if (res.success) {
 | 
					 | 
				
			||||||
                  this.$Message.success("优惠券修改成功");
 | 
					 | 
				
			||||||
                  this.closeCurrentPage();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
              });
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      // 关闭当前页面
 | 
					      // 关闭当前页面
 | 
				
			||||||
      closeCurrentPage() {
 | 
					      closeCurrentPage() {
 | 
				
			||||||
        this.$store.commit("removeTag", "add-platform-coupon");
 | 
					        this.$store.commit("removeTag", "add-kan-jia-goods");
 | 
				
			||||||
        localStorage.pageOpenedList = JSON.stringify(
 | 
					        localStorage.pageOpenedList = JSON.stringify(
 | 
				
			||||||
          this.$store.state.app.pageOpenedList
 | 
					          this.$store.state.app.pageOpenedList
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
				
			|||||||
@ -5,63 +5,68 @@
 | 
				
			|||||||
        <div class="base-info-item">
 | 
					        <div class="base-info-item">
 | 
				
			||||||
          <div class="form-item-view">
 | 
					          <div class="form-item-view">
 | 
				
			||||||
            <h4>商品信息</h4>
 | 
					            <h4>商品信息</h4>
 | 
				
			||||||
 | 
					            <FormItem label="商品名称">
 | 
				
			||||||
            <FormItem label="选择商品" prop="scopeType">
 | 
					              <div>{{ form.goodsName }}</div>
 | 
				
			||||||
              <Button type="primary" @click="openSkuList">选择商品</Button>
 | 
					            </FormItem>
 | 
				
			||||||
              <Button
 | 
					            <FormItem label="SKU编码">
 | 
				
			||||||
                type="error"
 | 
					              <div>{{ form.skuId }}</div>
 | 
				
			||||||
                ghost
 | 
					            </FormItem>
 | 
				
			||||||
                style="margin-left: 10px"
 | 
					            <FormItem label="店铺名称">
 | 
				
			||||||
                @click="delSelectGoods"
 | 
					              <div>{{ form.goodsSku.storeName }}</div>
 | 
				
			||||||
              >批量删除
 | 
					            </FormItem>
 | 
				
			||||||
              </Button
 | 
					            <FormItem label="商品价格">
 | 
				
			||||||
              >
 | 
					              <div>{{ form.goodsSku.price | unitPrice('¥') }}</div>
 | 
				
			||||||
 | 
					            </FormItem>
 | 
				
			||||||
 | 
					            <FormItem label="商品库存">
 | 
				
			||||||
 | 
					              <div>{{ form.goodsSku.quantity }}</div>
 | 
				
			||||||
 | 
					            </FormItem>
 | 
				
			||||||
 | 
					            <FormItem label="结算价格" prop="settlementPrice">
 | 
				
			||||||
 | 
					              <Input
 | 
				
			||||||
 | 
					                type="number"
 | 
				
			||||||
 | 
					                v-model="form.settlementPrice"
 | 
				
			||||||
 | 
					                placeholder="请填写结算价格"
 | 
				
			||||||
 | 
					                clearable
 | 
				
			||||||
 | 
					                style="width: 260px"
 | 
				
			||||||
 | 
					              />
 | 
				
			||||||
 | 
					            </FormItem>
 | 
				
			||||||
 | 
					            <FormItem label="最低购买金额" prop="purchasePrice">
 | 
				
			||||||
 | 
					              <Input
 | 
				
			||||||
 | 
					                type="number"
 | 
				
			||||||
 | 
					                v-model="form.purchasePrice"
 | 
				
			||||||
 | 
					                placeholder="请填写最低购买金额"
 | 
				
			||||||
 | 
					                clearable
 | 
				
			||||||
 | 
					                style="width: 260px"
 | 
				
			||||||
 | 
					              />
 | 
				
			||||||
 | 
					            </FormItem>
 | 
				
			||||||
 | 
					            <FormItem label="最低可砍" prop="lowestPrice">
 | 
				
			||||||
 | 
					              <Input
 | 
				
			||||||
 | 
					                type="number"
 | 
				
			||||||
 | 
					                v-model="form.lowestPrice"
 | 
				
			||||||
 | 
					                placeholder="请填写最低可砍金额"
 | 
				
			||||||
 | 
					                clearable
 | 
				
			||||||
 | 
					                style="width: 260px"
 | 
				
			||||||
 | 
					              />
 | 
				
			||||||
 | 
					            </FormItem>
 | 
				
			||||||
 | 
					            <FormItem label="最高可砍" prop="highestPrice">
 | 
				
			||||||
 | 
					              <Input
 | 
				
			||||||
 | 
					                type="number"
 | 
				
			||||||
 | 
					                v-model="form.highestPrice"
 | 
				
			||||||
 | 
					                placeholder="请填写最高可砍金额"
 | 
				
			||||||
 | 
					                clearable
 | 
				
			||||||
 | 
					                style="width: 260px"
 | 
				
			||||||
 | 
					              />
 | 
				
			||||||
            </FormItem>
 | 
					            </FormItem>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <FormItem astyle="width: 100%">
 | 
					            <FormItem label="活动库存" prop="stock">
 | 
				
			||||||
              <Table
 | 
					 | 
				
			||||||
                border
 | 
					 | 
				
			||||||
                :columns="columns"
 | 
					 | 
				
			||||||
                :data="form.promotionGoodsList"
 | 
					 | 
				
			||||||
                @on-selection-change="changeSelect"
 | 
					 | 
				
			||||||
              >
 | 
					 | 
				
			||||||
                <template slot-scope="{ row }" slot="skuId">
 | 
					 | 
				
			||||||
                  <div>{{ row.skuId }}</div>
 | 
					 | 
				
			||||||
                </template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                <template slot-scope="{ index }" slot="settlementPrice">
 | 
					 | 
				
			||||||
              <Input
 | 
					              <Input
 | 
				
			||||||
                type="number"
 | 
					                type="number"
 | 
				
			||||||
                    v-model="form.promotionGoodsList[index].settlementPrice"
 | 
					                v-model="form.stock"
 | 
				
			||||||
 | 
					                placeholder="请填写活动库存"
 | 
				
			||||||
 | 
					                clearable
 | 
				
			||||||
 | 
					                style="width: 260px"
 | 
				
			||||||
              />
 | 
					              />
 | 
				
			||||||
                </template>
 | 
					 | 
				
			||||||
                <template slot-scope="{ index }" slot="lowestPrice">
 | 
					 | 
				
			||||||
                  <Input
 | 
					 | 
				
			||||||
                    type="number"
 | 
					 | 
				
			||||||
                    v-model="form.promotionGoodsList[index].lowestPrice"
 | 
					 | 
				
			||||||
                  />
 | 
					 | 
				
			||||||
                </template>
 | 
					 | 
				
			||||||
                <template slot-scope="{ index }" slot="highestPrice">
 | 
					 | 
				
			||||||
                  <Input
 | 
					 | 
				
			||||||
                    type="number"
 | 
					 | 
				
			||||||
                    v-model="form.promotionGoodsList[index].highestPrice"
 | 
					 | 
				
			||||||
                  />
 | 
					 | 
				
			||||||
                </template>
 | 
					 | 
				
			||||||
                <template slot-scope="{ index }" slot="purchasePrice">
 | 
					 | 
				
			||||||
                  <Input
 | 
					 | 
				
			||||||
                    type="number"
 | 
					 | 
				
			||||||
                    v-model="form.promotionGoodsList[index].purchasePrice"
 | 
					 | 
				
			||||||
                  />
 | 
					 | 
				
			||||||
                </template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                <template slot-scope="{ index }" slot="stock">
 | 
					 | 
				
			||||||
                  <Input
 | 
					 | 
				
			||||||
                    type="number"
 | 
					 | 
				
			||||||
                    v-model="form.promotionGoodsList[index].stock"
 | 
					 | 
				
			||||||
                  />
 | 
					 | 
				
			||||||
                </template>
 | 
					 | 
				
			||||||
              </Table>
 | 
					 | 
				
			||||||
            </FormItem>
 | 
					            </FormItem>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <FormItem label="活动时间" prop="rangeTime">
 | 
					            <FormItem label="活动时间" prop="rangeTime">
 | 
				
			||||||
              <DatePicker
 | 
					              <DatePicker
 | 
				
			||||||
                type="datetimerange"
 | 
					                type="datetimerange"
 | 
				
			||||||
@ -90,111 +95,90 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
  import {
 | 
					  import {
 | 
				
			||||||
    saveKanjiaActivityGoods,
 | 
					    getKanJiaActivityGoodsById,
 | 
				
			||||||
    getPlatformCoupon,
 | 
					    editKanJiaActivityGoods,
 | 
				
			||||||
    editPlatformCoupon,
 | 
					 | 
				
			||||||
  } from "@/api/promotion";
 | 
					  } from "@/api/promotion";
 | 
				
			||||||
  import {regular} from "@/utils";
 | 
					  import {regular} from "@/utils";
 | 
				
			||||||
  import skuSelect from "@/views/lili-dialog";
 | 
					  import skuSelect from "@/views/lili-dialog";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  export default {
 | 
					  export default {
 | 
				
			||||||
    name: "addCoupon",
 | 
					    name: "editKanjiaActivityGoods",
 | 
				
			||||||
    components: {
 | 
					    components: {
 | 
				
			||||||
      skuSelect,
 | 
					      skuSelect,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    watch: {},
 | 
					    watch: {},
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
 | 
					      const checkSettlementPrice = (rule, value, callback) => {
 | 
				
			||||||
 | 
					        if (!value && value !== 0) {
 | 
				
			||||||
 | 
					          return callback(new Error("结算金额不能为空"));
 | 
				
			||||||
 | 
					        } else if (!regular.money.test(value)) {
 | 
				
			||||||
 | 
					          callback(new Error("请输入正整数或者两位小数"));
 | 
				
			||||||
 | 
					        } else if (parseFloat(value) > 99999999) {
 | 
				
			||||||
 | 
					          callback(new Error("结算金额设置超过上限值"));
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          callback();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					      const checkPurchasePrice = (rule, value, callback) => {
 | 
				
			||||||
 | 
					        if (!value && value !== 0) {
 | 
				
			||||||
 | 
					          return callback(new Error("最低购买金额不能为空"));
 | 
				
			||||||
 | 
					        } else if (!regular.money.test(value)) {
 | 
				
			||||||
 | 
					          callback(new Error("请输入正整数或者两位小数"));
 | 
				
			||||||
 | 
					        } else if (parseFloat(value) > 99999999) {
 | 
				
			||||||
 | 
					          callback(new Error("最低购买金额设置超过上限值"));
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          callback();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					      const checkLowestPrice = (rule, value, callback) => {
 | 
				
			||||||
 | 
					        if (!value && value !== 0) {
 | 
				
			||||||
 | 
					          return callback(new Error("最低可砍金额不能为空"));
 | 
				
			||||||
 | 
					        } else if (!regular.money.test(value)) {
 | 
				
			||||||
 | 
					          callback(new Error("请输入正整数或者两位小数"));
 | 
				
			||||||
 | 
					        } else if (parseFloat(value) > 99999999) {
 | 
				
			||||||
 | 
					          callback(new Error("最低可砍金额设置超过上限值"));
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          callback();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					      const checkHighestPrice = (rule, value, callback) => {
 | 
				
			||||||
 | 
					        if (!value && value !== 0) {
 | 
				
			||||||
 | 
					          return callback(new Error("最高可砍金额不能为空"));
 | 
				
			||||||
 | 
					        } else if (!regular.money.test(value)) {
 | 
				
			||||||
 | 
					          callback(new Error("请输入正整数或者两位小数"));
 | 
				
			||||||
 | 
					        } else if (parseFloat(value) > 99999999) {
 | 
				
			||||||
 | 
					          callback(new Error("最高可砍金额设置超过上限值"));
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          callback();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
      return {
 | 
					      return {
 | 
				
			||||||
        modalType: 0, // 是否编辑
 | 
					        modalType: 0, // 是否编辑
 | 
				
			||||||
        form: {
 | 
					        form: {
 | 
				
			||||||
          promotionGoodsList: [], // 活动商品列表
 | 
					          goodsSku: {},
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        id: this.$route.query.id, // 砍价活动id
 | 
					        id: this.$route.query.id, // 砍价活动id
 | 
				
			||||||
        submitLoading: false, // 添加或编辑提交状态
 | 
					        submitLoading: false, // 添加或编辑提交状态
 | 
				
			||||||
        selectedGoods: [], // 已选商品列表,便于删除
 | 
					 | 
				
			||||||
        promotionGoodsList: [], // 活动商品列表
 | 
					 | 
				
			||||||
        formRule: {
 | 
					        formRule: {
 | 
				
			||||||
          rangeTime: [{required: true, message: "请选择活动时间"}],
 | 
					          settlementPrice: [
 | 
				
			||||||
        },
 | 
					            {required: true, message: "请输入结算金额"},
 | 
				
			||||||
        columns: [
 | 
					            {validator: checkSettlementPrice},
 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            type: "selection",
 | 
					 | 
				
			||||||
            width: 60,
 | 
					 | 
				
			||||||
            align: "center",
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            title: "商品名称",
 | 
					 | 
				
			||||||
            key: "goodsName",
 | 
					 | 
				
			||||||
            tooltip: true,
 | 
					 | 
				
			||||||
            minWidth: 100,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            title: "商品价格",
 | 
					 | 
				
			||||||
            key: "price",
 | 
					 | 
				
			||||||
            width: 120,
 | 
					 | 
				
			||||||
            render: (h, params) => {
 | 
					 | 
				
			||||||
              return h(
 | 
					 | 
				
			||||||
                "div",
 | 
					 | 
				
			||||||
                this.$options.filters.unitPrice(params.row.price, "¥")
 | 
					 | 
				
			||||||
              );
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            title: "库存",
 | 
					 | 
				
			||||||
            key: "quantity",
 | 
					 | 
				
			||||||
            width: 100,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            title: "结算价格",
 | 
					 | 
				
			||||||
            slot: "settlementPrice",
 | 
					 | 
				
			||||||
            width: 110,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            title: "最低砍",
 | 
					 | 
				
			||||||
            slot: "lowestPrice",
 | 
					 | 
				
			||||||
            width: 110,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            title: "最高砍",
 | 
					 | 
				
			||||||
            slot: "highestPrice",
 | 
					 | 
				
			||||||
            width: 110,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            title: "最低购买金额",
 | 
					 | 
				
			||||||
            slot: "purchasePrice",
 | 
					 | 
				
			||||||
            width: 110,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            title: "活动库存",
 | 
					 | 
				
			||||||
            slot: "stock",
 | 
					 | 
				
			||||||
            width: 110,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            title: "操作",
 | 
					 | 
				
			||||||
            key: "action",
 | 
					 | 
				
			||||||
            align: "center",
 | 
					 | 
				
			||||||
            width: 100,
 | 
					 | 
				
			||||||
            render: (h, params) => {
 | 
					 | 
				
			||||||
              return h(
 | 
					 | 
				
			||||||
                "Button",
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                  props: {
 | 
					 | 
				
			||||||
                    size: "small",
 | 
					 | 
				
			||||||
                    type: "error",
 | 
					 | 
				
			||||||
                    ghost: true,
 | 
					 | 
				
			||||||
                  },
 | 
					 | 
				
			||||||
                  on: {
 | 
					 | 
				
			||||||
                    click: () => {
 | 
					 | 
				
			||||||
                      this.delGoods(params.index);
 | 
					 | 
				
			||||||
                    },
 | 
					 | 
				
			||||||
                  },
 | 
					 | 
				
			||||||
                },
 | 
					 | 
				
			||||||
                "删除"
 | 
					 | 
				
			||||||
              );
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          ],
 | 
					          ],
 | 
				
			||||||
 | 
					          purchasePrice: [
 | 
				
			||||||
 | 
					            {required: true, message: "请输入最低购买金额"},
 | 
				
			||||||
 | 
					            {validator: checkPurchasePrice},
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					          lowestPrice: [
 | 
				
			||||||
 | 
					            {required: true, message: "请输入最低可砍金额"},
 | 
				
			||||||
 | 
					            {validator: checkLowestPrice},
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					          highestPrice: [
 | 
				
			||||||
 | 
					            {required: true, message: "请输入最高可砍金额"},
 | 
				
			||||||
 | 
					            {validator: checkHighestPrice},
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					          rangeTime: [{required: true, message: "请选择活动时间"}],
 | 
				
			||||||
 | 
					          stock: [{required: true, message: "请输入活动库存"}],
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
        options: {
 | 
					        options: {
 | 
				
			||||||
          disabledDate(date) {
 | 
					          disabledDate(date) {
 | 
				
			||||||
            return date && date.valueOf() < Date.now() - 86400000;
 | 
					            return date && date.valueOf() < Date.now() - 86400000;
 | 
				
			||||||
@ -205,28 +189,22 @@
 | 
				
			|||||||
    async mounted() {
 | 
					    async mounted() {
 | 
				
			||||||
      // 如果id不为空则查询信息
 | 
					      // 如果id不为空则查询信息
 | 
				
			||||||
      if (this.id) {
 | 
					      if (this.id) {
 | 
				
			||||||
        this.getCoupon();
 | 
					        this.getKanJiaActivityGoods();
 | 
				
			||||||
        this.modalType = 1;
 | 
					        this.modalType = 1;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
      getCoupon() {
 | 
					      getKanJiaActivityGoods() {
 | 
				
			||||||
        getPlatformCoupon(this.id).then((res) => {
 | 
					        getKanJiaActivityGoodsById(this.id).then((res) => {
 | 
				
			||||||
          let data = res.result;
 | 
					          this.form = res.result;
 | 
				
			||||||
 | 
					          this.form.rangeTime = [];
 | 
				
			||||||
 | 
					          this.form.rangeTime.push(new Date(this.form.startTime), new Date(this.form.endTime));
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      openSkuList() { // 显示商品选择器
 | 
					 | 
				
			||||||
        this.$refs.skuSelect.open("goods");
 | 
					 | 
				
			||||||
        let data = JSON.parse(JSON.stringify(this.promotionGoodsList))
 | 
					 | 
				
			||||||
        data.forEach(e => {
 | 
					 | 
				
			||||||
          e.id = e.skuId
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        this.$refs.skuSelect.goodsData = data;
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      /** 保存砍价活动 */
 | 
					      /** 保存砍价活动 */
 | 
				
			||||||
      handleSubmit() {
 | 
					      handleSubmit() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.$refs.form.validate((valid) => {
 | 
					        this.$refs.form.validate((valid) => {
 | 
				
			||||||
          if (valid) {
 | 
					          if (valid) {
 | 
				
			||||||
            const params = JSON.parse(JSON.stringify(this.form));
 | 
					            const params = JSON.parse(JSON.stringify(this.form));
 | 
				
			||||||
@ -241,162 +219,72 @@
 | 
				
			|||||||
              this.form.rangeTime[1] / 1000
 | 
					              this.form.rangeTime[1] / 1000
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            delete params.rangeTime
 | 
					            delete params.rangeTime
 | 
				
			||||||
            let checkResult = true
 | 
					            console.warn(params)
 | 
				
			||||||
            //如果添加活动的时候选择了商品 则对选择的商品参数做一些校验
 | 
					 | 
				
			||||||
            if (this.form.promotionGoodsList.length > 0) {
 | 
					 | 
				
			||||||
              this.form.promotionGoodsList.forEach((res) => {
 | 
					 | 
				
			||||||
            //校验库存参数
 | 
					            //校验库存参数
 | 
				
			||||||
                if (res.stock <= 0 || res.stock > res.quantity) {
 | 
					            if (params.stock <= 0 || params.stock > params.goodsSku.quantity) {
 | 
				
			||||||
                  checkResult = false
 | 
					 | 
				
			||||||
              this.$Message.error("活动库存不能为0且不能超过商品库存");
 | 
					              this.$Message.error("活动库存不能为0且不能超过商品库存");
 | 
				
			||||||
              return
 | 
					              return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // 最低购买金额格式校验
 | 
					            // 最低购买金额格式校验
 | 
				
			||||||
                if (!regular.money.test(res.purchasePrice)) {
 | 
					            if (!regular.money.test(params.purchasePrice)) {
 | 
				
			||||||
                  checkResult = false
 | 
					 | 
				
			||||||
              this.$Message.error("最低购买金额格式不正确");
 | 
					              this.$Message.error("最低购买金额格式不正确");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // 结算价格金额格式校验
 | 
					            // 结算价格金额格式校验
 | 
				
			||||||
                if (!regular.money.test(res.settlementPrice)) {
 | 
					            if (!regular.money.test(params.settlementPrice)) {
 | 
				
			||||||
                  checkResult = false
 | 
					 | 
				
			||||||
              this.$Message.error("结算价格金额格式不正确");
 | 
					              this.$Message.error("结算价格金额格式不正确");
 | 
				
			||||||
              return
 | 
					              return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // 结算价格金额格式校验
 | 
					            // 结算价格金额格式校验
 | 
				
			||||||
                if (res.settlementPrice < 0 || res.settlementPrice > res.price) {
 | 
					            if (params.settlementPrice < 0 || params.settlementPrice > params.price) {
 | 
				
			||||||
                  checkResult = false
 | 
					 | 
				
			||||||
              this.$Message.error("结算价格金额不能为0且不能超过商品价格");
 | 
					              this.$Message.error("结算价格金额不能为0且不能超过商品价格");
 | 
				
			||||||
              return
 | 
					              return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            //最高砍价校验
 | 
					            //最高砍价校验
 | 
				
			||||||
                if (!regular.money.test(res.highestPrice)) {
 | 
					            if (!regular.money.test(params.highestPrice)) {
 | 
				
			||||||
                  checkResult = false
 | 
					 | 
				
			||||||
              this.$Message.error("最高可砍金额格式错误");
 | 
					              this.$Message.error("最高可砍金额格式错误");
 | 
				
			||||||
              return
 | 
					              return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
                if (res.highestPrice <= 0 || res.highestPrice > res.price) {
 | 
					            if (params.highestPrice <= 0 || params.highestPrice > params.price) {
 | 
				
			||||||
                  checkResult = false
 | 
					 | 
				
			||||||
              this.$Message.error("最高可砍金额不能为0且不能超过商品价格");
 | 
					              this.$Message.error("最高可砍金额不能为0且不能超过商品价格");
 | 
				
			||||||
              return
 | 
					              return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //最低砍价校验
 | 
					            //最低砍价校验
 | 
				
			||||||
                if (!regular.money.test(res.lowestPrice)) {
 | 
					            if (!regular.money.test(params.lowestPrice)) {
 | 
				
			||||||
                  checkResult = false
 | 
					 | 
				
			||||||
              this.$Message.error("最低可砍金额格式错误");
 | 
					              this.$Message.error("最低可砍金额格式错误");
 | 
				
			||||||
              return
 | 
					              return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
                if (res.lowestPrice <= 0 || res.lowestPrice > res.price) {
 | 
					            if (params.lowestPrice <= 0 || params.lowestPrice > params.price) {
 | 
				
			||||||
                  checkResult = false
 | 
					 | 
				
			||||||
              this.$Message.error("最低可砍金额不能为0");
 | 
					              this.$Message.error("最低可砍金额不能为0");
 | 
				
			||||||
              return
 | 
					              return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            //校验最高最低砍价金额
 | 
					            //校验最高最低砍价金额
 | 
				
			||||||
                if (res.lowestPrice > res.highestPrice) {
 | 
					            if (params.lowestPrice > params.highestPrice) {
 | 
				
			||||||
                  checkResult = false
 | 
					 | 
				
			||||||
              this.$Message.error("最低砍价金额不能大于最高砍价金额");
 | 
					              this.$Message.error("最低砍价金额不能大于最高砍价金额");
 | 
				
			||||||
              return
 | 
					              return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
              });
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (!checkResult) {
 | 
					 | 
				
			||||||
              return;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            this.submitLoading = true;
 | 
					 | 
				
			||||||
            if (this.modalType === 0) {
 | 
					 | 
				
			||||||
              // 添加 避免编辑后传入id等数据 记得删除
 | 
					 | 
				
			||||||
              delete params.id;
 | 
					 | 
				
			||||||
              saveKanjiaActivityGoods(params).then((res) => {
 | 
					 | 
				
			||||||
                this.submitLoading = false;
 | 
					 | 
				
			||||||
                if (res.success) {
 | 
					 | 
				
			||||||
                  this.$Message.success("砍价活动添加成功");
 | 
					 | 
				
			||||||
                  this.closeCurrentPage();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
              });
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
              // 编辑
 | 
					 | 
				
			||||||
              delete params.consumeLimit;
 | 
					 | 
				
			||||||
              delete params.updateTime;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
              editPlatformCoupon(params).then((res) => {
 | 
					            this.submitLoading = true;
 | 
				
			||||||
 | 
					            // 添加 避免编辑后传入id等数据 记得删除
 | 
				
			||||||
 | 
					            editKanJiaActivityGoods(params).then((res) => {
 | 
				
			||||||
              this.submitLoading = false;
 | 
					              this.submitLoading = false;
 | 
				
			||||||
              if (res.success) {
 | 
					              if (res.success) {
 | 
				
			||||||
                  this.$Message.success("优惠券修改成功");
 | 
					                this.$Message.success("砍价活动修改成功");
 | 
				
			||||||
                this.closeCurrentPage();
 | 
					                this.closeCurrentPage();
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      // 关闭当前页面
 | 
					      // 关闭当前页面
 | 
				
			||||||
      closeCurrentPage() {
 | 
					      closeCurrentPage() {
 | 
				
			||||||
        this.$store.commit("removeTag", "add-platform-coupon");
 | 
					        this.$store.commit("removeTag", "add-kan-jia-goods");
 | 
				
			||||||
        localStorage.pageOpenedList = JSON.stringify(
 | 
					        localStorage.pageOpenedList = JSON.stringify(
 | 
				
			||||||
          this.$store.state.app.pageOpenedList
 | 
					          this.$store.state.app.pageOpenedList
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        this.$router.go(-1);
 | 
					        this.$router.go(-1);
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      openSkuList() {
 | 
					
 | 
				
			||||||
        // 显示商品选择器
 | 
					 | 
				
			||||||
        this.$refs.skuSelect.open("goods");
 | 
					 | 
				
			||||||
        let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList));
 | 
					 | 
				
			||||||
        data.forEach((e) => {
 | 
					 | 
				
			||||||
          e.id = e.skuId;
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        this.$refs.skuSelect.goodsData = data;
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      changeSelect(e) {
 | 
					 | 
				
			||||||
        // 已选商品批量选择
 | 
					 | 
				
			||||||
        this.selectedGoods = e;
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      delSelectGoods() {
 | 
					 | 
				
			||||||
        // 多选删除商品
 | 
					 | 
				
			||||||
        if (this.selectedGoods.length <= 0) {
 | 
					 | 
				
			||||||
          this.$Message.warning("您还未选择要删除的数据");
 | 
					 | 
				
			||||||
          return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        this.$Modal.confirm({
 | 
					 | 
				
			||||||
          title: "确认删除",
 | 
					 | 
				
			||||||
          content: "您确认要删除所选商品吗?",
 | 
					 | 
				
			||||||
          onOk: () => {
 | 
					 | 
				
			||||||
            let ids = [];
 | 
					 | 
				
			||||||
            this.selectedGoods.forEach(function (e) {
 | 
					 | 
				
			||||||
              ids.push(e.id);
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            this.form.promotionGoodsList = this.form.promotionGoodsList.filter(
 | 
					 | 
				
			||||||
              (item) => {
 | 
					 | 
				
			||||||
                return !ids.includes(item.id);
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      delGoods(index) {
 | 
					 | 
				
			||||||
        // 删除商品
 | 
					 | 
				
			||||||
        this.form.promotionGoodsList.splice(index, 1);
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      selectedGoodsData(item) {
 | 
					 | 
				
			||||||
        // 回显已选商品
 | 
					 | 
				
			||||||
        let list = [];
 | 
					 | 
				
			||||||
        item.forEach((e) => {
 | 
					 | 
				
			||||||
          list.push({
 | 
					 | 
				
			||||||
            settlementPrice: e.settlementPrice || 0,
 | 
					 | 
				
			||||||
            purchasePrice: e.purchasePrice || 0,
 | 
					 | 
				
			||||||
            lowestPrice: e.lowestPrice || 0,
 | 
					 | 
				
			||||||
            highestPrice: e.highestPrice || 0,
 | 
					 | 
				
			||||||
            stock: e.stock || 0,
 | 
					 | 
				
			||||||
            goodsName: e.goodsName,
 | 
					 | 
				
			||||||
            price: e.price,
 | 
					 | 
				
			||||||
            originalPrice: e.price,
 | 
					 | 
				
			||||||
            quantity: e.quantity,
 | 
					 | 
				
			||||||
            storeId: e.storeId,
 | 
					 | 
				
			||||||
            storeName: e.storeName,
 | 
					 | 
				
			||||||
            skuId: e.id,
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        console.warn(list)
 | 
					 | 
				
			||||||
        this.form.promotionGoodsList = list;
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
				
			|||||||
@ -3,8 +3,8 @@
 | 
				
			|||||||
    <Card>
 | 
					    <Card>
 | 
				
			||||||
      <Row>
 | 
					      <Row>
 | 
				
			||||||
        <Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
 | 
					        <Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
 | 
				
			||||||
          <Form-item label="活动名称" prop="promotionName">
 | 
					          <Form-item label="商品名称" prop="goodsName">
 | 
				
			||||||
            <Input type="text" v-model="searchForm.promotionName" placeholder="请输入活动名称" clearable style="width: 200px" />
 | 
					            <Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px"/>
 | 
				
			||||||
          </Form-item>
 | 
					          </Form-item>
 | 
				
			||||||
          <Form-item label="活动状态" prop="promotionStatus">
 | 
					          <Form-item label="活动状态" prop="promotionStatus">
 | 
				
			||||||
            <Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
 | 
					            <Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
 | 
				
			||||||
@ -15,26 +15,50 @@
 | 
				
			|||||||
            </Select>
 | 
					            </Select>
 | 
				
			||||||
          </Form-item>
 | 
					          </Form-item>
 | 
				
			||||||
          <Form-item label="活动时间">
 | 
					          <Form-item label="活动时间">
 | 
				
			||||||
            <DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
 | 
					            <DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间"
 | 
				
			||||||
 | 
					                        style="width: 200px"></DatePicker>
 | 
				
			||||||
          </Form-item>
 | 
					          </Form-item>
 | 
				
			||||||
          <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
 | 
					          <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
 | 
				
			||||||
        </Form>
 | 
					        </Form>
 | 
				
			||||||
      </Row>
 | 
					      </Row>
 | 
				
			||||||
      <Row class="operation padding-row">
 | 
					      <Row class="operation padding-row">
 | 
				
			||||||
        <Button @click="add" type="primary">添加砍价</Button>
 | 
					        <Button @click="add" type="primary">添加砍价</Button>
 | 
				
			||||||
        <Button @click="delAll">批量下架</Button>
 | 
					 | 
				
			||||||
        <!-- <Button @click="upAll" >批量上架</Button> -->
 | 
					 | 
				
			||||||
      </Row>
 | 
					      </Row>
 | 
				
			||||||
      <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-select-cancel="cancelSelect" @on-selection-change="changeSelect">
 | 
					      <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
 | 
				
			||||||
 | 
					             @on-sort-change="changeSort">
 | 
				
			||||||
 | 
					        <template slot-scope="{ row }" slot="goodsName">
 | 
				
			||||||
 | 
					          <div>
 | 
				
			||||||
 | 
					            <a class="mr_10" @click="linkTo(row.goodsSku.goodsId,row.skuId)">{{row.goodsName}}</a>
 | 
				
			||||||
 | 
					            <Poptip trigger="hover" title="扫码在手机中查看" transfer>
 | 
				
			||||||
 | 
					              <div slot="content">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                <vue-qr :text="wapLinkTo(row.goodsSku.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff"
 | 
				
			||||||
 | 
					                        :size="150"></vue-qr>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
 | 
					              <img src="../../../assets/qrcode.svg" style="vertical-align:middle;" class="hover-pointer" width="20"
 | 
				
			||||||
 | 
					                   height="20" alt="">
 | 
				
			||||||
 | 
					            </Poptip>
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
 | 
					        <template slot-scope="{ row }" slot="startTime">
 | 
				
			||||||
 | 
					          <div>{{ row.startTime }}</div>
 | 
				
			||||||
 | 
					          <div>{{ row.endTime }}</div>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
 | 
					        <template slot-scope="{ row }" slot="quantity">
 | 
				
			||||||
 | 
					          <div>{{ row.goodsSku.quantity }}</div>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
        <template slot-scope="{ row,index }" slot="action">
 | 
					        <template slot-scope="{ row,index }" slot="action">
 | 
				
			||||||
          <Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary" size="small" style="margin-right: 10px" @click="edit(row)">编辑
 | 
					          <Button v-if="row.promotionStatus === 'NEW'" type="info"
 | 
				
			||||||
 | 
					                  size="small" style="margin-right: 10px" @click="edit(row)">编辑
 | 
				
			||||||
          </Button>
 | 
					          </Button>
 | 
				
			||||||
          <Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" style="margin-right: 10px" @click="remove(row)">下架
 | 
					          <Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'END'" type="error"
 | 
				
			||||||
 | 
					                  size="small" style="margin-right: 10px" @click="delAll(row)">删除
 | 
				
			||||||
          </Button>
 | 
					          </Button>
 | 
				
			||||||
        </template>
 | 
					        </template>
 | 
				
			||||||
      </Table>
 | 
					      </Table>
 | 
				
			||||||
      <Row type="flex" justify="end" class="page">
 | 
					      <Row type="flex" justify="end" class="page">
 | 
				
			||||||
        <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
 | 
					        <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
 | 
				
			||||||
 | 
					              @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
 | 
				
			||||||
              show-total show-elevator show-sizer></Page>
 | 
					              show-total show-elevator show-sizer></Page>
 | 
				
			||||||
      </Row>
 | 
					      </Row>
 | 
				
			||||||
    </Card>
 | 
					    </Card>
 | 
				
			||||||
@ -43,8 +67,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
  import {
 | 
					  import {
 | 
				
			||||||
    getKanjiaList,
 | 
					    getKanJiaGoodsList,
 | 
				
			||||||
    updatePlatformCouponStatus,
 | 
					    delKanJiaGoods,
 | 
				
			||||||
  } from "@/api/promotion";
 | 
					  } from "@/api/promotion";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  export default {
 | 
					  export default {
 | 
				
			||||||
@ -63,30 +87,46 @@
 | 
				
			|||||||
          pageSize: 10, // 页面大小
 | 
					          pageSize: 10, // 页面大小
 | 
				
			||||||
          sort: "startTime", // 默认排序字段
 | 
					          sort: "startTime", // 默认排序字段
 | 
				
			||||||
          order: "desc", // 默认排序方式
 | 
					          order: "desc", // 默认排序方式
 | 
				
			||||||
          promotionName: ""
 | 
					          goodsName: ""
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        form: {
 | 
					        form: {
 | 
				
			||||||
          // 添加或编辑表单对象初始化数据
 | 
					          // 添加或编辑表单对象初始化数据
 | 
				
			||||||
          promotionName: "",
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        // 表单验证规则
 | 
					        // 表单验证规则
 | 
				
			||||||
        formValidate: {
 | 
					        formValidate: {},
 | 
				
			||||||
          promotionName: [
 | 
					 | 
				
			||||||
            { required: true, message: "不能为空", trigger: "blur" },
 | 
					 | 
				
			||||||
          ],
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        submitLoading: false, // 添加或编辑提交状态
 | 
					        submitLoading: false, // 添加或编辑提交状态
 | 
				
			||||||
        selectList: [], // 多选数据
 | 
					        selectList: [], // 多选数据
 | 
				
			||||||
        selectCount: 0, // 多选计数
 | 
					        selectCount: 0, // 多选计数
 | 
				
			||||||
        columns: [
 | 
					        columns: [
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            title: "活动名称",
 | 
					            title: "商品名称",
 | 
				
			||||||
            key: "promotionName",
 | 
					            slot: "goodsName",
 | 
				
			||||||
            minWidth: 100,
 | 
					            minWidth: 150,
 | 
				
			||||||
            tooltip: true
 | 
					            tooltip: true,
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            title: "每人最低砍价",
 | 
					            title: "库存数量",
 | 
				
			||||||
 | 
					            slot: "quantity",
 | 
				
			||||||
 | 
					            width: 100,
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            title: "剩余活动库存",
 | 
				
			||||||
 | 
					            key: "stock",
 | 
				
			||||||
 | 
					            width: 110,
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            title: "最低购买金额",
 | 
				
			||||||
 | 
					            key: "lowestPrice",
 | 
				
			||||||
 | 
					            minWidth: 110,
 | 
				
			||||||
 | 
					            render: (h, params) => {
 | 
				
			||||||
 | 
					              return h(
 | 
				
			||||||
 | 
					                "div",
 | 
				
			||||||
 | 
					                this.$options.filters.unitPrice(params.row.lowestPrice, "¥")
 | 
				
			||||||
 | 
					              );
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            title: "每人最低砍",
 | 
				
			||||||
            key: "lowestPrice",
 | 
					            key: "lowestPrice",
 | 
				
			||||||
            minWidth: 100,
 | 
					            minWidth: 100,
 | 
				
			||||||
            render: (h, params) => {
 | 
					            render: (h, params) => {
 | 
				
			||||||
@ -97,7 +137,7 @@
 | 
				
			|||||||
            },
 | 
					            },
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            title: "每人最高砍价",
 | 
					            title: "每人最高砍",
 | 
				
			||||||
            key: "highestPrice",
 | 
					            key: "highestPrice",
 | 
				
			||||||
            minWidth: 100,
 | 
					            minWidth: 100,
 | 
				
			||||||
            tooltip: true,
 | 
					            tooltip: true,
 | 
				
			||||||
@ -109,20 +149,20 @@
 | 
				
			|||||||
            },
 | 
					            },
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            title: "活动时间",
 | 
					            title: "结算价格",
 | 
				
			||||||
            width: 300,
 | 
					            key: "settlementPrice",
 | 
				
			||||||
 | 
					            minWidth: 100,
 | 
				
			||||||
            render: (h, params) => {
 | 
					            render: (h, params) => {
 | 
				
			||||||
              if (params.row.getType === "ACTIVITY") {
 | 
					              return h(
 | 
				
			||||||
                return h("div", "长期有效");
 | 
					                "div",
 | 
				
			||||||
              } else {
 | 
					                this.$options.filters.unitPrice(params.row.settlementPrice, "¥")
 | 
				
			||||||
                return h("div", {
 | 
					              );
 | 
				
			||||||
                  domProps: {
 | 
					 | 
				
			||||||
                    innerHTML:
 | 
					 | 
				
			||||||
                      params.row.startTime + "~" + params.row.endTime,
 | 
					 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
                });
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            title: "活动开始时间",
 | 
				
			||||||
 | 
					            slot: "startTime",
 | 
				
			||||||
 | 
					            minWidth: 150,
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            title: "状态",
 | 
					            title: "状态",
 | 
				
			||||||
@ -155,14 +195,14 @@
 | 
				
			|||||||
                ),
 | 
					                ),
 | 
				
			||||||
              ]);
 | 
					              ]);
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            width: 130,
 | 
					            width: 100,
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            title: "操作",
 | 
					            title: "操作",
 | 
				
			||||||
            slot: "action",
 | 
					            slot: "action",
 | 
				
			||||||
            align: "center",
 | 
					            align: "center",
 | 
				
			||||||
            fixed: "right",
 | 
					            fixed: "right",
 | 
				
			||||||
            width: 180,
 | 
					            width: 150,
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        data: [], // 表单数据
 | 
					        data: [], // 表单数据
 | 
				
			||||||
@ -170,23 +210,7 @@
 | 
				
			|||||||
        selectCoupon: [], //本级选中的优惠券
 | 
					        selectCoupon: [], //本级选中的优惠券
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    props: {
 | 
					    props: {},
 | 
				
			||||||
      // 是否为选中模式
 | 
					 | 
				
			||||||
      checked: {
 | 
					 | 
				
			||||||
        type: Boolean,
 | 
					 | 
				
			||||||
        default: false,
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      //优惠券类型 查询参数
 | 
					 | 
				
			||||||
      getType: {
 | 
					 | 
				
			||||||
        type: String,
 | 
					 | 
				
			||||||
        default: "",
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      //已选择优惠券
 | 
					 | 
				
			||||||
      selectedList: {
 | 
					 | 
				
			||||||
        type: Array,
 | 
					 | 
				
			||||||
        default: [],
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    watch: {
 | 
					    watch: {
 | 
				
			||||||
      $route(to, from) {
 | 
					      $route(to, from) {
 | 
				
			||||||
        if (to.fullPath == "/promotion/manager-coupon") {
 | 
					        if (to.fullPath == "/promotion/manager-coupon") {
 | 
				
			||||||
@ -215,12 +239,9 @@
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
      // 添加砍价活动跳转
 | 
					      // 添加砍价活动跳转
 | 
				
			||||||
      add() {
 | 
					      add() {
 | 
				
			||||||
        this.$router.push({ name: "add-kanJia-activity" });
 | 
					        this.$router.push({name: "add-kanJia-activity-goods"});
 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      /** 跳转至领取详情页面 */
 | 
					 | 
				
			||||||
      receiveInfo(v) {
 | 
					 | 
				
			||||||
        this.$router.push({ name: "member-receive-coupon", query: { id: v.id } });
 | 
					 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      info(v) {
 | 
					      info(v) {
 | 
				
			||||||
        this.$router.push({name: "platform-coupon-info", query: {id: v.id}});
 | 
					        this.$router.push({name: "platform-coupon-info", query: {id: v.id}});
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
@ -250,37 +271,6 @@
 | 
				
			|||||||
        this.$refs.table.selectAll(false);
 | 
					        this.$refs.table.selectAll(false);
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      /**
 | 
					 | 
				
			||||||
       * 取消已选择的数据
 | 
					 | 
				
			||||||
       */
 | 
					 | 
				
			||||||
      cancelSelect(selection, row) {
 | 
					 | 
				
			||||||
        console.log(row)
 | 
					 | 
				
			||||||
        let findCoupon = this.selectCoupon.find((item) => {
 | 
					 | 
				
			||||||
          return item.id == row.id;
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        // 如果没有则添加
 | 
					 | 
				
			||||||
        if (!findCoupon) {
 | 
					 | 
				
			||||||
          this.selectCoupon.push(row);
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          // 有重复数据就删除
 | 
					 | 
				
			||||||
          this.selectCoupon.map((item, index) => {
 | 
					 | 
				
			||||||
            if (item.id == findCoupon.id) {
 | 
					 | 
				
			||||||
              this.selectCoupon.splice(index, 1);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      /**
 | 
					 | 
				
			||||||
       * 选择优惠券
 | 
					 | 
				
			||||||
       */
 | 
					 | 
				
			||||||
      changeSelect(e) {
 | 
					 | 
				
			||||||
        if (this.checked && e.length != 0) {
 | 
					 | 
				
			||||||
          this.selectCoupon.push(...e);
 | 
					 | 
				
			||||||
          this.check();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        this.selectList = e;
 | 
					 | 
				
			||||||
        this.selectCount = e.length;
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      getDataList() {
 | 
					      getDataList() {
 | 
				
			||||||
        this.loading = true;
 | 
					        this.loading = true;
 | 
				
			||||||
        if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
 | 
					        if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
 | 
				
			||||||
@ -291,21 +281,9 @@
 | 
				
			|||||||
          this.searchForm.endTime = null;
 | 
					          this.searchForm.endTime = null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // 带多条件搜索参数获取表单数据 请自行修改接口
 | 
					        // 带多条件搜索参数获取表单数据 请自行修改接口
 | 
				
			||||||
        getKanjiaList(this.searchForm).then((res) => {
 | 
					        getKanJiaGoodsList(this.searchForm).then((res) => {
 | 
				
			||||||
          this.loading = false;
 | 
					          this.loading = false;
 | 
				
			||||||
          if (res.success) {
 | 
					          if (res.success) {
 | 
				
			||||||
            res.result.records.forEach((item) => {
 | 
					 | 
				
			||||||
              if (this.selectCoupon.length != 0) {
 | 
					 | 
				
			||||||
                this.selectCoupon.forEach((child) => {
 | 
					 | 
				
			||||||
                  if (item.id == child.id) {
 | 
					 | 
				
			||||||
                    item.___selected = true;
 | 
					 | 
				
			||||||
                    item._checked = true;
 | 
					 | 
				
			||||||
                  }
 | 
					 | 
				
			||||||
                });
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
              item.___selected = false;
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            this.data = res.result.records;
 | 
					            this.data = res.result.records;
 | 
				
			||||||
            this.total = res.result.total;
 | 
					            this.total = res.result.total;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
@ -313,121 +291,24 @@
 | 
				
			|||||||
        this.total = this.data.length;
 | 
					        this.total = this.data.length;
 | 
				
			||||||
        this.loading = false;
 | 
					        this.loading = false;
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      handleSubmit() {
 | 
					 | 
				
			||||||
        this.$refs.form.validate((valid) => {
 | 
					 | 
				
			||||||
          if (valid) {
 | 
					 | 
				
			||||||
            this.submitLoading = true;
 | 
					 | 
				
			||||||
            if (this.modalType === 0) {
 | 
					 | 
				
			||||||
              // 添加 避免编辑后传入id等数据 记得删除
 | 
					 | 
				
			||||||
              delete this.form.id;
 | 
					 | 
				
			||||||
              this.postRequest("/coupon/insertOrUpdate", this.form).then(
 | 
					 | 
				
			||||||
                (res) => {
 | 
					 | 
				
			||||||
                  this.submitLoading = false;
 | 
					 | 
				
			||||||
                  if (res.success) {
 | 
					 | 
				
			||||||
                    this.$Message.success("操作成功");
 | 
					 | 
				
			||||||
                    this.getDataList();
 | 
					 | 
				
			||||||
                    this.modalVisible = false;
 | 
					 | 
				
			||||||
                  }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
              );
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
              // 编辑
 | 
					 | 
				
			||||||
              this.postRequest("/coupon/insertOrUpdate", this.form).then(
 | 
					 | 
				
			||||||
                (res) => {
 | 
					 | 
				
			||||||
                  this.submitLoading = false;
 | 
					 | 
				
			||||||
                  if (res.success) {
 | 
					 | 
				
			||||||
                    this.$Message.success("操作成功");
 | 
					 | 
				
			||||||
                    this.getDataList();
 | 
					 | 
				
			||||||
                    this.modalVisible = false;
 | 
					 | 
				
			||||||
                  }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
              );
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      edit(v) {
 | 
					      edit(v) {
 | 
				
			||||||
        this.$router.push({ name: "edit-kanJia-activity", query: { id: v.id } });
 | 
					        this.$router.push({name: "edit-kanJia-activity-goods", query: {id: v.id}});
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      remove(v) {
 | 
					      delAll(row) {
 | 
				
			||||||
        this.$Modal.confirm({
 | 
					        this.$Modal.confirm({
 | 
				
			||||||
          title: "确认下架",
 | 
					          title: "确认删除",
 | 
				
			||||||
          // 记得确认修改此处
 | 
					          content: "确认需要删除此砍价商品",
 | 
				
			||||||
          content: "确认要下架此优惠券么?",
 | 
					 | 
				
			||||||
          loading: true,
 | 
					 | 
				
			||||||
          onOk: () => {
 | 
					 | 
				
			||||||
            // 删除
 | 
					 | 
				
			||||||
            updatePlatformCouponStatus({
 | 
					 | 
				
			||||||
              couponIds: v.id,
 | 
					 | 
				
			||||||
              promotionStatus: "CLOSE",
 | 
					 | 
				
			||||||
            })
 | 
					 | 
				
			||||||
              .then((res) => {
 | 
					 | 
				
			||||||
                this.$Modal.remove();
 | 
					 | 
				
			||||||
                if (res.success) {
 | 
					 | 
				
			||||||
                  this.$Message.success("优惠券已作废");
 | 
					 | 
				
			||||||
                  this.getDataList();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
              })
 | 
					 | 
				
			||||||
              .catch(() => {
 | 
					 | 
				
			||||||
                this.$Modal;
 | 
					 | 
				
			||||||
              });
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      delAll() {
 | 
					 | 
				
			||||||
        if (this.selectCount <= 0) {
 | 
					 | 
				
			||||||
          this.$Message.warning("您还未选择要下架的优惠券");
 | 
					 | 
				
			||||||
          return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        this.$Modal.confirm({
 | 
					 | 
				
			||||||
          title: "确认下架",
 | 
					 | 
				
			||||||
          content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
 | 
					 | 
				
			||||||
          loading: true,
 | 
					          loading: true,
 | 
				
			||||||
          onOk: () => {
 | 
					          onOk: () => {
 | 
				
			||||||
            let ids = [];
 | 
					            let ids = [];
 | 
				
			||||||
            this.selectList.forEach(function (e) {
 | 
					            this.selectList.forEach(function (e) {
 | 
				
			||||||
              ids.push(e.id);
 | 
					              ids.push(e.id);
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            let params = {
 | 
					 | 
				
			||||||
              couponIds: ids.toString(),
 | 
					 | 
				
			||||||
              promotionStatus: "CLOSE",
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
            // 批量删除
 | 
					            // 批量删除
 | 
				
			||||||
            updatePlatformCouponStatus(params).then((res) => {
 | 
					            delKanJiaGoods(row.id).then((res) => {
 | 
				
			||||||
              this.$Modal.remove();
 | 
					              this.$Modal.remove();
 | 
				
			||||||
              if (res.success) {
 | 
					              if (res.success) {
 | 
				
			||||||
                this.$Message.success("下架成功");
 | 
					                this.$Message.success("删除成功");
 | 
				
			||||||
                this.clearSelectAll();
 | 
					 | 
				
			||||||
                this.getDataList();
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      upAll() {
 | 
					 | 
				
			||||||
        if (this.selectCount <= 0) {
 | 
					 | 
				
			||||||
          this.$Message.warning("请选择要上架的优惠券");
 | 
					 | 
				
			||||||
          return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        this.$Modal.confirm({
 | 
					 | 
				
			||||||
          title: "确认上架",
 | 
					 | 
				
			||||||
          content: "您确认要上架所选的 " + this.selectCount + " 条数据?",
 | 
					 | 
				
			||||||
          loading: true,
 | 
					 | 
				
			||||||
          onOk: () => {
 | 
					 | 
				
			||||||
            let ids = [];
 | 
					 | 
				
			||||||
            this.selectList.forEach(function (e) {
 | 
					 | 
				
			||||||
              ids.push(e.id);
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            let params = {
 | 
					 | 
				
			||||||
              couponIds: ids.toString(),
 | 
					 | 
				
			||||||
              promotionStatus: "START",
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
            // 批量上架
 | 
					 | 
				
			||||||
            updatePlatformCouponStatus(params).then((res) => {
 | 
					 | 
				
			||||||
              this.$Modal.remove();
 | 
					 | 
				
			||||||
              if (res.success) {
 | 
					 | 
				
			||||||
                this.$Message.success("上架成功");
 | 
					 | 
				
			||||||
                this.clearSelectAll();
 | 
					 | 
				
			||||||
                this.getDataList();
 | 
					                this.getDataList();
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
@ -436,10 +317,6 @@
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    mounted() {
 | 
					    mounted() {
 | 
				
			||||||
      //如果作为组件方式,传入了类型值,则搜索参数附加类型
 | 
					 | 
				
			||||||
      if (this.getType) {
 | 
					 | 
				
			||||||
        this.searchForm.getType = this.getType;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      this.init();
 | 
					      this.init();
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user