zhengjinyi 2 лет назад
Родитель
Сommit
8f22b1010f
60 измененных файлов с 5245 добавлено и 735 удалено
  1. 2 2
      .env.development
  2. 5 0
      .prettierrc.json
  3. 85 0
      src/api/campaign.js
  4. 9 0
      src/api/club.js
  5. 2 3
      src/api/goods.js
  6. 9 0
      src/components/index.js
  7. 1 1
      src/layout/components/Navbar.vue
  8. 5 3
      src/layout/components/Sidebar/Item.vue
  9. 4 0
      src/main.js
  10. 8 2
      src/router/index.js
  11. 55 0
      src/router/modules/campaign.js
  12. 28 0
      src/router/modules/centralized.js
  13. 11 4
      src/router/modules/club.js
  14. 2 2
      src/router/modules/finance.js
  15. 28 0
      src/router/modules/floor.js
  16. 9 8
      src/router/modules/goods.js
  17. 4 4
      src/router/modules/order.js
  18. 5 5
      src/router/modules/other.js
  19. 1 1
      src/store/getters.js
  20. 31 1
      src/styles/index.scss
  21. 52 0
      src/utils/time-picker.js
  22. 502 0
      src/views/campaign/activity-edit.vue
  23. 180 0
      src/views/campaign/activity-list.vue
  24. 362 0
      src/views/campaign/banner-edit.vue
  25. 465 0
      src/views/campaign/category-edit.vue
  26. 189 0
      src/views/campaign/components/activity/index.vue
  27. 202 0
      src/views/campaign/components/banner/index.vue
  28. 162 0
      src/views/campaign/components/category/index.vue
  29. 152 0
      src/views/campaign/components/good-dialog.vue
  30. 154 0
      src/views/campaign/components/good-multi-dialog.vue
  31. 58 0
      src/views/campaign/list.vue
  32. 465 0
      src/views/campaign/special-edit.vue
  33. 314 0
      src/views/centralized/details.vue
  34. 332 0
      src/views/centralized/list.vue
  35. 131 0
      src/views/club/details.vue
  36. 1 1
      src/views/club/editForm.vue
  37. 1 1
      src/views/club/form.vue
  38. 56 77
      src/views/club/list.vue
  39. 7 7
      src/views/club/operateList.vue
  40. 5 5
      src/views/dashboard/admin/index.vue
  41. 34 38
      src/views/finance/list.vue
  42. 159 0
      src/views/floor/components/good-multi-dialog.vue
  43. 433 0
      src/views/floor/edit.vue
  44. 157 0
      src/views/floor/list.vue
  45. 2 2
      src/views/goods/category-create.vue
  46. 2 2
      src/views/goods/category-edit.vue
  47. 2 2
      src/views/goods/category.vue
  48. 61 228
      src/views/goods/components/price-edit.vue
  49. 3 3
      src/views/goods/list-commonly.vue
  50. 3 3
      src/views/goods/list-preferential.vue
  51. 3 3
      src/views/goods/list-preferred.vue
  52. 4 4
      src/views/goods/list-select.vue
  53. 70 167
      src/views/goods/list.vue
  54. 71 52
      src/views/order/detail.vue
  55. 133 90
      src/views/order/list.vue
  56. 9 9
      src/views/order/refund.vue
  57. 1 1
      src/views/other/about.vue
  58. 1 1
      src/views/other/after.vue
  59. 1 1
      src/views/other/notes.vue
  60. 2 2
      src/views/other/password.vue

+ 2 - 2
.env.development

@@ -4,8 +4,8 @@ ENV = 'development'
 # base api
 # VUE_APP_BASE_API = '/dev-api'
 # VUE_APP_BASE_API = 'http://192.168.1.22:9104'
-# VUE_APP_BASE_API = 'http://192.168.1.26:9104'
-VUE_APP_BASE_API = 'https://mai-b.caimei365.com'
+VUE_APP_BASE_API = 'http://192.168.2.67:9104'
+# VUE_APP_BASE_API = 'https://mai-b.caimei365.com'
 # VUE_APP_BASE_API = 'http://192.168.78.1:9104/'
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

+ 5 - 0
.prettierrc.json

@@ -0,0 +1,5 @@
+{
+  "semi": false, // 去掉结尾的分号
+  "singleQuote": true // 单引号替代双引号
+  "trailingComma": "none"// 末尾禁止添加逗号
+}

+ 85 - 0
src/api/campaign.js

@@ -0,0 +1,85 @@
+import request from '@/utils/request'
+
+export function getBannerList(query) {
+  return request({
+    url: '/home/page/banner/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getBannerStatus(id) {
+  return request({
+    url: '/home/page/check/banner/status/' + id,
+    method: 'get'
+  })
+}
+
+export function getBannerSort(id, sort) {
+  return request({
+    url: `/home/page/banner/${id}/${sort}`,
+    method: 'get'
+  })
+}
+
+export function savePageBanner(params) {
+  return request({
+    url: '/home/page/save/banner',
+    method: 'post',
+    data: params
+  })
+}
+
+export function delPageBanner(id) {
+  return request({
+    url: '/home/page/del/banner/' + id,
+    method: 'get'
+  })
+}
+
+export function switchGoods(id) {
+  return request({
+    url: '/product/cmMallOrganizeProducts/switchLine/' + id,
+    method: 'get'
+  })
+}
+
+export function saveGoods(goods) {
+  return request({
+    url: '/product/cmMallOrganizeProducts/saveEditProductInfo',
+    method: 'post',
+    data: goods
+  })
+}
+
+export function saveGoodsSort(sorts) {
+  return request({
+    url: '/product/cmMallOrganizeProducts/batchSaveSort',
+    method: 'post',
+    params: sorts
+  })
+}
+
+export function getAddList(query) {
+  return request({
+    url: '/product/cmMallOrganizeProducts/toAddProduct1',
+    method: 'get',
+    params: query
+  })
+}
+
+export function saveAddList(data) {
+  return request({
+    url: '/product/cmMallOrganizeProducts/saveAddProductInfo',
+    method: 'post',
+    data: data
+  })
+}
+
+export function canncelProduct(data) {
+  return request({
+    url: '/product/cmMallOrganizeProducts/canncelProduct',
+    method: 'post',
+    data: data
+  })
+}

+ 9 - 0
src/api/club.js

@@ -30,6 +30,15 @@ export function getClubList(query) {
     params: query
   })
 }
+/**
+ *机构详情
+ */
+export function getClubDetail(id) {
+  return request({
+    url: '/user/cmUserOrganize/clubDetail/' + id,
+    method: 'get'
+  })
+}
 /**
  *保存并生成邀请码
  */

+ 2 - 3
src/api/goods.js

@@ -18,9 +18,8 @@ export function getModule(query) {
 
 export function switchGoods(id) {
   return request({
-    url: '/product/cmMallOrganizeProducts/switchLine',
-    method: 'post',
-    params: id
+    url: '/product/cmMallOrganizeProducts/switchLine/' + id,
+    method: 'get'
   })
 }
 

+ 9 - 0
src/components/index.js

@@ -0,0 +1,9 @@
+import Pagination from './Pagination'
+
+const install = (Vue) => {
+  Vue.component(Pagination.name, Pagination)
+}
+
+export default {
+  install
+}

+ 1 - 1
src/layout/components/Navbar.vue

@@ -8,7 +8,7 @@
       <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
         <div class="avatar-wrapper">
           <span class="admin-name">{{ adminName }}</span>
-          <img src="@/assets/avatar.jpg" class="user-avatar">
+          <img src="@/assets/avatar.gif" class="user-avatar">
           <!-- <i class="el-icon-caret-bottom" /> -->
         </div>
         <el-dropdown-menu slot="dropdown">

+ 5 - 3
src/layout/components/Sidebar/Item.vue

@@ -15,11 +15,13 @@ export default {
   render(h, context) {
     const { icon, title } = context.props
     const vnodes = []
-
     if (icon) {
-      vnodes.push(<svg-icon icon-class={icon}/>)
+      if (icon.includes('el-icon')) {
+        vnodes.push(<i class={[icon, 'sub-el-icon']} />)
+      } else {
+        vnodes.push(<svg-icon icon-class={icon}/>)
+      }
     }
-
     if (title) {
       vnodes.push(<span slot='title'>{(title)}</span>)
     }

+ 4 - 0
src/main.js

@@ -19,6 +19,8 @@ import './utils/error-log' // error log
 
 import * as filters from './filters' // global filters
 
+import Component from '@/components'
+
 const simplePwd = 'caimei123' // 简单密码
 /**
  * If you don't want to use mock-server
@@ -37,6 +39,8 @@ Vue.use(Element, {
   size: Cookies.get('size') || 'medium' // set element-ui default size
 })
 
+Vue.use(Component)
+
 // register global utility filters
 Object.keys(filters).forEach(key => {
   Vue.filter(key, filters[key])

+ 8 - 2
src/router/index.js

@@ -8,7 +8,10 @@ import Layout from '@/layout'
 
 /* Router Modules */
 import clubRouter from './modules/club'
+import centralizedRouter from './modules/centralized'
+import floorRouter from './modules/floor'
 import goodsRouter from './modules/goods'
+import campaign from './modules/campaign'
 import orderRouter from './modules/order'
 import financeRouter from './modules/finance'
 import otherRouter from './modules/other'
@@ -79,7 +82,7 @@ export const constantRoutes = [
         path: 'dashboard',
         component: () => import('@/views/dashboard/index'),
         name: 'Dashboard',
-        meta: { title: '首页', icon: 'ma-home', noCache: true, affix: true }
+        meta: { title: '首页', icon: 'el-icon-s-home', noCache: true, affix: true }
       }
     ]
   }
@@ -90,9 +93,12 @@ export const constantRoutes = [
  */
 export const asyncRoutes = [
   clubRouter,
+  centralizedRouter,
   goodsRouter,
-  orderRouter,
+  campaign,
+  floorRouter,
   financeRouter,
+  orderRouter,
   otherRouter,
   // 404 page must be placed at the end !!!
   { path: '*', redirect: '/404', hidden: true }

+ 55 - 0
src/router/modules/campaign.js

@@ -0,0 +1,55 @@
+/* Layout */
+import Layout from '@/layout'
+
+const clubRouter = {
+  path: '/campaign',
+  component: Layout,
+  redirect: '/campaign/list',
+  name: 'Campaign',
+  meta: { title: '活动管理', icon: 'el-icon-present' },
+  alwaysShow: true,
+  children: [
+    {
+      path: 'list',
+      name: 'CampaignList',
+      component: () => import('@/views/campaign/list'),
+      meta: { title: '运营专区', icon: 'el-icon-guide' }
+    },
+    {
+      path: 'banner-edit',
+      name: 'BannerEdit',
+      component: () => import('@/views/campaign/banner-edit'),
+      meta: { title: '轮播图编辑', icon: 'ma-other-notes' },
+      hidden: true
+    },
+    {
+      path: 'category-edit',
+      name: 'CategoryEdit',
+      component: () => import('@/views/campaign/category-edit'),
+      meta: { title: '主菜单编辑', icon: 'ma-other-notes' },
+      hidden: true
+    },
+    {
+      path: 'special-edit',
+      name: 'SpecialEdit',
+      component: () => import('@/views/campaign/special-edit'),
+      meta: { title: '活动编辑', icon: 'ma-other-notes' },
+      hidden: true
+    },
+    {
+      path: 'activity-edit',
+      name: 'ActivityEdit',
+      component: () => import('@/views/campaign/activity-edit'),
+      meta: { title: '活动编辑', icon: 'ma-other-notes' },
+      hidden: true
+    },
+    {
+      path: 'activity-list',
+      name: 'ActivityList',
+      component: () => import('@/views/campaign/activity-list'),
+      meta: { title: '活动列表', icon: 'el-icon-s-grid' }
+    }
+  ]
+}
+
+export default clubRouter

+ 28 - 0
src/router/modules/centralized.js

@@ -0,0 +1,28 @@
+/* Layout */
+import Layout from '@/layout'
+
+const clubRouter = {
+  path: '/centralized',
+  component: Layout,
+  redirect: '/centralized/list',
+  name: 'Centralized',
+  meta: { title: '集采管理', icon: 'el-icon-data-analysis' },
+  alwaysShow: true,
+  children: [
+    {
+      path: 'list',
+      name: 'List',
+      component: () => import('@/views/centralized/list'),
+      meta: { title: '集采需求列表', icon: 'el-icon-data-board' }
+    },
+    {
+      path: 'details',
+      name: 'Details',
+      component: () => import('@/views/centralized/details'),
+      meta: { title: '查看详情' },
+      hidden: true
+    }
+  ]
+}
+
+export default clubRouter

+ 11 - 4
src/router/modules/club.js

@@ -6,20 +6,27 @@ const clubRouter = {
   component: Layout,
   redirect: '/club/list',
   name: 'Club',
-  meta: { title: '机构管理', icon: 'ma-club' },
+  meta: { title: '机构管理', icon: 'el-icon-office-building' },
   alwaysShow: true,
   children: [
     {
       path: 'list',
       name: 'List',
       component: () => import('@/views/club/list'),
-      meta: { title: '机构列表', icon: 'ma-club-list' }
+      meta: { title: '机构列表', icon: 'el-icon-s-custom' }
+    },
+    {
+      path: 'details',
+      name: 'Details',
+      component: () => import('@/views/club/details'),
+      meta: { title: '查看资料' },
+      hidden: true
     },
     {
       path: 'form',
       name: 'Form',
       component: () => import('@/views/club/form'),
-      meta: { title: '上线机构', icon: 'ma-club-form' },
+      meta: { title: '添加机构', icon: 'ma-club-form' },
       hidden: true
     },
     {
@@ -33,7 +40,7 @@ const clubRouter = {
       path: 'editForm',
       component: () => import('@/views/club/editForm'),
       name: 'EditForm',
-      meta: { title: '编辑机构', noCache: true, activeMenu: '/club/list' },
+      meta: { title: '编辑资料', noCache: true, activeMenu: '/club/list' },
       hidden: true
     }
   ]

+ 2 - 2
src/router/modules/finance.js

@@ -6,14 +6,14 @@ const financeRouter = {
   component: Layout,
   redirect: '/finance/list',
   name: 'Finance',
-  meta: { title: '财务管理', icon: 'ma-finance' },
+  meta: { title: '财务管理', icon: 'el-icon-printer' },
   alwaysShow: true,
   children: [
     {
       path: 'list',
       name: 'List',
       component: () => import('@/views/finance/list'),
-      meta: { title: '对账列表', icon: 'ma-finance-list' }
+      meta: { title: '收款列表', icon: 'el-icon-coin' }
     },
     {
       path: 'refund',

+ 28 - 0
src/router/modules/floor.js

@@ -0,0 +1,28 @@
+/* Layout */
+import Layout from '@/layout'
+
+const floorRouter = {
+  path: '/floor',
+  component: Layout,
+  redirect: '/floor/list',
+  name: 'Floor',
+  meta: { title: '楼层管理', icon: 'el-icon-school' },
+  alwaysShow: true,
+  children: [
+    {
+      path: 'list',
+      name: 'FloorList',
+      component: () => import('@/views/floor/list'),
+      meta: { title: '楼层管理', icon: 'el-icon-s-operation' }
+    },
+    {
+      path: 'edit',
+      name: 'FloorEdit',
+      component: () => import('@/views/floor/edit'),
+      meta: { title: '楼层编辑', icon: 'ma-other-notes' },
+      hidden: true
+    }
+  ]
+}
+
+export default floorRouter

+ 9 - 8
src/router/modules/goods.js

@@ -6,14 +6,21 @@ const goodsRouter = {
   component: Layout,
   redirect: '/goods/list',
   name: 'Goods',
-  meta: { title: '商品管理', icon: 'ma-goods' },
+  meta: { title: '商品管理', icon: 'el-icon-goods' },
   alwaysShow: true,
   children: [
+    {
+      path: 'list',
+      name: 'List',
+      component: () => import('@/views/goods/list'),
+      meta: { title: '商品列表', icon: 'el-icon-shopping-bag-2' }
+    },
     {
       path: 'category',
       name: 'Category',
       component: () => import('@/views/goods/category'),
-      meta: { title: '商品分类', icon: 'ma-goods-category' }
+      meta: { title: '商品分类', icon: 'ma-goods-category' },
+      hidden: true
     },
     {
       path: 'category/edit/:id(\\d+)',
@@ -29,12 +36,6 @@ const goodsRouter = {
       meta: { title: '添加分类', noCache: true, activeMenu: '/goods/category' },
       hidden: true
     },
-    {
-      path: 'list',
-      name: 'List',
-      component: () => import('@/views/goods/list'),
-      meta: { title: '商品列表', icon: 'ma-goods-list' }
-    },
     {
       path: 'list/select/:type(\\d+)',
       name: 'SelectProduct',

+ 4 - 4
src/router/modules/order.js

@@ -6,20 +6,20 @@ const orderRouter = {
   component: Layout,
   redirect: '/order/list',
   name: 'Order',
-  meta: { title: '订单管理', icon: 'ma-order' },
+  meta: { title: '订单管理', icon: 'el-icon-shopping-cart-1' },
   alwaysShow: true,
   children: [
     {
       path: 'list',
       name: 'List',
       component: () => import('@/views/order/list'),
-      meta: { title: '订单列表', icon: 'ma-order-list' }
+      meta: { title: '订单列表', icon: 'el-icon-document-copy' }
     },
     {
       path: 'refund',
       name: 'Refund',
       component: () => import('@/views/order/refund'),
-      meta: { title: '用户退款列表', icon: 'ma-order-refund' }
+      meta: { title: '用户退款列表', icon: 'el-icon-money' }
     },
     {
       path: 'refund/detail/:id(\\d+)',
@@ -29,7 +29,7 @@ const orderRouter = {
       hidden: true
     },
     {
-      path: 'detail/:id(\\d+)',
+      path: 'detail',
       name: 'Detail',
       component: () => import('@/views/order/detail'),
       meta: { title: '订单详情', noCache: true, activeMenu: '/order/list' },

+ 5 - 5
src/router/modules/other.js

@@ -6,32 +6,32 @@ const otherRouter = {
   component: Layout,
   redirect: '/other/about',
   name: 'Other',
-  meta: { title: '其他设置', icon: 'ma-other' },
+  meta: { title: '其他设置', icon: 'el-icon-setting' },
   alwaysShow: true,
   children: [
     {
       path: 'about',
       name: 'About',
       component: () => import('@/views/other/about'),
-      meta: { title: '关于我们', icon: 'ma-other-about' }
+      meta: { title: '关于我们', icon: 'el-icon-info' }
     },
     {
       path: 'after',
       name: 'After',
       component: () => import('@/views/other/after'),
-      meta: { title: '售后无忧', icon: 'ma-other-after' }
+      meta: { title: '售后无忧', icon: 'el-icon-shopping-bag-2' }
     },
     {
       path: 'notes',
       name: 'Notes',
       component: () => import('@/views/other/notes'),
-      meta: { title: '购物须知', icon: 'ma-other-notes' }
+      meta: { title: '购物须知', icon: 'el-icon-shopping-cart-full' }
     },
     {
       path: 'password',
       name: 'Password',
       component: () => import('@/views/other/password'),
-      meta: { title: '修改密码', icon: 'ma-other-password' }
+      meta: { title: '修改密码', icon: 'el-icon-unlock' }
     }
   ]
 }

+ 1 - 1
src/store/getters.js

@@ -11,7 +11,7 @@ const getters = {
   name: state => state.user.name,
   avatar: state => state.user.avatar,
   roles: state => state.user.roles,
-  organizeID: state => state.user.organizeID,
+  organizeId: state => state.user.organizeID,
   permission_routes: state => state.permission.routes,
   errorLogs: state => state.errorLog.logs
 }

+ 31 - 1
src/styles/index.scss

@@ -199,4 +199,34 @@ input[type="number"]{
 }
 .el-dialog__header{
   border-bottom: 1px solid #e8f4ff;
-}
+}
+.filter-container {
+  padding-bottom: 10px;
+
+  .filter-item {
+    display: inline-block;
+    vertical-align: middle;
+    margin-bottom: 10px;
+  }
+
+  .filter-control {
+    display: inline-block;
+    margin-bottom: 10px;
+    margin-right: 10px;
+    > span,
+    > .el-input {
+      display: inline-block;
+      vertical-align: middle;
+    }
+    > span {
+      margin-right: 10px;
+      font-size: 14px;
+      color: #606266;
+      font-weight: bold;
+    }
+    > .el-input,
+    > .el-select {
+      width: 200px;
+    }
+  }
+}

+ 52 - 0
src/utils/time-picker.js

@@ -0,0 +1,52 @@
+// 时间picker
+const pickerOptions = {
+  shortcuts: [
+    {
+      text: '近1年',
+      onClick(picker) {
+        const end = new Date()
+        const start = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 365)
+        picker.$emit('pick', [start, end])
+      }
+    },
+    {
+      text: '近半年',
+      onClick(picker) {
+        const end = new Date()
+        const start = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 183)
+        picker.$emit('pick', [start, end])
+      }
+    },
+    {
+      text: '近1月',
+      onClick(picker) {
+        const end = new Date()
+        const start = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
+        picker.$emit('pick', [start, end])
+      }
+    },
+    {
+      text: '近1周',
+      onClick(picker) {
+        const end = new Date()
+        const start = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+        picker.$emit('pick', [start, end])
+      }
+    },
+    {
+      text: '昨天',
+      onClick(picker) {
+        const end = new Date()
+        const start = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24)
+        picker.$emit('pick', [start, end])
+      }
+    }
+  ]
+}
+
+export default pickerOptions

+ 502 - 0
src/views/campaign/activity-edit.vue

@@ -0,0 +1,502 @@
+<template>
+  <div class="app-container" style="width: 800px;margin: 0 auto;">
+    <el-form ref="bannerForm" :model="form" label-width="100px">
+      <el-form-item label="活动类型:" prop="acType" :rules="rules.acType">
+        <el-select v-model="form.acType" placeholder="请选择">
+          <el-option label="商品列表" :value="1" />
+          <el-option label="宣传图(一张)" :value="2" />
+          <el-option label="宣传图(多张)" :value="3" />
+        </el-select>
+        <el-button v-if="form.acType === 3" type="primary" icon="el-icon-plus" :disabled="disabled" style="margin-left: 10px;" @click="handleAddList">新增宣传图</el-button>
+      </el-form-item>
+      <el-form-item label="主题:" prop="name" :rules="rules.name">
+        <el-input v-model="form.name" placeholder="请输入活动主题" style="width: 200px;" />
+      </el-form-item>
+      <el-form-item label="状态:" prop="status" :rules="rules.status">
+        <el-select v-model="form.status" placeholder="请选择">
+          <el-option label="上线" :value="1" />
+          <el-option label="下线" :value="0" />
+        </el-select>
+      </el-form-item>
+      <template v-if="form.acType === 1">
+        <!-- 商品列表 -->
+        <el-form-item label="商品信息" :prop="productList" :rules="rules.productList">
+          <el-button type="primary" icon="el-icon-sort" size="mini" :disabled="disabled3(form.productList)" @click="handleOnInputBlur">一键排序</el-button>
+          <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleDialogVisible">添加商品</el-button>
+          <el-checkbox-group v-show="false" v-model="form.productList" />
+          <el-table v-show="form.productList && form.productList.length>0" :data="form.productList" border>
+            <el-table-column property="mainImage" label="商品图片" align="center" width="80">
+              <template slot-scope="{ row }">
+                <el-popover
+                  placement="top-start"
+                  title=""
+                  width="180"
+                  trigger="hover"
+                >
+                  <img :src="row.mainImage" alt="" style="width:150px;height:150px;">
+                  <img slot="reference" :src="row.mainImage" alt="" style="width:30px;height:30px;">
+                </el-popover>
+              </template>
+            </el-table-column>
+            <el-table-column property="name" label="商品名称" align="center" />
+            <el-table-column prop="validFlag" label="商品状态" align="center" width="150">
+              <template slot-scope="{row}">
+                <el-tag :type="row.validFlag | statusFilter">{{ row.validFlag*1 === 1 ? '已上架' : '已下架' }}</el-tag>
+              </template>
+            </el-table-column>
+            <el-table-column label="排序" align="center" width="100">
+              <template slot-scope="{row}">
+                <el-input v-model="row.sort" maxlength="4" minlength="1" />
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center">
+              <template slot-scope="scope">
+                <el-button type="text" @click="handleDeletePros(scope.$index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+      </template>
+      <template v-if="form.acType === 2 || form.acType === 3">
+        <div v-for="(activ,index) in form.activityList" :key="index" class="form-cell">
+          <el-form-item label="宣传图:" prop="banner" :rules="rules.banner">
+            <div class="form-el-upload">
+              <el-upload
+                class="avatar-uploader"
+                :action="actionUrl"
+                :headers="getToken"
+                :show-file-list="false"
+                :on-success="handleSuccess"
+                :before-upload="beforeUpload"
+              >
+                <div v-loading="loadImgLoading" class="avatar">
+                  <img v-if="form.banner" :src="form.banner" @error="reloadImage" @load="loadSucess">
+                  <i v-else class="el-icon-plus avatar-uploader-icon" />
+                </div>
+              </el-upload>
+            </div>
+          </el-form-item>
+          <!-- 商品列表 -->
+          <el-form-item label="商品信息" :prop="`activityList.${index}.productList`" :rules="rules.productList">
+            <el-button type="primary" icon="el-icon-sort" size="mini" :disabled="disabled3(activ.productList)" @click="handleOnInputBlur">一键排序</el-button>
+            <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleDialogVisible">添加商品</el-button>
+            <el-checkbox-group v-show="false" v-model="activ.productList" />
+            <el-table v-show="activ.productList && activ.productList.length>0" :data="activ.productList" border>
+              <el-table-column property="mainImage" label="商品图片" align="center" width="80">
+                <template slot-scope="{ row }">
+                  <el-popover
+                    placement="top-start"
+                    title=""
+                    width="180"
+                    trigger="hover"
+                  >
+                    <img :src="row.mainImage" alt="" style="width:150px;height:150px;">
+                    <img slot="reference" :src="row.mainImage" alt="" style="width:30px;height:30px;">
+                  </el-popover>
+                </template>
+              </el-table-column>
+              <el-table-column property="name" label="商品名称" align="center" />
+              <el-table-column prop="validFlag" label="商品状态" align="center" width="150">
+                <template slot-scope="{row}">
+                  <el-tag :type="row.validFlag | statusFilter">{{ row.validFlag*1 === 1 ? '已上架' : '已下架' }}</el-tag>
+                </template>
+              </el-table-column>
+              <el-table-column label="排序" align="center" width="100">
+                <template slot-scope="{row}">
+                  <el-input v-model="row.sort" maxlength="4" minlength="1" />
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleDeletePros(scope.$index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form-item>
+          <el-button class="delete_label" :disabled="disabled1" icon="el-icon-delete" size="mini" type="danger" @click="handleDelete(index)">删除</el-button>
+        </div>
+      </template>
+    </el-form>
+    <div class="el-dialog__footer" style="text-align: center;">
+      <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+    </div>
+    <!-- 商品弹框 -->
+    <good-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
+  </div>
+</template>
+
+<script>
+import { getClubList, createOperator, updateStatus } from '@/api/club'
+import goodDialog from './components/good-multi-dialog'
+const defaultForm = () => {
+  return {
+    banner: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+    productList: []
+  }
+}
+export default {
+  name: 'BannerEdit',
+  components: { goodDialog },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'warning'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      form: {
+        acType: 1,
+        name: '',
+        banner: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+        sort: 0,
+        status: 1,
+        actId: '',
+        productList: [],
+        activityList: [
+          {
+            banner: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+            productList: []
+          }
+        ]
+      },
+      productData: [
+        {
+          mainImage: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+          productName: 'Twinkle 水婴肌 美白 补水 紧致 无创水光',
+          shopName: '雅光博睿医药科技(广东)有限公司',
+          unit: '20ML',
+          costPrice: '50000.00',
+          price: '50000.00',
+          addTime: '2023-04-14 14:45:39',
+          validFlag: 1
+        }
+      ],
+      formParams: {
+        id: '',
+        month: '',
+        endMonth: '',
+        status: '',
+        configure: 1, // 专属优惠券配置  1是、0否
+        coupons: []
+      },
+      editType: 'add',
+      // 商品列表
+      dialogVisible: false,
+      loadImgLoading: false,
+      rules: {
+        acType: [{ required: true, message: '请选择活动类型', trigger: 'blur' }],
+        name: [{ required: true, message: '请填写轮播主题', trigger: 'blur' }],
+        banner: [{ required: true, message: '请上传轮播图', trigger: 'blur' }],
+        productList: [{ required: true, type: 'array', message: '请添加商品', trigger: ['change'] }],
+        sort: [{ required: true, message: '排序值不能为空', trigger: 'blur' }],
+        status: [{ required: true, message: '请选择状态', trigger: 'blur' }]
+      },
+      delFlag: false
+    }
+  },
+  computed: {
+    disabled() {
+      return this.form.activityList.length === 10
+    },
+    disabled1() {
+      return this.form.activityList.length === 1
+    },
+    getToken() {
+      return {
+        'token': this.$store.getters.token
+      }
+    },
+    actionUrl() {
+      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
+    }
+  },
+  created() {
+    this.editType = this.$route.query.type || 'edit'
+    console.log('editType', this.editType)
+    // this.initForm(this.editType)
+  },
+  methods: {
+    initForm(type) {
+      if (type === 'add') {
+        console.log('add')
+        this.svipCoupon(type, 1, 0)
+      } else {
+        console.log('edit')
+        this.svipCoupon(type, 0, this.$route.query.id)
+      }
+    },
+    async svipCoupon(type, configure, id) {
+      const res = await svipCoupon({ id: id, configure: configure })
+      const data = res.data.svipcouponForm
+      this.formParams = { ...this.formParams, ...data }
+      if (data.coupons.length > 0) {
+        this.delFlag = true
+        this.form.formList = data.coupons.map((el) => {
+          el = { ...el, ...this.defaultShop }
+          if (el.shop) {
+            el.shopData.push(el.shop)
+          }
+          return el
+        })
+        console.log('formList', this.form.formList)
+      } else {
+        for (let i = 0; i <= 2; i++) {
+          this.form.formList.push(defaultForm())
+        }
+      }
+    },
+    // 显示选择商品弹窗
+    handleDialogVisible() {
+      this.dialogVisible = true
+    },
+    handleGoodDialogVisible(index) {
+      // 显示选择商品弹窗
+      this.addIndex = index
+      this.dialogGoodVisible = true
+    },
+    deleteShop() {
+      // 清除供应商
+      this.form.productId = ''
+      this.productData = []
+    },
+    handleGoodConfirm(data) {
+      // 确认选择商品
+      const from = this.form.formList[this.addIndex]
+      from.associateList.push(data)
+      console.log('from', this.form.formList)
+      this.handleGoodCancel()
+    },
+    handleDeletePros(index) {
+      // 删除商品
+      this.$confirm('确定删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.from.productList.splice(index, 1)
+      })
+    },
+    onSubmit(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          this.handleFormParams()
+          this.$confirm('是否提交数据', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            console.log('formParams', this.formParams)
+            if (this.editType === 'add') {
+              this.formParams.configure = 1
+            } else {
+              this.formParams.configure = 0
+            }
+            this.saveVipCoupon(this.formParams)
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    handleFormParams() {
+      // 处理参数
+      this.formParams.coupons = this.form.formList.map((el) => {
+        if (el.associateList && el.associateList.length > 0) {
+          el.associateList = el.associateList.map((pro) => {
+            return {
+              sort: pro.sort,
+              pcStatus: pro.pcStatus,
+              appletsStatus: pro.appletsStatus,
+              name: pro.name,
+              shopName: pro.shopName,
+              mainImage: pro.mainImage,
+              productId: pro.productId
+            }
+          })
+        }
+        return el
+      })
+    },
+    async saveVipCoupon(params) {
+      // 保存超级会员优惠券
+      await saveVipCoupon(params)
+      this.$message.success('保存成功')
+      setTimeout(() => {
+        this.$router.push({ path: '/member/coupon/list' })
+      }, 1000)
+    },
+    // 取消选择商品
+    handleGoodCancel() {
+      this.dialogVisible = false
+      this.$refs.goodDialog.visible = false
+    },
+    handleAddList() {
+      // 新增宣传图
+      this.form.activityList.push(defaultForm())
+    },
+    handleDelete(index) {
+      // 删除单挑优惠券
+      this.$confirm('确定删除此条吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (this.delFlag) {
+          this.delCoupon(item.id, index)
+        } else {
+          this.form.activityList.splice(index, 1)
+        }
+      })
+    },
+    async delCoupon(id, index) {
+      // 保存超级会员优惠券
+      if (id) {
+        try {
+          await delCoupon(id)
+        } catch (error) {
+          console.log(error)
+        }
+      }
+      this.form.formList.splice(index, 1)
+    },
+    handleOnInputBlur(formItem) {
+      // 商品排序
+      this.form.productList.sort(this.sortByEnent('sort'))
+    },
+    sortByEnent(i) {
+      // 排序
+      return function(a, b) {
+        return a[i] - b[i] //  a[i] - b[i]为正序,倒叙为  b[i] - a[i]
+      }
+    },
+    handlePcStatusChange(row) {
+      // PC状态开启关闭
+      console.log('row', row)
+      if (row.pcStatus === '0') {
+        row.pcStatus = '1'
+      } else {
+        row.pcStatus = '0'
+      }
+    },
+    handleAppStatusChange(row) {
+      // 小程序状态开启关闭
+      if (row.appletsStatus === '0') {
+        row.appletsStatus = '1'
+      } else {
+        row.appletsStatus = '0'
+      }
+    },
+    disabled3(array) {
+      if (array && array.length >= 2) {
+        return false
+      } else {
+        return true
+      }
+    },
+    // 上传图标事件
+    handleSuccess(response, file) {
+      this.loadImgLoading = true
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.temp.classifyImage = response.data
+        }, 1000 * 2)
+      })
+    },
+    // 对上传图片的大小、格式进行限制
+    beforeUpload(file) {
+      const isJPG = file.type === 'image/jpeg'
+      const isJPG2 = file.type === 'image/jpg'
+      const isPNG = file.type === 'image/png'
+      const isLt5M = file.size / 1024 / 1024 < 5
+      if (!isJPG && !isJPG2 && !isPNG) {
+        this.$message.error('只支持jpg或png格式图片')
+      }
+      if (!isLt5M) {
+        this.$message.error('请上传5MB以内的图片!')
+      }
+      return (isJPG || isJPG2 || isPNG) && isLt5M
+    },
+    reloadImage() {
+      this.loadImgLoading = true
+      setTimeout(() => {
+        this.temp.classifyImage = this.temp.classifyImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
+      }, 1000 * 2)
+    },
+    loadSucess() {
+      this.loadImgLoading = false
+    }
+  }
+}
+</script>
+
+<style>
+.avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    float: left;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 148px;
+    height: 148px;
+    line-height: 148px;
+    text-align: center;
+  }
+  .avatar {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .avatar img {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .el-form-item__label{
+      text-align: right !important;
+  }
+  .form-el-upload{
+    width: 150px;
+  }
+  .el-upload__tip{
+    line-height: 20px;
+    color: red;
+    text-align: left;
+    position: absolute;
+    right: -50%;
+    bottom: 0;
+  }
+  .span_tip{
+    font-size: 12px;
+    color: red;
+    margin-left: 5px;
+  }
+  .filter-item-temp{
+    width: 100px;
+  }
+  .form-cell{
+    border: 1px solid #e1e1e1;
+    border-radius: 8px;
+    box-sizing: border-box;
+    box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.07);
+    padding: 20px;
+    position: relative;
+    margin-bottom: 20px;
+  }
+  .delete_label{
+    position: absolute;
+    right: 2%;
+    top: 20px;
+  }
+</style>

+ 180 - 0
src/views/campaign/activity-list.vue

@@ -0,0 +1,180 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>活动类型:</span>
+        <el-select v-model="listQuery.stats" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="请选择" />
+          <el-option :value="1" label="商品列表" />
+          <el-option :value="2" label="宣传图(一张)" />
+          <el-option :value="3" label="宣传图(多张)" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>主题:</span>
+        <el-input
+          v-model="listQuery.productId"
+          placeholder="请输入活动主题"
+          clearable
+          @input="e => (listQuery.productId= checkedInput(e,1))"
+          @keyup.enter.native="getList"
+          @clear="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <span>状态:</span>
+        <el-select v-model="listQuery.status" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="请选择" />
+          <el-option :value="0" label="已上线" />
+          <el-option :value="1" label="已下线" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+        <el-button type="primary" icon="el-icon-plus" @click="handleToEdit('add')">添加活动</el-button>
+      </div>
+    </div>
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      element-loading-text="Loading"
+      border
+      fit
+      highlight-current-row
+      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
+    >
+      <el-table-column label="活动ID" align="center" prop="classifyName" />
+      <el-table-column label="活动类型" align="center" prop="classifyName" />
+      <el-table-column label="活动主题" align="center" prop="classifyName" />
+      <el-table-column class-name="status-col" label="状态" align="center" prop="status">
+        <template slot-scope="{row}">
+          <el-tooltip :content="row.status*1 === 1 ? '停用' : '启用'" placement="top">
+            <el-switch
+              v-model="row.status"
+              active-value="1"
+              inactive-value="0"
+              @change="changeStatus(row.id, row.status)"
+            />
+          </el-tooltip>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="创建时间" prop="addTime">
+        <template slot-scope="{row}">
+          <span>{{ row.addTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="handleToEdit('edit',row.id)">编辑</el-button>
+          <el-button type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
+
+  </div>
+</template>
+
+<script>
+import { getCategory, switchClassify, saveCategorySort } from '@/api/goods-classify'
+import Pagination from '@/components/Pagination'
+
+export default {
+  components: { Pagination },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'danger'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      list: null,
+      listLoading: true,
+      total: 0,
+      listQuery: {
+        index: 1,
+        pageSize: 20,
+        organizeID: this.$store.getters.organizeId
+      }
+    }
+  },
+  computed: {
+    organizeID() {
+      return this.$store.getters.organizeId
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.listLoading = true
+      getCategory(this.listQuery).then(response => {
+        this.list = response.data.results
+        this.total = response.data.totalRecord
+        this.listLoading = false
+      })
+    },
+    changeStatus(id, status) {
+      const confirmTxt = '确定要' + (status * 1 === 1 ? '启用' : '停用') + '该分类吗?'
+      this.$confirm(confirmTxt).then(_ => {
+        this.confirmChange(id)
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    confirmChange(id) {
+      switchClassify({ id: id }).then(() => {
+        this.getList()
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    batchSaveSort() {
+      const sorts = []
+      this.list.map(item => {
+        if (item.sort) {
+          sorts.push(item.id + '-' + Math.abs(item.sort))
+        }
+      })
+      saveCategorySort({ newProducSorttList: sorts.join(',') }).then(response => {
+        this.$message({ message: response.msg, type: 'success', center: true })
+        this.getList()
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    handleToEdit(type, id) {
+      if (type === 'add') {
+        this.$router.push({ path: '/campaign/activity-edit', query: { type: type }})
+      } else {
+        this.$router.push({ path: '/campaign/activity-edit', query: { type: type, id: id }})
+      }
+    }
+  }
+}
+
+</script>
+<style>
+.el-input-number.is-controls-right .el-input__inner {
+    padding-left: 5px;
+    padding-right: 30px;
+}
+</style>
+<style lang="scss" scoped>
+.filter-title{
+  float: left;
+  font-size: 12px;
+  line-height: 18px;
+  text-align: left;
+  color: #2E3748;
+}
+.filter-title p{
+  margin:10px 0;
+}
+</style>

+ 362 - 0
src/views/campaign/banner-edit.vue

@@ -0,0 +1,362 @@
+<template>
+  <div class="app-container" style="width: 800px;margin: 0 auto;">
+    <el-form ref="bannerForm" :model="form" label-width="100px">
+      <el-form-item label="主题:" prop="bannerName" :rules="rules.bannerName">
+        <el-input v-model="form.bannerName" placeholder="请输入活动主题" style="width: 250px;" />
+      </el-form-item>
+      <el-form-item label="轮播图:" prop="bannerImage" :rules="rules.bannerImage">
+        <div class="form-el-upload">
+          <el-upload
+            class="avatar-uploader"
+            :action="actionUrl"
+            :headers="getToken"
+            :show-file-list="false"
+            :on-success="handleSuccess"
+            :before-upload="beforeUpload"
+          >
+            <div v-loading="loadImgLoading" class="avatar">
+              <img v-if="form.bannerImage" :src="form.bannerImage" @error="reloadImage" @load="loadSucess">
+              <i v-else class="el-icon-plus avatar-uploader-icon" />
+            </div>
+          </el-upload>
+        </div>
+      </el-form-item>
+      <el-form-item label="排序:" prop="sort" :rules="rules.sort">
+        <el-input v-model="form.sort" style="width: 200px" />
+      </el-form-item>
+      <el-form-item label="状态:" prop="enabledStatus" :rules="rules.enabledStatus">
+        <el-select v-model="form.enabledStatus" placeholder="请选择">
+          <el-option label="上线" :value="1" />
+          <el-option label="下线" :value="0" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="跳转:" prop="jumpType" :rules="rules.jumpType">
+        <el-radio-group v-model="form.jumpType">
+          <el-radio :label="1">单个商品详情</el-radio>
+          <el-radio :label="2">活动列表</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <template v-if="form.jumpType === 1">
+        <el-form-item label="商品信息" prop="productData" :rules="rules.productData">
+          <template v-if="form.productData && form.productData.length === 0">
+            <el-button type="primary" autofocussize="mini" size="mini" icon="el-icon-plus" @click="handleDialogVisible">选择商品</el-button>
+            <el-checkbox-group v-show="false" v-model="form.productData" />
+          </template>
+          <template v-else>
+            <el-table :data="form.productData" border width="1000">
+              <el-table-column property="mainImage" label="商品图片" align="center" width="80">
+                <template slot-scope="{ row }">
+                  <el-popover
+                    placement="top-start"
+                    title=""
+                    width="180"
+                    trigger="hover"
+                  >
+                    <img :src="row.mainImage" alt="" style="width:150px;height:150px;">
+                    <img slot="reference" :src="row.mainImage" alt="" style="width:30px;height:30px;">
+                  </el-popover>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productName" label="商品名称" align="center" width="300" />
+              <el-table-column prop="validFlag" label="商品状态" align="center" width="150">
+                <template slot-scope="{row}">
+                  <el-tag :type="row.validFlag | statusFilter">{{ row.validFlag*1 === 1 ? '已上架' : '已下架' }}</el-tag>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center">
+                <el-button type="text" @click="deleteShop">删除</el-button>
+              </el-table-column>
+            </el-table>
+          </template>
+        </el-form-item>
+      </template>
+      <template v-if="form.jumpType === 2">
+        <el-form-item label="选择活动:" prop="jumpActiveId" :rules="rules.jumpActiveId">
+          <el-select v-model="form.jumpActiveId" clearable>
+            <el-option
+              v-for="item in activityList"
+              :key="item.jumpActiveId"
+              :label="item.name"
+              :value="item.jumpActiveId"
+            />
+          </el-select>
+        </el-form-item>
+      </template>
+    </el-form>
+    <div class="el-dialog__footer" style="text-align: center;">
+      <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+    </div>
+    <!-- 商品弹框 -->
+    <good-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
+  </div>
+</template>
+
+<script>
+import { savePageBanner, svipCoupon } from '@/api/campaign'
+import goodDialog from './components/good-dialog'
+const defaultForm = () => {
+  return {
+    shopId: 0,
+    shopData: [],
+    couponType: 0,
+    couponAmount: '',
+    touchPrice: '',
+    productType: '1',
+    categoryType: '1',
+    associateList: []// 指定商品信息
+  }
+}
+export default {
+  name: 'BannerEdit',
+  components: { goodDialog },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'warning'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      form: {
+        organizeId: this.$store.getters.organizeId,
+        bannerName: '', // 轮播主题
+        bannerImage: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+        sort: 0, // 轮播排序值
+        enabledStatus: 1, // 轮播上线状态
+        jumpType: null, // 跳转类型
+        jumpActiveId: null, // 跳转活动Id
+        jumpProductId: null, // 单个跳转商品详情Id
+        productData: []
+      },
+      activityList: [
+        {
+          actId: 1,
+          name: '活动主题1'
+        },
+        {
+          actId: 2,
+          name: '活动主题2'
+        }
+      ],
+      formParams: {
+        id: '',
+        month: '',
+        endMonth: '',
+        status: '',
+        configure: 1, // 专属优惠券配置  1是、0否
+        coupons: []
+      },
+      editType: 'add',
+      // 商品列表
+      dialogVisible: false,
+      loadImgLoading: false,
+      rules: {
+        bannerName: [{ required: true, message: '请填写轮播主题', trigger: 'blur' }],
+        bannerImage: [{ required: true, message: '请上传轮播图', trigger: 'blur' }],
+        productData: [{ required: true, type: 'array', message: '请添加一个商品', trigger: ['change'] }],
+        sort: [{ required: true, message: '排序值不能为空', trigger: 'blur' }],
+        enabledStatus: [{ required: true, message: '请选择状态', trigger: 'blur' }],
+        jumpType: [{ required: true, message: '请选择跳转类型', trigger: 'blur' }],
+        jumpActiveId: [{ required: true, message: '请选择活动列表', trigger: 'blur' }]
+      },
+      delFlag: false
+    }
+  },
+  computed: {
+    disabled() {
+      return this.form.formList.length === 5
+    },
+    disabled1() {
+      return this.form.formList.length === 1
+    },
+    getToken() {
+      return {
+        'token': this.$store.getters.token
+      }
+    },
+    actionUrl() {
+      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
+    }
+  },
+  created() {
+    this.editType = this.$route.query.type || 'edit'
+    console.log('editType', this.editType)
+    // this.initForm(this.editType)
+  },
+  methods: {
+    initForm(type) {
+      if (type === 'add') {
+        console.log('add')
+        this.svipCoupon(type, 1, 0)
+      } else {
+        console.log('edit')
+        this.svipCoupon(type, 0, this.$route.query.id)
+      }
+    },
+    async svipCoupon(type, configure, id) {
+      const res = await svipCoupon({ id: id, configure: configure })
+      const data = res.data.svipcouponForm
+      this.formParams = { ...this.formParams, ...data }
+      if (data.coupons.length > 0) {
+        this.delFlag = true
+        this.form.formList = data.coupons.map((el) => {
+          el = { ...el, ...this.defaultShop }
+          if (el.shop) {
+            el.shopData.push(el.shop)
+          }
+          return el
+        })
+        console.log('formList', this.form.formList)
+      } else {
+        for (let i = 0; i <= 2; i++) {
+          this.form.formList.push(defaultForm())
+        }
+      }
+    },
+    // 显示选择商品弹窗
+    handleDialogVisible() {
+      this.dialogVisible = true
+    },
+    handleGoodDialogVisible(index) {
+      // 显示选择商品弹窗
+      this.addIndex = index
+      this.dialogGoodVisible = true
+    },
+    deleteShop() {
+      // 清除供应商
+      this.form.jumpProductId = ''
+      this.form.productData = []
+    },
+    handleGoodConfirm(data) {
+      // 确认选择商品
+      this.form.jumpProductId = data.productID
+      this.form.productData.push(data)
+      console.log('productData', this.form.productData)
+      console.log('jumpProductId', this.form.jumpProductId)
+      this.handleGoodCancel()
+    },
+    onSubmit(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          this.$confirm('是否提交数据', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            console.log('form', this.form)
+            this.savePageBanner(this.form)
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    async savePageBanner(params) {
+      // 保存超级会员优惠券
+      await savePageBanner(params)
+      this.$message.success('保存成功')
+      setTimeout(() => {
+        this.$router.push({ path: '/campaign/list' })
+      }, 1000)
+    },
+    // 取消选择商品
+    handleGoodCancel() {
+      this.dialogVisible = false
+      this.$refs.goodDialog.visible = false
+    },
+    handleAddList() {
+      // 新增优惠券
+      this.form.formList.push(defaultForm())
+    },
+    // 上传图标事件
+    handleSuccess(response, file) {
+      this.loadImgLoading = true
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.form.bannerImage = response.data
+        }, 1000 * 2)
+      })
+    },
+    // 对上传图片的大小、格式进行限制
+    beforeUpload(file) {
+      const isJPG = file.type === 'image/jpeg'
+      const isJPG2 = file.type === 'image/jpg'
+      const isPNG = file.type === 'image/png'
+      const isLt5M = file.size / 1024 / 1024 < 5
+      if (!isJPG && !isJPG2 && !isPNG) {
+        this.$message.error('只支持jpg或png格式图片')
+      }
+      if (!isLt5M) {
+        this.$message.error('请上传5MB以内的图片!')
+      }
+      return (isJPG || isJPG2 || isPNG) && isLt5M
+    },
+    reloadImage() {
+      this.loadImgLoading = true
+      setTimeout(() => {
+        this.temp.classifyImage = this.temp.classifyImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
+      }, 1000 * 2)
+    },
+    loadSucess() {
+      this.loadImgLoading = false
+    }
+  }
+}
+</script>
+
+<style>
+.avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    float: left;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 148px;
+    height: 148px;
+    line-height: 148px;
+    text-align: center;
+  }
+  .avatar {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .avatar img {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .el-form-item__label{
+      text-align: right !important;
+  }
+  .form-el-upload{
+    width: 150px;
+  }
+  .el-upload__tip{
+    line-height: 20px;
+    color: red;
+    text-align: left;
+    position: absolute;
+    right: -50%;
+    bottom: 0;
+  }
+  .span_tip{
+    font-size: 12px;
+    color: red;
+    margin-left: 5px;
+  }
+  .filter-item-temp{
+    width: 100px;
+  }
+</style>

+ 465 - 0
src/views/campaign/category-edit.vue

@@ -0,0 +1,465 @@
+<template>
+  <div class="app-container" style="width: 800px;margin: 0 auto;">
+    <el-form ref="bannerForm" :model="form" label-width="100px">
+      <el-form-item label="主题:" prop="name" :rules="rules.name">
+        <el-input v-model="form.name" placeholder="请输入活动主题" style="width: 250px;" />
+      </el-form-item>
+      <el-form-item label="轮播图:" prop="banner" :rules="rules.banner">
+        <div class="form-el-upload">
+          <el-upload
+            class="avatar-uploader"
+            :action="actionUrl"
+            :headers="getToken"
+            :show-file-list="false"
+            :on-success="handleSuccess"
+            :before-upload="beforeUpload"
+          >
+            <div v-loading="loadImgLoading" class="avatar">
+              <img v-if="form.banner" :src="form.banner" @error="reloadImage" @load="loadSucess">
+              <i v-else class="el-icon-plus avatar-uploader-icon" />
+            </div>
+          </el-upload>
+        </div>
+      </el-form-item>
+      <el-form-item label="排序:" prop="sort" :rules="rules.sort">
+        <el-input v-model="form.sort" style="width: 200px" />
+      </el-form-item>
+      <el-form-item label="状态:" prop="status" :rules="rules.status">
+        <el-select v-model="form.status" placeholder="请选择">
+          <el-option label="上线" :value="1" />
+          <el-option label="下线" :value="0" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="跳转:" prop="jumpType" :rules="rules.jumpType">
+        <el-radio-group v-model="form.jumpType">
+          <el-radio :label="1">单个商品详情</el-radio>
+          <el-radio :label="2">活动列表</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <template v-if="form.jumpType === 1">
+        <el-form-item label="商品信息" prop="productId" :rules="rules.productId">
+          <template v-if="productData && productData.length === 0">
+            <el-button type="primary" autofocussize="mini" size="mini" icon="el-icon-plus" @click="handleDialogVisible">选择商品</el-button>
+            <el-checkbox-group v-show="false" v-model="form.productId" />
+          </template>
+          <template v-else>
+            <el-table :data="productData" border width="1000">
+              <el-table-column property="mainImage" label="商品图片" align="center" width="80">
+                <template slot-scope="{ row }">
+                  <el-popover
+                    placement="top-start"
+                    title=""
+                    width="180"
+                    trigger="hover"
+                  >
+                    <img :src="row.mainImage" alt="" style="width:150px;height:150px;">
+                    <img slot="reference" :src="row.mainImage" alt="" style="width:30px;height:30px;">
+                  </el-popover>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productName" label="商品名称" align="center" width="300" />
+              <el-table-column prop="validFlag" label="商品状态" align="center" width="150">
+                <template slot-scope="{row}">
+                  <el-tag :type="row.validFlag | statusFilter">{{ row.validFlag*1 === 1 ? '已上架' : '已下架' }}</el-tag>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center">
+                <el-button type="text" @click="deleteShop">删除</el-button>
+              </el-table-column>
+            </el-table>
+          </template>
+        </el-form-item>
+      </template>
+      <template v-if="form.jumpType === 2">
+        <el-form-item label="选择活动:" prop="actId" :rules="rules.actId">
+          <el-select v-model="form.actId" clearable>
+            <el-option
+              v-for="item in activityList"
+              :key="item.actId"
+              :label="item.name"
+              :value="item.actId"
+            />
+          </el-select>
+        </el-form-item>
+      </template>
+    </el-form>
+    <div class="el-dialog__footer" style="text-align: center;">
+      <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+    </div>
+    <!-- 商品弹框 -->
+    <good-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
+  </div>
+</template>
+
+<script>
+import { getClubList, createOperator, updateStatus } from '@/api/club'
+import goodDialog from './components/good-dialog'
+const defaultForm = () => {
+  return {
+    shopId: 0,
+    shopData: [],
+    couponType: 0,
+    couponAmount: '',
+    touchPrice: '',
+    productType: '1',
+    categoryType: '1',
+    associateList: []// 指定商品信息
+  }
+}
+export default {
+  name: 'CategoryEdit',
+  components: { goodDialog },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'warning'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      form: {
+        name: '',
+        banner: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+        sort: 0,
+        status: 1,
+        jumpType: null,
+        actId: '',
+        productId: null
+      },
+      activityList: [
+        {
+          actId: 1,
+          name: '活动主题1'
+        },
+        {
+          actId: 2,
+          name: '活动主题2'
+        }
+      ],
+      productData: [
+        {
+          mainImage: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+          productName: 'Twinkle 水婴肌 美白 补水 紧致 无创水光',
+          shopName: '雅光博睿医药科技(广东)有限公司',
+          unit: '20ML',
+          costPrice: '50000.00',
+          price: '50000.00',
+          addTime: '2023-04-14 14:45:39',
+          validFlag: 1
+        }
+      ],
+      formParams: {
+        id: '',
+        month: '',
+        endMonth: '',
+        status: '',
+        configure: 1, // 专属优惠券配置  1是、0否
+        coupons: []
+      },
+      editType: 'add',
+      // 商品列表
+      dialogVisible: false,
+      loadImgLoading: false,
+      rules: {
+        name: [{ required: true, message: '请填写轮播主题', trigger: 'blur' }],
+        banner: [{ required: true, message: '请上传轮播图', trigger: 'blur' }],
+        productId: [{ required: true, type: 'array', message: '请添加一个商品', trigger: ['change'] }],
+        sort: [{ required: true, message: '排序值不能为空', trigger: 'blur' }],
+        status: [{ required: true, message: '请选择状态', trigger: 'blur' }],
+        jumpType: [{ required: true, message: '请选择跳转类型', trigger: 'blur' }],
+        actId: [{ required: true, message: '请选择活动列表', trigger: 'blur' }]
+      },
+      delFlag: false
+    }
+  },
+  computed: {
+    disabled() {
+      return this.form.formList.length === 5
+    },
+    disabled1() {
+      return this.form.formList.length === 1
+    },
+    getToken() {
+      return {
+        'token': this.$store.getters.token
+      }
+    },
+    actionUrl() {
+      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
+    }
+  },
+  created() {
+    this.editType = this.$route.query.type || 'edit'
+    console.log('editType', this.editType)
+    // this.initForm(this.editType)
+  },
+  methods: {
+    initForm(type) {
+      if (type === 'add') {
+        console.log('add')
+        this.svipCoupon(type, 1, 0)
+      } else {
+        console.log('edit')
+        this.svipCoupon(type, 0, this.$route.query.id)
+      }
+    },
+    async svipCoupon(type, configure, id) {
+      const res = await svipCoupon({ id: id, configure: configure })
+      const data = res.data.svipcouponForm
+      this.formParams = { ...this.formParams, ...data }
+      if (data.coupons.length > 0) {
+        this.delFlag = true
+        this.form.formList = data.coupons.map((el) => {
+          el = { ...el, ...this.defaultShop }
+          if (el.shop) {
+            el.shopData.push(el.shop)
+          }
+          return el
+        })
+        console.log('formList', this.form.formList)
+      } else {
+        for (let i = 0; i <= 2; i++) {
+          this.form.formList.push(defaultForm())
+        }
+      }
+    },
+    // 显示选择商品弹窗
+    handleDialogVisible() {
+      this.dialogVisible = true
+    },
+    handleGoodDialogVisible(index) {
+      // 显示选择商品弹窗
+      this.addIndex = index
+      this.dialogGoodVisible = true
+    },
+    deleteShop() {
+      // 清除供应商
+      this.form.productId = ''
+      this.productData = []
+    },
+    handleGoodConfirm(data) {
+      // 确认选择商品
+      const from = this.form.formList[this.addIndex]
+      from.associateList.push(data)
+      console.log('from', this.form.formList)
+      this.handleGoodCancel()
+    },
+    handleDeletePros(formItem, index) {
+      // 删除商品
+      this.$confirm('确定删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        formItem.associateList.splice(index, 1)
+      })
+    },
+    onSubmit(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          this.handleFormParams()
+          this.$confirm('是否提交数据', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            console.log('formParams', this.formParams)
+            if (this.editType === 'add') {
+              this.formParams.configure = 1
+            } else {
+              this.formParams.configure = 0
+            }
+            this.saveVipCoupon(this.formParams)
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    handleFormParams() {
+      // 处理参数
+      this.formParams.coupons = this.form.formList.map((el) => {
+        if (el.associateList && el.associateList.length > 0) {
+          el.associateList = el.associateList.map((pro) => {
+            return {
+              sort: pro.sort,
+              pcStatus: pro.pcStatus,
+              appletsStatus: pro.appletsStatus,
+              name: pro.name,
+              shopName: pro.shopName,
+              mainImage: pro.mainImage,
+              productId: pro.productId
+            }
+          })
+        }
+        return el
+      })
+    },
+    async saveVipCoupon(params) {
+      // 保存超级会员优惠券
+      await saveVipCoupon(params)
+      this.$message.success('保存成功')
+      setTimeout(() => {
+        this.$router.push({ path: '/member/coupon/list' })
+      }, 1000)
+    },
+    // 取消选择商品
+    handleGoodCancel() {
+      this.dialogVisible = false
+      this.$refs.goodDialog.visible = false
+    },
+    handleAddList() {
+      // 新增优惠券
+      this.form.formList.push(defaultForm())
+    },
+    handleDelete(item, index) {
+      // 删除单挑优惠券
+      this.$confirm('确定删除此优惠券吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (this.delFlag) {
+          this.delCoupon(item.id, index)
+        } else {
+          this.form.formList.splice(index, 1)
+        }
+      })
+    },
+    async delCoupon(id, index) {
+      // 保存超级会员优惠券
+      if (id) {
+        try {
+          await delCoupon(id)
+        } catch (error) {
+          console.log(error)
+        }
+      }
+      this.form.formList.splice(index, 1)
+    },
+    handleOnInputBlur(formItem) {
+      // 商品排序
+      formItem.associateList.sort(this.sortByEnent('sort'))
+    },
+    sortByEnent(i) {
+      // 排序
+      return function(a, b) {
+        return a[i] - b[i] //  a[i] - b[i]为正序,倒叙为  b[i] - a[i]
+      }
+    },
+    handlePcStatusChange(row) {
+      // PC状态开启关闭
+      console.log('row', row)
+      if (row.pcStatus === '0') {
+        row.pcStatus = '1'
+      } else {
+        row.pcStatus = '0'
+      }
+    },
+    handleAppStatusChange(row) {
+      // 小程序状态开启关闭
+      if (row.appletsStatus === '0') {
+        row.appletsStatus = '1'
+      } else {
+        row.appletsStatus = '0'
+      }
+    },
+    disabled3(array) {
+      if (array && array.length >= 2) {
+        return false
+      } else {
+        return true
+      }
+    },
+    // 上传图标事件
+    handleSuccess(response, file) {
+      this.loadImgLoading = true
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.temp.classifyImage = response.data
+        }, 1000 * 2)
+      })
+    },
+    // 对上传图片的大小、格式进行限制
+    beforeUpload(file) {
+      const isJPG = file.type === 'image/jpeg'
+      const isJPG2 = file.type === 'image/jpg'
+      const isPNG = file.type === 'image/png'
+      const isLt5M = file.size / 1024 / 1024 < 5
+      if (!isJPG && !isJPG2 && !isPNG) {
+        this.$message.error('只支持jpg或png格式图片')
+      }
+      if (!isLt5M) {
+        this.$message.error('请上传5MB以内的图片!')
+      }
+      return (isJPG || isJPG2 || isPNG) && isLt5M
+    },
+    reloadImage() {
+      this.loadImgLoading = true
+      setTimeout(() => {
+        this.temp.classifyImage = this.temp.classifyImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
+      }, 1000 * 2)
+    },
+    loadSucess() {
+      this.loadImgLoading = false
+    }
+  }
+}
+</script>
+
+<style>
+.avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    float: left;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 148px;
+    height: 148px;
+    line-height: 148px;
+    text-align: center;
+  }
+  .avatar {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .avatar img {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .el-form-item__label{
+      text-align: right !important;
+  }
+  .form-el-upload{
+    width: 150px;
+  }
+  .el-upload__tip{
+    line-height: 20px;
+    color: red;
+    text-align: left;
+    position: absolute;
+    right: -50%;
+    bottom: 0;
+  }
+  .span_tip{
+    font-size: 12px;
+    color: red;
+    margin-left: 5px;
+  }
+  .filter-item-temp{
+    width: 100px;
+  }
+</style>

+ 189 - 0
src/views/campaign/components/activity/index.vue

@@ -0,0 +1,189 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>主题:</span>
+        <el-input
+          v-model="listQuery.productId"
+          placeholder="请输入活动主题"
+          clearable
+          @input="e => (listQuery.productId= checkedInput(e,1))"
+          @keyup.enter.native="getList"
+          @clear="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <span>状态:</span>
+        <el-select v-model="listQuery.status" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="请选择" />
+          <el-option :value="0" label="已上线" />
+          <el-option :value="1" label="已下线" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+        <el-button type="primary" icon="el-icon-plus" @click="handleToEdit('add')">添加活动</el-button>
+      </div>
+    </div>
+    <p style="margin: 0;line-height: 24px;font-size: 14px;color: #999;">注:专题仅支持一个已启用状态的活动。</p>
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      element-loading-text="Loading"
+      border
+      fit
+      highlight-current-row
+      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
+    >
+      <el-table-column label="分类名称" align="center" prop="classifyName" />
+      <el-table-column label="活动入口图片" align="center" prop="classifyImage">
+        <template slot-scope="{row}">
+          <el-popover
+            placement="top-start"
+            title=""
+            width="530"
+            trigger="hover"
+          >
+            <img :src="row.classifyImage" alt="" style="width:500px;height:200px;">
+            <img slot="reference" :src="row.classifyImage" alt="" style="width:200px;height:50px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="排序值" align="center" prop="sort">
+        <template slot-scope="{row}">
+          <el-input-number v-model="row.sort" controls-position="right" :min="1" :max="999" :maxlength="3" size="mini" style="width:65px;" />
+        </template>
+      </el-table-column>
+      <el-table-column class-name="status-col" label="状态" align="center" prop="status" width="100">
+        <template slot-scope="{row}">
+          <el-tooltip :content="row.status*1 === 1 ? '停用' : '启用'" placement="top">
+            <el-switch
+              v-model="row.status"
+              active-value="1"
+              inactive-value="0"
+              @change="changeStatus(row.id, row.status)"
+            />
+          </el-tooltip>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="添加时间" prop="addTime">
+        <template slot-scope="{row}">
+          <span>{{ row.addTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="handleToEdit('edit',row.id)">编辑</el-button>
+          <el-button type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
+
+  </div>
+</template>
+
+<script>
+import { getCategory, switchClassify, saveCategorySort } from '@/api/goods-classify'
+import Pagination from '@/components/Pagination'
+
+export default {
+  components: { Pagination },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'danger'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      list: null,
+      listLoading: true,
+      total: 0,
+      listQuery: {
+        index: 1,
+        pageSize: 20,
+        organizeID: this.$store.getters.organizeId
+      }
+    }
+  },
+  computed: {
+    organizeID() {
+      return this.$store.getters.organizeId
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.listLoading = true
+      getCategory(this.listQuery).then(response => {
+        this.list = response.data.results
+        this.total = response.data.totalRecord
+        this.listLoading = false
+      })
+    },
+    changeStatus(id, status) {
+      const confirmTxt = '确定要' + (status * 1 === 1 ? '启用' : '停用') + '该分类吗?'
+      this.$confirm(confirmTxt).then(_ => {
+        this.confirmChange(id)
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    confirmChange(id) {
+      switchClassify({ id: id }).then(() => {
+        this.getList()
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    batchSaveSort() {
+      const sorts = []
+      this.list.map(item => {
+        if (item.sort) {
+          sorts.push(item.id + '-' + Math.abs(item.sort))
+        }
+      })
+      saveCategorySort({ newProducSorttList: sorts.join(',') }).then(response => {
+        this.$message({ message: response.msg, type: 'success', center: true })
+        this.getList()
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    // 跳转添加/编辑
+    handleToEdit(type, id) {
+      if (type === 'add') {
+        this.$router.push({ path: '/campaign/special-edit', query: { type: type }})
+      } else {
+        this.$router.push({ path: '/campaign/special-edit', query: { type: type, id: id }})
+      }
+    }
+  }
+}
+
+</script>
+<style>
+.el-input-number.is-controls-right .el-input__inner {
+    padding-left: 5px;
+    padding-right: 30px;
+}
+</style>
+<style lang="scss" scoped>
+.filter-title{
+  float: left;
+  font-size: 12px;
+  line-height: 18px;
+  text-align: left;
+  color: #2E3748;
+}
+.filter-title p{
+  margin:10px 0;
+}
+</style>

+ 202 - 0
src/views/campaign/components/banner/index.vue

@@ -0,0 +1,202 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>主题:</span>
+        <el-input
+          v-model="listQuery.bannerName"
+          placeholder="请输入主题"
+          clearable
+          @keyup.enter.native="getList"
+          @clear="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <span>状态:</span>
+        <el-select v-model="listQuery.status" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option :value="1" label="已上线" />
+          <el-option :value="0" label="已下线" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-search" @click="handleOnInputBlur(formItem,index)">查询</el-button>
+        <el-button type="primary" icon="el-icon-sort" @click="getList">一键排序</el-button>
+        <el-button type="primary" icon="el-icon-plus" @click="handleToEdit('add')">添加轮播图</el-button>
+      </div>
+    </div>
+    <p style="margin: 0;line-height: 24px;font-size: 14px;color: #999;">注:排序值越小越靠前</p>
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      element-loading-text="Loading"
+      border
+      fit
+      highlight-current-row
+      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
+    >
+      <el-table-column label="主题名称" align="center" prop="bannerName" />
+      <el-table-column label="轮播图" align="center" prop="bannerImage" width="200">
+        <template slot-scope="{row}">
+          <el-popover
+            placement="top-start"
+            title=""
+            width="530"
+            trigger="hover"
+          >
+            <img :src="row.bannerImage" alt="" style="width:500px;height:200px;">
+            <img slot="reference" :src="row.bannerImage" alt="" style="width:120px;height:50px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="排序" align="center" prop="sort" width="100">
+        <template slot-scope="{row}">
+          <el-input-number v-model="row.sort" controls-position="right" :min="1" :max="999" :maxlength="3" size="mini" style="width:65px;" @change="handleSort(row)" />
+        </template>
+      </el-table-column>
+      <el-table-column class-name="status-col" label="状态" align="center" prop="status">
+        <template slot-scope="{row}">
+          <el-tag v-if="row.enabledStatus===0" type="danger" size="small">已下线</el-tag>
+          <el-tag v-else type="success" size="small">已上线</el-tag>
+          <el-button v-if="row.enabledStatus === 0" type="primary" size="mini" @click="handleShangeStatus(row.id,row.enabledStatus)">上线</el-button>
+          <el-button v-else type="primary" size="mini" @click="handleShangeStatus(row.id)">下线</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="创建时间" prop="addTime">
+        <template slot-scope="{row}">
+          <span>{{ row.addTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="handleToEdit('edit',row.id)">编辑</el-button>
+          <el-button type="danger" size="mini" @click="handleDelete(row.id)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
+
+  </div>
+</template>
+
+<script>
+import { getBannerList, getBannerStatus, getBannerSort, delPageBanner } from '@/api/campaign'
+import Pagination from '@/components/Pagination'
+
+export default {
+  components: { Pagination },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'danger'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      list: null,
+      listLoading: true,
+      total: 0,
+      listQuery: {
+        index: 1,
+        pageSize: 20,
+        enabledStatus: '',
+        organizeId: this.$store.getters.organizeId
+      }
+    }
+  },
+  computed: {
+
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 获取轮播图列表
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getBannerList(this.listQuery)
+        this.list = res.data.results
+        this.total = res.data.totalRecord
+        this.listLoading = false
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 操作上下线
+    handleShangeStatus(id, status) {
+      let confirmTxt = ''
+      if (status === 1) {
+        confirmTxt = '确定下线该banner图吗?下线后将从小程序隐藏。'
+      } else {
+        confirmTxt = '确定上线该banner图吗?上线后将重新在小程序显示。'
+      }
+      this.$confirm(confirmTxt).then(_ => {
+        this.getBannerStatus(id)
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    // 上下线轮播图
+    async getBannerStatus(id) {
+      try {
+        await getBannerStatus(id)
+        this.$message({ message: '操作成功', type: 'success', center: true })
+        this.getList()
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 修改排序
+    async handleSort(row) {
+      try {
+        await getBannerSort(row.id, row.sort)
+        this.getList()
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 删除轮播图
+    async handleDelete(id) {
+      try {
+        await delPageBanner(id)
+        this.$message({ message: '操作成功', type: 'success', center: true })
+        this.getList()
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 跳转添加/编辑
+    handleToEdit(type, id) {
+      if (type === 'add') {
+        this.$router.push({ path: '/campaign/banner-edit', query: { type: type }})
+      } else {
+        this.$router.push({ path: '/campaign/banner-edit', query: { type: type, id: id }})
+      }
+    }
+  }
+}
+
+</script>
+<style>
+.el-input-number.is-controls-right .el-input__inner {
+    padding-left: 5px;
+    padding-right: 30px;
+}
+</style>
+<style lang="scss" scoped>
+.filter-title{
+  float: left;
+  font-size: 12px;
+  line-height: 18px;
+  text-align: left;
+  color: #2E3748;
+}
+.filter-title p{
+  margin:10px 0;
+}
+</style>

+ 162 - 0
src/views/campaign/components/category/index.vue

@@ -0,0 +1,162 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-sort" @click="handleOnInputBlur(formItem,index)">一键排序</el-button>
+        <el-button type="primary" icon="el-icon-plus" @click="handleToEdit('add')">添加菜单</el-button>
+      </div>
+    </div>
+    <p style="margin: 0;line-height: 24px;font-size: 14px;color: #999;">注:1. 最多支持8个已启用的菜单      2. 排序值越小越靠前</p>
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      element-loading-text="Loading"
+      border
+      fit
+      highlight-current-row
+      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
+    >
+      <el-table-column label="分类名称" align="center" prop="classifyName" />
+      <el-table-column label="分类图标" align="center" prop="classifyImage">
+        <template slot-scope="{row}">
+          <img :src="row.classifyImage" alt="" width="50">
+        </template>
+      </el-table-column>
+      <el-table-column label="排序值" align="center" prop="sort">
+        <template slot-scope="{row}">
+          <el-input-number v-model="row.sort" controls-position="right" :min="1" :max="999" :maxlength="3" size="mini" style="width:65px;" />
+        </template>
+      </el-table-column>
+      <el-table-column class-name="status-col" label="状态" align="center" prop="status" width="100">
+        <template slot-scope="{row}">
+          <el-tooltip :content="row.status*1 === 1 ? '停用' : '启用'" placement="top">
+            <el-switch
+              v-model="row.status"
+              active-value="1"
+              inactive-value="0"
+              @change="changeStatus(row.id, row.status)"
+            />
+          </el-tooltip>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="添加时间" prop="addTime">
+        <template slot-scope="{row}">
+          <span>{{ row.addTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="handleToEdit('edit',row.id)">编辑</el-button>
+          <el-button type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
+
+  </div>
+</template>
+
+<script>
+import { getCategory, switchClassify, saveCategorySort } from '@/api/goods-classify'
+import Pagination from '@/components/Pagination'
+
+export default {
+  components: { Pagination },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'danger'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      list: null,
+      listLoading: true,
+      total: 0,
+      listQuery: {
+        index: 1,
+        pageSize: 20,
+        organizeID: this.$store.getters.organizeId
+      }
+    }
+  },
+  computed: {
+    organizeID() {
+      return this.$store.getters.organizeId
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.listLoading = true
+      getCategory(this.listQuery).then(response => {
+        this.list = response.data.results
+        this.total = response.data.totalRecord
+        this.listLoading = false
+      })
+    },
+    changeStatus(id, status) {
+      const confirmTxt = '确定要' + (status * 1 === 1 ? '启用' : '停用') + '该分类吗?'
+      this.$confirm(confirmTxt).then(_ => {
+        this.confirmChange(id)
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    confirmChange(id) {
+      switchClassify({ id: id }).then(() => {
+        this.getList()
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    batchSaveSort() {
+      const sorts = []
+      this.list.map(item => {
+        if (item.sort) {
+          sorts.push(item.id + '-' + Math.abs(item.sort))
+        }
+      })
+      saveCategorySort({ newProducSorttList: sorts.join(',') }).then(response => {
+        this.$message({ message: response.msg, type: 'success', center: true })
+        this.getList()
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    // 跳转添加/编辑
+    handleToEdit(type, id) {
+      if (type === 'add') {
+        this.$router.push({ path: '/campaign/category-edit', query: { type: type }})
+      } else {
+        this.$router.push({ path: '/campaign/category-edit', query: { type: type, id: id }})
+      }
+    }
+  }
+}
+
+</script>
+<style>
+.el-input-number.is-controls-right .el-input__inner {
+    padding-left: 5px;
+    padding-right: 30px;
+}
+</style>
+<style lang="scss" scoped>
+.filter-title{
+  float: left;
+  font-size: 12px;
+  line-height: 18px;
+  text-align: left;
+  color: #2E3748;
+}
+.filter-title p{
+  margin:10px 0;
+}
+</style>

+ 152 - 0
src/views/campaign/components/good-dialog.vue

@@ -0,0 +1,152 @@
+<template>
+  <el-dialog
+    title="选择商品"
+    :visible.sync="visible"
+    width="1100px"
+    :close-on-click-modal="false"
+    :show-close="false"
+  >
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>商品名称:</span>
+        <el-input
+          v-model="listQuery.productName"
+          placeholder="商品名称"
+          clearable
+          @input="e => (listQuery.name= checkedInput(e,2))"
+        />
+      </div>
+      <div class="filter-control">
+        <span>供应商名称:</span>
+        <el-input
+          v-model="listQuery.shopName"
+          placeholder="供应商名称"
+          clearable
+          style="width:160px;"
+          @input="e => (listQuery.shopName= checkedInput(e,2))"
+        />
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" @click="getList">查询</el-button>
+      </div>
+    </div>
+    <el-table ref="table" v-loading="isLoading" :data="list" height="400px" border @select="handleSelect">
+      <el-table-column type="selection" width="50" />
+      <el-table-column prop="mainImage" label="商品图片" align="center" width="100">
+        <template slot-scope="{ row }">
+          <el-popover
+            placement="top-start"
+            title=""
+            width="180"
+            trigger="hover"
+          >
+            <img :src="row.mainImage" alt="" style="width:100px;height:100px;">
+            <img slot="reference" :src="row.mainImage" alt="" style="width:50px;height:50px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column prop="productName" label="商品名称" align="center" />
+      <el-table-column prop="shopName" label="供应商" align="center" width="250" />
+    </el-table>
+    <!-- 页码 -->
+    <pagination
+      :total="total"
+      :page-sizes="[20]"
+      :page-size="20"
+      :page.sync="listQuery.index"
+      :limit.sync="listQuery.pageSize"
+      @pagination="getList"
+    />
+    <div slot="footer">
+      <el-button @click="handleCanle">取 消</el-button>
+      <el-button type="primary" :disabled="disabled" @click="handleAddProConfirm(productRadio)">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getList } from '@/api/goods'
+
+export default {
+  name: 'ProDialog',
+  filters: {
+    NumFormat(value) {
+      // 处理金额
+      return Number(value).toFixed(2)
+    }
+  },
+  data() {
+    return {
+      visible: true,
+      listQuery: {
+        productId: '', // 商品id
+        productName: '', // 商品名称
+        shopName: '', // 供应商名称
+        index: 1,
+        pageSize: 20
+      },
+      list: [],
+      total: 0,
+      productRadio: null,
+      isLoading: true
+    }
+  },
+  computed: {
+    disabled() {
+      return this.productRadio === null
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      // 获取商品列表
+      try {
+        this.isLoading = true
+        const res = await getList(this.listQuery)
+        console.log('res', res)
+        this.list = res.data.results
+        this.total = res.data.totalRecord
+        this.isLoading = false
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 选择商品
+    handleSelect(selection, row) {
+      this.$refs.table.clearSelection()
+      this.$refs.table.toggleRowSelection(row)
+      this.productRadio = row
+    },
+    handleAddProConfirm() {
+      // 确认选择商品
+      this.productRadio.pcStatus = '1'
+      this.productRadio.appletsStatus = '1'
+      this.productRadio.sort = 1
+      this.$emit('confirm', this.productRadio)
+    },
+    handleCanle() {
+      // 取消弹窗
+      this.$emit('cancel')
+    },
+    checkedInput(event, type) {
+      let pattern = ''
+      switch (type) {
+        case 1:
+          pattern = /[^\d]/g
+          break
+        case 2:
+          pattern = /[^u4E00-u9FA5|d|a-zA-Z|rns,.?!,。?!…—&$=()-+/*{}[]]|s/g
+          break
+      }
+      return event.replace(pattern, '')
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+::v-deep{
+  thead .el-checkbox{display: none !important;}
+}
+</style>

+ 154 - 0
src/views/campaign/components/good-multi-dialog.vue

@@ -0,0 +1,154 @@
+<template>
+  <el-dialog
+    title="选择商品"
+    :visible.sync="visible"
+    width="1100px"
+    :close-on-click-modal="false"
+    :show-close="false"
+  >
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>商品ID:</span>
+        <el-input
+          v-model="listQuery.productId"
+          placeholder="商品ID"
+          clearable
+          @input="e => (listQuery.productId= checkedInput(e,1))"
+        />
+      </div>
+      <div class="filter-control">
+        <span>商品名称:</span>
+        <el-input
+          v-model="listQuery.name"
+          placeholder="商品名称"
+          clearable
+          @input="e => (listQuery.name= checkedInput(e,2))"
+        />
+      </div>
+      <div class="filter-control">
+        <span>供应商名称:</span>
+        <el-input
+          v-model="listQuery.shopName"
+          placeholder="供应商名称"
+          clearable
+          style="width:160px;"
+          @input="e => (listQuery.shopName= checkedInput(e,2))"
+        />
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" @click="getList">查询</el-button>
+      </div>
+    </div>
+    <el-table ref="table" v-loading="isLoading" :data="list" height="400px" border @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="50" />
+      <el-table-column prop="productId" label="商品ID" align="center" width="80" />
+      <el-table-column prop="coupon" label="商品图片" align="center" width="100">
+        <template v-if="row.productId" slot-scope="{ row }">
+          <el-popover
+            placement="top-start"
+            title=""
+            width="180"
+            trigger="hover"
+          >
+            <img :src="row.mainImage" alt="" style="width:100px;height:100px;">
+            <img slot="reference" :src="row.mainImage" alt="" style="width:50px;height:50px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column prop="name" label="商品名称" align="center" />
+      <el-table-column prop="shopName" label="供应商" align="center" width="250" />
+    </el-table>
+    <!-- 页码 -->
+    <pagination
+      :total="total"
+      :page-sizes="[20]"
+      :page-size="20"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="getList"
+    />
+    <div slot="footer">
+      <el-button @click="handleCanle">取 消</el-button>
+      <el-button type="primary" :disabled="disabled" @click="handleAddProConfirm(productRadio)">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getList } from '@/api/goods'
+
+export default {
+  name: 'ProDialog',
+  filters: {
+    NumFormat(value) {
+      // 处理金额
+      return Number(value).toFixed(2)
+    }
+  },
+  data() {
+    return {
+      visible: true,
+      listQuery: {
+        productId: '', // 商品id
+        name: '', // 商品名称
+        shopName: '', // 供应商名称
+        pageNum: 1,
+        pageSize: 20
+      },
+      list: [],
+      total: 0,
+      productRadio: null,
+      isLoading: true
+    }
+  },
+  computed: {
+    disabled() {
+      return this.productRadio === null
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 商品列表
+    async getList() {
+      this.isLoading = true
+      const res = await getList(this.listQuery)
+      this.list = res.data.results
+      this.total = res.data.totalRecord
+      this.isLoading = false
+    },
+    // 多选商品
+    handleSelectionChange(row) {
+      this.productRadio = row
+      console.log('row', row)
+    },
+    handleAddProConfirm() {
+      // 确认选择商品
+      this.productRadio.pcStatus = '1'
+      this.productRadio.appletsStatus = '1'
+      this.productRadio.sort = 1
+      this.$emit('confirm', this.productRadio)
+    },
+    handleCanle() {
+      // 取消弹窗
+      this.$emit('cancel')
+    },
+    checkedInput(event, type) {
+      let pattern = ''
+      switch (type) {
+        case 1:
+          pattern = /[^\d]/g
+          break
+        case 2:
+          pattern = /[^u4E00-u9FA5|d|a-zA-Z|rns,.?!,。?!…—&$=()-+/*{}[]]|s/g
+          break
+      }
+      return event.replace(pattern, '')
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 58 - 0
src/views/campaign/list.vue

@@ -0,0 +1,58 @@
+<template>
+  <div class="app-container">
+    <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
+      <el-tab-pane label="轮播图区" name="first" />
+      <el-tab-pane label="主菜单区" name="second" />
+      <el-tab-pane label="专题活动" name="three" />
+      <template v-if="activeName === 'first'">
+        <banner v-if="activeName === 'first'" />
+      </template>
+      <template v-if="activeName === 'second'">
+        <category v-if="activeName === 'second'" />
+      </template>
+      <template v-if="activeName === 'three'">
+        <activity v-if="activeName === 'three'" />
+      </template>
+    </el-tabs>
+  </div>
+</template>
+<script>
+import banner from './components/banner/index.vue'
+import category from './components/category/index.vue'
+import activity from './components/activity/index.vue'
+
+export default {
+  name: 'CampaignList',
+  components: {
+    banner,
+    category,
+    activity
+  },
+  data() {
+    return {
+      activeName: 'first'
+    }
+  },
+  computed: {
+
+  },
+  created() {
+
+  },
+  methods: {
+    // tab切换
+    handleClick(tab, event) {
+      console.log('name', tab.name)
+    }
+  }
+}
+</script>
+
+<style>
+.el-span-zero {
+  color: #0bd81c;
+}
+.el-span-one {
+  color: #ff353f;
+}
+</style>

+ 465 - 0
src/views/campaign/special-edit.vue

@@ -0,0 +1,465 @@
+<template>
+  <div class="app-container" style="width: 800px;margin: 0 auto;">
+    <el-form ref="bannerForm" :model="form" label-width="100px">
+      <el-form-item label="主题:" prop="name" :rules="rules.name">
+        <el-input v-model="form.name" placeholder="请输入活动主题" style="width: 250px;" />
+      </el-form-item>
+      <el-form-item label="轮播图:" prop="banner" :rules="rules.banner">
+        <div class="form-el-upload">
+          <el-upload
+            class="avatar-uploader"
+            :action="actionUrl"
+            :headers="getToken"
+            :show-file-list="false"
+            :on-success="handleSuccess"
+            :before-upload="beforeUpload"
+          >
+            <div v-loading="loadImgLoading" class="avatar">
+              <img v-if="form.banner" :src="form.banner" @error="reloadImage" @load="loadSucess">
+              <i v-else class="el-icon-plus avatar-uploader-icon" />
+            </div>
+          </el-upload>
+        </div>
+      </el-form-item>
+      <el-form-item label="排序:" prop="sort" :rules="rules.sort">
+        <el-input v-model="form.sort" style="width: 200px" />
+      </el-form-item>
+      <el-form-item label="状态:" prop="status" :rules="rules.status">
+        <el-select v-model="form.status" placeholder="请选择">
+          <el-option label="上线" :value="1" />
+          <el-option label="下线" :value="0" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="跳转:" prop="jumpType" :rules="rules.jumpType">
+        <el-radio-group v-model="form.jumpType">
+          <el-radio :label="1">单个商品详情</el-radio>
+          <el-radio :label="2">活动列表</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <template v-if="form.jumpType === 1">
+        <el-form-item label="商品信息" prop="productId" :rules="rules.productId">
+          <template v-if="productData && productData.length === 0">
+            <el-button type="primary" autofocussize="mini" size="mini" icon="el-icon-plus" @click="handleDialogVisible">选择商品</el-button>
+            <el-checkbox-group v-show="false" v-model="form.productId" />
+          </template>
+          <template v-else>
+            <el-table :data="productData" border width="1000">
+              <el-table-column property="mainImage" label="商品图片" align="center" width="80">
+                <template slot-scope="{ row }">
+                  <el-popover
+                    placement="top-start"
+                    title=""
+                    width="180"
+                    trigger="hover"
+                  >
+                    <img :src="row.mainImage" alt="" style="width:150px;height:150px;">
+                    <img slot="reference" :src="row.mainImage" alt="" style="width:30px;height:30px;">
+                  </el-popover>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productName" label="商品名称" align="center" width="300" />
+              <el-table-column prop="validFlag" label="商品状态" align="center" width="150">
+                <template slot-scope="{row}">
+                  <el-tag :type="row.validFlag | statusFilter">{{ row.validFlag*1 === 1 ? '已上架' : '已下架' }}</el-tag>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center">
+                <el-button type="text" @click="deleteShop">删除</el-button>
+              </el-table-column>
+            </el-table>
+          </template>
+        </el-form-item>
+      </template>
+      <template v-if="form.jumpType === 2">
+        <el-form-item label="选择活动:" prop="actId" :rules="rules.actId">
+          <el-select v-model="form.actId" clearable>
+            <el-option
+              v-for="item in activityList"
+              :key="item.actId"
+              :label="item.name"
+              :value="item.actId"
+            />
+          </el-select>
+        </el-form-item>
+      </template>
+    </el-form>
+    <div class="el-dialog__footer" style="text-align: center;">
+      <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+    </div>
+    <!-- 商品弹框 -->
+    <good-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
+  </div>
+</template>
+
+<script>
+import { getClubList, createOperator, updateStatus } from '@/api/club'
+import goodDialog from './components/good-dialog'
+const defaultForm = () => {
+  return {
+    shopId: 0,
+    shopData: [],
+    couponType: 0,
+    couponAmount: '',
+    touchPrice: '',
+    productType: '1',
+    categoryType: '1',
+    associateList: []// 指定商品信息
+  }
+}
+export default {
+  name: 'BannerEdit',
+  components: { goodDialog },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'warning'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      form: {
+        name: '',
+        banner: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+        sort: 0,
+        status: 1,
+        jumpType: null,
+        actId: '',
+        productId: null
+      },
+      activityList: [
+        {
+          actId: 1,
+          name: '活动主题1'
+        },
+        {
+          actId: 2,
+          name: '活动主题2'
+        }
+      ],
+      productData: [
+        {
+          mainImage: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+          productName: 'Twinkle 水婴肌 美白 补水 紧致 无创水光',
+          shopName: '雅光博睿医药科技(广东)有限公司',
+          unit: '20ML',
+          costPrice: '50000.00',
+          price: '50000.00',
+          addTime: '2023-04-14 14:45:39',
+          validFlag: 1
+        }
+      ],
+      formParams: {
+        id: '',
+        month: '',
+        endMonth: '',
+        status: '',
+        configure: 1, // 专属优惠券配置  1是、0否
+        coupons: []
+      },
+      editType: 'add',
+      // 商品列表
+      dialogVisible: false,
+      loadImgLoading: false,
+      rules: {
+        name: [{ required: true, message: '请填写活动主题', trigger: 'blur' }],
+        banner: [{ required: true, message: '请上传轮播图', trigger: 'blur' }],
+        productId: [{ required: true, type: 'array', message: '请添加一个商品', trigger: ['change'] }],
+        sort: [{ required: true, message: '排序值不能为空', trigger: 'blur' }],
+        status: [{ required: true, message: '请选择状态', trigger: 'blur' }],
+        jumpType: [{ required: true, message: '请选择跳转类型', trigger: 'blur' }],
+        actId: [{ required: true, message: '请选择活动列表', trigger: 'blur' }]
+      },
+      delFlag: false
+    }
+  },
+  computed: {
+    disabled() {
+      return this.form.formList.length === 5
+    },
+    disabled1() {
+      return this.form.formList.length === 1
+    },
+    getToken() {
+      return {
+        'token': this.$store.getters.token
+      }
+    },
+    actionUrl() {
+      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
+    }
+  },
+  created() {
+    this.editType = this.$route.query.type || 'edit'
+    console.log('editType', this.editType)
+    // this.initForm(this.editType)
+  },
+  methods: {
+    initForm(type) {
+      if (type === 'add') {
+        console.log('add')
+        this.svipCoupon(type, 1, 0)
+      } else {
+        console.log('edit')
+        this.svipCoupon(type, 0, this.$route.query.id)
+      }
+    },
+    async svipCoupon(type, configure, id) {
+      const res = await svipCoupon({ id: id, configure: configure })
+      const data = res.data.svipcouponForm
+      this.formParams = { ...this.formParams, ...data }
+      if (data.coupons.length > 0) {
+        this.delFlag = true
+        this.form.formList = data.coupons.map((el) => {
+          el = { ...el, ...this.defaultShop }
+          if (el.shop) {
+            el.shopData.push(el.shop)
+          }
+          return el
+        })
+        console.log('formList', this.form.formList)
+      } else {
+        for (let i = 0; i <= 2; i++) {
+          this.form.formList.push(defaultForm())
+        }
+      }
+    },
+    // 显示选择商品弹窗
+    handleDialogVisible() {
+      this.dialogVisible = true
+    },
+    handleGoodDialogVisible(index) {
+      // 显示选择商品弹窗
+      this.addIndex = index
+      this.dialogGoodVisible = true
+    },
+    deleteShop() {
+      // 清除供应商
+      this.form.productId = ''
+      this.productData = []
+    },
+    handleGoodConfirm(data) {
+      // 确认选择商品
+      const from = this.form.formList[this.addIndex]
+      from.associateList.push(data)
+      console.log('from', this.form.formList)
+      this.handleGoodCancel()
+    },
+    handleDeletePros(formItem, index) {
+      // 删除商品
+      this.$confirm('确定删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        formItem.associateList.splice(index, 1)
+      })
+    },
+    onSubmit(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          this.handleFormParams()
+          this.$confirm('是否提交数据', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            console.log('formParams', this.formParams)
+            if (this.editType === 'add') {
+              this.formParams.configure = 1
+            } else {
+              this.formParams.configure = 0
+            }
+            this.saveVipCoupon(this.formParams)
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    handleFormParams() {
+      // 处理参数
+      this.formParams.coupons = this.form.formList.map((el) => {
+        if (el.associateList && el.associateList.length > 0) {
+          el.associateList = el.associateList.map((pro) => {
+            return {
+              sort: pro.sort,
+              pcStatus: pro.pcStatus,
+              appletsStatus: pro.appletsStatus,
+              name: pro.name,
+              shopName: pro.shopName,
+              mainImage: pro.mainImage,
+              productId: pro.productId
+            }
+          })
+        }
+        return el
+      })
+    },
+    async saveVipCoupon(params) {
+      // 保存超级会员优惠券
+      await saveVipCoupon(params)
+      this.$message.success('保存成功')
+      setTimeout(() => {
+        this.$router.push({ path: '/member/coupon/list' })
+      }, 1000)
+    },
+    // 取消选择商品
+    handleGoodCancel() {
+      this.dialogVisible = false
+      this.$refs.goodDialog.visible = false
+    },
+    handleAddList() {
+      // 新增优惠券
+      this.form.formList.push(defaultForm())
+    },
+    handleDelete(item, index) {
+      // 删除单挑优惠券
+      this.$confirm('确定删除此优惠券吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (this.delFlag) {
+          this.delCoupon(item.id, index)
+        } else {
+          this.form.formList.splice(index, 1)
+        }
+      })
+    },
+    async delCoupon(id, index) {
+      // 保存超级会员优惠券
+      if (id) {
+        try {
+          await delCoupon(id)
+        } catch (error) {
+          console.log(error)
+        }
+      }
+      this.form.formList.splice(index, 1)
+    },
+    handleOnInputBlur(formItem) {
+      // 商品排序
+      formItem.associateList.sort(this.sortByEnent('sort'))
+    },
+    sortByEnent(i) {
+      // 排序
+      return function(a, b) {
+        return a[i] - b[i] //  a[i] - b[i]为正序,倒叙为  b[i] - a[i]
+      }
+    },
+    handlePcStatusChange(row) {
+      // PC状态开启关闭
+      console.log('row', row)
+      if (row.pcStatus === '0') {
+        row.pcStatus = '1'
+      } else {
+        row.pcStatus = '0'
+      }
+    },
+    handleAppStatusChange(row) {
+      // 小程序状态开启关闭
+      if (row.appletsStatus === '0') {
+        row.appletsStatus = '1'
+      } else {
+        row.appletsStatus = '0'
+      }
+    },
+    disabled3(array) {
+      if (array && array.length >= 2) {
+        return false
+      } else {
+        return true
+      }
+    },
+    // 上传图标事件
+    handleSuccess(response, file) {
+      this.loadImgLoading = true
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.temp.classifyImage = response.data
+        }, 1000 * 2)
+      })
+    },
+    // 对上传图片的大小、格式进行限制
+    beforeUpload(file) {
+      const isJPG = file.type === 'image/jpeg'
+      const isJPG2 = file.type === 'image/jpg'
+      const isPNG = file.type === 'image/png'
+      const isLt5M = file.size / 1024 / 1024 < 5
+      if (!isJPG && !isJPG2 && !isPNG) {
+        this.$message.error('只支持jpg或png格式图片')
+      }
+      if (!isLt5M) {
+        this.$message.error('请上传5MB以内的图片!')
+      }
+      return (isJPG || isJPG2 || isPNG) && isLt5M
+    },
+    reloadImage() {
+      this.loadImgLoading = true
+      setTimeout(() => {
+        this.temp.classifyImage = this.temp.classifyImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
+      }, 1000 * 2)
+    },
+    loadSucess() {
+      this.loadImgLoading = false
+    }
+  }
+}
+</script>
+
+<style>
+.avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    float: left;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 148px;
+    height: 148px;
+    line-height: 148px;
+    text-align: center;
+  }
+  .avatar {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .avatar img {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .el-form-item__label{
+      text-align: right !important;
+  }
+  .form-el-upload{
+    width: 150px;
+  }
+  .el-upload__tip{
+    line-height: 20px;
+    color: red;
+    text-align: left;
+    position: absolute;
+    right: -50%;
+    bottom: 0;
+  }
+  .span_tip{
+    font-size: 12px;
+    color: red;
+    margin-left: 5px;
+  }
+  .filter-item-temp{
+    width: 100px;
+  }
+</style>

+ 314 - 0
src/views/centralized/details.vue

@@ -0,0 +1,314 @@
+<template>
+  <div class="app-container clearfix" style=" width: 1000px;">
+    <h1 class="card-h1">采购商品</h1>
+    <el-card class="box-card">
+      <div class="card-main">
+        <div class="card-img">
+          <el-popover
+            placement="top-end"
+            title=""
+            width="230"
+            trigger="hover"
+          >
+            <img :src="detailsData.prudouct.image" alt="" style="width:200px;height:200px;">
+            <img slot="reference" :src="detailsData.prudouct.image" alt="" style="width:100px;height:100px;">
+          </el-popover>
+        </div>
+        <div class="card-name">
+          <p>{{ detailsData.prudouct.name }}</p>
+        </div>
+      </div></el-card>
+    <h1 class="card-h1">发起者需求</h1>
+    <el-card class="box-card">
+      <div class="card-cell">
+        <div class="card-cell-p">
+          <p><span>发起者:</span>{{ detailsData.initiate.userName }}</p>
+        </div>
+      </div>
+      <div class="card-cell">
+        <div class="card-cell-p">
+          <p><span>期望单价:</span>¥{{ detailsData.initiate.price }}</p>
+        </div>
+        <div class="card-cell-p">
+          <p><span>采购数量:</span>{{ detailsData.initiate.number }}</p>
+        </div>
+      </div>
+      <div v-if="detailsData.initiate.status === 1 || detailsData.initiate.status === 2" class="card-status">
+        <el-tag effect="dark" :type="detailsData.initiate.status === 1 ? 'success' : 'danger'">{{ detailsData.initiate.status === 1 ? '已完成' : '已删除' }}</el-tag>
+      </div>
+    </el-card>
+    <h1 class="card-h1">参与者需求(2)</h1>
+    <el-card v-for="(cell,index) in detailsData.particiList" :key="index" class="box-card" style="margin-bottom: 16px;">
+      <div class="card-cell">
+        <div class="card-cell-p">
+          <p><span>发起者:</span>{{ cell.userName }}</p>
+        </div>
+      </div>
+      <div class="card-cell">
+        <div class="card-cell-p">
+          <p><span>期望单价:</span>¥{{ cell.price }}</p>
+        </div>
+        <div class="card-cell-p">
+          <p><span>采购数量:</span>{{ cell.number }}</p>
+        </div>
+      </div>
+      <div v-if="cell.status === 1 || cell.status === 2" class="card-status">
+        <el-tag effect="dark" :type="cell.status === 1 ? 'success' : 'danger'">{{ cell.status === 1 ? '已完成' : '已删除' }}</el-tag>
+      </div>
+    </el-card>
+  </div>
+</template>
+<script>
+// 引入省市区组件,公共组件所在的路径
+import { addNewClub, saveAddClubUser } from '@/api/club'
+export default {
+  data() {
+    return {
+      userID: this.$route.query.userID,
+      clubID: this.$route.query.clubID,
+      dialogImageUrl: '',
+      dialogVisible: false,
+      isRequest: false,
+      businessImgLoading: false,
+      headImgLoading: false,
+      detailsData: {
+        prudouct: {
+          name: 'CH2天然净化防御精萃净化去味',
+          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
+        },
+        initiate: {
+          userName: '采美信息技术有限公司',
+          price: 400000,
+          number: 100,
+          status: 1
+        },
+        particiList: [
+          {
+            userName: '采美信息技术有限公司',
+            price: 400000,
+            number: 100,
+            status: 0
+          },
+          {
+            userName: '采美信息技术有限公司',
+            price: 400000,
+            number: 100,
+            status: 2
+          },
+          {
+            userName: '采美信息技术有限公司',
+            price: 400000,
+            number: 100,
+            status: 1
+          },
+          {
+            userName: '采美信息技术有限公司',
+            price: 400000,
+            number: 100,
+            status: 0
+          }
+        ]
+      },
+      form: {
+        userName: '采美信息技术有限公司',
+        linkMan: '智捷赵',
+        bindMobile: '158888888888',
+        province: '广东省',
+        city: '深圳市',
+        town: '福田区',
+        address: '广东省深圳市福田区上步南路10001锦峰大厦',
+        clubStatus: 91,
+        contractMobile: '',
+        socialCreditCode: '4305271988665444444444444',
+        headpic: 'https://img0.baidu.com/it/u=178849715,820264547&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+        businessLicenseImage: 'https://img0.baidu.com/it/u=178849715,820264547&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
+      },
+      addList: {
+        provinceID: '',
+        cityID: '',
+        townID: ''
+      },
+      loadingbut: false,
+      loadingbuttext: '保存'
+    }
+  },
+  computed: {
+    getToken() {
+      return {
+        'token': this.$store.getters.token
+      }
+    },
+    organizeID() {
+      return this.$store.getters.organizeId
+    },
+    actionUrl() {
+      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
+    }
+  },
+  created() {
+    // const params = { clubID: this.clubID, userID: this.userID }
+    // this.initClubData(params)
+  },
+  methods: {
+    initClubData(params) {
+      addNewClub(params).then(response => {
+        const resData = response.data
+        const dataObj = {
+          name: resData.name,
+          linkMan: resData.linkMan,
+          contractMobile: resData.contractMobile,
+          socialCreditCode: resData.socialCreditCode,
+          address: resData.address,
+          status: resData.status,
+          firstClubType: resData.firstClubType,
+          headpic: resData.headpic,
+          businessLicenseImage: resData.businessLicenseImage
+        }
+        this.form = Object.assign({}, dataObj)
+        this.addList.province = resData.province
+        this.addList.city = resData.city
+        this.addList.town = resData.town
+        this.addList.provinceID = resData.provinceID
+        this.addList.cityID = resData.cityID
+        this.addList.townID = resData.townID
+        this.isRequest = true
+      }).catch(() => {
+        // 封装静态数据
+      })
+    },
+    onSubmite() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          const Formobj = Object.assign(this.form, { id: this.organizeID, userID: this.userID, clubID: this.clubID })
+          const params = Object.assign(this.addList, Formobj)
+          this.loadingbut = true
+          this.loadingbuttext = '保存中...'
+          saveAddClubUser(params).then(response => {
+            this.loadingbut = false
+            this.loadingbuttext = '保存'
+            this.$message({ message: response.msg, type: 'success', center: true })
+            this.backToList()
+          })
+        }
+      })
+    },
+    backToList() {
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({
+            path: '/club/list'
+          })
+        })
+      })
+    },
+    // 从子组件获取省市区
+    handleCity(data) {
+      this.addList.provinceID = data.provinceid
+      this.addList.cityID = data.cityid
+      this.addList.townID = data.townid
+    },
+    // 上传图标事件
+    handleAvatarSuccess(response, file) {
+      this.businessImgLoading = true
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.form.businessLicenseImage = response.data
+        }, 1000 * 2)
+      })
+    },
+    reloadAvatarImage() {
+      this.businessImgLoading = true
+      setTimeout(() => {
+        this.form.businessLicenseImage = this.form.businessLicenseImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
+      }, 1000 * 2)
+    },
+    loadAvatarSucess() {
+      this.businessImgLoading = false
+    },
+    // 上传图标事件
+    handleDoorwaySuccess(response, file) {
+      this.headImgLoading = true
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.form.headpic = response.data
+        }, 1000 * 2)
+      })
+    },
+    reloadDoorwayImage() {
+      this.headImgLoading = true
+      setTimeout(() => {
+        this.form.headpic = this.form.headpic.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
+      }, 1000 * 2)
+    },
+    loadDoorwaySucess() {
+      this.headImgLoading = false
+    },
+    // 对上传图片的大小、格式进行限制
+    beforeUpload(file) {
+      const isJPG = file.type === 'image/jpeg'
+      const isJPG2 = file.type === 'image/jpg'
+      const isPNG = file.type === 'image/png'
+      const isLt5M = file.size / 1024 / 1024 < 5
+      if (!isJPG && !isJPG2 && !isPNG) {
+        this.$message.error('只支持jpg或png格式图片')
+      }
+      if (!isLt5M) {
+        this.$message.error('请上传5MB以内的图片!')
+      }
+      return (isJPG || isJPG2 || isPNG) && isLt5M
+    }
+  }
+}
+</script>
+<style lang="scss">
+.box-card{
+  position: relative;
+}
+.card-status{
+  position: absolute;
+  top: 50px;
+  right: 20px;
+}
+.card-h1{
+  line-height: 40px;
+  font-size: 16px;
+  color: #303133;
+  font-weight: normal;
+  margin: 0;
+}
+.card-main{
+  width: 100%;
+  height: 100px;
+  .card-img{
+    width: 100px;
+    height: 100px;
+    float: left;
+    border-radius: 4px;
+  }
+  .card-name{
+    height: 100px;
+    float: left;
+    margin-left:16px;
+    line-height: 40px;
+    font-size: 14px;
+    color: #606266;
+  }
+}
+.card-cell{
+  height: 40px;
+  line-height: 40px;
+  .card-cell-p{
+    line-height: 40px;
+    font-size: 14px;
+    color: #606266;
+    float: left;
+    margin-right: 40px;
+    p{
+      margin: 0;
+    }
+    span{
+      color: #909399;
+    }
+  }
+}
+</style>

+ 332 - 0
src/views/centralized/list.vue

@@ -0,0 +1,332 @@
+<template>
+  <div class="app-container">
+    <div class="app-header-search">
+      <el-form class="demo-form-inline">
+        <el-form-item label="商品名称:" style="width:280px;float: left;">
+          <el-input v-model="listQuery.userName" placeholder="请输入商品名称" maxlength="50" style="width:200px;" @keyup.enter.native="handleFilter" />
+        </el-form-item>
+        <el-form-item label="发起机构:" style="width:230px;float: left;">
+          <el-input v-model="listQuery.linkMan" placeholder="请输入发起机构" maxlength="10" style="width:150px" @keyup.enter.native="handleFilter" />
+        </el-form-item>
+        <el-form-item label="手机号:" style="width:200px;float: left;">
+          <el-input v-model="listQuery.bindMobile" placeholder="请输入手机号" maxlength="11" style="width:130px" @keyup.enter.native="handleFilter" />
+        </el-form-item>
+        <el-form-item label="状态:" style="width:190px;float: left;">
+          <el-select v-model="listQuery.clubStatus" placeholder="请选择" style="width:100px" value="" @change="handleFilter">
+            <el-option label="全部" value="" />
+            <el-option label="已完成" value="1" />
+            <el-option label="未完成" value="2" />
+            <el-option label="已删除" value="3" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="发布日期:" style="width:410px;float: left;">
+          <el-date-picker
+            v-model="listQuery.startTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期"
+            style="width: 150px;"
+          />
+          至
+          <el-date-picker
+            v-model="listQuery.endTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期"
+            style="width: 150px;"
+          />
+        </el-form-item>
+        <el-form-item style="width:100px;float: left;">
+          <el-button type="primary" icon="el-icon-search" @click="handleFilter">查询</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      element-loading-text="Loading"
+      border
+      fit
+      highlight-current-row
+      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
+    >
+      <el-table-column label="采购商品" width="220" align="center" prop="name" />
+      <el-table-column label="图片" align="center" width="100">
+        <template slot-scope="{ row }">
+          <el-popover
+            placement="top-start"
+            title=""
+            width="120"
+            trigger="hover"
+          >
+            <img :src="row.image" alt="" style="width:100px;height:100px;">
+            <img slot="reference" :src="row.image" alt="" style="width:50px;height:50px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="发起机构" align="center" prop="clubName" />
+      <el-table-column label="联系人" width="100" align="center" prop="linkMan" />
+      <el-table-column label="手机号" width="140" align="center" prop="bindMobile" />
+      <el-table-column label="参与机构数" width="100" align="center" prop="numb" />
+      <el-table-column label="上线状态" width="150" align="center" prop="status">
+        <template slot-scope="{ row }">
+          <span
+            :class="{
+              'el-span-status': row.status == '0',
+              'el-span-sStatus': row.status == '1',
+              'el-span-eStatus': row.status == '2',
+            }"
+          >
+            {{ row.status | statusFilters }}
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="发布时间" prop="registerTime" width="100">
+        <template slot-scope="{row}">
+          <span>{{ row.registerTime }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="handleDetail(row)">查看资料</el-button>
+          <el-button v-if="row.status === 1" type="warning" size="mini" @click="hanleVerify(row)">置为已完成</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 页码 -->
+    <pagination
+      :total="total"
+      :page-sizes="[20]"
+      :page-size="20"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="getclubList"
+    />
+  </div>
+</template>
+
+<script>
+import { getClubList, createOperator, updateStatus } from '@/api/club'
+import Pagination from '@/components/Pagination'
+
+export default {
+  components: { Pagination },
+  filters: {
+    statusFilters(value) {
+      console.log('value', value)
+      // 处理状态显示
+      const map = {
+        '0': '未完成',
+        '1': '已完成',
+        '2': '已删除'
+      }
+      return map[value]
+    }
+  },
+  data() {
+    return {
+      pageNum: 0,
+      list: [
+        {
+          name: 'CH2天然净化防御精萃净化去味',
+          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+          bindMobile: '158888888888',
+          clubName: '深圳联合丽格宝安店',
+          linkMan: '哈利波特',
+          numb: 10,
+          address: '上步南路10001锦峰大厦',
+          status: 0,
+          registerTime: '2023-04-14 14:45:39',
+          id: 121
+        },
+        {
+          name: 'CH2天然净化防御精萃净化去味',
+          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+          bindMobile: '158888888888',
+          clubName: '深圳联合丽格宝安店',
+          linkMan: '哈利波特',
+          numb: 10,
+          address: '上步南路10001锦峰大厦',
+          status: 1,
+          registerTime: '2023-04-14 14:45:39',
+          id: 121
+        },
+        {
+          name: 'CH2天然净化防御精萃净化去味',
+          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+          bindMobile: '158888888888',
+          clubName: '深圳联合丽格宝安店',
+          linkMan: '哈利波特',
+          numb: 10,
+          address: '上步南路10001锦峰大厦',
+          status: 2,
+          registerTime: '2023-04-14 14:45:39',
+          id: 121
+        },
+        {
+          name: 'CH2天然净化防御精萃净化去味',
+          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+          bindMobile: '158888888888',
+          clubName: '深圳联合丽格宝安店',
+          linkMan: '哈利波特',
+          numb: 10,
+          address: '上步南路10001锦峰大厦',
+          status: 1,
+          registerTime: '2023-04-14 14:45:39',
+          id: 121
+        }
+      ],
+      listLoading: true,
+      total: 0,
+      listQuery: {
+        pageNum: 1,
+        pageSize: 20,
+        userOrganizeID: this.$store.getters.organizeId,
+        userName: '',
+        linkMan: '',
+        bindMobile: '',
+        clubStatus: '',
+        startTime: '',
+        endTime: ''
+      },
+      startTime: '',
+      endTime: '',
+      addPeople: {
+        status: '',
+        text: ''
+      },
+      updateTemp: {},
+      updateTatusType: '',
+      dialogVisible: false,
+      dialogVisibleText: '',
+      dialogStatus: '',
+      loadingbut: false,
+      rules: {
+        linkName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
+        status: [{ required: true, message: '请选择审核状态', trigger: 'blur' }],
+        text: [{ required: true, message: '请填写原因', trigger: 'blur' }],
+        mobile: [
+          { required: true, message: '手机号码不能为空', trigger: 'blur' },
+          {
+            required: true,
+            pattern: /^\d{11}|\d{13}$/,
+            message: '手机号格式不正确',
+            trigger: 'blur'
+          }
+        ]
+      }
+    }
+  },
+  computed: {
+    disabled() {
+      return !this.addPeople.status
+    },
+    organizeID() {
+      return this.$store.getters.organizeId
+    }
+  },
+  created() {
+    this.listLoading = false
+    // this.fetchData()
+  },
+  methods: {
+    fetchData() {
+      this.listLoading = true
+      getClubList(this.listQuery).then(response => {
+        const data = response.data
+        this.list = data.results
+        this.listLoading = false
+        this.total = data.totalRecord
+        this.pageNum = data.index
+      }).catch(() => {
+        // 封装静态数据
+      })
+    },
+    hanleVerify(row) {
+      // 审核
+      this.dialogFormVisible = true
+    },
+    handleEdit(row) { // 添加运营
+      console.log(row)
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.addPeople = Object.assign({}, { clubID: row.clubID, userID: row.userID })
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    handleCreateOperator() { // 保存
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          const Formobj = { userOrganizeID: this.$store.getters.organizeId, configFlag: 1 }
+          const params = Object.assign(Formobj, this.addPeople)
+          this.loadingbut = true
+          createOperator(params).then(response => {
+            this.$message({ message: response.msg, type: 'success', center: true })
+            this.dialogFormVisible = false
+            this.loadingbut = false
+          }).catch(() => {
+            this.loadingbut = false
+          })
+        }
+      })
+    },
+    handOnline(row) {
+      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userOrganizeID: this.$store.getters.organizeId })
+      this.$confirm('确定上线该门店吗?上线后门店负责人可使用账号密码登录小程序。', '系统提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        const params = Object.assign({}, this.updateTemp)
+        this.updateClubStatus(params)
+      }).catch(() => {
+      })
+    },
+    handOffline(row) {
+      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userOrganizeID: this.$store.getters.organizeId })
+      this.$confirm('确定下线该门店吗?下线后该门店将不能在小程序进行采购。', '系统提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        const params = Object.assign({}, this.updateTemp)
+        this.updateClubStatus(params)
+      }).catch(() => {
+      })
+    },
+    updateClubStatus(params) {
+      updateStatus(params).then(response => {
+        if (response.code === '1') {
+          this.$message({ message: response.msg, type: 'success', center: true })
+          this.list = []
+          this.fetchData()
+        } else {
+          this.$message.error(response.msg)
+        }
+      })
+    },
+    handleDetail(row) {
+      this.$router.push({ path: '/centralized/details', query: { id: row.id }})
+    },
+    handleFilter() {
+      this.fetchData()
+    }
+  }
+}
+
+</script>
+<style scoped>
+  .el-dialog{
+    width: 600px;
+  }
+  .el-span-status{
+    color: #606266;
+  }
+  .el-span-sStatus{
+    color: #67C23A;
+  }
+  .el-span-eStatus{
+    color: #F56C6C;
+  }
+</style>

+ 131 - 0
src/views/club/details.vue

@@ -0,0 +1,131 @@
+<template>
+  <div class="app-container clearfix" style=" width: 700px;">
+    <el-form ref="dataForm" :model="form" label-position="left" label-width="130px">
+      <el-form-item label="门店名称:" prop="name" style="width: 500px;text-align: right;">
+        <el-input v-model="form.name" :disabled="true" type="text" />
+      </el-form-item>
+      <el-form-item label="联系人:" prop="linkMan" style="width: 500px; text-align: right;">
+        <el-input v-model="form.linkMan" :disabled="true" type="text" />
+      </el-form-item>
+      <el-form-item label="手机号:" prop="contractMobile" style="width: 500px; text-align: right;">
+        <el-input v-model="form.contractMobile" :disabled="true" />
+      </el-form-item>
+      <el-form-item label="门店地址:" prop="address" style="width: 500px; text-align: right;float:left;">
+        <el-input v-model="form.address" :disabled="true" />
+      </el-form-item>
+      <el-form-item label="营业执照编号:" prop="socialCreditCode" style="width: 500px; text-align: right;float:left;">
+        <el-input v-model="form.socialCreditCode" :disabled="true" />
+      </el-form-item>
+      <el-form-item v-if="form.businessLicenseImage" label="营业执照:" prop="businessLicenseImage" style="width:450px;text-align: right;float:left;">
+        <div class="form-el-upload">
+          <div class="avatar">
+            <img :src="form.businessLicenseImage">
+          </div>
+        </div>
+      </el-form-item>
+      <el-form-item v-if="form.headpic" label="门头照:" prop="headpic" style="width:450px; text-align: right;float:left;">
+        <div class="form-el-upload">
+          <div class="avatar">
+            <img :src="form.headpic">
+          </div>
+        </div>
+      </el-form-item>
+      <el-form-item v-if="form.headpic" label="医疗执业许可证:" prop="headpic" style="width:450px; text-align: right;float:left;">
+        <div class="form-el-upload">
+          <div class="avatar">
+            <img :src="form.headpic">
+          </div>
+        </div>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+<script>
+import { getClubDetail } from '@/api/club'
+export default {
+  data() {
+    return {
+      clubId: this.$route.query.clubId * 1,
+      form: {}
+    }
+  },
+  computed: {
+
+  },
+  created() {
+    this.getClubDetail()
+  },
+  methods: {
+    async getClubDetail() {
+      try {
+        const res = await getClubDetail(this.clubId)
+        console.log('res', res)
+        this.form = { ...this.form, ...res.data }
+      } catch (error) {
+        console.log('error', error)
+      }
+    }
+  }
+}
+</script>
+<style lang="scss">
+.el-input.is-disabled .el-input__inner{
+  color: #333;
+}
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+  float: left;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409EFF;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 148px;
+  height: 148px;
+  line-height: 148px;
+  text-align: center;
+}
+.avatar {
+  width: 148px;
+  height: 148px;
+  display: block;
+}
+.avatar img {
+  width: 148px;
+  height: 148px;
+  display: block;
+}
+.el-form-item__label{
+    text-align: right !important;
+}
+.form-el-upload{
+  width: 150px;
+}
+.el-upload__tip_club{
+  margin-top: 0;
+  line-height: 20px;
+  color: red;
+  text-align: left;
+  position: absolute;
+  right: -45%;
+  bottom: 0;
+}
+.address .el-form-item__content{
+  margin-left: 0 !important;
+}
+/*清除浮动*/
+.clearfix:before,.clearfix:after {
+  content: "";
+  display: block;
+  clear: both;
+}
+.clearfix {
+  zoom: 1;
+}
+</style>

+ 1 - 1
src/views/club/editForm.vue

@@ -130,7 +130,7 @@ export default {
       }
     },
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     },
     actionUrl() {
       return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'

+ 1 - 1
src/views/club/form.vue

@@ -129,7 +129,7 @@ export default {
       }
     },
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     },
     actionUrl() {
       return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'

+ 56 - 77
src/views/club/list.vue

@@ -2,23 +2,23 @@
   <div class="app-container">
     <div class="app-header-search">
       <el-form class="demo-form-inline">
-        <el-form-item label="机构名称:" style="width:280px;float: left;">
-          <el-input v-model="listQuery.userName" placeholder="请输入机构名称" maxlength="50" style="width:200px;" @keyup.enter.native="handleFilter" />
+        <el-form-item label="门店名称:" style="width:280px;float: left;">
+          <el-input v-model="listQuery.userName" placeholder="请输入机构名称" maxlength="50" style="width:200px;" @keyup.enter.native="getList" />
         </el-form-item>
         <el-form-item label="联系人:" style="width:230px;float: left;">
-          <el-input v-model="listQuery.linkMan" placeholder="请输入联系人姓名" maxlength="10" style="width:150px" @keyup.enter.native="handleFilter" />
+          <el-input v-model="listQuery.linkMan" placeholder="请输入联系人姓名" maxlength="10" style="width:150px" @keyup.enter.native="getList" />
         </el-form-item>
         <el-form-item label="手机号:" style="width:200px;float: left;">
-          <el-input v-model="listQuery.bindMobile" placeholder="请输入手机号" maxlength="11" style="width:130px" @keyup.enter.native="handleFilter" />
+          <el-input v-model="listQuery.bindMobile" placeholder="请输入手机号" maxlength="11" style="width:130px" @keyup.enter.native="getList" />
         </el-form-item>
-        <el-form-item label="上线状态:" style="width:190px;float: left;">
-          <el-select v-model="listQuery.clubStatus" placeholder="请选择" style="width:100px" value="" @change="handleFilter">
+        <el-form-item label="状态:" style="width:190px;float: left;">
+          <el-select v-model="listQuery.clubStatus" placeholder="请选择" style="width:100px" value="" @change="getList">
             <el-option label="全部" value="" />
             <el-option label="已上线" value="90" />
             <el-option label="已下线" value="91" />
           </el-select>
         </el-form-item>
-        <el-form-item label="创建时间:" style="width:410px;float: left;">
+        <el-form-item label="注册时间:" style="width:410px;float: left;">
           <el-date-picker
             v-model="listQuery.startTime"
             type="date"
@@ -36,11 +36,11 @@
           />
         </el-form-item>
         <el-form-item style="width:100px;float: left;">
-          <el-button type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
+          <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
         </el-form-item>
         <el-form-item style="width:100px;float: left;">
           <router-link :to="'/club/form/'">
-            <el-button type="primary">上线机构</el-button>
+            <el-button type="primary" icon="el-icon-plus">上线机构</el-button>
           </router-link>
         </el-form-item>
       </el-form>
@@ -54,16 +54,15 @@
       highlight-current-row
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
     >
-      <el-table-column align="center" label="序号" width="50">
-        <template slot-scope="scope">
-          {{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}
-        </template>
-      </el-table-column>
-      <el-table-column label="账号" width="150" align="center" prop="account" />
-      <el-table-column label="机构名称" width="180" align="center" prop="userName" />
+      <el-table-column label="门店名称" width="180" align="center" prop="userName" />
       <el-table-column label="联系人" width="100" align="center" prop="linkMan" />
       <el-table-column label="手机号" width="140" align="center" prop="bindMobile" />
-      <el-table-column class-name="status-col" label="上线状态" width="150" align="center" prop="status">
+      <el-table-column align="center" label="机构地址" prop="address">
+        <template slot-scope="{row}">
+          <span>{{ `${row.province}${row.city}${row.town}${row.address}` }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="上线状态" width="150" align="center" prop="status">
         <template slot-scope="{row}">
           <el-tag v-if="row.clubStatus*1===91" type="danger" size="small">已下线</el-tag>
           <el-tag v-else type="success" size="small">已上线</el-tag>
@@ -71,44 +70,36 @@
           <el-button v-else type="primary" size="mini" @click="handOffline(row)">下线</el-button>
         </template>
       </el-table-column>
-      <el-table-column align="center" label="机构地址" prop="address">
-        <template slot-scope="{row}">
-          <span>{{ `${row.province}${row.city}${row.town}${row.address}` }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column align="center" label="创建时间" prop="registerTime">
+
+      <el-table-column align="center" label="注册时间" prop="registerTime" width="100">
         <template slot-scope="{row}">
           <span>{{ row.registerTime }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
-          <router-link :to="{path:'/club/editForm',query:{ clubID:row.clubID, userID: row.userID}}">
-            <el-button type="primary" size="mini" style="width: 100px;margin:5px 0 0 0;">编辑</el-button>
-          </router-link>
-          <router-link :to="{path:'/club/operateList',query:{name:row.name,clubID:row.clubID,userID:row.userID}}">
-            <el-button type="primary" size="mini" style="width: 100px;margin:5px 0 0 0;">查看运营人员</el-button>
-          </router-link>
-          <el-button type="primary" size="mini" style="width: 100px;margin:5px 0 0 0;" @click="handleEdit(row)">添加运营人员</el-button>
+          <el-button type="primary" size="mini" @click="handleRecordDetail(row)">查看资料</el-button>
+          <el-button v-if="row.clubStatus === 90" type="warning" size="mini" @click="hanleVerify(row)">审核</el-button>
         </template>
       </el-table-column>
     </el-table>
-
     <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="fetchData" />
-
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="440px">
-      <el-form ref="dataForm" :rules="rules" :model="addPeople" label-position="left" label-width="70px" style="width: 400px;">
-        <el-form-item label="姓名" prop="linkName">
-          <el-input v-model="addPeople.linkName" placeholder="请输入姓名" maxlength="11" />
+    <el-dialog title="审核" :visible.sync="dialogFormVisible" width="440px">
+      <el-form ref="dataForm" :rules="rules" :model="addPeople" label-position="right" label-width="120px">
+        <el-form-item label="状态:">
+          <el-select v-model="addPeople.status" placeholder="请选择">
+            <el-option label="请选择" value="" />
+            <el-option label="审核通过" :value="1" />
+            <el-option label="审核未通过" :value="2" />
+          </el-select>
         </el-form-item>
-        <el-form-item label="手机号" prop="mobile">
-          <el-input v-model="addPeople.mobile" placeholder="请输入手机号" maxlength="11" />
+        <el-form-item v-if="addPeople.status===2" label="原因:" prop="text">
+          <el-input v-model="addPeople.text" type="textarea" placeholder="请填写审核未通过原因,50字以内" maxlength="50" :autosize="{ minRows: 5, maxRows: 5}" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="dialogFormVisible = false">取消</el-button>
-        <el-button type="primary" :loading="loadingbut" @click="handleCreateOperator()">{{ loadingbuttext }}</el-button>
-        <el-button type="primary" @click="handlePreservOperator()">保存生成邀请码</el-button>
+        <el-button type="primary" :disabled="disabled" @click="handleCreateOperator">保存</el-button>
       </div>
     </el-dialog>
     <template>
@@ -120,7 +111,7 @@
 </template>
 
 <script>
-import { getClubList, createOperator, preservOperator, updateStatus } from '@/api/club'
+import { getClubList, createOperator, updateStatus } from '@/api/club'
 import Pagination from '@/components/Pagination'
 
 export default {
@@ -128,13 +119,13 @@ export default {
   data() {
     return {
       pageNum: 0,
-      list: null,
+      list: [],
       listLoading: true,
       total: 0,
       listQuery: {
         index: 1,
         pageSize: 20,
-        userOrganizeID: this.$store.getters.organizeID,
+        userOrganizeID: this.$store.getters.organizeId,
         userName: '',
         linkMan: '',
         bindMobile: '',
@@ -145,8 +136,8 @@ export default {
       startTime: '',
       endTime: '',
       addPeople: {
-        linkName: '',
-        mobile: ''
+        status: '',
+        text: ''
       },
       updateTemp: {},
       updateTatusType: '',
@@ -155,14 +146,10 @@ export default {
       dialogFormVisible: false,
       dialogStatus: '',
       loadingbut: false,
-      loadingbuttext: '保存',
-      textMap: {
-        update: '添加运营人员',
-        create: 'Create',
-        titleText: '系统提示'
-      },
       rules: {
         linkName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
+        status: [{ required: true, message: '请选择审核状态', trigger: 'blur' }],
+        text: [{ required: true, message: '请填写原因', trigger: 'blur' }],
         mobile: [
           { required: true, message: '手机号码不能为空', trigger: 'blur' },
           {
@@ -176,15 +163,18 @@ export default {
     }
   },
   computed: {
+    disabled() {
+      return !this.addPeople.status
+    },
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {
-    this.fetchData()
+    this.getList()
   },
   methods: {
-    fetchData() {
+    getList() {
       this.listLoading = true
       getClubList(this.listQuery).then(response => {
         const data = response.data
@@ -196,6 +186,10 @@ export default {
         // 封装静态数据
       })
     },
+    hanleVerify(row) {
+      // 审核
+      this.dialogFormVisible = true
+    },
     handleEdit(row) { // 添加运营
       console.log(row)
       this.dialogStatus = 'update'
@@ -208,37 +202,22 @@ export default {
     handleCreateOperator() { // 保存
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          const Formobj = { userOrganizeID: this.$store.getters.organizeID, configFlag: 1 }
+          const Formobj = { userOrganizeID: this.$store.getters.organizeId, configFlag: 1 }
           const params = Object.assign(Formobj, this.addPeople)
           this.loadingbut = true
-          this.loadingbuttext = '保存中...'
           createOperator(params).then(response => {
             this.$message({ message: response.msg, type: 'success', center: true })
             this.dialogFormVisible = false
             this.loadingbut = false
-            this.loadingbuttext = '保存'
           }).catch(() => {
             this.loadingbut = false
-            this.loadingbuttext = '保存'
-          })
-        }
-      })
-    },
-    handlePreservOperator() { // 保存并生成邀请码
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          const Formobj = { userOrganizeID: this.$store.getters.organizeID, configFlag: 2 }
-          const params = Object.assign(Formobj, this.addPeople)
-          preservOperator(params).then(response => {
-            this.dialogFormVisible = false
-            this.$message({ message: response.msg, type: 'success', center: true })
           })
         }
       })
     },
     handOnline(row) {
-      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userOrganizeID: this.$store.getters.organizeID })
-      this.$confirm('确定上线该机构吗?', '系统提示', {
+      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userOrganizeID: this.$store.getters.organizeId })
+      this.$confirm('确定上线该门店吗?上线后门店负责人可使用账号密码登录小程序。', '系统提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
@@ -249,8 +228,8 @@ export default {
       })
     },
     handOffline(row) {
-      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userOrganizeID: this.$store.getters.organizeID })
-      this.$confirm('确定下线该机构吗?', '系统提示', {
+      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userOrganizeID: this.$store.getters.organizeId })
+      this.$confirm('确定下线该门店吗?下线后该门店将不能在小程序进行采购。', '系统提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
@@ -271,8 +250,8 @@ export default {
         }
       })
     },
-    handleFilter() {
-      this.fetchData()
+    handleRecordDetail(row) {
+      this.$router.push({ path: '/club/details', query: { clubId: row.clubID }})
     }
   }
 }

+ 7 - 7
src/views/club/operateList.vue

@@ -172,7 +172,7 @@ export default {
         pageSize: 20,
         clubID: this.$route.query.clubID,
         userID: this.$route.query.userID,
-        userOrganizeID: this.$store.getters.organizeID,
+        userOrganizeID: this.$store.getters.organizeId,
         linkName: '',
         mobile: '',
         status: '',
@@ -180,7 +180,7 @@ export default {
         endAddTime: ''
       },
       editTemp: {
-        userOrganizeID: this.$store.getters.organizeID,
+        userOrganizeID: this.$store.getters.organizeId,
         linkName: '',
         mobile: ''
       },
@@ -213,7 +213,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {
@@ -244,7 +244,7 @@ export default {
         id: row.id,
         clubID: row.clubID,
         userID: row.userID,
-        userOrganizeID: this.$store.getters.organizeID
+        userOrganizeID: this.$store.getters.organizeId
       }
     },
     handleConfirm() {
@@ -276,7 +276,7 @@ export default {
       this.dialogStatus = 'untying'
       this.dialogVisibleText = '确定解绑该运营人员吗?'
       this.handleConfirmType = 'untying'
-      this.editTemp = { userOrganizeID: this.$store.getters.organizeID, id: row.id, clubID: row.clubID, userID: row.userID }
+      this.editTemp = { userOrganizeID: this.$store.getters.organizeId, id: row.id, clubID: row.clubID, userID: row.userID }
     },
     unbindOperators() {
       const params = this.editTemp
@@ -317,7 +317,7 @@ export default {
     handleCreateOperator() { // 保存
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          const params = Object.assign({ userOrganizeID: this.$store.getters.organizeID, configFlag: 1 }, this.editTemp)
+          const params = Object.assign({ userOrganizeID: this.$store.getters.organizeId, configFlag: 1 }, this.editTemp)
           this.loadingbut = true
           this.loadingbuttext = '保存中...'
           preservOperator(params).then(response => {
@@ -338,7 +338,7 @@ export default {
     handlePreservOperator() { // 保存并生成邀请码
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          const Formobj = { userOrganizeID: this.$store.getters.organizeID, configFlag: 2 }
+          const Formobj = { userOrganizeID: this.$store.getters.organizeId, configFlag: 2 }
           const params = Object.assign(Formobj, this.editTemp)
           preservOperator(params).then(response => {
             this.dialogFormVisible = false

+ 5 - 5
src/views/dashboard/admin/index.vue

@@ -128,17 +128,17 @@ export default {
       Receivable: {
         startTime: this.getCurrentMonthFirst(),
         endTime: this.getCurrentMonthLast(),
-        organizeID: this.$store.getters.organizeID
+        organizeID: this.$store.getters.organizeId
       },
       Order: {
         startTime: this.getCurrentMonthFirst(),
         endTime: this.getCurrentMonthLast(),
-        organizeID: this.$store.getters.organizeID
+        organizeID: this.$store.getters.organizeId
       },
       Commodity: {
         startTime: this.getCurrentMonthFirst(),
         endTime: this.getCurrentMonthLast(),
-        organizeID: this.$store.getters.organizeID
+        organizeID: this.$store.getters.organizeId
       },
       count: 0,
       payTotalFee: ''
@@ -146,7 +146,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {
@@ -185,7 +185,7 @@ export default {
       })
     },
     handleGetHomepageSale() {
-      getHomepageSale({ organizeID: this.$store.getters.organizeID }).then(response => {
+      getHomepageSale({ organizeID: this.$store.getters.organizeId }).then(response => {
         this.isSaleRequest = true
         this.monthData = response.data.month
         this.payTotalFeeData = response.data.payTotalFee

+ 34 - 38
src/views/finance/list.vue

@@ -1,37 +1,34 @@
 <template>
   <div class="app-container">
-    <div class="app-header-search">
-      <el-form ref="dataSearch" :inline="true" :model="search" class="demo-form-inline">
-        <el-form-item label="订单ID:">
-          <el-input v-model="search.orderID" placeholder="请输入订单ID" oninput="if(value.length>9)value=value.slice(0,9)" />
-        </el-form-item>
-        <el-form-item label="订单编号:">
-          <el-input v-model="search.orderNumber" placeholder="请输入订单编号" maxlength="20" />
-        </el-form-item>
-        <el-form-item label="客户名称:">
-          <el-input v-model="search.customer" placeholder="请输入客户名称" maxlength="15" />
-        </el-form-item>
-        <el-form-item label="创建时间:">
-          <el-date-picker
-            v-model="listQuery.startTime"
-            type="date"
-            placeholder="选择日期"
-            format="yyyy 年 MM 月 dd 日"
-            value-format="yyyy-MM-dd"
-          />
-          至
-          <el-date-picker
-            v-model="listQuery.endTime"
-            type="date"
-            placeholder="选择日期"
-            format="yyyy 年 MM 月 dd 日"
-            value-format="yyyy-MM-dd"
-          />
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" icon="el-icon-search" @click="onSubmit">搜索</el-button>
-        </el-form-item>
-      </el-form>
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>订单ID:</span>
+        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>订单编号:</span>
+        <el-input v-model="listQuery.orderNumber" style="width:130px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>客户名称:</span>
+        <el-input v-model="listQuery.customer" style="width:130px;" placeholder="客户名称" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>下单时间:</span>
+        <el-date-picker
+          v-model="time"
+          type="daterange"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+          @change="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+      </div>
     </div>
     <el-table
       v-loading="listLoading"
@@ -50,13 +47,10 @@
       <el-table-column label="订单编号(ID)" align="center" prop="orderID" />
       <el-table-column label="下单时间" align="center" prop="createTime" />
       <el-table-column label="客户名称" align="center" prop="customer" />
+      <el-table-column label="订单金额(元)" align="center" prop="money" />
       <el-table-column label="应收金额(元)" align="center" prop="money" />
       <el-table-column label="已收金额(元)" align="center" prop="money1" />
       <el-table-column label="未收金额(元)" align="center" prop="money2" />
-      <el-table-column label="应付金额(元)" align="center" prop="money3" />
-      <el-table-column label="已付金额(元)" align="center" prop="money4" />
-      <el-table-column label="未付金额(元)" align="center" prop="money5" />
-      <el-table-column label="佣金(元)" align="center" prop="money6" />
     </el-table>
 
     <pagination v-show="total>20" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" />
@@ -66,6 +60,7 @@
 <script>
 import { getClubList } from '@/api/club'
 import Pagination from '@/components/Pagination'
+import pickerOptions from '@/utils/time-picker.js'
 
 export default {
   components: { Pagination },
@@ -81,6 +76,7 @@ export default {
   data() {
     return {
       list: null,
+      pickerOptions,
       listLoading: true,
       searchTimeVal: '',
       total: 0,
@@ -128,10 +124,10 @@ export default {
     }
   },
   created() {
-    this.fetchData()
+    this.getList()
   },
   methods: {
-    fetchData() {
+    getList() {
       this.listLoading = true
       getClubList().then(response => {
         this.list = response.data.items

+ 159 - 0
src/views/floor/components/good-multi-dialog.vue

@@ -0,0 +1,159 @@
+<template>
+  <el-dialog
+    title="选择商品"
+    :visible.sync="visible"
+    width="1100px"
+    :close-on-click-modal="false"
+    :show-close="false"
+  >
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>商品ID:</span>
+        <el-input
+          v-model="listQuery.productId"
+          placeholder="商品ID"
+          clearable
+          @input="e => (listQuery.productId= checkedInput(e,1))"
+        />
+      </div>
+      <div class="filter-control">
+        <span>商品名称:</span>
+        <el-input
+          v-model="listQuery.name"
+          placeholder="商品名称"
+          clearable
+          @input="e => (listQuery.name= checkedInput(e,2))"
+        />
+      </div>
+      <div class="filter-control">
+        <span>供应商名称:</span>
+        <el-input
+          v-model="listQuery.shopName"
+          placeholder="供应商名称"
+          clearable
+          style="width:160px;"
+          @input="e => (listQuery.shopName= checkedInput(e,2))"
+        />
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" @click="getList">查询</el-button>
+      </div>
+    </div>
+    <el-table ref="table" v-loading="isLoading" :data="list" height="400px" border @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="50" />
+      <el-table-column prop="productId" label="商品ID" align="center" width="80" />
+      <el-table-column prop="coupon" label="商品图片" align="center" width="100">
+        <template v-if="row.productId" slot-scope="{ row }">
+          <el-popover
+            placement="top-start"
+            title=""
+            width="180"
+            trigger="hover"
+          >
+            <img :src="row.mainImage" alt="" style="width:100px;height:100px;">
+            <img slot="reference" :src="row.mainImage" alt="" style="width:50px;height:50px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column prop="name" label="商品名称" align="center" />
+      <el-table-column prop="shopName" label="供应商" align="center" width="250" />
+      <el-table-column prop="price" label="机构价" align="center" width="160">
+        <template slot-scope="{ row }">
+          ¥{{ row.price ? row.price : '0.00' }}
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 页码 -->
+    <pagination
+      :total="total"
+      :page-sizes="[20]"
+      :page-size="20"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="getList"
+    />
+    <div slot="footer">
+      <el-button @click="handleCanle">取 消</el-button>
+      <el-button type="primary" :disabled="disabled" @click="handleAddProConfirm(productRadio)">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getClubList, createOperator, updateStatus } from '@/api/club'
+
+export default {
+  name: 'ProDialog',
+  filters: {
+    NumFormat(value) {
+      // 处理金额
+      return Number(value).toFixed(2)
+    }
+  },
+  data() {
+    return {
+      visible: true,
+      listQuery: {
+        productId: '', // 商品id
+        name: '', // 商品名称
+        shopName: '', // 供应商名称
+        pageNum: 1,
+        pageSize: 20
+      },
+      list: [],
+      total: 0,
+      productRadio: null,
+      isLoading: true
+    }
+  },
+  computed: {
+    disabled() {
+      return this.productRadio === null
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 商品列表
+    async getList() {
+      this.isLoading = true
+      const res = await fetchProductList(this.listQuery)
+      this.list = res.data.results
+      this.total = res.data.totalRecord
+      this.isLoading = false
+    },
+    // 多选商品
+    handleSelectionChange(row) {
+      this.productRadio = row
+      console.log('row', row)
+    },
+    handleAddProConfirm() {
+      // 确认选择商品
+      this.productRadio.pcStatus = '1'
+      this.productRadio.appletsStatus = '1'
+      this.productRadio.sort = 1
+      this.$emit('confirm', this.productRadio)
+    },
+    handleCanle() {
+      // 取消弹窗
+      this.$emit('cancel')
+    },
+    checkedInput(event, type) {
+      let pattern = ''
+      switch (type) {
+        case 1:
+          pattern = /[^\d]/g
+          break
+        case 2:
+          pattern = /[^u4E00-u9FA5|d|a-zA-Z|rns,.?!,。?!…—&$=()-+/*{}[]]|s/g
+          break
+      }
+      return event.replace(pattern, '')
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 433 - 0
src/views/floor/edit.vue

@@ -0,0 +1,433 @@
+<template>
+  <div class="app-container" style="width: 800px;margin: 0 auto;">
+    <el-form ref="bannerForm" :model="form" label-width="100px">
+      <el-form-item label="楼层标题:" prop="name" :rules="rules.name">
+        <el-input v-model="form.name" style="width: 250px;" />
+      </el-form-item>
+      <el-form-item label="排序:" prop="sort" :rules="rules.sort">
+        <el-input v-model="form.sort" style="width: 200px" />
+      </el-form-item>
+      <el-form-item label="状态:" prop="status" :rules="rules.status">
+        <el-select v-model="form.status" placeholder="请选择">
+          <el-option label="上线" :value="1" />
+          <el-option label="下线" :value="0" />
+        </el-select>
+      </el-form-item>
+      <!-- 商品列表 -->
+      <el-form-item label="商品信息" :prop="productList" :rules="rules.productList">
+        <el-button type="primary" icon="el-icon-sort" size="mini" :disabled="disabled3(form.productList)" @click="handleOnInputBlur">一键排序</el-button>
+        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleDialogVisible">添加商品</el-button>
+        <el-checkbox-group v-show="false" v-model="form.productList" />
+        <el-table v-show="form.productList && form.productList.length>0" :data="form.productList" border>
+          <el-table-column property="mainImage" label="商品图片" align="center" width="80">
+            <template slot-scope="{ row }">
+              <el-popover
+                placement="top-start"
+                title=""
+                width="180"
+                trigger="hover"
+              >
+                <img :src="row.mainImage" alt="" style="width:150px;height:150px;">
+                <img slot="reference" :src="row.mainImage" alt="" style="width:30px;height:30px;">
+              </el-popover>
+            </template>
+          </el-table-column>
+          <el-table-column property="name" label="商品名称" align="center" />
+          <el-table-column prop="validFlag" label="商品状态" align="center" width="150">
+            <template slot-scope="{row}">
+              <el-tag :type="row.validFlag | statusFilter">{{ row.validFlag*1 === 1 ? '已上架' : '已下架' }}</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column label="排序" align="center" width="100">
+            <template slot-scope="{row}">
+              <el-input v-model="row.sort" maxlength="4" minlength="1" />
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="center">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleDeletePros(scope.$index)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+    </el-form>
+    <div class="el-dialog__footer" style="text-align: center;">
+      <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+    </div>
+    <!-- 商品弹框 -->
+    <good-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
+  </div>
+</template>
+
+<script>
+import { getClubList, createOperator, updateStatus } from '@/api/club'
+import goodDialog from './components/good-multi-dialog'
+const defaultForm = () => {
+  return {
+    shopId: 0,
+    shopData: [],
+    couponType: 0,
+    couponAmount: '',
+    touchPrice: '',
+    productType: '1',
+    categoryType: '1',
+    associateList: []// 指定商品信息
+  }
+}
+export default {
+  name: 'BannerEdit',
+  components: { goodDialog },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'warning'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      form: {
+        name: '',
+        banner: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+        sort: 0,
+        status: 1,
+        jumpType: null,
+        actId: '',
+        productId: null
+      },
+      activityList: [
+        {
+          actId: 1,
+          name: '活动主题1'
+        },
+        {
+          actId: 2,
+          name: '活动主题2'
+        }
+      ],
+      productData: [
+        {
+          mainImage: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+          productName: 'Twinkle 水婴肌 美白 补水 紧致 无创水光',
+          shopName: '雅光博睿医药科技(广东)有限公司',
+          unit: '20ML',
+          costPrice: '50000.00',
+          price: '50000.00',
+          addTime: '2023-04-14 14:45:39',
+          validFlag: 1
+        }
+      ],
+      formParams: {
+        id: '',
+        month: '',
+        endMonth: '',
+        status: '',
+        configure: 1, // 专属优惠券配置  1是、0否
+        coupons: []
+      },
+      editType: 'add',
+      // 商品列表
+      dialogVisible: false,
+      loadImgLoading: false,
+      rules: {
+        name: [{ required: true, message: '请填写轮播主题', trigger: 'blur' }],
+        banner: [{ required: true, message: '请上传轮播图', trigger: 'blur' }],
+        productId: [{ required: true, type: 'array', message: '请添加一个商品', trigger: ['change'] }],
+        sort: [{ required: true, message: '排序值不能为空', trigger: 'blur' }],
+        status: [{ required: true, message: '请选择状态', trigger: 'blur' }],
+        jumpType: [{ required: true, message: '请选择跳转类型', trigger: 'blur' }],
+        actId: [{ required: true, message: '请选择活动列表', trigger: 'blur' }]
+      },
+      delFlag: false
+    }
+  },
+  computed: {
+    disabled() {
+      return this.form.formList.length === 5
+    },
+    disabled1() {
+      return this.form.formList.length === 1
+    },
+    getToken() {
+      return {
+        'token': this.$store.getters.token
+      }
+    },
+    actionUrl() {
+      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
+    }
+  },
+  created() {
+    this.editType = this.$route.query.type || 'edit'
+    console.log('editType', this.editType)
+    // this.initForm(this.editType)
+  },
+  methods: {
+    initForm(type) {
+      if (type === 'add') {
+        console.log('add')
+        this.svipCoupon(type, 1, 0)
+      } else {
+        console.log('edit')
+        this.svipCoupon(type, 0, this.$route.query.id)
+      }
+    },
+    async svipCoupon(type, configure, id) {
+      const res = await svipCoupon({ id: id, configure: configure })
+      const data = res.data.svipcouponForm
+      this.formParams = { ...this.formParams, ...data }
+      if (data.coupons.length > 0) {
+        this.delFlag = true
+        this.form.formList = data.coupons.map((el) => {
+          el = { ...el, ...this.defaultShop }
+          if (el.shop) {
+            el.shopData.push(el.shop)
+          }
+          return el
+        })
+        console.log('formList', this.form.formList)
+      } else {
+        for (let i = 0; i <= 2; i++) {
+          this.form.formList.push(defaultForm())
+        }
+      }
+    },
+    // 显示选择商品弹窗
+    handleDialogVisible() {
+      this.dialogVisible = true
+    },
+    handleGoodDialogVisible(index) {
+      // 显示选择商品弹窗
+      this.addIndex = index
+      this.dialogGoodVisible = true
+    },
+    deleteShop() {
+      // 清除供应商
+      this.form.productId = ''
+      this.productData = []
+    },
+    handleGoodConfirm(data) {
+      // 确认选择商品
+      const from = this.form.formList[this.addIndex]
+      from.associateList.push(data)
+      console.log('from', this.form.formList)
+      this.handleGoodCancel()
+    },
+    handleDeletePros(formItem, index) {
+      // 删除商品
+      this.$confirm('确定删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        formItem.associateList.splice(index, 1)
+      })
+    },
+    onSubmit(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          this.handleFormParams()
+          this.$confirm('是否提交数据', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            console.log('formParams', this.formParams)
+            if (this.editType === 'add') {
+              this.formParams.configure = 1
+            } else {
+              this.formParams.configure = 0
+            }
+            this.saveVipCoupon(this.formParams)
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    handleFormParams() {
+      // 处理参数
+      this.formParams.coupons = this.form.formList.map((el) => {
+        if (el.associateList && el.associateList.length > 0) {
+          el.associateList = el.associateList.map((pro) => {
+            return {
+              sort: pro.sort,
+              pcStatus: pro.pcStatus,
+              appletsStatus: pro.appletsStatus,
+              name: pro.name,
+              shopName: pro.shopName,
+              mainImage: pro.mainImage,
+              productId: pro.productId
+            }
+          })
+        }
+        return el
+      })
+    },
+    async saveVipCoupon(params) {
+      // 保存超级会员优惠券
+      await saveVipCoupon(params)
+      this.$message.success('保存成功')
+      setTimeout(() => {
+        this.$router.push({ path: '/member/coupon/list' })
+      }, 1000)
+    },
+    // 取消选择商品
+    handleGoodCancel() {
+      this.dialogVisible = false
+      this.$refs.goodDialog.visible = false
+    },
+    handleAddList() {
+      // 新增优惠券
+      this.form.formList.push(defaultForm())
+    },
+    handleDelete(item, index) {
+      // 删除单挑优惠券
+      this.$confirm('确定删除此优惠券吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (this.delFlag) {
+          this.delCoupon(item.id, index)
+        } else {
+          this.form.formList.splice(index, 1)
+        }
+      })
+    },
+    async delCoupon(id, index) {
+      // 保存超级会员优惠券
+      if (id) {
+        try {
+          await delCoupon(id)
+        } catch (error) {
+          console.log(error)
+        }
+      }
+      this.form.formList.splice(index, 1)
+    },
+    handleOnInputBlur(formItem) {
+      // 商品排序
+      formItem.associateList.sort(this.sortByEnent('sort'))
+    },
+    sortByEnent(i) {
+      // 排序
+      return function(a, b) {
+        return a[i] - b[i] //  a[i] - b[i]为正序,倒叙为  b[i] - a[i]
+      }
+    },
+    handlePcStatusChange(row) {
+      // PC状态开启关闭
+      console.log('row', row)
+      if (row.pcStatus === '0') {
+        row.pcStatus = '1'
+      } else {
+        row.pcStatus = '0'
+      }
+    },
+    handleAppStatusChange(row) {
+      // 小程序状态开启关闭
+      if (row.appletsStatus === '0') {
+        row.appletsStatus = '1'
+      } else {
+        row.appletsStatus = '0'
+      }
+    },
+    disabled3(array) {
+      if (array && array.length >= 2) {
+        return false
+      } else {
+        return true
+      }
+    },
+    // 上传图标事件
+    handleSuccess(response, file) {
+      this.loadImgLoading = true
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.temp.classifyImage = response.data
+        }, 1000 * 2)
+      })
+    },
+    // 对上传图片的大小、格式进行限制
+    beforeUpload(file) {
+      const isJPG = file.type === 'image/jpeg'
+      const isJPG2 = file.type === 'image/jpg'
+      const isPNG = file.type === 'image/png'
+      const isLt5M = file.size / 1024 / 1024 < 5
+      if (!isJPG && !isJPG2 && !isPNG) {
+        this.$message.error('只支持jpg或png格式图片')
+      }
+      if (!isLt5M) {
+        this.$message.error('请上传5MB以内的图片!')
+      }
+      return (isJPG || isJPG2 || isPNG) && isLt5M
+    },
+    reloadImage() {
+      this.loadImgLoading = true
+      setTimeout(() => {
+        this.temp.classifyImage = this.temp.classifyImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
+      }, 1000 * 2)
+    },
+    loadSucess() {
+      this.loadImgLoading = false
+    }
+  }
+}
+</script>
+
+<style>
+.avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    float: left;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 148px;
+    height: 148px;
+    line-height: 148px;
+    text-align: center;
+  }
+  .avatar {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .avatar img {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .el-form-item__label{
+      text-align: right !important;
+  }
+  .form-el-upload{
+    width: 150px;
+  }
+  .el-upload__tip{
+    line-height: 20px;
+    color: red;
+    text-align: left;
+    position: absolute;
+    right: -50%;
+    bottom: 0;
+  }
+  .span_tip{
+    font-size: 12px;
+    color: red;
+    margin-left: 5px;
+  }
+  .filter-item-temp{
+    width: 100px;
+  }
+</style>

+ 157 - 0
src/views/floor/list.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-sort" @click="handleOnInputBlur(formItem,index)">一键排序</el-button>
+        <el-button type="primary" icon="el-icon-plus" @click="handleToEdit('add')">添加楼层</el-button>
+      </div>
+    </div>
+    <p style="margin: 0;line-height: 24px;font-size: 14px;color: #999;">注:排序值越小越靠前</p>
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      element-loading-text="Loading"
+      border
+      fit
+      highlight-current-row
+      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
+    >
+      <el-table-column label="楼层名称" align="center" prop="classifyName" />
+      <el-table-column class-name="status-col" label="状态" align="center" prop="status" width="100">
+        <template slot-scope="{row}">
+          <el-tooltip :content="row.status*1 === 1 ? '停用' : '启用'" placement="top">
+            <el-switch
+              v-model="row.status"
+              active-value="1"
+              inactive-value="0"
+              @change="changeStatus(row.id, row.status)"
+            />
+          </el-tooltip>
+        </template>
+      </el-table-column>
+      <el-table-column label="排序值" align="center" prop="sort" width="100">
+        <template slot-scope="{row}">
+          <el-input-number v-model="row.sort" controls-position="right" :min="1" :max="999" :maxlength="3" size="mini" style="width:65px;" />
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="创建时间" prop="addTime">
+        <template slot-scope="{row}">
+          <span>{{ row.addTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="handleToEdit('edit',row.id)">编辑</el-button>
+          <el-button type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
+
+  </div>
+</template>
+
+<script>
+import { getCategory, switchClassify, saveCategorySort } from '@/api/goods-classify'
+import Pagination from '@/components/Pagination'
+
+export default {
+  components: { Pagination },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        0: 'danger'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      list: null,
+      listLoading: true,
+      total: 0,
+      listQuery: {
+        index: 1,
+        pageSize: 20,
+        organizeID: this.$store.getters.organizeId
+      }
+    }
+  },
+  computed: {
+    organizeID() {
+      return this.$store.getters.organizeId
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.listLoading = true
+      getCategory(this.listQuery).then(response => {
+        this.list = response.data.results
+        this.total = response.data.totalRecord
+        this.listLoading = false
+      })
+    },
+    changeStatus(id, status) {
+      const confirmTxt = '确定要' + (status * 1 === 1 ? '启用' : '停用') + '该分类吗?'
+      this.$confirm(confirmTxt).then(_ => {
+        this.confirmChange(id)
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    confirmChange(id) {
+      switchClassify({ id: id }).then(() => {
+        this.getList()
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    batchSaveSort() {
+      const sorts = []
+      this.list.map(item => {
+        if (item.sort) {
+          sorts.push(item.id + '-' + Math.abs(item.sort))
+        }
+      })
+      saveCategorySort({ newProducSorttList: sorts.join(',') }).then(response => {
+        this.$message({ message: response.msg, type: 'success', center: true })
+        this.getList()
+      }).catch(() => {
+        this.getList()
+      })
+    },
+    // 跳转添加/编辑
+    handleToEdit(type, id) {
+      if (type === 'add') {
+        this.$router.push({ path: '/floor/edit', query: { type: type }})
+      } else {
+        this.$router.push({ path: '/floor/edit', query: { type: type, id: id }})
+      }
+    }
+  }
+}
+
+</script>
+<style>
+.el-input-number.is-controls-right .el-input__inner {
+    padding-left: 5px;
+    padding-right: 30px;
+}
+</style>
+<style lang="scss" scoped>
+.filter-title{
+  float: left;
+  font-size: 12px;
+  line-height: 18px;
+  text-align: left;
+  color: #2E3748;
+}
+.filter-title p{
+  margin:10px 0;
+}
+</style>

+ 2 - 2
src/views/goods/category-create.vue

@@ -71,7 +71,7 @@ export default {
       loadImgLoading: false,
       temp: {
         id: '',
-        organizeID: this.$store.getters.organizeID,
+        organizeID: this.$store.getters.organizeId,
         classifyName: '',
         classifyImage: '',
         sort: '',
@@ -93,7 +93,7 @@ export default {
       return window.location.href.split('/').reverse()[0]
     },
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     },
     actionUrl() {
       return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'

+ 2 - 2
src/views/goods/category-edit.vue

@@ -71,7 +71,7 @@ export default {
       loadImgLoading: false,
       temp: {
         id: '',
-        organizeID: this.$store.getters.organizeID,
+        organizeID: this.$store.getters.organizeId,
         classifyName: '',
         classifyImage: '',
         sort: '',
@@ -93,7 +93,7 @@ export default {
       return window.location.href.split('/').reverse()[0]
     },
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     },
     actionUrl() {
       return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'

+ 2 - 2
src/views/goods/category.vue

@@ -84,13 +84,13 @@ export default {
       listQuery: {
         index: 1,
         pageSize: 20,
-        organizeID: this.$store.getters.organizeID
+        organizeID: this.$store.getters.organizeId
       }
     }
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {

+ 61 - 228
src/views/goods/components/price-edit.vue

@@ -1,64 +1,59 @@
 <template>
-  <el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible" width="600px">
+  <el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible" width="1000px">
     <el-form ref="dataForm" :model="formData" :rules="rules" size="mini" label-width="120px">
       <el-form-item label="商品名称:">
-        <div class="text" v-text="productDetail.productName" />
+        <div class="text" v-text="product.productName" />
+      </el-form-item>
+      <el-form-item label="商品图片:">
+        <el-popover
+          placement="top-start"
+          title=""
+          width="120"
+          trigger="hover"
+        >
+          <img :src="product.mainImage" alt="" style="width:100px;height:100px;">
+          <img slot="reference" :src="product.mainImage" alt="" style="width:50px;height:50px;">
+        </el-popover>
       </el-form-item>
       <el-form-item label="供应商名称:">
-        <div class="text" v-text="productDetail.shopName" />
+        <div class="text" v-text="product.shopName" />
       </el-form-item>
-      <el-form-item label="商品分类:" prop="classifyID">
-        <el-select v-model="formData.classifyID" placeholder="商品分类" :label="productDetail.productClassifyName" size="small">
-          <template v-for="item in classify">
-            <el-option v-if="item.status*1 === 1" :key="item.id" :label="item.classifyName" :value="item.id" />
-          </template>
+      <el-form-item label="商品状态:" prop="validFlag">
+        <el-select v-model="formData.validFlag" placeholder="请选择">
+          <el-option label="上架" value="1" />
+          <el-option label="下架" value="0" />
         </el-select>
       </el-form-item>
-      <div class="line">
-        <el-form-item label="市场价:" prop="normalPrice" :rules="{required:true, validator:checkMultiplePrice, type:'float', trigger:'blur'}">
-          <el-input v-model="formData.normalPrice" size="small" />
-        </el-form-item>
-        <el-form-item label="成本价:" prop="costPrice" :rules="{required:true, validator:checkMultiplePrice, type:'float', trigger:'blur'}">
-          <el-input v-model="formData.costPrice" size="small" />
-        </el-form-item>
-      </div>
-
-      <el-form-item label="售价:" prop="ladderPriceFlag">
-        <el-radio-group v-model="formData.ladderPriceFlag" size="small" @change="clearValidate">
-          <el-radio :label="0">不使用阶梯价格</el-radio>
-          <el-radio :label="1">使用阶梯价格</el-radio>
-        </el-radio-group>
+      <el-form-item label="商品规格:" prop="skus">
+        <el-table row-key="title" :data="formData.skus" border>
+          <el-table-column label="商品规格" prop="title" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.unit }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="起订量" prop="name" align="center" width="100">
+            <template slot-scope="{row}">
+              <el-input v-model="row.minBuyNumber" />
+            </template>
+          </el-table-column>
+          <el-table-column label="成本价" prop="name" align="center" width="200">
+            <template slot-scope="{row}">
+              <span> ¥{{ row.costPrice | toThousandFloatFilter }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="售价" prop="name" align="center" width="200">
+            <template slot-scope="{row}">
+              <el-input v-model="row.price">
+                <template slot="prepend">¥</template>
+              </el-input>
+            </template>
+          </el-table-column>
+        </el-table>
       </el-form-item>
-
-      <div v-show="formData.ladderPriceFlag === 0" class="single">
-        <el-form-item label="     " prop="retailPrice">
-          <el-input v-model="formData.retailPrice" size="small" />
-        </el-form-item>
-        <el-form-item label="起订量:" prop="minBuyNumber">
-          <el-input v-model.number="formData.minBuyNumber" size="small" />
-        </el-form-item>
-      </div>
-      <div v-show="formData.ladderPriceFlag === 1" class="multiple">
-        <div class="group">
-          <div v-for="(item, index) in formData.ladderPriceList" :key="'ladderPrice'+index" class="line">
-            <el-form-item label="起订量" label-width="60px" style="width:130px" :prop="'ladderPriceList.' + index + '.buyNum'" :rules="{validator:checkMultipleNumber, type:'number', trigger:'blur'}">
-              <el-input v-model.number="item.buyNum" size="small" />
-            </el-form-item>
-            <el-form-item label="及以上,单价为" label-width="120px" style="width:210px" :prop="'ladderPriceList.' + index + '.buyPrice'" :rules="{validator:checkMultiplePrice, type:'float', trigger:'blur'}">
-              <el-input v-model="item.buyPrice" size="small" />
-            </el-form-item>
-          </div>
-        </div>
-        <el-form-item label-width="20px" style="width:80px">
-          <el-button v-if="ladderSize === 2" type="text" @click="addLadder">添加</el-button>
-          <el-button v-if="ladderSize === 3" type="text" style="color:red" @click="removeLadder">删除</el-button>
-        </el-form-item>
-      </div>
-
     </el-form>
     <div slot="footer" class="dialog-footer">
       <el-button @click="dialogFormVisible = false"> 关闭 </el-button>
-      <el-button type="primary" @click="updateGoods"> 确认 </el-button>
+      <el-button type="primary" @click="handleSave"> 保存 </el-button>
     </div>
   </el-dialog>
 </template>
@@ -75,7 +70,7 @@ export default {
       type: Boolean,
       default: false
     },
-    productDetail: {
+    product: {
       type: Object,
       default: () => {}
     },
@@ -88,28 +83,9 @@ export default {
     return {
       postData: null,
       formData: {
-        id: '',
-        classifyID: 0,
-        normalPrice: '',
-        costPrice: '',
-        ladderPriceFlag: 0,
-        retailPrice: '',
-        minBuyNumber: '',
-        ladderPriceList: []
-      },
-      ladderSize: 2,
-      ladderPrice: {
-        delFlag: 0,
-        productId: 0, // bigint(11) DEFAULT NULL COMMENT '商品id,具体对应cm_mall_organize_products表的ID',
-        ladderNum: 3, // bigint(11) DEFAULT NULL COMMENT '第几阶梯(最多可设置3阶梯)',
-        buyNum: '', // bigint(11) DEFAULT NULL COMMENT '购买数量(起订量)',
-        buyPrice: '' // decimal(10,2) DEFAULT NULL COMMENT '购买价格(对应起订量单价)',
+        skus: [],
+        validFlag: ''
       },
-      singlePrice: {
-        price: '',
-        number: ''
-      },
-      multiplePrice: [],
       rules: {
         classifyID: [{ required: true, message: '*必填', trigger: 'change' }],
         ladderPriceFlag: [{ required: true, message: '*必填', trigger: 'change' }],
@@ -129,173 +105,30 @@ export default {
     }
   },
   watch: {
-    productDetail: function(val) {
+    product: function(val) {
       this.postData = JSON.parse(JSON.stringify(val))
-      this.formData.id = this.postData.id
-      this.formData.classifyID = this.postData.classifyID * 1
-      this.formData.normalPrice = this.postData.normalPrice
-      this.formData.costPrice = this.postData.costPrice
-      this.formData.ladderPriceFlag = this.postData.ladderPriceFlag * 1
-      this.formData.retailPrice = this.postData.retailPrice
-      this.formData.minBuyNumber = this.postData.minBuyNumber * 1
-      // 初始化阶梯价格
-      this.formData.ladderPriceList = []
-      this.ladderPrice.productId = val.id
-      if (!val.ladderPriceList || val.ladderPriceList.length === 0) {
-        for (let i = 1; i <= 2; i++) {
-          this.ladderPrice.ladderNum = i
-          this.formData.ladderPriceList.push(JSON.parse(JSON.stringify(this.ladderPrice)))
-        }
-      } else {
-        val.ladderPriceList.forEach(item => {
-          if (item.delFlag * 1 === 0) {
-            this.formData.ladderPriceList.push(JSON.parse(JSON.stringify(item)))
-          }
-        })
-        for (let i = 0; i < this.formData.ladderPriceList.length; i++) {
-          this.formData.ladderPriceList[i].buyPrice = this.toFloatFilter(this.formData.ladderPriceList[i].buyPrice)
-        }
-      }
-      this.ladderSize = this.formData.ladderPriceList.length
+      this.formData.skus = this.postData.skus
+      this.formData.validFlag = this.postData.validFlag
     }
   },
   methods: {
-    clearValidate() {
-      this.$nextTick(() => {
-        this.$refs['dataForm'].clearValidate()
-      })
-    },
-    addLadder() {
-      this.ladderPrice.productId = this.formData.id
-      this.ladderPrice.ladderNum = 3
-      this.formData.ladderPriceList.push(JSON.parse(JSON.stringify(this.ladderPrice)))
-      this.ladderSize = 3
-    },
-    removeLadder() {
-      this.formData.ladderPriceList.splice(2, 1)
-      this.ladderSize = 2
-    },
-    updateGoods() {
+    handleSave() {
+      // 保存商品
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          if (this.postData.ladderPriceList && this.postData.ladderPriceList.length > 0) {
-            for (let i = 0; i < this.postData.ladderPriceList.length; i++) {
-              this.postData.ladderPriceList[i].delFlag = 1
-            }
-          } else { this.postData.ladderPriceList = [] }
-          this.postData.classifyID = this.formData.classifyID
-          this.postData.normalPrice = this.formData.normalPrice
-          this.postData.costPrice = this.formData.costPrice
-          this.postData.ladderPriceFlag = this.formData.ladderPriceFlag
-          if (this.formData.ladderPriceFlag === 0) {
-            this.postData.retailPrice = this.formData.retailPrice
-            this.postData.minBuyNumber = this.formData.minBuyNumber
-          } else {
-            for (let i = 0; i < this.formData.ladderPriceList.length; i++) {
-              if (this.postData.ladderPriceList[i]) {
-                this.postData.ladderPriceList[i].delFlag = 0
-                this.postData.ladderPriceList[i].ladderNum = this.formData.ladderPriceList[i].ladderNum
-                this.postData.ladderPriceList[i].buyNum = this.formData.ladderPriceList[i].buyNum
-                this.postData.ladderPriceList[i].buyPrice = this.formData.ladderPriceList[i].buyPrice
-              } else {
-                this.postData.ladderPriceList.push(JSON.parse(JSON.stringify(this.formData.ladderPriceList[i])))
-              }
-            }
-          }
-          saveGoods(this.postData).then(response => {
-            this.$message({ message: response.msg, type: 'success', center: true })
-            this.$parent.fetchData()
-            this.dialogFormVisible = false
-          })
-        }
-      })
-    },
-    /** 自定义校验规则 */
-    checkSinglePrice(rule, value, callback) {
-      if (this.formData.ladderPriceFlag === 1) {
-        return callback()
-      }
-      if (!value) {
-        return callback(new Error('*必填'))
-      }
-      this.$nextTick(() => {
-        if (!Number.parseFloat(value * 1)) {
-          return callback(new Error('*请输入正确的金额'))
-        } else {
-          if (('' + value).split('.').length > 1 && ('' + value).split('.')[1].length > 2) {
-            return callback(new Error('*最多保留两位小数'))
-          } else {
-            return callback()
-          }
+          this.saveGoods()
         }
       })
     },
-    checkSingleNumber(rule, value, callback) {
-      if (this.formData.ladderPriceFlag === 1) {
-        return callback()
-      }
-      if (!value) {
-        return callback(new Error('*必填'))
-      }
-      this.$nextTick(() => {
-        if (!Number.isInteger(value)) {
-          return callback(new Error('*起订量数值填写错误'))
-        } else {
-          return callback()
-        }
-      })
-    },
-    checkMultiplePrice(rule, value, callback) {
-      if (this.formData.ladderPriceFlag === 0) {
-        return callback()
-      }
-      if (!value) {
-        return callback(new Error('*必填'))
-      }
-      this.$nextTick(() => {
-        if (!Number.parseFloat(value * 1)) {
-          return callback(new Error('*请输入正确的金额'))
-        } else {
-          if (('' + value).split('.').length > 1 && ('' + value).split('.')[1].length > 2) {
-            return callback(new Error('*最多保留两位小数'))
-          } else {
-            return callback()
-          }
-        }
-      })
-    },
-    checkMultipleNumber(rule, value, callback) {
-      if (this.formData.ladderPriceFlag === 0) {
-        return callback()
-      }
-      if (!value) {
-        return callback(new Error('*必填'))
-      }
-      this.$nextTick(() => {
-        if (!Number.isInteger(value)) {
-          return callback(new Error('*起订量数值填写错误'))
-        } else {
-          if ((rule.fullField.indexOf('2') > 0 && this.formData.ladderPriceList[2].buyNum <= this.formData.ladderPriceList[1].buyNum) ||
-            (rule.fullField.indexOf('1') > 0 && this.formData.ladderPriceList[1].buyNum <= this.formData.ladderPriceList[0].buyNum)) {
-            return callback(new Error('*起订量必须大于上一个阶梯'))
-          } else {
-            return callback()
-          }
-        }
-      })
-    },
-    /** 两位小数转换 */
-    toFloatFilter(num) {
-      let result = '' + num
-      const temp = result.split('.')
-      if (temp.length === 1) {
-        result += '.00'
-      } else if (temp.length > 1) {
-        if (temp[1].length < 2) {
-          result += '0'
-        }
+    async saveGoods() {
+      try {
+        await saveGoods(this.postData)
+        this.$message({ message: '操作成功', type: 'success', center: true })
+        this.$parent.getList()
+        this.dialogFormVisible = false
+      } catch (error) {
+        console.log('error', error)
       }
-      return result
     }
   }
 }

+ 3 - 3
src/views/goods/list-commonly.vue

@@ -137,7 +137,7 @@ export default {
       listQuery: {
         index: 1,
         pageSize: 10,
-        organizeID: this.$store.getters.organizeID,
+        organizeID: this.$store.getters.organizeId,
         commonlyProduct: '1', // 常用商品
         id: '',
         productName: '',
@@ -148,7 +148,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     },
     onKeypress() {
       return (/[\d]/.test(String.fromCharCode(event.keyCode)))
@@ -160,7 +160,7 @@ export default {
   },
   methods: {
     getModuleType() {
-      getModule({ organizeID: this.$store.getters.organizeID }).then(response => {
+      getModule({ organizeID: this.$store.getters.organizeId }).then(response => {
         this.modules = response.data[0]
       })
     },

+ 3 - 3
src/views/goods/list-preferential.vue

@@ -137,7 +137,7 @@ export default {
       listQuery: {
         index: 1,
         pageSize: 10,
-        organizeID: this.$store.getters.organizeID,
+        organizeID: this.$store.getters.organizeId,
         preferentialProduct: '1', // 星范精品
         id: '',
         productName: '',
@@ -148,7 +148,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     },
     onKeypress() {
       return (/[\d]/.test(String.fromCharCode(event.keyCode)))
@@ -160,7 +160,7 @@ export default {
   },
   methods: {
     getModuleType() {
-      getModule({ organizeID: this.$store.getters.organizeID }).then(response => {
+      getModule({ organizeID: this.$store.getters.organizeId }).then(response => {
         this.modules = response.data[0]
       })
     },

+ 3 - 3
src/views/goods/list-preferred.vue

@@ -137,7 +137,7 @@ export default {
       listQuery: {
         index: 1,
         pageSize: 10,
-        organizeID: this.$store.getters.organizeID,
+        organizeID: this.$store.getters.organizeId,
         preferredProduct: '1', // 星范优选
         id: '',
         productName: '',
@@ -148,7 +148,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     },
     onKeypress() {
       return (/[\d]/.test(String.fromCharCode(event.keyCode)))
@@ -160,7 +160,7 @@ export default {
   },
   methods: {
     getModuleType() {
-      getModule({ organizeID: this.$store.getters.organizeID }).then(response => {
+      getModule({ organizeID: this.$store.getters.organizeId }).then(response => {
         this.modules = response.data[0]
       })
     },

+ 4 - 4
src/views/goods/list-select.vue

@@ -122,7 +122,7 @@ export default {
       listQuery: {
         index: 1,
         pageSize: 10,
-        organizeID: this.$store.getters.organizeID,
+        organizeID: this.$store.getters.organizeId,
         id: '',
         productName: '',
         shopName: '',
@@ -136,7 +136,7 @@ export default {
       return window.location.href.split('/').reverse()[0] * 1
     },
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {
@@ -145,7 +145,7 @@ export default {
   },
   methods: {
     getModuleType() {
-      getModule({ organizeID: this.$store.getters.organizeID }).then(response => {
+      getModule({ organizeID: this.$store.getters.organizeId }).then(response => {
         this.modules = response.data[0]
       })
     },
@@ -216,7 +216,7 @@ export default {
       this.multipleSelection.map(item => {
         itemsList.push(item.id)
       })
-      saveAddList({ itemsList: JSON.stringify(itemsList), organizeID: this.$store.getters.organizeID, modules: this.moduleId }).then(response => {
+      saveAddList({ itemsList: JSON.stringify(itemsList), organizeID: this.$store.getters.organizeId, modules: this.moduleId }).then(response => {
         this.$message({ message: response.msg, type: 'success', center: true })
         this.backToParentPath()
       }).catch(() => {

+ 70 - 167
src/views/goods/list.vue

@@ -1,67 +1,26 @@
 <template>
-  <div class="app-container" style="padding: 0 20px;">
-
-    <el-menu :router="true" default-active="/goods/list" class="el-menu-demo" mode="horizontal">
-      <el-menu-item index="/goods/list">全部商品</el-menu-item>
-      <el-menu-item v-if="modules && modules.firstModulesName" index="/goods/list/preferred">{{ modules.firstModulesName }}</el-menu-item>
-      <el-menu-item v-if="modules && modules.secondModulesName" index="/goods/list/preferential">{{ modules.secondModulesName }}</el-menu-item>
-      <el-menu-item v-if="modules && modules.thirdModulesName" index="/goods/list/commonly">{{ modules.thirdModulesName }}</el-menu-item>
-    </el-menu>
-
-    <div class="filter-container" style="padding: 20px 0;">
-      <el-form class="demo-form-inline goods-list">
-        <el-form-item label="商品ID:" style="width:190px;float: left;">
-          <el-input v-model="listQuery.id" type="number" placeholder="请输入商品ID" oninput="if(value.length>9)value=value.slice(0,9)" style="width: 120px;" class="filter-item" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item label="商品名称:" style="width:240px;float: left;">
-          <el-input v-model="listQuery.productName" placeholder="请输入商品名称" style="width: 150px;" class="filter-item" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item label="供应商名称:" style="width:250px;float: left;">
-          <el-input v-model="listQuery.shopName" placeholder="请输入供应商名称" style="width: 150px;" class="filter-item" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item label="商品状态:" style="width:190px;float: left;">
-          <el-select v-model="listQuery.validFlag" placeholder="商品状态" clearable style="width: 110px" class="filter-item" value="" @change="handleFilter">
-            <el-option label="全部" value="" />
-            <el-option label="已上架" value="1" />
-            <el-option label="已下架" value="2" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="商品分类:" style="width:210px;float: left;">
-          <el-select v-model="listQuery.classifyID" placeholder="商品分类" clearable style="width: 120px" class="filter-item" value="" @change="handleFilter">
-            <template v-for="item in classify">
-              <el-option v-if="item.status*1 === 1" :key="item.id" :label="item.classifyName" :value="item.id" />
-            </template>
-          </el-select>
-        </el-form-item>
-        <el-form-item v-if="modules && modules.firstModulesName" :label="modules.firstModulesName+':'" style="width:180px;float: left;">
-          <el-select v-model="listQuery.preferredProduct" placeholder="请选择" clearable style="width: 90px" class="filter-item" value="" @change="handleFilter">
-            <!-- <el-option label="全部" value="" /> -->
-            <el-option label="是" value="1" />
-            <el-option label="否" value="0" />
-          </el-select>
-        </el-form-item>
-        <el-form-item v-if="modules && modules.secondModulesName" :label="modules.secondModulesName+':'" style="width:180px;float: left;">
-          <el-select v-model="listQuery.preferentialProduct" placeholder="请选择" clearable style="width: 90px" class="filter-item" value="" @change="handleFilter">
-            <!-- <el-option label="全部" value="" /> -->
-            <el-option label="是" value="1" />
-            <el-option label="否" value="0" />
-          </el-select>
-        </el-form-item>
-        <el-form-item v-if="modules && modules.thirdModulesName" :label="modules.thirdModulesName+':'" style="width:200px;float: left;">
-          <el-select v-model="listQuery.commonlyProduct" placeholder="请选择" clearable style="width: 90px" class="filter-item" value="" @change="handleFilter">
-            <!-- <el-option label="全部" value="" /> -->
-            <el-option label="是" value="1" />
-            <el-option label="否" value="0" />
-          </el-select>
-        </el-form-item>
-        <el-form-item style="width:100px;float: left;">
-          <el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
-            搜索
-          </el-button>
-        </el-form-item>
-      </el-form>
+  <div class="app-container">
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>商品名称:</span>
+        <el-input v-model="listQuery.productName" style="width:130px;" placeholder="商品名称" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>供应商名称:</span>
+        <el-input v-model="listQuery.shopName" style="width:130px;" placeholder="供应商名称" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>商品状态:</span>
+        <el-select v-model="listQuery.validFlag" placeholder="商品状态" clearable style="width: 110px" value="" @change="getList">
+          <el-option label="所有" value="" />
+          <el-option label="已上架" value="1" />
+          <el-option label="已下架" value="2" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+      </div>
     </div>
-
     <el-table
       v-loading="listLoading"
       :data="list"
@@ -77,19 +36,21 @@
           <span style="white-space:nowrap;text-overflow:initial;">{{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="商品ID" align="center" prop="id" width="50" />
       <el-table-column label="商品图片" align="center" prop="mainImage">
         <template slot-scope="{row}">
-          <img :src="row.mainImage" alt="" width="50">
+          <el-popover
+            placement="top-start"
+            title=""
+            width="120"
+            trigger="hover"
+          >
+            <img :src="row.mainImage" alt="" style="width:100px;height:100px;">
+            <img slot="reference" :src="row.mainImage" alt="" style="width:50px;height:50px;">
+          </el-popover>
         </template>
       </el-table-column>
       <el-table-column label="商品名称" align="center" prop="productName" min-width="200" />
       <el-table-column label="供应商" align="center" prop="shopName" min-width="110" />
-      <el-table-column label="市场价" align="center">
-        <template slot-scope="{row}">
-          ¥{{ row.normalPrice | toThousandFloatFilter }}
-        </template>
-      </el-table-column>
       <el-table-column label="成本价" align="center">
         <template slot-scope="{row}">
           ¥{{ row.costPrice | toThousandFloatFilter }}
@@ -97,37 +58,7 @@
       </el-table-column>
       <el-table-column label="售价" align="center">
         <template slot-scope="{row}">
-          <template v-if="row.ladderPriceFlag*1===1">
-            <div v-for="(item, index) in row.ladderShownList" :key="row.id+'list_ladder_pri'+index">
-              ¥{{ item.price | toThousandFloatFilter }}</div>
-          </template>
-          <template v-else>¥{{ row.retailPrice | toThousandFloatFilter }}</template>
-        </template>
-      </el-table-column>
-      <el-table-column label="起订量" align="center" width="70">
-        <template slot-scope="{row}">
-          <template v-if="row.ladderPriceFlag*1===1">
-            <div v-for="(item, index) in row.ladderShownList" :key="row.id+'list_ladder_pri'+index">{{ item.number }}</div>
-          </template>
-          <template v-else>{{ row.minBuyNumber }}</template>
-        </template>
-      </el-table-column>
-      <el-table-column v-if="modules && modules.firstModulesName" :label="modules.firstModulesName" align="center" prop="preferredProduct" width="50">
-        <template slot-scope="{row}">
-          <!--<el-tag :type="row.preferredProduct | statusFilter">{{ row.preferredProduct*1 === 1 ? '启用' : '停用' }}</el-tag>-->
-          <i v-if="row.preferredProduct*1 === 1" class="el-icon-success" type="success" />
-        </template>
-      </el-table-column>
-      <el-table-column v-if="modules && modules.secondModulesName" :label="modules.secondModulesName" align="center" prop="preferentialProduct" width="50">
-        <template slot-scope="{row}">
-          <!--<el-tag :type="row.preferentialProduct | statusFilter">{{ row.preferentialProduct*1 === 1 ? '启用' : '停用' }}</el-tag>-->
-          <i v-if="row.preferentialProduct*1 === 1" class="el-icon-success" type="success" />
-        </template>
-      </el-table-column>
-      <el-table-column v-if="modules && modules.thirdModulesName" :label="modules.thirdModulesName" align="center" prop="commonlyProduct" width="50">
-        <template slot-scope="{row}">
-          <!--<el-tag :type="row.commonlyProduct | statusFilter">{{ row.commonlyProduct*1 === 1 ? '启用' : '停用' }}</el-tag>-->
-          <i v-if="row.commonlyProduct*1 === 1" class="el-icon-success" type="success" />
+          ¥{{ row.price | toThousandFloatFilter }}
         </template>
       </el-table-column>
       <el-table-column class-name="status-col" label="商品状态" align="center" prop="validFlag">
@@ -135,23 +66,22 @@
           <el-tag :type="row.validFlag | statusFilter">{{ row.validFlag*1 === 1 ? '已上架' : '已下架' }}</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="商品分类" align="center" prop="productClassifyName" width="100" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="{row}">
-          <el-button type="primary" size="mini" style="width: 70px;margin:5px 0 0 0;" @click="handleEdit(row)">编辑</el-button>
-          <el-button :type="row.validFlag*1 === 1 ? 'danger' : 'success'" size="mini" style="width: 70px;margin:5px 0 0 0;" @click="handleSwitch(row)">{{ row.validFlag*1 === 1 ? '下架' : '上架' }}</el-button>
-        </template>
-      </el-table-column>
       <el-table-column align="center" label="添加时间" prop="addTime">
         <template v-if="row.addTime" slot-scope="{row}">
           <span>{{ row.addTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="操作" align="center">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="handleEdit(row)">编辑</el-button>
+          <el-button :type="row.validFlag*1 === 1 ? 'warning' : 'primary'" size="mini" @click="handleSwitch(row)">{{ row.validFlag*1 === 1 ? '下架' : '上架' }}</el-button>
+        </template>
+      </el-table-column>
     </el-table>
 
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="fetchData" />
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
 
-    <PriceEdit ref="priceChild" :dialog-title="dialogTitle" :is-visible.sync="dialogFormVisible" :product-detail="dialogData" :classify="classify" />
+    <PriceEdit ref="priceChild" :dialog-title="dialogTitle" :is-visible.sync="dialogFormVisible" :product="dialogData" />
 
     <template>
       <el-backtop style="right: 40px; bottom: 40px;">
@@ -162,7 +92,7 @@
 </template>
 
 <script>
-import { getList, getModule, switchGoods } from '@/api/goods'
+import { getList, switchGoods } from '@/api/goods'
 import PriceEdit from './components/price-edit'
 import Pagination from '@/components/Pagination'
 export default {
@@ -171,7 +101,7 @@ export default {
     statusFilter(status) {
       const statusMap = {
         1: 'success',
-        0: 'danger'
+        0: 'warning'
       }
       return statusMap[status]
     }
@@ -180,24 +110,17 @@ export default {
     return {
       pageNum: 0,
       activeIndex: '0',
-      list: null,
+      list: [],
       modules: null,
-      classify: null,
       listLoading: true,
       total: 0,
       listQuery: {
         index: 1,
         pageSize: 10,
-        organizeID: this.$store.getters.organizeID,
-        id: '',
+        organizeID: this.$store.getters.organizeId,
         productName: '',
         shopName: '',
-        classifyID: '', // 商品分类
-        validFlag: '', // '商品状态,1已上架,2已下架',
-        preferredProduct: '', // 是否是优选商品:0不是优选,1优选商品',
-        commonlyProduct: '', // 是否是常用商品:0不是常用,1常用商品',
-        preferentialProduct: '', // 是否是星范精品:0不是精品,1星范精品商品',
-        productClassifyName: '' // '对应cm_mall_products_classify商品分类表id',
+        validFlag: '' // '商品状态,1已上架,2已下架',
       },
       dialogData: {},
       dialogFormVisible: false,
@@ -207,55 +130,31 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {
-    this.getModuleType()
-    this.fetchData()
+    this.getList()
   },
   methods: {
-    getModuleType() {
-      getModule({ organizeID: this.$store.getters.organizeID }).then(response => {
-        this.modules = response.data[0]
-      })
-    },
-    fetchData() {
+    async getList() {
+      // 获取商品列表
       this.listLoading = true
-      getList(this.listQuery).then(response => {
-        const { organizeProductsPage, listByEffective } = response.data
-        this.pageNum = organizeProductsPage.index
-        this.list = organizeProductsPage.results
-        this.total = organizeProductsPage.totalRecord
-        this.classify = listByEffective
+      try {
+        const res = await getList(this.listQuery)
+        console.log('res', res)
+        this.pageNum = res.data.index
+        this.list = res.data.results
+        this.total = res.data.totalRecord
         this.listLoading = false
-        this.list.map(row => {
-          row.ladderShownList = []
-          if (row.ladderPriceFlag * 1 === 1 && row.ladderPriceList != null) {
-            for (let i = 0; i < row.ladderPriceList.length; i++) {
-              if (row.ladderPriceList[i] && row.ladderPriceList[i].delFlag * 1 === 0) {
-                let str = ''
-                if (row.ladderPriceList[i + 1] && row.ladderPriceList[i + 1].delFlag * 1 === 0) {
-                  str = row.ladderPriceList[i].buyNum + '-' + (row.ladderPriceList[i + 1].buyNum - 1)
-                } else {
-                  str = '≥' + row.ladderPriceList[i].buyNum
-                }
-                row.ladderShownList.push({
-                  price: row.ladderPriceList[i].buyPrice,
-                  number: str
-                })
-              }
-            }
-          }
-        })
-      })
-    },
-    handleFilter() {
-      this.fetchData()
+      } catch (error) {
+        console.log('error', error)
+      }
     },
     handleSwitch(row) {
+      // 操作上下架
       if (row.validFlag === '1') {
-        this.$confirm('确定下架该商品吗?下架后该商品将不会出现在小程序商城。', '系统提示', {
+        this.$confirm('确定下架该商品吗?下架后该商品将不会再出现在联合丽格商城', '系统提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
@@ -272,17 +171,21 @@ export default {
         })
       }
     },
-    handSwithGoods(row) {
-      switchGoods({ id: row.id }).then(() => {
-        this.fetchData()
-      }).catch(() => {
-        this.fetchData()
-      })
+    async handSwithGoods(row) {
+      // 上下架接口
+      try {
+        const res = await switchGoods(row.id)
+        this.$message({ message: res.msg, type: 'success', center: true })
+        this.getList()
+      } catch (error) {
+        console.log('error', error)
+      }
     },
     handleEdit(row) {
+      // 操作编辑商品
       this.dialogData = Object.assign({}, row)
       this.dialogFormVisible = true
-      this.$refs['priceChild'].clearValidate()
+      // this.$refs['priceChild'].clearValidate()
     }
   }
 }

+ 71 - 52
src/views/order/detail.vue

@@ -13,9 +13,9 @@
     <el-card v-if="order" class="box-card">
       <div class="refund-item">
         <el-row :gutter="24" class="box-row">
-          <el-col :span="6"><b>订单编号(ID):</b> {{ order.orderNo + '(' + order.orderID + ')' }}</el-col>
-          <el-col :span="6"><b>下单时间:</b> {{ order.orderTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</el-col>
-          <el-col :span="6"><b>订单状态:</b>
+          <el-col :span="6"><b>下单时间:</b> {{ order.orderTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</el-col>
+          <el-col :span="6"><b>订单编号(ID):</b> {{ order.orderNo + '(' + order.orderID + ')' }}</el-col>
+          <el-col :span="6"><b>订单状态</b>
             <template v-if="['11','12','13','21','22','23','31','32','33'].indexOf(order.status)>=0">
               <el-tag type="success" size="small">{{ '交易中('+statusObj[order.status]+')' }}</el-tag>
             </template>
@@ -23,27 +23,9 @@
               <el-tag :type="order.status*1===6?'info':''" size="small">{{ statusObj[order.status] }}</el-tag>
             </template>
           </el-col>
-          <el-col v-if="order.bpOrderUserinfo" :span="6"><b>买家:</b> {{ order.bpOrderUserinfo.name }}</el-col>
-        </el-row>
-        <el-row :gutter="24" class="box-row">
-          <el-col :span="6"><b>收款状态:</b>
-            <el-tag v-if="order.receiptStatus*1===1" type="danger" size="small">待收款</el-tag>
-            <el-tag v-if="order.receiptStatus*1===2" type="warning" size="small">部分收款</el-tag>
-            <el-tag v-if="order.receiptStatus*1===3" type="success" size="small">已收款</el-tag>
-          </el-col>
-          <el-col :span="6"><b>退款状态:</b>
-            <el-tag v-if="order.refundType*1===1" type="warning" size="small">部分退款</el-tag>
-            <el-tag v-else-if="order.refundType*1===2" type="danger" size="small">已退款</el-tag>
-            <el-tag v-else type="info" size="small">无退款</el-tag>
-          </el-col>
-          <el-col :span="6"><b>发货状态:</b>
-            <el-tag v-if="order.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
-            <el-tag v-if="order.sendOutStatus*1===2" type="warning" size="small">部分发货</el-tag>
-            <el-tag v-if="order.sendOutStatus*1===3" type="success" size="small">已发货</el-tag>
-          </el-col>
           <el-col :span="6">
             <el-dropdown class="dropdown">
-              <el-button type="primary">
+              <el-button type="primary" size="mini">
                 功能<i class="el-icon-arrow-down el-icon--right" />
               </el-button>
               <el-dropdown-menu slot="dropdown">
@@ -55,51 +37,90 @@
             </el-dropdown>
           </el-col>
         </el-row>
+        <el-row :gutter="24" class="box-row">
+          <el-col :span="6"><b>收款状态:</b>
+            <el-tag v-if="order.receiptStatus*1===1" type="danger" size="small">待收款</el-tag>
+            <el-tag v-if="order.receiptStatus*1===2" type="warning" size="small">部分收款</el-tag>
+            <el-tag v-if="order.receiptStatus*1===3" type="success" size="small">已收款</el-tag>
+          </el-col>
+          <el-col :span="6"><b>发货状态:</b>
+            <el-tag v-if="order.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
+            <el-tag v-if="order.sendOutStatus*1===2" type="warning" size="small">部分发货</el-tag>
+            <el-tag v-if="order.sendOutStatus*1===3" type="success" size="small">已发货</el-tag>
+          </el-col>
+          <el-col :span="6"><b>付款状态:</b>
+            <el-tag v-if="order.refundType*1===1" type="warning" size="small">部分付款</el-tag>
+            <el-tag v-else-if="order.refundType*1===2" type="danger" size="small">已付款</el-tag>
+            <el-tag v-else type="info" size="small">无付款</el-tag>
+          </el-col>
+          <el-col :span="6"><b>退款状态:</b>
+            <el-tag v-if="order.refundType*1===1" type="warning" size="small">部分退款</el-tag>
+            <el-tag v-else-if="order.refundType*1===2" type="danger" size="small">已退款</el-tag>
+            <el-tag v-else type="info" size="small">无退款</el-tag>
+          </el-col>
+        </el-row>
       </div>
       <div class="refund-item">
         <el-row v-if="order.bpOrderUserinfo" :gutter="24" class="box-row">
-          <el-col :span="6"><b>收货人:</b> {{ order.bpOrderUserinfo.shouHuoRen }}</el-col>
-          <el-col :span="6"><b>手机:</b> {{ order.bpOrderUserinfo.mobile }}</el-col>
-          <el-col :span="12"><b>地址:</b> {{ order.bpOrderUserinfo.province +' '+ order.bpOrderUserinfo.city +' '+ order.bpOrderUserinfo.town +' '+ order.bpOrderUserinfo.address }}</el-col>
+          <el-col v-if="order.bpOrderUserinfo" :span="6"><b>机构:</b> {{ order.bpOrderUserinfo.name }}</el-col>
+        </el-row>
+        <el-row v-if="order.bpOrderUserinfo" :gutter="24" class="box-row">
+          <el-col :span="6"><b>收货人:</b> {{ order.bpOrderUserinfo.shouHuoRen }}</el-col>
+          <el-col :span="6"><b>手机:</b> {{ order.bpOrderUserinfo.mobile }}</el-col>
+          <el-col :span="12"><b>地址:</b> {{ order.bpOrderUserinfo.province +' '+ order.bpOrderUserinfo.city +' '+ order.bpOrderUserinfo.town +' '+ order.bpOrderUserinfo.address }}</el-col>
         </el-row>
         <el-row :gutter="24" class="box-row">
           <el-col :span="6"><b>订单金额:</b> ¥{{ order.payTotalFee | toThousandFloatFilter }}</el-col>
-          <el-col :span="6"><b>已收金额:</b>
+          <el-col :span="6"><b>应收金额:</b>
+            ¥{{ order.payableAmount | toThousandFloatFilter }}
+          </el-col>
+          <el-col :span="12"><b>已收金额:</b>
             <template v-if="order.receiptStatus*1===1">¥0.00</template>
             <template v-else>¥{{ receiptAmount | toThousandFloatFilter }}</template>
           </el-col>
-          <el-col :span="12"><b>应收金额:</b> ¥{{ order.payableAmount | toThousandFloatFilter }}<span style="color:red;"> (账户余额抵扣:¥{{ order.balancePayFee | toThousandFloatFilter }})</span></el-col>
+
         </el-row>
         <el-row :gutter="24" class="box-row">
-          <el-col :span="6"><b>经理折扣:</b>
-            <template v-if="order.discountFee<0">¥0.00</template>
-            <template v-else>
-              ¥{{ order.discountFee>returnedPurchaseFee ? (order.discountFee - returnedPurchaseFee) : '0' }}
-              <span style="color:red;">(原:¥{{ order.discountFee | toThousandFloatFilter }},
-                折扣取消:¥<template v-if="order.discountFee>returnedPurchaseFee">{{ returnedPurchaseFee | toThousandFloatFilter }}</template>
-                <template v-else>{{ order.discountFee | toThousandFloatFilter }}</template>)</span>
-            </template>
+          <el-col :span="6"><b>退款金额(已完成):</b> ¥{{ returnValue | toThousandFloatFilter }}
           </el-col>
-          <el-col :span="6"><b>运费:</b>
+          <el-col :span="6"><b>运费:</b>
             <template v-if="order.freight*1===0">包邮</template>
             <template v-else-if="order.freight*1===-1">到付</template>
             <template v-else-if="order.freight*1===-2">仪器到付-产品包邮</template>
             <template v-else>¥{{ order.freight }}</template>
           </el-col>
-          <el-col :span="12"><b>退款金额(已完成):</b> ¥{{ returnValue | toThousandFloatFilter }}
-            <span style="color:red;">(原:¥{{ returnedPurchaseFee | toThousandFloatFilter }},
-              折扣取消:¥<template v-if="order.discountFee>returnedPurchaseFee">{{ returnedPurchaseFee | toThousandFloatFilter }}</template>
-              <template v-else>{{ order.discountFee | toThousandFloatFilter }}</template>)</span>
-          </el-col>
         </el-row>
       </div>
       <div class="refund-item">
         <div v-for="shopOrder in order.newShopOrders" :key="shopOrder.shopOrderID" class="order-item">
           <el-row :gutter="22" class="box-row">
-            <el-col :span="9"><b>子订单号(ID):</b> {{ shopOrder.shopOrderNo + '(' + shopOrder.shopOrderID + ')' }}</el-col>
-            <el-col :span="5"><b>下单时间:</b> {{ shopOrder.orderTime }}</el-col>
-            <el-col :span="5"><b>子订单金额:</b> ¥{{ shopOrder.needPayAmount | toThousandFloatFilter }}</el-col>
-            <el-col :span="5"><b>发货状态:</b>
+            <el-col :span="6"><b>下单时间:</b> {{ shopOrder.orderTime }}</el-col>
+            <el-col :span="6"><b>子订单号(ID):</b> {{ shopOrder.shopOrderNo + '(' + shopOrder.shopOrderID + ')' }}</el-col>
+            <el-col :span="6"><b>子订单金额:</b> ¥{{ shopOrder.needPayAmount | toThousandFloatFilter }}</el-col>
+            <el-col :span="6"><b>发货状态:</b>
+              <el-tag v-if="shopOrder.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
+              <el-tag v-if="shopOrder.sendOutStatus*1===2" type="warning" size="small">部分发货</el-tag>
+              <el-tag v-if="shopOrder.sendOutStatus*1===3" type="success" size="small">已发货</el-tag>
+            </el-col>
+          </el-row>
+          <el-row :gutter="22" class="box-row">
+            <el-col :span="6"><b>商品总额:</b> {{ shopOrder.orderTime }}</el-col>
+            <el-col :span="6"><b>应付金额:</b> {{ shopOrder.shopOrderNo + '(' + shopOrder.shopOrderID + ')' }}</el-col>
+            <el-col :span="6"><b>已付金额:</b> ¥{{ shopOrder.needPayAmount | toThousandFloatFilter }}</el-col>
+            <el-col :span="6"><b>待付金额:</b> ¥{{ shopOrder.needPayAmount | toThousandFloatFilter }}</el-col>
+          </el-row>
+          <el-row :gutter="22" class="box-row">
+            <el-col :span="6"><b>收款状态:</b>
+              <el-tag v-if="shopOrder.receiptStatus*1===1" type="danger" size="small">待收款</el-tag>
+              <el-tag v-if="shopOrder.receiptStatus*1===2" type="warning" size="small">部分收款</el-tag>
+              <el-tag v-if="shopOrder.receiptStatus*1===3" type="success" size="small">已收款</el-tag>
+            </el-col>
+            <el-col :span="6"><b>付款状态:</b>
+              <el-tag v-if="shopOrder.refundType*1===1" type="warning" size="small">部分付款</el-tag>
+              <el-tag v-else-if="shopOrder.refundType*1===2" type="danger" size="small">已付款</el-tag>
+              <el-tag v-else type="info" size="small">无付款</el-tag>
+            </el-col>
+            <el-col :span="6"><b>发货状态:</b>
               <el-tag v-if="shopOrder.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
               <el-tag v-if="shopOrder.sendOutStatus*1===2" type="warning" size="small">部分发货</el-tag>
               <el-tag v-if="shopOrder.sendOutStatus*1===3" type="success" size="small">已发货</el-tag>
@@ -132,7 +153,6 @@
         </div>
       </div>
     </el-card>
-
     <Remarks dialog-title="订单备注信息" :is-visible.sync="dialogRemarksVisible" :order-id="dialogRemarksOrderId" :remark-list="dialogRemarkList" />
     <template>
       <el-backtop style="right: 40px; bottom: 40px;">
@@ -178,7 +198,7 @@ export default {
   },
   computed: {
     orderID: function() {
-      return window.location.href.split('/').reverse()[0] * 1
+      return this.$route.query.orderID * 1
     }
   },
   created() {
@@ -237,14 +257,13 @@ export default {
     margin-top: -10px;
   }
   .refund-item{
+    padding: 10px 0;
     border-bottom:1px dashed #E4E7ED;
-    margin-bottom: 20px;
   }
   .order-item{
-    border-bottom: 1px solid #DCDFE6;
-    background:#F2F6FC;
-    margin-top: 20px;
-    padding: 5px 15px 0;
+    background:#f7f7f7;
+    margin-bottom: 20px;
+    padding: 10px 15px;
     border-radius: 5px;
   }
   .product-row{

+ 133 - 90
src/views/order/list.vue

@@ -1,83 +1,107 @@
 <template>
   <div class="app-container">
     <div class="filter-container">
-      <el-form ref="searchForm" :inline="true" class="demo-form-inline">
-        <el-form-item label="订单ID:" style="width:180px;float: left;">
-          <el-input v-model="listQuery.orderID" type="number" placeholder="请输入订单ID" oninput="if(value.length>9)value=value.slice(0,9)" style="width: 120px;" class="filter-item" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item label="订单号:" style="width:180px;float: left;">
-          <el-input v-model="listQuery.orderNo" placeholder="请输入订单号" style="width: 120px;" class="filter-item" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item label="买家:" style="width:200px;float: left;">
-          <el-input v-model="listQuery.buyer" placeholder="请输入买家名称" style="width: 150px;" class="filter-item" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item label="收货人:" style="width:180px;float: left;">
-          <el-input v-model="listQuery.receiver" placeholder="请输入收货人" style="width: 120px;" class="filter-item" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item class="date-box" label="下单时间:" style="width:405px;float: left;">
-          <el-date-picker
-            v-model="listQuery.startTime"
-            style="width:150px;margin-bottom: 10px;"
-            type="date"
-            placeholder="请选择日期"
-            format="yyyy-MM-dd"
-            value-format="yyyy-MM-dd"
-          />
-          至
-          <el-date-picker
-            v-model="listQuery.endTime"
-            style="width:150px;margin-bottom: 10px;"
-            type="date"
-            placeholder="请选择日期"
-            format="yyyy-MM-dd"
-            value-format="yyyy-MM-dd"
-          />
-        </el-form-item>
-        <el-form-item class="date-box" label="订单状态:" style="width:200px;float: left;">
-          <el-select v-model="listQuery.status" placeholder="订单状态" clearable style="width: 110px" class="filter-item" value="" @change="handleFilter">
-            <el-option label="待确认" value="0" />
-            <el-option label="交易中" value="99" />
-            <el-option label="交易完成" value="4" />
-            <el-option label="订单完成" value="5" />
-            <el-option label="已关闭" value="6" />
-            <el-option label="交易全退" value="7" />
-          </el-select>
-        </el-form-item>
-        <el-form-item class="date-box" label="收款状态:" style="width:200px;float: left;">
-          <el-select v-model="listQuery.receiptStatus" placeholder="收款状态" clearable style="width: 110px" class="filter-item" value="" @change="handleFilter">
-            <el-option label="待收款" value="1" />
-            <el-option label="部分收款" value="2" />
-            <el-option label="已收款" value="3" />
-          </el-select>
-
-        </el-form-item>
-        <el-form-item class="date-box" label="发货状态:" style="width:200px;float: left;">
-          <el-select v-model="listQuery.sendOutStatus" placeholder="发货状态" clearable style="width: 110px" class="filter-item" value="" @change="handleFilter">
-            <el-option label="待发货" value="1" />
-            <el-option label="部分发货" value="2" />
-            <el-option label="已发货" value="3" />
-          </el-select>
-
-        </el-form-item>
-        <el-form-item class="date-box" label="退款状态:" style="width:200px;float: left;">
-          <el-select v-model="listQuery.refundType" placeholder="退款状态" clearable style="width: 110px" class="filter-item" value="" @change="handleFilter">
-            <el-option label="无退款" value="0" />
-            <el-option label="部分退款" value="1" />
-            <el-option label="已退款" value="2" />
-          </el-select>
-        </el-form-item>
-        <el-form-item class="date-box" label="待审核退款:" style="width:220px;float: left;">
-          <el-select v-model="listQuery.returnedPurchaseStatus" placeholder="待审核退款" clearable style="width: 120px" class="filter-item" value="" @change="handleFilter">
-            <el-option label="有" value="1" />
-            <el-option label="无" value="0" />
-          </el-select>
-        </el-form-item>
-        <el-form-item style="width:100px;float: left;">
-          <el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
-        </el-form-item>
-      </el-form>
+      <div class="filter-control">
+        <span>订单ID:</span>
+        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>订单号:</span>
+        <el-input v-model="listQuery.orderNo" style="width:180px;" placeholder="订单号" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>机构名称:</span>
+        <el-input v-model="listQuery.buyer" placeholder="机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>收货人:</span>
+        <el-input v-model="listQuery.receiver" style="width:120px;" placeholder="收货人" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>商品名称:</span>
+        <el-input v-model="listQuery.receiver" placeholder="商品名称" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>订单状态:</span>
+        <el-select v-model="listQuery.status" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option label="待确认" value="0" />
+          <el-option label="交易中" value="99" />
+          <el-option label="交易完成" value="4" />
+          <el-option label="订单完成" value="5" />
+          <el-option label="已关闭" value="6" />
+          <el-option label="交易全退" value="7" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>收款状态:</span>
+        <el-select v-model="listQuery.receiptStatus" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option label="待收款" value="1" />
+          <el-option label="部分收款" value="2" />
+          <el-option label="已收款" value="3" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>发货状态:</span>
+        <el-select v-model="listQuery.sendOutStatus" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option label="待发货" value="1" />
+          <el-option label="部分发货" value="2" />
+          <el-option label="已发货" value="3" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>付款状态:</span>
+        <el-select v-model="listQuery.sendOutStatus" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option label="待付款" value="1" />
+          <el-option label="部分付款" value="2" />
+          <el-option label="已付款" value="3" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>退款状态:</span>
+        <el-select v-model="listQuery.refundType" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option label="无退款" value="0" />
+          <el-option label="部分退款" value="1" />
+          <el-option label="已退款" value="2" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>待审核退款:</span>
+        <el-select v-model="listQuery.returnedPurchaseStatus" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option label="有" value="1" />
+          <el-option label="无" value="0" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>待审核退款:</span>
+        <el-select v-model="listQuery.returnedPurchaseStatus" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option label="协销订单" value="1" />
+          <el-option label="自主订单" value="0" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>下单时间:</span>
+        <el-date-picker
+          v-model="time"
+          type="daterange"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+          @change="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+      </div>
     </div>
-
     <el-table
       v-loading="listLoading"
       :data="list"
@@ -89,7 +113,7 @@
     >
       <el-table-column label="订单ID" align="center" prop="orderID" width="65" />
       <el-table-column label="订单编号" align="center" prop="orderNo" />
-      <el-table-column label="买家" align="center" prop="buyer" />
+      <el-table-column label="机构" align="center" prop="buyer" />
       <el-table-column label="收货人" align="center" prop="receiver" />
       <el-table-column label="订单状态" align="center" prop="status" width="150px">
         <template slot-scope="{row}">
@@ -108,6 +132,13 @@
           <el-tag v-if="row.receiptStatus*1===3" type="success" size="small">已收款</el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="付款状态" align="center" prop="receiptStatus">
+        <template slot-scope="{row}">
+          <el-tag v-if="row.receiptStatus*1===1" type="danger" size="small">待付款</el-tag>
+          <el-tag v-if="row.receiptStatus*1===2" type="warning" size="small">部分付款</el-tag>
+          <el-tag v-if="row.receiptStatus*1===3" type="success" size="small">已付款</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="发货状态" align="center" prop="sendOutStatus">
         <template slot-scope="{row}">
           <el-tag v-if="row.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
@@ -138,12 +169,10 @@
           <span>{{ row.orderTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
-          <router-link :to="'/order/detail/' + row.orderID ">
-            <el-button type="primary" size="mini" style="width: 70px;margin:5px 0 0 0;">查看详情</el-button>
-          </router-link>
-          <el-dropdown>
+          <el-button type="primary" size="mini" @click="handleDetailes(row.orderID)">查看详情</el-button>
+          <!-- <el-dropdown>
             <el-button type="success" size="mini" style="width: 70px;margin:5px 0 0 0;">
               功能<i class="el-icon-arrow-down el-icon--right" />
             </el-button>
@@ -153,12 +182,12 @@
               <el-dropdown-item v-if="['0','11','6'].indexOf(row.status)<0"><router-link :to="'/order/refund-record/' + row.orderID ">收退款记录</router-link></el-dropdown-item>
               <el-dropdown-item v-if="['0','11','6'].indexOf(row.status)<0"><router-link :to="'/order/refund-return/' + row.orderID ">退款(退货)记录</router-link></el-dropdown-item>
             </el-dropdown-menu>
-          </el-dropdown>
+          </el-dropdown> -->
         </template>
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="fetchData" />
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
 
     <Remarks dialog-title="订单备注信息" :is-visible.sync="dialogRemarksVisible" :order-id="dialogRemarksOrderId" :remark-list="dialogRemarkList" />
     <template>
@@ -172,11 +201,14 @@
 <script>
 import { getList, getRemarks } from '@/api/order'
 import Pagination from '@/components/Pagination'
+import pickerOptions from '@/utils/time-picker.js'
 import Remarks from './components/remarks'
 export default {
   components: { Pagination, Remarks },
   data() {
     return {
+      time: '',
+      pickerOptions,
       list: null,
       listLoading: true,
       total: 0,
@@ -186,7 +218,7 @@ export default {
       listQuery: {
         index: 1,
         pageSize: 20,
-        organizeID: this.$store.getters.organizeID,
+        organizeID: this.$store.getters.organizeId,
         orderID: '',
         orderNo: '',
         buyer: '',
@@ -219,14 +251,24 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {
-    this.fetchData()
+    this.getList()
   },
   methods: {
-    fetchData() {
+    initTime() {
+      // 初始化获取时间筛选值
+      if (this.time && this.time.length > 0) {
+        this.listQuery.startTime = this.time[0]
+        this.listQuery.endTime = this.time[1]
+      } else {
+        this.listQuery.startTime = ''
+        this.listQuery.endTime = ''
+      }
+    },
+    getList() {
       this.listLoading = true
       getList(this.listQuery).then(response => {
         this.list = response.data.results
@@ -236,8 +278,9 @@ export default {
         this.listLoading = false
       })
     },
-    handleFilter() {
-      this.fetchData()
+    // 查看订单详情
+    handleDetailes(orderID) {
+      this.$router.push({ path: '/order/detail', query: { orderID: orderID }})
     },
     RemarksOrder: function(id) {
       getRemarks({ orderID: id }).then(response => {

+ 9 - 9
src/views/order/refund.vue

@@ -3,16 +3,16 @@
     <div class="filter-container">
       <el-form ref="searchForm" :inline="true" class="demo-form-inline">
         <el-form-item label="退款编号:" style="width:215px;float: left;">
-          <el-input v-model="listQuery.returnedNo" placeholder="请输入退款编号" style="width: 140px;" class="filter-item" @keyup.enter.native="handleFilter" />
+          <el-input v-model="listQuery.returnedNo" placeholder="退款编号" style="width: 140px;" class="filter-item" @keyup.enter.native="handleFilter" />
         </el-form-item>
         <el-form-item label="订单ID:" style="width:180px;float: left;">
-          <el-input v-model="listQuery.orderID" type="number" oninput="if(value.length>9)value=value.slice(0,9)" placeholder="请输入订单ID" style="width: 120px;" class="filter-item" @keyup.enter.native="handleFilter" />
+          <el-input v-model="listQuery.orderID" type="number" oninput="if(value.length>9)value=value.slice(0,9)" placeholder="订单ID" style="width: 120px;" class="filter-item" @keyup.enter.native="handleFilter" />
         </el-form-item>
         <el-form-item label="订单编号:" style="width:215px;float: left;">
-          <el-input v-model="listQuery.orderNo" placeholder="请输入订单编号" style="width: 140px;" class="filter-item" @keyup.enter.native="handleFilter" />
+          <el-input v-model="listQuery.orderNo" placeholder="订单编号" style="width: 140px;" class="filter-item" @keyup.enter.native="handleFilter" />
         </el-form-item>
-        <el-form-item label="买家:" style="width:190px;float: left;">
-          <el-input v-model="listQuery.userName" placeholder="请输入买家名称" style="width: 140px;" class="filter-item" @keyup.enter.native="handleFilter" />
+        <el-form-item label="机构:" style="width:190px;float: left;">
+          <el-input v-model="listQuery.userName" placeholder="机构名称" style="width: 140px;" class="filter-item" @keyup.enter.native="handleFilter" />
         </el-form-item>
         <el-form-item label="退款审核状态:" style="width:240px;float: left;">
           <el-select v-model="listQuery.status" placeholder="退款审核状态" clearable style="width: 130px" class="filter-item" value="" @change="handleFilter">
@@ -41,7 +41,7 @@
           />
         </el-form-item>
         <el-form-item style="width:100px;float: left;">
-          <el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
+          <el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">查询</el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -63,7 +63,7 @@
           <el-tag v-if="row.status*1===3" type="danger" size="small">审核不通过</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="买家" align="center" prop="userName" />
+      <el-table-column label="机构" align="center" prop="userName" />
       <el-table-column label="订单编号(ID)" align="center" prop="orderNo">
         <template slot-scope="{row}">{{ row.orderNo + '(' + row.orderID + ')' }}</template>
       </el-table-column>
@@ -123,7 +123,7 @@ export default {
       listQuery: {
         index: 1,
         pageSize: 20,
-        organizeID: this.$store.getters.organizeID,
+        organizeID: this.$store.getters.organizeId,
         returnedNo: '',
         orderID: '',
         orderNo: '',
@@ -136,7 +136,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {

+ 1 - 1
src/views/other/about.vue

@@ -36,7 +36,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {

+ 1 - 1
src/views/other/after.vue

@@ -25,7 +25,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {

+ 1 - 1
src/views/other/notes.vue

@@ -25,7 +25,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   created() {

+ 2 - 2
src/views/other/password.vue

@@ -46,7 +46,7 @@ export default {
   },
   computed: {
     organizeID() {
-      return this.$store.getters.organizeID
+      return this.$store.getters.organizeId
     }
   },
   methods: {
@@ -69,7 +69,7 @@ export default {
             })
             return
           }
-          const Formobj = { organizeID: this.$store.getters.organizeID }
+          const Formobj = { organizeID: this.$store.getters.organizeId }
           const params = Object.assign(Formobj, this.from)
           this.fullscreenLoading = true
           changePassword(params).then(response => {