zhangdan 3 rokov pred
rodič
commit
a1a500be2d
35 zmenil súbory, kde vykonal 3874 pridanie a 257 odobranie
  1. 2 2
      package-lock.json
  2. 15 0
      src/api/OperateJournal.js
  3. 41 0
      src/api/boundRecord.js
  4. 20 0
      src/api/dealer.js
  5. 86 0
      src/api/menu.js
  6. 7 7
      src/api/power-role.js
  7. 6 6
      src/api/power-user.js
  8. 101 0
      src/api/shelf.js
  9. 20 0
      src/api/store.js
  10. 1 1
      src/components/Select/index.js
  11. 107 8
      src/config/router.config.js
  12. 1 1
      src/utils/request.js
  13. 460 0
      src/views/bnSetting/menu/adminMenus.vue
  14. 348 0
      src/views/bnSetting/menu/childModal.vue
  15. 497 0
      src/views/bnSetting/menu/storeMenus.vue
  16. 162 0
      src/views/bnSetting/menusAuth.vue
  17. 41 0
      src/views/bnSetting/menusAuthTab.vue
  18. 61 0
      src/views/common/dealerList.vue
  19. 61 0
      src/views/common/storeList.vue
  20. 241 0
      src/views/numsGoodsShelves/bondManagement/list.vue
  21. 73 77
      src/views/numsGoodsShelves/goodsShelvesAdministration/addGoodsShelve.vue
  22. 159 0
      src/views/numsGoodsShelves/goodsShelvesAdministration/addHWModal.vue
  23. 108 0
      src/views/numsGoodsShelves/goodsShelvesAdministration/changeStatusModal.vue
  24. 188 0
      src/views/numsGoodsShelves/goodsShelvesAdministration/chooseImportModal.vue
  25. 122 36
      src/views/numsGoodsShelves/goodsShelvesAdministration/goodsAllocationSet.vue
  26. 207 0
      src/views/numsGoodsShelves/goodsShelvesAdministration/importHuoweiModal.vue
  27. 91 79
      src/views/numsGoodsShelves/goodsShelvesAdministration/list.vue
  28. 253 0
      src/views/numsGoodsShelves/goodsShelvesAdministration/settlementModifyModal.vue
  29. 336 0
      src/views/numsGoodsShelves/goodsShelvesAdministration/settlementSet.vue
  30. 19 12
      src/views/power/OperateJournal/OperateJournal.vue
  31. 5 7
      src/views/power/role/roleList.vue
  32. 1 1
      src/views/power/role/roleModal.vue
  33. 30 16
      src/views/power/user/userList.vue
  34. 2 2
      src/views/power/user/userModal.vue
  35. 2 2
      vue.config.js

+ 2 - 2
package-lock.json

@@ -1,6 +1,6 @@
 {
-  "name": "qpls-md",
-  "version": "2.0.0",
+  "name": "jq-repairFusion",
+  "version": "1.0.0",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {

+ 15 - 0
src/api/OperateJournal.js

@@ -0,0 +1,15 @@
+import { axios } from '@/utils/request'
+
+// 操作日志列表
+export const journalList = (params) => {
+  let url = `/sysLog/queryLike/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+

+ 41 - 0
src/api/boundRecord.js

@@ -0,0 +1,41 @@
+import { axios } from '@/utils/request'
+
+// 获取货架列表数据
+export const bondRecordByPage = params => {
+  const url = `/shelf/bondRecord/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 保证金详情
+export const bondRecordDetail = params => {
+  return axios({
+    url: `//shelf/bondRecord/queryBySn/${params.bondRecordSn}`,
+    data: {},
+    method: 'post'
+  })
+}
+
+// 新增/编辑保证金接口
+export const saveBondRecord = params => {
+  return axios({
+    url: '/shelf/bondRecord/save',
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 保证金列表(无分页)
+export const bondRecordList = params => {
+  const url = `/shelf/bondRecord/queryList`
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}

+ 20 - 0
src/api/dealer.js

@@ -0,0 +1,20 @@
+import { axios } from '@/utils/request'
+// 获取经销商列表(带分页)
+export const dealerListByPage = params => {
+  const url = `/dealer/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+// 获取经销商列表(无分页)
+export const dealerList = params => {
+  return axios({
+    url: '/dealer/queryList',
+    data: params,
+    method: 'POST'
+  })
+}

+ 86 - 0
src/api/menu.js

@@ -0,0 +1,86 @@
+import { axios } from '@/utils/request'
+
+// 获取菜单树数据
+export const getMenuList = params => {
+  const url = `/menu/findAll`
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 保存
+export const saveMenu = params => {
+  const url = `/menu/save`
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 删除
+export const deleteMenu = params => {
+  const url = `/menu/delete/${params.id}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+
+// 获取门店菜单树数据
+export const getMdMenuList = params => {
+  const url = `/mdmenu/findAll`
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 门店菜单保存
+export const saveMdMenu = params => {
+  const url = `/mdmenu/save`
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+// 门店菜单删除
+export const deleteMdMenu = params => {
+  const url = `/mdmenu/delete/${params.id}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+
+// 获取运营菜单树数据
+export const getYyMenuList = params => {
+  const url = `/yymenu/findAll`
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 运营菜单保存
+export const saveYyMenu = params => {
+  const url = `/yymenu/save`
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+// 运营菜单删除
+export const deleteYyMenu = params => {
+  const url = `/yymenu/delete/${params.id}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}

+ 7 - 7
src/api/power-role.js

@@ -2,7 +2,7 @@ import { axios } from '@/utils/request'
 
 // 获取列表数据
 export const getPowerRoleList = params => {
-  const url = `/role/queryLike/${params.pageNo}/${params.pageSize}`
+  const url = `/yyrole/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -15,7 +15,7 @@ export const getPowerRoleList = params => {
 // 改变权限状态接口 flag 0:禁用 1:启用
 export const updateEnableStatus = params => {
   return axios({
-    url: `/role/enable/${params.id}/${params.flag}`,
+    url: `/yyrole/enable/${params.id}/${params.flag}`,
     data: {},
     method: 'get'
   })
@@ -24,7 +24,7 @@ export const updateEnableStatus = params => {
 // 删除用户接口
 export const delectRolePower = params => {
   return axios({
-    url: `/role/delete/${params.id}`,
+    url: `/yyrole/delete/${params.id}`,
     data: {},
     method: 'get'
   })
@@ -33,7 +33,7 @@ export const delectRolePower = params => {
 // 新增/编辑保存接口
 export const saveRolePower = params => {
   return axios({
-    url: '/role/save',
+    url: '/yyrole/save',
     data: params,
     method: 'POST'
   })
@@ -41,7 +41,7 @@ export const saveRolePower = params => {
 
 // 获取菜单树数据
 export const getMenuList = params => {
-  const url = `/role/findAllMenu/${params.id}`
+  const url = `/yyrole/findAllMenu/${params.id}`
   return axios({
     url: url,
     method: 'get'
@@ -50,10 +50,10 @@ export const getMenuList = params => {
 
 // 保存权限分配
 export const addMenuPower = params => {
-  const url = `/role/saveRoleMenu`
+  const url = `/yyrole/saveRoleMenu`
   return axios({
     url: url,
     data: params,
     method: 'post'
   })
-}
+}

+ 6 - 6
src/api/power-user.js

@@ -3,7 +3,7 @@ import { axios } from '@/utils/request'
 // 重置密码
 export const resetPSD = params => {
   return axios({
-    url: '/mduser/resetPwd',
+    url: '/yyuser/resetPwd',
     data: params,
     method: 'POST'
   })
@@ -11,7 +11,7 @@ export const resetPSD = params => {
 
 // 获取列表数据
 export const getPowerUserList = params => {
-  const url = `/mduser/queryLike/${params.pageNo}/${params.pageSize}`
+  const url = `/yyuser/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -34,7 +34,7 @@ export const getUserAllList = params => {
 // 改变权限状态接口
 export const updateEnableStatus = params => {
   return axios({
-    url: `/mduser/enable/${params.id}/${params.flag}`,
+    url: `/yyuser/enable/${params.id}/${params.flag}`,
     data: {},
     method: 'get'
   })
@@ -43,7 +43,7 @@ export const updateEnableStatus = params => {
 // 删除用户接口
 export const delectUserPower = params => {
   return axios({
-    url: `/mduser/delete/${params.id}`,
+    url: `/yyuser/delete/${params.id}`,
     data: {},
     method: 'get'
   })
@@ -52,7 +52,7 @@ export const delectUserPower = params => {
 // 新增/编辑保存接口
 export const saveUserPower = params => {
   return axios({
-    url: '/mduser/save',
+    url: '/yyuser/save',
     data: params,
     method: 'POST'
   })
@@ -61,7 +61,7 @@ export const saveUserPower = params => {
 // 获取角色列表接口
 export const getRoleList = params => {
   return axios({
-    url: '/mdrole/findAll',
+    url: '/yyrole/findAll',
     data: params,
     method: 'POST'
   })

+ 101 - 0
src/api/shelf.js

@@ -0,0 +1,101 @@
+import { axios } from '@/utils/request'
+
+// 获取货架列表数据
+export const getShelfList = params => {
+  const url = `/shelf/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 改变数字货架状态接口
+export const updateEnableStatus = params => {
+  return axios({
+    url: `/shelf/updateState`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 货架详情
+export const shelfDetail = params => {
+  return axios({
+    url: `/shelf/queryBySn/${params.shelfSn}`,
+    data: {},
+    method: 'post'
+  })
+}
+
+// 新增/编辑保存货架接口
+export const saveShelf = params => {
+  return axios({
+    url: '/shelf/save',
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 下载货位模板
+export const shelfHWExport = (params) => {
+  return axios({
+    url: '/shelf/place/downloadExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 解析货位模板
+export const shelfHWreadExcel = params => {
+  const url = `/shelf/place/readExcel`
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+// 货位列表
+export const shelfHWList = params => {
+  const url = `/shelf/place/queryList`
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+// 批量保存货位
+export const shelfAllSave = params => {
+  return axios({
+    url: '/shelf/place/saveBatch',
+    data: params,
+    method: 'POST'
+  })
+}
+// 货位详情
+export const shelfHWDetail = params => {
+  return axios({
+    url: `/shelf/place/queryBySn/${params.shelfPlaceSn}`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 保存结算方式
+export const shelfSettleRuleSave = params => {
+  return axios({
+    url: `/shelf/settleRule/save`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 结算方式详情
+export const settleRuleDetail = params => {
+  return axios({
+    url: `/shelf/settleRule/queryBySnType/${params.shelfSn}/${params.settleType}`,
+    method: 'get'
+  })
+}

+ 20 - 0
src/api/store.js

@@ -0,0 +1,20 @@
+import { axios } from '@/utils/request'
+// 获取门店列表(带分页)
+export const storeListByPage = params => {
+  const url = `/store/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+// 获取门店列表(无分页)
+export const storeList = params => {
+  return axios({
+    url: '/store/queryList',
+    data: params,
+    method: 'POST'
+  })
+}

+ 1 - 1
src/components/Select/index.js

@@ -98,7 +98,7 @@ export default {
       <Select vModel={props.value} {...{ props, on: on }}>
         {
           this.dataList.map(item => {
-            return (<a-select-option value={item.code} key={item.code}>{item['dispName']}</a-select-option>)
+            return (<a-select-option value={item.code} key={item.code} disabled={false}>{item['dispName']}</a-select-option>)
           })
         }
       </Select>

+ 107 - 8
src/config/router.config.js

@@ -83,7 +83,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'set/:id',
+                path: 'hwSet/:id',
                 name: 'goodsAllocationSet',
                 component: () => import('@/views/numsGoodsShelves/goodsShelvesAdministration/goodsAllocationSet.vue'),
                 meta: {
@@ -91,12 +91,32 @@ export const asyncRouterMap = [
                   hidden: true
                   // permission: 'M_salesNew'
                 }
+              },
+              {
+                path: 'jsSet/:id',
+                name: 'settlementSet',
+                component: () => import('@/views/numsGoodsShelves/goodsShelvesAdministration/settlementSet.vue'),
+                meta: {
+                  title: '结算设置',
+                  hidden: true
+                  // permission: 'M_salesNew'
+                }
               }
             ]
+          },
+          {
+            path: '/numsGoodsShelves/bondManagement',
+            name: 'bondManagementList',
+            component: () => import(/* webpackChunkName: "auth" */ '@/views/numsGoodsShelves/bondManagement/list.vue'),
+            meta: {
+              title: '保证金管理',
+              icon: 'user'
+              // permission: 'M_powerMD_user_list'
+            }
           }
-
         ]
       },
+      // 系统设置
       // auth
       {
         path: '/auth',
@@ -104,8 +124,8 @@ export const asyncRouterMap = [
         component: PageView,
         meta: {
           title: '权限管理',
-          icon: 'lock',
-          permission: 'M_powerMD_0'
+          icon: 'lock'
+          // permission: 'M_powerMD_0'
         },
         children: [
           {
@@ -114,8 +134,8 @@ export const asyncRouterMap = [
             component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
             meta: {
               title: '用户管理',
-              icon: 'user',
-              permission: 'M_powerMD_user_list'
+              icon: 'user'
+              // permission: 'M_powerMD_user_list'
             }
           },
           {
@@ -124,10 +144,89 @@ export const asyncRouterMap = [
             component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
             meta: {
               title: '角色管理',
-              icon: 'solution',
-              permission: 'M_powerMD_role_list'
+              icon: 'solution'
+              // permission: 'M_powerMD_role_list'
+            }
+          },
+          {
+            path: '/menusAuth/adminMenus',
+            name: 'adminMenus',
+            component: () => import(/* webpackChunkName: "auth" */ '@/views/bnSetting/menu/adminMenus.vue'),
+            meta: {
+              title: '菜单管理',
+              icon: 'appstore'
+              // permission: 'M_menuList'
+            }
+          }
+        ]
+      },
+      {
+        path: '/setting',
+        redirect: '/setting/userList',
+        component: PageView,
+        meta: {
+          title: '系统设置',
+          icon: 'setting'
+          // permission: 'M_systemSet'
+        },
+        children: [
+          {
+            path: '/setting/dataDictionary',
+            name: 'powerDD',
+            component: () => import(/* webpackChunkName: "setting" */
+              '@/views/power/dataDictionary/dataDictionary.vue'),
+            meta: {
+              title: '数据字典管理',
+              icon: 'database'
+              // permission: 'M_dataD_lookup'
+            }
+          },
+          // {
+          //   path: '/setting/register',
+          //   name: 'powerRegister',
+          //   component: () => import(/* webpackChunkName: "setting" */ '@/views/power/register/register.vue'),
+          //   meta: {
+          //     title: '参数管理',
+          //     icon: 'key',
+          //     permission: 'M_sys_register'
+          //   }
+          // },
+          {
+            path: '/setting/OperateJournal',
+            name: 'powerOperateJournal',
+            component: () => import(/* webpackChunkName: "setting" */
+              '@/views/power/OperateJournal/OperateJournal.vue'),
+            meta: {
+              title: '操作日志',
+              icon: 'read'
+              // permission: 'M_OperateJournalList'
             }
           }
+          // {
+          //   path: '/setting/noticeManagement',
+          //   redirect: '/setting/noticeManagement/list',
+          //   name: 'noticeManagement',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '公告管理',
+          //     icon: 'sketch',
+          //     permission: 'M_noticeManagementList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'noticeManagementList',
+          //       component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/noticeManagement/list.vue'),
+          //       meta: {
+          //         title: '公告列表',
+          //         icon: 'sketch',
+          //         hidden: true,
+          //         permission: 'M_noticeManagementList'
+          //       }
+          //     }
+          //   ]
+          // }
         ]
       }
     ]

+ 1 - 1
src/utils/request.js

@@ -76,7 +76,7 @@ service.interceptors.response.use((response) => {
       description: response.data.code
     })
   }
-  return response.data
+  return response
 }, err)
 
 const installer = {

+ 460 - 0
src/views/bnSetting/menu/adminMenus.vue

@@ -0,0 +1,460 @@
+<template>
+  <a-card :bordered="false" :bodyStyle="{overflowY: 'auto'}">
+    <a-row :gutter="24">
+      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild">添加子菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle">添加顶部菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()">删除</a-button>
+    </a-row>
+    <a-row :gutter="24">
+      <!-- 左侧菜单树列表 -->
+      <a-col :span="8">
+        <a-row :gutter="24" class="textCount">
+          <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
+          <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{ selectedMenu }}</span><span v-if="selectedKeys.length" class="imgSize" @click="cancelSel">取消选择</span></span>
+        </a-row>
+        <a-row :gutter="24" >
+          <a-input-search placeholder="输入搜索菜单名搜索" style="width: 100%" @change="onChange" />
+          <a-tree
+            @expand="onExpand"
+            :treeData="getMenus"
+            :expandedKeys="expandedKeys"
+            :autoExpandParent="autoExpandParent"
+            @select="onSelect"
+            :selectedKeys="selectedKeys"
+          >
+            <template slot="title" slot-scope="{title}">
+              <span v-if="title.indexOf(searchValue) > -1">
+                {{ title.substr(0, title.indexOf(searchValue)) }}
+                <span style="color: #f50">{{ searchValue }}</span>
+                {{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
+              </span>
+              <span v-else>{{ title }}</span>
+            </template>
+            <a-icon slot="file" type="file" />
+            <a-icon slot="pushpin" type="pushpin" />
+          </a-tree>
+        </a-row>
+      </a-col>
+      <!-- 右侧 -->
+      <a-col :span="16" >
+        <a-form :form="form" @submit="handleSubmit">
+          <!-- 类型 -->
+          <a-form-item label="类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <div v-if="!formData.type||formData.type=='0'">
+              <a-icon type="file" style="margin-right: 10px;" /><span >页面菜单</span>
+            </div>
+            <div v-if="formData.type=='1'">
+              <a-icon type="pushpin" style="margin-right: 10px;" /><span >操作按钮</span>
+            </div>
+          </a-form-item>
+          <!-- 名称 -->
+          <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入名称(最多30个字符)"
+              v-decorator="['formData.name', {
+                initialValue: formData.name,
+                getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入名称!' }] }]"
+            />
+          </a-form-item>
+          <!-- 路由英文名 -->
+          <!-- <a-form-item v-if="!formData.type||formData.type=='0'" label="路由英文名" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入路由英文名"
+              v-decorator="['formData.routeName', {
+                initialValue: formData.routeName,
+                rules: [{ required: true, message: '请输入路由英文名!' }] }]"
+            />
+          </a-form-item> -->
+          <!-- 路径 -->
+          <!-- <a-form-item v-if="!formData.type||formData.type=='0'" label="路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入路径"
+              v-decorator="['formData.routePath', {
+                initialValue: formData.routePath,
+                rules: [{ required: true, message: '请输入路径!' }] }]"
+            />
+          </a-form-item> -->
+          <!-- 请求路径 -->
+          <!-- <a-form-item v-if="formData.type==1" label="请求路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入请求路径"
+              v-decorator="['formData.urlPath', {
+                initialValue: formData.urlPath,
+                rules: [{ required: true, message: '请输入请求路径!' }] }]"
+            />
+          </a-form-item> -->
+          <!-- 前端权限编码 -->
+          <a-form-item label="前端权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入前端权限编码"
+              v-decorator="[
+                'formData.code',
+                {
+                  initialValue: formData.code,
+                  rules: [{ required: true, message: '请输入前端权限编码!' }] },
+              ]"
+            />
+          </a-form-item>
+          <!-- 后台权限编码 -->
+          <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-textarea
+              placeholder="请输入后台权限编码"
+              :auto-size="{ minRows: 2, maxRows: 6 }"
+              v-decorator="[
+                'formData.permission',
+                {
+                  initialValue: formData.permission,
+                  rules: [{ required: formData.isLeaf, message: '请输入后台权限编码!' }] },
+              ]"
+            />
+          </a-form-item>
+          <!-- 图标 -->
+          <!-- <a-form-item v-if="!formData.type ||formData.type=='0' " label="图标" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入图标名称"
+              v-decorator="['formData.icon', {
+                initialValue: formData.icon,
+                rules: [] }]"
+            />
+          </a-form-item> -->
+          <!-- 前端组件 -->
+          <!-- <a-form-item v-if="!formData.type ||formData.type=='0'" label="前端组件" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入前端组件路径"
+              v-decorator="['formData.componentPath', {
+                initialValue: formData.componentPath,
+                rules: [{ required: true, message: '请输入前端组件路径!' }] }]"
+            />
+          </a-form-item> -->
+
+          <!-- 第三方链接 -->
+          <!-- <a-form-item v-if="!formData.type ||formData.type=='0'" label="第三方链接" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入第三方链接地址"
+              v-decorator="['formData.urlPath', {
+                initialValue: formData.urlPath,
+                rules: [] }]"
+            />
+          </a-form-item> -->
+
+          <!-- 排序值 -->
+          <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input-number
+              style="width: 100%;"
+              type="number"
+              placeholder="请输入排序值(0~999999)"
+              v-decorator="['formData.sort', {
+                initialValue: formData.sort,
+                rules: [] }]"
+              :max="999999"
+              :min="0"
+            />
+          </a-form-item>
+          <!-- 状态 -->
+          <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-radio-group
+              name="radioGroup"
+              v-decorator="[
+                'formData.status',
+                {
+                  initialValue: formData.status,
+                  rules: [{ required: true, message: '请选择状态!' }] },
+              ]"
+            >
+              <a-radio :value="1">是</a-radio>
+              <a-radio :value="0">否</a-radio>
+            </a-radio-group>
+          </a-form-item>
+
+          <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
+            <a-button type="primary" @click="handleSubmit()">
+              保存
+            </a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="clear">
+              重置
+            </a-button>
+          </a-form-item>
+        </a-form>
+
+      </a-col>
+    </a-row>
+    <childModal parentType="admin" :visible="showChildModal" @refresh="getYyMenuList" :data="parentData" @close="showChildModal = false"></childModal>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import childModal from './childModal.vue'
+import { getYyMenuList, saveYyMenu, deleteYyMenu } from '@/api/menu.js'
+
+export default {
+  name: 'Menu',
+  components: {
+    STable, VSelect, childModal
+  },
+  props: {},
+  data () {
+    return {
+      treeData: [],
+      dataList: [],
+      searchValue: '',
+      expandedKeys: [],
+      autoExpandParent: true,
+      selectedKeys: [],
+      selectedMenu: '', // 选择的树节点名
+      formLayout: 'horizontal',
+      form: this.$form.createForm(this, { name: 'menu' }),
+      showChildModal: false,
+      parentData: {}, // 父级菜单
+      formData: {
+        id: '',
+        name: '',
+        routePath: '',
+        icon: '',
+        routeName: '',
+        componentPath: '',
+        urlPath: '',
+        code: '',
+        permission: '',
+        sort: '',
+        type: '0',
+        isLeaf: true,
+        status: '' // 活动状态
+      }
+    }
+  },
+  computed: {
+    getMenus () {
+      this.generateList(this.treeData)
+      return this.treeData
+    }
+  },
+  methods: {
+    onExpand (expandedKeys) {
+      // console.log('onExpand', expandedKeys)
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+    onSelect (selectedKeys, info) {
+      console.log('onSelect', info)
+      this.selectedKeys = selectedKeys
+      if (info.selected) {
+        const data = info.selectedNodes[0].data.props
+        const isLeaf = data.dataRef.children
+        // this.formData = Object.assign({}, this.formData, info.selectedNodes[0].data.props)
+        this.formData = {
+          id: data.id,
+          name: data.name,
+          routePath: data.routePath,
+          icon: data.icon,
+          routeName: data.routeName,
+          componentPath: data.componentPath,
+          urlPath: data.urlPath,
+          code: data.code,
+          permission: data.permission,
+          sort: data.sort,
+          type: data.type,
+          status: data.status,
+          isLeaf: !(isLeaf && isLeaf.length)
+        }
+
+        this.selectedMenu = this.formData.name
+        this.formData.status = Number(this.formData.status)
+      } else {
+        this.selectedMenu = ''
+        this.clear()
+      }
+    },
+    generateList (data) {
+      for (let i = 0; i < data.length; i++) {
+        const node = data[i]
+        const key = node.title
+        this.dataList.push({ key, title: key })
+        node.scopedSlots = { title: 'title' }
+        node.slots = { icon: node.type == '0' ? 'file' : 'pushpin' }
+
+        if (node.children) {
+          this.generateList(node.children)
+        }
+      }
+    },
+    getParentKey (key, tree) {
+      let parentKey
+      for (let i = 0; i < tree.length; i++) {
+        const node = tree[i]
+        if (node.children) {
+          if (node.children.some(item => item.title == key)) {
+            parentKey = node.key
+          } else if (this.getParentKey(key, node.children)) {
+            parentKey = this.getParentKey(key, node.children)
+          }
+        }
+      }
+      return parentKey
+    },
+    onChange (e) {
+      const value = e.target.value
+      const expandedKeys = this.dataList
+        .map(item => {
+          if (item.title.indexOf(value) > -1) {
+            return this.getParentKey(item.title, this.treeData)
+          }
+          return null
+        })
+        .filter((item, i, self) => item && self.indexOf(item) === i)
+      Object.assign(this, {
+        expandedKeys,
+        searchValue: value,
+        autoExpandParent: true
+      })
+    },
+    // 获取菜单树列表
+    getYyMenuList () {
+      getYyMenuList().then(res => {
+        console.log(res, 'res1111111')
+        if (res.status == 200) {
+          this.treeData = res.data
+          console.log(this.treeData, 'this.treeData')
+        }
+      })
+    },
+    // 添加子节点
+    addChild () {
+      if (!this.selectedMenu) {
+        return this.$message.warning('请先选择一个父级菜单')
+      } else if (this.formData.type == '1') {
+        return this.$message.warning('请选择一个页面级菜单')
+      }
+      this.showChildModal = true
+      this.parentData = this.formData
+    },
+    // 添加顶部菜单
+    addTitle () {
+      this.showChildModal = true
+      this.parentData = {}
+    },
+
+    //  取消选择
+    cancelSel () {
+      this.selectedKeys = []
+      this.selectedMenu = ''
+      this.clear()
+    },
+    // 清空列表
+    clear () {
+      this.form.resetFields()
+      this.formData.id = ''
+      this.formData.name = ''
+      this.formData.routePath = ''
+      this.formData.icon = ''
+      this.formData.routeName = ''
+      this.formData.componentPath = ''
+      this.formData.urlPath = ''
+      this.formData.sort = ''
+      this.formData.type = ''
+      this.formData.status = ''
+      this.formData.code = ''
+      this.formData.permission = ''
+      this.formData.isLeaf = true
+    },
+
+    // 删除数据
+    delect () {
+      if (!this.selectedKeys.length) {
+        return this.$message.warning('您还未选择要删除的数据')
+      }
+      const _this = this
+      console.log(_this.formData.id, '_this.formData.id')
+      this.$confirm({
+        title: '警告',
+        content: `确定要删除您选择的 ${_this.formData.name} 的数据吗?`,
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          deleteYyMenu({
+            id: _this.formData.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success('删除成功')
+              _this.getYyMenuList()
+            }
+          }).catch(() => {
+            _this.$message.success('删除失败, 请稍后重试')
+          })
+        }
+      })
+    },
+
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          console.log(values.formData, ' formData.type222222222')
+          if (values.formData.permission) {
+            values.formData.permission = values.formData.permission.replace(/\//g, '_')
+          }
+          saveYyMenu(Object.assign({ id: this.formData.id }, values.formData)).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              _this.getYyMenuList()
+              _this.clear()
+            } else {
+              // this.$message.warning(res.message)
+            }
+          })
+        }
+      })
+    },
+    handleCancel () {
+      this.clear()
+    }
+
+  },
+  mounted () {
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, { name: 'menu' })
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getYyMenuList()
+    })
+  },
+  watch: {
+
+  }
+}
+</script>
+
+<style>
+  .menu-box::-webkit-scrollbar{
+    width: 6px;
+    height: 6px ;
+  }
+
+  .menu-box::-webkit-scrollbar-thumb{
+    width: 6px;
+    height: 6px ;
+    border-radius: 4px;
+    -webkit-box-shadow: inset 0 0 2px #d1d1d1;
+    background: #e4e4e4;
+  }
+
+  .textCount{
+    border: 1px solid #91d5ff;
+    background-color: #e6f7ff;
+    border-radius: 5px;
+    padding: 5px 10px 5px 20px;
+    margin: 10px 0;
+    color: rgba(0, 0, 0);
+  }
+  .imgSize{
+    color: #2d8cf0;
+    margin-left: 10px;
+    font-size: 14px;
+  }
+
+</style>

+ 348 - 0
src/views/bnSetting/menu/childModal.vue

@@ -0,0 +1,348 @@
+<template>
+  <div>
+    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+      <a-form :form="form" @submit="handleSubmit">
+        <!-- 上级菜单 -->
+        <a-form-item label="上级菜单" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <div >
+            <span >{{ parentTitle }}</span>
+          </div>
+
+        </a-form-item>
+        <!-- 类型 -->
+        <a-form-item label="类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-select
+            @change="selectChange"
+            :disabled="disabled"
+            v-decorator="[
+              'formData.type',
+              {
+                initialValue: formData.type,
+                rules: [{ required: true, message: '请选择状态!' }] },
+            ]"
+            style="width: 100%"
+            placeholder="请选择菜单类型"
+          >
+            <a-select-option :value="0">页面类型</a-select-option>
+            <a-select-option :value="1">按钮类型</a-select-option>
+          </a-select>
+        </a-form-item>
+
+        <!-- 名称 -->
+        <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input
+            placeholder="请输入名称(最多30个字符)"
+            :maxLength="30"
+            v-decorator="['formData.name', {
+              initialValue: formData.name,
+              getValueFromEvent: $filterEmpty,
+              rules: [{ required: true, message: '请输入名称!' }] }]"
+          />
+        </a-form-item>
+        <!-- 路由英文名 -->
+        <!-- <a-form-item v-if="!formData.type" label="路由英文名" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input
+            placeholder="请输入路由英文名"
+            v-decorator="['formData.routeName', {
+              initialValue: formData.routeName,
+              rules: [{ required: true, message: '请输入路由英文名!' }] }]"
+          />
+        </a-form-item> -->
+        <!-- 路径 -->
+        <!-- <a-form-item v-if="!formData.type" label="路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+             <a-input placeholder="请输入路径"
+                      v-decorator="['formData.routePath', {
+                        initialValue: formData.routePath,
+                        rules: [{ required: true, message: '请输入路径!' }] }]"
+             />
+           </a-form-item> -->
+        <!-- 请求路径 -->
+        <!-- <a-form-item v-if="formData.type==1" label="请求路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+             <a-input placeholder="请输入请求路径"
+                      v-decorator="['formData.urlPath', {
+                        initialValue: formData.urlPath,
+                        rules: [{ required: true, message: '请输入请求路径!' }] }]"
+             />
+           </a-form-item> -->
+        <!-- 前端权限编码 -->
+        <a-form-item label="前端权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input
+            placeholder="请输入前端权限编码"
+            v-decorator="[
+              'formData.code',
+              {
+                initialValue: formData.code,
+                rules: [{ required: true, message: '请输入前端权限编码!' }] },
+            ]"
+          />
+
+        </a-form-item>
+        <!-- 后台权限编码 -->
+        <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-textarea
+            placeholder="请输入后台权限编码"
+            :auto-size="{ minRows: 2, maxRows: 6 }"
+            v-decorator="[
+              'formData.permission',
+              {initialValue: formData.permission},
+            ]"
+          />
+
+        </a-form-item>
+
+        <!-- 图标 -->
+        <!-- <a-form-item v-if="!formData.type" label="图标" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input
+            placeholder="请输入图标名称"
+            v-decorator="['formData.icon', {
+              initialValue: formData.icon,
+              rules: [] }]"
+          />
+        </a-form-item> -->
+        <!-- 前端组件 -->
+        <!-- <a-form-item v-if="!formData.type" label="前端组件" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input
+            placeholder="请输入前端组件路径"
+            v-decorator="['formData.componentPath', {
+              initialValue: formData.componentPath,
+              rules: [{ required: true, message: '请输入前端组件路径!' }] }]"
+          />
+        </a-form-item> -->
+
+        <!-- 第三方链接 -->
+        <!-- <a-form-item v-if="!formData.type" label="第三方链接" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input
+            placeholder="请输入第三方链接地址"
+            v-decorator="['formData.urlPath', {
+              initialValue: formData.urlPath,
+              rules: [] }]"
+          />
+        </a-form-item> -->
+
+        <!-- 排序值 -->
+        <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input-number
+            style="width: 100%;"
+            type="number"
+            placeholder="请输入排序值(0~999999)"
+            v-decorator="['formData.sort', {
+              initialValue: formData.sort,
+              rules: [] }]"
+            :max="999999"
+            :min="0"
+          />
+        </a-form-item>
+        <!-- 连锁可用 -->
+        <a-form-item v-if="parentType=='store'" label="连锁可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-radio-group
+            name="radioGroup"
+            v-decorator="[
+              'formData.chainOrgUse',
+              {
+                initialValue: formData.chainOrgUse,
+                rules: [{ required: true, message: '请选择!' }] },
+            ]"
+          >
+            <a-radio :value="1">是</a-radio>
+            <a-radio :value="0">否</a-radio>
+          </a-radio-group>
+        </a-form-item>
+        <!-- 单店可用 -->
+        <a-form-item v-if="parentType=='store'" label="单店可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-radio-group
+            name="radioGroup"
+            v-decorator="[
+              'formData.singleOrgUse',
+              {
+                initialValue: formData.singleOrgUse,
+                rules: [{ required: true, message: '请选择!' }] },
+            ]"
+          >
+            <a-radio :value="1">是</a-radio>
+            <a-radio :value="0">否</a-radio>
+          </a-radio-group>
+        </a-form-item>
+        <!-- 状态 -->
+        <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-radio-group
+            name="radioGroup"
+            v-decorator="[
+              'formData.status',
+              {
+                initialValue: formData.status,
+                rules: [{ required: true, message: '请选择状态!' }] },
+            ]"
+          >
+            <a-radio :value="1">是</a-radio>
+            <a-radio :value="0">否</a-radio>
+          </a-radio-group>
+        </a-form-item>
+
+        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
+          <a-button type="primary" @click="handleSubmit()">
+            保存
+          </a-button>
+          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { saveYyMenu, saveMdMenu } from '@/api/menu.js'
+export default {
+  name: 'ChildModal',
+  components: {
+    STable, VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    parentType: {
+      type: String,
+      default: ''
+    },
+    data: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible,
+      titleText: '',
+      disabled: false,
+      parentTitle: '',
+      formLayout: 'horizontal',
+      form: this.$form.createForm(this, { name: 'childModal' }),
+      formData: {
+        parentId: '',
+        name: '',
+        routePath: '',
+        icon: '',
+        routeName: '',
+        code: '',
+        permission: '',
+        componentPath: '',
+        urlPath: '',
+        sort: '',
+        type: undefined,
+        chainOrgUse: 1,
+        singleOrgUse: 1,
+        status: 1 // 活动状态
+      }
+    }
+  },
+  methods: {
+    cancel (e) {
+      this.clear()
+      this.$emit('close')
+    },
+
+    selectChange (val) {
+      this.formData.type = val
+      console.log(val)
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          console.log(values.formData, ' formData.type222222222')
+          values.formData.permission = values.formData.permission.replace(/\//g, '_')
+          const saveRequest = this.parentType == 'store' ? saveMdMenu : saveYyMenu
+          saveRequest(Object.assign(this.formData, values.formData)).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              this.$emit('refresh')
+              setTimeout(function () {
+                _this.cancel()
+              }, 300)
+            } else {
+              // this.$message.warning(res.message)
+            }
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.clear()
+          _this.cancel()
+        }
+      })
+    },
+    clear () {
+      this.form.resetFields()
+      this.parentTitle = ''
+      this.formData.parentId = ''
+      this.formData.name = ''
+      this.formData.routePath = ''
+      this.formData.icon = ''
+      this.formData.routeName = ''
+      this.formData.componentPath = ''
+      this.formData.urlPath = ''
+      this.formData.sort = ''
+      this.formData.type = ''
+      this.formData.status = 1
+      this.formData.chainOrgUse = 1
+      this.formData.singleOrgUse = 1
+      this.formData.code = ''
+      this.formData.permission = ''
+    }
+
+  },
+  mounted () {
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, { name: 'childModal' })
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        if (this.data.id) { // 添加子菜单
+          this.titleText = '添加子菜单'
+          // this.disabled = false
+          console.log(this.data, 'this.data')
+          this.formData.parentId = this.data.id
+          this.parentTitle = this.data.name
+        } else { // 添加顶菜单
+          this.titleText = '添加顶菜单'
+          this.formData.type = 0
+          // this.disabled = false
+        }
+      } else {
+        this.cancel()
+      }
+    }
+  }
+}
+</script>
+
+<style >
+  .modalBox{
+  }
+  .ant-modal-footer {
+    display: none;
+  }
+</style>

+ 497 - 0
src/views/bnSetting/menu/storeMenus.vue

@@ -0,0 +1,497 @@
+<template>
+  <a-card :bordered="false">
+    <a-row :gutter="24">
+      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild">添加子菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle">添加顶部菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()">删除</a-button>
+
+    </a-row>
+    <a-row :gutter="24">
+      <!-- 左侧菜单树列表 -->
+      <a-col :span="8">
+        <a-row :gutter="24" class="textCount">
+          <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
+          <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{ selectedMenu }}</span><span v-if="selectedKeys.length" class="imgSize" @click="cancelSel">取消选择</span></span>
+        </a-row>
+
+        <a-row :gutter="24" >
+          <a-input-search placeholder="输入搜索菜单名搜索" style="width: 100%" @change="onChange" />
+          <a-tree
+            @expand="onExpand"
+            :treeData="getMenus"
+            :expandedKeys="expandedKeys"
+            :autoExpandParent="autoExpandParent"
+            @select="onSelect"
+            :selectedKeys="selectedKeys"
+          >
+            <template slot="title" slot-scope="{title}">
+              <span v-if="title.indexOf(searchValue) > -1">
+                {{ title.substr(0, title.indexOf(searchValue)) }}
+                <span style="color: #f50">{{ searchValue }}</span>
+                {{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
+              </span>
+              <span v-else>{{ title }}</span>
+            </template>
+            <a-icon slot="file" type="file" />
+            <a-icon slot="pushpin" type="pushpin" />
+          </a-tree>
+        </a-row>
+      </a-col>
+      <!-- 右侧 -->
+      <a-col :span="16" >
+        <a-form :form="form" @submit="handleSubmit">
+          <!-- 类型 -->
+          <a-form-item label="类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <div v-if="!formData.type||formData.type=='0'">
+              <a-icon type="file" style="margin-right: 10px;" /><span >页面菜单</span>
+            </div>
+            <div v-if="formData.type=='1'">
+              <a-icon type="pushpin" style="margin-right: 10px;" /><span >操作按钮</span>
+            </div>
+          </a-form-item>
+
+          <!-- 名称 -->
+          <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入名称(最多30个字符)"
+              :maxLength="30"
+              v-decorator="['formData.name', {
+                initialValue: formData.name,
+                getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入名称!' }] }]"
+            />
+          </a-form-item>
+          <!-- 路由英文名 -->
+          <!-- <a-form-item v-if="!formData.type||formData.type=='0'" label="路由英文名" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入路由英文名"
+              v-decorator="['formData.routeName', {
+                initialValue: formData.routeName,
+                rules: [{ required: true, message: '请输入路由英文名!' }] }]"
+            />
+          </a-form-item> -->
+          <!-- 路径 -->
+          <!-- <a-form-item v-if="!formData.type||formData.type=='0'" label="路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入路径"
+              v-decorator="['formData.routePath', {
+                initialValue: formData.routePath,
+                rules: [{ required: true, message: '请输入路径!' }] }]"
+            />
+          </a-form-item> -->
+          <!-- 请求路径 -->
+          <!-- <a-form-item v-if="formData.type==1" label="请求路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入请求路径"
+              v-decorator="['formData.urlPath', {
+                initialValue: formData.urlPath,
+                rules: [{ required: true, message: '请输入请求路径!' }] }]"
+            />
+          </a-form-item> -->
+          <!-- 前端权限编码 -->
+          <a-form-item label="前端权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入前端权限编码"
+              v-decorator="[
+                'formData.code',
+                {
+                  initialValue: formData.code,
+                  rules: [{ required: true, message: '请输入前端权限编码!' }] },
+              ]"
+            />
+          </a-form-item>
+          <!-- 后台权限编码 -->
+          <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入后台权限编码"
+              v-decorator="[
+                'formData.permission',
+                {
+                  initialValue: formData.permission,
+                  rules: [{ required: formData.isLeaf, message: '请输入后台权限编码!' }] },
+              ]"
+            />
+          </a-form-item>
+          <!-- 图标 -->
+          <!-- <a-form-item v-if="!formData.type ||formData.type=='0' " label="图标" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入图标名称"
+              v-decorator="['formData.icon', {
+                initialValue: formData.icon,
+                rules: [] }]"
+            />
+          </a-form-item> -->
+          <!-- 前端组件 -->
+          <!-- <a-form-item v-if="!formData.type ||formData.type=='0'" label="前端组件" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入前端组件路径"
+              v-decorator="['formData.componentPath', {
+                initialValue: formData.componentPath,
+                rules: [{ required: true, message: '请输入前端组件路径!' }] }]"
+            />
+          </a-form-item> -->
+
+          <!-- 第三方链接 -->
+          <!-- <a-form-item v-if="!formData.type ||formData.type=='0'" label="第三方链接" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入第三方链接地址"
+              v-decorator="['formData.urlPath', {
+                initialValue: formData.urlPath,
+                rules: [] }]"
+            />
+          </a-form-item> -->
+
+          <!-- 排序值 -->
+          <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input-number
+              style="width: 100%;"
+              placeholder="请输入排序值(0~999999)"
+              v-decorator="['formData.sort', {
+                initialValue: formData.sort,
+                rules: [] }]"
+              :max="999999"
+              :min="0"
+            />
+          </a-form-item>
+          <!-- 连锁可用 -->
+          <a-form-item label="连锁可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-radio-group
+              name="radioGroup"
+              v-decorator="[
+                'formData.chainOrgUse',
+                {
+                  initialValue: formData.chainOrgUse,
+                  rules: [{ required: true, message: '请选择!' }] },
+              ]"
+            >
+              <a-radio :value="1">是</a-radio>
+              <a-radio :value="0">否</a-radio>
+            </a-radio-group>
+          </a-form-item>
+          <!-- 单店可用 -->
+          <a-form-item label="单店可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-radio-group
+              name="radioGroup"
+              v-decorator="[
+                'formData.singleOrgUse',
+                {
+                  initialValue: formData.singleOrgUse,
+                  rules: [{ required: true, message: '请选择!' }] },
+              ]"
+            >
+              <a-radio :value="1">是</a-radio>
+              <a-radio :value="0">否</a-radio>
+            </a-radio-group>
+          </a-form-item>
+          <!-- 状态 -->
+          <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-radio-group
+              name="radioGroup"
+              v-decorator="[
+                'formData.status',
+                {
+                  initialValue: formData.status,
+                  rules: [{ required: true, message: '请选择状态!' }] },
+              ]"
+            >
+              <a-radio :value="1">是</a-radio>
+              <a-radio :value="0">否</a-radio>
+            </a-radio-group>
+          </a-form-item>
+
+          <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
+            <a-button type="primary" @click="handleSubmit()">
+              保存
+            </a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="clear">
+              重置
+            </a-button>
+          </a-form-item>
+        </a-form>
+
+      </a-col>
+    </a-row>
+    <childModal parentType="store" :visible="showChildModal" @refresh="getMdMenuList" :data="parentData" @close="showChildModal = false"></childModal>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import childModal from './childModal.vue'
+import { getMdMenuList, saveMdMenu, deleteMdMenu } from '@/api/menu.js'
+
+export default {
+  name: 'Menu',
+  components: {
+    STable, VSelect, childModal
+  },
+  props: {},
+  data () {
+    return {
+      treeData: [],
+      dataList: [],
+      searchValue: '',
+      expandedKeys: [],
+      autoExpandParent: true,
+      selectedKeys: [],
+      selectedMenu: '', // 选择的树节点名
+      formLayout: 'horizontal',
+      form: this.$form.createForm(this, { name: 'menu' }),
+      showChildModal: false,
+      parentData: {}, // 父级菜单
+      formData: {
+        id: '',
+        name: '',
+        routePath: '',
+        icon: '',
+        routeName: '',
+        componentPath: '',
+        urlPath: '',
+        code: '',
+        permission: '',
+        sort: '',
+        type: '0',
+        isLeaf: true,
+        chainOrgUse: '',
+        singleOrgUse: '',
+        status: '' // 活动状态
+      }
+    }
+  },
+  computed: {
+    getMenus () {
+      this.generateList(this.treeData)
+      return this.treeData
+    }
+  },
+  methods: {
+    onExpand (expandedKeys) {
+      // console.log('onExpand', expandedKeys)
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+
+    onSelect (selectedKeys, info) {
+      console.log('onSelect', info)
+      this.selectedKeys = selectedKeys
+      if (info.selected) {
+        const data = info.selectedNodes[0].data.props
+        const isLeaf = data.dataRef.children
+        // this.formData = Object.assign({}, this.formData, info.selectedNodes[0].data.props)
+        this.formData = {
+          id: data.id,
+          name: data.name,
+          routePath: data.routePath,
+          icon: data.icon,
+          routeName: data.routeName,
+          componentPath: data.componentPath,
+          urlPath: data.urlPath,
+          code: data.code,
+          permission: data.permission,
+          sort: data.sort,
+          type: data.type,
+          chainOrgUse: data.chainOrgUse,
+          singleOrgUse: data.singleOrgUse,
+          status: data.status,
+          isLeaf: !(isLeaf && isLeaf.length)
+        }
+
+        this.selectedMenu = this.formData.name
+        this.formData.status = Number(this.formData.status)
+        this.formData.chainOrgUse = Number(this.formData.chainOrgUse)
+        this.formData.singleOrgUse = Number(this.formData.singleOrgUse)
+      } else {
+        this.selectedMenu = ''
+        this.clear()
+      }
+    },
+    generateList (data) {
+      for (let i = 0; i < data.length; i++) {
+        const node = data[i]
+        const key = node.title
+        this.dataList.push({ key, title: key })
+        node.scopedSlots = { title: 'title' }
+        node.slots = { icon: node.type == '0' ? 'file' : 'pushpin' }
+
+        if (node.children) {
+          this.generateList(node.children)
+        }
+      }
+    },
+    getParentKey (key, tree) {
+      let parentKey
+      for (let i = 0; i < tree.length; i++) {
+        const node = tree[i]
+        if (node.children) {
+          if (node.children.some(item => item.title == key)) {
+            parentKey = node.key
+          } else if (this.getParentKey(key, node.children)) {
+            parentKey = this.getParentKey(key, node.children)
+          }
+        }
+      }
+      return parentKey
+    },
+    onChange (e) {
+      const value = e.target.value
+      const expandedKeys = this.dataList
+        .map(item => {
+          if (item.title.indexOf(value) > -1) {
+            return this.getParentKey(item.title, this.treeData)
+          }
+          return null
+        })
+        .filter((item, i, self) => item && self.indexOf(item) === i)
+      Object.assign(this, {
+        expandedKeys,
+        searchValue: value,
+        autoExpandParent: true
+      })
+    },
+    // 获取菜单树列表
+    getMdMenuList () {
+      getMdMenuList().then(res => {
+        console.log(res, 'res1111111')
+        if (res.status == 200) {
+          this.treeData = res.data
+          console.log(this.treeData, 'this.treeData')
+        }
+      })
+    },
+    // 添加子节点
+    addChild () {
+      if (!this.selectedMenu) {
+        return this.$message.warning('请先选择一个父级菜单')
+      } else if (this.formData.type == '1') {
+        return this.$message.warning('请选择一个页面级菜单')
+      }
+      this.showChildModal = true
+      this.parentData = this.formData
+    },
+    // 添加顶部菜单
+    addTitle () {
+      this.showChildModal = true
+      this.parentData = {}
+    },
+    //  取消选择
+    cancelSel () {
+      this.selectedKeys = []
+      this.selectedMenu = ''
+      this.clear()
+    },
+    // 清空列表
+    clear () {
+      this.form.resetFields()
+      this.formData.id = ''
+      this.formData.name = ''
+      this.formData.routePath = ''
+      this.formData.icon = ''
+      this.formData.routeName = ''
+      this.formData.componentPath = ''
+      this.formData.urlPath = ''
+      this.formData.sort = ''
+      this.formData.type = ''
+	    this.formData.chainOrgUse = ''
+	    this.formData.singleOrgUse = ''
+      this.formData.status = ''
+      this.formData.code = ''
+      this.formData.permission = ''
+      this.formData.isLeaf = true
+    },
+
+    // 删除数据
+    delect () {
+      if (!this.selectedKeys.length) {
+        return this.$message.warning('您还未选择要删除的数据')
+      }
+      const _this = this
+      console.log(_this.formData.id, '_this.formData.id')
+      this.$confirm({
+        title: '警告',
+        content: `确定要删除您选择的 ${_this.formData.name} 的数据吗?`,
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          deleteMdMenu({
+            id: _this.formData.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success('删除成功')
+              _this.getMdMenuList()
+            }
+          }).catch(() => {
+            _this.$message.success('删除失败, 请稍后重试')
+          })
+        }
+      })
+    },
+
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          console.log(values.formData, ' formData.type222222222')
+          saveMdMenu(Object.assign({ id: this.formData.id }, values.formData)).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              _this.getMdMenuList()
+              _this.clear()
+            } else {
+              // this.$message.warning(res.message)
+            }
+          })
+        }
+      })
+    },
+    handleCancel () {
+      this.clear()
+    }
+
+  },
+  mounted () {
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, { name: 'menu' })
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getMdMenuList()
+    })
+  },
+  watch: {
+
+  }
+}
+</script>
+
+<style>
+  .menu-box::-webkit-scrollbar{
+    width: 6px;
+    height: 6px ;
+  }
+
+  .menu-box::-webkit-scrollbar-thumb{
+    width: 6px;
+    height: 6px ;
+    border-radius: 4px;
+    -webkit-box-shadow: inset 0 0 2px #d1d1d1;
+    background: #e4e4e4;
+  }
+
+  .textCount{
+    border: 1px solid #91d5ff;
+    background-color: #e6f7ff;
+    border-radius: 5px;
+    padding: 5px 10px 5px 20px;
+    margin: 10px 0;
+    color: rgba(0, 0, 0);
+  }
+  .imgSize{
+    color: #2d8cf0;
+    margin-left: 10px;
+    font-size: 14px;
+  }
+
+</style>

+ 162 - 0
src/views/bnSetting/menusAuth.vue

@@ -0,0 +1,162 @@
+<template>
+  <div>
+    <a-form class="form-box" style="height: 500px;overflow: auto;margin-bottom: 15px;" :form="form" @submit="handleSubmit">
+      <a-tree
+        checkable
+        @check="onCheck"
+        @expand="onExpand"
+        :autoExpandParent="autoExpandParent"
+        v-model="checkedKeys"
+        :treeData="treeData"
+      />
+    </a-form>
+    <a-form-item :wrapper-col="{ offset: 3 }">
+      <a-button type="primary" @click="handleSubmit()">
+        保存
+      </a-button>
+    </a-form-item>
+  </div>
+</template>
+
+<script>
+import { findLsMenu, saveLsMouldMenu, findDdMenu, saveDdMouldMenu } from '@/api/menuSet'
+export default {
+  name: 'MenusAuth',
+  props: {
+    types: {
+      type: String,
+      default: 'dd'
+    }
+  },
+  data () {
+    return {
+      menuIds: '',
+      treeData: [],
+      expandedKeys: [],
+      autoExpandParent: false,
+      checkedKeys: [],
+      checkedData: [],
+      formLayout: 'horizontal',
+      form: this.$form.createForm(this, { name: 'menuModal' })
+    }
+  },
+  methods: {
+    tabChange (v) {
+      console.log(v)
+    },
+    // 初始化树
+    treeInit (dr) {
+      this.treeData = dr.menuList
+      this.menuIds = dr.mould.menuIds
+      if (this.menuIds) {
+        const arr = this.menuIds.split(',')
+        const temp = []
+        arr.map(item => {
+          temp.push(Number(item))
+        })
+        this.checkedData = temp
+        this.expandedKeys = temp
+        // 找出叶子节点
+        this.findLeaf(this.treeData, temp)
+      }
+    },
+    // 获取连锁树数据
+    getfindLsMenu () {
+      findLsMenu().then(res => {
+        console.log(res, '+++++++++连锁+++++++++')
+        if (res.status == 200) {
+          this.treeInit(res.data)
+        }
+      })
+    },
+    // 获取单店树数据
+    getfindDdMenu () {
+      findDdMenu().then(res => {
+        console.log(res, '+++++++++单店+++++++++')
+        if (res.status == 200) {
+          this.treeInit(res.data)
+        }
+      })
+    },
+    onExpand (expandedKeys) {
+      console.log('onExpand', expandedKeys)
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+    onCheck (checkedKeys, info) {
+      this.checkedData = [...checkedKeys, ...info.halfCheckedKeys]
+      this.checkedKeys = checkedKeys
+    },
+    // 勾选已选的菜单
+    findLeaf (data, arr) {
+      for (let i = 0; i < data.length; i++) {
+        const node = data[i]
+        if (node.children) {
+          this.findLeaf(node.children, arr)
+        } else {
+          const hasNode = arr.find(item => {
+            return item == node.id
+          })
+          if (hasNode) {
+            this.checkedKeys.push(node.id)
+          }
+        }
+      }
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          // console.log(this.checkedData)
+          if (this.checkedData.length == 0) {
+            return this.$message.warning('请先选择菜单')
+          }
+          const arr = this.checkedData.join(',')
+          if (this.types == 'dd') {
+            this.ddSave({ menuIds: arr })
+          } else {
+            this.lsSave({ menuIds: arr })
+          }
+        }
+      })
+    },
+    // 保存单店
+    ddSave (pars) {
+      saveDdMouldMenu(pars).then(res => {
+        console.log(res, 'res--save')
+        if (res.status + '' === '200') {
+          this.$message.success(res.message ? res.message : '保存成功')
+        } else {
+          // this.$message.warning(res.message)
+        }
+      })
+    },
+    // 保存连锁
+    lsSave (pars) {
+      saveLsMouldMenu(pars).then(res => {
+        console.log(res, 'res--save')
+        if (res.status + '' === '200') {
+          this.$message.success(res.message ? res.message : '保存成功')
+        } else {
+          // this.$message.warning(res.message)
+        }
+      })
+    }
+  },
+  mounted () {
+    // 单店
+    if (this.types == 'dd') {
+      this.getfindDdMenu()
+    } else {
+      this.getfindLsMenu()
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, { name: 'menu' })
+  }
+}
+</script>
+
+<style>
+</style>

+ 41 - 0
src/views/bnSetting/menusAuthTab.vue

@@ -0,0 +1,41 @@
+<template>
+  <div class="menusAuth-cons">
+    <a-tabs @change="tabChange" type="card">
+      <a-tab-pane tab="单店菜单设置" key="1">
+        <menusAuth types="dd"></menusAuth>
+      </a-tab-pane>
+      <a-tab-pane tab="连锁店菜单设置" key="2">
+        <menusAuth types="ls"></menusAuth>
+      </a-tab-pane>
+    </a-tabs>
+  </div>
+</template>
+
+<script>
+  import menusAuth from './menusAuth.vue'
+  export default {
+    name: 'menusAuthTab',
+    components: {
+      menusAuth
+    },
+    data() {
+      return {}
+    },
+    methods: {
+      tabChange(v) {
+        console.log(v)
+      },
+    },
+    beforeRouteEnter (to, from, next) {
+      next(vm => {
+      })
+    },
+  }
+</script>
+
+<style>
+  .menusAuth-cons{
+    background: #fff;
+    padding: 10px;
+  }
+</style>

+ 61 - 0
src/views/common/dealerList.vue

@@ -0,0 +1,61 @@
+<template>
+  <!-- 经销商 -->
+  <a-select
+    show-search
+    label-in-value
+    :value="dealerName"
+    placeholder="请输入名称搜索"
+    style="width: 100%"
+    :filter-option="false"
+    :dropdownMatchSelectWidth="false"
+    :not-found-content="fetching ? undefined : null"
+    @search="fetchUser"
+    @change="handleChange"
+    allowClear>
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { dealerListByPage } from '@/api/dealer'
+export default {
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      dealerName: [],
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (dealerName) {
+      console.log('fetching user', dealerName)
+      if (dealerName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      dealerListByPage({ dealerName: dealerName, pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data && res.data.list ? res.data.list : []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      Object.assign(this, {
+        dealerName: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('change', value || { key: undefined, label: '' })
+    },
+    resetForm () {
+      this.dealerName = []
+    }
+  }
+}
+</script>

+ 61 - 0
src/views/common/storeList.vue

@@ -0,0 +1,61 @@
+<template>
+  <!-- 经销商 -->
+  <a-select
+    show-search
+    label-in-value
+    :value="name"
+    placeholder="请输入名称搜索"
+    style="width: 100%"
+    :filter-option="false"
+    :dropdownMatchSelectWidth="false"
+    :not-found-content="fetching ? undefined : null"
+    @search="fetchUser"
+    @change="handleChange"
+    allowClear>
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.tenantId" :value="item.tenantId">{{ item.name }}</a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { storeListByPage } from '@/api/store'
+export default {
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      name: [],
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (name) {
+      console.log('fetching user', name)
+      if (name == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      storeListByPage({ name: name, pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data && res.data.list ? res.data.list : []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      Object.assign(this, {
+        name: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('change', value || { key: undefined, label: '' })
+    },
+    resetForm () {
+      this.name = []
+    }
+  }
+}
+</script>

+ 241 - 0
src/views/numsGoodsShelves/bondManagement/list.vue

@@ -0,0 +1,241 @@
+<template>
+  <a-card size="small" :bordered="false">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="货架名称">
+                <a-input id="userList-name" allowClear v-model.trim="queryParam.name" placeholder="请输入货架名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="配件经销商">
+                <a-input id="userList-phone" allowClear v-model.trim="queryParam.phone" placeholder="请输入手机号码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="汽车修理厂">
+                <a-input id="userList-phone" allowClear v-model.trim="queryParam.phone" placeholder="请输入手机号码"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="状态">
+                  <v-select id="userList-loginFlag" code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" id="userList-search">查询</a-button>
+              <a-button type="" @click="reset" id="userList-reset" style="margin-left: 10px;">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <div class="table-operator">
+        <a-button v-if="$hasPermissions('B_powerMD_user_add')" type="primary" class="button-error" @click="openModal">新增保证金</a-button>
+      </div>
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px', wordBreak: 'break-all' }"
+        size="small"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="phone" slot-scope="text">
+          <a-statistic :precision="2" :value="112893" :valueStyle="{fontSize:'12px'}"/>
+        </template>
+        <template slot="status" slot-scope="text, record">
+          <!-- <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/> -->
+        </template>
+        <template slot="action" slot-scope="text, record">
+          <a-button type="link" @click="handleEdit(record)">编辑</a-button>
+          <a-button type="link" @click="handleDel(record)">删除</a-button>
+          <!-- <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span> -->
+        </template>
+      </s-table>
+    </a-spin>
+    <!--新增/编辑数字货架 -->
+    <!-- <addGoodsShelve :visible="showModal" @refresh="$refs.table.refresh(true)" :nowData="itemData" @close="handleUserCancel"></addGoodsShelve> -->
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+// import addGoodsShelve from './addGoodsShelve.vue'
+import { updateEnableStatus, getPowerUserList } from '@/api/power-user.js'
+export default {
+  name: 'UserList',
+  components: {
+    STable, VSelect
+  },
+  data () {
+    return {
+      spinning: false,
+      advanced: false,
+      tableHeight: 0,
+      // 查询参数
+      queryParam: {
+        name: '',
+        phone: '',
+        loginFlag: undefined
+      },
+      showModal: false,
+      itemData: null, // 编辑行数据
+      openStatusModal: false, // 货架状态弹窗初始状态
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '货架名称', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '配件经销商', dataIndex: 'org.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '汽车修理厂', dataIndex: 'name', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '保证金金额', dataIndex: 'phone', width: '12%', align: 'center', scopedSlots: { customRender: 'phone' } },
+        { title: '状态', dataIndex: 'phone', width: '12%', align: 'center', scopedSlots: { customRender: 'status' } },
+        { title: '创建时间', dataIndex: 'loginName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return getPowerUserList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (let i = 0; i < data.list.length; i++) {
+              const _item = data.list[i]
+              _item.no = no + i + 1
+              _item.loginFlag = _item.loginFlag + '' === '1'
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      optionAlertShow: false,
+      showSyncModal: false //  同步账号编辑弹框
+    }
+  },
+  methods: {
+    // 新增
+    openModal () {
+      this.itemData = null
+      this.showModal = true
+    },
+    // 关闭弹框
+    handleUserCancel () {
+      this.showModal = false
+      this.itemData = null
+    },
+    // 重置
+    reset () {
+      this.queryParam.name = ''
+      this.queryParam.phone = ''
+      this.queryParam.loginFlag = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 编辑
+    handleEdit (row) {
+      this.itemData = row
+      if (row.ownerOrgFlag == 1) { //  自建
+        this.showModal = true
+      } else { //  同步过来的,非自建
+        this.showSyncModal = true
+      }
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        content: '删除后无法恢复,确认删除?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          // delectRolePower({
+          //   id: row.id
+          // }).then(res => {
+          //   if (res.status == 200) {
+          //     _this.$message.success(res.message)
+          //     _this.$refs.table.refresh()
+          //     _this.spinning = false
+          //   } else {
+          //     _this.spinning = false
+          //   }
+          // })
+        }
+      })
+    },
+    // 结算设置
+    handleSettlement (row) {
+      this.$router.push({ name: 'settlementSet', params: { id: row.id } })
+    },
+    // 关闭弹框 同步账号
+    handleCancel () {
+      this.itemData = null
+      this.showSyncModal = false
+    },
+    // 修改状态
+    changeFlagHandle (text, record) {
+      this.openStatusModal = true
+      // const _data = {
+      //   id: record.id,
+      //   flag: record.loginFlag ? '1' : '0'
+      // }
+      // this.spinning = true
+      // updateEnableStatus(_data).then(res => {
+      //   if (res.status == 200) {
+      //     this.$message.success(res.message)
+      //     this.$refs.table.refresh()
+      //     this.spinning = false
+      //   } else {
+      //     this.$refs.table.refresh()
+      //     this.spinning = false
+      //   }
+      // })
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 215
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.reset()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.reset()
+    }
+  }
+}
+</script>
+<style lang="less">
+  .ant-statistic-content-value-decimal{
+    font-size: 12px;
+  }
+</style>

+ 73 - 77
src/views/numsGoodsShelves/goodsShelvesAdministration/addGoodsShelve.vue

@@ -20,61 +20,45 @@
         >
           <a-row :gutter="24">
             <a-col :span="12">
-              <a-form-model-item label="配件经销商" prop="name">
-                <a-select
-                  placeholder="请选择数字货架提供方(输入名称查找)"
-                  id="userSyncEdit-roleNames"
-                  :disabled="nowData?true:false"
-                  allowClear
-                  v-model="form.roleNames"
-                  mode="multiple">
-                  <a-select-option v-for="item in roleList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-                </a-select>
+              <a-form-model-item label="配件经销商" prop="dealerSn">
+                <dealerList ref="dealerList" @change="dealerChange" :itemSn="form.dealerSn"></dealerList>
               </a-form-model-item>
             </a-col>
             <a-col :span="12">
-              <a-form-model-item label="汽车修理厂" prop="phone">
-                <a-select
-                  style="background-color: none;"
-                  placeholder="请选择数字货架提供方(输入名称查找)"
-                  id="userSyncEdit-roleNames"
-                  :disabled="nowData?true:false"
-                  allowClear
-                  v-model="form.roleNames"
-                  mode="multiple">
-                  <a-select-option v-for="item in roleList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-                </a-select>
+              <a-form-model-item label="汽车修理厂" prop="storeSn">
+                <storeList ref="storeList" @change="storeChange" :itemSn="form.storeSn"></storeList>
               </a-form-model-item>
             </a-col>
           </a-row>
           <a-row :gutter="20">
             <a-col :span="24">
-              <a-form-model-item label="货架名称" prop="loginName" :label-col="{span: 3}" :wrapper-col="{span: 20}">
-                <a-input id="userEdit-loginName" v-model.trim="form.loginName":maxLength="50" allowClear placeholder="请输入货架名称(最多30个字符)"/>
+              <a-form-model-item label="货架名称" prop="shelfName" :label-col="{span: 3}" :wrapper-col="{span: 20}">
+                <a-input id="userEdit-shelfName" v-model.trim="form.shelfName" :maxLength="30" allowClear placeholder="请输入货架名称(最多30个字符)"/>
               </a-form-model-item>
             </a-col>
           </a-row>
           <a-row :gutter="24">
             <!-- 状态 -->
             <a-col :span="12">
-              <a-form-model-item label="货架归属" prop="loginFlag">
-                <a-radio-group name="radioGroup" v-model="form.loginFlag" @change="changeRadio">
-                  <a-radio :value="1">配件经销商</a-radio>
-                  <a-radio :value="0">汽车修理厂</a-radio>
+              <a-form-model-item label="货架归属" prop="ownerType">
+                <a-radio-group name="radioGroup" v-model="form.ownerType" @change="changeRadio">
+                  <a-radio :value="1">平台</a-radio>
+                  <a-radio :value="0">自有</a-radio>
                 </a-radio-group>
               </a-form-model-item>
             </a-col>
           </a-row>
-          <a-row :gutter="24" v-if="form.loginFlag===0">
+          <a-row :gutter="24" v-if="form.ownerType===0">
             <a-col :span="24">
-              <a-form-model-item label="产品图片" help="说明:最多5张。" :label-col="{span:3}" :wrapper-col="{span:20}">
+              <a-form-model-item label="产品图片" help="说明:请上传清晰、完整的图片,支持jpg/jpeg/png格式,不超过500KB(最多5张)。" :label-col="{span:3}" :wrapper-col="{span:20}">
                 <Upload
                   class="upload"
                   id="productInfoEdit-productMsg"
-                  v-model="form.productMsg"
+                  v-model="form.images"
                   ref="productMsg"
                   @change="changeImage"
                   :maxNums="5"
+                  :beforeUpload="beforeUpload"
                   listType="picture-card" ></Upload>
               </a-form-model-item>
             </a-col>
@@ -98,12 +82,12 @@
 
 <script>
 import { STable, VSelect, Upload } from '@/components'
-import { getRoleList, saveUserPower } from '@/api/power-user.js'
+import { saveShelf, shelfDetail } from '@/api/shelf.js'
+import dealerList from '@/views/common/dealerList.vue'
+import storeList from '@/views/common/storeList.vue'
 export default {
   name: 'UserModal',
-  components: {
-    STable, VSelect, Upload
-  },
+  components: { STable, VSelect, Upload, dealerList, storeList },
   props: {
     visible: {
       type: Boolean,
@@ -116,33 +100,32 @@ export default {
       }
     }
   },
+
   data () {
     return {
       spinning: false,
       titleText: '新增数字货架',
       isshow: this.visible,
       roleList: [],
+      pageInfo: null,
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+
       form: {
-        name: '',
-        phone: '',
-        loginName: '',
-        sex: undefined,
-        loginFlag: '', // 状态
-        roleNames: undefined, // 角色
-        productMsg: '', // 图片
-        remarks: ''
+        dealerSn: undefined, // 经销商sn
+        ownerType: '1', // 平台
+        storeSn: undefined, // 汽车修理厂sn
+        shelfName: '', // 货架名称
+        images: '', // 图片
+        remarks: ''// 备注
       },
       rules: {
-        name: [ { required: true, message: '请输入用户名称', trigger: 'blur' }, { pattern: '^[^<|>]{1,30}$', message: '请输入不含<或>的字符,最多30个字符' } ],
-        phone: [ { required: true, message: '请输入手机号码', trigger: 'blur' }, { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' } ],
-        loginName: [ { required: true, message: '请输入用户账号', trigger: 'blur' }, { pattern: /^[0-9A-Za-z]+$/, message: '用户账号为数字或大小写字母组成!' } ],
-        sex: [ { required: true, message: '请选择性别', trigger: 'change' } ],
-        loginFlag: [ { required: true, message: '请选择状态', trigger: 'change' } ],
-        roleNames: [ { required: true, message: '请选择角色', trigger: 'change' } ]
+        shelfName: [ { required: true, message: '请输入用户名称', trigger: 'blur' }, { pattern: '^[^<|>]{1,30}$', message: '请输入不含<或>的字符,最多30个字符' } ],
+        dealerSn: [ { required: true, message: '请选择配件经销商', trigger: 'change' } ],
+        ownerType: [ { required: true, message: '请选择货架归属', trigger: 'change' } ],
+        storeSn: [ { required: true, message: '请选择汽车修理厂', trigger: 'change' } ]
       }
     }
   },
@@ -155,26 +138,52 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.name = str
     },
+    // 经销商 change
+    dealerChange (obj) {
+      this.form.dealerSn = obj.key || undefined
+    },
+    // 汽车修理厂 change
+    storeChange (obj) {
+      this.form.storeSn = obj.key || undefined
+    },
     // 产品图片上传
     changeImage (file) {
       this.form.productMsg = file
     },
     // 改变货架归属
     changeRadio (e) {
-      this.form.loginFlag = e.target.value
+      this.form.ownerType = e.target.value
       console.log(e.target.value, '=========')
     },
+    // 查询货架详情
+    getShelfDetail () {
+      this.spinning = true
+      shelfDetail({ shelfSn: this.nowData.shelfSn }).then(res => {
+        if (res.status == 200) {
+          this.form = Object.assign({}, res.data)
+          this.form.ownerType = Number(this.form.ownerType)
+        } else {
+          this.form = {
+            dealerSn: undefined, // 经销商sn
+            ownerType: 1, // 平台
+            storeSn: undefined, // 汽车修理厂sn
+            shelfName: '', // 货架名称
+            images: '', // 图片
+            remarks: ''// 备注
+          }
+        }
+        this.spinning = false
+      })
+    },
     // 保存提交
     handleSubmit () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = JSON.parse(JSON.stringify(_this.form))
-          params.roleNames = _this.form.roleNames.join(',')
           params.id = _this.nowData && _this.nowData.id ? _this.nowData.id : null
-          params.ownerOrgFlag = _this.nowData && _this.nowData.ownerOrgFlag
           _this.spinning = true
-          saveUserPower(params).then(res => {
+          saveShelf(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('refresh')
@@ -191,16 +200,6 @@ export default {
           return false
         }
       })
-    },
-    // 获取角色列表接口
-    getRoleList () {
-      getRoleList().then(res => {
-        if (res.status == 200) {
-          this.roleList = res.data
-        } else {
-          this.$message.warning(res.message)
-        }
-      })
     }
   },
   watch: {
@@ -211,16 +210,15 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
-        this.form.name = ''
-        this.form.phone = ''
-        this.form.loginName = ''
-        this.form.sex = undefined
-        this.form.loginFlag = ''
-        this.form.roleNames = undefined
-        this.form.remarks = ''
-        this.titleText = '新增用户'
-      } else {
-        this.getRoleList()
+        this.form = {
+          dealerSn: undefined, // 经销商sn
+          ownerType: 1, // 平台
+          storeSn: undefined, // 汽车修理厂sn
+          shelfName: '', // 货架名称
+          images: '', // 图片
+          remarks: ''// 备注
+        }
+        this.titleText = '新增数字货架'
       }
     },
     nowData: {
@@ -228,11 +226,9 @@ export default {
         if (this.isshow && newValue) {
           if (this.nowData.id) { //  编辑
             this.titleText = '编辑数字货架'
-            this.form = Object.assign({}, this.nowData)
-            if (this.nowData.roleIds) {
-              this.form.roleNames = this.nowData.roleIds.split(',')
-            }
-            this.form.loginFlag = Number(this.nowData.loginFlag)
+            this.getShelfDetail()
+          } else {
+            this.titleText = '新增数字货架'
           }
         }
       },

+ 159 - 0
src/views/numsGoodsShelves/goodsShelvesAdministration/addHWModal.vue

@@ -0,0 +1,159 @@
+<template>
+  <div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-modal
+        centered
+        wrapClassName="addGoodsShelve-modal"
+        :footer="null"
+        :maskClosable="false"
+        :title="titleText"
+        v-model="isshow"
+        @cancle="isshow=false"
+        :width="500">
+        <a-form-model
+          id="userEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+        >
+          <a-row :gutter="20">
+            <a-col :span="24">
+              <a-form-model-item label="货架名称" prop="shelfName" :label-col="{span: 5}" :wrapper-col="{span: 18}">
+                <a-input id="userEdit-shelfName" v-model.trim="form.shelfName" :maxLength="30" allowClear placeholder="请输入货架名称(最多30个字符)"/>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
+            <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '8px' }">保存</a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="isshow=false">取消</a-button>
+          </a-form-model-item>
+        </a-form-model>
+      </a-modal>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { saveShelf, shelfDetail } from '@/api/shelf.js'
+export default {
+  name: 'UserModal',
+  props: {
+    openHWModal: {
+      type: Boolean,
+      default: false
+    },
+    nowData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+
+  data () {
+    return {
+      spinning: false,
+      titleText: '新增货位',
+      isshow: this.openHWModal,
+      roleList: [],
+      pageInfo: null,
+      form: {
+        shelfName: '' // 货架名称
+      },
+      rules: {
+        shelfName: [ { required: true, message: '请输入用户名称', trigger: 'blur' }, { pattern: '^[^<|>]{1,30}$', message: '请输入不含<或>的字符,最多30个字符' } ]
+      }
+    }
+  },
+  methods: {
+    // 过滤空格
+    filterEmpty () {
+      let str = this.form.name
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.name = str
+    },
+    // 查询货架详情
+    getShelfDetail () {
+      this.spinning = true
+      shelfDetail({ shelfSn: this.nowData.shelfSn }).then(res => {
+        if (res.status == 200) {
+          this.form = Object.assign({}, res.data)
+          this.form.ownerType = Number(this.form.ownerType)
+        } else {
+          this.form = {
+            shelfName: '' // 货架名称
+          }
+        }
+        this.spinning = false
+      })
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = JSON.parse(JSON.stringify(_this.form))
+          params.id = _this.nowData && _this.nowData.id ? _this.nowData.id : null
+          _this.spinning = true
+          saveShelf(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('refresh')
+              setTimeout(function () {
+                _this.isshow = false
+                _this.spinning = false
+              }, 300)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    openHWModal (newValue, oldValue) {
+      console.log(newValue, 'newValue')
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+        this.form = {
+          shelfName: '' // 货架名称
+        }
+        this.titleText = '新增货位'
+      }
+    },
+    nowData: {
+      handler (newValue, oldValue) {
+        if (this.isshow && newValue) {
+          if (this.nowData.id) { //  编辑
+            this.titleText = '编辑货位'
+            this.getShelfDetail()
+          } else {
+            this.titleText = '新增货位'
+            this.form = {
+              shelfName: '' // 货架名称
+            }
+          }
+        }
+      },
+      deep: true
+    }
+  }
+}
+</script>
+<style lang="less">
+.addGoodsShelve-modal{
+  .ant-select-disabled .ant-select-selection{
+    background-color: none !important;
+  }
+}
+</style>

+ 108 - 0
src/views/numsGoodsShelves/goodsShelvesAdministration/changeStatusModal.vue

@@ -0,0 +1,108 @@
+<template>
+  <div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-modal
+        centered
+        wrapClassName="addGoodsShelve-modal"
+        :footer="null"
+        :maskClosable="false"
+        :title="titleText"
+        v-model="isshow"
+        @cancle="isshow=false"
+        :width="600">
+        <div style="text-align: center;">
+          <h3 style="padding: 15px 0; font-weight: bold;">{{ nowData.shelfName }}</h3>
+          <div style="padding-bottom: 15px">
+            <p>此数字货架当前状态为<span style="display:inline-block;padding:0 3px">"{{ nowData.state }}"</span>,确定流转到下一个状态<span style="display:inline-block;padding:0 3px;color:red">"{{ nextState }}"</span>吗?</p>
+            <p v-if="nowData.state=='已启用'">暂停后汽车修理厂无法再使用数字货架</p>
+            <p v-if="nowData.state=='已暂停'">关闭后,该数字货架的所有数据都不可见</p>
+            <p>状态流转后无法再回退,请谨慎操作!</p>
+          </div>
+          <div>
+            <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '8px' }">保存</a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="isshow=false">取消</a-button>
+          </div>
+        </div>
+      </a-modal>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { updateEnableStatus } from '@/api/shelf.js'
+export default {
+  name: 'UserModal',
+  props: {
+    openStatusModal: {
+      type: Boolean,
+      default: false
+    },
+    nowData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      titleText: '更改数字货架状态',
+      isshow: this.openStatusModal,
+      nextState: ''
+    }
+  },
+  methods: {
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      _this.spinning = true
+      updateEnableStatus({ shelfSn: this.nowData.shelfSn, state: this.nextState }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$emit('refresh')
+          setTimeout(function () {
+            _this.isshow = false
+            _this.spinning = false
+          }, 300)
+        } else {
+          _this.spinning = false
+        }
+      })
+    }
+  },
+  watch: {
+    openStatusModal (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    },
+    nowData: {
+      handler (newValue, oldValue) {
+        if (this.isshow && newValue) {
+          if (this.nowData.id) { //  编辑
+            if (this.nowData.state == '未启用') {
+              this.nextState = '已启用'
+            } else if (this.nowData.state == '已启用') {
+              this.nextState = '已暂停'
+            } else {
+              this.nextState = '已关闭'
+            }
+          }
+        }
+      },
+      deep: true
+    }
+  }
+}
+</script>
+<style lang="less">
+.addGoodsShelve-modal{
+  .ant-select-disabled .ant-select-selection{
+    background-color: none !important;
+  }
+}
+</style>

+ 188 - 0
src/views/numsGoodsShelves/goodsShelvesAdministration/chooseImportModal.vue

@@ -0,0 +1,188 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <p class="red">注意:成功导入后,现有的货位将会被全部删除,即覆盖导入的方式,您所看到的货位就是可导入的数据,请谨慎操作</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <!-- <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button> -->
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+// import { hdExportExcel } from '@/libs/exportExcel'
+// import { sparePartsDetailParseProducts, sparePartsDetailFailExcel } from '@/api/spareParts'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '货位号', dataIndex: 'productCode', width: '90%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      loadData: [],
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '货位号', dataIndex: 'productCode', width: '40%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '错误原因', dataIndex: 'productName', width: '50%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      const params = {
+        sparePartsSn: this.paramsData.sparePartsSn,
+        path: this.paramsData.path
+      }
+      // sparePartsDetailParseProducts(params).then(res => {
+      //   this.loading = false
+      //   if (res.status == 200) {
+      //     if (res.data.okList && res.data.okList.length > 0) {
+      //       res.data.okList.map((item, index) => {
+      //         item.no = index + 1
+      //       })
+      //     }
+      //     if (res.data.failList && res.data.failList.length > 0) {
+      //       res.data.failList.map((item, index) => {
+      //         item.no = index + 1
+      //       })
+      //     }
+      //     _this.loadData = res.data.okList || []
+      //     _this.unLoadData = res.data.failList || []
+      //   }
+      // })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        this.$emit('ok', this.loadData)
+        this.isShow = false
+      }
+    },
+    // 导出
+    handleError () {
+      // const _this = this
+      // if (_this.unLoadData.length < 1) {
+      //   _this.$message.info('暂无可导出错误项~')
+      //   return
+      // }
+      // _this.spinning = true
+      // const params = {
+      //   list: _this.unLoadData
+      // }
+      // hdExportExcel(sparePartsDetailFailExcel, params, '产品导入错误项', function () {
+      //   _this.spinning = false
+      // })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 122 - 36
src/views/numsGoodsShelves/goodsShelvesAdministration/goodsAllocationSet.vue

@@ -3,23 +3,28 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="goodsAllocationSet-baseInfo">
         <template slot="subTitle">
-          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+          <a href="javascript:;" @click="handleBack">
+            <a-icon type="left"></a-icon> 返回列表
+          </a>
+          <span style="margin: 0 15px;color: #666;font-weight: bold;">货架名称:{{ pageInfo.shelfName||'--' }}</span>
         </template>
       </a-page-header>
       <a-card :bordered="false" size="small" class="goodsAllocationSet-baseInfo">
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="基础信息">
             <a-descriptions size="small" :column="3">
-              <a-descriptions-item label="货架名称">{{ }}</a-descriptions-item>
-              <a-descriptions-item label="配件经销商">{{ }}</a-descriptions-item>
-              <a-descriptions-item label="汽车修理厂">{{ }}</a-descriptions-item>
+              <a-descriptions-item label="配件经销商">{{ pageInfo.dealerSn||'--' }}</a-descriptions-item>
+              <a-descriptions-item label="汽车修理厂">{{ pageInfo.storeSn||'--' }}</a-descriptions-item>
+              <a-descriptions-item label="货架归属">{{ pageInfo.ownerType==1?'自有':'平台' }}</a-descriptions-item>
+              <a-descriptions-item label="货架图片">{{ pageInfo.dealerSn||'--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ pageInfo.remarks||'--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
       </a-card>
       <a-card :bordered="false" size="small" class="pages-wrap">
         <div class="goodsAllocationSet-baseInfo">
-          <a-button @click="handleExport" type="primary">导入货位</a-button>
+          <a-button @click="pageInfo.state=='未启用'? addHW(0):addHW(1)" type="primary">{{ pageInfo.state=='未启用'? '批量导入货位':'新增' }}</a-button>
         </div>
         <s-table
           class="sTable fixPagination"
@@ -31,53 +36,96 @@
           :data="loadData"
           :defaultLoadData="false"
           bordered>
-          <template slot="name" slot-scope="text, record">
-            <a-input allowClear placeholder="请输入货位号" v-if="isEdit" style="width: 80%;"/>
-            <span v-if="!isEdit">{{ record.name }}</span>
+          <template slot="no" ,slot-scope="text, record,index">
+            <span>{{ index+1 }}</span>
           </template>
           <template slot="status" slot-scope="text, record">
-            <a-button type="link" @click="handleEdit(record)" v-if="!isEdit">编辑</a-button>
-            <a-button type="link" @click="handleSave(record,0)" v-if="isEdit">保存</a-button>
-            <a-button type="link" @click="handleSave(record,1)" v-if="isEdit">取消</a-button>
-          <!-- <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span> -->
+            <a-button type="link" @click="handleEdit(record)">编辑</a-button>
+            <!-- <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span> -->
           </template>
         </s-table>
       </a-card>
-
+      <!-- 导入货位模板 -->
+      <importHuoweiModal :openModal="openModal" @close="openModal=false" @refresh="$refs.table.refresh(true)"></importHuoweiModal>
+      <!-- 新增货位 -->
+      <addHWModal :openHWModal="openHWModal" @refresh="$refs.table.refresh(true)" :nowData="itemData" @close="openHWModal=false"></addHWModal>
     </a-spin>
   </div>
 </template>
 
 <script>
-import { STable } from '@/components'
-import { getPowerUserList } from '@/api/power-user.js'
+import {
+  STable
+} from '@/components'
+import { shelfDetail, shelfHWList } from '@/api/shelf.js'
+import importHuoweiModal from './importHuoweiModal.vue'
+import addHWModal from './addHWModal.vue'
 export default {
-  components: { STable },
+  components: {
+    STable, importHuoweiModal, addHWModal },
   data () {
     return {
       spinning: false,
-      isEdit: false, // 货位号是否为编辑
+      openModal: false, // 货位模板弹窗初始状态(批量导入)
+      openHWModal: false, // 新增货位初始弹窗
+      pageInfo: null,
+      itemData: null,
       // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '货位号', dataIndex: 'name', width: '11%', align: 'center', scopedSlots: { customRender: 'name' } },
-        { title: '创建时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '最后修改时间', dataIndex: '', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', width: '9%', align: 'center', scopedSlots: { customRender: 'status' } }
+      columns: [{
+        title: '序号',
+        width: '4%',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'no'
+        }
+      },
+      {
+        title: '货位号',
+        dataIndex: 'shelfPlaceCode',
+        width: '11%',
+        align: 'center',
+        customRender: function (text) {
+          return text || '--'
+        }
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: '13%',
+        align: 'center',
+        customRender: function (text) {
+          return text || '--'
+        }
+      },
+      {
+        title: '最后修改时间',
+        dataIndex: 'updateDate',
+        width: '18%',
+        align: 'center',
+        customRender: function (text) {
+          return text || '--'
+        },
+        ellipsis: true
+      },
+      {
+        title: '操作',
+        width: '9%',
+        align: 'left',
+        scopedSlots: {
+          customRender: 'status'
+        }
+      }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
-        return getPowerUserList(Object.assign(parameter)).then(res => {
+        return shelfHWList(Object.assign({
+          shelfSn: this.$route.params.shelfSn
+        })).then(res => {
+          console.log(res)
           let data
           if (res.status == 200) {
             data = res.data
-            const no = (data.pageNo - 1) * data.pageSize
-            for (let i = 0; i < data.list.length; i++) {
-              const _item = data.list[i]
-              _item.no = no + i + 1
-              _item.loginFlag = _item.loginFlag + '' === '1'
-            }
           }
           this.spinning = false
           return data
@@ -85,18 +133,37 @@ export default {
       }
     }
   },
-  mounted () {
-    this.$refs.table.refresh()
-  },
   methods: {
     handleBack () {
       this.$router.go(-1)
     },
+    addHW (type) {
+      console.log(type, '=========val')
+      if (type == 0) {
+        this.openModal = true
+      } else {
+        this.openHWModal = true
+      }
+    },
     handleExport () {
       console.log('=========导入货位')
     },
     handleEdit (row) {
-      this.isEdit = true
+      this.itemData = row
+      this.openHWModal = true
+    },
+    getShelfDetail () {
+      this.spinning = true
+      shelfDetail({
+        shelfSn: this.$route.params.shelfSn
+      }).then(res => {
+        if (res.status == 200) {
+          this.pageInfo = Object.assign({}, res.data)
+        } else {
+          this.pageInfo = null
+        }
+        this.spinning = false
+      })
     },
     handleSave (row, type) {
       if (type == 0) {
@@ -108,18 +175,37 @@ export default {
         this.isEdit = false
         this.$refs.table.refresh()
       })
+    },
+    pageInit () {
+      this.getShelfDetail()
+      this.$refs.table.refresh()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
     }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
   }
 }
 </script>
 
 <style lang="less">
-  .goodsAllocationSet-page{
+  .goodsAllocationSet-page {
     position: relative;
     height: 100%;
     padding-bottom: 51px;
     box-sizing: border-box;
-    .goodsAllocationSet-baseInfo{
+
+    .goodsAllocationSet-baseInfo {
       margin-bottom: 10px;
     }
   }

+ 207 - 0
src/views/numsGoodsShelves/goodsShelvesAdministration/importHuoweiModal.vue

@@ -0,0 +1,207 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="批量导入货位"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="750">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>下载导入模板
+            <p>请按照下载的Excel模板填写数据</p>
+            <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          </div>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入数据
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“货位号”的列,且名称必须相同</li>
+            <li>2) 除了“货位号”一列,其他列可自定义,不影响数据导入</li>
+            <li>3) 注意:使用此功能时,现有的货位将会被全部删除,即覆盖导入的方式,请谨慎操作</li>
+          </ul>
+
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+// import { hdExportExcel } from '@/libs/exportExcel'
+// import { sparePartsDetailDownload } from '@/api/spareParts'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+    // params: {
+    //   type: Object,
+    //   default: null
+    // }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      }
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      this.openImportModal = true
+      // if (this.paramsData) {
+      //   this.openImportModal = true
+      // } else {
+      //   this.$message.warning('添加文件后再进行下一步操作!')
+      // }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          sparePartsSn: this.params.sparePartsSn || '',
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    },
+    //  导出
+    handleExport () {
+      // const _this = this
+      // const params = { grabFlag: this.params.grabFlag }
+      // this.exportLoading = true
+      // this.spinning = true
+      // hdExportExcel(sparePartsDetailDownload, params, '散件入库导入模板', function () {
+      //   _this.exportLoading = false
+      //   _this.spinning = false
+      // })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 91 - 79
src/views/numsGoodsShelves/goodsShelvesAdministration/list.vue

@@ -6,23 +6,28 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="货架名称">
-                <a-input id="userList-name" allowClear v-model.trim="queryParam.name" placeholder="请输入货架名称"/>
+                <a-input id="userList-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入货架名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="配件经销商">
-                <a-input id="userList-phone" allowClear v-model.trim="queryParam.phone" placeholder="请输入手机号码"/>
+                <dealerList ref="dealerList" @change="dealerChange" :itemSn="queryParam.dealerSn"></dealerList>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="汽车修理厂">
-                <a-input id="userList-phone" allowClear v-model.trim="queryParam.phone" placeholder="请输入手机号码"/>
+                <storeList ref="storeList" @change="storeChange" :itemSn="queryParam.storeSn"></storeList>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="状态">
-                  <v-select id="userList-loginFlag" code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
+                <a-form-item label="货架状态">
+                  <v-select id="userList-loginFlag" code=" SHELF_STATE" v-model="queryParam.shelfState" allowClear placeholder="请选择状态"></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="结算状态">
+                  <v-select id="userList-loginFlag" code="SETTLE_TYPE" v-model="queryParam.settleType" allowClear placeholder="请选择状态"></v-select>
                 </a-form-item>
               </a-col>
             </template>
@@ -38,7 +43,7 @@
         </a-form>
       </div>
       <div class="table-operator">
-        <a-button v-if="$hasPermissions('B_powerMD_user_add')" type="primary" class="button-error" @click="openModal">新增数字货架</a-button>
+        <a-button v-if="$hasPermissions('B_powerMD_user_add')" type="primary" class="button-error" @click="handleEdit()">新增数字货架</a-button>
       </div>
       <s-table
         class="sTable fixPagination"
@@ -51,30 +56,34 @@
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
-        <span slot="status" slot-scope="text, record">
-          <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
-        </span>
-        <span slot="action" slot-scope="text, record">
-          <a-button type="link" @click="handleEdit(record)">编辑</a-button>
-          <a-button type="link" @click="handleSet(record)">货位设置</a-button>
+        <template slot="state" slot-scope="text, record">
+          <div @click="changeFlagHandle(record)" style="cursor:pointer;">{{ record.state }}<a-icon v-if="record.state!='已关闭'" type="edit" title="编辑" :style="{color:' #1890FF',paddingLeft: '5px'}"/></div>
+        </template>
+        <template slot="action" slot-scope="text, record">
+          <a-button type="link" class="button-info" @click="handleEdit(record)">编辑</a-button>
+          <a-button type="link" class="button-info" @click="handleSet(record)">货位设置</a-button>
+          <a-button type="link" class="button-info" @click="handleSettlement(record)">结算设置</a-button>
           <!-- <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span> -->
-        </span>
+        </template>
       </s-table>
     </a-spin>
-    <!-- 自建账号  新增/编辑 -->
+    <!--新增/编辑数字货架 -->
     <addGoodsShelve :visible="showModal" @refresh="$refs.table.refresh(true)" :nowData="itemData" @close="handleUserCancel"></addGoodsShelve>
+    <!-- 货架状态更改 -->
+    <changeStatusModal :openStatusModal="openStatusModal" :nowData="itemData" @refresh="$refs.table.refresh()" @close="openStatusModal=false"></changeStatusModal>
   </a-card>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
 import addGoodsShelve from './addGoodsShelve.vue'
-import { resetPSD, updateEnableStatus, getPowerUserList, delectUserPower } from '@/api/power-user.js'
+import changeStatusModal from './changeStatusModal.vue'
+import { getShelfList } from '@/api/shelf.js'
+import dealerList from '@/views/common/dealerList.vue'
+import storeList from '@/views/common/storeList.vue'
 export default {
   name: 'UserList',
-  components: {
-    STable, VSelect, addGoodsShelve
-  },
+  components: { STable, VSelect, addGoodsShelve, changeStatusModal, storeList, dealerList },
   data () {
     return {
       spinning: false,
@@ -82,27 +91,32 @@ export default {
       tableHeight: 0,
       // 查询参数
       queryParam: {
-        name: '',
-        phone: '',
-        loginFlag: undefined
+        dealerSn: undefined, // 配件经销商sn
+        shelfName: '', // 货架名称
+        shelfState: '', // 货架状态
+        settleType: '', // 结算状态
+        storeSn: undefined, // 汽车修理厂
+        state: undefined// 货架状态
       },
       showModal: false,
       itemData: null, // 编辑行数据
+      openStatusModal: false, // 货架状态弹窗初始状态
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '货架名称', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '配件经销商', dataIndex: 'org.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '汽车修理厂', dataIndex: 'name', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '货位数量', dataIndex: 'phone', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'loginName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', width: '9%', align: 'center', scopedSlots: { customRender: 'status' } },
-        { title: '操作', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '货架名称', dataIndex: 'shelfName', width: '17%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '配件经销商', dataIndex: 'org.name', width: '17%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '汽车修理厂', dataIndex: 'name', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '货位数量', dataIndex: 'shelfPlaceNum', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '结算方式', dataIndex: 'phone', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: <div>货架状态&nbsp;<a-tooltip placement='top' title='货架状态'><a-icon type="question-circle" /></a-tooltip></div>, dataIndex: 'state', width: '7%', align: 'center', scopedSlots: { customRender: 'state' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', width: '15%', align: 'left', scopedSlots: { customRender: 'action' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
-        return getPowerUserList(Object.assign(parameter, this.queryParam)).then(res => {
+        return getShelfList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -110,7 +124,7 @@ export default {
             for (let i = 0; i < data.list.length; i++) {
               const _item = data.list[i]
               _item.no = no + i + 1
-              _item.loginFlag = _item.loginFlag + '' === '1'
+              // _item.loginFlag = _item.loginFlag + '' === '1'
             }
           }
           this.spinning = false
@@ -122,6 +136,14 @@ export default {
     }
   },
   methods: {
+    // 经销商 change
+    dealerChange (obj) {
+      this.queryParam.dealerSn = obj.key || undefined
+    },
+    // 汽车修理厂 change
+    storeChange (obj) {
+      this.queryParam.storeSn = obj.key || undefined
+    },
     // 新增
     openModal () {
       this.itemData = null
@@ -134,46 +156,30 @@ export default {
     },
     // 重置
     reset () {
-      this.queryParam.name = ''
-      this.queryParam.phone = ''
-      this.queryParam.loginFlag = undefined
+      this.queryParam = {
+        dealerSn: undefined, // 配件经销商sn
+        shelfName: '', // 货架名称
+        shelfState: '', // 货架状态
+        settleType: '', // 结算状态
+        storeSn: undefined, // 汽车修理厂
+        state: undefined// 货架状态
+      }
       this.$refs.table.refresh(true)
     },
-    // 重置密码
-    resetPassword (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认重置密码吗?',
-        centered: true,
-        onOk () {
-          _this.spinning = true
-          resetPSD({
-            id: row.id
-          }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
-        }
-      })
-    },
+    // 编辑
     handleEdit (row) {
-      this.itemData = row
-      if (row.ownerOrgFlag == 1) { //  自建
-        this.showModal = true
-      } else { //  同步过来的,非自建
-        this.showSyncModal = true
+      this.showModal = true
+      if (row) { //  编辑
+        this.itemData = row
       }
     },
     // 货位设置
     handleSet (row) {
-      this.$router.push({ name: 'goodsAllocationSet', params: { id: row.id } })
-      // this.$router.push({ path: `/numsGoodsShelves/goodsShelvesAdministration/goodsAllocationSet/set/${row.id}` })
+      this.$router.push({ name: 'goodsAllocationSet', params: { shelfSn: row.shelfSn } })
+    },
+    // 结算设置
+    handleSettlement (row) {
+      this.$router.push({ name: 'settlementSet', params: { shelfSn: row.shelfSn } })
     },
     // 关闭弹框 同步账号
     handleCancel () {
@@ -181,22 +187,28 @@ export default {
       this.showSyncModal = false
     },
     // 修改状态
-    changeFlagHandle (text, record) {
-      const _data = {
-        id: record.id,
-        flag: record.loginFlag ? '1' : '0'
+    changeFlagHandle (row) {
+      console.log(row, '------------状态')
+      this.itemData = row
+      if (row.state != '已关闭') {
+        this.openStatusModal = true
       }
-      this.spinning = true
-      updateEnableStatus(_data).then(res => {
-        if (res.status == 200) {
-          this.$message.success(res.message)
-          this.$refs.table.refresh()
-          this.spinning = false
-        } else {
-          this.$refs.table.refresh()
-          this.spinning = false
-        }
-      })
+
+      // const _data = {
+      //   id: record.id,
+      //   flag: record.loginFlag ? '1' : '0'
+      // }
+      // this.spinning = true
+      // updateEnableStatus(_data).then(res => {
+      //   if (res.status == 200) {
+      //     this.$message.success(res.message)
+      //     this.$refs.table.refresh()
+      //     this.spinning = false
+      //   } else {
+      //     this.$refs.table.refresh()
+      //     this.spinning = false
+      //   }
+      // })
     },
     pageInit () {
       const _this = this

+ 253 - 0
src/views/numsGoodsShelves/goodsShelvesAdministration/settlementModifyModal.vue

@@ -0,0 +1,253 @@
+<template>
+  <div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-modal
+        centered
+        wrapClassName="addGoodsShelve-modal"
+        :footer="null"
+        :maskClosable="false"
+        :title="titleText"
+        v-model="isshow"
+        @cancle="isshow=false"
+        :width="800">
+        <a-form-model
+          id="userEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-model-item label="当前结算方式">
+                {{ settlementType=='1'?'授信结算':'按月结算' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item label="结算方式" prop="name">
+                <a-select
+                  style="background-color: none;"
+                  placeholder="请选择结算方式"
+                  id="isEnable"
+                  allowClear
+                  v-model="form.isEnable"
+                >
+                  <a-select-option v-for="item in settlementTypeList" :key="item.code" :value="item.code" :disabled="settlementType==item.code?true:false">{{ item.name }}</a-select-option>
+                </a-select>
+                <!-- <v-select
+                  code="ENABLE_FLAG"
+                  v-model="form.isEnable"
+                  allowClear
+                  placeholder="请选择结算方式"
+                  @change="changeJStype"
+                ></v-select> -->
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item label="授信额度" prop="name" v-if="form.isEnable==1">
+                <a-input
+                  id="userEdit-loginName"
+                  v-model.trim="form.name"
+                  allowClear
+                  placeholder="请输入授信额度"
+                  suffix="元"/>
+              </a-form-model-item>
+              <a-form-model-item label="结算日期" prop="phone" v-if="form.isEnable==0">
+                <a-select
+                  style="background-color: none;"
+                  placeholder="请选择结算日期"
+                  id="userSyncEdit-roleNames"
+                  allowClear
+                  v-model="form.roleNames"
+                >
+                  <a-select-option v-for="item in dateList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item label="结算提醒金额" prop="loginName" v-if="form.isEnable==1">
+                <a-input
+                  id="userEdit-loginName"
+                  v-model.trim="form.loginName"
+                  allowClear
+                  placeholder="请输入结算提醒金额"
+                  suffix="元"/>
+              </a-form-model-item>
+              <a-form-model-item label="结算提醒日期" prop="loginName" v-if="form.isEnable==0">
+                <a-select
+                  style="background-color: none;"
+                  placeholder="请选择结算提醒日期"
+                  id="userSyncEdit-roleNames"
+                  allowClear
+                  v-model="form.roleNames"
+                >
+                  <a-select-option v-for="item in dateList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item :label="form.isEnable==1?'超过授信额度':'超期未结算'" prop="loginName" v-if="form.isEnable==1">
+                <a-checkbox @change="onChange">
+                  限制汽车修理厂无法使用数字货架
+                </a-checkbox>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
+            <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '8px' }">保存</a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="handleBack">取消</a-button>
+          </a-form-model-item>
+        </a-form-model>
+      </a-modal>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect, Upload } from '@/components'
+import { getRoleList, saveUserPower } from '@/api/power-user.js'
+export default {
+  name: 'UserModal',
+  components: {
+    STable, VSelect, Upload
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    nowData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    },
+    settlementType: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      titleText: '修改结算方式',
+      isshow: this.visible,
+      roleList: [],
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      settlementTypeList: [{ code: 0, name: '按月结算' }, { code: 1, name: '授信结算' }],
+      form: {
+        name: '',
+        phone: '',
+        loginName: '',
+        sex: undefined,
+        loginFlag: '', // 状态
+        roleNames: undefined, // 角色
+        productMsg: '', // 图片
+        remarks: ''
+      },
+      rules: {
+        name: [ { required: true, message: '请输入用户名称', trigger: 'blur' }, { pattern: '^[^<|>]{1,30}$', message: '请输入不含<或>的字符,最多30个字符' } ],
+        phone: [ { required: true, message: '请输入手机号码', trigger: 'blur' }, { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' } ],
+        loginName: [ { required: true, message: '请输入用户账号', trigger: 'blur' }, { pattern: /^[0-9A-Za-z]+$/, message: '用户账号为数字或大小写字母组成!' } ],
+        sex: [ { required: true, message: '请选择性别', trigger: 'change' } ],
+        loginFlag: [ { required: true, message: '请选择状态', trigger: 'change' } ],
+        roleNames: [ { required: true, message: '请选择角色', trigger: 'change' } ]
+      }
+    }
+  },
+  methods: {
+    // 过滤空格
+    filterEmpty () {
+      let str = this.form.name
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.name = str
+    },
+    // 产品图片上传
+    changeImage (file) {
+      this.form.productMsg = file
+    },
+    // 改变货架归属
+    changeRadio (e) {
+      this.form.loginFlag = e.target.value
+      console.log(e.target.value, '=========')
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = JSON.parse(JSON.stringify(_this.form))
+          params.roleNames = _this.form.roleNames.join(',')
+          params.id = _this.nowData && _this.nowData.id ? _this.nowData.id : null
+          params.ownerOrgFlag = _this.nowData && _this.nowData.ownerOrgFlag
+          _this.spinning = true
+          saveUserPower(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('refresh')
+              setTimeout(function () {
+                _this.isshow = false
+                _this.spinning = false
+              }, 300)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    handleBack () {
+      this.$emit('close')
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+        this.form.name = ''
+        this.form.phone = ''
+        this.form.loginName = ''
+        this.form.sex = undefined
+        this.form.loginFlag = ''
+        this.form.roleNames = undefined
+        this.form.remarks = ''
+      }
+    },
+    nowData: {
+      handler (newValue, oldValue) {
+        if (this.isshow && newValue) {
+          if (this.nowData.id) { //  编辑
+            this.titleText = '编辑数字货架'
+            this.form = Object.assign({}, this.nowData)
+            if (this.nowData.roleIds) {
+              this.form.roleNames = this.nowData.roleIds.split(',')
+            }
+            this.form.loginFlag = Number(this.nowData.loginFlag)
+          }
+        }
+      },
+      deep: true
+    }
+  }
+}
+</script>
+<style lang="less">
+.addGoodsShelve-modal{
+  .ant-select-disabled .ant-select-selection{
+    background-color: none !important;
+  }
+}
+</style>

+ 336 - 0
src/views/numsGoodsShelves/goodsShelvesAdministration/settlementSet.vue

@@ -0,0 +1,336 @@
+<template>
+  <div class="goodsAllocationSet-page">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="goodsAllocationSet-baseInfo">
+        <template slot="subTitle">
+          <a href="javascript:;" @click="handleBack">
+            <a-icon type="left"></a-icon> 返回列表
+          </a>
+          <span style="margin: 0 15px;color: #666;font-weight: bold;">货架名称:{{ pageInfo&&pageInfo.shelfName?pageInfo.shelfName:'--' }}</span>
+        </template>
+      </a-page-header>
+      <a-card :bordered="false" size="small" class="goodsAllocationSet-baseInfo">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions size="small" :column="3">
+              <a-descriptions-item label="配件经销商">{{ pageInfo&&pageInfo.dealerSn?pageInfo.dealerSn:'--' }}</a-descriptions-item>
+              <a-descriptions-item label="汽车修理厂">{{ pageInfo&&pageInfo.storeSn?pageInfo.storeSn:'--' }}</a-descriptions-item>
+              <a-descriptions-item label="货架归属">{{ pageInfo&&pageInfo.ownerType==1?'自有':'平台' }}</a-descriptions-item>
+              <a-descriptions-item label="货架图片">{{ pageInfo&& pageInfo.dealerSn?pageInfo.dealerSn:'--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ pageInfo&&pageInfo.remarks?pageInfo.remarks:'--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+        <a-collapse :activeKey="['1']" class="bzj-collapse">
+          <a-collapse-panel key="1" header="保证金 ( 保证金的新增/编辑/删除请在左侧菜单“保证金管理”功能中操作 )">
+            <s-table
+              class="sTable fixPagination"
+              ref="table"
+              size="small"
+              rowKey="id"
+              :showPagination="false"
+              :columns="columns"
+              :data="loadData"
+              :defaultLoadData="false"
+              bordered>
+              <template slot="status" slot-scope="text, record">
+                <a-button type="link" @click="handleEdit(record)">编辑</a-button>
+                <a-button type="link" @click="handleDel(record)">删除</a-button>
+              <!-- <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span> -->
+              </template>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card :bordered="false" size="small" class="pages-wrap">
+        <div class="goodsAllocationSet-baseInfo">
+          <a-form-model
+            id="userEdit-form"
+            ref="ruleForm"
+            :model="form"
+            :rules="rules"
+            :label-col="formItemLayout.labelCol"
+            :wrapper-col="formItemLayout.wrapperCol"
+          >
+            <a-row :gutter="24">
+              <a-col :span="24">
+                <a-form-model-item label="结算方式" prop="name">
+                  <div style="display: flex;">
+                    <v-select code="ENABLE_FLAG" v-model="form.isEnable" allowClear placeholder="请选择结算方式" @change="changeJStype"></v-select>
+                    <a-button type="link" @click="handleModify">修改</a-button>
+                  </div>
+
+                </a-form-model-item>
+              </a-col>
+              <a-col :span="24">
+                <a-form-model-item label="授信额度" prop="name" v-if="form.isEnable==1">
+                  <a-input
+                    id="userEdit-loginName"
+                    v-model.trim="form.name"
+                    allowClear
+                    placeholder="请输入授信额度"
+                    suffix="元"/>
+                </a-form-model-item>
+                <a-form-model-item label="结算日期" prop="phone" v-if="form.isEnable==0">
+                  <a-select
+                    style="background-color: none;"
+                    placeholder="请选择结算日期"
+                    id="userSyncEdit-roleNames"
+                    allowClear
+                    v-model="form.roleNames"
+                  >
+                    <a-select-option v-for="item in dateList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <!-- </a-row>
+            <a-row :gutter="24"> -->
+              <a-col :span="24">
+                <a-form-model-item label="结算提醒金额" prop="loginName" v-if="form.isEnable==1">
+                  <a-input
+                    id="userEdit-loginName"
+                    v-model.trim="form.loginName"
+                    allowClear
+                    placeholder="请输入结算提醒金额"
+                    suffix="元"/>
+                </a-form-model-item>
+                <a-form-model-item label="结算提醒日期" prop="loginName" v-if="form.isEnable==0">
+                  <a-select
+                    style="background-color: none;"
+                    placeholder="请选择结算提醒日期"
+                    id="userSyncEdit-roleNames"
+                    allowClear
+                    v-model="form.roleNames"
+                  >
+                    <a-select-option v-for="item in dateList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :span="24">
+                <a-form-model-item :label="form.isEnable==1?'超过授信额度':'超期未结算'" prop="loginName" v-if="form.isEnable==1">
+                  <a-checkbox @change="onChange">
+                    限制汽车修理厂无法使用数字货架
+                  </a-checkbox>
+                  <!-- <a-radio-group v-model="value" @change="onChange">
+                    <a-radio :value="1"></a-radio>
+                  </a-radio-group> -->
+                </a-form-model-item>
+              </a-col>
+              <!-- </a-row>
+            <a-row :gutter="24"> -->
+              <a-col :span="24">
+                <a-form-model-item label="是否需要缴纳保证金" prop="loginFlag" v-if="form.isEnable==1">
+                  <a-radio-group name="radioGroup" v-model="form.loginFlag">
+                    <a-radio :value="1">是</a-radio>
+                    <a-radio :value="0">否</a-radio>
+                  </a-radio-group>
+                </a-form-model-item>
+              </a-col>
+              <!-- 状态 -->
+              <a-col :span="24">
+                <a-form-model-item label="保证金缴纳金额" prop="loginName" v-if="form.isEnable==1">
+                  <a-input
+                    id="userEdit-loginName"
+                    v-model.trim="form.loginName"
+                    allowClear
+                    placeholder="请输入保证金缴纳金额"
+                    suffix="元"/>
+                </a-form-model-item>
+              </a-col>
+              <!-- </a-row>
+            <a-row :gutter="24"> -->
+            </a-row>
+            <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
+              <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '8px' }">保存</a-button>
+              <a-button :style="{ marginLeft: '8px' }" @click="handleBack">取消</a-button>
+            </a-form-model-item>
+          </a-form-model>
+        </div>
+
+      </a-card>
+      <!-- 修改结算方式弹窗 -->
+      <settlementModifyModal :visible="openModal" :settlementType="settlementType" @close="openModal=false"></settlementModifyModal>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { shelfDetail } from '@/api/shelf.js'
+import { bondRecordList } from '@/api/boundRecord.js'
+import settlementModifyModal from './settlementModifyModal.vue'
+export default {
+  components: { STable, settlementModifyModal, VSelect },
+  data () {
+    return {
+      spinning: false,
+      isEdit: false, // 货位号是否为编辑
+      openModal: false, // 货位模板弹窗初始状态
+      formItemLayout: {
+        labelCol: { span: 8 },
+        wrapperCol: { span: 10 }
+      },
+      value: '',
+      settlementType: '', // 结算方式
+      pageInfo: null,
+      form: {
+        isEnable: '',
+        name: '',
+        phone: '',
+        loginName: '',
+        sex: undefined,
+        loginFlag: '', // 状态
+        roleNames: undefined, // 角色
+        productMsg: '', // 图片
+        remarks: ''
+      },
+      dateList: [{ id: 1, name: 1 }, { id: 2, name: 2 }, { id: 3, name: 3 }, { id: 4, name: 4 }, { id: 5, name: 5 }, { id: 6, name: 6 }, { id: 7, name: 7 }, { id: 8, name: 8 }, { id: 9, name: 9 }, { id: 10, name: 10 }, { id: 11, name: 11 }, { id: 12, name: 12 }, { id: 13, name: 13 }, { id: 14, name: 14 }, { id: 15, name: 15 }, { id: 16, name: 16 }, { id: 17, name: 17 }, { id: 18, name: 18 }, { id: 19, name: 19 }, { id: 20, name: 20 }, { id: 21, name: 21 }, { id: 22, name: 22 }, { id: 23, name: 23 }, { id: 24, name: 24 }, { id: 25, name: 25 }],
+      rules: {
+        name: [ { required: true, message: '请输入授信额度', trigger: 'blur' }, { pattern: '/^0\.([1-9]|\d[1-9])$|^[1-9]\d{0,8}\.\d{0,2}$|^[1-9]\d{0,8}$/', message: '授信额度最多2位小数且最大为999999' } ],
+        phone: [ { required: true, message: '请输入手机号码', trigger: 'blur' }, { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' } ],
+        loginName: [ { required: true, message: '请输入用户账号', trigger: 'blur' }, { pattern: /^[0-9A-Za-z]+$/, message: '用户账号为数字或大小写字母组成!' } ],
+        isEnable: [ { required: true, message: '请选择结算方式', trigger: 'change' } ],
+        loginFlag: [ { required: true, message: '请选择结算日期', trigger: 'change' } ],
+        roleNames: [ { required: true, message: '请选择结算提醒日期', trigger: 'change' } ]
+      },
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '保证金金额', dataIndex: 'bondAmount', width: '11%', align: 'center', scopedSlots: { customRender: 'name' } },
+        { title: '状态', dataIndex: 'state', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '支付时间', width: '9%', align: 'center', dataIndex: 'payPersonDate' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return bondRecordList(Object.assign({})).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // const no = (data.pageNo - 1) * data.pageSize
+            // for (let i = 0; i < data.list.length; i++) {
+            //   const _item = data.list[i]
+            //   _item.no = no + i + 1
+            //   _item.loginFlag = _item.loginFlag + '' === '1'
+            // }
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    handleBack () {
+      this.$router.go(-1)
+    },
+    getShelfDetail () {
+      this.spinning = true
+      shelfDetail({
+        shelfSn: this.$route.params.shelfSn
+      }).then(res => {
+        if (res.status == 200) {
+          this.pageInfo = Object.assign({}, res.data)
+        } else {
+          this.pageInfo = null
+        }
+        this.spinning = false
+      })
+    },
+    handleExport () {
+      console.log('=========导入货位')
+    },
+    handleEdit (row) {
+      this.isEdit = true
+    },
+    handleSave (row, type) {
+      if (type == 0) {
+        console.log('====保存')
+      } else {
+        console.log('=====取消')
+      }
+      this.$nextTick(() => {
+        this.isEdit = false
+        this.$refs.table.refresh()
+      })
+    },
+    // 修改结算方式
+    changeJStype (val, option) {
+      console.log(val, option, 'val')
+    },
+    handleModify () {
+      this.settlementType = this.form.isEnable
+      this.openModal = true
+      console.log('----------修改')
+    },
+    onChange (e) {
+      console.log(e.target.checked)
+    },
+    handleSubmit () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = JSON.parse(JSON.stringify(_this.form))
+          params.roleNames = _this.form.roleNames.join(',')
+          params.id = _this.nowData && _this.nowData.id ? _this.nowData.id : null
+          params.ownerOrgFlag = _this.nowData && _this.nowData.ownerOrgFlag
+          _this.spinning = true
+          saveUserPower(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('refresh')
+              setTimeout(function () {
+                _this.isshow = false
+                _this.spinning = false
+              }, 300)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    pageInit () {
+      this.getShelfDetail()
+      this.$refs.table.refresh()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .goodsAllocationSet-page{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    .goodsAllocationSet-baseInfo{
+      margin-bottom: 10px;
+    }
+    .bzj-collapse{
+      margin-top: 10px;
+      .ant-collapse-content-box{
+        padding: 10px !important;
+      }
+    }
+
+  }
+</style>

+ 19 - 12
src/views/power/OperateJournal/OperateJournal.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="48">
             <a-col :md="8" :sm="24">
               <a-form-item label="操作时间">
-                <a-range-picker :format="dateFormat" show-time :placeholder="['开始时间', '结束时间']" v-model="time" @change="onChange" />
+                <a-range-picker  show-time :placeholder="['开始时间', '结束时间']" v-model="time" @change="onChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -45,14 +45,15 @@ export default {
   components: { STable },
   data () {
     return {
+      disabled:false,
       // 列表
       form: this.$form.createForm(this, {
         name: 'OperateJournal'
       }),
-      time: [moment(getDate.getToday().starttime, this.dateFormat), moment(getDate.getToday().endtime, this.dateFormat)],
+      time: [getDate.getTodayTime().starttime, getDate.getTodayTime().endtime],
       searchData: {
-        beginDate: null, // 查询的开始时间
-        endDate: null, // 查询的结束时间
+        beginDate: getDate.getTodayTime().starttime, // 查询的开始时间
+        endDate: getDate.getTodayTime().endtime, // 查询的结束时间
         queryWord: '' // 操作人
       },
       dateFormat: 'YYYY-MM-DD HH:mm:ss',
@@ -86,15 +87,21 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        this.searchData.beginDate == null ? (this.searchData.beginDate = getDate.getToday().starttime) : null
-        this.searchData.endDate == null ? (this.searchData.endDate = getDate.getToday().endtime) : null
+        this.disabled = true
+        // this.searchData.beginDate = this.queryParam.beginDate + ' 00:00:00'
+        // this.searchData.endDate = this.queryParam.endDate + ' 23:59:59'
         return journalList(Object.assign(parameter, this.searchData)).then(res => {
-          const no = (res.data.data.pageNo - 1) * res.data.data.pageSize
-          for (let i = 0; i < res.data.data.list.length; i++) {
-            const _item = res.data.data.list[i]
-            _item.no = no + i + 1
-          }
-          return res.data.data
+           let data
+           if (res.status == 200) {
+             data = res.data
+             const no = (data.pageNo - 1) * data.pageSize
+             for (var i = 0; i < data.list.length; i++) {
+               data.list[i].no = no + i + 1
+             }
+             this.disabled = false
+           }
+          
+          return data
         })
       }
     }

+ 5 - 7
src/views/power/role/roleList.vue

@@ -28,7 +28,7 @@
         </a-form>
       </div>
       <div class="table-operator">
-        <a-button v-if="$hasPermissions('B_powerMD_role_add')" type="primary" class="button-error" @click="openModal" id="roleList-openModal">新增</a-button>
+        <a-button type="primary" class="button-error" @click="openModal" id="roleList-openModal">新增</a-button>
       </div>
       <s-table
         class="sTable fixPagination"
@@ -44,13 +44,12 @@
         <!-- 启用禁用 -->
         <span slot="status" slot-scope="text, record">
           <a-switch
-            v-if="$hasPermissions('B_powerMD_role_enable')"
             checkedChildren="启用"
             unCheckedChildren="禁用"
             id="roleList-isEnable"
             v-model="record.isEnable"
             @change="changeFlagHandle(text, record)" />
-          <span v-else>{{ record.isEnable==1?'已启用':'已禁用' }}</span>
+          <!-- <span v-else>{{ record.isEnable==1?'已启用':'已禁用' }}</span> -->
         </span>
         <!-- 角色描述 -->
         <template slot="remarks" slot-scope="text, record">
@@ -58,13 +57,12 @@
         </template>
         <!-- 操作 -->
         <span slot="action" slot-scope="text, record">
-          <a-icon v-if="$hasPermissions('M_powerMD_role_menu')" type="setting" title="菜单权限" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="openMenuModal(record)" />
-          <a-icon v-if="$hasPermissions('B_powerMD_role_edit')" type="edit" title="编辑" :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}" @click="handleEdit(record)" />
+          <a-icon type="setting" title="菜单权限" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="openMenuModal(record)" />
+          <a-icon type="edit" title="编辑" :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}" @click="handleEdit(record)" />
           <a-icon
             type="delete"
             title="删除"
             :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
-            v-if="!record.isEnable && $hasPermissions('B_powerMD_role_del')"
             @click="delect(record)" />
         </span>
       </s-table>
@@ -86,7 +84,7 @@ import {
   updateEnableStatus,
   delectRolePower,
   getMenuList
-} from '@/api/powerRole-md.js'
+} from '@/api/power-role.js'
 export default {
   name: 'RoleList',
   components: {

+ 1 - 1
src/views/power/role/roleModal.vue

@@ -67,7 +67,7 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { saveRolePower } from '@/api/powerRole-md.js'
+import { saveRolePower } from '@/api/power-role.js'
 export default {
   name: 'RoleModal',
   components: {

+ 30 - 16
src/views/power/user/userList.vue

@@ -27,7 +27,7 @@
         </a-form>
       </div>
       <div class="table-operator">
-        <a-button v-if="$hasPermissions('B_powerMD_user_add')" type="primary" class="button-error" @click="openModal">新增</a-button>
+        <a-button type="primary" class="button-error" @click="openModal">新增</a-button>
       </div>
       <s-table
         class="sTable fixPagination"
@@ -41,30 +41,27 @@
         :defaultLoadData="false"
         bordered>
         <span slot="status" slot-scope="text, record">
-          <a-switch v-if="$hasPermissions('B_powerMD_user_enable') && record.superAdmin!=1" checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
-          <span v-else>{{ record.loginFlag==1?'已启用':'已禁用' }}</span>
+          <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
+          <!-- <span v-else>{{ record.loginFlag==1?'已启用':'已禁用' }}</span> -->
         </span>
         <span slot="action" slot-scope="text, record">
           <a-icon
             type="edit"
             title="编辑"
             :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}"
-            v-if="$hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1"
             @click="handleEdit(record)"
           />
           <a-icon
             type="unlock"
             title="重置密码"
-            v-if="record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')"
             :style="{fontSize: '20px',color:' #ffaa00',padding: '0 10px'}"
             @click="resetPassword(record)" />
           <a-icon
             type="delete"
             title="删除"
             :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
-            v-if="record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del')"
             @click="delect(record)"/>
-          <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span>
+          <!-- <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span> -->
         </span>
       </s-table>
     </a-spin>
@@ -98,15 +95,15 @@ export default {
       itemData: null, // 编辑行数据
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '来源', dataIndex: 'org.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '用户名称', dataIndex: 'name', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '手机号码', dataIndex: 'phone', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '用户账号', dataIndex: 'loginName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '角色', width: '13%', align: 'center', dataIndex: 'roleNames', customRender: function (text) { return text || '--' } },
-        { title: '状态', width: '9%', align: 'center', scopedSlots: { customRender: 'status' } },
-        { title: '操作', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '来源', dataIndex: 'org.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '用户名称', dataIndex: 'name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '手机号码', dataIndex: 'phone', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '用户账号', dataIndex: 'loginName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '角色', width: '15%', align: 'center', dataIndex: 'roleNames', customRender: function (text) { return text || '--' } },
+        { title: '状态', width: '10%', align: 'center', scopedSlots: { customRender: 'status' } },
+        { title: '操作', width: '15%', align: 'left', scopedSlots: { customRender: 'action' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -209,6 +206,23 @@ export default {
       this.showSyncModal = false
     },
     // 修改状态
+    // changeFlagHandle (text, record) {
+    //   const _data = {
+    //     id: record.id,
+    //     flag: record.isEnable ? '1' : '0'
+    //   }
+    //   this.spinning = true
+    //   updateEnableStatus(_data).then(res => {
+    //     if (res.status == 200) {
+    //       this.$message.success(res.message)
+    //       this.$refs.table.refresh()
+    //       this.spinning = false
+    //     } else {
+    //       this.$refs.table.refresh()
+    //       this.spinning = false
+    //     }
+    //   })
+    // },
     changeFlagHandle (text, record) {
       const _data = {
         id: record.id,

+ 2 - 2
src/views/power/user/userModal.vue

@@ -36,13 +36,13 @@
               </a-form-model-item>
             </a-col>
           </a-row>
-          <a-row :gutter="20">
+          <!-- <a-row :gutter="20">
             <a-col :span="24">
               <a-form-model-item label="用户账号" prop="loginName" :label-col="{span: 3}" :wrapper-col="{span: 20}">
                 <a-input id="userEdit-loginName" v-model.trim="form.loginName":maxLength="50" allowClear placeholder="请输入用户账号(最多50个字符)"/>
               </a-form-model-item>
             </a-col>
-          </a-row>
+          </a-row> -->
           <a-row :gutter="24">
             <!-- 性别 -->
             <a-col :span="12">

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.103:8503/qpls-md',
-        target: 'https://t.qpls.360arrow.com/qpls-md', //  Á·Ï°
+        target: ' http://192.168.16.107:7300/mock/61aeb88e4b9f94168035f9e0/xprh-admin',
+        // target: 'https://t.qpls.360arrow.com/qpls-md', //  Á·Ï°
         // target: 'http://p.iscm.360arrow.com/qpls-md', //  Ô¤·¢²¼
         // target: 'http://qpls-md.360arrow.com/qpls-md', //  Éú²ú
         // ws: false,