wenjie 6 months ago
parent
commit
eed7b89988

+ 1 - 0
package.json

@@ -35,6 +35,7 @@
     "xlsx": "^0.16.0"
   },
   "devDependencies": {
+    "@babel/plugin-syntax-dynamic-import": "^7.8.3",
     "@vue/cli-plugin-babel": "4.4.4",
     "@vue/cli-plugin-eslint": "4.4.4",
     "@vue/cli-plugin-unit-jest": "4.4.4",

+ 71 - 2
src/api/auth.js

@@ -1,8 +1,8 @@
 /*
  * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
  * @Date: 2021-07-15 12:26:02
- * @LastEditors: wj 1454560336@qq.com
- * @LastEditTime: 2023-12-18 10:56:42
+ * @LastEditors: wenjie 1454560336@qq.com
+ * @LastEditTime: 2024-11-14 09:44:09
  * @FilePath: \admin-manage\src\api\auth.js
  * @Description: 
  * 
@@ -46,5 +46,74 @@ export function superadminList(params) {
   })
 }
 
+// 菜单管理
+export function getMenuList(params) {
+  return request({
+      url: '/zswl-cloud-shop/authMenu/search',
+      method: 'get',
+      params
+  })
+}
 
+// 添加编辑菜单
+export function addOrUpdateMenu(data) {
+  return request({
+      url: '/zswl-cloud-shop/authMenu/addOrUpdate',
+      method: 'post',
+      data
+  })
+}
 
+// 菜单层级数据
+export function getMenuData(params) {
+  return request({
+      url: '/zswl-cloud-shop/authMenu/search',
+      method: 'get',
+      params
+  })
+}
+
+// 菜单详情
+export function menuDetail(params) {
+  return request({
+      url: '/zswl-cloud-shop/authMenu/get',
+      method: 'get',
+      params
+  })
+}
+
+// 菜单删除
+export function delMenu(params) {
+  return request({
+      url: '/zswl-cloud-shop/authMenu/del',
+      method: 'get',
+      params
+  })
+}
+
+// 角色列表
+export function authRoleList(params) {
+  return request({
+      url: '/zswl-cloud-shop/authRole/search',
+      method: 'get',
+      params
+  })
+}
+
+// 角色启用禁用
+export function authRoleEnable(params) {
+  return request({
+      url: '/zswl-cloud-shop/authRole/enable',
+      method: 'get',
+      params
+  })
+}
+
+// 添加编辑角色
+export function addOrUpdateAuthRole(data) {
+  return request({
+      url: '/zswl-cloud-shop/authRole/addOrUpdate',
+      method: 'post',
+      data
+  })
+}

+ 4 - 4
src/layout/components/Sidebar/index.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author: wj 1454560336@qq.com
  * @Date: 2023-09-18 10:57:47
- * @LastEditors: wj 1454560336@qq.com
- * @LastEditTime: 2023-11-03 09:40:23
+ * @LastEditors: wenjie 1454560336@qq.com
+ * @LastEditTime: 2024-11-13 16:28:31
  * @FilePath: \admin-manage\src\layout\components\Sidebar\index.vue
  * @Description: 
  * 
@@ -22,7 +22,7 @@
         :collapse-transition="false"
         mode="vertical"
       >
-        <sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
+        <sidebar-item v-for="route in menus" :key="route.path" :item="route" :base-path="route.path" />
       </el-menu>
     </el-scrollbar>
   </div>
@@ -41,7 +41,7 @@ export default {
       'sidebar','menus'
     ]),
     routes() {
-      return this.$router.options.routes
+      return  this.$router.options.routes
     },
     activeMenu() {
       const route = this.$route

+ 25 - 24
src/permission.js

@@ -2,7 +2,7 @@
  * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
  * @Date: 2022-08-02 18:10:30
  * @LastEditors: wenjie 1454560336@qq.com
- * @LastEditTime: 2024-11-07 10:05:27
+ * @LastEditTime: 2024-11-13 16:21:09
  * @FilePath: \admin-manage\src\permission.js
  * @Description: 
  * 
@@ -45,32 +45,33 @@ router.beforeEach((to, from, next) => {
       next({ path: '/' })
       NProgress.done()
     } else {
-      next()
-      NProgress.done()
-      // const hasGetUserInfo = store.getters.menu
-      // if (store.getters.menus) {
-      //   next()
-      // } else {
-      //   try {
-      //     // 获取用户信息
-      //     store.dispatch('user/getMenu').then(res=>{
-      //       // res.push({ path: '*', redirect: '/404', hidden: true })
-
-      //       router.addRoutes(res)
+      // next()
+      // NProgress.done()
+      const hasGetUserInfo = store.getters.menu
+      if (store.getters.menus) {
+        next()
+      } else {
+        try {
+          // 获取用户信息
+          store.dispatch('user/getMenu').then(res=>{
+            router.addRoutes(res)
+            console.log('list',res,router);
             
-      //       next({ ...to, replace: true })
-      //     })
-      //     // let asyncRouterMap = asyncRouter
+            next({ ...to, replace: true })
+            NProgress.done()
 
+          })
+          // let asyncRouterMap = asyncRouter
 
-      //   } catch (error) {
-      //     // remove token and go to login page to re-login
-      //     // await store.dispatch('user/resetToken')
-      //     // Message.error(error || 'Has Error')
-      //     // next(`/login?redirect=${to.path}`)
-      //     // NProgress.done()
-      //   }
-      // }
+
+        } catch (error) {
+          // remove token and go to login page to re-login
+          // await store.dispatch('user/resetToken')
+          // Message.error(error || 'Has Error')
+          // next(`/login?redirect=${to.path}`)
+          // NProgress.done()
+        }
+      }
 
     }
   } else {

+ 45 - 215
src/router/index.js

@@ -2,7 +2,7 @@
  * @Author: wenjie 1454560336@qq.com
  * @Date: 2024-03-05 11:36:07
  * @LastEditors: wenjie 1454560336@qq.com
- * @LastEditTime: 2024-11-07 10:01:35
+ * @LastEditTime: 2024-11-14 14:44:30
  * @FilePath: \admin-manage\src\router\index.js
  * @Description:
  *
@@ -139,38 +139,6 @@ export let constantRoutes = [{
       },
     ]
   },
-  // {
-  //   id: 36,
-  //   path: '/adminManage',
-  //   component: Layout,
-  //   meta: { title: '账号管理', icon: 'el-icon-user-solid' },
-  //   alwaysShow: true,
-  //   children: [
-  //     {
-  //       id: 37,
-  //       path: '/adminManage/adminList',
-  //       name: '/adminManage/adminList',
-  //       component: () => import('@/views/adminManage/adminList.vue'),
-  //       meta: { title: '账号列表', icon: '' },
-  //     },
-  //     {
-  //       id: 37,
-  //       path: '/adminManage/adminDetail',
-  //       name: '/adminManage/adminDetail',
-  //       hidden: true ,
-  //       component: () => import('@/views/adminManage/adminDetail.vue'),
-  //       meta: { title: '账号详情', icon: '',activeMenu:'/adminManage/adminList' },
-  //     },
-  //     {
-  //       id: 37,
-  //       path: '/adminManage/adminAdd',
-  //       name: '/adminManage/adminAdd',
-  //       hidden: true ,
-  //       component: () => import('@/views/adminManage/adminAdd.vue'),
-  //       meta: { title: '人员添加', icon: '',activeMenu:'/adminManage/adminList' },
-  //     },
-  //   ]
-  // },
 
   {
     id: 0,
@@ -271,72 +239,7 @@ export let constantRoutes = [{
           }
         ]
       },
-      // {
-      //   id: 0,
-      //   path: '/operationManage/shopAudit/index',
-      //   component: operationLayout,
-      //   meta: {
-      //     title: '店铺审核',
-      //     icon: ''
-      //   },
-      //   alwaysShow: true,
-      //   children: [{
-      //       id: 1,
-      //       path: '/operationManage/shopAudit/index',
-      //       name: '/operationManage/shopAudit/index',
-      //       component: () => import('@/views/operationManage/shopAudit/index.vue'),
-      //       meta: {
-      //         title: '审核列表',
-      //         icon: ''
-      //       },
-      //     },
-      //     {
-      //       id: 1,
-      //       path: '/operationManage/shopAudit/audit',
-      //       name: '/operationManage/shopAudit/audit',
-      //       hidden:true,
-      //       component: () => import('@/views/operationManage/shopAudit/audit.vue'),
-      //       meta: {
-      //         title: '店铺审核',
-      //         icon: '',
-      //         activeMenu: '/operationManage/shopAudit/index'
-      //       },
-      //     },
-      //   ]
-      // },
-      // {
-      //   id: 0,
-      //   path: '/operationManage/goodsTemplate/index',
-      //   component: operationLayout,
-      //   meta: {
-      //     title: '规格模板',
-      //     icon: ''
-      //   },
-      //   alwaysShow: true,
-      //   children: [{
-      //       id: 1,
-      //       path: '/operationManage/goodsTemplate/index',
-      //       name: '/operationManage/goodsTemplate/index',
-      //       component: () => import('@/views/operationManage/goodsTemplate/index.vue'),
-      //       meta: {
-      //         title: '商品规格',
-      //         icon: ''
-      //       },
-      //     },
-      //     {
-      //       id: 1,
-      //       path: '/operationManage/goodsTemplate/addGoodsTemplate',
-      //       name: '/operationManage/goodsTemplate/addGoodsTemplate',
-      //       hidden:true,
-      //       component: () => import('@/views/operationManage/goodsTemplate/addGoodsTemplate.vue'),
-      //       meta: {
-      //         title: '添加规格',
-      //         icon: '',
-      //         activeMenu: '/operationManage/goodsTemplate/index'
-      //       },
-      //     },
-      //   ]
-      // },
+     
       {
         id: 0,
         path: '/operationManage/goodsType/index',
@@ -433,49 +336,7 @@ export let constantRoutes = [{
           },
         ]
       },
-      // {
-      //   id: 0,
-      //   path: '/operationManage/goodsAudit/index',
-      //   component: operationLayout,
-      //   meta: {
-      //     title: '商品审核',
-      //     icon: ''
-      //   },
-      //   alwaysShow: true,
-      //   children: [{
-      //       id: 1,
-      //       path: '/operationManage/goodsAudit/index',
-      //       name: '/operationManage/goodsAudit/index',
-      //       component: () => import('@/views/operationManage/goodsAudit/index.vue'),
-      //       meta: {
-      //         title: '审核列表',
-      //         icon: ''
-      //       },
-      //     },
-      //     {
-      //       id: 1,
-      //       path: '/operationManage/goodsAudit/auditGoods',
-      //       name: '/operationManage/goodsAudit/auditGoods',
-      //       hidden:true,
-      //       component: () => import('@/views/operationManage/goodsAudit/auditGoods.vue'),
-      //       meta: {
-      //         title: '商品审核',
-      //         icon: '',
-      //         activeMenu: '/operationManage/goodsAudit/index'
-      //       },
-      //     },
-      //     // {
-      //     //   id: 1,
-      //     //   path: '/operationManage/goodsAudit/auditDetail',
-      //     //   name: '/operationManage/goodsAudit/auditDetail',
-      //     //   component: () => import('@/views/operationManage/goodsAudit/auditDetail.vue'),
-      //     //   meta: {
-      //     //     title: '审核详情',
-      //     //     icon: ''
-      //     //   },
-      //     // },
-      //   ]
-      // },
+   
       {
         id: 0,
         path: '/operationManage/orderManage/index',
@@ -624,16 +485,6 @@ export let constantRoutes = [{
               icon: ''
             },
           },
-          // {
-          //   id: 1,
-          //   path: '/operationManage/comboManage/addCombo',
-          //   name: '/operationManage/comboManage/addCombo',
-          //   component: () => import('@/views/operationManage/comboManage/addCombo.vue'),
-          //   meta: {
-          //     title: '添加套餐',
-          //     icon: ''
-          //   },
-          // },
           {
             id: 1,
             path: '/operationManage/comboManage/editCombo',
@@ -716,26 +567,7 @@ export let constantRoutes = [{
         },
       ]
       },
-      // {
-      //   id: 0,
-      //   path: '/operationManage/ticketManage/index',
-      //   component: operationLayout,
-      //   meta: {
-      //     title: '核销管理',
-      //     icon: ''
-      //   },
-      //   alwaysShow: true,
-      //   children: [{
-      //     id: 1,
-      //     path: '/operationManage/ticketManage/index',
-      //     name: '/operationManage/ticketManage/index',
-      //     component: () => import('@/views/operationManage/ticketManage/index.vue'),
-      //     meta: {
-      //       title: '核销列表',
-      //       icon: ''
-      //     },
-      //   }, ]
-      // },
+  
       {
         id: 0,
         path: '/operationManage/appMenuManage/index',
@@ -1067,48 +899,6 @@ export let constantRoutes = [{
           },
         ]
       },
-
-      // {
-      //   id: 0,
-      //   path: '/operationManage/noticeManage/index',
-      //   component: operationLayout,
-      //   meta: {
-      //     title: '通知管理',
-      //     icon: ''
-      //   },
-      //   alwaysShow: true,
-      //   children: [{
-      //       id: 1,
-      //       path: '/operationManage/noticeManage/index',
-      //       name: '/operationManage/noticeManage/index',
-      //       component: () => import('@/views/operationManage/noticeManage/index.vue'),
-      //       meta: {
-      //         title: '通知列表',
-      //         icon: ''
-      //       },
-      //     },
-      //     {
-      //       id: 1,
-      //       path: '/operationManage/noticeManage/addBanner',
-      //       name: '/operationManage/noticeManage/addBanner',
-      //       component: () => import('@/views/operationManage/noticeManage/addNotice.vue'),
-      //       meta: {
-      //         title: '添加通知',
-      //         icon: ''
-      //       },
-      //     },
-      //     {
-      //       id: 1,
-      //       path: '/operationManage/noticeManage/editBanner',
-      //       name: '/operationManage/noticeManage/editBanner',
-      //       component: () => import('@/views/operationManage/noticeManage/editNotice.vue'),
-      //       meta: {
-      //         title: '编辑通知',
-      //         icon: ''
-      //       },
-      //     },
-      //   ]
-      // },
     ]
   },
   {
@@ -1609,7 +1399,47 @@ export let constantRoutes = [{
 ]
 
 export const asyncRouter = [
-
+  {
+    id: 0,
+    path: '/authorityManage',
+    component: Layout,
+    meta: {
+      title: '权限管理',
+      icon: 'icon-shouyefill'
+    },
+    children: [
+      {
+        id: 1,
+        path: '/authorityManage/menuList',
+        name: '/authorityManage/menuList',
+        component: () => import('@/views/authorityManage/menuList.vue'),
+        meta: {
+          title: '菜单列表',
+          icon: ''
+        },
+      },
+      {
+        id: 2,
+        path: '/authorityManage/roleList',
+        name: '/authorityManage/roleList',
+        component: () => import('@/views/authorityManage/roleList.vue'),
+        meta: {
+          title: '角色列表',
+          icon: ''
+        },
+      },
+      {
+        id: 2,
+        path: '/authorityManage/userList',
+        name: '/authorityManage/userList',
+        component: () => import('@/views/authorityManage/userList.vue'),
+        meta: {
+          title: '用户列表',
+          icon: ''
+        },
+      },
+    ]
+  },
 
 ]
 

+ 66 - 23
src/store/modules/user.js

@@ -1,6 +1,8 @@
-import { login} from '@/api/auth'
+import { login,getMenuData} from '@/api/auth'
 import { getToken, setToken, removeToken,setREToken } from '@/utils/auth'
 import { resetRouter, asyncRouter } from '@/router'
+import Layout from '@/layout'
+import operationLayout from '@/views/operationManage/index'
 // import { getMenu } from '@/api/menu'
 // import {login} from '@/api/home'
 const getDefaultState = () => {
@@ -13,6 +15,8 @@ const getDefaultState = () => {
   }
 }
 
+ 
+
 const state = getDefaultState()
 
 const mutations = {
@@ -62,31 +66,70 @@ const actions = {
   // 获取菜单
   getMenu({ commit, state }) {
     return new Promise((resolve, reject) => {
-      getMenu().then(response => {
-        let menuList = response.data.menu
-        let list = asyncRouter
-        let menuIndex = []
-        list.map((menu,d)=>{
-            if(menu.children){
-              let ids = []
-              menu.children.map((item,index)=>{//删除不存在的页面
-                if(menuList.includes(item.id)){
-                  }else{
-                  ids.unshift(index)
+      getMenuData({menuSource:1}).then(response => {
+        let menuList = response.content.records
+        let list = []
+        menuList.map(item=>{
+          let obj = {}
+          obj = {
+            path: item.requestUrl,
+            component: Layout,
+            meta: {
+              title: item.menuName,
+              icon: 'el-icon-s-shop'
+            },
+            alwaysShow: item.showStatus == 1?true:false,
+            children:[]
+          }
+          if(item.childs&&item.childs.length>0){
+            item.childs.map(subItem=>{
+              let subObj = {}
+              if(subItem.childs&&subItem.childs.some((item)=>{return item.menuType==2})){
+
+                subObj = {
+                  path: subItem.requestUrl,
+                  name: subItem.requestUrl,
+                  component:operationLayout,
+                  meta: {
+                    title: subItem.menuName,
+                    icon: 'el-icon-s-shop'
+                  },
+                  alwaysShow: true,
+                  children:[]
                 }
-              })
-              ids.map(i=>{
-                menu.children.splice(i,1)
-              })
-            }
-          if (!menu.children||!menu.children.length){
-              menuIndex.unshift(d)
-            }
-        })
-        menuIndex.map(i=>{
-          list.splice(i,1)
+                subItem.childs.map(i=>{
+                  if(i.menuType==2){
+                    subObj.children.push({
+                      path:i.requestUrl,
+                      name:i.requestUrl,
+                      component:resolve => require([`@/views${i.requestUrl}`], resolve),
+                      meta: {
+                        title: i.menuName,
+                      }
+
+                    })
+                  }
+                })
+
+              }else{
+                subObj = {
+                  path: subItem.requestUrl,
+                  name: subItem.requestUrl,
+                  component:resolve => require([`@/views${subItem.requestUrl}`], resolve),
+                  meta: {
+                    title: subItem.menuName,
+                    icon: 'el-icon-s-shop'
+                  },
+                }
+              }
+              obj.children.push(subObj)
+            })
+          }
+          list.push(obj)
+
         })
         list.push({ path: '*', redirect: '/404', hidden: true })
+        list = asyncRouter.concat(list)
         commit('SET_MENU', list)
         resolve(list)
       }).catch(error => {

+ 1 - 2
src/utils/request.js

@@ -2,7 +2,7 @@
  * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
  * @Date: 2022-08-02 14:50:38
  * @LastEditors: wenjie 1454560336@qq.com
- * @LastEditTime: 2024-11-11 13:54:37
+ * @LastEditTime: 2024-11-12 15:35:43
  * @FilePath: \admin-manage\src\utils\request.js
  * @Description: 
  * 
@@ -59,7 +59,6 @@ service.interceptors.response.use(
    * You can also judge the status by HTTP Status Code
    */
   response => {
-    console.log(response);
     const res = response.data
     // 如果code不是 0, 这被判定为一个错误。
     if (res.state !== "Success" && res.status != 0) {

+ 158 - 23
src/views/authorityManage/menuList.vue

@@ -13,30 +13,33 @@
     row-key="id"
     border
     default-expand-all
-    :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
+    :tree-props="{children: 'childs', hasChildren: 'hasChildren'}">
     <el-table-column
-      prop="date"
+      prop="menuName"
       label="菜单名称"
       align="center"
       >
     </el-table-column>
     <el-table-column
-      prop="name"
+      prop="sort"
       label="排序"
       align="center"
       >
     </el-table-column>
     <el-table-column
-      prop="address"
+      prop="requestUrl"
       label="请求地址"
       align="center"
       >
     </el-table-column>
     <el-table-column
-      prop="address"
+      prop="menuType"
       label="类型"
       align="center"
       >
+      <template slot-scope="scope">
+        <span>{{scope.row.menuType |filterType}}</span>
+      </template>
     </el-table-column>
       <el-table-column prop="address" align="center" label="操作">
         <template slot-scope="scope">
@@ -45,48 +48,72 @@
         </template>
       </el-table-column>
     </el-table>
+    <!-- <div class="page-box">
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        background
+        :current-page="query.currentPage"
+        :page-sizes="[10, 20, 30, 40]"
+        :page-size="query.pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total"
+      >
+      </el-pagination>
+    </div> -->
 
     <el-dialog :title="title" width="550px" :visible.sync="dialogFormVisible">
         <el-form label-width="130px" :model="setQuery"
         ref="setQuery"
         :rules="rules">
-            <el-form-item label="菜单名称:"  prop="paperName">
+            <el-form-item label="菜单名称:"  prop="menuName">
                 <el-input
-                v-model="setQuery.paperName"
+                v-model="setQuery.menuName"
                 class="item-width-300"
                 ></el-input>
             </el-form-item>
-             <el-form-item label="上级菜单:"  prop="paperName">
-                <el-select v-model="setQuery.type" class="item-width-300" placeholder="请选择">
+             <el-form-item label="上级菜单:" v-if="setQuery.menuType != 1"  prop="parentId">
+              <el-cascader
+              class="item-width-300"
+              v-model="setQuery.parentId"
+              :options="tableData"
+              :props="{ checkStrictly: true,emitPath:false,children: 'childs',label:'menuName',value:'id' }"
+              clearable></el-cascader>
+                <!-- <el-select v-model="setQuery.parentId" class="item-width-300" placeholder="请选择">
                     <el-option
                     v-for="item in options"
                     :key="item.value"
                     :label="item.label"
                     :value="item.value">
                     </el-option>
-                </el-select>
+                </el-select> -->
             </el-form-item>
-            <el-form-item label="菜单类型:"  prop="questionsNum">
-               <el-radio-group v-model="setQuery.type">
+            <el-form-item label="菜单类型:"  prop="menuType">
+               <el-radio-group v-model="setQuery.menuType">
                     <el-radio :label="1">目录</el-radio>
                     <el-radio :label="2">菜单</el-radio>
                     <el-radio :label="3">按钮</el-radio>
                 </el-radio-group>
             </el-form-item>
-             <el-form-item label="请求地址:"  prop="questionsNum">
+             <el-form-item label="请求地址:" v-if="setQuery.menuType == 2" prop="requestUrl">
                 <el-input
-                type="number"
-                v-model.number="setQuery.questionsNum"
+                v-model="setQuery.requestUrl"
                 class="item-width-300"
                 ></el-input>
             </el-form-item>
-             <el-form-item label="显示排序:"  prop="questionsNum">
+             <el-form-item label="显示排序:"  prop="sort">
                 <el-input
                 type="number"
-                v-model.number="setQuery.questionsNum"
+                v-model.number="setQuery.sort"
                 class="item-width-300"
                 ></el-input>
             </el-form-item>
+            <el-form-item label="是否显示:"  prop="showStatus">
+              <el-radio-group v-model="setQuery.showStatus">
+                  <el-radio :label="1">显示</el-radio>
+                  <el-radio :label="2">隐藏</el-radio>
+              </el-radio-group>
+          </el-form-item>
         </el-form>
     <div slot="footer" class="dialog-footer">
         <el-button @click="dialogFormVisible = false">取 消</el-button>
@@ -97,12 +124,15 @@
   </div>
 </template>
   
-  <script>
+<script>
+import { getMenuList,delMenu,addOrUpdateMenu,menuDetail } from "@/api/auth.js";
+
 export default {
   name: "menuList",
   data() {
     return {
       title:"",
+      btnLoading:false,
       dialogFormVisible:false,
       tableData: [{
           id: 1,
@@ -149,23 +179,65 @@ export default {
           label: '蚵仔煎'
         }
       ],
+      query: {
+        menuSource: 1,
+        currentPage: 1,
+        pageSize: 999,
+      },
+      total: 0,
       setQuery: {
-       type:1
+       menuType:1
       },
-      rules:{}
+      rules:{
+        menuName: [{ required: true, message: "请输入菜单名称", trigger: "blur" }],
+        requestUrl: [{ required: true, message: "请输入请求地址", trigger: "blur" }],
+        parentId: [{ required: true, message: "请选择上级菜单", trigger: "change" }],
+        sort: [{ required: true, message: "请输入排序", trigger: "blur" }],
+      }
     };
   },
-
+  filters: {
+    filterType: function(val) {
+      if(val == 1){
+        return "目录"
+      }else if(val == 2){
+        return "菜单"
+      }else{
+        return "按钮"
+      }
+    }
+  },
   methods: {
 
     handleEdit(row){
+      console.log(row);
+      this.menuDetail(row.id)
         this.title = "编辑"
         this.dialogFormVisible = true
+        this.setQuery = {
+            "id": row.id,
+            "menuName": row.menuName,
+            "menuSource": row.menuSource,
+            "menuType": row.menuType,
+            "parentId": row.parentId,
+            "requestUrl": row.requestUrl,
+            "showStatus": row.showStatus,
+            "sort": row.sort
+        }
      
     },
     handleAdd(){
         this.title = "添加"
         this.dialogFormVisible = true
+        this.setQuery = {
+            "menuName": "",
+            "menuSource": 1,
+            "menuType": 1,
+            "parentId": "",
+            "requestUrl": "",
+            "showStatus": 1,
+            "sort": 0
+        }
     },
     // 点击删除
     handleDel(id) {
@@ -174,21 +246,84 @@ export default {
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          del({menuId:id}).then(res=>{
+          delMenu({id}).then(res=>{
             if(res.state == 'Success'){
                this.$notify({
                 title: '成功',
                 message: '操作成功',
                 type: 'success'
               });
-              this.getMenu()
+              this.getMenuList()
             }
           })
         })
     },
+    handleSizeChange(val) {
+      this.query.currentPage = 1;
+      this.query.pageSize = val;
+      this.getMenuList()
+    },
+    handleCurrentChange(val) {
+      this.query.currentPage = val;
+      this.getMenuList()
+    },
+    save(){
+      this.$refs.setQuery.validate((valid) => {
+        if (valid) {
+          this.btnLoading = true
+          addOrUpdateMenu(this.setQuery).then(res=>{
+            this.btnLoading = false
+            if(res.state == 'Success'){
+              this.$notify({
+                title: '成功',
+                message: '操作成功',
+                type: 'success'
+              });
+              this.dialogFormVisible = false
+              this.getMenuList()
+            }
+
+          })
+        } 
+       });
+    },
+    getMenuList(){
+      getMenuList(this.query).then(res=>{
+        if(res.state == 'Success'){
+          this.tableData = res.content.records
+          this.total = res.content.total
+          this.options = []
+          res.content.records.forEach(item=>{
+            this.options.push({
+              value: item.id,
+              label: item.menuName
+            })
+          })
+        }
+
+      })
+    },
+    menuDetail(id){
+      menuDetail({id}).then(res=>{
+        if(res.state == 'Success'){
+           this.setQuery = {
+            "id": res.content.id,
+            "menuName": res.content.menuName,
+            "menuSource": res.content.menuSource,
+            "menuType": res.content.menuType,
+            "parentId": res.content.parentId,
+            "requestUrl": res.content.requestUrl,
+            "showStatus": res.content.showStatus,
+            "sort": res.content.sort
+        }
+
+        }
+      })
+    }
 
   },
   created() {
+    this.getMenuList()
   },
 };
 </script>

+ 116 - 63
src/views/authorityManage/roleList.vue

@@ -3,21 +3,14 @@
   <div class="roleList app-container">
     <div class="search">
         <div>
-            <el-input
-            v-model="query.name"
-            size="small"
-            clearable
-            placeholder="请输入名称"
-            class="item-width-200 "
-            ></el-input>
              <el-input
-            v-model="query.name"
+            v-model="query.roleName"
             size="small"
             clearable
-            placeholder="请输入登录账号"
+            placeholder="请输入角色名"
             class="item-width-200 ml10"
             ></el-input>
-            <el-select
+            <!-- <el-select
           v-model="query.activityType"
           size="small"
           class="item-width-200 ml10"
@@ -31,12 +24,13 @@
             :value="item.value"
           >
           </el-option>
-        </el-select>
+        </el-select> -->
 
         <el-date-picker
           v-model="date"
           size="small"
-          value-format="timestamp"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          :default-time="['00:00:00', '23:59:59']"
           class="item-width-350 ml10"
           type="datetimerange"
           range-separator="至"
@@ -73,7 +67,7 @@
       <el-table-column
         align="center"
         label="角色名称"
-        prop="activityName"
+        prop="roleName"
         show-overflow-tooltip
       >
       </el-table-column>
@@ -81,7 +75,7 @@
       <el-table-column
         align="center"
         label="备注"
-        prop="status"
+        prop="remake"
         show-overflow-tooltip
       >
       </el-table-column>
@@ -91,11 +85,14 @@
         prop="status"
         show-overflow-tooltip
       >
+        <template slot-scope="scope">
+          {{scope.row.status === 1 ? '启用' : '禁用'}}
+        </template>
       </el-table-column>
        <el-table-column
         align="center"
         label="创建时间"
-        prop="status"
+        prop="createTime"
         show-overflow-tooltip
       >
       </el-table-column>
@@ -103,8 +100,7 @@
        <el-table-column prop="address" align="center" label="操作">
         <template slot-scope="scope">
           <el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button>
-          <el-button type="text" size="small" @click="handleEdit(scope.row)">权限分配</el-button>
-          <el-button type="text" size="small" @click="handleDel(scope.row.id)">删除</el-button>
+          <el-button type="text" size="small" @click="handleDel(scope.row)">{{scope.row.status === 1 ? '禁用' : '启用'}}</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -126,20 +122,26 @@
         <el-form label-width="130px" :model="setQuery"
         ref="setQuery"
         :rules="rules">
-            <el-form-item label="角色名称:"  prop="paperName">
+            <el-form-item label="角色名称:"  prop="roleName">
                 <el-input
-                v-model="setQuery.paperName"
+                v-model="setQuery.roleName"
                 class="item-width-300"
                 ></el-input>
             </el-form-item>
-            <el-form-item label="备注:"  prop="paperName">
+            <el-form-item label="备注:"  prop="remake">
                 <el-input
-                v-model="setQuery.paperName"
+                v-model="setQuery.remake"
                 class="item-width-300"
                 ></el-input>
             </el-form-item>
+            <el-form-item label="状态:"  prop="status">
+                <el-radio-group v-model="setQuery.status">
+                    <el-radio :label="1">启用</el-radio>
+                    <el-radio :label="2">禁用</el-radio>
+                </el-radio-group>
+            </el-form-item>
              
-            <el-form-item label="权限分配:"  prop="questionsNum">
+            <el-form-item label="权限分配:"  prop="authRang">
               <el-tree
                 style="margin-top: 10px;"
                 :data="data"
@@ -163,7 +165,7 @@
 </template>
 
   <script>
-  import {activityList,activityDel,activityStop} from '@/api/activity'
+  import {authRoleList,authRoleEnable,addOrUpdateAuthRole,getMenuData} from '@/api/auth'
 export default {
   name: "roleList",
   data() {
@@ -205,8 +207,8 @@ export default {
           }]
         }],
         defaultProps: {
-          children: 'children',
-          label: 'label'
+          children: 'childs',
+          label: 'menuName'
         },
       options:[
         {
@@ -224,16 +226,34 @@ export default {
       btnLoading: false,
       dialogFormVisible: false,
       query: {
-        "activityType":null,
-        "state":'',
+        "roleName":'',
+        "start":'',
+        "end":'',
         "currentPage": 1,
         "pageSize": 10,
         shopId: 0,
       },
       setQuery: {
-       type:1
+        "authRang": "",
+        "id": 0,
+        "remake": "",
+        "roleName": "",
+        "roleSource": 0,
+        "sourceId": "",
+        "status": 0
+      },
+      rules:{
+        roleName: [
+          { required: true, message: '请输入角色名称', trigger: 'blur' },
+        ],
+        remake:[
+          { required: true, message: '请输入备注', trigger: 'blur' }
+        ],
+        authRang: [
+          { required: true, message: '请选择权限', trigger: 'change' },
+        ]
+
       },
-      rules:{},
       title: "",
       total: 0,
     };
@@ -241,11 +261,11 @@ export default {
   watch: {
     date(val){
       if(val){
-        this.query.startTime = val[0]
-        this.query.endTime = val[1]
+        this.query.start = val[0]
+        this.query.end = val[1]
       }else{
-        this.query.startTime = ''
-        this.query.endTime = ''
+        this.query.start = ''
+        this.query.end = ''
       }
     }
   },
@@ -253,23 +273,47 @@ export default {
     handleEdit(row){
         this.title = "编辑"
         this.dialogFormVisible = true
+        this.setQuery = {
+          "authRang": row.authRang.split(',').map(Number),
+          "id": row.id,
+          "remake": row.remake,
+          "roleName": row.roleName,
+          "roleSource": row.roleSource,
+          "sourceId": row.sourceId,
+          "status": row.status
+        }
+        this.$nextTick(() => {
+          this.$refs.tree.setCheckedKeys(this.setQuery.authRang)
+        })
      
     },
     handleAdd(){
         this.title = "添加"
         this.dialogFormVisible = true
+        this.setQuery = {
+          "authRang": "",
+          "remake": "",
+          "roleName": "",
+          "roleSource": 1,
+          "sourceId": localStorage.getItem('epid'),
+          "status": 1
+        }
+         this.$nextTick(() => {
+          this.$refs.tree.setCheckedKeys([])
+        })
     },
     handleSearch(){
       this.query.currentPage = 1
-      this.activityList();
+      this.authRoleList();
     },
-    handleDel(id){
-         this.$confirm(`此操作将删除该活动, 是否继续?`, "提示", {
+    handleDel(row){
+      let msg = row.status == 1 ? '禁用' : '启用'
+        this.$confirm(`此操作将${msg}该数据, 是否继续?`, "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning",
         }).then(() => {
-          activityDel({id}).then(res=>{
+          authRoleEnable({id:row.id}).then(res=>{
             if(res.state == 'Success'){
                this.$notify({
                 title: "成功",
@@ -284,46 +328,55 @@ export default {
     handleSizeChange(val) {
       this.query.currentPage = 1;
       this.query.pageSize = val;
-      this.activityList()
+      this.authRoleList()
     },
     handleCurrentChange(val) {
       this.query.currentPage = val;
-      this.activityList()
+      this.authRoleList()
     },
-    activityList(){
-    //   this.loading = true
-    //   activityList(this.query).then(res=>{
-    //     this.loading = false
-    //     if(res.state == 'Success'){
-    //       this.tableData = res.content.records
-    //       this.total = res.content.total
-    //     }
-    //   })
+    authRoleList(){
+      this.loading = true
+      authRoleList(this.query).then(res=>{
+        this.loading = false
+        if(res.state == 'Success'){
+          this.tableData = res.content.records
+          this.total = res.content.total
+        }
+      })
     },
     save(){
-        console.log(1111);
+       console.log(this.$refs.tree.getCheckedKeys());
+       this.setQuery.authRang = this.$refs.tree.getCheckedKeys().join(',')
         this.$refs.setQuery.validate((v) => {
         if (v) {
-        //   this.btnLoading = true
-        //   addOrUpdatePaper(this.setQuery).then(res=>{
-        //     this.btnLoading = false
-        //     if(res.state == 'Success'){
+          this.btnLoading = true
+          addOrUpdateAuthRole(this.setQuery).then(res=>{
+            this.btnLoading = false
+            if(res.state == 'Success'){
                 this.dialogFormVisible = false
-        //       this.$notify({
-        //           title: '成功',
-        //           message: '操作成功',
-        //           type: 'success'
-        //         });
-        //         this.query.currentPage = 1
-        //         this.paperList();
-        //     }
-        //   })
+              this.$notify({
+                  title: '成功',
+                  message: '操作成功',
+                  type: 'success'
+                });
+                this.query.currentPage = 1
+                this.authRoleList();
+            }
+          })
         }
       });
+    },
+    getMenuData(){
+      getMenuData({menuSource:1}).then(res=>{
+          if(res.state == 'Success'){
+            this.data = res.content.records
+          }
+      })
     }
   },
   created() {
-    this.activityList()
+    this.authRoleList()
+    this.getMenuData()
   },
 };
 </script>

+ 0 - 406
src/views/operationManage/goodsAudit/auditDetail.vue

@@ -1,406 +0,0 @@
-<template>
-  <div class="auditDetail app-container">
-    <el-form
-      v-loading="loading"
-      :model="form"
-      ref="form"
-      :rules="rules"
-      label-width="130px"
-    >
-      <el-form-item label="商品名称:">
-        <el-input
-          v-model="setQuery.goodsName"
-          :maxlength="11"
-          class="item-width-300"
-          disabled
-        ></el-input>
-      </el-form-item>
-      <el-form-item label="商品类型:">
-        <el-select
-          v-model="setQuery.goodsType"
-          disabled
-          class="item-width-300"
-          placeholder="请选择商品类型"
-        >
-          <el-option
-            v-for="item in options"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          >
-          </el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="setQuery.goodsType == 1" label="立减额度:">
-        <el-input
-          disabled
-          v-model.number="setQuery.discount"
-          :maxlength="18"
-          class="item-width-300"
-        >
-          <template slot="append">元</template>
-        </el-input>
-      </el-form-item>
-      <el-form-item v-else-if="setQuery.goodsType == 2" label="折扣率:">
-        <el-input
-          disabled
-          v-model.number="setQuery.discount"
-          :maxlength="18"
-          class="item-width-300"
-        >
-          <template slot="append">%</template>
-        </el-input>
-      </el-form-item>
-      <el-form-item v-else-if="setQuery.goodsType == 3" label="满减规则:">
-        <el-input
-          disabled
-          v-model.number="setQuery.condition"
-          :maxlength="18"
-          class="item-width-150"
-        >
-        </el-input>
-        减
-        <el-input
-          disabled
-          v-model.number="setQuery.discount"
-          :maxlength="18"
-          class="item-width-100"
-        >
-        </el-input>
-      </el-form-item>
-      <el-form-item label="售价:">
-        <el-input
-          v-model="setQuery.realPrice"
-          :maxlength="11"
-          class="item-width-300"
-          disabled
-        ></el-input>
-      </el-form-item>
-      <el-form-item label="库存:">
-        <el-input
-          v-model="setQuery.stockCount"
-          :maxlength="11"
-          class="item-width-300"
-        ></el-input>
-      </el-form-item>
-      <el-form-item label="使用限制时间:">
-        <div class="tabs">
-          <div
-            class="tab"
-            v-for="(item, index) in tabs"
-            :class="[setQuery.useType == index+1 ? 'active' : '']"
-            :key="item"
-            @click="handleTab(index+1)"
-          >
-            {{ item }}
-          </div>
-        </div>
-        <el-date-picker
-          v-show="tab == 2"
-          v-model="date"
-          type="datetimerange"
-          class="item-width-400"
-          :picker-options="pickerOptions"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          align="right"
-        >
-        </el-date-picker>
-
-        <el-select
-          disabled
-          v-show="tab == 3 || tab == 4"
-          v-model="setQuery.day"
-          multiple
-          clearable
-          filterable
-          class="item-width-400"
-          placeholder="请选择"
-        >
-          <el-option
-            v-for="item in nums"
-            :key="item"
-            :label="
-              (nums == 7 ? '每周' : '每月') + item + (nums == 31 ? '号' : '')
-            "
-            :value="item"
-          >
-          </el-option>
-        </el-select>
-      </el-form-item>
-
-      <el-form-item label="商品说明:">
-        <el-input
-          disabled
-          type="textarea"
-          placeholder="请输入商品说明,限100字"
-          v-model="setQuery.goodsDescribe"
-          maxlength="100"
-          :rows="6"
-          class="item-width-300"
-          show-word-limit
-        >
-        </el-input>
-      </el-form-item>
-      <el-form-item label="商品购买设置:">
-        <el-table
-          :data="tableData"
-          tooltip-effect="dark"
-          border
-          style="width: 600px"
-        >
-          <el-table-column
-            align="center"
-            label="人员类型"
-            prop="name"
-            show-overflow-tooltip
-          >
-           <template slot-scope="scope">
-             {{scope.row.name}}
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="shopName"
-            align="center"
-            label="购买设置"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <el-checkbox
-                :false-label="1"
-                :true-label="2"
-                v-model="scope.row.buySet"
-                >限制购买</el-checkbox
-              >
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="shopName"
-            align="center"
-            label="限购数量"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.buyPrice"
-                :maxlength="8"
-                size="small"
-                class="item-width-100"
-              >
-              </el-input>
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="shopName"
-            align="center"
-            label="优惠价格"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.buyPrice"
-                :maxlength="8"
-                size="small"
-                class="item-width-100"
-              >
-              </el-input>
-            </template>
-          </el-table-column>
-        </el-table>
-      </el-form-item>
-
-      
-
-      <el-form-item label="审核意见:" prop="checkDetail">
-        <el-input
-          type="textarea"
-          placeholder="请输入审核意见"
-          v-model="setQuery.checkDetail"
-          maxlength="400"
-          :rows="6"
-          class="item-width-500"
-          show-word-limit
-        >
-        </el-input>
-      </el-form-item>
-    </el-form>
-  </div>
-</template>
-
-<script>
-import { getCheckDetail } from "@/api/goods";
-import { getSetMealNameAndId } from "@/api/common";
-import Upload from "@/components/Upload";
-export default {
-  components: {
-    Upload,
-  },
-  data() {
-    return {
-      nums: 7,
-      value2: "",
-      tabs: ["不限制", "自定义时间", "每周", "每月"],
-      tab: 1,
-      date: "",
-      loading: false,
-      setQuery: {
-        goodsName: "立减10元",
-        goodsType: "1",
-        goodsCode: "102",
-        condition: 0,
-        discount: 10,
-        realPrice: 0,
-        stockCount: 10,
-        useType: 0,
-        useStartTime: null,
-        useEndTime: null,
-        goodsDescribe: "商品描述",
-        goodsWeight: 99,
-        checkUser: null,
-        checkDetail: "名字不规范、不予通过",
-        checkTime: "2023-11-03 17:34:25",
-        details: null,
-      },
-      form: {
-        checkDetail: "",
-      },
-      rules: {
-        checkDetail: [
-          { required: true, message: "请输入审核意见", trigger: "blur" },
-        ],
-      },
-      mealList: null,
-      options: [
-        {
-          value: "1",
-          label: "立减券",
-        },
-        {
-          value: "2",
-          label: "折扣券",
-        },
-        {
-          value: "3",
-          label: "满减券",
-        },
-      ],
-      tableData: [
-        { setMealId: 0, buySet: 2, buyNum: 2, buyPrice: 0, name: "非会员" },
-        { setMealId: 1, buySet: 2, buyNum: 5, buyPrice: 5, name: "10元套餐" },
-        { setMealId: 2, buySet: 2, buyNum: 7, buyPrice: 7, name: "20元套餐" },
-        { setMealId: 3, buySet: 2, buyNum: 1, buyPrice: 9, name: "30元套餐" },
-      ],
-      pickerOptions: {
-        shortcuts: [
-          {
-            text: "最近一周",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-          {
-            text: "最近一个月",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-          {
-            text: "最近三个月",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-        ],
-      },
-    };
-  },
-  watch: {
-    date(val) {
-      console.log(val);
-      if (val) {
-      } else {
-      }
-    },
-  },
-  methods: {
-    handleTab(val) {
-      // this.setQuery.useType = val
-      val == 2 ? (this.nums = 7) : (this.nums = 31);
-    },
-    // 商品详情
-    getCheckDetail() {
-      this.loading = true;
-      getCheckDetail({ goodsId: this.$route.query.id }).then((res) => {
-        this.loading = false;
-        if (res.state == "Success") {
-          this.setQuery = res.content;
-          this.tableData = res.content.details;
-          this.getSetMealNameAndId().then((r) => {
-            // 替换套餐名
-            this.tableData.map((item) => {
-              if (item.setMealId == 0) {
-                this.$set(item,'name',"非会员")
-              } else {
-                this.$set(item,'name',r[item.setMealId])
-              }
-            });
-          });
-        }
-      });
-    },
-    getSetMealNameAndId() {
-      return new Promise((resolve, reject) => {
-        getSetMealNameAndId().then((res) => {
-          if (res.state == "Success") {
-            resolve(res.content);
-          }
-        });
-      });
-    },
-  },
-  created() {
-    this.getCheckDetail();
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-@import "@/styles/element-variables";
-.auditDetail {
-  padding-bottom: 40px;
-  .btn-group {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-  }
-  .tabs {
-    display: flex;
-    border-radius: 4px;
-    margin-bottom: 10px;
-    cursor: pointer;
-    .tab {
-      width: 90px;
-      height: 30px;
-      line-height: 30px;
-      text-align: center;
-      border: 1px solid #f1f1f1;
-    }
-  }
-  .active {
-    color: $--color-primary;
-    border: 1px solid $--color-primary !important;
-    background: #d1d3fa;
-    border-radius: 4px;
-  }
-}
-</style>

+ 0 - 915
src/views/operationManage/goodsAudit/auditGoods.vue

@@ -1,915 +0,0 @@
-<template>
-  <div class="auditGoods app-container">
-    <el-form
-      :model="form"
-      ref="form"
-      :rules="rules"
-      v-loading="loading"
-      label-width="170px"
-    >
-
-    <el-form-item  label="商品名称:">
-           <Upload disabled width="100px" height="100px" type="goodsImg" :imgUrl="setQuery.goodsImg" @uploadEnd="uploadEnd"></Upload>
-      </el-form-item>
-      <el-form-item label="商品名称:" prop="goodsName">
-        <el-input
-        disabled
-          v-model="setQuery.goodsName"
-          class="item-width-300"
-        ></el-input>
-      </el-form-item>
-       <el-form-item  label="商品类型:" prop="goodsType">
-        <el-select disabled v-model="setQuery.goodsType" class="item-width-300" placeholder="请选择商品类型">
-            <el-option
-            v-for="item in options"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-            </el-option>
-        </el-select>
-      </el-form-item>
-
-       <template v-if="setQuery.goodsType == 1">
-        <el-form-item  label="优惠券类型:" prop="goodsCode">
-        <el-select disabled v-model="setQuery.goodsCode" class="item-width-300" placeholder="请选择优惠券类型">
-            <el-option
-            v-for="item in options1"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-            </el-option>
-        </el-select>
-      </el-form-item>
-    
-
-      <el-form-item  v-if="setQuery.goodsCode == 102 " label="立减额度:" prop="discount">
-        <el-input
-        disabled
-          v-model.number="setQuery.discount"
-          :maxlength="18"
-          class="item-width-300"
-        >
-        <template slot="append">元</template>
-        </el-input>
-      </el-form-item>
-      
-      <el-form-item  v-else-if="setQuery.goodsCode == 103" label="折扣率:" prop="discount">
-        <el-input
-        disabled
-          v-model.number="setQuery.discount"
-          :maxlength="18"
-          class="item-width-300"
-        >
-        <template slot="append">%</template>
-        </el-input>
-      </el-form-item>
-      <el-form-item  v-else-if="setQuery.goodsCode == 104" label="满减规则:" prop="discount">
-        <el-input
-        disabled
-          v-model.number="setQuery.condition"
-          :maxlength="18"
-          class="item-width-150"
-        >
-        </el-input>
-        减
-         <el-input
-         disabled
-          v-model.number="setQuery.discount"
-          :maxlength="18"
-          class="item-width-100"
-        >
-        </el-input>
-      </el-form-item>
-      </template>
-
-      <!-- 研学 -->
-      <template v-else-if="setQuery.goodsType == 6">
-        <el-form-item label="研学栏目:" prop="columnId">
-          <el-cascader
-            disabled
-            class="item-width-300"
-            v-model="setQuery.columnId"
-            show-all-levels
-            :options="columnOptions"
-            :props="{ value: 'id', label: 'columnName', children: 'pages' }"
-            clearable
-          ></el-cascader>
-        </el-form-item>
-      </template>
-
-     
-      <el-form-item  label="售价:" prop="realPrice">
-        <el-input
-        disabled
-          v-model.number="setQuery.realPrice"
-          :maxlength="18"
-          class="item-width-300"
-        >
-        <template slot="append">元</template>
-        </el-input>
-      </el-form-item>
-      <el-form-item  label="库存:" v-if="setQuery.goodsCode == 101" prop="exchangeCodeDataCode">
-        <el-select disabled v-model="setQuery.exchangeCodeDataCode" class="item-width-300" placeholder="请选择库存">
-            <el-option
-            v-for="item in options2"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-            </el-option>
-        </el-select>
-      </el-form-item>
-       <el-form-item  label="库存:" v-else prop="stockCount">
-        <el-input
-        disabled
-          v-model.number="setQuery.stockCount"
-          :maxlength="18"
-          class="item-width-300"
-        >
-        </el-input>
-      </el-form-item>
-
-      <template v-if="setQuery.goodsCode == 102 || setQuery.goodsCode == 103 || setQuery.goodsCode == 104">
-          <el-form-item disabled label="有效期限制:" prop="validType">
-            <el-radio disabled v-model="setQuery.validType" :label="1">不限制</el-radio>
-            <el-radio disabled v-model="setQuery.validType" :label="2">限制</el-radio>
-            <div v-show="setQuery.validType == 2">
-              <el-date-picker
-              disabled
-              v-model="date1"
-              type="datetimerange"
-              class="item-width-400"
-              value-format="yyyy-MM-dd HH:mm:ss"
-              :picker-options="pickerOptions"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right">
-              </el-date-picker>
-            </div>
-          </el-form-item>
-
-          <el-form-item disabled label="使用限制时间:" prop="shopName">
-          <div class="tabs">
-            <div class="tab" v-for="(item,index) in tabs" :class="[setQuery.useType == index+1?'active':'']" :key="item" @click="handleTab(index+1)">{{item}}</div>
-          </div>
-            <el-date-picker
-            disabled
-            v-show="setQuery.useType == 2"
-            v-model="date"
-            type="datetimerange"
-            class="item-width-400"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            :picker-options="pickerOptions"
-            range-separator="至"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-            align="right">
-            </el-date-picker>
-
-              <el-select
-              disabled
-                v-show="setQuery.useType == 3 || setQuery.useType == 4"
-                v-model="setQuery.day"
-                clearable
-                filterable
-                class="item-width-400"
-                placeholder="请选择">
-                <el-option
-                v-for="item in nums"
-                :key="item"
-                :label="(nums == 7 ?'每周':'每月') + item + (nums == 31 ?'号':'')"
-                :value="item">
-                </el-option>
-            </el-select>
-
-          </el-form-item>
-
-          <el-form-item  label="过期自动退:" prop="advent">
-            <el-radio disabled v-model="setQuery.advent" :label="1">是</el-radio>
-            <el-radio disabled v-model="setQuery.advent" :label="2">否</el-radio>
-          </el-form-item>
-
-          <el-form-item  label="支付抵扣限制:" prop="useMethod">
-            <el-radio disabled v-model="setQuery.useMethod" :label="1">线上和线下</el-radio>
-            <el-radio disabled v-model="setQuery.useMethod" :label="2">仅线上</el-radio>
-            <el-radio disabled v-model="setQuery.useMethod" :label="3">仅线下</el-radio>
-          </el-form-item>
-
-          <el-form-item disabled label="优惠券适用商品范围:" prop="useRangeType">
-            <el-radio disabled v-model="setQuery.useRangeType" :label="1">全部商品</el-radio>
-            <el-radio disabled v-model="setQuery.useRangeType" :label="2">指定商品</el-radio>
-          </el-form-item>
-
-          <template v-if="setQuery.useRangeType == 2 && setQuery.useMethod != 3">
-           <el-table
-          :data="tableData"
-          tooltip-effect="dark"
-          border
-          v-loading="tableLoading"
-          style="width: 100%"
-        >
-          <el-table-column
-            align="center"
-            label="商品名称"
-            prop="goodsName"
-            show-overflow-tooltip
-          >
-          </el-table-column>
-          <el-table-column
-            prop="goodsType"
-            align="center"
-            label="类型"
-            show-overflow-tooltip
-          >
-          <template slot-scope="scope">
-            {{scope.row.goodsType == 1?'优惠券':'研学'}}
-          </template>
-          </el-table-column>
-          <el-table-column
-            prop="discountContent"
-            align="center"
-            label="所属店铺"
-            show-overflow-tooltip
-          >
-          </el-table-column>
-          <el-table-column prop="address" align="center" label="操作">
-            <template slot-scope="scope">
-              <el-button type="text" size="small" @click="">查看</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-        <div class="page-box">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            background
-            :current-page="query.currentPage"
-            :page-sizes="[10]"
-            :page-size="query.pageSize"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total"
-          >
-          </el-pagination>
-        </div>
-          </template>
-
-         
-      </template>
-
-
-      <!-- 研学 -->
-      <template v-if="setQuery.goodsType == 6">
-        <el-form-item label="使用限制时间:" prop="shopName">
-          <div class="tabs">
-            <div
-              class="tab"
-              v-for="(item, index) in tabs"
-              :class="[setQuery.useType == index + 1 ? 'active' : '']"
-              :key="item"
-              @click="handleTab(index + 1)"
-            >
-              {{ item }}
-            </div>
-          </div>
-          <el-date-picker
-            v-show="setQuery.useType == 2"
-            v-model="date"
-            disabled
-            type="datetimerange"
-            class="item-width-400"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            :picker-options="pickerOptions"
-            range-separator="至"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-            align="right"
-          >
-          </el-date-picker>
-
-          <el-select
-            v-show="setQuery.useType == 3 || setQuery.useType == 4"
-            v-model="setQuery.day"
-            clearable
-            filterable
-            class="item-width-400"
-            placeholder="请选择"
-          >
-            <el-option
-              v-for="item in nums"
-              :key="item"
-              :label="
-                (nums == 7 ? '每周' : '每月') + item + (nums == 31 ? '号' : '')
-              "
-              :value="item"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="研学商品顶部图:" prop="studyItem">
-          <div class="notice">
-            (图片支持jpg, png, bmp格式,建议上传100kb~500kb大小文件)
-          </div>
-          <Upload
-            type="studyItem"
-            id="studyItem"
-            width="300px"
-            height="200px"
-            disabled
-            uploadType="GOODS_INFO"
-            :imgUrl="setQuery.studyItem"
-            @uploadEnd="uploadEnd"
-          ></Upload>
-        </el-form-item>
-      </template>
-
-      <el-form-item label="商品详情:" prop="goodsDescribe">
-        <!-- <div style="border: 1px solid #E4E7ED; width: 500px;border-radius:4px;padding:0 15px;min-height:60px;" v-html="setQuery.goodsDescribe">
-        </div> -->
-        <div style="border: 1px solid #ccc; width: 500px">
-          <Toolbar
-            style="border-bottom: 1px solid #ccc"
-            :editor="editor"
-            :defaultConfig="toolbarConfig"
-            :mode="editorMode"
-          />
-          <Editor
-            style="height: 500px; overflow-y: hidden"
-            v-model="setQuery.goodsDescribe"
-            :defaultConfig="editorConfig"
-            :mode="editorMode"
-            @onCreated="onCreated"
-          />
-        </div>
-      </el-form-item>
-
-    <el-form-item label="商品购买设置:">
-        <el-table
-      :data="setQuery.details"
-      tooltip-effect="dark"
-      border
-      style="width: 600px"
-    >
-      <el-table-column
-        align="center"
-        label="人员类型"
-        prop="setMealId"
-        show-overflow-tooltip
-      >
-      <template slot-scope="scope">
-        {{scope.row.setMealId | filterMeal(that)}}
-      </template>
-      </el-table-column>
-      <el-table-column
-        prop="shopName"
-        align="center"
-        label="购买设置"
-        show-overflow-tooltip
-      >
-       <template slot-scope="scope">
-          <el-checkbox :true-label="2" :false-label="1" v-model="scope.row.buySet">限制购买</el-checkbox>
-        </template>
-      </el-table-column>
-      <el-table-column
-        prop="shopName"
-        align="center"
-        label="限购数量"
-        show-overflow-tooltip
-      >
-       <template slot-scope="scope">
-         <el-input
-          v-model="scope.row.buyNum"
-          :maxlength="8"
-          size="small"
-          class="item-width-100"
-        >
-        </el-input>
-        </template>
-      </el-table-column>
-      <el-table-column
-        prop="shopName"
-        align="center"
-        label="优惠价格"
-        show-overflow-tooltip
-      >
-       <template slot-scope="scope">
-         <el-input
-          v-model="scope.row.buyPrice"
-          :maxlength="8"
-          size="small"
-          class="item-width-100"
-        >
-        </el-input>
-        </template>
-      </el-table-column>
-    </el-table>
-      </el-form-item>
-
-       <el-form-item label="分账规则:" prop="shareId">
-        <el-select
-          v-model="form.shareId"
-          class="item-width-300"
-          placeholder="请选择分账规则"
-        >
-          <el-option
-            v-for="item in ruleOptions"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          >
-          </el-option>
-        </el-select>
-      </el-form-item>
-
-      <el-form-item label="审核意见:" prop="checkDetail">
-        <el-input
-          type="textarea"
-          placeholder="请输入审核意见"
-          v-model="form.checkDetail"
-          maxlength="400"
-          :rows="6"
-           class="item-width-500"
-          show-word-limit
-        >
-        </el-input>
-      </el-form-item>
-
-    </el-form>
-
-    <div class="btn-group" v-if="mode != 'detail'">
-       <el-button  type="danger" :loading="loading"  @click="save(3)">拒 绝</el-button>
-     <el-button type="primary" :loading="loading"  @click="save(2)">通过</el-button>
-    </div>
-  </div>
-</template>
-
-<script>
-import {allCouponByShop,get,getGoodsCoupon,search,goodsCouponSet,check } from '@/api/goods'
-import {getSetMealNameAndId} from '@/api/common'
-import { getData } from "@/api/study";
-import {getRuleList } from "@/api/rule";
-import Upload from '@/components/Upload';
-import Vue from "vue";
-import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
-import OSS from "ali-oss";
-import { requestUploadImg, finishUploadImg } from "@/api/common";
-export default Vue.extend( {
-    components: {
-        Upload,
-        Editor,
-        Toolbar
-    },
-  data() {
-    return {
-      editor: null,
-      editorMode: "default", // or 'simple'
-      mode:'add',
-      that:this,
-        nums:7,
-        value2:'',
-        tabs:['不限制','自定义时间','每周','每月'],
-        tab:0,
-        date:'',
-        date1:'',
-        loading:false,
-        tableLoading:false,
-        tableData:[],
-        columnOptions: [],
-        ruleOptions:[],
-        imgList:[],
-        query:{
-          shopId:localStorage.getItem('epid'),
-          currentPage:1,
-          pageSize:10,
-        },
-        total:0,
-        toolbarConfig: {},
-      editorConfig: {
-        placeholder: "请输入内容...",
-        MENU_CONF: {
-          uploadImage: {
-            // 自定义上传
-            customUpload(file, insertFn) {
-              // file 即选中的文件
-              requestUploadImg({
-                fineName: file.name,
-                operate: "OTHER",
-              }).then((res) => {
-                if (res.state == "Success") {
-                  const client = new OSS({
-                    // yourregion填写Bucket所在地域。以华东1(杭州)为例,Region填写为oss-cn-hangzhou。
-                    region: res.content.endPoint.split(".")[0],
-                    // 从环境变量中获取访问凭证。运行本代码示例之前,请确保已设置环境变量OSS_ACCESS_KEY_ID和OSS_ACCESS_KEY_SECRET。
-                    accessKeyId: res.content.token.accessKeyId,
-                    accessKeySecret: res.content.token.accessKeySecret,
-                    // 填写Bucket名称。
-                    bucket: res.content.bucket,
-                    stsToken: res.content.token.securityToken,
-                  });
-
-                  client
-                    .multipartUpload(res.content.paths[0].join("/"), file)
-                    .then((r) => {
-                      // 上传完成
-                      finishUploadImg([{ path: res.content.paths[0] }]).then(
-                        (msg) => {
-                          if (msg.state == "Success") {
-                            let url =
-                              "http://" +
-                              res.content.bucket +
-                              "." +
-                              res.content.endPoint +
-                              "/" +
-                              res.content.paths[0].join("/");
-                            insertFn(url, "", "");
-                          }
-                        }
-                      );
-                    })
-                    .catch((err) => {
-                      console.log(err); //上传失败之后
-                    });
-                }
-              });
-            },
-          },
-        },
-      },
-      setQuery: {
-        "advent": 1,
-        "condition": 0,
-        "day": 0,
-        "discount": 0,
-        "exchangeCodeDataCode": "",
-        "goodsCode": "",
-        "goodsDescribe": "",
-        "goodsId": "",
-        "goodsImg": "",
-        "goodsName": "",
-        "goodsType": "",
-        "goodsWeight": 0,
-        "realPrice": 0,
-        "shopId": localStorage.getItem('epid'),
-        "stockCount": 0,
-        "useEndTime": "",
-        "useMethod": 1,
-        "useRange": "",
-        "useRangeType": 1,
-        "useStartTime": "",
-        "useType": 1,
-        "validEndTime": "",
-        "validStartTime": "",
-        "validType": 1,
-        "shareId":0,
-      },
-      form:{
-        shareId:'',
-          checkDetail:''
-      },
-      rules: {
-        checkDetail: [{ required: true, message: "请输入审核意见", trigger: "blur" }],
-        shareId: [{ required: true, message: "请选择分账规则", trigger: "change" }],
-      },
-      options: [
-        {
-          value: "1",
-          label: "优惠券",
-        },
-        {
-          value: "6",
-          label: "研学",
-        },
-        {
-          value: "5",
-          label: "商品",
-        },
-      ],
-      options1: [
-        // {
-        //   value: "102",
-        //   label: "立减券",
-        // },
-        // {
-        //   value: "103",
-        //   label: "折扣券",
-        // },
-        // {
-        //   value: "104",
-        //   label: "满减券",
-        // },
-        // {
-        //   value: "101",
-        //   label: "兑换码",
-        // },
-      ],
-      options2: [],
-      mealOption:[],
-       pickerOptions: {
-          shortcuts: [{
-            text: '最近一周',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
-              picker.$emit('pick', [start, end]);
-            }
-          }, {
-            text: '最近一个月',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit('pick', [start, end]);
-            }
-          }, {
-            text: '最近三个月',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit('pick', [start, end]);
-            }
-          }]
-        },
-    };
-  },
-  watch: {
-    
-    // 使用限制时间
-    date(val) {
-      if(val){
-        this.setQuery.useStartTime = val[0]
-        this.setQuery.useEndTime = val[1]
-      }else{
-        this.setQuery.useStartTime = ''
-        this.setQuery.useEndTime = ''
-        
-      }
-    },
-    // 有效期时间
-    date1(val) {
-      if(val){
-        this.setQuery.validStartTime = val[0]
-        this.setQuery.validEndTime = val[1]
-      }else{
-        this.setQuery.validStartTime = ''
-        this.setQuery.validEndTime = ''
-        
-      }
-    },
-
-  },
-  filters: {
-    filterMeal: function(val,that) {
-      let msg
-      that.mealOption.map(item=>{
-        if(val == item.value){
-          msg = item.label
-        }else if(val === 0){
-          msg = '无套餐'
-        }
-      })
-      return msg
-    }
-  },
-  methods: {
-     onCreated(editor) {
-      this.editor = Object.seal(editor); // 一定要用 Object.seal() ,否则会报错
-    },
-    // 获取研学栏目
-    getData() {
-      getData().then((res) => {
-        if (res.state == "Success") {
-          this.columnOptions = res.content;
-        }
-      });
-    },
-    uploadEnd(val){
-      this.setQuery[val.type] = val.url
-    },
-    handleSizeChange(val) {
-      this.query.currentPage = 1;
-      this.query.pageSize = val;
-      this.allCouponByShop()
-
-    },
-    handleCurrentChange(val) {
-      this.query.currentPage = val;
-      this.allCouponByShop()
-    },
-    handleTab(val){
-      if(this.mode == 'detail') return
-        this.setQuery.useType = val
-        this.setQuery.day = ''
-        val == 3?this.nums =7:this.nums =31
-    },
-    save(applyState) {
-      if(applyState == 2){
-        this.form.checkDetail = this.form.checkDetail || '通过'
-        this.rules = {
-          shareId: [{ required: true, message: "请选择分账规则", trigger: "change" }],
-        }
-      }else{
-        this.rules = {
-          checkDetail: [{ required: true, message: "请输入审核意见", trigger: "blur" }],
-          shareId: [{ required: true, message: "请选择分账规则", trigger: "change" }],
-        }
-      }
-      
-      this.$refs.form.validate((v) => {
-        if (v) {
-          this.loading = true
-          this.goodsCouponSet().then(res=>{
-            this.check(applyState)
-          })
-        }
-      });
-    },
-    // 获取兑换码库存
-    getCode() {
-      search({currentPage:1,pageSize:999}).then((res) => {
-        if (res.state == "Success") {
-          res.content.records.map(item=>{
-              this.options2.push({
-                label:item.exchangeCodeDataName +`(${item.totalNum})`,
-                value:item.exchangeCodeDataId
-              })
-          })
-        }
-      });
-    },
-    // 获取优惠券类型
-    getGoodsCoupon(){
-      getGoodsCoupon().then(res=>{
-        if (res.state == "Success") {
-          for (const key in res.content) {
-            if (Object.hasOwnProperty.call(res.content, key)) {
-                this.options1.push({
-                  label:res.content[key],
-                  value:key
-                }) 
-            }
-          }
-        }
-      })
-    },
-    // 所有商品
-    allCouponByShop(){
-      this.tableLoading = true
-      allCouponByShop(this.query).then(res=>{
-        this.tableLoading = false
-        if (res.state == "Success") {
-          this.tableData = res.content
-        }
-      })
-    },
-     // 商品详情
-    get(){
-      this.loading = true
-      get({goodsId:this.$route.query.id,shopId:this.$route.query.shopId}).then(res=>{
-      this.loading = false
-          if(res.state == 'Success'){
-            this.setQuery = res.content
-            this.setQuery.shopId = localStorage.getItem('epid')
-            // 使用时间为自定义时
-            if(this.setQuery.useType == 2){
-              this.date = [this.setQuery.useStartTime,this.setQuery.useEndTime]
-            }
-            // 限制有效期
-            if(this.setQuery.validType == 2){
-              this.date1 = [this.setQuery.validStartTime,this.setQuery.validEndTime]
-            }
-            this.setQuery.exchangeCodeDataCode = this.setQuery.exchangeCodeDataId
-            this.form.shareId = this.setQuery.shareId 
-            // 初始化购买设置
-            if(!this.setQuery.details){
-              this.setQuery.details = []
-              this.mealOption.map(item=>{
-                this.setQuery.details.push({
-                    "buyNum": 0,
-                    "buyPrice": this.setQuery.realPrice,
-                    "buySet": 1,
-                    "setMealId": item.value
-                })
-              })
-            }
-          }
-      })
-    },
-    getSetMealNameAndId(){
-      return new Promise((resolve,reject)=>{
-        getSetMealNameAndId().then(res=>{
-          if(res.state == 'Success'){
-            for (const key in res.content) {
-              if (Object.hasOwnProperty.call(res.content, key)) {
-                this.mealOption.push({
-                  label:res.content[key],
-                  value:key
-                })
-              }
-            }
-            this.mealOption.unshift({
-              label:'无套餐',
-              value:0
-            })
-            resolve()
-          }
-        })
-      })
-    },
-    // 商品购买配置
-    goodsCouponSet(){
-      return new Promise((resolve,reject)=>{
-        goodsCouponSet({goodsCouponSets:this.setQuery.details,goodsId:this.$route.query.id,shopId:this.$route.query.shopId}).then(res=>{
-              this.loading = true
-              if(res.state == 'Success'){
-                resolve()
-              }
-            })
-      })
-      
-    },
-    check(applyState){
-      
-      check({ 
-            "applyState": applyState,
-            "shareId": this.form.shareId,
-            "checkDetail": this.form.checkDetail,
-            "goodsDescribe":this.setQuery.goodsDescribe,
-            "checkUserId": localStorage.getItem('epid'),
-            "goodsId": this.$route.query.id}).then(res=>{
-              this.loading = false
-              if(res.state == 'Success'){
-                this.$notify({
-                    title: '成功',
-                    message: '操作成功',
-                    type: 'success'
-                  });
-                  this.$router.push('/operationManage/goodsAudit/index')
-              }
-            })
-    },
-    // 规则
-    getRuleList() {
-      getRuleList({currentPage:1,pageSize:999}).then((res) => {
-        if (res.state == "Success") {
-          res.content.records.map(item=>{
-            this.ruleOptions.push({
-              label:item.shareRule,
-              value:item.id
-            })
-          })
-        }
-      });
-    },
-  },
-    created () {
-      this.mode = this.$route.query.mode || 'add'
-      this.getCode()
-      this.getData();
-      this.getGoodsCoupon()
-      this.getRuleList()
-      this.getSetMealNameAndId().then(()=>{
-        if(this.$route.query.id){
-          this.get()
-        }
-      })
-    },
-});
-</script>
-<style src="@wangeditor/editor/dist/css/style.css"></style>
-<style lang="scss" scoped>
-@import '@/styles/element-variables';
-.auditGoods {
-  padding-bottom: 40px;
-  .btn-group{
-    display: flex;
-    align-items: center;
-    justify-content: center;
-  }
-  .tabs{
-    display:flex;
-    border-radius: 4px;
-    margin-bottom: 10px;
-    cursor: pointer;
-    .tab{
-        width: 90px;
-        height: 30px;
-        line-height: 30px;
-        text-align: center;
-        border: 1px solid #f1f1f1;
-    }
-  }
-  .active{
-    color: $--color-primary;
-    border: 1px solid $--color-primary!important;
-    background: #d1d3fa;
-    border-radius: 4px;
-  }
-
-  .notice{
-    font-size: 12px;
-    color: #ccc;
-  }
-
-}
-</style>

+ 0 - 429
src/views/operationManage/goodsAudit/auditGoods1.vue

@@ -1,429 +0,0 @@
-<template>
-  <div class="auditGoods app-container">
-    <el-form
-      :model="form"
-      ref="form"
-      :rules="rules"
-      label-width="130px"
-      
-    >
-      <el-form-item label="商品名称:">
-        <el-input
-          v-model="setQuery.goodsName"
-          :maxlength="11"
-          class="item-width-300"
-          disabled
-        ></el-input>
-      </el-form-item>
-       <el-form-item label="商品类型:">
-        <el-select v-model="setQuery.goodsType" disabled class="item-width-300" placeholder="请选择商品类型">
-            <el-option
-            v-for="item in options"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-            </el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="setQuery.goodsType == 1" label="立减额度:">
-        <el-input
-        disabled
-          v-model.number="setQuery.discount"
-          :maxlength="18"
-          class="item-width-300"
-        >
-        <template slot="append">元</template>
-        </el-input>
-      </el-form-item>
-      <el-form-item v-else-if="setQuery.goodsType == 2" label="折扣率:">
-        <el-input
-        disabled
-          v-model.number="setQuery.discount"
-          :maxlength="18"
-          class="item-width-300"
-        >
-        <template slot="append">%</template>
-        </el-input>
-      </el-form-item>
-      <el-form-item v-else-if="setQuery.goodsType == 3" label="满减规则:">
-        <el-input
-        disabled
-          v-model.number="setQuery.condition"
-          :maxlength="18"
-          class="item-width-150"
-        >
-        </el-input>
-        减
-         <el-input
-         disabled
-          v-model.number="setQuery.discount"
-          :maxlength="18"
-          class="item-width-100"
-        >
-        </el-input>
-      </el-form-item>
-       <el-form-item label="售价:">
-        <el-input
-          v-model="setQuery.realPrice"
-          :maxlength="11"
-          class="item-width-300"
-          disabled
-        ></el-input>
-      </el-form-item>
-       <el-form-item label="库存:">
-        <el-input
-          v-model="setQuery.stockCount"
-          :maxlength="11"
-          disabled
-          class="item-width-300"
-        ></el-input>
-      </el-form-item>
-      <el-form-item label="使用限制时间:">
-       <div class="tabs">
-        <div class="tab" v-for="(item,index) in tabs" :class="[setQuery.useType == index+1?'active':'']" :key="item" @click="handleTab(index+1)">{{item}}</div>
-       </div>
-         <el-date-picker
-         v-show="tab == 2"
-        v-model="date"
-        type="datetimerange"
-        class="item-width-400"
-        :picker-options="pickerOptions"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        align="right">
-        </el-date-picker>
-
-          <el-select
-          disabled
-          v-show="tab == 3 || tab == 4"
-        v-model="setQuery.day"
-        multiple
-        clearable
-        filterable
-        class="item-width-400"
-        placeholder="请选择">
-        <el-option
-        v-for="item in nums"
-        :key="item"
-        :label="(nums == 7 ?'每周':'每月') + item + (nums == 31 ?'号':'')"
-        :value="item">
-        </el-option>
-    </el-select>
-      </el-form-item>
-
-      <el-form-item label="商品说明:">
-        <el-input
-        disabled
-          type="textarea"
-          placeholder="请输入商品说明,限100字"
-          v-model="setQuery.goodsDescribe"
-          maxlength="100"
-          :rows="6"
-           class="item-width-300"
-          show-word-limit
-        >
-        </el-input>
-      </el-form-item>
-      <el-form-item label="商品购买设置:">
-       <el-table
-      :data="setQuery.details"
-      tooltip-effect="dark"
-      border
-      style="width: 600px"
-    >
-      <el-table-column
-        align="center"
-        label="人员类型"
-        prop="setMealId"
-        show-overflow-tooltip
-      >
-      <template slot-scope="scope">
-        {{scope.row.setMealId | filterMeal(that)}}
-      </template>
-      </el-table-column>
-      <el-table-column
-        prop="shopName"
-        align="center"
-        label="购买设置"
-        show-overflow-tooltip
-      >
-       <template slot-scope="scope">
-          <el-checkbox :true-label="1" :false-label="2" v-model="scope.row.buySet">限制购买</el-checkbox>
-        </template>
-      </el-table-column>
-      <el-table-column
-        prop="shopName"
-        align="center"
-        label="限购数量"
-        show-overflow-tooltip
-      >
-       <template slot-scope="scope">
-         <el-input
-          v-model="scope.row.buyNum"
-          :maxlength="8"
-          size="small"
-          class="item-width-100"
-        >
-        </el-input>
-        </template>
-      </el-table-column>
-      <el-table-column
-        prop="shopName"
-        align="center"
-        label="优惠价格"
-        show-overflow-tooltip
-      >
-       <template slot-scope="scope">
-         <el-input
-          v-model="scope.row.buyPrice"
-          :maxlength="8"
-          size="small"
-          class="item-width-100"
-        >
-        </el-input>
-        </template>
-      </el-table-column>
-    </el-table>
-      </el-form-item>
-
-      <el-form-item label="审核意见:" prop="checkDetail">
-        <el-input
-          type="textarea"
-          placeholder="请输入审核意见"
-          v-model="form.checkDetail"
-          maxlength="400"
-          :rows="6"
-           class="item-width-500"
-          show-word-limit
-        >
-        </el-input>
-      </el-form-item>
-    </el-form>
-
-    <div class="btn-group">
-       <el-button  type="danger" :loading="loading"  @click="save(3)">拒 绝</el-button>
-     <el-button type="primary" :loading="loading"  @click="save(2)">确 定</el-button>
-    </div>
-  </div>
-</template>
-
-<script>
-import { get,getCheckDetail,check,goodsCouponSet } from '@/api/goods'
-import Upload from '@/components/Upload'
-import {getSetMealNameAndId} from '@/api/common'
-export default {
-    components: {
-        Upload,
-    },
-  data() {
-    return {
-      that:this,
-        nums:7,
-        value2:'',
-        tabs:['不限制','自定义时间','每周','每月'],
-        tab:1,
-        date:'',
-        loading:false,
-      setQuery: {
-         "goodsName": "立减10元",
-          "goodsType": "1",
-          "goodsCode": "102",
-          "condition": 0,
-          "discount": 10,
-          "realPrice": 0,
-          "stockCount": 10,
-          "useType": 0,
-          "useStartTime": null,
-          "useEndTime": null,
-          "goodsDescribe": "商品描述",
-          "goodsWeight": 99,
-          "checkUser": null,
-          "checkDetail": "名字不规范、不予通过",
-          "checkTime": "2023-11-03 17:34:25",
-          "details": null
-      },
-      form:{
-          checkDetail:''
-      },
-      rules: {
-        checkDetail: [{ required: true, message: "请输入审核意见", trigger: "blur" }],
-        
-      },
-      options: [
-        {
-          value: "1",
-          label: "立减券",
-        },
-        {
-          value: "2",
-          label: "折扣券",
-        },
-        {
-          value: "3",
-          label: "满减券",
-        },
-      ],
-      mealOption:[],
-
-       pickerOptions: {
-          shortcuts: [{
-            text: '最近一周',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
-              picker.$emit('pick', [start, end]);
-            }
-          }, {
-            text: '最近一个月',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit('pick', [start, end]);
-            }
-          }, {
-            text: '最近三个月',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit('pick', [start, end]);
-            }
-          }]
-        },
-    };
-  },
-  watch: {
-    date(val) {
-      console.log(val);
-      if(val){
-
-      }else{
-
-      }
-    }
-  },
-  filters: {
-    filterMeal: function(val,that) {
-      let msg
-      that.mealOption.map(item=>{
-        if(val == item.value){
-          msg = item.label
-        }else if(val === 0){
-          msg = '无套餐'
-        }
-      })
-      return msg
-    }
-  },
-  methods: {
-    handleTab(val){
-        // this.setQuery.useType = val
-        val == 2?this.nums =7:this.nums =31
-    },
-    save(applyState) {
-      this.$refs.form.validate((v) => {
-        if (v) {
-          this.loading = true
-          this.goodsCouponSet().then(res=>{
-            this.check(applyState)
-          })
-        }
-      });
-    },
-    // 商品详情
-    get(){
-      this.loading = true
-      getCheckDetail({goodsId:this.$route.query.id}).then(res=>{
-      this.loading = false
-          if(res.state == 'Success'){
-            this.setQuery = res.content
-          }
-      })
-    },
-    // 获取套餐列表
-    getSetMealNameAndId(){
-      getSetMealNameAndId().then(res=>{
-        if(res.state == 'Success'){
-          for (const key in res.content) {
-            if (Object.hasOwnProperty.call(res.content, key)) {
-              this.mealOption.push({
-                label:res.content[key],
-                value:key
-              })
-            }
-          }
-          
-        }
-      })
-    },
-    // 商品购买配置
-    goodsCouponSet(){
-      return new Promise((resolve,reject)=>{
-        goodsCouponSet(this.setQuery.details).then(res=>{
-              this.loading = true
-              if(res.state == 'Success'){
-                resolve()
-              }
-            })
-      })
-      
-    },
-    check(applyState){
-      check({ 
-            "applyState": applyState,
-            "checkDetail": this.form.checkDetail,
-            "checkUserId": localStorage.getItem('epid'),
-            "goodsId": this.$route.query.id}).then(res=>{
-              this.loading = false
-              if(res.state == 'Success'){
-                this.$notify({
-                    title: '成功',
-                    message: '操作成功',
-                    type: 'success'
-                  });
-                  this.$router.push('/operationManage/shopManage/index')
-              }
-            })
-    }
-  },
-  created () {
-    this.get();
-    this.getSetMealNameAndId();
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-@import '@/styles/element-variables';
-.auditGoods {
-  padding-bottom: 40px;
-  .btn-group{
-    display: flex;
-    align-items: center;
-    justify-content: center;
-  }
-  .tabs{
-    display:flex;
-    border-radius: 4px;
-    margin-bottom: 10px;
-    cursor: pointer;
-    .tab{
-        width: 90px;
-        height: 30px;
-        line-height: 30px;
-        text-align: center;
-        border: 1px solid #f1f1f1;
-    }
-  }
-  .active{
-    color: $--color-primary;
-    border: 1px solid $--color-primary!important;
-    background: #d1d3fa;
-        border-radius: 4px;
-
-  }
-}
-</style>

+ 0 - 240
src/views/operationManage/goodsAudit/index.vue

@@ -1,240 +0,0 @@
-
-<template>
-  <div class="goodsAudit app-container">
-    <div class="search">
-      <div>
-        <el-input
-          v-model="query.goodsName"
-          size="small"
-          placeholder="请输入商品名称"
-          class="item-width-200"
-        ></el-input>
-        <el-select
-          v-model="query.state"
-          size="small"
-          class="item-width-200 ml10"
-          placeholder="请选择状态"
-        >
-          <el-option
-            v-for="item in options"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          >
-          </el-option>
-        </el-select>
-      </div>
-     
-    </div>
-
-    <el-table
-      :data="tableData"
-      tooltip-effect="dark"
-      border
-      v-loading="loading"
-      style="width: 100%"
-    >
-      <el-table-column
-        align="center"
-        label="商品名称"
-        prop="goodsName"
-        show-overflow-tooltip
-      >
-      </el-table-column>
-      <el-table-column
-        prop="goodsType"
-        align="center"
-        label="类型"
-        show-overflow-tooltip
-      >
-       <template slot-scope="scope">
-        {{scope.row.goodsType |filterType}}
-       </template>
-      </el-table-column>
-      <el-table-column
-        prop="discountContent"
-        align="center"
-        label="优惠内容"
-        show-overflow-tooltip
-      >
-      </el-table-column>
-      <el-table-column
-        prop="shopName"
-        align="center"
-        label="店铺名称"
-        show-overflow-tooltip
-      >
-      </el-table-column>
-      <el-table-column
-        prop="applyState"
-        align="center"
-        label="审核内容"
-        show-overflow-tooltip
-      >
-      <template slot-scope="scope">
-        {{scope.row.applyState|filterState}}
-       </template>
-      </el-table-column>
-      <el-table-column
-        prop="applyTime"
-        align="center"
-        label="提交时间" 
-        show-overflow-tooltip
-      >
-      </el-table-column>
-
-      <el-table-column prop="address" align="center" label="操作">
-        <template slot-scope="scope">
-          <el-button type="text" v-if="scope.row.applyState == 2" size="small" @click="handleDetail(scope.row)">查看</el-button>
-
-          <el-button type="text" v-else size="small" @click="handleAudit(scope.row)">审核</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="page-box">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        background
-        :current-page="query.page"
-        :page-sizes="[10, 20, 30, 40]"
-        :page-size="query.pageSize"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="total"
-      >
-      </el-pagination>
-    </div>
-  </div>
-</template>
-  
-  <script>
-import { debounce } from "@/utils/index";
-import {checkList} from '@/api/goods';
-export default {
-  name: "goodsAudit",
-  data() {
-    return {
-      options: [
-        {
-          value: 1,
-          label: "待审核",
-        },
-        // {
-        //   value: 2,
-        //   label: "审核通过",
-        // },
-        {
-          value: 3,
-          label: "已审核",
-        },
-        
-      ],
-      tableData: [],
-      loading: false,
-      query: {
-        state: 1,
-        goodsName: "",
-        currentPage: 1,
-        pageSize: 10,
-      },
-      title: "",
-      total: 0,
-    };
-  },
-  watch: {
-    query: {
-      handler: debounce(function (val) {
-        this.checkList()
-      }),
-      deep: true,
-    },
-  },
-   filters: {
-    filterState: function(value) {
-      // 1-待审核, 2-成功, 3-被驳回
-        if (value == 1) {
-          return '待审核'
-        }
-        else if (value == 2) {
-          return '审核通过'
-        }
-        else if (value == 3) {
-          return '被驳回'
-        }
-    },
-    filterType:function(val){
-      if(val== 1){
-        return '优惠券'
-      }else if(val == 6){
-        return '研学'
-      }else if(val == 5){
-        return '商品'
-      }
-    }
-  },
-  methods: {
-    handleDetail(row){
-      this.$router.push({
-        path:'/operationManage/goodsAudit/auditGoods',
-        query:{
-          id:row.goodsId,
-          title:'审核详情',
-          mode:'detail',
-          shopId:row.shopId
-        }
-      })
-    },
-    // 点击审核
-    handleAudit(row) {
-      this.$router.push({
-        path:'/operationManage/goodsAudit/auditGoods',
-        query:{
-          id:row.goodsId,
-          mode:'edit',
-          shopId:row.shopId
-        }
-      })
-
-    },
-    handleSizeChange(val) {
-      this.query.currentPage = 1;
-      this.query.pageSize = val;
-    this.checkList()
-
-    },
-    handleCurrentChange(val) {
-      this.query.currentPage = val;
-    this.checkList()
-
-    },
-
-    search() {
-      this.query.currentPage = 1;
-    this.checkList()
-
-    },
-    checkList(){
-      this.loading = true
-      checkList(this.query).then(res=>{
-        this.loading = false
-        if(res.state == 'Success'){
-          this.tableData = res.content.records
-          this.total = res.content.total
-        }
-      })
-    }
-  },
-  created() {
-    this.checkList()
-  },
-};
-</script>
-  
-<style lang="scss" scoped>
-.goodsAudit {
-  .search{
-    justify-content: space-between;
-  }
-}
-</style>
-  

+ 75 - 30
src/views/operationManage/shopManage/shopAdd.vue

@@ -2,7 +2,7 @@
  * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
  * @Date: 2023-05-26 16:37:34
  * @LastEditors: wenjie 1454560336@qq.com
- * @LastEditTime: 2024-11-11 14:22:45
+ * @LastEditTime: 2024-11-12 15:37:19
  * @FilePath: \admin-manage\src\views\operationManage\shopManage\shopAdd.vue
  * @Description:
  *
@@ -21,7 +21,7 @@
     <el-tabs v-model="activeName">
     <el-tab-pane label="基本信息" name="1">
       <el-form-item label="商铺主体:" prop="shopMainId">
-        <el-select v-model="setQuery.shopMainId" :disabled="mode != 'add'" size="small" filterable class="item-width-300" placeholder="请搜索选择店铺主体">
+        <el-select v-model="setQuery.shopMainId" @change="changeMain" :disabled="mode != 'add'" size="small" filterable class="item-width-300" placeholder="请搜索选择店铺主体">
           <el-option
             v-for="item in shopMainOptions"
             :key="item.value"
@@ -213,7 +213,7 @@
        <el-form-item label="绑定所属平台及分账规则" prop="platformType">
 
         <el-checkbox-group v-model="setQuery.platformType" prop="platformType">
-            <div class="flex" v-for="(item,index) in masterShopOptions" :key="index" >
+            <div class="flex" v-for="(item,index) in shopOptions" :key="index" >
               <el-checkbox :label="item.value">{{item.label}}</el-checkbox> 
             <el-form-item label="分账规则:" v-if="setQuery.platformType.includes(item.value)" :prop="'shopInfos.' + index + '.shareId'" :rules="{required: true, message: '请选择分账规则', trigger: 'change'}">
               <el-select
@@ -317,6 +317,7 @@ import {getRuleList} from '@/api/rule'
 import {getData} from '@/api/goods'
 import {finishComplexList} from '@/api/payment'
 import {getSearchList,uidToAddress} from '@/api/common'
+import {accountDetail } from "@/api/user";
 import { debounce } from "@/utils/index";
 export default {
   components: {
@@ -336,6 +337,7 @@ export default {
         }
       };
     return {
+      shopOptions:[],
       checkList:[],
       activeName:"1",
       map:null,
@@ -488,6 +490,7 @@ export default {
     // }),
     "setQuery.shopMainId":function(val){
       if(val){
+        this.accountDetail(val)
         this.finishComplexList()
       }else{
           this.authOptions = []
@@ -520,6 +523,9 @@ export default {
     },
   },
   methods: {
+    changeMain(val){
+      this.setQuery.shopInfos = []
+    },
     
     // 选择地址
     selectAddress(val){
@@ -668,24 +674,25 @@ export default {
           this.setQuery.serviceCate = this.setQuery.serviceCate.split('/').map(item=>{return item = item.split(',').map(item=> Number(item))})
           this.setQuery.shopMenuId = this.setQuery.shopMenuId.split(',').map(item=> Number(item))
           this.setQuery.platformType = this.setQuery.platformType.split(',').map(item=> Number(item))
-          let shopInfos = JSON.parse(JSON.stringify(this.setQuery.shopInfos))
-          this.setQuery.shopInfos=[]
-          this.masterShopOptions.map(item=>{
-            this.setQuery.shopInfos.push({
-              shareId:'',
-              authAccount:'',
-              platformType:item.value
-            })
-          })
-
-          this.setQuery.shopInfos.map(item=>{
-              shopInfos.map(i=>{
-                if(item.platformType == i.platformType){
-                  item.shareId = i.shareId
-                  item.authAccount = i.authAccount
-                }
-            })
-          })
+          // let shopInfos = JSON.parse(JSON.stringify(this.setQuery.shopInfos))
+          // this.setQuery.shopInfos=[]
+
+          // this.shopOptions.map(item=>{
+          //   this.setQuery.shopInfos.push({
+          //     shareId:'',
+          //     authAccount:'',
+          //     platformType:item.value
+          //   })
+          // })
+
+          // this.setQuery.shopInfos.map(item=>{
+          //     shopInfos.map(i=>{
+          //       if(item.platformType == i.platformType){
+          //         item.shareId = i.shareId
+          //         item.authAccount = i.authAccount
+          //       }
+          //   })
+          // })
 
         }
       });
@@ -850,17 +857,55 @@ export default {
           this.authOptions = list
         }
       })
-    }
+    },
+    accountDetail(accountId) {
+      return new Promise((resolve, reject) => {
+          accountDetail({accountId}).then((res) => {
+            if (res.state == "Success") {
+              if(res.content.platformShares){
+                this.shopOptions = []
+                JSON.parse(res.content.platformShares).map((item) => {
+                  this.shopOptions.push({
+                    label: this.filterMasterName(item.platformType),
+                    value: Number(item.platformType) 
+                  })
+                })
+
+                let shopInfos = JSON.parse(JSON.stringify(this.setQuery.shopInfos))
+                this.setQuery.shopInfos=[]
+
+                this.shopOptions.map(item=>{
+                  this.setQuery.shopInfos.push({
+                    shareId:'',
+                    authAccount:'',
+                    platformType:item.value
+                  })
+                })
+
+                this.setQuery.shopInfos.map(item=>{
+                    shopInfos.map(i=>{
+                      if(item.platformType == i.platformType){
+                        item.shareId = i.shareId
+                        item.authAccount = i.authAccount
+                      }
+                  })
+                })
+              }
+              resolve()
+            }
+          });
+       })
+    },
   },
   created() {
-    this.setQuery.shopInfos=[]
-    this.masterShopOptions.map(item=>{
-      this.setQuery.shopInfos.push({
-        shareId:'',
-        authAccount:'',
-        platformType:item.value
-      })
-    })
+    // this.setQuery.shopInfos=[]
+    // this.masterShopOptions.map(item=>{
+    //   this.setQuery.shopInfos.push({
+    //     shareId:'',
+    //     authAccount:'',
+    //     platformType:item.value
+    //   })
+    // })
     // this.finishComplexList()
     this.getData()
     this.getRuleList()

+ 1 - 1
yarn.lock

@@ -459,7 +459,7 @@
 
 "@babel/plugin-syntax-dynamic-import@^7.8.3":
   "integrity" "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ=="
-  "resolved" "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz"
+  "resolved" "https://registry.npmmirror.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz"
   "version" "7.8.3"
   dependencies:
     "@babel/helper-plugin-utils" "^7.8.0"