Bladeren bron

no message

linwenxin 1 jaar geleden
bovenliggende
commit
ac14330ffa

+ 211 - 0
src/components/selectComponent/selectGoods.vue

@@ -0,0 +1,211 @@
+<template>
+  <el-dialog title="选择商品" :visible.sync="show" :show-close="false" width="1000px" :close-on-click-modal="false">
+    <div class="dialog-container clearfix">
+      <div class="left fl">
+        <div class="item" @click="changeClassify('')">全部分类</div>
+        <div class="group" v-for="(item, index) in classifyList" :key="index">
+          <div class="item" @click="toggleOpen(index)">
+            <i :class="item.isOpen ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i> {{ item.name }}
+          </div>
+          <div class="child" v-if="item.isOpen">
+            <div class="item" v-for="(childItem, childIndex) in item.children" :key="childIndex"
+              @click="changeClassify(childItem.categoryId)">{{ childItem.name }}</div>
+          </div>
+        </div>
+      </div>
+      <div class="right fl">
+        <div class="search">
+          <el-input placeholder="请输入商品名称进行搜索" v-model="goods_keyword" class="input-with-select" clearable size="small"
+            style="width: 250px">
+            <el-button slot="append" icon="el-icon-search" size="small" @click="getGoodsListByScreen"></el-button>
+          </el-input>
+        </div>
+        <div class="table" style="margin: 10px 0 20px;">
+          <el-table v-loading="goodsTable_listLoading" :data="goodsTable_dataList" element-loading-text="Loading"
+            tooltip-effect="dark" style="width: 100%" max-height="270" @selection-change="handleChooseGoods">
+            <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
+            <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200"
+              show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" prop="goodsPrice" label="价格" width="80"></el-table-column>
+            <el-table-column align="center" prop="stockNum" label="库存" width="80"></el-table-column>
+          </el-table>
+        </div>
+        <div class="pagination clearfix">
+          <div class="fr">
+            <el-pagination @current-change="goodsTableCurrentChange" :current-page="goodsTable_currentPage"
+              :page-size="goodsTable_pageSize" background layout="prev, pager, next" :total="goodsTable_listTotal">
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="submitAddGoods">保 存</el-button>
+      <el-button @click="cancelAddGoods">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getClassifyList, getGoodsList } from "@/api/coupon";
+export default {
+  props: {
+    goodsList: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      show:true,
+      maxGoodsCount: 10000000,
+      classifyList: [],
+      classifyCurrent: '',
+      goods_keyword: '',
+      goodsTable_dataList: null, // 列表数据
+      goodsTable_listLoading: true, // 列表加载loading
+      goodsTable_currentPage: 1, // 当前页码
+      goodsTable_pageSize: 10, // 每页数量
+      goodsTable_listTotal: 0, // 列表总数
+      goodsTable_choose: [], // table中 当前选择商品
+    }
+  },
+  created() {
+    this.getGoodsList();
+  },
+  methods: {
+    // 获取分类列表
+    getClassifyList() {
+      getClassifyList({ categoryLevel: 1, status: true }).then(res => {
+        res.data.forEach(item => {
+          item.isOpen = false;
+        });
+        this.classifyList = res.data;
+        this.classifyCurrent = '';
+        this.getGoodsList();
+      })
+    },
+
+    // 展开/收起 分类
+    toggleOpen(index) {
+      this.classifyList[index].isOpen = !this.classifyList[index].isOpen;
+    },
+
+    // 切换分类
+    changeClassify(cid) {
+      if (this.goodsTable_choose.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分类');
+      }
+      this.classifyCurrent = cid;
+      this.goodsTable_currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 搜索
+    getGoodsListByScreen() {
+      if (this.goodsTable_choose.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可搜索');
+      }
+      this.goodsTable_currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 获取商品列表
+    getGoodsList() {
+      getGoodsList({
+        pageNum: this.goodsTable_currentPage,
+        pageSize: this.goodsTable_pageSize,
+        keyword: this.goods_keyword,
+        categoryId: this.classifyCurrent,
+      }).then(res => {
+        let oldGoodsList = [...this.goodsList];
+        let newGoodsList = res.data.records;
+        for (let i = 0; i < oldGoodsList.length; i++) {
+          let oldItem = oldGoodsList[i]
+          for (let j = 0; j < newGoodsList.length; j++) {
+            let newItem = newGoodsList[j]
+            if (newItem.goodsId === oldItem.goodsId) {
+              newGoodsList[j].selected = true;
+              break;
+            }
+          }
+        }
+        this.goodsTable_dataList = newGoodsList;
+        this.goodsTable_listTotal = res.data.total;
+        this.goodsTable_listLoading = false;
+      })
+    },
+
+    // 查询重复值并禁选
+    checkboxSelect(row, rowIndex) {
+      if (row.selected) {
+        return false // 禁用
+      } else {
+        return true // 不禁用
+      }
+    },
+
+    // 更改列表当前页
+    goodsTableCurrentChange(val) {
+      if (this.goodsTable_choose.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分页');
+      }
+      this.goodsTable_currentPage = val;
+      this.getGoodsList();
+    },
+
+    // table点击选择商品
+    handleChooseGoods(val) {
+      this.goodsTable_choose = val;
+    },
+
+    // 取消 选择会员
+    cancelAddGoods() {
+      this.$emit("cancelSelectGoods")
+    },
+
+    // 提交 选择会员
+    submitAddGoods() {
+      this.$emit("selectGoodsPass", [...this.goodsList, ...this.goodsTable_choose])
+      this.$nextTick(() => {
+        this.$emit("cancelSelectGoods")
+      })
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.dialog-container {
+  .left {
+    width: 140px;
+    height: 350px;
+    overflow-y: scroll;
+
+    .group {
+      margin-top: 10px;
+    }
+
+    .child {
+      margin-top: 5px;
+
+      .item {
+        padding-left: 18px;
+      }
+    }
+
+    .item {
+      cursor: pointer;
+      line-height: 24px;
+    }
+  }
+
+  .right {
+    width: calc(100% - 140px);
+    height: 350px;
+    box-sizing: border-box;
+    padding-left: 20px;
+  }
+}
+</style>

+ 172 - 0
src/components/selectComponent/selectMember.vue

@@ -0,0 +1,172 @@
+<template>
+  <el-dialog title="选择会员" :visible.sync="show" :show-close="false" width="1000px" :close-on-click-modal="false">
+    <div class="dialog-container2 clearfix">
+      <el-form ref="screenForm" :model="member_screenForm" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :xs="7" :sm="7" :lg="7">
+            <el-form-item label="关键词" prop="keyword" label-width="55px">
+              <el-input v-model="member_screenForm.keyword" placeholder="请输入会员名称/电话"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="8" :sm="8" :lg="8">
+            <el-form-item label="注册日期" prop="registerDate" label-width="70px">
+              <el-date-picker style="width: 100%" v-model="member_screenForm.registerDate" type="daterange"
+                value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col  :xs="6" :sm="6" :lg="6">
+            <el-form-item label="" prop="type" label-width="20px">
+              <el-radio-group v-model="member_screenForm.type" :disabled="memberList.length > 0 ? true : false">
+                <el-radio :label="'SERVICE'">业务员</el-radio>
+                <el-radio :label="'GENERAL'">普通用户</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="2" :sm="2" :lg="2" class="tr">
+            <el-button size="small" type="primary" @click="getMemberListByScreen">搜索</el-button>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div class="table memberTable" style="margin: 10px 0 20px;">
+        <el-table v-loading="memberTable_listLoading" :data="memberTable_dataList" element-loading-text="Loading"
+          tooltip-effect="dark" style="width: 100%" max-height="360" @selection-change="handleChooseMember">
+          <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
+          <el-table-column align="center" prop="nickName" label="会员名称" min-width="150"></el-table-column>
+          <el-table-column align="center" prop="sex" label="性别" min-width="100"></el-table-column>
+          <el-table-column align="center" prop="mobile" label="注册手机" min-width="100"></el-table-column>
+          <el-table-column align="center" prop="memberName" label="角色" min-width="100">
+            <template slot-scope="scope">
+              {{ scope.row.type | MEMBER_CURRENT_TYPE_FILTER }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="memberName" label="状态" min-width="100">
+            <template slot-scope="scope">
+              <el-tag :type="scope.row.status ? 'success' : 'danger'">{{ scope.row.status | MEMBER_CURRENT_STATUS_FILTER
+              }}</el-tag>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination @current-change="memberTableCurrentChange" :current-page="memberTable_currentPage"
+            :page-size="memberTable_pageSize" background layout="prev, pager, next" :total="memberTable_listTotal">
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="submitAddMember">保 存</el-button>
+      <el-button @click="cancelAddMember">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getMemberList } from "@/api/coupon";
+export default {
+  props: {
+    memberList: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      show:true,
+      member_screenForm: { // 筛选表单数据
+        keyword: '', // 名称
+        registerDate: [],
+        type: 'SERVICE',
+      },
+      memberTable_dataList: [], // 列表数据
+      memberTable_listLoading: true, // 列表加载loading
+      memberTable_currentPage: 1, // 当前页码
+      memberTable_pageSize: 10, // 每页数量
+      memberTable_listTotal: 0, // 列表总数
+      memberTable_choose: [], // table中 当前选择会员
+    }
+  },
+  created() {
+    this.getMemberList()
+  },
+  methods: {
+    // 搜索
+    getMemberListByScreen() {
+      if (this.memberTable_choose.length > 0) {
+        return this.$errorMsg('当前已选择会员,不可搜索');
+      }
+      this.memberTable_currentPage = 1;
+      this.getMemberList();
+    },
+
+    // 查询重复值并禁选
+    checkboxSelect(row, rowIndex) {
+      if (row.selected) {
+        return false // 禁用
+      } else {
+        return true // 不禁用
+      }
+    },
+    // 获取会员列表
+    getMemberList() {
+      getMemberList({
+        pageNum: this.memberTable_currentPage,
+        pageSize: this.memberTable_pageSize,
+        keyword: this.member_screenForm.keyword,
+        type: this.member_screenForm.type,
+        startTime: this.member_screenForm.registerDate && this.member_screenForm.registerDate[0] ? this.member_screenForm.registerDate[0] + ' 00:00:00' : null,
+        endTime: this.member_screenForm.registerDate && this.member_screenForm.registerDate[1] ? this.member_screenForm.registerDate[1] + ' 23:59:59' : null,
+      }).then(res => {
+        let oldMemberList = this.memberList;
+        let newMemberList = res.data.records;
+        for (let i = 0; i < oldMemberList.length; i++) {
+          let oldItem = oldMemberList[i]
+          for (let j = 0; j < newMemberList.length; j++) {
+            let newItem = newMemberList[j]
+            if (newItem.userId === oldItem.userId) {
+              newMemberList[j].selected = true;
+              break;
+            }
+          }
+        }
+        this.memberTable_dataList = newMemberList;
+        this.memberTable_listTotal = res.data.total;
+        this.memberTable_listLoading = false;
+      })
+    },
+
+    // 更改列表当前页
+    memberTableCurrentChange(val) {
+      if (this.memberTable_choose.length > 0) {
+        return this.$errorMsg('当前已选择会员,不可切换分页');
+      }
+      this.memberTable_currentPage = val;
+      this.getMemberList();
+    },
+
+    // table点击选择会员
+    handleChooseMember(val) {
+      this.memberTable_choose = val;
+    },
+
+    // 取消 选择会员
+    cancelAddMember() {
+      this.$emit("cancelSelectMember")
+    },
+
+    // 提交 选择会员
+    submitAddMember() {
+      this.$emit("selectMemberPass", [...this.memberList, ...this.memberTable_choose])
+      this.$nextTick(() => {
+        this.$emit("cancelSelectMember")
+      })
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+</style>

+ 101 - 58
src/filters/index.js

@@ -1,5 +1,7 @@
-import { COMMON_SELECT } from '@/utils/select_data'
-import { getDictList } from '@/api/common'
+
+import {
+  COMMON_SELECT
+} from '@/utils/select_data'
 
 /**
  * Show plural label if time is plural number
@@ -36,12 +38,12 @@ export function timeAgo(time) {
  */
 export function numberFormatter(num, digits) {
   const si = [
-    { value: 1e18, symbol: 'E' },
-    { value: 1e15, symbol: 'P' },
-    { value: 1e12, symbol: 'T' },
-    { value: 1e9, symbol: 'G' },
-    { value: 1e6, symbol: 'M' },
-    { value: 1e3, symbol: 'k' }
+    { value: 1E18, symbol: 'E' },
+    { value: 1E15, symbol: 'P' },
+    { value: 1E12, symbol: 'T' },
+    { value: 1E9, symbol: 'G' },
+    { value: 1E6, symbol: 'M' },
+    { value: 1E3, symbol: 'k' }
   ]
   for (let i = 0; i < si.length; i++) {
     if (num >= si[i].value) {
@@ -67,20 +69,6 @@ export function uppercaseFirst(string) {
   return string.charAt(0).toUpperCase() + string.slice(1)
 }
 
-/**
- * 保留2位小数点
- * @param {number} num
- * @returns
- */
-export function numToFixed(num) {
-  if (!num) return '0.00'
-  if (isNaN(Number(num))) return num
-  num = num.toFixed(2)
-  if (num.includes('.')) {
-    return num.slice(0, -3).replace(/(\d)(?=(\d{3})+$)/g, '$1,') + num.slice(-3)
-  }
-  return num.replace(/(\d)(?=(\d{3})+$)/g, '$1,')
-}
 
 /**
  * 截取到“日”的日期
@@ -88,9 +76,7 @@ export function numToFixed(num) {
  * @param {String} date
  */
 export function dateToDayFilter(date) {
-  if (!date) {
-    return ''
-  }
+  if(!date) {return ''}
   return date.slice(0, 10)
 }
 
@@ -99,10 +85,8 @@ export function dateToDayFilter(date) {
  * yyyy-MM-dd HH:mm:ss  =>  yyyy-MM-dd HH:mm
  * @param {String} date
  */
-export function dateToMinFilter(date) {
-  if (!date) {
-    return ''
-  }
+ export function dateToMinFilter(date) {
+  if(!date) {return ''}
   return date.slice(0, 16)
 }
 
@@ -110,10 +94,8 @@ export function dateToMinFilter(date) {
  * 转换成“年月”的日期
  * yyyy-MM-dd HH:mm:ss  =>  yyyy年MM月
  */
-export function dateToYearMonthFilter(date) {
-  if (!date) {
-    return ''
-  }
+ export function dateToYearMonthFilter(date) {
+  if(!date) {return ''}
   return date.slice(0, 4) + '年' + date.slice(5, 7) + '月'
 }
 
@@ -121,53 +103,114 @@ export function dateToYearMonthFilter(date) {
  * 密码
  */
 export function passwordFilter(value) {
-  if (value === null || value === '') return ''
-  let password = '********'
+  if(value === null || value === '') return ''
+  let password = '********';
   // for (let i = 0; i < value.length; i++) {
   //   password += '*'
   // }
-  return password
+  return password;
+}
+
+/**
+ * 会员的当前状态
+ */
+export function MEMBER_CURRENT_STATUS_FILTER(value) {
+  let obj = COMMON_SELECT.MEMBER_CURRENT_STATUS.find(o => o.value === value);
+  return obj ? obj.label : ''
 }
 
 /**
- * 服务单状态
+ * 会员的类型
+ */
+export function MEMBER_CURRENT_TYPE_FILTER(value) {
+  let obj = COMMON_SELECT.MEMBER_CURRENT_TYPE.find(o => o.value === value);
+  return obj ? obj.label : ''
+}
+
+/**
+ * 订单状态
  */
 export function ORDER_CURRENT_STATUS_FILTER(value) {
-  let obj = COMMON_SELECT.ORDER_CURRENT_STATUS.find(o => o.value === value)
+  let obj = COMMON_SELECT.ORDER_CURRENT_STATUS.find(o => o.value === value);
+  return obj ? obj.label : ''
+}
+
+/**
+ * 物流状态
+ */
+export function EXPRESS_CURRENT_STATE_FILTER(value) {
+  let obj = COMMON_SELECT.EXPRESS_CURRENT_STATE.find(o => o.value === value);
+  return obj ? obj.label : ''
+}
+
+/**
+ * 维护订单状态
+ */
+export function ORDER_REFUND_CURRENT_STATUS_FILTER(value) {
+  let obj = COMMON_SELECT.ORDER_REFUND_CURRENT_STATUS.find(o => o.value === value);
+  return obj ? obj.label : ''
+}
+
+/**
+ * 结算状态
+ */
+export function SETTLEMENT_CURRENT_STATUS_FILTER(value) {
+  let obj = COMMON_SELECT.SETTLEMENT_CURRENT_STATUS.find(o => o.value === value);
   return obj ? obj.label : ''
 }
 
-// 导入状态
-export function IMPORT_STATUS_FILTER(value) {
-  if (value === null || value === '') return ''
-  let obj = COMMON_SELECT.IMPORT_STATUS.find(o => o.value === value)
+/**
+ * 退款方式
+ */
+export function REFUND_CURRENT_TYPE_FILTER(value) {
+  let obj = COMMON_SELECT.REFUND_CURRENT_TYPE.find(o => o.value === value);
+  return obj ? obj.label : ''
+}
+
+/**
+ * 券标志
+ */
+export function COUPON_CURRENT_FLAG_FILTER(value) {
+  let obj = COMMON_SELECT.COUPON_CURRENT_FLAG.find(o => o.value === value);
   return obj ? obj.label : ''
 }
 
-// 销售类型
-export function SALES_TYPE_FILTER(value) {
-  if (value === null || value === '') return ''
-  let obj = COMMON_SELECT.SALES_TYPE.find(o => o.value === value)
+/**
+ * 秒杀活动状态
+ */
+export function SEC_KILL_CURRENT_STATUS_FILTER(value) {
+  let obj = COMMON_SELECT.SEC_KILL_CURRENT_STATUS.find(o => o.value === value);
   return obj ? obj.label : ''
 }
 
-// 默认状态
-export function DEFAULT_STATUS_FILTER(value) {
-  if (value === null || value === '') return ''
-  let obj = COMMON_SELECT.DEFAULT_STATUS.find(o => o.value === value)
+/**
+ * 消息类型
+ */
+export function NOTICE_CURRENT_TYPE_FILTER(value) {
+  let obj = COMMON_SELECT.NOTICE_CURRENT_TYPE.find(o => o.value === value);
   return obj ? obj.label : ''
 }
 
-// 结算状态
-export function SETTLE_STATUS_FILTER(value) {
-  if (value === null || value === '') return ''
-  let obj = COMMON_SELECT.SETTLE_STATUS.find(o => o.value === value)
+/**
+ * 线下销售状态
+ */
+ export function OFFLINE_STATUS_FILTER(value) {
+  let obj = COMMON_SELECT.OFFLINE_STATUS.find(o => o.value == value);
   return obj ? obj.label : ''
 }
 
-// 品类
-export function MAIN_LIST_FILTER(value) {
-  if (value === null || value === '') return ''
-  let obj = COMMON_SELECT.MAIN_LIST.find(o => o.value == value)
+/**
+ * 线下销售类型
+ */
+ export function OFFLINE_TYPE_FILTER(value) {
+  let obj = COMMON_SELECT.OFFLINE_TYPE.find(o => o.value === value);
   return obj ? obj.label : ''
 }
+
+/**
+ * 优惠码状态
+ */
+ export function DISCODE_STATUS_FILTER(value) {
+  let obj = COMMON_SELECT.DISCODE_STATUS.find(o => o.value === value);
+  return obj ? obj.label : ''
+}

+ 111 - 75
src/utils/select_data.js

@@ -1,8 +1,35 @@
+
 /**
  * 管理下拉框选项
  */
 
-// 服务单的当前状态
+// 会员的当前状态
+export const MEMBER_CURRENT_STATUS = [
+  { label: '正常', value: true },
+  { label: '禁用', value: false }
+]
+
+// 会员的当前类型
+export const MEMBER_CURRENT_TYPE = [
+  { label: '普通用户', value: 'GENERAL' },
+  { label: '业务员', value: 'SERVICE' }
+]
+
+// 结算的当前状态
+export const SETTLEMENT_CURRENT_STATUS = [
+  { label: '结算中', value: 'ING' },
+  { label: '已结算', value: 'OVER' },
+  { label: '已取消', value: 'CANCEL' },
+  { label: '异常结算', value: 'EXCEPTION' },
+]
+
+// 运费模板的当前状态
+export const FREIGHT_CURRENT_TYPE = [
+  { label: '启用', value: true },
+  { label: '禁用', value: false }
+]
+
+// 订单的当前状态
 export const ORDER_CURRENT_STATUS = [
   { label: '待付款', value: 'NOPAY' },
   { label: '待发货', value: 'DFH' },
@@ -10,102 +37,111 @@ export const ORDER_CURRENT_STATUS = [
   { label: '已完成', value: 'OVER' },
   { label: '已关闭', value: 'CLOSE' },
   { label: '已超时', value: 'TIMEOUT' },
-  { label: '售后', value: 'REFUND' }
-]
-
-// 大类列表
-export const MAIN_LIST = [
-  { label: '家用空调', value: 101 },
-  { label: '商用空调', value: 102 },
-  { label: '家用空气能热水器', value: 103 },
-  { label: '生活电器', value: 104 },
-  { label: '晶弘冰箱', value: 106 },
-  { label: '壁挂炉', value: 109 }
+  { label: '售后', value: 'REFUND' },
 ]
 
-// 大类列表
-export const MAIN2_LIST = [
-  { label: '家用空调', value: 101 },
-  { label: '空气能热水器', value: 103 },
-  { label: '生活电器', value: 104 },
-  { label: '晶弘冰箱', value: 106 }
+// 物流的当前状态
+export const EXPRESS_CURRENT_STATE = [
+  { label: '在途', value: 0 },
+  { label: '揽收', value: 1 },
+  { label: '疑难', value: 2 },
+  { label: '签收', value: 3 },
+  { label: '退签', value: 4 },
+  { label: '派件', value: 5 },
+  { label: '退回', value: 6 }
 ]
 
-// 大类列表
-export const MAIN3_LIST = [
-  { label: '家用空调', value: 101 },
-  { label: '空气能热水器', value: 103 },
-  { label: '生活电器', value: 104 },
-  { label: '晶弘冰箱', value: 106 },
-  { label: '清洗', value: 0 }
+// 维权订单的当前状态
+export const ORDER_REFUND_CURRENT_STATUS = [
+  { label: '待商家处理', value: 'DSJCL' },
+  { label: '待商家收货', value: 'DSJSH' },
+  { label: '待买家处理', value: 'DMJCL' },
+  { label: '已完成', value: 'OVER' },
+  { label: '已取消', value: 'CANCEL' },
+  { label: '已关闭', value: 'CLOSE' },
 ]
 
-// 确定状态
-export const CONFIRM_STATUS = [
-  { label: '已确定', value: 'yqd' },
-  { label: '未确定', value: 'wqd' },
-  { label: '部分确定', value: 'bfqd' }
+// 维权订单的当前类型
+export const REFUND_CURRENT_TYPE = [
+  { label: '仅退款', value: 'REFUND_AMOUNT' },
+  { label: '退货退款', value: 'REFUND_GOODS' }
 ]
 
-// 安装类型
-export const INSTALL_TYPE = [
-  { label: '一体机', value: 'all' },
-  { label: '内机', value: 'inside' },
-  { label: '外机', value: 'out' },
-  { label: '一拖二', value: 'insideTwo' },
-  { label: '一内一外', value: 'insideAndOut' }
+// 优惠券的当前标志
+export const COUPON_CURRENT_FLAG = [
+  { label: '待发布', value: 'WAIT' },
+  { label: '进行中', value: 'START' },
+  { label: '已结束', value: 'END' },
+  { label: '已取消', value: 'CANCEL' }
 ]
 
-// 结算状态
-export const SETTLE_STATUS = [
-  { label: '未结算', value: 'wjs' },
-  { label: '部分结算', value: 'bfjs' },
-  { label: '全部结算', value: 'yjs' }
+// 秒杀活动状态
+export const SEC_KILL_CURRENT_STATUS = [
+  { label: '未开始', value: 1 },
+  { label: '进行中', value: 2 },
+  { label: '已结束', value: 3 },
+  { label: '已关闭', value: 4 },
 ]
 
-// 结算状态
-export const SETTLE3_STATUS = [
-  { label: '待导入开票数据', value: 'DKP' },
-  { label: '待结算', value: 'WAIT' },
-  { label: '成功', value: 'OK' },
-  { label: '失败', value: 'FAIL' }
+// 消息类型
+export const NOTICE_CURRENT_TYPE = [
+  { label: '订单', value: 1 },
+  { label: '其他', value: 2 }
 ]
 
-// 导入状态
-export const IMPORT_STATUS = [
-  { label: '已导入', value: 'ydr' },
-  { label: '未导入', value: 'wdr' }
+// 工单大类
+export const ORDER_MAIN_TYPE = [
+  {id: 101, number: 101, name: '家用空调'},
+  {id: 102, number: 102, name: '商用空调'},
+  {id: 103, number: 103, name: '家用空气能热水器'},
+  {id: 104, number: 104, name: '生活电器'},
+  {id: 106, number: 106, name: '晶弘冰箱'},
+  {id: 107, number: 107, name: '手机'},
+  {id: 108, number: 108, name: '回收平台'},
+  {id: 109, number: 109, name: '壁挂炉'},
+  {id: 110, number: 110, name: '智能门锁'},
+  {id: 111, number: 111, name: '移动电源'},
+  {id: 112, number: 112, name: '格健医疗'},
+  {id: 113, number: 133, name: '商用净水机'},
+  // {id: 114, number: 110, name: '螺杆机'},
+  {id: 999, number: 999, name: '清洗服务'},
 ]
 
-// 配置状态
-export const CONFIGURE_STATUS = [
-  { label: '已配置', value: 1 },
-  { label: '未配置', value: 0 }
+// 线下销售状态
+export const OFFLINE_STATUS = [
+  { label: '正常', value: 1 },
+  { label: '作废', value: 0 }
 ]
 
-// 销售类型
-export const SALES_TYPE = [
-  { label: '零售机', value: 1 },
-  { label: '工程机', value: 2 }
+// 线下销售类型
+export const OFFLINE_TYPE = [
+  { label: '工程', value: 'PROJECT' },
+  { label: '二手', value: 'RESALE' },
+  { label: '批发', value: 'WHOLESALE' },
+  // { label: '线上', value: 'ONLINE' },
+  { label: '零售', value: 'RETAIL' },
 ]
 
-// 默认状态
-export const DEFAULT_STATUS = [
-  { label: '正常', value: true },
-  { label: '禁用', value: false }
+// 优惠码状态
+export const DISCODE_STATUS = [
+  { label: '未使用', value: 0 },
+  { label: '已使用', value: 1 }
 ]
 
 export const COMMON_SELECT = {
+  MEMBER_CURRENT_STATUS,
+  MEMBER_CURRENT_TYPE,
+  SETTLEMENT_CURRENT_STATUS,
+  FREIGHT_CURRENT_TYPE,
   ORDER_CURRENT_STATUS,
-  MAIN_LIST,
-  MAIN2_LIST,
-  MAIN3_LIST,
-  CONFIRM_STATUS,
-  INSTALL_TYPE,
-  SETTLE_STATUS,
-  SETTLE3_STATUS,
-  IMPORT_STATUS,
-  CONFIGURE_STATUS,
-  SALES_TYPE,
-  DEFAULT_STATUS
+  EXPRESS_CURRENT_STATE,
+  ORDER_REFUND_CURRENT_STATUS,
+  REFUND_CURRENT_TYPE,
+  COUPON_CURRENT_FLAG,
+  SEC_KILL_CURRENT_STATUS,
+  NOTICE_CURRENT_TYPE,
+  ORDER_MAIN_TYPE,
+  OFFLINE_STATUS,
+  OFFLINE_TYPE,
+  DISCODE_STATUS
 }

+ 981 - 0
src/views/mallManagement/activity/groupbuy_add/index.vue

@@ -0,0 +1,981 @@
+<template>
+  <div class="app-container">
+    <h3 style="margin-bottom: 30px">{{isEdit ? '编辑':'添加'}}团购活动</h3>
+
+    <div class="form-contaner">
+      <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="100px">
+        <el-form-item label="活动名称:" prop="name">
+          <el-input v-model="mainForm.name" placeholder="请填写活动名称" style="width: 400px;"></el-input>
+        </el-form-item>
+        <el-form-item label="活动时间:" prop="date">
+          <el-date-picker
+            v-model="mainForm.date"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            style="width: 400px;"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-upload
+          class="avatar-uploader"
+          style="height: 0"
+          :action="baseURL + 'common/upload'"
+          :headers="myHeaders"
+          :show-file-list="false"
+          :on-success="uploadSuccess"
+          :before-upload="beforeUpload">
+        </el-upload>
+        <el-form-item label="活动图:" prop="imgUrl">
+          <div class="images">
+            <div class="main-img">
+              <div class="img" v-if="img1_url" @mouseover="img1_hover = true;" @mouseout="img1_hover = false;">
+                <el-image ref="img1" :src="img1_url" :preview-src-list="[img1_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
+                <div class="mask" v-show="img1_hover">
+                  <i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
+                  <i class="el-icon-upload2" @click="uploadImage('img1')"></i>
+                  <i class="el-icon-delete" @click="deleteImage('img1')"></i>
+                </div>
+              </div>
+              <div class="add" v-else @click="uploadImage('img1')">
+                <i class="el-icon-plus avatar-uploader-icon"></i>
+              </div>
+            </div>
+          </div>
+        </el-form-item>
+        <el-form-item label="海报图:" prop="imgUrl">
+          <div class="images">
+            <div class="main-img">
+              <div class="img" v-if="img2_url" @mouseover="img2_hover = true;" @mouseout="img2_hover = false;">
+                <el-image ref="img2" :src="img2_url" :preview-src-list="[img2_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
+                <div class="mask" v-show="img2_hover">
+                  <i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
+                  <i class="el-icon-upload2" @click="uploadImage('img2')"></i>
+                  <i class="el-icon-delete" @click="deleteImage('img2')"></i>
+                </div>
+              </div>
+              <div class="add" v-else @click="uploadImage('img2')">
+                <i class="el-icon-plus avatar-uploader-icon"></i>
+              </div>
+            </div>
+          </div>
+        </el-form-item>
+        <el-form-item label="活动状态:" prop="status">
+          <el-radio-group v-model="mainForm.status">
+            <el-radio :label="true">启用</el-radio>
+            <el-radio :label="false">不启用</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="备注:" prop="remark">
+          <el-input type="textarea" v-model="mainForm.remark" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请填写备注" style="width: 400px;"></el-input>
+        </el-form-item>
+      </el-form>
+    </div>
+
+    <div class="mymain-container">
+      <div class="btn-group">
+        <el-button size="small" type="primary" @click="addMember">选择团长</el-button>
+      </div>
+
+      <div class="table">
+        <el-table :data="memberList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="300px">
+          <el-table-column align="center" label="头像" prop="avatar">
+            <template slot-scope="scope">
+              <el-image style="width: 40px; height: 40px; border-radius: 50%;" :src="scope.row.avatar" :preview-src-list="[scope.row.avatar]" fit="cover"></el-image>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="团长名称" prop="nickName"></el-table-column>
+          <el-table-column align="center" label="手机号码" prop="mobile"></el-table-column>
+
+          <el-table-column align="center" label="操作">
+            <template slot-scope="scope">
+              <el-popconfirm title="确定删除吗?" @onConfirm="deleteMember(scope.$index)" >
+                <el-button slot="reference" type="text">删除</el-button>
+              </el-popconfirm>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+
+      <div class="btn-group">
+        <el-button size="small" type="primary" @click="addGoods">选择商品</el-button>
+      </div>
+
+      <div class="diy-table">
+        <div class="table-head clearfix">
+          <div class="item goods">商品名称</div>
+          <div class="item sort">排序</div>
+          <div class="right">
+            <div class="item name">规格</div>
+            <div class="item input">划线价格</div>
+            <div class="item input">统一拼团价</div>
+            <div class="item input">统一团长分佣</div>
+            <div class="item input">库存</div>
+            <div class="item input">销量</div>
+            <div class="item opera">操作</div>
+          </div>
+          <div class="blank"></div>
+        </div>
+        <div class="goods-item" v-for="(item, index) in goodsList" :key="index">
+          <div class="goods-info">
+            <img :src="item.goodsImgSrc" alt="">
+            {{item.goodsName}}
+          </div>
+          <div class="sort">
+            <el-input type="number" size="small" v-model="item.sortNum"></el-input>
+          </div>
+          <div class="spec-list">
+            <div class="spec-item" v-for="(it, idx) in item.specs" :key="idx">
+              <div class="col name">{{it.goodsSpecName}}-{{it.goodsSpecValue}}</div>
+              <div class="col input"><el-input type="number" size="small" v-model="it.orgGoodsPrice"></el-input></div>
+              <div class="col input"><el-input type="number" size="small" v-model="it.comGroupPrice"></el-input></div>
+              <div class="col input"><el-input type="number" size="small" v-model="it.comShareAmount"></el-input></div>
+              <div class="col input"><el-input type="number" size="small" v-model="it.stock"></el-input></div>
+              <div class="col input"><el-input type="number" size="small" v-model="it.salesNum"></el-input></div>
+              <div class="col btn"><el-button type="text" @click="toSetHead(it.promotionGroupSpecId)">团长设置</el-button></div>
+            </div>
+          </div>
+          <div class="operation">
+            <el-button type="text" style="color: #f56c6c" @click="deleteGoods(index)">删除</el-button>
+          </div>
+        </div>
+        <div class="empty-text" v-if="goodsList.length < 1">暂无数据</div>
+      </div>
+    </div>
+
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{ formLoading ? '保存中 ...' : '保 存' }}</el-button>
+        <el-button @click="goBack">关 闭</el-button>
+      </div>
+    </div>
+
+
+    <!-- 选择商品 -->
+    <el-dialog title="选择商品" :visible.sync="addGoodsVisible" :show-close="false" width="60%" :close-on-click-modal="false">
+      <div class="dialog-container clearfix">
+        <div class="left fl">
+          <div class="item" @click="changeClassify('')">全部分类</div>
+          <div class="group" v-for="(item, index) in classifyList" :key="index">
+            <div class="item" @click="toggleOpen(index)">
+              <i :class="item.isOpen ? 'el-icon-caret-bottom':'el-icon-caret-right'"></i> {{item.name}}
+            </div>
+            <div class="child" v-if="item.isOpen">
+              <div class="item" v-for="(childItem, childIndex) in item.children" :key="childIndex" @click="changeClassify(childItem.categoryId)">{{childItem.name}}</div>
+            </div>
+          </div>
+        </div>
+
+        <div class="right fl">
+          <div class="search">
+            <el-input placeholder="请输入商品名称进行搜索" v-model="keyword" class="input-with-select" clearable size="small" style="width: 250px">
+              <el-button slot="append" icon="el-icon-search" size="small" @click="getGoodsListByScreen"></el-button>
+            </el-input>
+          </div>
+          <div class="table" style="margin: 10px 0 20px;">
+            <el-table 
+              v-loading="table_listLoading" 
+              :data="table_dataList" 
+              element-loading-text="Loading" 
+              tooltip-effect="dark" 
+              style="width: 100%" 
+              max-height="270"
+              @selection-change="handleChooseGoods">
+              <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
+              <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200" show-overflow-tooltip></el-table-column>
+              <el-table-column align="center" prop="goodsPrice" label="价格" width="80"></el-table-column>
+              <el-table-column align="center" prop="stockNum" label="库存" width="80"></el-table-column>
+            </el-table>
+          </div>
+          <div class="pagination clearfix">
+            <div class="fr">
+              <el-pagination
+                @current-change="handleTableCurrentChange"
+                :current-page="table_currentPage"
+                :page-size="table_pageSize"
+                background
+                layout="prev, pager, next"
+                :total="table_listTotal">
+              </el-pagination>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitAddGoods">保 存</el-button>
+        <el-button @click="cancelAddGoods">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 选择会员 -->
+    <el-dialog title="选择会员" :visible.sync="addMemberVisible" :show-close="false" width="65%" :close-on-click-modal="false">
+      <div class="dialog-container2 clearfix">
+        <el-form ref="screenForm" :model="member_screenForm" size="small" label-position="left">
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="7">
+              <el-form-item label="关键词" prop="keyword" label-width="55px">
+                <el-input v-model="member_screenForm.keyword" placeholder="请输入会员名称/电话"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="2" class="tr">
+              <el-button size="small" type="primary" @click="getMemberListByScreen">搜索</el-button>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div class="table memberTable" style="margin: 10px 0 20px;">
+          <el-table 
+            v-loading="memberTable_listLoading" 
+            :data="memberTable_dataList" 
+            element-loading-text="Loading" 
+            tooltip-effect="dark" 
+            style="width: 100%" 
+            max-height="360"
+            @selection-change="handleChooseMember">
+            <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
+            <el-table-column align="center" prop="nickName" label="会员名称" min-width="150"></el-table-column>
+            <el-table-column align="center" prop="mobile" label="手机号码" min-width="100"></el-table-column>
+          </el-table>
+        </div>
+        <div class="pagination clearfix">
+          <div class="fr">
+            <el-pagination
+              @current-change="memberTableCurrentChange"
+              :current-page="memberTable_currentPage"
+              :page-size="memberTable_pageSize"
+              background
+              layout="prev, pager, next"
+              :total="memberTable_listTotal">
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitAddMember">保 存</el-button>
+        <el-button @click="cancelAddMember">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getToken } from '@/utils/auth'
+import { editActivity, addActivity, getClassifyList, getGoodsList, getActivityDetail, getMemberList } from '@/api/groupbuy'
+
+export default {
+  data() {
+    return {
+      baseURL: process.env.VUE_APP_BASE_API,
+      myHeaders: {'x-token': getToken()},
+      isEdit: false,
+      editId: '',
+      formLoading: false,
+      mainForm: {
+        name: '',
+        date: '',
+        remark: '',
+        status: true,
+      },
+      mainFormRules: {
+        name: [
+          { required: true, message: '请填写活动名称', trigger: 'blur' }
+        ],
+        date: [
+          { required: true, message: '请选择活动时间', trigger: 'change' }
+        ],
+      },
+
+      uploadImageType: null,
+      img1_url: '',
+      img1_hover: false,
+      img2_url: '',
+      img2_hover: false,
+
+      goodsList: [], // 列表数据
+      addGoodsVisible: false,
+
+      classifyList: [],
+      classifyCurrent: '',
+      keyword: '',
+      table_dataList: null, // 列表数据
+      table_listLoading: true, // 列表加载loading
+      table_currentPage: 1, // 当前页码
+      table_pageSize: 10, // 每页数量
+      table_listTotal: 0, // 列表总数
+      table_chooseGoods: [], // table中 当前选择商品
+
+      saveDontBack: false,
+
+      memberList: [], // 会员数据
+      addMemberVisible: false,
+      member_screenForm: { // 筛选表单数据
+        keyword: '', // 名称
+      },
+      memberTable_dataList: null, // 列表数据
+      memberTable_listLoading: true, // 列表加载loading
+      memberTable_currentPage: 1, // 当前页码
+      memberTable_pageSize: 10, // 每页数量
+      memberTable_listTotal: 0, // 列表总数
+      memberTable_choose: [], // table中 当前选择会员
+
+    }
+  },
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+  created() {
+    const { id } = this.$route.query;
+    this.isEdit = id ? true : false;
+    this.editId = id;
+
+    if(this.isEdit) {
+      this.getDetail(id);
+    }
+  },
+  methods: {
+    goBack() {
+      this.$router.go(-1)
+    },
+
+    // 获取详情
+    getDetail(id) {
+      getActivityDetail({promotionGroupId: id}).then(res => {
+        this.mainForm = {
+          name: res.data.name,
+          date: [res.data.startTime.slice(0, 10), res.data.endTime.slice(0, 10)],
+          status: res.data.status,
+          remark: res.data.remark,
+        }
+        this.img1_url = res.data.imgUrl;
+        this.img2_url = res.data.posterImgUrl;
+        this.goodsList = res.data.goods;
+        this.memberList = res.data.promotionGroupUsers;
+      })
+    },
+
+    // 获取分类列表
+    getClassifyList() {
+      getClassifyList({categoryLevel: 1, status: true}).then(res => {
+        res.data.forEach(item => {
+          item.isOpen = false;
+        });
+        this.classifyList = res.data;
+        this.classifyCurrent = '';
+        this.getGoodsList();
+      })
+    },
+
+    // 展开/收起 分类
+    toggleOpen(index) {
+      this.classifyList[index].isOpen = !this.classifyList[index].isOpen;
+    },
+
+    // 切换分类
+    changeClassify(cid) {
+      if(this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分类');
+      }
+      this.classifyCurrent = cid;
+      this.table_currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 搜索
+    getGoodsListByScreen() {
+      if(this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可搜索');
+      }
+      this.table_currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 获取商品列表
+    getGoodsList() {
+      getGoodsList({
+        pageNum: this.table_currentPage,
+        pageSize: this.table_pageSize,
+        keyword: this.keyword,
+        categoryId: this.classifyCurrent,
+      }).then(res => {
+        let oldGoodsList = this.goodsList;
+        let newGoodsList = res.data.records;
+        for(let i = 0; i < oldGoodsList.length; i++) {
+          let oldItem = oldGoodsList[i]
+          for(let j = 0; j < newGoodsList.length; j++) {
+            let newItem = newGoodsList[j]
+            if(newItem.goodsId === oldItem.goodsId){
+              newGoodsList[j].selected = true;
+              break;
+            }
+          }
+        }
+        for(let j = 0; j < newGoodsList.length; j++) {
+          let newItem = newGoodsList[j]
+          if(newItem.promotionGroup === true){
+            newGoodsList[j].selected = true;
+          }
+        }
+        this.table_dataList = newGoodsList;
+        this.table_listTotal = res.data.total;
+        this.table_listLoading = false;
+      })
+    },
+
+    // 查询重复值并禁选
+    checkboxSelect (row, rowIndex) {
+      if (row.selected) {
+        return false // 禁用
+      }else{
+        return true // 不禁用
+      }
+    },
+
+    // 更改列表当前页
+    handleTableCurrentChange(val) {
+      if(this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分页');
+      }
+      this.table_currentPage = val;
+      this.getGoodsList();
+    },
+
+    // table点击选择商品
+    handleChooseGoods(val) {
+      this.table_chooseGoods = val;
+    },
+
+    addGoods() {
+      this.addGoodsVisible = true;
+      this.getClassifyList();
+    },
+
+    // 取消 选择商品
+    cancelAddGoods(){
+      this.addGoodsVisible = false;
+    },
+
+    // 提交 选择商品
+    submitAddGoods() {
+      let oldGoodsList = this.goodsList;
+      let newGoodsList = [];
+
+      this.table_chooseGoods.forEach(item => {
+        let obj = {
+          goodsId: item.goodsId,
+          goodsImgSrc: item.imgUrl,
+          goodsName: item.goodsName,
+          specs: []
+        }
+        item.goodsSpecs.forEach(it => {
+          let c_obj = {
+            goodsId: item.goodsId,
+            goodsSpecId: it.goodsSpecId,
+            goodsSpecName: it.name,
+            goodsSpecValue: it.specValue,
+            orgGoodsPrice: it.price,
+            comGroupPrice: '',
+            comShareAmount: '',
+            stock: it.stockNum,
+            salesNum: it.soldNum
+          }
+          obj.specs.push(c_obj);
+        })
+        newGoodsList.push(obj);
+      })
+      this.goodsList = oldGoodsList.concat(newGoodsList);
+      this.addGoodsVisible = false;
+      console.log(this.goodsList);
+    },
+
+    // 删除商品
+    deleteGoods(index) {
+      this.goodsList.splice(index, 1);
+    },
+
+    // 获取会员列表
+    getMemberList() {
+      getMemberList({
+        pageNum: this.memberTable_currentPage,
+        pageSize: this.memberTable_pageSize,
+        keyword: this.member_screenForm.keyword,
+        promotionGroupLeader: true,
+      }).then(res => {
+        let oldMemberList = this.memberList;
+        let newMemberList = res.data.records;
+        for(let i = 0; i < oldMemberList.length; i++) {
+          let oldItem = oldMemberList[i]
+          for(let j = 0; j < newMemberList.length; j++) {
+            let newItem = newMemberList[j]
+            if(newItem.userId === oldItem.userId){
+              newMemberList[j].selected = true;
+              break;
+            }
+          }
+        }
+        this.memberTable_dataList = newMemberList;
+        this.memberTable_listTotal = res.data.total;
+        this.memberTable_listLoading = false;
+      })
+    },
+
+    // 选择会员 - 搜索
+    getMemberListByScreen() {
+      if(this.memberTable_choose.length > 0) {
+        return this.$errorMsg('当前已选择会员,不可搜索');
+      }
+      this.memberTable_currentPage = 1;
+      this.getMemberList();
+    },
+
+    // 更改列表当前页
+    memberTableCurrentChange(val) {
+      if(this.memberTable_choose.length > 0) {
+        return this.$errorMsg('当前已选择会员,不可切换分页');
+      }
+      this.memberTable_currentPage = val;
+      this.getMemberList();
+    },
+
+    // table点击选择会员
+    handleChooseMember(val) {
+      this.memberTable_choose = val;
+    },
+
+    // 添加会员
+    addMember() {
+      this.addMemberVisible = true;
+
+      if(this.memberList.length > 0) {
+        this.member_screenForm.type = this.memberList[0].type;
+      }
+      
+      this.getMemberList();
+    },
+
+    // 删除会员
+    deleteMember(index) {
+      this.memberList.splice(index, 1);
+    },
+
+    // 取消 选择会员
+    cancelAddMember(){
+      this.addMemberVisible = false;
+    },
+
+    // 提交 选择会员
+    submitAddMember() {
+      // if(this.memberTable_choose.length > 1) {
+      //   return this.$errorMsg('每次只能选择一个会员');
+      // }
+      let oldMemberList = this.memberList;
+      let newMemberList = this.memberTable_choose;
+      this.memberList = oldMemberList.concat(newMemberList);
+      this.addMemberVisible = false;
+    },
+
+    // 提交表单
+    submitMainForm() {
+      if(!this.img1_url) {
+        return this.$errorMsg('请上传活动图');
+      }
+      if(this.memberList.length < 1) {
+        return this.$warningNotify('至少选择一个团长');
+      }
+      if(this.goodsList.length < 1) {
+        return this.$warningNotify('至少选择一个商品');
+      }
+
+      for(let i=0; i<this.goodsList.length; i++) {
+        for(let j=0; j<this.goodsList[i].specs.length; j++) {
+          if(this.goodsList[i].specs[j].orgGoodsPrice === '') {
+            this.formLoading = false;
+            this.$errorMsg('划线价格不能为空');
+            return;
+          }
+          if(this.goodsList[i].specs[j].comGroupPrice === '') {
+            this.formLoading = false;
+            this.$errorMsg('统一团购价不能为空');
+            return;
+          }
+          if(this.goodsList[i].specs[j].comShareAmount === '') {
+            this.formLoading = false;
+            this.$errorMsg('统一分佣金额不能为空');
+            return;
+          }
+          if(this.goodsList[i].specs[j].stock === '') {
+            this.formLoading = false;
+            this.$errorMsg('库存不能为空');
+            return;
+          }
+          if(this.goodsList[i].specs[j].salesNum === '') {
+            this.formLoading = false;
+            this.$errorMsg('销量不能为空');
+            return;
+          }
+        }
+      }
+
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          this.formLoading = true;
+
+          let params = {
+            name: this.mainForm.name,
+            startTime: this.mainForm.date[0] + ' 00:00:00',
+            endTime: this.mainForm.date[1] + ' 23:59:59',
+            remark: this.mainForm.remark,
+            imgUrl: this.img1_url,
+            posterImgUrl: this.img2_url,
+            status: this.mainForm.status,
+            goods: this.goodsList,
+            promotionGroupUsers: this.memberList,
+          }
+          params = this.$deleteEmptyObj(params);
+
+          if(this.isEdit) {
+            params.promotionGroupId = this.editId;
+            editActivity(params).then(res => {
+              this.formLoading = false;
+              this.$successMsg('编辑成功');
+              setTimeout(()=>{
+                this.goBack();
+              }, 1000)
+            }).catch(err => {
+              this.formLoading = false;
+            })
+          } else {
+            addActivity(params).then(res => {
+              this.formLoading = false;
+              this.$successMsg('添加成功');
+              if(!this.saveDontBack) {
+                setTimeout(()=>{
+                  this.goBack();
+                }, 1000)
+              }else {
+                this.$router.go(-1);
+                setTimeout(() => {
+                  this.$router.push({
+                    name:"groupbuy_add",
+                    query: {
+                      id: res.data
+                    }
+                  })
+                  this.editId = res.data;
+                  this.getDetail(res.data);
+                }, 100)
+              }
+            }).catch(err => {
+              this.saveDontBack = false;
+              this.formLoading = false;
+            })
+          }
+        }else {
+          this.$warningNotify('请先完善信息');
+          return false;
+        }
+      })
+    },
+
+    // 去设置团长
+    toSetHead(id) {
+      if(!this.editId) {
+        this.saveDontBack = true;
+        return this.$errorMsg('请先保存该活动');
+      }
+      this.$router.push({
+        name:"groupbuy_set",
+        query: {
+          id
+        }
+      })
+    },
+
+    uploadImage(type) {
+      this.uploadImageType = type;
+      document.querySelector('.avatar-uploader input').click();
+    },
+
+    // 上传图片
+    uploadSuccess(res, file) {
+      this[this.uploadImageType + '_url'] = res.data.url;
+    },
+
+    beforeUpload(file) {
+      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
+      const whiteList = ['jpg', 'jpeg', 'png'];
+      if (whiteList.indexOf(fileSuffix) === -1) {
+        this.$errorMsg('只支持上传jpg/jpeg/png文件!');
+        return false;
+      }
+    },
+
+    // 预览图片
+    previewImage(type) {
+      this.$refs[type].showViewer = true;
+    },
+
+    // 删除图片
+    deleteImage(type) {
+      this[this.uploadImageType + '_url'] = '';
+    },
+  },
+
+}
+</script>
+
+<style scoped lang="scss">
+  .diy-table {
+    overflow-x: scroll;
+    border-left: 1px solid #f5f5f5;
+    margin-top: 20px;
+    width: 100%;
+    // min-width: 1185px;
+    max-width: 100%;
+    .table-head {
+      display: flex;
+      .item {
+        height: 40px;
+        line-height: 40px;
+        float: left;
+        font-weight: 500;
+        font-size: 14px;
+        background: #f5f5f5;
+        text-align: center;
+      }
+      .right {
+        float: left;
+        width: 74%;
+        min-width: 1000px;
+        flex-shrink: 0;
+        height: 40px;
+      }
+      .goods {
+        width: 15%;
+        min-width: 170px;
+      }
+      .sort {
+        width: 5%;
+        min-width: 80px;
+      }
+      .name {
+        width: 15%;
+        min-width: 150px;
+      }
+      .input {
+        width: 15%;
+        min-width: 150px;
+      }
+      .opera {
+        width: 10%;
+        min-width: 80px;
+        text-align: right;
+      }
+      .blank {
+        background: #f5f5f5;
+        width: 6%;
+        min-width: 90px;
+      }
+    }
+    .goods-item {
+      display: flex;
+      align-content: center;
+      .goods-info {
+        flex-shrink: 0;
+        width: 15%;
+        min-width: 170px;
+        padding: 0 10px;
+        display: flex;
+        align-items: center;
+        border-bottom: 1px solid #f5f5f5;
+        border-right: 1px solid #f5f5f5;
+        font-size: 14px;
+        &:last-child {
+          border-bottom: none;
+        }
+        img {
+          width: 40px;
+          height: 40px;
+          margin-right: 10px;
+          flex-shrink: 0;
+        }
+      }
+      .sort {
+        width: 5%;
+        min-width: 80px;
+        border-bottom: 1px solid #f5f5f5;
+        border-right: 1px solid #f5f5f5;
+        display: flex;
+        align-items: center;
+        padding: 10px;
+      }
+      .spec-list {
+        width: 74%;
+        min-width: 1000px;
+        border-bottom: 1px solid #f5f5f5;
+        border-right: 1px solid #f5f5f5;
+        &:last-child {
+          border-bottom: none;
+        }
+        .spec-item {
+          display: flex;
+          align-items: center;
+          border-bottom: 1px solid #f5f5f5;
+          &:last-child {
+            border-bottom: none;
+          }
+          .col {
+            flex-shrink: 0;
+            height: 50px;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            padding: 0 10px;
+            border-right: 1px solid #f5f5f5;
+            &:last-child {
+              border-right: none;
+            }
+          }
+          .name {
+            width: 15%;
+            min-width: 150px;
+            font-size: 14px;
+            text-align: center;
+          }
+          .input {
+            width: 15%;
+            min-width: 150px;
+          }
+          .btn {
+            width: 10%;
+            min-width: 80px;
+          }
+        }
+      }
+      .operation {
+        flex-shrink: 0;
+        width: 6%;
+        min-width: 90px;
+        padding: 0 10px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        border-bottom: 1px solid #f5f5f5;
+        border-right: 1px solid #f5f5f5;
+      }
+    }
+    .empty-text {
+      line-height: 60px;
+      text-align: center;
+      color: #909399;
+    }
+  }
+
+  .dialog-container {
+    .left {
+      width: 140px;
+      height: 350px;
+      overflow-y: scroll;
+      .group {
+        margin-top: 10px;
+      }
+      .child {
+        margin-top: 5px;
+        .item {
+          padding-left: 18px;
+        }
+      }
+      .item {
+        cursor: pointer;
+        line-height: 24px;
+      }
+    }
+    .right {
+      width: calc(100% - 140px);
+      height: 350px;
+      box-sizing: border-box;
+      padding-left: 20px;
+    }
+  }
+
+  .images {
+    display: flex;
+    flex-wrap: wrap;
+    .main-img {
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+      align-items: center;
+      width: 120px;
+      margin-right: 20px;
+      .img {
+        border: 1px dashed #eaeaea;
+        border-radius: 5px;
+        overflow: hidden;
+        position: relative;
+        .el-image {
+          display: block;
+        }
+        .mask {
+          position: absolute;
+          left: 0;
+          top: 0;
+          width: 120px;
+          height: 120px;
+          background: rgba($color: #000000, $alpha: 0.3);
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          i {
+            font-size: 20px;
+            color: #ffffff;
+            cursor: pointer;
+            margin: 0 8px;
+          }
+        }
+      }
+      .text {
+        font-size: 14px;
+        color: #666666;
+      }
+    }
+    .add {
+      width: 120px;
+      height: 120px;
+      border: 1px dashed #eaeaea;
+      border-radius: 5px;
+      cursor: pointer;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      i {
+        font-size: 30px;
+        color: #999;
+      }
+    }
+    .tmp-img {
+      position: relative;
+      .tmp {
+        position: absolute;
+        left: 0;
+        top: 0;
+        line-height: 20px;
+        padding: 0 8px;
+        background: #f66460;
+        border-radius: 0 0 10px 0;
+        font-size: 12px;
+        color: #ffffff;
+      }
+    }
+  }
+</style>

+ 482 - 0
src/views/mallManagement/activity/groupbuy_detail/index.vue

@@ -0,0 +1,482 @@
+<template>
+  <div class="app-container">
+    <el-page-header @back="goBack" content="拼团详情" style="margin-bottom: 30px"></el-page-header>
+
+    <!-- 筛选条件 -->
+    <div class="screen-container">
+      <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="手机号码" prop="phone">
+              <el-input v-model="screenForm.phone" placeholder="请输入手机号码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="">
+              <el-button size="small" @click="resetScreenForm">清空</el-button>
+              <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+
+    <div class="table">
+      <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="团长名称" prop="nickName" min-width="120"></el-table-column>
+        <el-table-column align="center" label="所属网点" prop="websitName" min-width="120"></el-table-column>
+        <el-table-column align="center" label="职务" prop="position" min-width="100"></el-table-column>
+        <el-table-column align="center" label="手机号码" prop="phone" min-width="160"></el-table-column>
+        <el-table-column align="center" label="首次分享时间" prop="firstTime" min-width="160"></el-table-column>
+        <el-table-column align="center" label="分享次数">
+          <template slot-scope="scope">
+            <el-button type="text" @click="openShareDetail(scope.row.userId)">{{scope.row.shareNum}}</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="订单数量" prop="orderNum" min-width="100">
+          <template slot-scope="scope">
+            {{scope.row.orderNum || 0}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="订单台数" prop="goodsNum" min-width="100">
+          <template slot-scope="scope">
+            {{scope.row.goodsNum || 0}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="成交金额" prop="orderTotalAmount" min-width="100">
+          <template slot-scope="scope">
+            {{scope.row.orderTotalAmount || 0}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="团长分佣" prop="shareTotalAmount" min-width="100">
+          <template slot-scope="scope">
+            {{scope.row.shareTotalAmount || 0}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="已分佣金额" prop="settledAmount" min-width="100">
+          <template slot-scope="scope">
+            {{scope.row.settledAmount || 0}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="订单管理" min-width="120">
+          <template slot-scope="scope">
+            <el-button type="text" @click="openOrderDetail(scope.row.userId)">详情</el-button>
+            <el-button type="text" @click="handleExport(scope.row.userId)">导出订单</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div class="pagination clearfix">
+      <div class="fr">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="listTotal">
+        </el-pagination>
+      </div>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button @click="goBack">返 回</el-button>
+      </div>
+    </div>
+
+    <!-- 分享详情 -->
+    <el-dialog title="分享详情" :visible.sync="shareDialog" :show-close="false" width="70%" :close-on-click-modal="false">
+      <div class="table" style="margin: 10px 0 20px;">
+        <el-table 
+          v-loading="shareTable_listLoading" 
+          :data="shareTable_dataList" 
+          element-loading-text="Loading" 
+          tooltip-effect="dark" 
+          style="width: 100%" 
+          max-height="270">
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" prop="userName" label="用户名称" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="userPhone" label="手机号码" min-width="120"></el-table-column>
+          <el-table-column align="center" prop="createTime" label="访问时间" min-width="160"></el-table-column>
+        </el-table>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @current-change="shareTableCurrentChange"
+            :current-page="shareTable_currentPage"
+            :page-size="shareTable_pageSize"
+            background
+            layout="prev, pager, next"
+            :total="shareTable_listTotal">
+          </el-pagination>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="shareDialog = false">关 闭</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 订单详情 -->
+    <el-dialog title="订单详情" :visible.sync="orderDialog" :show-close="false" width="70%" :close-on-click-modal="false">
+      <div class="table" style="margin: 10px 0 20px;">
+        <el-table 
+          v-loading="orderTable_listLoading" 
+          :data="orderTable_dataList" 
+          element-loading-text="Loading" 
+          tooltip-effect="dark" 
+          style="width: 100%" 
+          max-height="270">
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" prop="orderId" label="订单编号" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="orderTitle" label="商品名称" min-width="200" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="totalAmount" label="订单金额" min-width="100"></el-table-column>
+          <el-table-column align="center" prop="orderStatus" label="订单状态" min-width="100">
+            <template slot-scope="scope">
+              {{scope.row.orderStatus | statusFilter}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="totalShareAmount" label="团长分佣" min-width="100"></el-table-column>
+          <el-table-column align="center" prop="payTime" label="下单时间" min-width="160"></el-table-column>
+          <el-table-column align="center" label="操作" min-width="80">
+            <template slot-scope="scope">
+              <el-button type="text" @click="toOrderDetail(scope.row.orderId)">详情</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @current-change="orderTableCurrentChange"
+            :current-page="orderTable_currentPage"
+            :page-size="orderTable_pageSize"
+            background
+            layout="prev, pager, next"
+            :total="orderTable_listTotal">
+          </el-pagination>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="orderDialog = false">关 闭</el-button>
+      </div>
+    </el-dialog>
+
+
+  </div>
+</template>
+
+<script>
+import { getDetailList, getShareList, getOrderList } from '@/api/groupbuy'
+import { downloadFiles } from '@/utils/util'
+
+export default {
+  filters: {
+    statusFilter(val) {
+      const MAP = {
+        NOPAY: '待付款',
+        DFH: '待发货',
+        YFH: '已发货',
+        OVER: '已完成',
+        CLOSE: '已关闭',
+        REFUND: '售后',
+      }
+      return MAP[val];
+    }
+  },
+
+  data() {
+    return {
+      id: '',
+      detailUserId: '',
+      screenForm: { // 筛选表单数据
+        phone: '',
+      },
+      dataList: null, // 列表数据
+      listLoading: true, // 列表加载loading
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+
+      shareDialog: false, // 分享详情 - 弹窗
+      shareTable_dataList: null, // 分享详情 - 列表数据
+      shareTable_listLoading: true, // 分享详情 - 列表加载loading
+      shareTable_currentPage: 1, // 分享详情 - 当前页码
+      shareTable_pageSize: 10, // 分享详情 - 每页数量
+      shareTable_listTotal: 0, // 分享详情 - 列表总数
+
+      orderDialog: false, // 订单详情 - 弹窗
+      orderTable_dataList: null, // 订单详情 - 列表数据
+      orderTable_listLoading: true, // 订单详情 - 列表加载loading
+      orderTable_currentPage: 1, // 订单详情 - 当前页码
+      orderTable_pageSize: 10, // 订单详情 - 每页数量
+      orderTable_listTotal: 0, // 订单详情 - 列表总数
+
+    }
+  },
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+  created() {
+    const { id } = this.$route.query;
+    this.id = id;
+
+    this.getList();
+  },
+  methods: {
+    goBack() {
+      this.$router.go(-1)
+    },
+
+    // 获取详情
+    getList() {
+      getDetailList({
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        promotionGroupId: this.id,
+        mobile: this.screenForm.phone
+      }).then(res => {
+        this.dataList = res.data.records;
+        this.listTotal = res.data.total;
+        this.listLoading = false;
+      })
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getList();
+    },
+
+    // 分享详情 - 获取列表
+    getShareList() {
+      getShareList({
+        pageNum: this.shareTable_currentPage,
+        pageSize: this.shareTable_pageSize,
+        userId: this.detailUserId,
+        promotionGroupId: this.id
+      }).then(res => {
+        this.shareTable_dataList = res.data.records;
+        this.shareTable_listTotal = res.data.total;
+        this.shareTable_listLoading = false;
+      })
+    },
+
+    // 分享详情 - 打开弹窗
+    openShareDetail(id) {
+      this.detailUserId = id;
+      this.shareDialog = true;
+      this.shareTable_currentPage = 1;
+      this.getShareList();
+    },
+
+    // 分享详情 - 更改列表当前页
+    shareTableCurrentChange(val) {
+      this.shareTable_currentPage = val;
+      this.getShareList();
+    },
+
+    // 订单详情 - 获取列表
+    getOrderList() {
+      getOrderList({
+        pageNum: this.orderTable_currentPage,
+        pageSize: this.orderTable_pageSize,
+        userId: this.detailUserId,
+        promotionGroupId: this.id
+      }).then(res => {
+        this.orderTable_dataList = res.data.records;
+        this.orderTable_listTotal = res.data.total;
+        this.orderTable_listLoading = false;
+      })
+    },
+
+    // 订单详情 - 打开弹窗
+    openOrderDetail(id) {
+      this.detailUserId = id;
+      this.orderDialog = true;
+      this.orderTable_currentPage = 1;
+      this.getOrderList();
+    },
+
+    // 订单详情 - 更改列表当前页
+    orderTableCurrentChange(val) {
+      this.orderTable_currentPage = val;
+      this.getOrderList();
+    },
+
+    // 订单详情
+    toOrderDetail(orderId) {
+      let {href} = this.$router.resolve({path: `/order/detail?orderId=${orderId}`});
+      window.open(href, '_blank');
+    },
+
+    // 导出
+    handleExport(id) {
+      let screenData = {
+        promotionGroupUserId: id,
+        promotionGroupId: this.id
+      };
+      downloadFiles('order/export', screenData);
+    },
+
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .diy-table {
+    overflow-x: scroll;
+    border: 1px solid #f5f5f5;
+    margin-top: 20px;
+    .table-head {
+      display: flex;
+      .item {
+        flex-shrink: 0;
+        height: 40px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        font-weight: 500;
+        font-size: 14px;
+        background: #f5f5f5;
+      }
+      .goods {
+        width: 200px;
+      }
+      .name {
+        width: 120px;
+      }
+      .input {
+        width: 160px;
+      }
+      .opera {
+        width: 180px;
+      }
+    }
+    .goods-item {
+      display: flex;
+      align-content: center;
+      .goods-info {
+        flex-shrink: 0;
+        width: 200px;
+        padding: 0 10px;
+        display: flex;
+        align-items: center;
+        border-bottom: 1px solid #f5f5f5;
+        border-right: 1px solid #f5f5f5;
+        &:last-child {
+          border-bottom: none;
+        }
+      }
+      .spec-list {
+        border-bottom: 1px solid #f5f5f5;
+        border-right: 1px solid #f5f5f5;
+        &:last-child {
+          border-bottom: none;
+        }
+        .spec-item {
+          display: flex;
+          align-items: center;
+          border-bottom: 1px solid #f5f5f5;
+          &:last-child {
+            border-bottom: none;
+          }
+          .col {
+            flex-shrink: 0;
+            height: 50px;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            padding: 0 10px;
+            border-right: 1px solid #f5f5f5;
+            &:last-child {
+              border-right: none;
+            }
+          }
+          .name {
+            width: 120px;
+            font-size: 14px;
+          }
+          .input {
+            width: 160px;
+          }
+          .btn {
+            width: 100px;
+          }
+        }
+      }
+      .operation {
+        flex-shrink: 0;
+        width: 80px;
+        padding: 0 10px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        border-bottom: 1px solid #f5f5f5;
+      }
+    }
+  }
+
+  .dialog-container {
+    .left {
+      width: 140px;
+      height: 350px;
+      overflow-y: scroll;
+      .group {
+        margin-top: 10px;
+      }
+      .child {
+        margin-top: 5px;
+        .item {
+          padding-left: 18px;
+        }
+      }
+      .item {
+        cursor: pointer;
+        line-height: 24px;
+      }
+    }
+    .right {
+      width: calc(100% - 140px);
+      height: 350px;
+      box-sizing: border-box;
+      padding-left: 20px;
+    }
+  }
+</style>

+ 3 - 3
src/views/mallManagement/activity/groupbuy_index/index.vue

@@ -177,12 +177,12 @@ export default {
     addOrEdit(type, id) {
       if(type == 'add') {
         this.$router.push({
-          path: '/activity/groupbuy_add',
+          name:"groupbuy_add",
           query: {}
         })
       }else {
         this.$router.push({
-          path: '/activity/groupbuy_add',
+          name:"groupbuy_add",
           query: {
             id
           }
@@ -202,7 +202,7 @@ export default {
     // 去详情
     toDetail(id) {
       this.$router.push({
-        path: '/activity/groupbuy_detail',
+        name:"groupbuy_detail",
         query: {
           id
         }

+ 199 - 0
src/views/mallManagement/activity/groupbuy_set/index.vue

@@ -0,0 +1,199 @@
+<template>
+  <div class="app-container">
+    <h3 style="margin-bottom: 30px">团长设置</h3>
+
+    <div class="screen-container">
+      <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="团长名称" prop="name">
+              <el-input v-model="screenForm.name" placeholder="请输入团长名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="手机号码" prop="phone">
+              <el-input v-model="screenForm.phone" placeholder="请输入手机号码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="团长价格" prop="price">
+              <el-input v-model="screenForm.price" placeholder="请输入团长价格"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="团长分佣" prop="amount">
+              <el-input v-model="screenForm.amount" placeholder="请输入团长分佣"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="24" class="tr">
+            <el-form-item label="">
+              <el-button size="small" @click="resetScreenForm">清空</el-button>
+              <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+
+    <div class="mymain-container">
+      <div class="table">
+        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="团长名称" prop="userName" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="手机号码" prop="userPhone" min-width="120"></el-table-column>
+          <el-table-column align="center" label="划线价格" prop="orgGoodsPrice" min-width="140">
+            <template slot-scope="scope">
+              <el-input type="number" v-model="scope.row.orgGoodsPrice" disabled></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="统一拼团价" prop="comGroupPrice" min-width="140">
+            <template slot-scope="scope">
+              <el-input type="number" v-model="scope.row.comGroupPrice" disabled></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="统一团长分佣" prop="comShareAmount" min-width="140">
+            <template slot-scope="scope">
+              <el-input type="number" v-model="scope.row.comShareAmount" disabled></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="团长价格" prop="groupPrice" min-width="140">
+            <template slot-scope="scope">
+              <el-input type="number" v-model="scope.row.groupPrice"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="团长分佣" prop="shareAmount" min-width="140">
+            <template slot-scope="scope">
+              <el-input type="number" v-model="scope.row.shareAmount"></el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
+        <el-button @click="goBack">关 闭</el-button>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import { getHeadList, editHead } from '@/api/groupbuy'
+
+export default {
+  data() {
+    return {
+      id: '',
+      dataList: null, // 列表数据
+      listLoading: true, // 列表加载loading
+      screenForm: { // 筛选表单数据
+        name: '',
+        phone: '',
+        price: '',
+        amount: '',
+      },
+      formLoading: false,
+      
+    }
+  },
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+  created() {
+    const { id } = this.$route.query;
+    this.id = id;
+
+    this.getList();
+  },
+  methods: {
+    goBack() {
+      this.$router.go(-1)
+    },
+
+    // 获取列表
+    getList() {
+      this.listLoading = true;
+
+      let params = {
+        promotionGroupSpecId: this.id,
+        name: this.screenForm.name,
+        phone: this.screenForm.phone,
+        groupPrice: this.screenForm.price,
+        shareAmount: this.screenForm.amount,
+      }
+
+      getHeadList(params).then(res => {
+        this.dataList = res.data;
+        this.listLoading = false;
+      })
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.getList()
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields()
+      this.getList()
+    },
+
+    // 提交
+    submitMainForm() {
+      this.formLoading = true;
+
+      editHead(this.dataList).then(res => {
+        this.formLoading = false;
+        this.$successMsg('编辑成功');
+        setTimeout(()=>{
+          this.goBack();
+        }, 1000)
+      }).catch(err => {
+        this.formLoading = false;
+      })
+    },
+  },
+
+}
+</script>
+
+<style scoped lang="scss">
+  .dialog-container {
+    .left {
+      width: 140px;
+      height: 350px;
+      overflow-y: scroll;
+      .group {
+        margin-top: 10px;
+      }
+      .child {
+        margin-top: 5px;
+        .item {
+          padding-left: 18px;
+        }
+      }
+      .item {
+        cursor: pointer;
+        line-height: 24px;
+      }
+    }
+    .right {
+      width: calc(100% - 140px);
+      height: 350px;
+      box-sizing: border-box;
+      padding-left: 20px;
+    }
+  }
+</style>

+ 500 - 0
src/views/mallManagement/activity/seckill_add/index.vue

@@ -0,0 +1,500 @@
+<template>
+  <div class="app-container">
+    <div class="form-contaner">
+      <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="100px">
+        <el-form-item label="活动名称:" prop="activityName">
+          <el-input v-model="mainForm.activityName" placeholder="请填写活动名称" style="width: 400px;"></el-input>
+        </el-form-item>
+        <el-form-item label="活动时间:" prop="activityDate">
+          <el-date-picker
+            v-model="mainForm.activityDate"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            style="width: 400px;"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="活动场次:" prop="stageList">
+          <el-select v-model="mainForm.stageList" multiple placeholder="请选择" style="width: 400px;">
+            <el-option
+              v-for="item in stageArr"
+              :key="item.name"
+              :label="item.name + '点'"
+              :value="item.name">
+              <span style="float: left">{{ item.name }}点</span>
+              <span style="float: left; color: #8492a6; font-size: 13px; margin-left: 20px">{{ item.startHour }}:00:00-{{ item.endHour }}:00:00</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备注:" prop="remark">
+          <el-input type="textarea" v-model="mainForm.remark" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请填写备注" style="width: 400px;"></el-input>
+        </el-form-item>
+      </el-form>
+    </div>
+
+    <div class="mymain-container">
+      <div class="btn-group">
+        <el-button size="small" type="primary" @click="addGoods">选择商品</el-button>
+      </div>
+
+      <div class="table">
+        <el-table :data="goodsList" border fit stripe>
+          <el-table-column align="center" label="商品名称" prop="goodsName" min-width="200"></el-table-column>
+          <el-table-column align="center" label="划线价格" prop="goodsPrice" min-width="140">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.goodsPrice"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="库存" prop="stockNum"></el-table-column>
+          <el-table-column align="center" label="分佣金额" prop="amount" min-width="140">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.amount" :disabled="scope.row.sharePercent != 0 && scope.row.sharePercent != null"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="分佣比例(%)" prop="sharePercent" min-width="140">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.sharePercent"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="限购(0为不限购)" prop="limitBuy" min-width="140">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.limitBuy"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="秒杀价" prop="price" min-width="140">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.price"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="秒杀库存" prop="secStockNum" min-width="140">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.secStockNum"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="销量" prop="salesVolume" min-width="140">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.salesVolume"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="排序" prop="sortNum" min-width="140">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.sortNum"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="操作" width="100">
+            <template slot-scope="scope">
+              <el-button type="text" @click="deleteGoods(scope.$index)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
+        <el-button @click="goBack">关 闭</el-button>
+      </div>
+    </div>
+
+
+    <!-- 选择商品 -->
+    <el-dialog title="选择商品" :visible.sync="addGoodsVisible" :show-close="false" width="50%" :close-on-click-modal="false">
+      <div class="dialog-container clearfix">
+        <div class="left fl">
+          <div class="item" @click="changeClassify('')">全部分类</div>
+          <div class="group" v-for="(item, index) in classifyList" :key="index">
+            <div class="item" @click="toggleOpen(index)">
+              <i :class="item.isOpen ? 'el-icon-caret-bottom':'el-icon-caret-right'"></i> {{item.name}}
+            </div>
+            <div class="child" v-if="item.isOpen">
+              <div class="item" v-for="(childItem, childIndex) in item.children" :key="childIndex" @click="changeClassify(childItem.categoryId)">{{childItem.name}}</div>
+            </div>
+          </div>
+        </div>
+
+        <div class="right fl">
+          <div class="search">
+            <el-input placeholder="请输入商品名称进行搜索" v-model="keyword" class="input-with-select" clearable size="small" style="width: 250px">
+              <el-button slot="append" icon="el-icon-search" size="small" @click="getGoodsListByScreen"></el-button>
+            </el-input>
+          </div>
+          <div class="table" style="margin: 10px 0 20px;">
+            <el-table 
+              v-loading="table_listLoading" 
+              :data="table_dataList" 
+              element-loading-text="Loading" 
+              tooltip-effect="dark" 
+              style="width: 100%" 
+              max-height="270"
+              @selection-change="handleChooseGoods">
+              <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
+              <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200" show-overflow-tooltip></el-table-column>
+              <el-table-column align="center" prop="goodsPrice" label="价格" width="80"></el-table-column>
+              <el-table-column align="center" prop="stockNum" label="库存" width="80"></el-table-column>
+            </el-table>
+          </div>
+          <div class="pagination clearfix">
+            <div class="fr">
+              <el-pagination
+                @current-change="handleTableCurrentChange"
+                :current-page="table_currentPage"
+                :page-size="table_pageSize"
+                background
+                layout="prev, pager, next"
+                :total="table_listTotal">
+              </el-pagination>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitAddGoods">保 存</el-button>
+        <el-button @click="cancelAddGoods">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { editActivity, addActivity, getClassifyList, getGoodsList, getActivityDetail } from '@/api/seckill'
+
+export default {
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      formLoading: false,
+      mainForm: {
+        activityName: '',
+        activityDate: '',
+        stageList: [],
+        remark: '',
+      },
+      mainFormRules: {
+        activityName: [
+          { required: true, message: '请填写活动名称', trigger: 'blur' }
+        ],
+        activityDate: [
+          { required: true, message: '请选择活动时间', trigger: 'change' }
+        ],
+        stageList: [
+          { required: true, message: '请选择活动场次', trigger: 'change' }
+        ],
+      },
+      goodsList: [], // 列表数据
+      addGoodsVisible: false,
+
+      classifyList: [],
+      classifyCurrent: '',
+      keyword: '',
+      table_dataList: null, // 列表数据
+      table_listLoading: true, // 列表加载loading
+      table_currentPage: 1, // 当前页码
+      table_pageSize: 10, // 每页数量
+      table_listTotal: 0, // 列表总数
+      table_chooseGoods: [], // table中 当前选择商品
+
+      stageArr: [
+        {name: 10, startHour: 10, endHour: 12},
+        {name: 12, startHour: 12, endHour: 15},
+        {name: 15, startHour: 15, endHour: 18},
+        {name: 18, startHour: 18, endHour: 20},
+        {name: 20, startHour: 20, endHour: 10},
+      ]
+    }
+  },
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+  created() {
+    const { id } = this.$route.query;
+    this.isEdit = id ? true : false;
+    this.editId = id;
+
+    if(this.isEdit) {
+      this.getActivityDetail(id);
+    }
+  },
+  methods: {
+    goBack() {
+      this.$router.go(-1)
+    },
+
+    // 获取详情
+    getActivityDetail(secKillId) {
+      getActivityDetail({secKillId}).then(res => {
+        let stageList = [];
+        res.data.stages.forEach(item => {
+          stageList.push(Number(item.name));
+        })
+        this.mainForm = {
+          activityName: res.data.secKillName,
+          activityDate: [res.data.startTime.slice(0, 10), this.reduceDate(res.data.endTime.slice(0, 10))],
+          remark: res.data.remark,
+          stageList: stageList
+        }
+        this.goodsList = res.data.goodsSpecs;
+      })
+    },
+
+    // 获取分类列表
+    getClassifyList() {
+      getClassifyList({categoryLevel: 1, status: true}).then(res => {
+        res.data.forEach(item => {
+          item.isOpen = false;
+        });
+        this.classifyList = res.data;
+        this.classifyCurrent = '';
+        this.getGoodsList();
+      })
+    },
+
+    // 展开/收起 分类
+    toggleOpen(index) {
+      this.classifyList[index].isOpen = !this.classifyList[index].isOpen;
+    },
+
+    // 切换分类
+    changeClassify(cid) {
+      if(this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分类');
+      }
+      this.classifyCurrent = cid;
+      this.table_currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 搜索
+    getGoodsListByScreen() {
+      if(this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可搜索');
+      }
+      this.table_currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 获取商品列表
+    getGoodsList() {
+      getGoodsList({
+        pageNum: this.table_currentPage,
+        pageSize: this.table_pageSize,
+        keyword: this.keyword,
+        categoryId: this.classifyCurrent,
+      }).then(res => {
+        let oldGoodsList = this.goodsList;
+        let newGoodsList = res.data.records;
+        for(let i = 0; i < oldGoodsList.length; i++) {
+          let oldItem = oldGoodsList[i]
+          for(let j = 0; j < newGoodsList.length; j++) {
+            let newItem = newGoodsList[j]
+            if(newItem.goodsId === oldItem.goodsId){
+              newGoodsList[j].selected = true;
+              break;
+            }
+          }
+        }
+        this.table_dataList = newGoodsList;
+        this.table_listTotal = res.data.total;
+        this.table_listLoading = false;
+      })
+    },
+
+    // 查询重复值并禁选
+    checkboxSelect (row, rowIndex) {
+      if (row.selected) {
+        return false // 禁用
+      }else{
+        return true // 不禁用
+      }
+    },
+
+    // 更改列表当前页
+    handleTableCurrentChange(val) {
+      if(this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分页');
+      }
+      this.table_currentPage = val;
+      this.getGoodsList();
+    },
+
+    // table点击选择商品
+    handleChooseGoods(val) {
+      this.table_chooseGoods = val;
+    },
+
+    addGoods() {
+      this.addGoodsVisible = true;
+      this.getClassifyList();
+    },
+
+    // 取消 选择商品
+    cancelAddGoods(){
+      this.addGoodsVisible = false;
+    },
+
+    // 提交 选择商品
+    submitAddGoods() {
+      let oldGoodsList = this.goodsList;
+      let newGoodsList = this.table_chooseGoods;
+      this.goodsList = oldGoodsList.concat(newGoodsList);
+      this.addGoodsVisible = false;
+    },
+
+    // 删除商品
+    deleteGoods(index) {
+      this.goodsList.splice(index, 1);
+    },
+
+    // 给日期减一天
+    reduceDate(date, days) {
+      if (days == undefined || days == '') {
+        days = 1;
+      }
+      var date = new Date(date);
+      date.setDate(date.getDate() - days);
+      var month = date.getMonth() + 1;
+      var day = date.getDate();
+      function checkTime(i){
+        if (i<10) {
+          i = "0"+i;
+        }
+        return i;
+      }
+      return date.getFullYear() + '-' + checkTime(month) + '-' + checkTime(day);
+    },
+
+    // 给日期加一天
+    addDate(date, days) {
+      if (days == undefined || days == '') {
+        days = 1;
+      }
+      var date = new Date(date);
+      date.setDate(date.getDate() + days);
+      var month = date.getMonth() + 1;
+      var day = date.getDate();
+      function checkTime(i){
+        if (i<10) {
+          i = "0"+i;
+        }
+        return i;
+      }
+      return date.getFullYear() + '-' + checkTime(month) + '-' + checkTime(day);
+    },
+
+    // 提交表单
+    submitMainForm() {
+      if(this.mainForm.stageList.length < 1) {
+        return this.$warningNotify('至少选择一个活动场次');
+      }
+      if(this.goodsList.length < 1) {
+        return this.$warningNotify('至少选择一个商品');
+      }
+      let goodsList = this.goodsList;
+      for(let i=0; i<goodsList.length; i++) {
+        if(!Number(goodsList[i].sharePercent) && (goodsList[i].amount / goodsList[i].price > 0.4)) {
+          this.formLoading = false;
+          this.$errorMsg('单个商品的分佣金额不能超过秒杀价的40%');
+          return;
+        }
+        if(Number(goodsList[i].sharePercent) < 0 || Number(goodsList[i].sharePercent) > 40) {
+          this.formLoading = false;
+          this.$errorMsg('单个商品的分佣比例范围在0-40');
+          return;
+        }
+      }
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          this.formLoading = true;
+
+          let stageList = [];
+          this.mainForm.stageList.forEach(item => {
+            let index = this.$findElem(this.stageArr, 'name', item)
+            if(index >= 0) {
+              stageList.push(this.stageArr[index]);
+            }
+          })
+
+          let params = {
+            secKillName: this.mainForm.activityName,
+            startTime: this.mainForm.activityDate[0] + ' 10:00:00',
+            endTime: this.addDate(this.mainForm.activityDate[1]) + ' 09:59:59',
+            remark: this.mainForm.remark,
+            goodsSpecs: this.goodsList,
+            stages: stageList
+          }
+          params = this.$deleteEmptyObj(params);
+
+          if(this.isEdit) {
+            params.secKillId = this.editId;
+            editActivity(params).then(res => {
+              this.formLoading = false;
+              this.$successMsg('编辑成功');
+              setTimeout(()=>{
+                this.goBack();
+              }, 1000)
+            }).catch(err => {
+              this.formLoading = false;
+            })
+          } else {
+            addActivity(params).then(res => {
+              this.formLoading = false;
+              this.$successMsg('添加成功');
+              setTimeout(()=>{
+                this.goBack();
+              }, 1000)
+            }).catch(err => {
+              this.formLoading = false;
+            })
+          }
+        }else {
+          this.$warningNotify('请先完善信息');
+          return false;
+        }
+      })
+    },
+  },
+
+}
+</script>
+
+<style scoped lang="scss">
+  .dialog-container {
+    .left {
+      width: 140px;
+      height: 350px;
+      overflow-y: scroll;
+      .group {
+        margin-top: 10px;
+      }
+      .child {
+        margin-top: 5px;
+        .item {
+          padding-left: 18px;
+        }
+      }
+      .item {
+        cursor: pointer;
+        line-height: 24px;
+      }
+    }
+    .right {
+      width: calc(100% - 140px);
+      height: 350px;
+      box-sizing: border-box;
+      padding-left: 20px;
+    }
+  }
+
+</style>

+ 2 - 2
src/views/mallManagement/activity/seckill_index/index.vue

@@ -281,12 +281,12 @@ export default {
     addOrEdit(type, id) {
       if(type == 'add') {
         this.$router.push({
-          path: '/activity/seckill_add',
+          name:"seckill_add",
           query: {}
         })
       }else {
         this.$router.push({
-          path: '/activity/seckill_add',
+          name:"seckill_add",
           query: {
             id
           }