Quellcode durchsuchen

Merge branch 'deploy' of http://git.chelingzhu.com/chelingzhu-web/qhsxKx-admin-html into deploy

lilei vor 4 Jahren
Ursprung
Commit
29f198f398

+ 1 - 1
.env

@@ -2,4 +2,4 @@ NODE_ENV=production
 VUE_APP_PREVIEW=false
 VUE_APP_API_BASE_URL=http://carwash.zyucgj.com/cw-admin
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=洗车机运营
+VUE_APP_PRO_NAME=洗车机运营管理平

+ 1 - 1
.env.development

@@ -2,4 +2,4 @@ NODE_ENV=development
 VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=/api
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=洗车机运营台-dev
+VUE_APP_PRO_NAME=洗车机运营管理平台-dev

+ 1 - 1
.env.preview

@@ -2,4 +2,4 @@ NODE_ENV=production
 VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=http://carwash.test.zyucgj.com/cw-admin
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=洗车机运营台-pro
+VUE_APP_PRO_NAME=洗车机运营管理平台-pro

+ 1 - 1
public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>logo.png">
-    <title>洗车机运营台</title>
+    <title>洗车机运营管理平台</title>
     <style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>
     <!-- require cdn assets css -->
     <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>

+ 10 - 7
src/components/UploadFile/index.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="upload-file" :style="{width: maxNums>1?'100%':'auto'}">
+    <!-- previewFile 暂时去掉,否则不能正常回显 -->
     <a-upload
       :action="action"
       :listType="listType"
@@ -7,7 +8,6 @@
       @preview="handlePreview"
       @change="handleChange"
       :beforeUpload="beforeUpload"
-      :preview-file="previewFile"
       :data="params"
       :value="comVal"
     >
@@ -26,6 +26,14 @@
   </div>
 </template>
 <script>
+  function getBase64(file) {
+    return new Promise((resolve, reject) => {
+      const reader = new FileReader();
+      reader.readAsDataURL(file);
+      reader.onload = () => resolve(reader.result);
+      reader.onerror = error => reject(error);
+    });
+  }
 export default {
   name: 'Upload',
   props: {
@@ -43,9 +51,7 @@ export default {
     },
     previewFile: {
       type: Function,
-      default: function () {
-
-      }
+      default: function () {}
     },
     action: {
       type: String,
@@ -161,7 +167,6 @@ export default {
       if (this.fileType == '*') {
         return true
       }
-
       const isType = this.fileType.indexOf(file.type) >= 0 && file.type != ''
       if (!isType) {
         if (tip != 0) {
@@ -169,7 +174,6 @@ export default {
         }
         return isType
       }
-
       // 文件大小
       const isLt2M = file.size / 1024 / 1024 < this.fileSize
       if (!isLt2M ) {
@@ -182,7 +186,6 @@ export default {
         }
         return isLt2M
       }
-
       return true
     }
   }

+ 1 - 1
src/components/global.less

@@ -407,7 +407,7 @@ body {
 
     h1 {
       color: #fff;
-      font-size: 20px;
+      font-size: 16px;
       margin: 0 0 0 12px;
       font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
       font-weight: 600;

+ 212 - 211
src/config/router.config.js

@@ -8,199 +8,200 @@ import {
 } from '@/layouts'
 
 export const asyncRouterMap = [{
-    path: '/',
-    name: 'index',
-    component: BasicLayout,
+  path: '/',
+  name: 'index',
+  component: BasicLayout,
+  meta: {
+    title: '首页'
+  },
+  redirect: '/home',
+  children: [{
+    path: '/home',
+    name: 'home',
+    redirect: '/home',
+    component: PageView,
     meta: {
-      title: '首页'
+      title: '首页',
+      icon: 'home'
     },
-    redirect: '/home',
+    hideChildrenInMenu: true,
     children: [{
-        path: '/home',
-        name: 'home',
-        redirect: '/home',
-        component: PageView,
-        meta: {
-          title: '首页',
-          icon: 'home'
-        },
-        hideChildrenInMenu: true,
-        children: [{
-            path: '/home',
-            name: 'home',
-            component: () => import( /* webpackChunkName: "home" */ '@/views/Home'),
-            meta: {
-              title: '首页',
-              icon: 'home',
-              hidden: true
-            }
-          },
-          {
-            path: '/changePwd',
-            name: 'changePwd',
-            component: () => import( /* webpackChunkName: "home" */ '@/views/user/ChangePwd'),
-            meta: {
-              title: '修改密码',
-              icon: 'home',
-              hidden: true
-            }
-          }
-        ]
-      },
-      // Car washing machine management center
-      {
-        path: '/CarWashManagement',
-        redirect: '/CarWashManagement/CarWashManagement',
-        component: PageView,
-        meta: {
-          title: '洗车机管理中心',
-          icon: 'setting'
-          // permission: 'M_setting_0'
-        },
-        children: [{
-          path: '/CarWashManagement/CarWashManagement',
-          name: 'CarWashManagement',
-          component: () => import('@/views/CarWashManagement/CarWashManagement.vue'),
-          meta: {
-            title: '洗车机管理',
-            icon: 'database'
-            // permission: 'M_sys_dataDictionary'
-          }
-        }]
-      },
-      {
-        path: '/Order',
-        redirect: '/Order/OrderCenter',
-        name: 'Order',
-        component: PageView,
-        meta: {
-          title: '订单中心',
-          icon: 'snippets'
-          // permission: 'M_setting_0'
-        },
-        children: [{
-          path: '/Order/OrderCenter',
-          name: 'OrderCenter',
-          component: () => import('@/views/Order/OrderCenter.vue'),
-          meta: {
-            title: '订单中心',
-            icon: 'snippets'
-            // permission: 'M_sys_dataDictionary'
-          }
-        }]
-      },
+      path: '/home',
+      name: 'home',
+      component: () => import(/* webpackChunkName: "home" */ '@/views/Home'),
+      meta: {
+        title: '首页',
+        icon: 'home',
+        hidden: true
+      }
+    },
+    {
+      path: '/changePwd',
+      name: 'changePwd',
+      component: () => import(/* webpackChunkName: "home" */ '@/views/user/ChangePwd'),
+      meta: {
+        title: '修改密码',
+        icon: 'home',
+        hidden: true
+      }
+    }
+    ]
+  },
+  // Car washing machine management center
+  {
+    path: '/CarWashManagement',
+    redirect: '/CarWashManagement/CarWashManagement',
+    component: PageView,
+    meta: {
+      title: '洗车机管理中心',
+      icon: 'setting'
+      // permission: 'M_setting_0'
+    },
+    children: [{
+      path: '/CarWashManagement/CarWashManagement',
+      name: 'CarWashManagement',
+      component: () => import('@/views/CarWashManagement/CarWashManagement.vue'),
+      meta: {
+        title: '洗车网点管理',
+        icon: 'database'
+        // permission: 'M_sys_dataDictionary'
+      }
+    }]
+  },
+  {
+    path: '/Order',
+    redirect: '/Order/OrderCenter',
+    name: 'Order',
+    component: PageView,
+    meta: {
+      title: '订单中心',
+      icon: 'snippets'
+      // permission: 'M_setting_0'
+    },
+    children: [{
+      path: '/Order/OrderCenter',
+      name: 'OrderCenter',
+      component: () => import('@/views/Order/OrderCenter.vue'),
+      meta: {
+        title: '订单中心',
+        icon: 'snippets'
+        // permission: 'M_sys_dataDictionary'
+      }
+    }]
+  },
+  // {
+  //   path: '/RefundRecord',
+  //   redirect: '/RefundRecord/RefundRecord',
+  //   component: PageView,
+  //   meta: {
+  //     title: '退单记录',
+  //     icon: 'setting'
+  //     // permission: 'M_setting_0'
+  //   },
+  //   children: [{
+  //     path: '/RefundRecord/RefundRecord',
+  //     name: 'RefundRecord',
+  //     component: () => import('@/views/RefundRecord/RefundRecord.vue'),
+  //     meta: {
+  //       title: '退单记录',
+  //       icon: 'setting'
+  //       // permission: 'M_sys_dataDictionary'
+  //     }
+  //   }
+  //   ]
+  // },
+  {
+    path: '/auth',
+    redirect: '/auth/userList',
+    component: PageView,
+    meta: {
+      title: '权限管理',
+      icon: 'lock'
+      // permission: 'M_auth_0' ,
+    },
+    children: [{
+      path: '/auth/userList',
+      name: 'powerUserList',
+      component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
+      meta: {
+        title: '用户管理',
+        icon: 'user'
+        // permission: 'M_auth_userList' ,
+      }
+    },
+    {
+      path: '/auth/roleList',
+      name: 'powerRoleList',
+      component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
+      meta: {
+        title: '角色管理',
+        icon: 'solution'
+        // permission: 'M_auth_roleList',
+      }
+    },
+    {
+      path: '/menusAuth/adminMenus',
+      name: 'adminMenus',
+      component: () => import(/* webpackChunkName: "bnSetting" */ '@/views/bnSetting/menu/adminMenus.vue'),
+      meta: {
+        title: '菜单管理',
+        icon: 'appstore'
+        // permission: 'M_menusAuth_adminMenus'
+      }
+    }
+    ]
+  },
+  {
+    path: '/setting',
+    redirect: '/setting/userList',
+    component: PageView,
+    meta: {
+      title: '系统设置',
+      icon: 'setting'
+      // permission: 'M_setting_0'
+    },
+    children: [{
+      path: '/setting/dataDictionary',
+      name: 'powerDD',
+      component: () => import(/* webpackChunkName: "setting" */
+        '@/views/power/dataDictionary/dataDictionary.vue'),
+      meta: {
+        title: '数据字典管理',
+        icon: 'database'
+        // permission: 'M_sys_dataDictionary'
+      }
+    }
+      // 暂时屏蔽,后期可能需要
       // {
-      //   path: '/RefundRecord',
-      //   redirect: '/RefundRecord/RefundRecord',
-      //   component: PageView,
+      //   path: '/setting/register',
+      //   name: 'powerRegister',
+      //   component: () => import( /* webpackChunkName: "setting" */ '@/views/power/register/register.vue'),
       //   meta: {
-      //     title: '退单记录',
-      //     icon: 'setting'
-      //     // permission: 'M_setting_0'
-      //   },
-      //   children: [{
-      //     path: '/RefundRecord/RefundRecord',
-      //     name: 'RefundRecord',
-      //     component: () => import('@/views/RefundRecord/RefundRecord.vue'),
-      //     meta: {
-      //       title: '退单记录',
-      //       icon: 'setting'
-      //       // permission: 'M_sys_dataDictionary'
-      //     }
+      //     title: '参数管理',
+      //     icon: 'key'
+      //     // permission: 'M_sys_register'
       //   }
-      //   ]
       // },
-      {
-        path: '/auth',
-        redirect: '/auth/userList',
-        component: PageView,
-        meta: {
-          title: '权限管理',
-          icon: 'lock'
-          // permission: 'M_auth_0' ,
-        },
-        children: [{
-            path: '/auth/userList',
-            name: 'powerUserList',
-            component: () => import( /* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
-            meta: {
-              title: '用户管理',
-              icon: 'user'
-              // permission: 'M_auth_userList' ,
-            }
-          },
-          {
-            path: '/auth/roleList',
-            name: 'powerRoleList',
-            component: () => import( /* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
-            meta: {
-              title: '角色管理',
-              icon: 'solution'
-              // permission: 'M_auth_roleList',
-            }
-          },
-          {
-            path: '/menusAuth/menu',
-            name: 'powerMenu',
-            component: () => import( /* webpackChunkName: "auth" */ '@/views/power/menu/menu.vue'),
-            meta: {
-              title: '菜单管理',
-              icon: 'profile'
-              // permission: 'M_menusAuth_menu'
-            }
-          }
-        ]
-      },
-      {
-        path: '/setting',
-        redirect: '/setting/userList',
-        component: PageView,
-        meta: {
-          title: '系统设置',
-          icon: 'setting'
-          // permission: 'M_setting_0'
-        },
-        children: [{
-            path: '/setting/dataDictionary',
-            name: 'powerDD',
-            component: () => import( /* webpackChunkName: "setting" */
-              '@/views/power/dataDictionary/dataDictionary.vue'),
-            meta: {
-              title: '数据字典管理',
-              icon: 'database'
-              // permission: 'M_sys_dataDictionary'
-            }
-          },
-          {
-            path: '/setting/register',
-            name: 'powerRegister',
-            component: () => import( /* webpackChunkName: "setting" */ '@/views/power/register/register.vue'),
-            meta: {
-              title: '参数管理',
-              icon: 'key'
-              // permission: 'M_sys_register'
-            }
-          },
-          // 暂时屏蔽,后期可能需要
-          // {
-          //   path: '/setting/jobs',
-          //   name: 'powerJobs',
-          //   component: () => import( /* webpackChunkName: "setting" */ '@/views/power/job/jobs.vue'),
-          //   meta: {
-          //     title: '定时器',
-          //     icon: 'alert'
-          //     // permission: 'M_sys_job'
-          //   }
-          // }
-        ]
-      }
+      // 暂时屏蔽,后期可能需要
+      // {
+      //   path: '/setting/jobs',
+      //   name: 'powerJobs',
+      //   component: () => import( /* webpackChunkName: "setting" */ '@/views/power/job/jobs.vue'),
+      //   meta: {
+      //     title: '定时器',
+      //     icon: 'alert'
+      //     // permission: 'M_sys_job'
+      //   }
+      // }
     ]
-  },
-  {
-    path: '*',
-    redirect: '/404',
-    hidden: true
   }
+  ]
+},
+{
+  path: '*',
+  redirect: '/404',
+  hidden: true
+}
 ]
 
 /**
@@ -208,35 +209,35 @@ export const asyncRouterMap = [{
  * @type { *[] }
  */
 export const constantRouterMap = [{
-    path: '/user',
-    component: UserLayout,
-    redirect: '/user/login',
-    hidden: true,
-    children: [{
-        path: 'login',
-        name: 'login',
-        component: () => import( /* webpackChunkName: "user" */ '@/views/user/Login')
-      },
-      {
-        path: 'register',
-        name: 'register',
-        component: () => import( /* webpackChunkName: "user" */ '@/views/user/Register')
-      },
-      {
-        path: 'register-result',
-        name: 'registerResult',
-        component: () => import( /* webpackChunkName: "user" */ '@/views/user/RegisterResult')
-      },
-      {
-        path: 'recover',
-        name: 'recover',
-        component: undefined
-      }
-    ]
+  path: '/user',
+  component: UserLayout,
+  redirect: '/user/login',
+  hidden: true,
+  children: [{
+    path: 'login',
+    name: 'login',
+    component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
+  },
+  {
+    path: 'register',
+    name: 'register',
+    component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
+  },
+  {
+    path: 'register-result',
+    name: 'registerResult',
+    component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
   },
   {
-    path: '/404',
-    component: () => import( /* webpackChunkName: "fail" */ '@/views/exception/404')
+    path: 'recover',
+    name: 'recover',
+    component: undefined
   }
+  ]
+},
+{
+  path: '/404',
+  component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
+}
 
 ]

+ 1 - 1
src/utils/domUtil.js

@@ -16,4 +16,4 @@ export const setDocumentTitle = function (title) {
   }
 }
 
-export const domTitle = '洗车机运营台'
+export const domTitle = '洗车机运营管理平台'

+ 2 - 1
src/views/CarWashManagement/AddCarWashModal.vue

@@ -38,7 +38,7 @@
             <a-form-model-item label="网点照片" prop="icon" class="default-form-item">
               <a-row>
                 <a-col :span="8">
-                  <Upload ref="showPicture" :fileSize="5" :maxNums="1" @change="pictureChange" listType="picture-card" upText="上传图片"></Upload>
+                  <Upload v-model="form.icon" ref="showPicture" :fileSize="5" :maxNums="1" @change="pictureChange" listType="picture-card" upText="上传图片"></Upload>
                 </a-col>
                 <a-col :span="16">
                   <p class="pic-remarks">(尺寸为100*100px)</p>
@@ -348,6 +348,7 @@
       //  保存
       onSubmit(){
         const _this = this
+        console.log(this.form,'-----提交前表单')
         _this.$refs.ruleForm.validate(valid => {
           if (valid) {
             let formData = JSON.parse(JSON.stringify(_this.form))

+ 1 - 1
src/views/CarWashManagement/CarWashManagement.vue

@@ -54,7 +54,7 @@
       <template slot="businessStatus" slot-scope="text, record">{{ record.businessStatus ? $refs.businessStatus.getNameByCode(record.businessStatus) : '-' }}</template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-tooltip placement="left" trigger="click" overlayClassName="btn-cont">
+        <a-tooltip placement="left" overlayClassName="btn-cont">
           <template slot="title">
             <div class="btn-set-cont">
               <p class="set-sub-btn normal" @click="setStoreUpdateStatus(record, 'OPEN')" v-if="record.deviceStatus != 'PAUSE' && record.businessStatus != 'OPEN'">

+ 1 - 1
src/views/Home.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="home">
-    <a-alert message="欢迎登录洗车机运营台系统" type="info" showIcon />
+    <a-alert message="欢迎登录洗车机运营管理平台系统" type="info" showIcon />
   </div>
 </template>
 

+ 4 - 8
src/views/Order/OrderCenter.vue

@@ -74,7 +74,6 @@
     </s-table>
     <!-- 查看详情弹窗 -->
     <order-detail-modal :openModal="openDetailModal" :nowId="detailId" @close="openDetailModal=false" />
-    
   </a-card>
 </template>
 
@@ -108,7 +107,7 @@
           endDate: null, // 创建的结束时间
           storeIdList: [], // 网点名称
           orderNo: '', // 单号
-          itemId: '', // 服务项目
+          itemId: undefined, // 服务项目
           customerMobile: '', // 手机号码
           orderStatus: '' // 状态
         },
@@ -120,7 +119,7 @@
         storeOptionData: [], // 网点名称数据
         openDetailModal: false, // 查看详情弹窗 默认关闭
         detailId: null, // 初始化id
-        detailStatus:'',
+        detailStatus: '',
         // 将默认当天时间日期回显在时间选择框中
         time: [
           moment(getDate.getToday().starttime, this.dateFormat),
@@ -201,7 +200,6 @@
         ],
         // 加载数据方法 必须为 Promise 对象
         loadData: parameter => {
-          // console.log(this.searchForm.storeId)
           this.searchForm.beginDate == null ? this.searchForm.beginDate = getDate.getToday().starttime : null
           this.searchForm.endDate == null ? this.searchForm.endDate = getDate.getToday().endtime : null
           this.searchForm.storeIdList = this.storeId
@@ -232,7 +230,7 @@
           pageNo: this.pageNo,
           pageSize: this.pageSize
         }).then(res => {
-          console.log(res, '-----------')
+          // console.log(res, '-----------')
           if (res.status == 200) {
             this.itemOptionData = res.data.list
           }
@@ -244,7 +242,7 @@
           pageNo: this.pageNo,
           pageSize: this.pageSize
         }).then(res => {
-          console.log(res, '-----------')
+          // console.log(res, '-----------')
           if (res.status == 200) {
             this.storeOptionData = res.data.list
           }
@@ -277,8 +275,6 @@
         // 将当前行的id传递给详情页 
         this.openDetailModal = true
         this.detailId = record.id
-        this.detailStatus = record.orderStatus
-        console.log(this.detailStatus)
       },
       // 退款---暂不做
       // refund(row) {

+ 56 - 61
src/views/Order/OrderDetailModal.vue

@@ -50,20 +50,20 @@
                 <span v-else-if=" orderDetailData.payStatus != 'PAID' ">{{ 0 }} 元</span>
               </a-form-item>
             </a-col>
-            <!-- <a-col :span="8">
+            <a-col :span="8" v-if="orderDetailData.beginImage">
               <a-form-item label="洗车照片" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
                 <div style="display: flex;">
                   <div>
-                      <img :src="imgBefore" alt="" @click="isShowImgModal=true">
+                    <img class="imgCar" :src="orderDetailData.beginImage" alt="" @click="isShowBeginImageModal=true">
                     <div style="text-align: center;">洗车前</div>
                   </div>
                   <div>
-                      <img :src="imgAfter" alt="" @click="isShowImgModal=true">
+                    <img class="imgCar" :src="orderDetailData.endImage" alt="" @click="isShowEndImageModal=true">
                     <div style="text-align: center;">洗车后</div>
                   </div>
                 </div>
               </a-form-item>
-            </a-col> -->
+            </a-col>
           </a-row>
           <a-row :gutter="24">
             <!-- <a-col :span="8">
@@ -80,7 +80,7 @@
           <a-row style="text-align: center;margin-top: 100px;">
             <a-col>
               <a-form-item>
-                <a-button type="default" @click="isShow=false" >返回列表</a-button>
+                <a-button type="default" @click="isShow=false">返回列表</a-button>
               </a-form-item>
             </a-col>
           </a-row>
@@ -88,85 +88,73 @@
       </div>
     </a-modal>
     <!-- 查看洗车前后照片对比 -->
-    <!-- <a-modal class="picModal" :width="600" :footer="null" :destroyOnClose="true" @cancel="isShowImgModal=false" v-model="isShowImgModal">
-      <img :src="imgBefore" class="pic" />
-    </a-modal> -->
+    <a-modal class="imgModal" title="洗车前照片" :width="600" :footer="null" :destroyOnClose="true" @cancel="isShowBeginImageModal=false"
+      v-model="isShowBeginImageModal">
+      <img :src="orderDetailData.beginImage" class="pic" />
+    </a-modal>
+    <a-modal class="imgModal" title="洗车后照片" :width="600" :footer="null" :destroyOnClose="true" @cancel="isShowEndImageModal=false"
+      v-model="isShowEndImageModal">
+      <img :src="orderDetailData.endImage" class="pic" />
+    </a-modal>
   </div>
 </template>
 
 <script>
-  import { Upload, VSelect } from '@/components'
-  import { orderDetail } from '../../api/order.js'
+  import {
+    Upload,
+    VSelect
+  } from '@/components'
+  import {
+    orderDetail
+  } from '../../api/order.js'
   export default {
-    components: { Upload, VSelect },
-    name:'OrderDetailModal',
+    components: {
+      Upload,
+      VSelect
+    },
+    name: 'OrderDetailModal',
     props: {
-      openModal: {  //  弹框是否展示
+      openModal: { //  弹框是否展示
         type: Boolean,
         default: false
       },
-      nowId:{
+      nowId: {
         type: Number,
-        default: null 
-      },
-      nowStatus:{
-        type: String,
-        default: ''
+        default: null
       }
     },
     data() {
       return {
-        orderDetailData:[],
+        orderDetailData: [],
         isShow: this.openModal,
-        // rowId:null
-        // isShowImgModal: false,
-        // imgBefore:require('../../assets/logo.png')
+        isShowBeginImageModal: false, // 洗车前图片弹窗
+        isShowEndImageModal: false, // 洗车后图片弹窗
       }
     },
-    methods: {
-      // getDetailData(){
-      //   if(this.rowId){
-      //     orderDetail({id:this.rowId}).then(res=>{
-      //       console.log(res,'------------')
-      //       if(res.status == 200){
-      //         // setTimeout(() => {
-      //         // 	res.data.orderStatus = this.$refs.orderStatus.getNameByCode(res.data.orderStatus)
-      //         // }, 100)
-      //         this.orderDetailData = res.data
-      //       }
-      //     })
-      //   }
-      // }
-    },
+    methods: {},
     watch: {
       //  父页面传过来的弹框状态以及当前行id
-      openModal (newValue, oldValue) {
+      openModal(newValue, oldValue) {
         this.isShow = newValue
       },
-      nowStatus (newValue, oldValue) {
-        console.log(newValue)
-      },
-      nowId(newValue, oldValue){
-        // this.rowId = newValue
-        // console.log(this.rowId)
-        // this.getDetailData()
-        if(newValue){
-          orderDetail({id:newValue}).then(res=>{
-            console.log(res,'------------')
-            if(res.status == 200){
-              console.log(res.data,'+++')
+      nowId(newValue, oldValue) {
+        if (newValue) {
+          orderDetail({
+            id: newValue
+          }).then(res => {
+            console.log(res, '------------')
+            if (res.status == 200)
               setTimeout(() => {
-              	res.data.orderStatus = this.$refs.orderStatus.getNameByCode(res.data.orderStatus)
-              }, 100)
-              this.orderDetailData = res.data
-              console.log(this.orderDetailData,'---')
-            }
+                res.data.orderStatus = this.$refs.orderStatus.getNameByCode(res.data.orderStatus)
+              }, 500)
+            this.orderDetailData = res.data
+            console.log(this.orderDetailData, '---')
           })
         }
       },
       //  重定义的弹框状态
-      isShow (val){
-        if (!val){
+      isShow(val) {
+        if (!val) {
           this.$emit('close')
         }
       }
@@ -177,11 +165,18 @@
   .orderDetail-content .ant-form-inline .ant-form-item {
     margin-bottom: 20px;
   }
-  .pic{
-    transform: scale(3);
+
+  .imgCar {
+    width: 100px;
+    height: auto;
+    margin: 0 10px;
+  }
+
+  .pic {
+    transform: scale(1);
     display: block;
     max-width: 100%;
-    height:100%;
+    height: 100%;
     margin: 0 auto;
   }
 </style>

+ 9 - 9
src/views/power/menu/menu.vue → src/views/bnSetting/menu/adminMenus.vue

@@ -178,14 +178,14 @@
 
       </a-col>
     </a-row>
-    <childModal :visible="showChildModal" @refresh="getMenuList" :data="parentData" @close="showChildModal = false"></childModal>
+    <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 { getMenuList, saveMenu, deleteMenu } from '@/api/menu.js'
+import { getYyMenuList, saveYyMenu, deleteYyMenu } from '@/api/menu.js'
 
 export default {
   name: 'Menu',
@@ -310,8 +310,8 @@ export default {
       })
     },
     // 获取菜单树列表
-    getMenuList () {
-      getMenuList().then(res => {
+    getYyMenuList () {
+      getYyMenuList().then(res => {
         console.log(res, 'res1111111')
         if (res.status == 200) {
           this.treeData = res.data
@@ -372,12 +372,12 @@ export default {
         okText: '确定',
         cancelText: '取消',
         onOk () {
-          deleteMenu({
+          deleteYyMenu({
             id: _this.formData.id
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success('删除成功')
-              _this.getMenuList()
+              _this.getYyMenuList()
             }
           }).catch(() => {
             _this.$message.success('删除失败, 请稍后重试')
@@ -392,11 +392,11 @@ export default {
       this.form.validateFields((err, values) => {
         if (!err) {
           console.log(values.formData, ' formData.type222222222')
-          saveMenu(Object.assign({ id: this.formData.id }, values.formData)).then(res => {
+          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.getMenuList()
+              _this.getYyMenuList()
               _this.clear()
             } else {
               // this.$message.warning(res.message)
@@ -417,7 +417,7 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getMenuList()
+      vm.getYyMenuList()
     })
   },
   watch: {

+ 41 - 2
src/views/power/menu/childModal.vue → src/views/bnSetting/menu/childModal.vue

@@ -126,6 +126,36 @@
               rules: [] }]"
           />
         </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
@@ -158,7 +188,7 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { saveMenu } from '@/api/menu.js'
+import { saveYyMenu, saveMdMenu } from '@/api/menu.js'
 export default {
   name: 'ChildModal',
   components: {
@@ -169,6 +199,10 @@ export default {
       type: Boolean,
       default: false
     },
+    parentType: {
+      type: String,
+      default: ''
+    },
     data: {
       type: Object,
       default: function () {
@@ -196,6 +230,8 @@ export default {
         urlPath: '',
         sort: '',
         type: undefined,
+        chainOrgUse: 1,
+        singleOrgUse: 1,
         status: 1 // 活动状态
       }
     }
@@ -216,7 +252,8 @@ export default {
       this.form.validateFields((err, values) => {
         if (!err) {
           console.log(values.formData, ' formData.type222222222')
-          saveMenu(Object.assign(this.formData, values.formData)).then(res => {
+          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 : '保存成功')
@@ -258,6 +295,8 @@ export default {
       this.formData.sort = ''
       this.formData.type = ''
       this.formData.status = 1
+      this.formData.chainOrgUse = 1
+      this.formData.singleOrgUse = 1
       this.formData.code = ''
       this.formData.permission = ''
     }

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

@@ -0,0 +1,494 @@
+<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"
+            showIcon
+          >
+            <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="请输入名称"
+              v-decorator="['formData.name', {
+                initialValue: formData.name,
+                rules: [{ required: true, message: '请输入名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+            />
+          </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
+              type="number"
+              placeholder="请输入排序值"
+              v-decorator="['formData.sort', {
+                initialValue: formData.sort,
+                rules: [] }]"
+            />
+          </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, 0.85);
+  }
+  .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>