Преглед изворни кода

Merge branch 'deploy' of chelingzhu-web/zyyc_channe_html into master

lilei пре 4 година
родитељ
комит
205af8afc7
58 измењених фајлова са 2778 додато и 3318 уклоњено
  1. 1 1
      .env
  2. 1 1
      .env.preview
  3. 2 2
      src/App.vue
  4. 44 0
      src/api/FinancialManagement.js
  5. 46 0
      src/api/SetmealSales.js
  6. 0 100
      src/api/car-wash.js
  7. 0 59
      src/api/card-voucher-role.js
  8. 0 58
      src/api/card-voucher-user.js
  9. 97 0
      src/api/customerBundle.js
  10. 11 3
      src/api/data.js
  11. 3 3
      src/api/index.js
  12. 0 45
      src/api/job.js
  13. 5 6
      src/api/login.js
  14. 6 6
      src/api/power-role.js
  15. 6 6
      src/api/power-user.js
  16. 0 22
      src/api/register.js
  17. 2 2
      src/api/report-charts.js
  18. 0 58
      src/api/send-coupon-role.js
  19. 0 61
      src/api/send-coupon-user.js
  20. BIN
      src/assets/logo.png
  21. 1 0
      src/components/Echarts/bar.vue
  22. 1 0
      src/components/Echarts/line.vue
  23. 1 1
      src/components/Echarts/pie.vue
  24. 1 1
      src/components/Select/index.js
  25. 18 0
      src/components/global.less
  26. 3 3
      src/components/tools/UserMenu.vue
  27. 45 54
      src/config/router.config.js
  28. 3 6
      src/layouts/UserLayout.vue
  29. 61 61
      src/libs/getDate.js
  30. 144 114
      src/libs/tools.js
  31. 2 0
      src/store/getters.js
  32. 32 14
      src/store/modules/user.js
  33. 29 28
      src/utils/request.js
  34. 229 0
      src/views/FinancialManagement/PaySettlementRecords.vue
  35. 121 0
      src/views/FinancialManagement/PaySettlementRecordsDetailsModal.vue
  36. 133 0
      src/views/FinancialManagement/WriteOffDetailsModal.vue
  37. 74 46
      src/views/Home.vue
  38. 248 0
      src/views/SetmealSales/BuySetmeal.vue
  39. 0 208
      src/views/SetmealSales/OrderDetailModal.vue
  40. 309 0
      src/views/SetmealSales/PurchasedSetmeal.vue
  41. 248 0
      src/views/SetmealSales/SetmealDetailModal.vue
  42. 119 0
      src/views/SetmealSales/SetmealItemDetailModal.vue
  43. 187 0
      src/views/SetmealSales/SetmealPayMoney.vue
  44. 310 0
      src/views/SetmealSales/VerificationRecords.vue
  45. 0 403
      src/views/SetmealSales/WriteOffRecords.vue
  46. 0 315
      src/views/power/dataDictionary/codeItemModal.vue
  47. 0 199
      src/views/power/dataDictionary/codeModal.vue
  48. 0 398
      src/views/power/dataDictionary/dataDictionary.vue
  49. 0 423
      src/views/power/job/jobs.vue
  50. 0 430
      src/views/power/register/register.vue
  51. 5 3
      src/views/power/role/menuModal.vue
  52. 25 13
      src/views/power/role/roleList.vue
  53. 7 3
      src/views/power/role/roleModal.vue
  54. 22 12
      src/views/power/user/userList.vue
  55. 11 4
      src/views/power/user/userModal.vue
  56. 8 143
      src/views/user/ChangePwd.vue
  57. 155 0
      src/views/user/ResetPwd.vue
  58. 2 3
      vue.config.js

+ 1 - 1
.env

@@ -1,5 +1,5 @@
 NODE_ENV=production
 VUE_APP_PREVIEW=false
-VUE_APP_API_BASE_URL=https://carwash.zyucgj.com/cw-admin/
+VUE_APP_API_BASE_URL=https://channel.zyucgj.com/zyyc-channel/
 VUE_APP_VERSION=V1.0.1
 VUE_APP_PRO_NAME=合作商运营管理平台

+ 1 - 1
.env.preview

@@ -1,5 +1,5 @@
 NODE_ENV=production
 VUE_APP_PREVIEW=true
-VUE_APP_API_BASE_URL=https://carwash.test.zyucgj.com/cw-admin/
+VUE_APP_API_BASE_URL=https://channel.test.zyucgj.com/zyyc-channel/
 VUE_APP_VERSION=V1.0.1
 VUE_APP_PRO_NAME=合作商运营管理平台-pro

+ 2 - 2
src/App.vue

@@ -1,9 +1,9 @@
 <template>
-  <a-locale-provider :locale="locale">
+  <a-config-provider :locale="locale">
     <div id="app">
       <router-view/>
     </div>
-  </a-locale-provider>
+  </a-config-provider>
 </template>
 
 <script>

+ 44 - 0
src/api/FinancialManagement.js

@@ -0,0 +1,44 @@
+import { axios } from '@/utils/request'
+
+// 应付结算记录列表
+export const settlementRecordsList = params => {
+  const url = `/salesChannelSettlement/queryLike/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 合计
+export const settlementRecordsListTotal = params => {
+  const url = `/salesChannelSettlement/total`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 合作商
+export const salesChannelList = params => {
+  const url = `/salesChannel/query`
+  return axios.request({
+    url: url,
+    method: 'post'
+  })
+}
+
+// 按核销套餐单号查询详情列表
+export const SettlementRecordsDetailsList = params => {
+  const url = `/SettlementGoodsChannel/detail/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 46 - 0
src/api/SetmealSales.js

@@ -0,0 +1,46 @@
+import { axios } from '@/utils/request'
+
+// 核销记录列表
+export const getVerificationRecordsList = (params) => {
+  const url = `/verification/queryLikeByChannel/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 门店
+export const getStoreList = (params) => {
+  const url = `/store/queryLike/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 合计
+export const getVerificationRecordsListTotal = (params) => {
+  const url = `/verification/countSettledByChannel`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 导出核销数据
+export const settlementRecordsExport = (params) => {
+  const url = `/verification/export`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 0 - 100
src/api/car-wash.js

@@ -1,100 +0,0 @@
-import { axios } from '@/utils/request'
-
-// 门店设备列表
-export const storeQuery = (params) => {
-  const url = `store/query/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-// 门店设备保存
-export const storeSave = (params) => {
-  const url = 'store/save'
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-// 查询设备
-export const deviceQuery = (params) => {
-  const url = `device/query/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-// 网点详情
-export const storeFind = params => {
-  const url = `store/find/${params.id}`
-  return axios.request({
-    url: url,
-    method: 'get'
-  })
-}
-// 查询门店的服务时段价格
-export const findItem = params => {
-  const url = `item/${params.id}`
-  return axios.request({
-    url: url,
-    method: 'get'
-  })
-}
-// 服务列表
-export const itemQuery = (params) => {
-  const url = `item/query/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-// 删除网点
-export const storeDel = params => {
-  const url = `store/del/${params.id}`
-  return axios.request({
-    url: url,
-    method: 'get'
-  })
-}
-// 获取当前设备图片
-export const deviceImage = params => {
-  const url = `device/image/${params.deviceNo}`
-  return axios.request({
-    url: url,
-    method: 'get'
-  })
-}
-// 获取网点小程序码
-export const storeQrCode = params => {
-  const url = `store/qrCode/${params.deviceNo}/${params.id}`
-  return axios.request({
-    url: url,
-    method: 'get'
-  })
-}
-// 更改网点营业状态
-export const storeUpdateStatus = params => {
-  const url = `store/updateStatus/${params.id}/${params.businessStatus}`
-  return axios.request({
-    url: url,
-    method: 'get'
-  })
-}
-// 检测设备状态
-export const deviceValidStatus = params => {
-  const url = `device/validStatus/${params.deviceNo}`
-  return axios.request({
-    url: url,
-    method: 'get'
-  })
-}

+ 0 - 59
src/api/card-voucher-role.js

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

+ 0 - 58
src/api/card-voucher-user.js

@@ -1,58 +0,0 @@
-import { axios } from '@/utils/request'
-
-// 重置密码
-export const resetPSD = params => {
-  return axios({
-    url: 'yyuser/resetPwd',
-    data: params,
-    method: 'POST'
-  })
-}
-
-// 获取列表数据
-export const getPowerUserList = params => {
-  const url = `yyuser/queryLike/${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: `yyuser/enable/${params.id}/${params.flag}`,
-    data: {},
-    method: 'get'
-  })
-}
-
-// 删除用户接口
-export const delectUserPower = params => {
-  return axios({
-    url: `yyuser/delete/${params.id}`,
-    data: {},
-    method: 'get'
-  })
-}
-
-// 新增/编辑保存接口
-export const saveUserPower = params => {
-  return axios({
-    url: 'yyuser/save',
-    data: params,
-    method: 'POST'
-  })
-}
-
-// 获取角色列表接口
-export const getRoleList = params => {
-  return axios({
-    url: 'yyrole/findAll',
-    data: params,
-    method: 'POST'
-  })
-}

+ 97 - 0
src/api/customerBundle.js

@@ -0,0 +1,97 @@
+import { axios } from '@/utils/request'
+
+//  已购套餐 列表
+export const listCustomerBundle = params => {
+  const url = `customerBundle/queryLike/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  }).then(res => res)
+}
+//  已购套餐 详情
+export const customerBundleDetail = (params) => {
+  return axios.request({
+    url: `customerBundle/detail/${params.id}`,
+    method: 'get'
+  }).then(res => res)
+}
+
+// 已购套餐   使用记录
+export const customerBundleUseHistory = params => {
+  const url = `customerBundle/useHistory/${params.id}`
+  return axios.request({
+    url: url,
+    method: 'get'
+  }).then(res => res)
+}
+
+export const customerBundleHistory = (params) => {
+  return axios.request({
+    url: `customerBundle/useHistory/${params.id}`,
+    method: 'get'
+  }).then(res => res.data)
+}
+
+// 取消购买套餐
+export const cancelBuy = (params) => {
+  return axios.request({
+    url: `customerBundle/cancel/${params.id}`,
+    method: 'get'
+  }).then(res => res.data)
+}
+
+// 套餐列表
+export const getBundleList = params => {
+  const url = `bundle/query`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  }).then(res => res)
+}
+// 套餐   详情
+export const getBundleDetails = params => {
+  const url = `bundle/${params.id}`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'get'
+  }).then(res => res)
+}
+// 套餐  根据手机号查车牌号和客户信息
+export const bundleFindByMobile = params => {
+  const url = `customer/findByMobile/${params.mobile}`
+  return axios.request({
+    url: url,
+    method: 'get'
+  })
+}
+// 套餐  确认收款
+export const bundleBuy = params => {
+  return axios.request({
+    url: `order/buy`,
+    data: params,
+    method: 'post'
+  }).then(res => res)
+}
+// 导出
+export const exportBundle = params => {
+  const url = 'customerBundle/export'
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+//  已购套餐 合计
+export const countListBundle = params => {
+  return axios.request({
+    url: `customerBundle/countList`,
+    data: params,
+    method: 'post'
+  }).then(res => res)
+}

+ 11 - 3
src/api/data.js

@@ -2,14 +2,22 @@ import { axios } from '@/utils/request'
 
 export function login (parameter) {
   return axios({
-    url: '/login',
+    url: '/auth/login',
     method: 'post',
     data: parameter
   })
 }
 
+// 根据字典code查询选项
+export const getLookUpDatas = (params) => {
+  return axios.request({
+    url: `lookup/findByLookup/${params.type}`,
+    method: 'get'
+  })
+}
+
 export const listLookUp = params => {
-  let url = `/lookup/queryLike`
+  const url = `/lookup/queryLike`
   return axios({
     url: url,
     data: params,
@@ -18,7 +26,7 @@ export const listLookUp = params => {
 }
 
 export const getLookUpData = (params) => {
-  let url = `/lookupItem/query/${params.pageNo}/${params.pageSize}`
+  const url = `/lookupItem/query/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({

+ 3 - 3
src/api/index.js

@@ -1,6 +1,6 @@
 const api = {
-  Login: '/login',
-  Logout: '/logout',
+  Login: '/auth/login',
+  Logout: '/auth/logout',
   ForgePassword: '/auth/forge-password',
   Register: '/auth/register',
   twoStepCode: '/auth/2step-code',
@@ -9,4 +9,4 @@ const api = {
   // get my info
   UserInfo: '/user/info'
 }
-export default api
+export default api

+ 0 - 45
src/api/job.js

@@ -1,45 +0,0 @@
-import { axios } from '@/utils/request'
-
-export const listJob = (params) => {
-  let url = `/job/queryJob/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-export const pauseJob = (params) => {
-  return axios({
-    url: '/job/pauseJob',
-    data: params,
-    method: 'post'
-  })
-}
-export const resumeJob = (params) => {
-  return axios({
-    url: '/job/resumeJob',
-    data: params,
-    method: 'post'
-  })
-}
-export const delJob = (params) => {
-  return axios({
-    url: `job/delJob/${params.id}`,
-    method: 'get'
-  })
-}
-export const addJob = (params) => {
-  return axios({
-    url: '/job/addJob',
-    data: params,
-    method: 'post'
-  })
-}
-export const callJob = (params) => {
-  return axios({
-    url: `job/callJob/${params.id}`,
-    method: 'get'
-  })
-}

+ 5 - 6
src/api/login.js

@@ -3,16 +3,15 @@ import { axios } from '@/utils/request'
 
 export function login ({ username, password }) {
   return axios({
-    url: 'login',
-    headers: { 'content-type': 'application/x-www-form-urlencoded', 'App-Type': 9 },
-    data: `username=${username}&password=${password}`,
+    url: 'auth/login',
+    data: { username, password },
     method: 'post'
-  }).then(res => res.data)
+  })
 }
 
 export function logout () {
   return axios({
-    url: 'logout',
+    url: 'auth/logout',
     method: 'get'
   })
 }
@@ -57,7 +56,7 @@ export function get2step (parameter) {
 // 修改密码
 export function changePwd (parameter) {
   return axios({
-    url: 'user/changePWD',
+    url: '/user/changePWD',
     method: 'post',
     data: parameter
   })

+ 6 - 6
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 = `scrole/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -14,7 +14,7 @@ export const getPowerRoleList = params => {
 // 保存角色
 export const saveRolePower = params => {
   return axios({
-    url: 'role/save',
+    url: 'scrole/save',
     data: params,
     method: 'POST'
   })
@@ -22,7 +22,7 @@ export const saveRolePower = params => {
 // flag 0:禁用 1:启用  启禁用角色
 export const updateEnableStatus = params => {
   return axios({
-    url: `role/enable/${params.id}/${params.flag}`,
+    url: `scrole/enable/${params.id}/${params.flag}`,
     data: {},
     method: 'get'
   })
@@ -30,14 +30,14 @@ export const updateEnableStatus = params => {
 // 删除角色
 export const delectRolePower = params => {
   return axios({
-    url: `role/delete/${params.id}`,
+    url: `scrole/delete/${params.id}`,
     data: {},
     method: 'get'
   })
 }
 // 查询可用所有菜单
 export const getMenuList = params => {
-  const url = `role/findAllMenu/${params.id}`
+  const url = `scrole/findAllMenu/${params.id}`
   return axios({
     url: url,
     method: 'get'
@@ -45,7 +45,7 @@ export const getMenuList = params => {
 }
 // 保存角色菜单关系
 export const addMenuPower = params => {
-  const url = `role/saveRoleMenu`
+  const url = `scrole/saveRoleMenu`
   return axios({
     url: url,
     data: params,

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

@@ -3,7 +3,7 @@ import { axios } from '@/utils/request'
 // 重置密码
 export const resetPSD = params => {
   return axios({
-    url: 'user/resetPwd',
+    url: 'scuser/resetPwd',
     data: params,
     method: 'POST'
   })
@@ -11,14 +11,14 @@ export const resetPSD = params => {
 // 启用禁用
 export const updateEnableStatus = params => {
   return axios({
-    url: `user/enable/${params.id}/${params.flag}`,
+    url: `scuser/enable/${params.id}/${params.flag}`,
     data: {},
     method: 'get'
   })
 }
 // 分页查询用户
 export const getPowerUserList = params => {
-  const url = `user/queryLike/${params.pageNo}/${params.pageSize}`
+  const url = `scuser/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -30,7 +30,7 @@ export const getPowerUserList = params => {
 // 删除用户接口
 export const delectUserPower = params => {
   return axios({
-    url: `user/delete/${params.id}`,
+    url: `scuser/delete/${params.id}`,
     data: {},
     method: 'get'
   })
@@ -38,7 +38,7 @@ export const delectUserPower = params => {
 // 查询所有角色
 export const getRoleList = params => {
   return axios({
-    url: 'role/findAll',
+    url: 'scrole/findAll',
     data: params,
     method: 'POST'
   })
@@ -46,7 +46,7 @@ export const getRoleList = params => {
 // 保存用户
 export const saveUserPower = params => {
   return axios({
-    url: 'user/save',
+    url: 'scuser/save',
     data: params,
     method: 'POST'
   })

+ 0 - 22
src/api/register.js

@@ -1,22 +0,0 @@
-import { axios } from '@/utils/request'
-
-export const listRegister = () => {
-  return axios({
-    url: 'register/findAll',
-    method: 'get'
-  })
-}
-
-export const saveRegister = params => {
-  return axios({
-    url: 'register/save',
-    data: params,
-    method: 'post'
-  })
-}
-export const delRegisterNode = params => {
-  return axios({
-    url: `register/del/${params.id}`,
-    method: 'get'
-  })
-}

+ 2 - 2
src/api/report-charts.js

@@ -2,8 +2,8 @@ import { axios } from '@/utils/request'
 // 获取列表数据
 export const getOrderstatistics = params => {
   return axios({
-    url: 'order/statistics',
+    url: 'customerBundle/statistics',
     data: params,
-    method: 'POST'
+    method: 'post'
   })
 }

+ 0 - 58
src/api/send-coupon-role.js

@@ -1,58 +0,0 @@
-import { axios } from '@/utils/request'
-
-// 获取角色列表数据
-export const getRoleList = params => {
-  const url = `mdrole/queryLike/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-
-// 启用禁用角色   flag 0:禁用 1:启用
-export const changeRoleStatus = params => {
-  return axios({
-    url: `mdrole/enable/${params.id}/${params.flag}`,
-    params: params,
-    method: 'get'
-  })
-}
-
-// 查询发券可用所有菜单
-export const getAllUsedMenu = params => {
-  return axios({
-    url: `mdrole/findAllMenu/${params.id}`,
-    data: {},
-    method: 'get'
-  })
-}
-
-// 保存新修改的可用菜单
-export const getAllNewMenu = params => {
-  return axios({
-    url: `mdrole/saveRoleMenu`,
-    data: params,
-    method: 'post'
-  })
-}
-
-// 新增-编辑角色
-export const getEnableRole = params => {
-  return axios({
-    url: 'mdrole/save',
-    data: params,
-    method: 'post'
-  })
-}
-
-// 删除角色
-export const getDelRole = params => {
-  return axios({
-    url: `mdrole/delete/${params.id}`,
-    data: params,
-    method: 'get'
-  })
-}

+ 0 - 61
src/api/send-coupon-user.js

@@ -1,61 +0,0 @@
-import { axios } from '@/utils/request'
-
-// 重置密码
-export const resetPSD = params => {
-  return axios({
-    url: 'employee/restPWD',
-    data: params,
-    method: 'POST'
-  })
-}
-
-// 获取列表数据
-export const getUserList = params => {
-  const url = `employee/queryLike/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'POST'
-  })
-}
-
-// 获取网点名称列表
-export const storeList = params => {
-  const url = `store/query/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-
-// 删除用户接口
-export const delectUser = params => {
-  return axios({
-    url: `employee/del/${params.id}`,
-    data: {},
-    method: 'get'
-  })
-}
-
-// 新增/编辑保存接口
-export const saveUser = params => {
-  return axios({
-    url: 'employee/save',
-    data: params,
-    method: 'POST'
-  })
-}
-
-// 获取角色列表数据
-export const getRoleList = params => {
-  return axios.request({
-    url: '/mdrole/findAll',
-    data: params,
-    method: 'POST'
-  })
-}

BIN
src/assets/logo.png


+ 1 - 0
src/components/Echarts/bar.vue

@@ -59,6 +59,7 @@ export default {
             this.xZoomEnd = 80
           } else {
             this.isShowZoom = false
+            this.xZoomEnd = 100
           }
           if (nVal.length > 30) {
             this.xZoomEnd = 70

+ 1 - 0
src/components/Echarts/line.vue

@@ -59,6 +59,7 @@ export default {
             this.xZoomEnd = 80
           } else {
             this.isShowZoom = false
+            this.xZoomEnd = 100
           }
           if (nVal.length > 30) {
             this.xZoomEnd = 70

+ 1 - 1
src/components/Echarts/pie.vue

@@ -87,7 +87,7 @@ export default {
             textStyle: {
               rich: {
                 name: {
-                  fontSize: 14,
+                  fontSize: 13,
                   fontWeight: 'normal',
                   color: '#666666',
                   padding: [10, 0]

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

@@ -58,7 +58,7 @@ export default {
       const a = this.dataList.find(item => {
         return item.code == code
       })
-      return a ? a.dispName : '-'
+      return a ? a.dispName : '--'
     },
     // 根据名称 获取code
     getCodeByName (dispName) {

+ 18 - 0
src/components/global.less

@@ -501,3 +501,21 @@ body {
     }
   }
 }
+
+/* 表格操作按钮样式 */
+  td .actionBtn {
+    font-size: 20px;
+    padding: 0 10px;
+  }
+  td .icon-blues {
+  	color: #1890FF;
+  }
+  td .icon-green {
+  	color: #16b50e;
+  }
+  td .icon-red {
+  	color: red;
+  }
+  td .icon-orange {
+  	color: #ffaa00;
+  }

+ 3 - 3
src/components/tools/UserMenu.vue

@@ -7,11 +7,11 @@
         </span>
       </a> -->
       <!-- <notice-icon class="action"/> -->
+	  <span style="margin: 0 5px;">{{ salesChannelName }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ nickname }}</span>
       <a-dropdown>
         <span class="action ant-dropdown-link user-dropdown-menu">
           <!-- <a-avatar class="avatar" size="small" :src="avatar==''?defaultAvatar:avatar"/> -->
-          <a-icon type="user" />
-          <span style="margin: 0 5px;">{{ nickname }}</span>
+          <!-- <a-icon type="user" /> -->
           <a-icon type="down" />
         </span>
         <a-menu slot="overlay" class="user-dropdown-menu-wrapper">
@@ -54,7 +54,7 @@ export default {
     NoticeIcon
   },
   computed: {
-    ...mapGetters(['nickname', 'avatar'])
+    ...mapGetters(['nickname', 'avatar', 'salesChannelName'])
   },
   data () {
     return {

+ 45 - 54
src/config/router.config.js

@@ -46,24 +46,59 @@ export const asyncRouterMap = [{
   },
   {
     path: '/SetmealSales',
-    redirect: '/SetmealSales/OrderCenter',
+    redirect: '/SetmealSales/VerificationRecords',
     name: 'SetmealSales',
     component: PageView,
     meta: {
       title: '套餐销售',
       icon: 'snippets',
-      permission: 'M_order_0'
+      permission: 'M_bundel_saller'
     },
     children: [{
-      path: '/SetmealSales/WriteOffRecords',
-      name: 'WriteOffRecords',
-      component: () => import('@/views/SetmealSales/WriteOffRecords.vue'),
+      path: '/SetmealSales/VerificationRecords',
+      name: 'VerificationRecords',
+      component: () => import('@/views/SetmealSales/VerificationRecords.vue'),
       meta: {
         title: '核销记录',
         icon: 'file-text',
-        permission: 'M_order_list'
+        permission: 'M_hxjl_list'
       }
-    }]
+    },
+    {
+      path: '/SetmealSales/BuySetmeal',
+      name: 'BuySetmeal',
+      component: () => import('@/views/SetmealSales/BuySetmeal.vue'),
+      meta: {
+        title: '购买套餐',
+        icon: 'file-text',
+        permission: 'M_buy_bundel'
+      }
+    },
+    {
+      path: '/SetmealSales/PurchasedSetmeal',
+      name: 'PurchasedSetmeal',
+      component: () => import('@/views/SetmealSales/PurchasedSetmeal.vue'),
+      meta: {
+        title: '已购套餐',
+        icon: 'file-text',
+        permission: 'M_bundel_buyRecord'
+      }
+    }
+    ]
+  },
+  {
+	  path: '/FinancialManagement',
+	  name: 'FinancialManagement',
+	  component: PageView,
+	  meta: { title: '财务管理', icon: 'account-book', permission: 'M_cwgn' },
+	  children: [
+	    {
+	      path: 'PaySettlementRecords/list',
+	      name: 'PaySettlementRecords',
+	      component: () => import(/* webpackChunkName: "writeOff" */ '@/views/FinancialManagement/PaySettlementRecords.vue'),
+	      meta: { title: '应付结算记录', icon: 'form', permission: 'M_yfjs_js_list' }
+	    }
+	  ]
   },
   {
     path: '/auth',
@@ -72,7 +107,7 @@ export const asyncRouterMap = [{
     meta: {
       title: '运营平台权限管理',
       icon: 'apartment',
-      permission: 'M_yyAuth_0'
+      permission: 'M_power_auth'
     },
     children: [
       {
@@ -82,7 +117,7 @@ export const asyncRouterMap = [{
         meta: {
           title: '用户管理',
           icon: 'user',
-          permission: 'M_auth_yyUser'
+          permission: 'M_power_user_list'
         }
       },
       {
@@ -92,54 +127,10 @@ export const asyncRouterMap = [{
         meta: {
           title: '角色管理',
           icon: 'solution',
-          permission: 'M_auth_yyRole'
+          permission: 'M_power_role_list'
         }
       }
     ]
-  },
-  {
-    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'
-      //   }
-      // }
-    ]
   }
   ]
 },

+ 3 - 6
src/layouts/UserLayout.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="userLayout" :class="['user-layout-wrapper', device]">
-    <canvas id='canvas'></canvas>
+    <canvas id="canvas"></canvas>
     <div class="container">
       <div class="top">
         <div class="header">
@@ -10,7 +10,7 @@
           </a>
         </div>
         <div class="desc">
-          {{title}}
+          {{ title }}
         </div>
       </div>
 
@@ -87,9 +87,6 @@ export default {
         text-align: center;
 
         .header {
-          height: 44px;
-          line-height: 44px;
-
           .badge {
             position: absolute;
             display: inline-block;
@@ -101,7 +98,7 @@ export default {
           }
 
           .logo {
-            height: 44px;
+            height: 64px;
             vertical-align: top;
             margin-right: 16px;
             border-style: none;

+ 61 - 61
src/libs/getDate.js

@@ -1,65 +1,65 @@
 // 引入 moment 时间插件
-import moment from "moment";
-//获取今日/昨日/本周/上周/本月/上月 时间
+import moment from 'moment'
+// 获取今日/昨日/本周/上周/本月/上月 时间
 export default {
-    // 获取今日的开始结束时间
-    getToday() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().startOf("day").valueOf()).format("YYYY-MM-DD");
-        obj.endtime = moment(moment().valueOf()).format("YYYY-MM-DD");
-        return obj
-    },
-    // 获取昨日的开始结束时间
-    getYesterday() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().add(-1, 'days').startOf("day").valueOf()).format("YYYY-MM-DD");
-        obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取当前周的开始结束时间
-    getCurrWeekDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().week(moment().week()).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
-        obj.endtime = moment(moment().week(moment().week()).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取上一周的开始结束时间
-    getLastWeekDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
-        obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取当前月的开始结束时间
-    getCurrMonthDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD');
-        obj.endtime = moment(moment().month(moment().month()).endOf('month').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取上一个月的开始结束时间
-    getLastMonthDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD');
-        obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD');
-        return obj
+  // 获取今日的开始结束时间
+  getToday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
     }
+    obj.starttime = moment(moment().startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取昨日的开始结束时间
+  getYesterday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().add(-1, 'days').startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前周的开始到当天结束时间
+  getCurrWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week()).startOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一周的开始结束时间
+  getLastWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前月的开始到当天结束时间
+  getCurrMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一个月的开始结束时间
+  getLastMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  }
 }

+ 144 - 114
src/libs/tools.js

@@ -1,9 +1,9 @@
 export const forEach = (arr, fn) => {
   if (!arr.length || !fn) return
   let i = -1
-  let len = arr.length
+  const len = arr.length
   while (++i < len) {
-    let item = arr[i]
+    const item = arr[i]
     fn(item, i, arr)
   }
 }
@@ -14,9 +14,9 @@ export const forEach = (arr, fn) => {
  * @description 得到两个数组的交集, 两个数组的元素为数值或字符串
  */
 export const getIntersection = (arr1, arr2) => {
-  let len = Math.min(arr1.length, arr2.length)
+  const len = Math.min(arr1.length, arr2.length)
   let i = -1
-  let res = []
+  const res = []
   while (++i < len) {
     const item = arr2[i]
     if (arr1.indexOf(item) > -1) res.push(item)
@@ -108,17 +108,17 @@ const getDate = (timeStamp, startType) => {
 export const formtDate = (timeStamp, fmt) => {
   const d = new Date(timeStamp)
   var o = {
-        'M+': d.getMonth() + 1, // 月份
-        'd+': d.getDate(), // 日
-        'h+': d.getHours(), // 小时
-        'm+': d.getMinutes(), // 分
-        's+': d.getSeconds(), // 秒
-        'q+': Math.floor((d.getMonth() + 3) / 3), // 季度
-        'S': d.getMilliseconds() // 毫秒
-    }
-    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length))
-    for (var k in o) { if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) }
-    return fmt
+    'M+': d.getMonth() + 1, // 月份
+    'd+': d.getDate(), // 日
+    'h+': d.getHours(), // 小时
+    'm+': d.getMinutes(), // 分
+    's+': d.getSeconds(), // 秒
+    'q+': Math.floor((d.getMonth() + 3) / 3), // 季度
+    'S': d.getMilliseconds() // 毫秒
+  }
+  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length))
+  for (var k in o) { if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) }
+  return fmt
 }
 /**
  * @param {String|Number} timeStamp 时间戳
@@ -160,22 +160,46 @@ export const formatSubmitDate = (val, type) => {
   if (val == null || val == '' || val == undefined) {
     return ''
   } else {
-    let _date = new Date(val)
-    let _year = _date.getFullYear()
-    let _montn = (_date.getMonth() + 1) < 10 ? '0' + (_date.getMonth() + 1) : (_date.getMonth() + 1)
-    let _day = _date.getDate() < 10 ? '0' + _date.getDate() : _date.getDate()
-    let _hour = _date.getHours() < 10 ? '0' + _date.getHours() : _date.getHours()
-    let _minutes = _date.getMinutes() < 10 ? '0' + _date.getMinutes() : _date.getMinutes()
-    let _seconds = _date.getSeconds() < 10 ? '0' + _date.getSeconds() : _date.getSeconds()
+    const _date = new Date(val)
+    const _year = _date.getFullYear()
+    const _montn = (_date.getMonth() + 1) < 10 ? '0' + (_date.getMonth() + 1) : (_date.getMonth() + 1)
+    const _day = _date.getDate() < 10 ? '0' + _date.getDate() : _date.getDate()
+    const _hour = _date.getHours() < 10 ? '0' + _date.getHours() : _date.getHours()
+    const _minutes = _date.getMinutes() < 10 ? '0' + _date.getMinutes() : _date.getMinutes()
+    const _seconds = _date.getSeconds() < 10 ? '0' + _date.getSeconds() : _date.getSeconds()
 
     if (type == 'minutes') return _year + '-' + _montn + '-' + _day + ' ' + _hour + ':' + _minutes
     else if (type == 'seconds') return _year + '-' + _montn + '-' + _day + ' ' + _hour + ':' + _minutes + ':' + _seconds
     else return _year + '-' + _montn + '-' + _day
   }
 }
+
+// 判断两个时间段是否相差m个月  time1,time2均为日期类型,time1为前时间,time2为后时间
+export const completeDate = function (times1, times2, m) {
+  const time1 = new Date(times1)
+  const time2 = new Date(times2)
+  var diffyear = time2.getFullYear() - time1.getFullYear()
+  var diffmonth = diffyear * 12 + time2.getMonth() - time1.getMonth()
+  if (diffmonth < 0) {
+    return false
+  }
+  var diffDay = time2.getDate() - time1.getDate()
+  if (diffmonth < m || (diffmonth == m && diffDay <= 0)) {
+    if (diffmonth == m && diffDay == 0) {
+      var timeA = time1.getHours() * 3600 + 60 * time1.getMinutes() + time1.getSeconds()
+      var timeB = time2.getHours() * 3600 + 60 * time2.getMinutes() + time2.getSeconds()
+      if (timeB - timeA > 0) {
+        return false
+      }
+    }
+    return true
+  }
+  return false
+}
+
 // 正则验证车牌,验证通过返回true,不通过返回false
 export const isLicensePlate = function (str) {
-    return /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(str)
+  return /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(str)
 }
 // 车牌可输入字符
 export const isCarNumber = function (str) {
@@ -184,6 +208,12 @@ export const isCarNumber = function (str) {
 
   return _value
 }
+
+// 校验手机号
+export const isMobile = function (str) {
+  return /^[0-9]{11}$/.test(str)
+}
+
 // 小数点后两位
 export const numberToFixed = function (val, num) {
   let _value = val + ''
@@ -267,7 +297,7 @@ export const off = (function () {
 export const hasKey = (obj, key) => {
   if (key) return key in obj
   else {
-    let keysArr = Object.keys(obj)
+    const keysArr = Object.keys(obj)
     return keysArr.length
   }
 }
@@ -301,7 +331,7 @@ export const removeListById = (id, list) => {
  * @description 遍历赋值
 */
 export const objExtend = (obj1, obj2) => {
-  for (var a in obj1){
+  for (var a in obj1) {
     obj2[a] = obj1[a]
   }
   return obj2
@@ -311,8 +341,8 @@ export const objExtend = (obj1, obj2) => {
  * @description 浅拷贝
 */
 export const cloneObj = (obj) => {
-  let ret = {}
-  for (var a in obj){
+  const ret = {}
+  for (var a in obj) {
     ret[a] = obj[a]
   }
   return ret
@@ -322,98 +352,98 @@ export const cloneObj = (obj) => {
  * 校验身份证号合法性
  */
 export const checkIdNumberValid = (tex) => {
-    // var tip = '输入的身份证号有误,请检查后重新输入!'
-    let num = tex
-    num = num.toUpperCase()
+  // var tip = '输入的身份证号有误,请检查后重新输入!'
+  let num = tex
+  num = num.toUpperCase()
 
-    let len = num.length
-    let re
-    if (len == 0) return true
+  const len = num.length
+  let re
+  if (len == 0) return true
 
-    // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X。
-    if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(num))){
-        return false
-    }
+  // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X。
+  if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(num))) {
+    return false
+  }
 
-    // 验证前两位地区是否有效
-    let aCity = {11: '北京',
-12: '天津',
-13: '河北',
-14: '山西',
-15: '内蒙古',
-21: '辽宁',
-22: '吉林',
-23: '黑龙江',
-31: '上海',
-32: '江苏',
-33: '浙江',
-34: '安徽',
-35: '福建',
-36: '江西',
-37: '山东',
-41: '河南',
-42: '湖北',
-43: '湖南',
-44: '广东',
-45: '广西',
-46: '海南',
-50: '重庆',
-51: '四川',
-52: '贵州',
-53: '云南',
-54: '西藏',
-61: '陕西',
-62: '甘肃',
-63: '青海',
-64: '宁夏',
-65: '新疆',
-71: '台湾',
-81: '香港',
-82: '澳门',
-91: '国外'}
-
-    if (aCity[parseInt(num.substr(0, 2))] == null){
-        return false
-    }
+  // 验证前两位地区是否有效
+  const aCity = { 11: '北京',
+    12: '天津',
+    13: '河北',
+    14: '山西',
+    15: '内蒙古',
+    21: '辽宁',
+    22: '吉林',
+    23: '黑龙江',
+    31: '上海',
+    32: '江苏',
+    33: '浙江',
+    34: '安徽',
+    35: '福建',
+    36: '江西',
+    37: '山东',
+    41: '河南',
+    42: '湖北',
+    43: '湖南',
+    44: '广东',
+    45: '广西',
+    46: '海南',
+    50: '重庆',
+    51: '四川',
+    52: '贵州',
+    53: '云南',
+    54: '西藏',
+    61: '陕西',
+    62: '甘肃',
+    63: '青海',
+    64: '宁夏',
+    65: '新疆',
+    71: '台湾',
+    81: '香港',
+    82: '澳门',
+    91: '国外' }
+
+  if (aCity[parseInt(num.substr(0, 2))] == null) {
+    return false
+  }
 
-    // 当身份证为15位时的验证出生日期。
-    if (len == 15){
-        re = new RegExp(/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/)
-        let arrSplit = num.match(re)
-
-        // 检查生日日期是否正确
-        let dtmBirth = new Date('19' + arrSplit[2] + '/' + arrSplit[3] + '/' + arrSplit[4])
-        let bGoodDay = (dtmBirth.getYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]))
-        if (!bGoodDay){
-            return false
-        }
+  // 当身份证为15位时的验证出生日期。
+  if (len == 15) {
+    re = new RegExp(/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/)
+    const arrSplit = num.match(re)
+
+    // 检查生日日期是否正确
+    const dtmBirth = new Date('19' + arrSplit[2] + '/' + arrSplit[3] + '/' + arrSplit[4])
+    const bGoodDay = (dtmBirth.getYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]))
+    if (!bGoodDay) {
+      return false
     }
+  }
 
-    // 当身份证号为18位时,校验出生日期和校验位。
-    if (len == 18){
-        re = new RegExp(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/)
-        let arrSplit = num.match(re)
-        // 检查生日日期是否正确
-        let dtmBirth = new Date(arrSplit[2] + '/' + arrSplit[3] + '/' + arrSplit[4])
-        let bGoodDay = (dtmBirth.getFullYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]))
-        if (!bGoodDay){
-            return false
-        } else {
-            // 检验18位身份证的校验码是否正确。
-            // 校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
-            let valnum
-            let arrInt = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
-            let arrCh = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']
-            let nTemp = 0
-            let i
-            for (i = 0; i < 17; i++){
-                nTemp += num.substr(i, 1) * arrInt[i]
-            }
-            valnum = arrCh[nTemp % 11]
-            if (valnum != num.substr(17, 1)){
-                return false
-            }
-        }
+  // 当身份证号为18位时,校验出生日期和校验位。
+  if (len == 18) {
+    re = new RegExp(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/)
+    const arrSplit = num.match(re)
+    // 检查生日日期是否正确
+    const dtmBirth = new Date(arrSplit[2] + '/' + arrSplit[3] + '/' + arrSplit[4])
+    const bGoodDay = (dtmBirth.getFullYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]))
+    if (!bGoodDay) {
+      return false
+    } else {
+      // 检验18位身份证的校验码是否正确。
+      // 校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
+      let valnum
+      const arrInt = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
+      const arrCh = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']
+      let nTemp = 0
+      let i
+      for (i = 0; i < 17; i++) {
+        nTemp += num.substr(i, 1) * arrInt[i]
+      }
+      valnum = arrCh[nTemp % 11]
+      if (valnum != num.substr(17, 1)) {
+        return false
+      }
     }
-    return true
+  }
+  return true
 }

+ 2 - 0
src/store/getters.js

@@ -5,6 +5,8 @@ const getters = {
   token: state => state.user.token,
   avatar: state => state.user.avatar,
   nickname: state => state.user.name,
+  salesChannelName: state => state.user.salesChannelName,
+  mustChangePwd: state => state.user.mustChangePwd,
   welcome: state => state.user.welcome,
   roles: state => state.user.roles,
   userInfo: state => state.user.info,

+ 32 - 14
src/store/modules/user.js

@@ -7,6 +7,8 @@ const user = {
   state: {
     token: '',
     name: '',
+    salesChannelName: '',
+    mustChangePwd: null,
     welcome: '',
     avatar: '',
     roles: { permissionList: [] },
@@ -23,6 +25,12 @@ const user = {
       state.welcome = welcome
       Vue.ls.set('userName', name, 7 * 24 * 60 * 60 * 1000)
     },
+    SET_CHANNELNAME: (state, name) => {
+      state.salesChannelName = name
+    },
+    SET_MUSTCHANGEPWD: (state, status) => {
+      state.mustChangePwd = status
+    },
     SET_AVATAR: (state, avatar) => {
       state.avatar = avatar
     },
@@ -39,22 +47,30 @@ const user = {
     Login ({ commit }, userInfo) {
       console.log(userInfo, 'userInfo----')
       return new Promise((resolve, reject) => {
-        login(userInfo).then(res => {
-          console.log(res, 'login success')
-          if (res && res.userid) {
-            Vue.ls.set('hasError', 0)
-            commit('SET_TOKEN', res.userid)
-            commit('SET_NAME', { name: res.userNameCN, welcome: welcome() })
-            commit('SET_AVATAR', res.avatar ? res.avatar : '')
-            Vue.ls.set('rolesAccess', { permissionList: res.permCodes }, 7 * 24 * 60 * 60 * 1000)
-            // 记住密码
-            if (userInfo.rememberMe) {
-              VueCookies.set('REMEMBER_ME', JSON.stringify(userInfo))
-            } else {
-              VueCookies.remove('REMEMBER_ME')
+        login(userInfo).then(ret => {
+          console.log(ret, 'login success')
+          if (ret.status == 200) {
+            const res = ret.data
+            if (res.access_token && res.auth_user) {
+              const users = res.auth_user
+              Vue.ls.set('hasError', 0)
+              commit('SET_TOKEN', res.access_token)
+              commit('SET_NAME', { name: users.userNameCN, welcome: welcome() })
+              commit('SET_CHANNELNAME', users.extInfo.channel.salesChannelName)
+              commit('SET_MUSTCHANGEPWD', users.mustChangePwd)
+              Vue.ls.set('rolesAccess', { permissionList: users.permCodes }, 7 * 24 * 60 * 60 * 1000)
+              commit('SET_AVATAR', res.avatar ? res.avatar : '')
+              // 记住密码
+              if (userInfo.rememberMe) {
+                VueCookies.set('REMEMBER_ME', JSON.stringify(userInfo))
+              } else {
+                VueCookies.remove('REMEMBER_ME')
+              }
             }
+            resolve(res)
+          } else {
+            reject(ret)
           }
-          resolve()
         }).catch(error => {
           reject(error)
         })
@@ -82,6 +98,8 @@ const user = {
           resolve(error)
         }).finally(() => {
           commit('SET_NAME', { name: '', welcome: '' })
+          commit('SET_CHANNELNAME', '')
+          commit('SET_MUSTCHANGEPWD', '')
           commit('SET_AVATAR', '')
           commit('SET_TOKEN', '')
           commit('SET_ROLES', { permissionList: [] })

+ 29 - 28
src/utils/request.js

@@ -1,10 +1,11 @@
-import Vue from 'vue'
+// import Vue from 'vue'
 import axios from 'axios'
 import store from '@/store'
 import notification from 'ant-design-vue/es/notification'
+import modal from 'ant-design-vue/es/modal'
 import { VueAxios } from './axios'
-import { ACCESS_TOKEN } from '@/store/mutation-types'
-console.log(process.env.VUE_APP_PRO_NAME)
+// import { ACCESS_TOKEN } from '@/store/mutation-types'
+// console.log(process.env.VUE_APP_PRO_NAME)
 // 创建 axios 实例
 const service = axios.create({
   baseURL: process.env.VUE_APP_API_BASE_URL, // api base_url
@@ -12,19 +13,15 @@ const service = axios.create({
 })
 
 const err = (error) => {
+  console.log(error.response.data.message, 'error')
   if (error.response) {
-    const data = error.response.data
-    if ((error.response.status == 403 || error.response.status == 401) && window.location.pathname != '/user/login') {
+    const status = error.response.status
+    if ((status == 503 || status == 500) && window.location.pathname != '/user/login') {
       notification.destroy()
       notification.error({
         message: '提示',
-        description: data.message
+        description: error.response.data.message
       })
-      setTimeout(function () {
-        store.dispatch('Logout').then(() => {
-          window.location.reload()
-        })
-      }, 2000)
     }
   }
   // 超时无法访问服务
@@ -32,47 +29,51 @@ const err = (error) => {
     notification.destroy()
     notification.error({
       message: '提示',
-      description: error.message
+      description: '请求超时'
     })
-    setTimeout(function () {
-      store.dispatch('Logout').then(() => {
-        window.location.reload()
-      })
-    }, 2000)
   }
   return Promise.reject(error)
 }
 
 // request interceptor
 service.interceptors.request.use(config => {
-  const token = Vue.ls.get(ACCESS_TOKEN)
+  const token = store.getters.token
+  config.headers['App-Type'] = 8 // 平台类型
   if (token) {
-    // config.headers['Access-Token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
+    config.headers['access-token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
   }
   return config
 }, err)
 
 // response interceptor
 service.interceptors.response.use((response) => {
-  console.log(response, response.data.status, 'responseresponseresponse')
+  console.log(response, 'response.data.status')
   if (window.location.pathname != '/user/login') {
-    if (response.data.status == '900') {
+    if (response.data.status == '500') {
       notification.destroy()
       notification.error({
         message: '提示',
         description: response.data.message
       })
     }
-  } else {
-    if (response.data.status == '500') {
-      notification.destroy()
-      notification.error({
-        message: '提示',
-        description: response.data.message
+    const et = sessionStorage.getItem('errorTips')
+    if (response.data.status && response.data.status.length == 4 && !et) {
+      sessionStorage.setItem('errorTips', 1)
+      modal.destroyAll()
+      modal.error({
+        title: '提示',
+        content: response.data.message,
+        onOk () {
+          sessionStorage.setItem('errorTips', 0)
+          if (['1001', '1002', '1006', '1099', '1100', '9000'].indexOf(response.data.status) >= 0) {
+            store.dispatch('Logout').then(() => {
+              window.location.reload()
+            })
+          }
+        }
       })
     }
   }
-
   return response.data
 }, err)
 

+ 229 - 0
src/views/FinancialManagement/PaySettlementRecords.vue

@@ -0,0 +1,229 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="refresh">
+        <a-row :gutter="48">
+          <a-col :lg="6" :sm="12">
+            <a-form-item label="结算时间:" :label-col="{ span: 3 }" :wrapper-col="{ span: 12 }">
+              <a-range-picker
+                style="width:100%"
+                id="PaySettlementRecords-queryOrderDate"
+                :disabledDate="disabledDate"
+                v-model="queryOrderDate"
+                format="YYYY-MM-DD"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-form-item label="结算单号" :label-col="{ span: 3 }" :wrapper-col="{ span: 12 }">
+              <a-input class="full-width" v-model="queryParam.settleNo" placeholder="请输入" allowClear id="PaySettlementRecords-queryOrderDate"/>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-button type="primary" @click="refresh" id="PaySettlementRecords-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" id="PaySettlementRecords-resetSearchForm">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div class="ftext" slot="message">共<span>{{ orderTotal }}</span>单,实收<span>¥{{ amountTotal }}</span>元</div>
+    </a-alert>
+    <!-- 列表 -->
+    <div>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        bordered
+        :columns="columns"
+        :data="loadData">
+        <template slot="action" slot-scope="text, record">
+          <!-- <a-icon type="eye" title="查看" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="handleDetail(record)" /> -->
+          <a-button type="primary" @click="handleDetail(record)" id="PaySettlementRecords-handleDetail">详情</a-button>
+        </template>
+      </s-table>
+    </div>
+    <!-- 应收结算记录详情弹窗 -->
+    <pay-settlement-records-details-modal :itemId="itemId" :openModalDetails="openModalDetails" @close="openModalDetails=false"></pay-settlement-records-details-modal>
+    <!-- 核销详情弹窗 -->
+    <WriteOffDetailsModal :itemId="itemId" :openWriteOffModal="openWriteOffModal" @close="openWriteOffModal=false"></WriteOffDetailsModal>
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  settlementRecordsList,
+  settlementRecordsListTotal
+} from '@/api/FinancialManagement'
+import PaySettlementRecordsDetailsModal from './PaySettlementRecordsDetailsModal.vue'
+import WriteOffDetailsModal from './WriteOffDetailsModal.vue'
+export default {
+  name: 'SettlementRecordsList',
+  components: {
+    VSelect,
+    STable,
+    PaySettlementRecordsDetailsModal,
+    WriteOffDetailsModal
+  },
+  data () {
+    return {
+      loadData: parameter => {
+        const searchData = Object.assign(parameter, this.queryParam)
+        console.log(this.queryOrderDate, 'this.queryOrderDate')
+        if (this.queryOrderDate && this.queryOrderDate.length) {
+          searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+          searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+        } else {
+          searchData.beginDate = ''
+          searchData.endDate = ''
+        }
+        return settlementRecordsList(searchData).then(res => {
+          const no = (res.data.pageNo - 1) * res.data.pageSize
+          for (let i = 0; i < res.data.list.length; i++) {
+            const _item = res.data.list[i]
+            _item.no = no + i + 1
+          }
+          return res.data
+        })
+      },
+      queryOrderDate: undefined,
+      queryParam: {
+        settleNo: '',
+        beginDate: '',
+        endDate: ''
+      },
+      orderTotal: 0, // 订单数量
+      amountTotal: 0, // 实收总金额
+      itemId: '', // 每条数据id
+      // settleId: '',
+      openModalDetails: false, // 默认关闭详情弹窗
+      openWriteOffModal: false,
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '60px',
+        align: 'center'
+      },
+      {
+        title: '结算单号',
+        dataIndex: 'settleNo',
+        width: '150px',
+        align: 'center'
+      },
+      {
+        title: '结算时间',
+        dataIndex: 'settleDate',
+        width: '150px',
+        align: 'center'
+      },
+      {
+        title: '结算订单数',
+        dataIndex: 'orderNum',
+        width: '150px',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'userInfo'
+        }
+      },
+      {
+        title: '结算金额',
+        dataIndex: 'realAmount',
+        align: 'center',
+        width: '150px'
+      },
+      {
+        title: '操作',
+        dataIndex: 'action',
+        width: '100px',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ]
+    }
+  },
+  methods: {
+    // 禁止不可选日期
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
+    // 查看详情
+    handleDetail (record) {
+      this.itemId = record.settleNo
+      if (record.settleType === 'BUNDLE_SALE') {
+        this.openModalDetails = true
+        console.log(this.openModalDetails)
+      } else {
+        this.openWriteOffModal = true
+      }
+	  console.log(this.itemId, record.settleType)
+    },
+    // 查询
+    refresh () {
+      this.$refs.table.refresh(true)
+      this.getListTotal()
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryOrderDate = undefined
+      this.queryParam = {
+        settleNo: '',
+        beginDate: '',
+        endDate: ''
+      }
+      this.$refs.table.refresh(true)
+      this.getListTotal()
+    },
+    // 合计
+    getListTotal () {
+      const params = {
+        settleNo: this.queryParam.settleNo,
+        beginDate: this.queryParam.beginDate,
+        endDate: this.queryParam.endDate
+      }
+      if (this.queryOrderDate && this.queryOrderDate.length) {
+        params.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+        params.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+      } else {
+        params.beginDate = ''
+        params.endDate = ''
+      }
+      //    params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
+      //    params.endDate == null ? params.endDate = getDate.getToday().endtime : null
+      settlementRecordsListTotal(params).then(res => {
+        if (res.status == 200) {
+          if (res.data) {
+            this.orderTotal = res.data.orderNum || 0
+            this.amountTotal = res.data.amount || 0
+          } else {
+            this.orderTotal = 0
+            this.amountTotal = 0
+          }
+        }
+      })
+    }
+
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.resetSearchForm()
+    })
+  }
+}
+</script>
+
+<style scoped>
+	.ftext span {
+		color: #fa8c16;
+		font-weight: bold;
+	}
+</style>

+ 121 - 0
src/views/FinancialManagement/PaySettlementRecordsDetailsModal.vue

@@ -0,0 +1,121 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      title="详情"
+      v-model="isshow"
+      @cancle="cancel"
+      :footer="null"
+      width="60%"
+      :centered="true">
+      <s-table
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        bordered
+        :columns="columns"
+        :data="loadData">
+      </s-table>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { SettlementRecordsDetailsList } from '@/api/FinancialManagement'
+export default {
+  name: 'SettlementRecordsDetailsModal',
+  components: {
+    STable
+  },
+  props: {
+    openModalDetails: {
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      loadData: parameter => {
+        return SettlementRecordsDetailsList({
+          settleNo: this.itemId,
+          pageNo: 1,
+          pageSize: 10
+        }).then(res => {
+          const no = (res.data.pageNo - 1) * res.data.pageSize
+          for (let i = 0; i < res.data.list.length; i++) {
+            const _item = res.data.list[i]
+            _item.no = no + i + 1
+          }
+          return res.data
+        })
+      },
+      isshow: this.openModalDetails,
+      settleId: '', // 套餐名称
+      openWriteOffModal: false, // 核销弹窗默认关闭
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          width: '60px',
+          align: 'center'
+        },
+        {
+          title: '订单号',
+          dataIndex: 'orderBundleNo',
+          width: '150px',
+          align: 'center'
+        },
+        {
+          title: '下单时间',
+          dataIndex: 'orderDate',
+          width: '150px',
+          align: 'center'
+        },
+        {
+          title: '套餐名称',
+          dataIndex: 'bundleName',
+          width: '150px',
+          align: 'center'
+        },
+        {
+          title: '结算金额',
+          dataIndex: 'settleAmount',
+          align: 'center',
+          width: '150px'
+        }
+      ]
+    }
+  },
+  methods: {
+    // 关闭弹窗
+    cancel (e) {
+      this.$emit('close')
+    }
+  },
+  watch: {
+    openModalDetails (newValue, oldValue) {
+      this.isshow = newValue
+      console.log(this.isshow)
+    },
+    isshow (val) {
+      if (!val) {
+        this.$emit('close')
+      }
+    },
+    itemId (newValue, oldValue) {
+      console.log(newValue)
+      if (newValue && this.isshow) {
+        this.$refs.table.refresh(true)
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 133 - 0
src/views/FinancialManagement/WriteOffDetailsModal.vue

@@ -0,0 +1,133 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      title="详情"
+      v-model="isshow"
+      @cancle="cancel"
+      :footer="null"
+      width="60%"
+      :centered="true">
+      <s-table
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        bordered
+        :columns="columns"
+        :data="loadData">
+      </s-table>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { STable } from '@/components'
+import {
+  SettlementRecordsDetailsList
+} from '@/api/FinancialManagement'
+export default {
+  components: {
+    STable
+  },
+  props: {
+    openWriteOffModal: {
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      loadData: parameter => {
+        return SettlementRecordsDetailsList({
+          settleNo: this.itemId,
+          pageNo: 1,
+          pageSize: 10
+        }).then(res => {
+          const no = (res.data.pageNo - 1) * res.data.pageSize
+          for (let i = 0; i < res.data.list.length; i++) {
+            const _item = res.data.list[i]
+            _item.no = no + i + 1
+          }
+          return res.data
+        })
+      },
+      isshow: this.openWriteOffModal,
+	  columns: [{
+	    title: '序号',
+	    dataIndex: 'no',
+	    width: '60px',
+	    align: 'center'
+	  },
+	  {
+	    title: '核销单号',
+	    dataIndex: 'verificationNo',
+	    width: '150px',
+	    align: 'center'
+	  },
+	  {
+	    title: '核销时间',
+	    dataIndex: 'usedTime',
+	    width: '150px',
+	    align: 'center'
+	  },
+	  {
+	    title: '套餐名称',
+	    dataIndex: 'bundleName',
+	    width: '150px',
+	    align: 'center'
+	  },
+	  {
+	    title: '服务名称',
+	    dataIndex: 'bundleItemName',
+	    width: '150px',
+	    align: 'center',
+	    scopedSlots: {
+	      customRender: 'userInfo'
+	    }
+	  },
+	  {
+	    title: '结算金额',
+	    dataIndex: 'settleAmount',
+	    align: 'center',
+	    width: '150px'
+	  },
+	  {
+	    title: '核销门店',
+	    dataIndex: 'usedStoreName',
+	    width: '100px',
+	    align: 'center'
+	  }
+	  ]
+    }
+  },
+  methods: {
+	  // 关闭弹窗
+	  cancel (e) {
+	    this.clear()
+	    this.$emit('close')
+	  }
+  },
+  watch: {
+	  openWriteOffModal (newValue, oldValue) {
+	  		  this.isshow = newValue
+	  },
+	  isshow (val) {
+	    if (!val) {
+	      this.$emit('close')
+	    }
+	  },
+	  itemId (newValue, oldValue) {
+	    if (newValue && this.isshow) {
+	       this.$refs.table.refresh(newValue)
+	    }
+	  }
+  }
+}
+</script>
+
+<style>
+</style>

+ 74 - 46
src/views/Home.vue

@@ -11,6 +11,7 @@
                 <a-range-picker
                   style="width: 220px;"
                   @change="dateChange"
+                  id="statistics-queryWord"
                   v-model.trim="searchForm.queryWord"
                   :disabledDate="disabledDate"
                 />
@@ -19,6 +20,7 @@
                 快捷筛选:
                 <span
                   :class="['searchItem',curentType==item.type?'active':'']"
+                  id="statistics-quick"
                   v-for="(item,index) in tabList"
                   :key="index"
                   @click="getCurentSearchTime(item)">{{ item.name }}</span>
@@ -31,9 +33,9 @@
       <a-card class="panel" title="按业务量统计">
         <!-- 业务量趋势图表展示 -->
         <chart-line
-          style="height: 300px;"
+          style="height: 350px;"
           color="#6C6FBE"
-          :yMax="5000"
+          :yMax="200"
           yUnit="单"
           :xAxisRotate="resize"
           :xAxisData="XdaysData"
@@ -47,7 +49,7 @@
           <a-col :md="4" :lg="4">
             <a-card class="border-radius background-skyblue">
               <div class="module-list ">
-                <span>{{ chartData.KX }}</span>
+                <span>{{ chartData.xmbundleNum }}</span>
                 <p>洗美套餐</p>
               </div>
             </a-card>
@@ -55,7 +57,7 @@
           <a-col :md="4" :lg="4">
             <a-card class="border-radius background-greenBlue">
               <div class="module-list ">
-                <span>{{ chartData.JX }}</span>
+                <span>{{ chartData.bybundleNum }}</span>
                 <p>保养套餐</p>
               </div>
             </a-card>
@@ -63,7 +65,7 @@
           <a-col :md="4" :lg="4">
             <a-card class="border-radius background-blackGreen">
               <div class="module-list ">
-                <span>{{ chartData.DLX }}</span>
+                <span>{{ chartData.xtyhbundleNum }}</span>
                 <p>系统养护套餐</p>
               </div>
             </a-card>
@@ -79,10 +81,10 @@
           <a-col span="24" v-if="currentTabChart=='tab1'">
             <chart-bar
               ref="ChartBar"
-              style="height: 300px;"
+              style="height: 350px;"
               color="#6C6FBE"
               :xAxisRotate="resize"
-              :yMax="1000"
+              :yMax="200"
               yUnit="单"
               :xAxisData="XdaysData"
               :seriesData="washTypeBarData"
@@ -93,9 +95,9 @@
           <a-col span="24" v-if="currentTabChart=='tab2'">
             <chart-line
               ref="ChartLine"
-              style="height: 300px;"
+              style="height: 350px;"
               color="#6C6FBE"
-              :yMax="1000"
+              :yMax="200"
               yUnit="单"
               :xAxisRotate="resize"
               :xAxisData="XdaysData"
@@ -114,7 +116,7 @@
               :searchData="XdaysData"
               :value="washTypePieData"
               title="套餐销售量(单)"
-              :total="chartData.allOrderNum"
+              :total="chartData.bundleNum"
               :color="washTypePieColor"
               :xAxisRotate="resize"
               text="" />
@@ -127,7 +129,7 @@
               :searchData="XdaysData"
               :value="couponChartData"
               title="套餐内总服务项目数(次)"
-              :total="chartData.allOrderNum"
+              :total="chartData.itemNum"
               :color="couponColor"
               :xAxisRotate="resize"
               text="" />
@@ -135,10 +137,26 @@
         </a-row>
       </a-card>
     </div>
+    <!-- 重置密码 -->
+    <a-modal
+      class="resetPwdModal"
+      title="重置密码"
+      width="60%"
+      centered
+      :footer="null"
+      :closable="false"
+      :maskClosable="false"
+      :destroyOnClose="true"
+      @cancel="openResetPwd=false"
+      v-model="openResetPwd">
+      <ResetPwd />
+    </a-modal>
   </div>
 </template>
 
 <script>
+import ResetPwd from '@/views/user/ResetPwd.vue'
+import { mapGetters } from 'vuex'
 import {
   ChartPie,
   ChartBar,
@@ -153,7 +171,8 @@ export default {
   components: {
     ChartPie,
     ChartBar,
-    ChartLine
+    ChartLine,
+    ResetPwd
   },
   watch: {
     screenWidth (val) {
@@ -171,6 +190,7 @@ export default {
     }
   },
   computed: {
+    ...mapGetters(['mustChangePwd']),
     resize () {
       console.log(this.screenWidth, 'this.screenWidth')
       if (this.screenWidth < 1640) {
@@ -183,29 +203,28 @@ export default {
     washTypePieData () {
       const data = [{
         'name': '洗美套餐',
-        'value': this.chartData.KX
+        'value': this.chartData.xmbundleNum
       }, {
         'name': '保养套餐',
-        'value': this.chartData.JX
+        'value': this.chartData.bybundleNum
       }, {
         'name': '系统养护套餐',
-        'value': this.chartData.DLX
+        'value': this.chartData.xtyhbundleNum
       }]
       return data
     },
-    // 洗车用券量占比数据
+    // 套餐内总服务项目数占比数据
     couponChartData () {
       const data = [{
         'name': '套餐服务核销量',
-        'value': this.chartData.notUseCouponOrderNum
+        'value': this.chartData.itemUsedNum
       }, {
         'name': '套餐服务未核销量',
-        'value': this.chartData.useCouponOrderNum
+        'value': this.chartData.itemUnUsedNum
       }]
       return data
     }
   },
-
   data () {
     return {
       screenWidth: document.body.clientWidth, // 这里是给到了一个默认值
@@ -213,15 +232,16 @@ export default {
       form: this.$form.createForm(this, { name: 'searchForm' }),
       isNoData: false, // 是否有每天营业额及进店量数据
       searchForm: {
-        queryWord: null, // 时间查询条件,默认本周
+        queryWord: null // 时间查询条件,默认本周
       },
       chartData: {
-        KX: 0, // 快洗
-        JX: 0, // 精洗
-        DLX: 0, // 打蜡洗
-        allOrderNum: 0, // 洗车总量
-        useCouponOrderNum: 0, // 用券洗车量
-        notUseCouponOrderNum: 0 // 未用券洗车量
+        xmbundleNum: 0, // 洗美套餐
+        bybundleNum: 0, // 保养套餐
+        xtyhbundleNum: 0, // 系统养护套餐
+        itemNum: 0, // 服务数量
+        itemUsedNum: 0, // 已使用服务数量
+        itemUnUsedNum: 0, // 未使用服务数量
+        bundleNum: 0 //  套餐销售量
       },
       // 快速删选tab
       tabList: [{
@@ -258,7 +278,7 @@ export default {
       ],
       couponColor: ['#d48265', '#ff55ff'],
       // 套餐类型数据
-      currentTabChart: 'tab1', // 洗车类型详情数据与变化趋势的tab 默认展示详情数据
+      currentTabChart: 'tab1', // 套餐类型详情数据与变化趋势的tab 默认展示详情数据
       XdaysData: [], // 图表X轴时间集合
       // 套餐类型柱状图表数据
       washTypeBarData: [{
@@ -300,11 +320,10 @@ export default {
         couponChartData: [],
         washTypePieData: [],
         chartData: {}
-      }
+      },
+      openResetPwd: false //  重置密码是否显示
     }
   },
-  created () {
-  },
   methods: {
     moment,
     // 时间改变
@@ -387,40 +406,49 @@ export default {
     // 整合图表每天数据
     filterData (data) {
       const days = [] // 日期合集
-      const kxData = [] // 快速洗车数据
-      const jxData = [] // 精致洗车数据
-      const dlxData = [] // 打蜡洗车数据
-      const totalData = [] // 全部洗车量数据
-      const useCouponData = [] // 用券洗车量数据
+      const kxData = [] // 洗美套餐数据
+      const jxData = [] // 保养套餐数据
+      const dlxData = [] // 系统养护套餐数据
+      const totalData = [] // 当日套餐销售量数据
+      const useCouponData = [] // 当日套餐使用量数据
+      console.log(data, '--data')
       data.map(item => {
         const itemDay = item.date.split('-')
         const month = Number(itemDay[1])
         const day = Number(itemDay[2])
         const time = month + '月' + day + '日'
         days.push(time)
-        kxData.push(item.KX)
-        jxData.push(item.JX)
-        dlxData.push(item.DLX)
-        totalData.push(item.allOrderNum)
-        useCouponData.push(item.useCouponOrderNum)
+        kxData.push(item.xmbundleNum)
+        jxData.push(item.bybundleNum)
+        dlxData.push(item.xtyhbundleNum)
+        totalData.push(item.bundleNum)
+        useCouponData.push(item.customerBundleUsedNum)
       })
       this.XdaysData = days
       const washTypeData = [kxData, jxData, dlxData]
-      // 洗车类型柱状图表数据
+      console.log(washTypeData, 'washTypeData')
+      // 套餐类型柱状图表数据
       this.washTypeBarData.map((item, index) => {
         item.data = washTypeData[index]
       })
-      // 洗车类型折线图表数据
+      // 套餐类型折线图表数据
       this.washTypeLineData.map((item, index) => {
         item.data = washTypeData[index]
       })
-      // 洗车量图表数据赋值
+      // 套餐量图表数据赋值
       this.washCarsChartData[0].data = totalData
       this.washCarsChartData[1].data = useCouponData
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
+      //  判断登录用户是否重置过密码(首次登陆需强制重置密码)
+      if (vm.mustChangePwd == 0) {
+        vm.openResetPwd = false
+      } else {
+        vm.openResetPwd = true
+      }
+      console.log(vm.mustChangePwd, '-------是否需要重置密码')
       vm.pageInit()
       vm.curentType = 'thisWeek'
       vm.getCurentSearchTime()
@@ -484,7 +512,7 @@ export default {
         left: 40%;
       }
       .chartPie-box{
-        height: 300px;
+        height: 400px;
         width: 100%;
       }
       .panel-title {
@@ -525,7 +553,7 @@ export default {
       }
 
       .background-pop {
-        background-color: #8544e0;
+        background-color: #6C6FBE;
       }
 
       .background-black {
@@ -549,7 +577,7 @@ export default {
       }
 
       .background-orange {
-        background-color: #d2701b;
+        background-color: #ffaa00;
       }
     }
 

+ 248 - 0
src/views/SetmealSales/BuySetmeal.vue

@@ -0,0 +1,248 @@
+<template>
+  <div class="buySetmeal-wrap">
+    <a-card :bordered="false">
+      <a-row>
+        <a-col :span="5"><b class="buySetmeal-tit">选择套餐</b></a-col>
+        <a-col :span="19" class="search-con">
+          <a-input-search
+            v-model="queryWord"
+            allowClear
+            placeholder="搜索套餐"
+            enter-button
+            class="search-inp"
+            id="buySetmeal-search"
+            @search="onSearch" />
+        </a-col>
+      </a-row>
+      <div class="draConts">
+        <!-- 分类 -->
+        <a-tabs v-model="clsId" tabPosition="left" class="smenus" @change="tabChange">
+          <a-tab-pane key="all" tab="全部"></a-tab-pane>
+          <a-tab-pane v-for="item in setmealType" :key="item.code" :tab="item.dispName"></a-tab-pane>
+        </a-tabs>
+        <!-- 套餐数据列表 -->
+        <div class="itemBox" id="bundelScroll" :style="{height: winH - 358 + 'px'}">
+          <a-row class="items-list" v-for="(item, index) in listData" :key="index">
+            <a-col :span="15">
+              <h3>{{ item.name }} </h3>
+              <p>
+                <span><b>原价:</b><em style="text-decoration: line-through;">¥{{ item.originalPrice }}</em> </span>
+                <span style="margin-left: 15px;margin-right: 15px;color: red;"><b>现价:</b>¥{{ item.price }} </span>
+              </p>
+              <p>
+                <span><b>套餐说明:</b>{{ item.summary || '-' }}</span>
+              </p>
+            </a-col>
+            <a-col :span="1"></a-col>
+            <a-col :span="4">
+              <!-- <span>1 套</span> -->
+            </a-col>
+            <a-col :span="4">
+              <a-button
+                class="handle-btn buy-btn"
+                id="buySetmeal-buy"
+                type="primary"
+                @click="openPay(item)"
+                shape="round">下单</a-button>
+              <a-button
+                class="handle-btn look-btn"
+                id="buySetmeal-look"
+                @click="openDetails(item)"
+                shape="round">查看详细</a-button>
+            </a-col>
+          </a-row>
+          <a-empty v-if="listData.length == 0" class="noData" />
+        </div>
+      </div>
+    </a-card>
+    <!-- 下单弹框 -->
+    <SetmealPayMoney :openModal="openSetmealPay" :setmealInfo="setmealInfo" @close="closeModal" />
+    <!-- 套餐详细 -->
+    <SetmealItemDetailModal :openModal="openSetmealDetails" :setmealId="setmealId" @close="closeModal" />
+  </div>
+
+</template>
+
+<script>
+import SetmealPayMoney from './SetmealPayMoney.vue'
+import SetmealItemDetailModal from './SetmealItemDetailModal.vue'
+import { getLookUpDatas } from '@/api/data'
+import { getBundleList } from '@/api/customerBundle.js'
+export default {
+  name: 'BuySetmeal',
+  components: { SetmealPayMoney, SetmealItemDetailModal },
+  data () {
+    return {
+      listData: [], //  套餐数据
+      queryWord: '', //  关键词
+      clsId: '',
+      pageNo: 1,
+      pageSize: 1000,
+      setmealType: [], //  套餐类型
+      openSetmealPay: false, //  下单弹框是否显示
+      openSetmealDetails: false, //  查看详细弹框是否显示
+      setmealId: null, //  套餐id
+      setmealInfo: null, //  套餐信息
+      winH: 0 //  浏览器高度
+    }
+  },
+  methods: {
+    //  搜索套餐
+    onSearch () {
+      this.clsId = 'all'
+      this.initData()
+    },
+    pageInit () {
+      // 默认选择第一个类型
+      this.clsId = 'all'
+      this.queryWord = ''
+      this.initData()
+    },
+    // 初始化数据
+    initData () {
+      getBundleList({
+        queryWord: this.queryWord,
+        clsId: this.clsId == 'all' ? '' : this.clsId
+      }).then(res => {
+        if (res.status == 200) {
+          this.listData = res.data
+        } else {
+          this.listData = []
+        }
+      })
+    },
+    //  tab 切换
+    tabChange (v) {
+      this.listData = []
+      document.getElementById('bundelScroll').scrollTop = 0
+      this.clsId = v
+      if (this.clsId == 'all') {
+        this.queryWord = this.queryWord
+      } else {
+        this.queryWord = ''
+      }
+      this.initData()
+    },
+    // 下单
+    openPay (data) {
+      this.setmealInfo = data
+      this.openSetmealPay = true
+    },
+    closeModal () {
+      this.setmealId = null
+      this.setmealInfo = null
+      this.openSetmealPay = false
+      this.openSetmealDetails = false
+      this.initData()
+    },
+    //  查看详细
+    openDetails (data) {
+      this.setmealId = String(data.id)
+      this.openSetmealDetails = true
+    },
+    //  套餐分类  数据字典
+    getBundleClsDatas () {
+      getLookUpDatas({ type: 'BUNDLE_TYPE' }).then(res => {
+        if (res.status == 200) {
+          this.setmealType = res.data
+        } else {
+          this.setmealType = []
+        }
+      })
+    }
+  },
+  mounted () {
+    this.winH = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight // 浏览器高度
+    this.getBundleClsDatas()//  套餐分类  数据字典
+    this.pageInit()
+  }
+}
+</script>
+
+<style lang="less">
+  .buySetmeal-wrap{
+    .buySetmeal-tit{
+      line-height: 32px;
+    }
+    .search-con{
+      text-align: right;
+      .search-inp{
+        width: 60%;
+      }
+      .ant-input-group .ant-input-affix-wrapper{
+        height: 34px;
+      }
+      .ant-input-group-addon{
+        padding: 0;
+      }
+    }
+    .ant-tabs .ant-tabs-left-bar .ant-tabs-tab, .ant-tabs .ant-tabs-right-bar .ant-tabs-tab{
+      padding: 12px 55px;
+      margin: 0;
+    }
+    .draConts{
+      display: flex;
+      border-top: 1px solid #eee;
+      margin-top: 20px;
+      padding-top: 20px;
+      .smenus{
+        width: 20%;
+        .ant-tabs-nav .ant-tabs-tab:hover{
+          color: #1890FF;
+        }
+        .ant-tabs-ink-bar{
+          background: #1890FF;
+        }
+        .ant-tabs-tab-active.ant-tabs-tab{
+          border-radius: 60px 0 0 60px;
+          color: #1890FF;
+          background: #f0faff;
+        }
+        .ant-tabs-content.ant-tabs-content-animated.ant-tabs-left-content{
+          width: 0;
+          padding: 0;
+        }
+
+      }
+      .itemBox{
+        width: 80%;
+        overflow: auto;
+        .items-list{
+          display: flex;
+          align-items: middle;
+          justify-content: space-around;
+          border: 1px solid #eee;
+          border-radius: 10px;
+          margin: 10px 0;
+          padding: 15px 20px;
+          font-size: 14px;
+          overflow: hidden;
+          align-items: center;
+          h3{
+            margin: 0;
+          }
+          p{
+            color: #666;
+            padding: 5px 0 0 0;
+            margin: 0;
+            b{
+              font-weight: normal;
+              color: #333;
+            }
+          }
+          .handle-btn{
+            display: block;
+            width: 90px;
+          }
+          .look-btn{
+            margin-top: 15px;
+          }
+        }
+        .noData{
+          margin: 150px 0 0;
+          text-align: center;
+        }
+      }
+    }
+  }
+</style>

+ 0 - 208
src/views/SetmealSales/OrderDetailModal.vue

@@ -1,208 +0,0 @@
-<template>
-  <div>
-    <a-modal
-      title="查看详情"
-      :footer="null"
-      :width="1100"
-      :destroyOnClose="true"
-      @cancel="isShow = false"
-      v-model="isShow">
-      <v-select ref="orderStatus" code="ORDER_STATUS" placeholder="请选择" allowClear v-show="false"></v-select>
-      <div class="orderDetail-content">
-        <a-form>
-          <a-row :gutter="24">
-            <a-col :span="8">
-              <a-form-item label="下单时间" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.orderTime }}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="8">
-              <a-form-item label="单号" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.orderNo }}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="8">
-              <a-form-item label="门店名称" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.storeName }}</span>
-              </a-form-item>
-            </a-col>
-          </a-row>
-          <a-row :gutter="24">
-            <a-col :span="8">
-              <a-form-item label="服务名称" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.itemName }}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="8">
-              <a-form-item label="手机号码" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.customerMobile }}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="8">
-              <a-form-item label="状态" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.orderStatus }}</span>
-              </a-form-item>
-            </a-col>
-          </a-row>
-          <a-row :gutter="24">
-            <a-col :span="8">
-              <a-form-item label="应付(¥)" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.payableAmount }} 元</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="8">
-              <a-form-item label="实付(¥)" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span v-if=" orderDetailData.payStatus == 'PAID' ">{{ orderDetailData.paymentAmount }} 元</span>
-                <span v-if=" orderDetailData.payStatus != 'PAID' ">{{ 0 }} 元</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="8">
-              <a-form-item label="优惠(¥)" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.orderCoupons ? orderDetailData.couponAmount : 0 }} 元</span>
-              </a-form-item>
-            </a-col>
-          </a-row>
-          <a-row :gutter="24">
-            <a-col :span="8">
-              <a-form-item label="使用优惠券" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.orderCoupons ? orderDetailData.orderCoupons[0].couponTitle : '--' }}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="8">
-              <a-form-item label="洗车照片" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <div style="display: flex;">
-                  <div class="imgBox">
-                    <div>
-                      <img v-if="orderDetailData.beginImage" class="imgCar" :src="orderDetailData.beginImage" alt="" @click="isShowBeginImageModal=true">
-                      <div v-if="!orderDetailData.beginImage" class="imgCar">--</div>
-                    </div>
-                    <div>洗车前</div>
-                  </div>
-                  <div class="imgBox">
-                    <div>
-                      <img v-if="orderDetailData.endImage" class="imgCar" :src="orderDetailData.endImage" alt="" @click="isShowEndImageModal=true">
-                      <div v-if="!orderDetailData.endImage" class="imgCar">--</div>
-                    </div>
-                    <div>洗车后</div>
-                  </div>
-                </div>
-              </a-form-item>
-            </a-col>
-          </a-row>
-          <a-row style="text-align: center;margin-top: 100px;">
-            <a-col>
-              <a-form-item>
-                <a-button type="default" @click="isShow=false">返回列表</a-button>
-              </a-form-item>
-            </a-col>
-          </a-row>
-        </a-form>
-      </div>
-    </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'
-export default {
-  components: {
-    Upload,
-    VSelect
-  },
-  name: 'OrderDetailModal',
-  props: {
-    openModal: { //  弹框是否展示
-      type: Boolean,
-      default: false
-    },
-    nowId: {
-      type: Number,
-      default: null
-    }
-  },
-  data () {
-    return {
-      orderDetailData: [],
-      isShow: this.openModal,
-      isShowBeginImageModal: false, // 洗车前图片弹窗
-      isShowEndImageModal: false // 洗车后图片弹窗
-    }
-  },
-  methods: {},
-  watch: {
-    //  父页面传过来的弹框状态以及当前行id
-    openModal (newValue, oldValue) {
-      this.isShow = newValue
-    },
-    nowId (newValue, oldValue) {
-      if (newValue) {
-        orderDetail({
-          id: newValue
-        }).then(res => {
-          // console.log(res, '------------')
-          this.orderDetailData = res.data
-          if (res.status == 200) {
-            setTimeout(() => {
-              res.data.orderStatus = this.$refs.orderStatus.getNameByCode(res.data.orderStatus)
-            }, 500)
-          }
-        })
-      }
-    },
-    //  重定义的弹框状态
-    isShow (val) {
-      if (!val) {
-        this.$emit('close')
-      }
-    }
-  }
-}
-</script>
-<style lang="less">
-	.orderDetail-content .ant-form-inline .ant-form-item {
-		margin-bottom: 20px;
-	}
-
-	.imgBox {
-		text-align: center;
-		margin-left: 10px;
-		.imgCar {
-			height: 50px;
-			width: auto;
-		}
-	}
-	.pic {
-		transform: scale(1);
-		display: block;
-		max-width: 100%;
-		height: 100%;
-		margin: 0 auto;
-	}
-</style>

+ 309 - 0
src/views/SetmealSales/PurchasedSetmeal.vue

@@ -0,0 +1,309 @@
+<template>
+  <a-card :bordered="false" class="purchasedSetmeal-wrap">
+    <!-- 搜索条件 -->
+    <div class="purchasedSetmeal-searchForm">
+      <a-form ref="searchForm" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="下单时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-range-picker
+                id="purchasedSetmeal-time"
+                v-model="time"
+                :format="dateFormat"
+                :placeholder="['开始时间','结束时间']"
+                :disabledDate="disabledDate"
+                @change="onChange" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="订单号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-input v-model.trim="searchForm.number" id="purchasedSetmeal-number" placeholder="请输入订单号" allowClear />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="客户信息" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-input v-model.trim="searchForm.queryWord" id="purchasedSetmeal-queryWord" placeholder="请输入手机号" allowClear />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="套餐名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-input v-model.trim="searchForm.bundleName" id="purchasedSetmeal-bundleName" placeholder="请输入套餐名称" allowClear />
+            </a-form-item>
+          </a-col>
+          <!-- <a-col :span="6">
+            <a-form-item label="订单状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}"> -->
+          <v-select
+            v-show="false"
+            v-model="searchForm.orderFlag"
+            ref="orderFlag"
+            id="purchasedSetmeal-status"
+            code="PAY_STATUS"
+            placeholder="请选择订单状态"
+            allowClear></v-select>
+          <!-- </a-form-item>
+          </a-col> -->
+          <a-col :span="6">
+            <a-form-item label="结算状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <v-select
+                v-model="searchForm.salesChannelSettleStatus"
+                ref="salesChannelSettleStatus"
+                id="purchasedSetmeal-status"
+                code="SETTLE_STATUS_ALL"
+                placeholder="请选择结算状态"
+                allowClear></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-button class="handle-btn serach-btn" id="purchasedSetmeal-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button class="handle-btn" type="" id="purchasedSetmeal-reset" @click="handleReset">重置</a-button>
+            <a-button class="handle-btn export-btn" id="purchasedSetmeal-export" type="" :loading="loading" @click="handleExport">导出</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 新建 -->
+    <div class="table-operator"><a-button type="primary" v-if="$hasPermissions('M_buy_bundel')" id="purchasedSetmeal-buy" icon="plus" @click="goBuy()">购买套餐</a-button></div>
+    <!-- 合计 -->
+    <div class="total">
+      <a-icon type="info-circle" class="iconImg" />
+      <strong>总计:</strong><span v-model="orderTotal">{{ orderTotal || 0 }} 单</span>
+      <strong style="margin-left: 15px;">收款金额:</strong><span v-model="totalAmounts">{{ totalAmounts || 0 }} 元</span>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 客户信息 -->
+      <p slot="custInfo" slot-scope="text, record">
+        <span v-if="record.custMobile">{{ record.custMobile }}</span>
+        <span v-else>--</span>
+      </p>
+      <!-- 订单状态 -->
+      <span slot="orderFlag" slot-scope="text, record">{{ $refs.orderFlag.getNameByCode(record.orderFlag) }}</span>
+      <!-- 结算状态 -->
+      <span slot="salesChannelSettleStatus" slot-scope="text, record">{{ $refs.salesChannelSettleStatus.getNameByCode(record.salesChannelSettleStatus) }}</span>
+      <!-- 操作 -->
+      <span slot="action" slot-scope="text, record">
+        <a-button type="primary" id="purchasedSetmeal-look" @click="seeDetail(record)">详情</a-button>
+      </span>
+    </s-table>
+    <!-- 查看详情弹窗 -->
+    <setmeal-detail-modal :openModal="openDetailModal" :setmealId="detailId" @close="openDetailModal=false" />
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import getDate from '@/libs/getDate.js'
+import { completeDate } from '@/libs/tools.js'
+import moment from 'moment'
+import SetmealDetailModal from './SetmealDetailModal.vue'
+import { listCustomerBundle, exportBundle, countListBundle } from '@/api/customerBundle.js'
+export default {
+  name: 'PurchasedSetmeal',
+  components: { STable, VSelect, SetmealDetailModal },
+  data () {
+    return {
+      // 查询参数
+      searchForm: {
+        beginDate: null, // 开始时间
+        endDate: null, // 结束时间
+        bundleName: '', // 套餐名称
+        number: '', // 订单号
+        queryWord: '', // 客户信息
+        orderFlag: '', // 订单状态
+        salesChannelSettleStatus: '' // 结算状态
+      },
+      loading: false, // 导出loading
+      orderTotal: '', // 合计开单数量
+      totalAmounts: '', // 合计收款金额
+      openDetailModal: false, // 查看详情弹窗 默认关闭
+      detailId: null, // 初始化id
+      // 将默认当天时间日期回显在时间选择框中
+      time: [
+        moment(getDate.getToday().starttime, this.dateFormat),
+        moment(getDate.getToday().endtime, this.dateFormat)
+      ],
+      dateFormat: 'YYYY-MM-DD',
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '订单号', dataIndex: 'number', width: 100, align: 'center' },
+        { title: '下单时间', dataIndex: 'orderDate', width: 100, align: 'center' },
+        { title: '套餐名称', dataIndex: 'bundleName', width: 100, align: 'center' },
+        { title: '客户信息', scopedSlots: { customRender: 'custInfo' }, width: 100, align: 'center' },
+        { title: '收款金额(¥)', dataIndex: 'payedAmount', width: 80, align: 'center' },
+        { title: '订单状态', scopedSlots: { customRender: 'orderFlag' }, width: 80, align: 'center' },
+        { title: '结算状态', scopedSlots: { customRender: 'salesChannelSettleStatus' }, width: 80, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.searchForm.beginDate == null ? this.searchForm.beginDate = getDate.getToday().starttime : null
+        this.searchForm.endDate == null ? this.searchForm.endDate = getDate.getToday().endtime : null
+        return listCustomerBundle(Object.assign(parameter, this.searchForm)).then(res => {
+          if (res.status == 200) {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+            }
+            this.getTotal()
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  methods: {
+    moment,
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    //  购买套餐
+    goBuy () {
+      this.$router.push({ path: '/SetmealSales/BuySetmeal' })
+    },
+    // 创建时间change
+    onChange (dates, dateStrings) {
+      if ((dates, dateStrings)) {
+        this.searchForm.beginDate = dateStrings[0]
+        this.searchForm.endDate = dateStrings[1]
+      }
+    },
+    // 合计
+    getTotal () {
+      const params = {
+        beginDate: this.searchForm.beginDate,
+        endDate: this.searchForm.endDate,
+        bundleName: this.searchForm.bundleName,
+        number: this.searchForm.number,
+        queryWord: this.searchForm.queryWord,
+        orderFlag: this.searchForm.orderFlag,
+        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
+      }
+      params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
+      params.endDate == null ? params.endDate = getDate.getToday().endtime : null
+      countListBundle(params).then(res => {
+        if (res.status == 200) {
+          if (res.data) {
+            this.orderTotal = res.data.cnt || 0
+            this.totalAmounts = res.data.totalAmounts || 0
+          } else {
+            this.orderTotal = 0
+            this.totalAmounts = 0
+          }
+        } else {
+          this.orderTotal = 0
+          this.totalAmounts = 0
+        }
+      })
+    },
+    // 查看详情--跳转到对应的详情页
+    seeDetail (record) {
+      // 将当前行的id传递给详情页
+      this.detailId = String(record.id)
+      this.openDetailModal = true
+    },
+    // 重置
+    handleReset () {
+      this.searchForm.beginDate = getDate.getToday().starttime
+      this.searchForm.endDate = getDate.getToday().endtime
+      this.time = [
+        moment(getDate.getToday().starttime, this.dateFormat),
+        moment(getDate.getToday().endtime, this.dateFormat)
+      ]
+      this.searchForm.bundleName = ''
+      this.searchForm.number = ''
+      this.searchForm.queryWord = ''
+      this.searchForm.orderFlag = null
+      this.searchForm.salesChannelSettleStatus = null
+      this.$refs.table.refresh(true)
+    },
+    // 导出
+    handleExport () {
+      const params = {
+        beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
+        endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
+        bundleName: this.searchForm.bundleName,
+        number: this.searchForm.number,
+        queryWord: this.searchForm.queryWord,
+        orderFlag: this.searchForm.orderFlag,
+        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
+      }
+      if (!params.beginDate && !params.endDate) {
+        this.$message.error('请先选择需要导出的下单时间区间再进行导出!')
+        return
+      }
+      // 判断两个时间段是否相差m个月
+      if (!completeDate(params.beginDate, params.endDate, 3)) {
+        this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
+        return
+      }
+      this.loading = true
+      exportBundle(params).then(res => {
+        this.loading = false
+        this.download(res)
+      })
+    },
+    download (data) {
+      if (!data) { return }
+      const url = window.URL.createObjectURL(new Blob([data]))
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = url
+      const a = moment().format('YYYYMMDDhhmmss')
+      const fname = '已购套餐记录-' + a
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+    }
+  }
+}
+</script>
+<style lang="less">
+  .purchasedSetmeal-wrap{
+    .purchasedSetmeal-searchForm {
+    	// 搜索框的下间距
+    	.ant-form-item {
+    		margin-bottom: 10px;
+    	}
+      .handle-btn{
+        margin-top: 4px;
+      }
+      .serach-btn{
+        margin-right: 10px;
+      }
+      .export-btn{
+        background-color: #ff9900;
+        border-color: #ff9900;
+        color: #fff;
+        margin-left: 10px;
+      }
+      .export-btn.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .export-btn.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger){
+        color: #fff;
+        border-color: #ff9900;
+      }
+    }
+    .table-operator{
+      margin: 18px 0 30px;
+    }
+    // 合计
+    .total {
+    	margin: 15px 0 25px;
+    	width: 100%;
+    	background-color: #e6f7ff;
+    	border: 1px solid #91d5ff;
+    	padding: 8px 15px 8px 27px;
+    	border-radius: 4px;
+    	.iconImg {
+    		color: #1890FF;
+    		margin-right: 10px;
+    	}
+    }
+  }
+</style>

+ 248 - 0
src/views/SetmealSales/SetmealDetailModal.vue

@@ -0,0 +1,248 @@
+<template>
+  <div class="DetailsSetmeal">
+    <v-select v-show="false" ref="payType" code="PAY_PROCUCT_TYPE" placeholder="支付方式"></v-select>
+    <a-modal
+      class="DetailsSetmealModal"
+      title="套餐购买详情"
+      width="80%"
+      centered
+      :footer="null"
+      :maskClosable="false"
+      :destroyOnClose="true"
+      @cancel="isShow = false"
+      v-model="isShow"
+    >
+      <a-row :gutter="20" v-if="detailsData">
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">购买日期:</p>
+          <p class="item-main">{{ detailsData.orderDate || '--' }}</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">订单号:</p>
+          <p class="item-main">{{ detailsData.orderBundle.number || '--' }}</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">客户名称:</p>
+          <p class="item-main">{{ detailsData.orderBundle.custName || '--' }}</p>
+        </a-col>
+      </a-row>
+      <a-row :gutter="20" v-if="detailsData">
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">手机号:</p>
+          <p class="item-main">{{ detailsData.orderBundle.custMobile || '--' }}</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">销售合作商:</p>
+          <p class="item-main">{{ detailsData.dataSourceName || '--' }}</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">套餐名称:</p>
+          <p class="item-main">{{ detailsData.orderBundle.bundleName || '--' }}</p>
+        </a-col>
+      </a-row>
+      <a-row :gutter="20" v-if="detailsData">
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">套餐价格:</p>
+          <p class="item-main">{{ detailsData.orderBundle.totalAmount ? detailsData.orderBundle.totalAmount + '元' : '--' }}</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">销售人员:</p>
+          <p class="item-main">{{ detailsData.sellerName || '--' }}</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">收款金额:</p>
+          <p class="item-main">{{ detailsData.orderBundle.payedAmount ? detailsData.orderBundle.payedAmount + '元' : '--' }}</p>
+        </a-col>
+      </a-row>
+      <a-row :gutter="20" v-if="detailsData">
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">支付方式:</p>
+          <p class="item-main">{{ $refs.payType.getNameByCode(detailsData.paymentDetailList[0].payType) }}</p>
+        </a-col>
+      </a-row>
+      <a-tabs type="card">
+        <a-tab-pane key="1" tab="套餐内容">
+          <!-- 套餐内容列表 -->
+          <a-table
+            ref="tcTable"
+            size="middle"
+            :rowKey="record => record.id"
+            :columns="setMealColumns"
+            :dataSource="setMealData"
+            :pagination="false"
+            bordered></a-table>
+        </a-tab-pane>
+        <a-tab-pane key="2" tab="使用记录">
+          <!-- 使用记录列表 -->
+          <a-table
+            ref="recordTable"
+            size="middle"
+            :rowKey="record => record.id"
+            :columns="recordColumns"
+            :dataSource="recordData"
+            :pagination="false"
+            bordered>
+            <!-- 车牌号 -->
+            <span slot="vehicleNum" slot-scope="text, record">{{ record.vehicleNum || '--' }}</span>
+            <!-- 服务门店 -->
+            <span slot="usedStoreName" slot-scope="text, record">{{ record.usedStoreName || '--' }}</span>
+          </a-table>
+        </a-tab-pane>
+      </a-tabs>
+      <div class="btn-cont"><a-button id="detailsSetmealModal-back" @click="isShow = false">返回列表</a-button></div>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { customerBundleDetail, customerBundleUseHistory } from '@/api/customerBundle.js'
+export default {
+  name: 'SetmealDetailModal',
+  components: { STable, VSelect },
+  props: {
+    openModal: {
+      //  弹框是否展示
+      type: Boolean,
+      default: false
+    },
+    setmealId: {
+      //  套餐id
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  弹框是否展示
+      setMealColumns: [
+        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '内容', dataIndex: 'itemName', width: 200, align: 'center' },
+        { title: '剩余数量', dataIndex: 'remainTimes', width: 100, align: 'center' }
+      ],
+      recordColumns: [
+        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '使用时间', dataIndex: 'usedTime', width: 100, align: 'center' },
+        { title: '服务内容', dataIndex: 'bundItemName', width: 100, align: 'center' },
+        { title: '服务门店', scopedSlots: { customRender: 'usedStoreName' }, width: 100, align: 'center' },
+        { title: '核销单号', dataIndex: 'bizNum', width: 100, align: 'center' }
+      ],
+      setMealData: [], //  套餐内容
+      recordData: [], //  使用记录
+      detailsData: null //  套餐数据
+    }
+  },
+  methods: {
+    // 套餐详情
+    getSetmealInfo (id) {
+      //  套餐详情
+      customerBundleDetail({ id: id }).then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          this.detailsData = res.data
+          if (res.data && res.data.customerBundleItemList && res.data.customerBundleItemList.length > 0) {
+            res.data.customerBundleItemList.map((item, index) => {
+              item.no = index + 1
+            })
+            this.setMealData = res.data.customerBundleItemList
+          } else {
+            this.setMealData = []
+          }
+        } else {
+          this.detailsData = null
+          this.setMealData = []
+        }
+      })
+      //  使用记录
+      customerBundleUseHistory({ id: id }).then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          if (res.data && res.data.length > 0) {
+            res.data.map((item, index) => {
+              item.no = index + 1
+            })
+            this.recordData = res.data
+          } else {
+            this.recordData = []
+          }
+        } else {
+          this.recordData = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      }
+    },
+    setmealId (newValue, oldValue) {
+      if (newValue && this.isShow) {
+        this.getSetmealInfo(newValue)
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.DetailsSetmealModal {
+	.ant-modal-body {
+		padding: 24px 40px;
+	}
+	.item-cont {
+		margin-bottom: 15px;
+		display: flex;
+		.item-label {
+			width: 115px;
+			font-size: 14px;
+			color: rgba(0, 0, 0, 0.85);
+			flex-shrink: 0;
+		}
+		.item-main {
+			flex-grow: 1;
+			.wd-icon {
+				display: block;
+			}
+		}
+		.guidance-con {
+			border: 1px dashed #e8e8e8;
+			border-radius: 6px;
+			padding: 20px;
+			img {
+				max-width: 100%;
+			}
+		}
+		.period-price-con {
+			border-bottom: 1px solid #e8e8e8;
+		}
+		.item-period {
+			display: flex;
+			align-items: center;
+			justify-content: space-evenly;
+			flex-grow: 1;
+			border: 1px solid #e8e8e8;
+			border-width: 1px 1px 0;
+			text-align: center;
+			.period,
+			.period-price {
+				padding: 5px 0;
+				border-right: 1px solid #e8e8e8;
+			}
+			.period-price:last-child {
+				border-right: none;
+			}
+		}
+	}
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 119 - 0
src/views/SetmealSales/SetmealItemDetailModal.vue

@@ -0,0 +1,119 @@
+<template>
+  <a-modal
+    class="setmealItemDetailModal"
+    title="查看"
+    width="80%"
+    centered
+    :footer="null"
+    :maskClosable="false"
+    :destroyOnClose="true"
+    @cancel="isShow=false"
+    v-model="isShow">
+    <div class="table-con">
+      <div class="table-main" v-if="bundleItemList">
+        <p class="table-tit">服务:</p>
+        <a-table
+          ref="table-item"
+          size="middle"
+          :rowKey="(record) => record.id"
+          :columns="columns_item"
+          :dataSource="bundleItemList"
+          :pagination="false"
+          bordered>
+          <!-- 服务价格 -->
+          <template slot="itemPrice" slot-scope="text, record">{{ record.itemPrice ? record.itemPrice : 0 }}元</template>
+          <!-- 次数 -->
+          <template slot="itemTimes" slot-scope="text, record">{{ record.times ? record.times : '--' }}</template>
+          <!-- 价值 -->
+          <template slot="worth" slot-scope="text, record">{{ Number(record.itemPrice ? record.itemPrice : 0) * (record.times ? record.times : 0) }}元</template>
+        </a-table>
+      </div>
+      <div class="btn-cont">
+        <a-button id="setmealItemDetail-cancel" class="setmealItemDetail-cancel" @click="isShow=false">返回</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { getBundleDetails } from '@/api/customerBundle.js'
+export default {
+  name: 'SetmealItemDetailModal',
+  components: { STable },
+  props: {
+    openModal: {
+      //  弹框是否展示
+      type: Boolean,
+      default: false
+    },
+    setmealId: {
+      //  套餐id
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  弹框是否展示
+      columns_item: [
+        { title: '服务名称', dataIndex: 'itemName', width: 120, align: 'center' },
+        { title: '服务类别', dataIndex: 'itemClsName', width: 100, align: 'center' },
+        { title: '服务价格', scopedSlots: { customRender: 'itemPrice' }, width: 100, align: 'center' },
+        { title: '次数', scopedSlots: { customRender: 'itemTimes' }, width: 100, align: 'center' },
+        { title: '价值', scopedSlots: { customRender: 'worth' }, width: 100, align: 'center' }
+      ],
+      bundleItemList: []
+    }
+  },
+  methods: {
+    //  套餐信息
+    getSetmealInfo (id) {
+      getBundleDetails({ id: id }).then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          this.bundleItemList = res.data.bundleItemList || []
+        } else {
+          this.bundleItemList = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      }
+    },
+    setmealId (newValue, oldValue) {
+      if (newValue && this.isShow) {
+        this.getSetmealInfo(newValue)
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .setmealItemDetailModal{
+    .table-con{
+      .table-main{
+        .table-tit{
+          margin: 0 0 10px;
+        }
+        margin: 0 0 30px;
+      }
+    }
+    .btn-cont{
+      text-align: center;
+      .setmealPayMoney-cancel{
+        margin-left: 30px;
+      }
+    }
+  }
+</style>

+ 187 - 0
src/views/SetmealSales/SetmealPayMoney.vue

@@ -0,0 +1,187 @@
+<template>
+  <a-modal
+    class="setmealPayMoneyModal"
+    title="套餐收款"
+    width="60%"
+    centered
+    :footer="null"
+    :maskClosable="false"
+    :destroyOnClose="true"
+    @cancel="isShow = false"
+    v-model="isShow">
+    <!-- 表单 -->
+    <a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
+      <a-form-model-item label="手机号" prop="custMobile">
+        <a-input v-model.trim="form.custMobile" @input="mobileInput" :maxLength="11" placeholder="请输入手机号" />
+      </a-form-model-item>
+      <a-form-model-item label="客户姓名" prop="custName"><a-input v-model.trim="form.custName" :maxLength="30" placeholder="请输入客户姓名(最多30个字符)" /></a-form-model-item>
+      <a-form-model-item label="应收金额" class="item-con">
+        <p class="item-main">
+          <span class="item-price" v-if="setmealData">{{ setmealData.price || 0 }}</span>
+          元
+        </p>
+      </a-form-model-item>
+      <a-form-model-item label="收款方式" class="item-con"><p class="item-main">现金</p></a-form-model-item>
+      <a-form-model-item label="" class="btn-cont" :label-col="{ span: 0 }" :wrapper-col="{ span: 24 }">
+        <a-button type="primary" id="setmealPayMoney-submit" @click="onSubmit">确认收款</a-button>
+        <a-button id="setmealPayMoney-cancel" class="setmealPayMoney-cancel" @click="cancel">取消</a-button>
+      </a-form-model-item>
+      <p class="text-center">重要提示:请确认在线下实际收到款后再点击【确认收款】!</p>
+    </a-form-model>
+  </a-modal>
+</template>
+
+<script>
+import { isMobile } from '@/libs/tools'
+import { bundleFindByMobile, bundleBuy } from '@/api/customerBundle.js'
+export default {
+  name: 'SetmealPayMoney',
+  props: {
+    openModal: {
+      //  弹框是否展示
+      type: Boolean,
+      default: false
+    },
+    setmealInfo: {
+      //  套餐信息
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    // 校验手机号
+    const isMobileValid = (rule, value, callback) => {
+      if (!value) {
+        callback(new Error('请输入手机号'))
+      } else {
+        if (!isMobile(value)) {
+          callback(new Error('请输入正确的手机号'))
+        } else {
+          callback()
+        }
+      }
+    }
+    return {
+      isShow: this.openModal, //  弹框是否展示
+      form: {
+        custMobile: '',
+        custName: '',
+        custId: null
+      },
+      rules: {
+        custMobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }, { validator: isMobileValid, trigger: 'blur' }]
+      },
+      setmealData: null //  套餐数据
+    }
+  },
+  methods: {
+    //  手机号输入监听
+    mobileInput () {
+      if (this.form.custMobile.length == 11) {
+        if (isMobile(this.form.custMobile)) {
+          //  校验手机号
+          //  根据手机号去查询是否已绑定车牌
+          bundleFindByMobile({ mobile: this.form.custMobile }).then(res => {
+            if (res.status == 200) {
+              if (res.data) {
+                //  查到客户信息
+                this.form.custId = res.data.id
+              } else {
+                //  未查到客户信息
+                this.form.custId = null
+              }
+            } else {
+              this.form.custId = null
+            }
+          })
+        }
+      }
+    },
+    //  确认收款
+    onSubmit () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = {
+            bundleId: this.setmealData.id,
+            custId: this.form.custId,
+            custName: this.form.custName,
+            custMobile: this.form.custMobile,
+            totalAmount: this.setmealData.price,
+            paymentDetail: { payType: 10001 }
+          }
+          bundleBuy(params).then(res => {
+            if (res.status == 200) {
+              if (this.$hasPermissions('M_bundel_buyRecord')) {
+                this.$router.push({ path: '/SetmealSales/PurchasedSetmeal' })
+              } else {
+                this.cancel()
+              }
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  取消收款
+    cancel () {
+      this.resetForm() //  重置表单数据
+      this.isShow = false
+    },
+    // 重置表单
+    resetForm () {
+      this.form.custMobile = ''
+      this.form.custName = ''
+      this.form.custId = null
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      } else {
+        this.resetForm() //  重置表单数据
+      }
+    },
+    setmealInfo (newValue, oldValue) {
+      if (newValue && this.isShow) {
+        this.setmealData = newValue
+      } else {
+        this.setmealData = null
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.setmealPayMoneyModal {
+  .item-con {
+    .item-main {
+      margin: 0;
+      .item-price {
+        font-size: 24px;
+        color: red;
+        margin-right: 5px;
+      }
+    }
+  }
+  .btn-cont {
+    text-align: center;
+    .setmealPayMoney-cancel {
+      margin-left: 30px;
+    }
+  }
+  .text-center {
+    text-align: center;
+  }
+}
+</style>

+ 310 - 0
src/views/SetmealSales/VerificationRecords.vue

@@ -0,0 +1,310 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 搜索条件 -->
+    <div class="orderCenter-searchForm">
+      <a-form ref="searchForm" @keyup.enter.native="handleSearch">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="核销时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-range-picker
+                v-model="time"
+                id="VerificationRecords-time"
+                :format="dateFormat"
+                :placeholder="['开始时间','结束时间']"
+                :disabledDate="disabledDate"
+                @change="onChange" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="核销门店" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-select placeholder="请选择" allowClear v-model="searchForm.usedStoreId" id="VerificationRecords-usedStoreId">
+                <a-select-option v-for="item in storeOptionData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="客户信息" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-input v-model.trim="searchForm.queryWord" placeholder="请输入手机号" allowClear id="VerificationRecords-queryWord"/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="套餐名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-input v-model.trim="searchForm.bundName" placeholder="请输入" allowClear id="VerificationRecords-bundName"/>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="关联订单号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-input v-model.trim="searchForm.orderNo" placeholder="请输入" allowClear id="VerificationRecords-orderNo"/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="18">
+            <a-button style="margin-right: 10px;" type="primary" @click="handleSearch" id="VerificationRecords-handleSearch">查询</a-button>
+            <a-button type="" @click="handleRest" id="VerificationRecords-handleRest">重置</a-button>
+            <a-button type="" :loading="loading" class="export-btn" @click="handleExport" id="VerificationRecords-handleExport">导出</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div class="ftext" slot="message">总计:<span>{{ orderTotal || 0 }}</span>单,结算金额:<span>¥{{ paymentAmountTotal || 0 }}</span>元</div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 订单编号 -->
+      <template slot="num" slot-scope="text, record">
+        <p>{{ record.bizNum }}</p>
+        <p>{{ record.orderNo }}</p>
+      </template>
+      <!-- 客户信息 -->
+      <template slot="userInfo" slot-scope="text, record">
+        <!-- <p>{{ text }}<br>{{ record.vehicleNumber ? record.vehicleNumber : '--' }}</p> -->
+        <div>
+          <span v-if="record.custMobile">{{ record.custMobile }}</span>
+          <span v-if="record.vehicleNum">{{ record.vehicleNum }}</span>
+        </div>
+        <span v-if="!record.custMobile && !record.vehicleNum">--</span>
+      </template>
+    </s-table>
+  </a-card>
+</template>
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import getDate from '@/libs/getDate.js'
+import { completeDate } from '@/libs/tools.js'
+import {
+  getVerificationRecordsList, getVerificationRecordsListTotal, settlementRecordsExport, getStoreList
+} from '@/api/SetmealSales.js'
+import moment from 'moment'
+export default {
+  name: 'OrderCenter',
+  components: {
+    STable,
+    VSelect
+  },
+  data () {
+    return {
+      // 查询参数
+      searchForm: {
+        beginDate: null, // 创建的开始时间
+        endDate: null, // 创建的结束时间
+        usedStoreId: undefined, // 核销门店
+        orderNo: '', // 单号
+        queryWord: '', // 客户信息
+        bundName: '' // 套餐名称
+      },
+      loading: false, // 导出loading
+      orderTotal: '', // 合计开单数量
+      paymentAmountTotal: '', // 合计实收金额
+      storeOptionData: [], // 门店数据
+      // 将默认当天时间日期回显在时间选择框中
+      time: [
+        moment(getDate.getToday().starttime, this.dateFormat),
+        moment(getDate.getToday().endtime, this.dateFormat)
+      ],
+      dateFormat: 'YYYY-MM-DD',
+      nowBeginDate: '',
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '核销时间',
+        dataIndex: 'usedTime',
+        width: 100,
+        align: 'center'
+      },
+      {
+        title: '核销单号/关联订单号',
+        scopedSlots: { customRender: 'num' },
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '核销服务名称',
+        dataIndex: 'bundItemName',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '客户信息',
+        scopedSlots: { customRender: 'userInfo' },
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '套餐名称',
+        dataIndex: 'bundName',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '结算金额(¥)',
+        dataIndex: 'salesChannelSettleAmount',
+        width: 100,
+        align: 'center',
+        customRender: function (text) {
+		  return (text || 0) + '元'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+		  const _this = this
+        _this.searchForm.beginDate == null ? this.searchForm.beginDate = getDate.getToday().starttime : null
+        _this.searchForm.endDate == null ? this.searchForm.endDate = getDate.getToday().endtime : null
+        return getVerificationRecordsList(Object.assign(parameter, _this.searchForm)).then(res => {
+          if (res.status == 200) {
+            _this.orderTotal = res.data.count
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+            }
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  methods: {
+    moment,
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    // 创建时间change
+    onChange (dates, dateStrings) {
+      if ((dates, dateStrings)) {
+        this.searchForm.beginDate = dateStrings[0]
+        this.searchForm.endDate = dateStrings[1]
+      }
+    },
+    // 获取门店数据
+    getStoreListData () {
+      getStoreList({
+        pageNo: 1,
+        pageSize: 1000
+      }).then(res => {
+        if (res.status == 200) {
+          this.storeOptionData = res.data.list || []
+        }
+      })
+    },
+    // 合计
+    getTotal () {
+      const params = {
+        beginDate: this.searchForm.beginDate,
+        endDate: this.searchForm.endDate,
+        usedStoreId: this.searchForm.usedStoreId,
+        orderNo: this.searchForm.orderNo,
+        queryWord: this.searchForm.queryWord,
+        bundName: this.searchForm.bundName
+      }
+      params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
+      params.endDate == null ? params.endDate = getDate.getToday().endtime : null
+      getVerificationRecordsListTotal(params).then(res => {
+        console.log(res, '--------')
+        if (res.status == 200) {
+          this.paymentAmountTotal = res.data || 0
+        }
+      })
+    },
+    // 查询
+    handleSearch () {
+      this.$refs.table.refresh(true)
+      this.getTotal()
+    },
+    // 重置
+    handleRest () {
+      this.nowBeginDate = getDate.getToday().starttime
+      this.searchForm.beginDate = getDate.getToday().starttime
+      this.searchForm.endDate = getDate.getToday().endtime
+      this.time = [
+        moment(getDate.getToday().starttime, this.dateFormat),
+        moment(getDate.getToday().endtime, this.dateFormat)
+      ]
+      this.searchForm.usedStoreId = undefined
+      this.searchForm.orderNo = ''
+      this.$refs.table.refresh()
+      this.getTotal()
+    },
+    // 导出
+    handleExport () {
+      const params = {
+        beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
+        endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
+        usedStoreId: this.searchForm.usedStoreId,
+        orderNo: this.searchForm.orderNo,
+        queryWord: this.searchForm.queryWord,
+        bundName: this.searchForm.bundName
+      }
+	  if (!params.beginDate && !params.endDate) {
+		 this.$message.error('请先选择需要导出的核销时间段再进行导出!')
+		  return
+	  }
+      if (!completeDate(params.beginDate, params.endDate, 3)) {
+        this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
+        return
+      }
+	  this.loading = true
+      settlementRecordsExport(params).then(res => {
+        this.loading = false
+        this.download(res)
+      })
+    },
+    download (data) {
+      if (!data) { return }
+      const url = window.URL.createObjectURL(new Blob([data]))
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = url
+      const a = moment().format('YYYYMMDDhhmmss')
+      const fname = '核销记录-' + a
+      console.log(fname, '111111')
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.handleRest()
+      vm.getStoreListData()
+    })
+  }
+}
+</script>
+<style lang="less">
+	.orderCenter-searchForm {
+
+		// 搜索框的下间距
+		.ant-form-item {
+			margin-bottom: 10px;
+		}
+	}
+  .export-btn{
+    background-color: #ff9900;
+    border-color: #ff9900;
+    color: #fff;
+    margin-left: 10px;
+  }
+	// 合计
+	.ftext span {
+		color: #fa8c16;
+		font-weight: bold;
+	}
+</style>

+ 0 - 403
src/views/SetmealSales/WriteOffRecords.vue

@@ -1,403 +0,0 @@
-<template>
-  <a-card :bordered="false">
-    <!-- 搜索条件 -->
-    <div class="orderCenter-searchForm">
-      <a-form ref="searchForm">
-        <a-row :gutter="48">
-          <a-col :span="6">
-            <a-form-item label="下单时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-range-picker v-model="time" :format="dateFormat" :placeholder="['开始时间','结束时间']" @change="onChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="网点名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-select placeholder="请选择" allowClear v-model="storeId" mode="multiple">
-                <a-select-option v-for="item in storeOptionData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="单号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input v-model.trim="searchForm.orderNo" placeholder="请输入" allowClear />
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="服务项目" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-select placeholder="请选择" allowClear v-model="searchForm.itemId">
-                <a-select-option v-for="item in itemOptionData" :key="item.id" :value="item.id">{{ item.itemName }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="48">
-          <a-col :span="6">
-            <a-form-item label="手机号码" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input v-model.trim="searchForm.customerMobile" placeholder="请输入" allowClear :maxLength="11" />
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <v-select v-model="searchForm.orderStatus" ref="orderStatus" code="ORDER_STATUS" placeholder="请选择" allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-button style="margin-right: 10px;" type="primary" @click="handleSearch">查询</a-button>
-            <a-button type="" @click="handleRest">重置</a-button>
-            <a-button type="" :loading="loading" class="export-btn" @click="handleExport">导出</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 合计 -->
-    <div class="total">
-      <a-icon type="info-circle" class="iconImg" />
-      <strong>合计:</strong><span v-model="orderTotal">{{ orderTotal || 0 }} 单</span><strong style="margin-left: 15px;">实收:</strong><span
-        v-model="paymentAmountTotal">{{ paymentAmountTotal || 0 }} 元</span>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      bordered>
-      <!-- 状态 -->
-      <span slot="orderStatus" slot-scope="text">
-        {{ $refs.orderStatus.getNameByCode(text) }}
-      </span>
-      <!-- 实收金额 -->
-      <span slot="paymentAmount" slot-scope="text, record">
-        <template v-if=" record.payStatus == 'PAID' ">{{ record.paymentAmount }}</template>
-        <template v-else-if=" record.payStatus != 'PAID' ">{{ 0 }}</template>
-      </span>
-      <!-- 优惠 -->
-      <span slot="couponAmount" slot-scope="text, record">
-        <template v-if=" record.orderStatus != 'CANCELED' ">{{ record.couponAmount }}</template>
-        <template v-else-if=" record.orderStatus == 'CANCELED' ">{{ 0 }}</template>
-      </span>
-      <!-- 操作 -->
-      <span slot="action" slot-scope="text, record">
-        <a-button type="primary" @click="seeDetail(record)">查看</a-button>
-        <!-- 本期暂不做 -->
-        <!-- <a-button type="danger" @click="refund(record)">退款</a-button> -->
-      </span>
-    </s-table>
-    <!-- 查看详情弹窗 -->
-    <order-detail-modal :openModal="openDetailModal" :nowId="detailId" @close="openDetailModal=false" />
-  </a-card>
-</template>
-
-<script>
-import {
-  STable,
-  VSelect
-} from '@/components'
-import getDate from '@/libs/getDate.js'
-import {
-  orderCenterList,
-  itemList,
-  storeList,
-  orderTotal,
-  exportOrder
-} from '@/api/order.js'
-import OrderDetailModal from './OrderDetailModal.vue'
-import moment from 'moment'
-export default {
-  name: 'OrderCenter',
-  components: {
-    STable,
-    VSelect,
-    OrderDetailModal
-  },
-  data () {
-    return {
-      storeId: [], // 网点名称
-      // 查询参数
-      searchForm: {
-        beginDate: null, // 创建的开始时间
-        endDate: null, // 创建的结束时间
-        storeIdList: [], // 网点名称
-        orderNo: '', // 单号
-        itemId: undefined, // 服务项目
-        customerMobile: '', // 手机号码
-        orderStatus: '' // 状态
-      },
-      loading: false, // 导出loading
-      orderTotal: '', // 合计开单数量
-      paymentAmountTotal: '', // 合计实收金额
-      itemOptionData: [], // 服务项目数据
-      storeOptionData: [], // 网点名称数据
-      openDetailModal: false, // 查看详情弹窗 默认关闭
-      detailId: null, // 初始化id
-      // 将默认当天时间日期回显在时间选择框中
-      time: [
-        moment(getDate.getToday().starttime, this.dateFormat),
-        moment(getDate.getToday().endtime, this.dateFormat)
-      ],
-      dateFormat: 'YYYY-MM-DD',
-      columns: [{
-        title: '下单时间',
-        dataIndex: 'orderTime',
-        minWidth: '40',
-        align: 'center'
-      },
-      {
-        title: '单号',
-        dataIndex: 'orderNo',
-        minWidth: '40',
-        align: 'center'
-      },
-      {
-        title: '网点名称',
-        dataIndex: 'storeName',
-        minWidth: '40',
-        align: 'center'
-      },
-      {
-        title: '服务项目',
-        dataIndex: 'itemName',
-        minWidth: '40',
-        align: 'center'
-      },
-      {
-        title: '手机号码',
-        dataIndex: 'customerMobile',
-        minWidth: '40',
-        align: 'center'
-      },
-      {
-        title: '应收(¥)',
-        dataIndex: 'payableAmount',
-        minWidth: '40',
-        align: 'center'
-      },
-      {
-        title: '优惠(¥)',
-        dataIndex: 'couponAmount',
-        minWidth: '40',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'couponAmount'
-        }
-      },
-      {
-        title: '实收(¥)',
-        dataIndex: 'paymentAmount',
-        minWidth: '40',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'paymentAmount'
-        }
-
-      },
-      {
-        title: '状态',
-        dataIndex: 'orderStatus',
-        minWidth: '40',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'orderStatus'
-        }
-      },
-      {
-        title: '操作',
-        dataIndex: 'action',
-        minWidth: '40',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'action'
-        }
-
-      }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        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
-        return orderCenterList(Object.assign(parameter, this.searchForm)).then(res => {
-          // console.log(res,'0000000000000000000')
-          if (res.status == 200) {
-            return res.data
-            this.getTotal()
-          }
-        })
-      }
-    }
-  },
-  methods: {
-    moment,
-    // 创建时间change
-    onChange (dates, dateStrings) {
-      if ((dates, dateStrings)) {
-        this.searchForm.beginDate = dateStrings[0]
-        this.searchForm.endDate = dateStrings[1]
-      }
-      console.log(this.searchForm.beginDate, this.searchForm.endDate)
-    },
-    // 获取服务项目数据
-    getItemListData () {
-      itemList({
-        pageNo: 1,
-        pageSize: 1000
-      }).then(res => {
-        // console.log(res, '-----------')
-        if (res.status == 200) {
-          this.itemOptionData = res.data.list || []
-        } else {
-          this.itemOptionData = []
-        }
-      })
-    },
-    // 获取网点名称数据
-    getStoreListData () {
-      storeList({
-        pageNo: 1,
-        pageSize: 1000
-      }).then(res => {
-        // console.log(res, '-----------')
-        if (res.status == 200) {
-          this.storeOptionData = res.data.list || []
-        } else {
-          this.storeOptionData = []
-        }
-      })
-    },
-    // 合计
-    getTotal () {
-      const params = {
-        beginDate: this.searchForm.beginDate,
-        endDate: this.searchForm.endDate,
-        storeIdList: this.searchForm.storeIdList,
-        orderNo: this.searchForm.orderNo,
-        itemId: this.searchForm.itemId,
-        customerMobile: this.searchForm.customerMobile,
-        orderStatus: this.searchForm.orderStatus
-      }
-      params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
-      params.endDate == null ? params.endDate = getDate.getToday().endtime : null
-      params.storeIdList = this.storeId
-      orderTotal(params).then(res => {
-        console.log(res, '--------')
-        if (res.status == 200) {
-          this.orderTotal = res.data.orderNum || 0
-          this.paymentAmountTotal = res.data.paymentAmount || 0
-        }
-      })
-    },
-    // 查看详情--跳转到对应的详情页
-    seeDetail (record) {
-      // 将当前行的id传递给详情页
-      this.openDetailModal = true
-      this.detailId = record.id
-    },
-    // 退款---暂不做
-    // refund(row) {
-    //   const _this = this
-    //   this.$confirm({
-    //     title: '警告',
-    //     content: '确认退款后 款项将通过原渠道退回 且不可撤回,确认退款?',
-    //     okText: '确定',
-    //     cancelText: '取消',
-    //     // onOk() {
-    //
-    //     // }
-    //   })
-    // },
-    // 查询
-    handleSearch () {
-      this.$refs.table.refresh()
-      this.getTotal()
-    },
-    // 重置
-    handleRest () {
-      this.searchForm.beginDate = getDate.getToday().starttime
-      this.searchForm.endDate = getDate.getToday().endtime
-      this.time = [
-        moment(getDate.getToday().starttime, this.dateFormat),
-        moment(getDate.getToday().endtime, this.dateFormat)
-      ]
-      this.storeId = []
-      this.searchForm.orderNo = ''
-      this.searchForm.itemId = undefined
-      this.searchForm.customerMobile = ''
-      this.searchForm.orderStatus = ''
-      // this.$refs.searchForm.resetFields()
-      this.$refs.table.refresh()
-      this.getTotal()
-    },
-    // 导出
-    handleExport () {
-      this.loading = true
-      const params = {
-        beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
-        endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
-        storeIdList: this.storeId,
-        orderNo: this.searchForm.orderNo,
-        itemId: this.searchForm.itemId,
-        customerMobile: this.searchForm.customerMobile,
-        orderStatus: this.searchForm.orderStatus
-      }
-      exportOrder(params).then(res => {
-        console.log(res)
-        this.loading = false
-        this.download(res)
-      })
-    },
-    download (data) {
-      if (!data) {
-        return
-      }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDhhmmss')
-      const fname = '订单记录-' + a
-      console.log(fname, '111111')
-      link.setAttribute('download', fname + '.xlsx')
-
-      document.body.appendChild(link)
-      link.click()
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getItemListData()
-      vm.handleRest()
-      vm.getStoreListData()
-    })
-  }
-}
-</script>
-<style lang="less">
-	.orderCenter-searchForm {
-
-		// 搜索框的下间距
-		.ant-form-item {
-			margin-bottom: 10px;
-		}
-	}
-  .export-btn{
-    background-color: #ff9900;
-    border-color: #ff9900;
-    color: #fff;
-    margin-left: 10px;
-  }
-	// 合计
-	.total {
-		margin: 15px 0 25px;
-		width: 100%;
-		background-color: #e6f7ff;
-		border: 1px solid #91d5ff;
-		padding: 8px 15px 8px 27px;
-		border-radius: 4px;
-
-		.iconImg {
-			color: #1890FF;
-			margin-right: 10px;
-		}
-	}
-</style>

+ 0 - 315
src/views/power/dataDictionary/codeItemModal.vue

@@ -1,315 +0,0 @@
-<template>
-  <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
-      <a-form :form="form" @submit="handleSubmit">
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <!-- code -->
-            <a-form-item label="字典码" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
-              <a-input
-                disabled
-                placeholder=""
-                v-decorator="['formData.lookupCode', {
-                  initialValue: formData.lookupCode,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
-
-        <a-row :gutter="24">
-          <a-col :span="12" style="padding-right: 0px;">
-            <!-- 名称 -->
-            <a-form-item label="名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder="请输入名称"
-                v-decorator="['formData.dispName', {
-                  initialValue: formData.dispName,
-                  rules: [{ required: true, message: '请输入名称!' }] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <!-- 项编码 -->
-            <a-form-item label="项编码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder="请输入项编码"
-                v-decorator="['formData.code', {
-                  initialValue: formData.code,
-                  rules: [{ required: true, message: '请输入项编码!' }] }]"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12" style="padding-right: 0px;">
-            <a-form-item label="启用" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-radio-group
-                name="radioGroup"
-                v-decorator="[
-                  'formData.isEnable',
-                  {
-                    initialValue: formData.isEnable,
-                    rules: [] },
-                ]"
-              >
-                <a-radio :value="1">是</a-radio>
-                <a-radio :value="0">否</a-radio>
-              </a-radio-group>
-            </a-form-item>
-          </a-col>
-          <!-- 排序值 -->
-          <a-col :span="12">
-            <a-form-item label="排序值" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                type="number"
-                placeholder="请输入排序值"
-                v-decorator="['formData.sort', {
-                  initialValue: formData.sort,
-                  rules: [{ required: true, message: '请输入排序值!' }] }]"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <!-- 扩展参数 -->
-        <a-row :gutter="24">
-          <a-col :span="12" style="padding-right: 0px;">
-            <!-- 扩展一 -->
-            <a-form-item label="扩展一" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr1', {
-                  initialValue: formData.attr1,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <!-- 扩展二 -->
-            <a-form-item label="扩展二" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr2', {
-                  initialValue: formData.attr2,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12" style="padding-right: 0px;">
-            <!-- 扩展三 -->
-            <a-form-item label="扩展三" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr3', {
-                  initialValue: formData.attr3,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <!-- 扩展四 -->
-            <a-form-item label="扩展四" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr4', {
-                  initialValue: formData.attr4,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12" style="padding-right: 0px;">
-            <!-- 扩展五 -->
-            <a-form-item label="扩展五" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr5', {
-                  initialValue: formData.attr5,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <!-- 扩展六 -->
-            <a-form-item label="扩展六" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr6', {
-                  initialValue: formData.attr6,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
-
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
-              <a-textarea
-                v-decorator="[
-                  'formData.remarks',
-                  {
-                    initialValue: formData.remarks,
-                    rules: [] },
-                ]"
-                style="min-height: 50px;"
-                placeholder=""
-                autosize />
-            </a-form-item>
-          </a-col>
-        </a-row>
-
-        <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 { saveLookUpItem } from '@/api/lookup.js'
-export default {
-  name: 'CodeItemModal',
-  components: {
-    STable, VSelect
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    data: {
-      type: Object,
-      default: function () {
-        return {}
-      }
-    }
-  },
-  data () {
-    return {
-      titleText: '添加字典项',
-      isshow: this.visible,
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this, { name: 'miniForm' }),
-      roleList: [],
-      formData: {
-        lookupCode: '',
-        code: '', // code
-        dispName: '',
-        isEnable: 1, // 活动状态
-        sort: '',
-        attr1: '',
-        attr2: '',
-        attr3: '',
-        attr4: '',
-        attr5: '',
-        attr6: '',
-        remarks: ''
-      }
-
-    }
-  },
-  methods: {
-    cancel (e) {
-      this.clear()
-      this.$emit('close')
-    },
-
-    // 保存提交
-    handleSubmit () {
-      const _this = this
-      this.form.validateFields((err, values) => {
-        console.log(values, 'values222')
-        if (!err) {
-          saveLookUpItem(Object.assign(this.formData, values.formData)).then(res => {
-            console.log(res, 'res--save')
-            if (res.status + '' === '200') {
-              this.$message.success(res.message)
-              this.$emit('refresh')
-              setTimeout(function () {
-                _this.cancel()
-              }, 300)
-            } else {
-              this.$message.error(res.message)
-            }
-          })
-        }
-      })
-    },
-    // 取消
-    handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
-    },
-    clear () {
-      this.form.resetFields()
-      delete this.formData.id
-      this.formData.lookupCode = ''
-      this.formData.code = ''
-      this.formData.dispName = ''
-      this.formData.isEnable = 1
-      this.formData.sort = ''
-      this.formData.attr1 = ''
-      this.formData.attr2 = ''
-      this.formData.attr3 = ''
-      this.formData.attr4 = ''
-      this.formData.attr5 = ''
-      this.formData.attr6 = ''
-      this.formData.remarks = ''
-    }
-
-  },
-  mounted () {
-  },
-  beforeCreate () {
-    this.form = this.$form.createForm(this, { name: 'miniForm' })
-  },
-  watch: {
-    visible (newValue, oldValue) {
-      this.isshow = newValue
-    },
-    isshow (newValue, oldValue) {
-      if (newValue) {
-        if (this.data.id) { // 编辑
-          this.titleText = '编辑字典项'
-          this.formData = Object.assign({}, this.data)
-
-          delete this.formData.no
-          this.formData.isEnable = Number(this.formData.isEnable)
-          console.log(this.formData, 'this.formData')
-        } else {
-          this.formData.lookupCode = this.data.lookupCode
-          this.titleText = '添加字典项'
-        }
-      } else {
-        this.cancel()
-      }
-    }
-  }
-}
-</script>
-
-<style >
-  .modalBox{
-    width: 650px !important;
-  }
-  .ant-modal-footer {
-    display: none;
-  }
-</style>

+ 0 - 199
src/views/power/dataDictionary/codeModal.vue

@@ -1,199 +0,0 @@
-<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 }">
-          <a-input
-            placeholder="请输入类别编码"
-            :disabled="true"
-            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.name', {
-              initialValue: formData.name,
-              rules: [{ required: true, message: '请输入名称!' }] }]"
-          />
-        </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: [{ required: true, message: '请输入排序值!' }] }]"
-          />
-        </a-form-item>
-        <!-- 状态 -->
-        <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-          <a-radio-group
-            name="radioGroup"
-            v-decorator="[
-              'formData.isEnable',
-              {
-                initialValue: formData.isEnable,
-                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-textarea
-            v-decorator="[
-              'formData.remarks',
-              { initialValue: formData.remarks,
-                rules: [] },
-            ]"
-            style="min-height: 60px;"
-            placeholder=""
-            autosize />
-        </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 { saveLookUp } from '@/api/lookup.js'
-export default {
-  name: 'CodeModal',
-  components: {
-    STable, VSelect
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    data: {
-      type: Object,
-      default: function () {
-        return {}
-      }
-    }
-  },
-  data () {
-    return {
-      titleText: '添加字典',
-      isshow: this.visible,
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this, { name: 'miniForm' }),
-      formData: {
-        name: '',
-        code: '',
-        sort: '',
-        isEnable: '', // 活动状态
-        remarks: ''
-      }
-
-    }
-  },
-  methods: {
-    cancel (e) {
-      this.clear()
-      this.$emit('close')
-    },
-
-    // 保存提交
-    handleSubmit () {
-      const _this = this
-      this.form.validateFields((err, values) => {
-        if (!err) {
-          saveLookUp(Object.assign(this.formData, values.formData)).then(res => {
-            if (res.status + '' === '200') {
-              this.$message.success(res.message ? res.message : '保存成功')
-              this.$emit('refresh')
-              setTimeout(function () {
-                _this.cancel()
-              }, 300)
-            } else {
-              this.$message.error(res.message)
-            }
-          })
-        }
-      })
-    },
-    // 取消
-    handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
-    },
-    clear () {
-      this.form.resetFields()
-      delete this.formData.id
-      this.formData.name = ''
-      this.formData.code = ''
-      this.formData.sort = ''
-      this.formData.isEnable = ''
-      this.formData.remarks = ''
-    }
-
-  },
-  mounted () {
-  },
-  beforeCreate () {
-    this.form = this.$form.createForm(this, { name: 'miniForm' })
-  },
-  watch: {
-    visible (newValue, oldValue) {
-      this.isshow = newValue
-    },
-    isshow (newValue, oldValue) {
-      if (newValue) {
-        if (this.data.id) { // 编辑
-          this.formData.titleText = '编辑字典'
-          this.formData = Object.assign({}, this.data)
-
-          delete this.formData.no
-          this.formData.isEnable = Number(this.formData.isEnable)
-          console.log(this.formData, 'this.formData')
-        } else {
-          this.formData.titleText = '添加字典'
-        }
-      } else {
-        this.cancel()
-      }
-    }
-  }
-}
-</script>
-
-<style >
-  .modalBox{
-  }
-  .ant-modal-footer {
-    display: none;
-  }
-</style>

+ 0 - 398
src/views/power/dataDictionary/dataDictionary.vue

@@ -1,398 +0,0 @@
-<template>
-  <a-card :bordered="false">
-    <a-row :gutter="24">
-      <!-- 左侧字典列表 -->
-      <a-col :span="6">
-        <a-row :gutter="24">
-          <!-- <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addCode">添加字典</a-button> -->
-          <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="editCode">编辑字典</a-button>
-          <!-- <a-select style="width: 110px" placeholder="更多操作" allowClear >
-               <a-select-option @click="editCode" value="编辑字典">编辑字典</a-select-option>
-               <a-select-option @click="delectCode" value="删除字典">删除字典</a-select-option>
-             </a-select> -->
-        </a-row>
-        <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="selectedKey.length" class="imgSize" @click="cancelSel">取消选择</span></span>
-        </a-row>
-        <a-row :gutter="24" >
-          <a-input-search v-model="code" placeholder="输入编码类别/名称 搜索字典" style="width: 100%" @search="getCodeList" />
-        </a-row>
-        <a-row :gutter="24" >
-          <a-menu class="menu-box" style="border-right: 0;max-height: 650px;overflow: auto;" v-model="selectedKey" >
-            <a-menu-item style="margin-bottom: 0px;height: 30px; line-height: 30px;" v-for="(item,index) in codeList" :key="index" :value="item">{{ item.name }}</a-menu-item>
-          </a-menu>
-          <span v-if="noData" style="line-height: 50px; font-weight: 600;">暂无数据</span>
-        </a-row>
-      </a-col>
-      <!-- 右侧数据列表 -->
-      <a-col :span="18" >
-        <div style="padding-left: 20px;">
-          <div class="table-page-search-wrapper">
-            <a-form layout="inline">
-              <a-row :gutter="48">
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="数据名称">
-                    <a-input allowClear v-model="queryParam.dispName" placeholder="请输入数据名称"/>
-                  </a-form-item>
-                </a-col>
-
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="状态">
-                    <a-select
-                      allowClear
-                      v-model="queryParam.isEnable"
-                      placeholder="请选择"
-                    >
-                      <a-select-option :value="1">
-                        是
-                      </a-select-option>
-                      <a-select-option :value="0">
-                        否
-                      </a-select-option>
-                    </a-select>
-                    <!-- <v-select code="FLAG" v-model="queryParam.enableFlag" allowClear placeholder="是否启用"></v-select> -->
-                  </a-form-item>
-                </a-col>
-                <a-col :md="2" :sm="24">
-                  <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-                </a-col>
-                <!-- <a-col :md="2" :sm="24">
-                  <a-button type="primary" @click="queryParam=''">重置</a-button>
-                </a-col> -->
-              </a-row>
-            </a-form>
-          </div>
-          <!-- <a-divider/> -->
-          <div class="table-operator">
-            <a-button type="primary" icon="plus" @click="openCodeItemModal">添加数据</a-button>
-            <!-- <a-button type="" icon="delete" @click="delectAll">批量删除</a-button> -->
-            <a-button type="" icon="reload" @click="$refs.table.refresh(true)">刷新数据</a-button>
-          </div>
-          <!-- <div  class="textCount">
-            <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
-            <span>已选择<span style="color: #40a9ff;font-weight: 600;margin-left: 10px;">{{selectedNum}}项</span><span class="imgSize">清空</span></span>
-          </div> -->
-          <s-table
-            ref="table"
-            size="default"
-            rowKey="id"
-            :columns="columns"
-            :data="loadData"
-            bordered
-          >
-            <span slot="action" slot-scope="text, record">
-              <template>
-                <a class="action-button" @click="handleEdit(record)">修改</a>
-                <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
-              </template>
-            </span>
-          </s-table>
-        </div>
-
-      </a-col>
-    </a-row>
-    <codeModal :visible="showCodeModal" :data="codeData" @refresh="getCodeList" @close="showCodeModal = false"></codeModal>
-    <codeItemModal :visible="showItemCodeModal" :data="itemCodeData" @refresh="$refs.table.refresh(true)" @close="showItemCodeModal = false"></codeItemModal>
-  </a-card>
-</template>
-
-<script>
-import { STable, VSelect } from '@/components'
-import codeModal from './codeModal.vue'
-import codeItemModal from './codeItemModal.vue'
-import { listLookUp, delLookUp, getLookUpItem, delLookUpItem } from '@/api/lookup.js'
-export default {
-  name: 'DataDictionary',
-  components: {
-    STable, VSelect, codeModal, codeItemModal
-  },
-  props: {},
-  data () {
-    // const rowSelection = {
-    //    onChange: (selectedRowKeys, selectedRows) => {
-    //      console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
-    //    },
-    //    onSelect: (record, selected, selectedRows) => {
-    //      this.selectedNum = selectedRows.length
-    //      console.log(record,'record')
-    //      console.log(selectedRows,'selectedRows')
-    //    },
-    //    onSelectAll: (selected, selectedRows, changeRows) => {
-    //      this.selectedNum = selectedRows.length
-    //      console.log(selected, selectedRows, changeRows)
-    //    }
-    //  }
-    return {
-      // 查询参数
-      queryParam: {
-        dispName: '',
-        isEnable: undefined,
-        lookupCode: ''
-      },
-      noData: false,
-      code: '', // 根据输入编码类别/名称搜索字典
-      selectedNum: '',
-      selectedKey: [], // 选中的字典编码项
-      selectedMenu: '',
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this, { name: 'miniForm' }),
-      codeList: [],
-      showCodeModal: false,
-      showItemCodeModal: false,
-      codeData: {}, // 编辑字典行数据
-      itemCodeData: {},
-      // 表头
-      columns: [
-        {
-          title: '序号',
-          dataIndex: 'no',
-          width: '40',
-          align: 'center'
-        },
-        {
-          title: '名称',
-          dataIndex: 'dispName',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '项编码',
-          dataIndex: 'code',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '排序值',
-          dataIndex: 'sort',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '是否启用',
-          width: '100',
-          align: 'center',
-          dataIndex: 'isEnable',
-          customRender: function (text) {
-            if (text == 1) {
-              return '启用'
-            } else {
-              return '禁用'
-            }
-          }
-        },
-        {
-          title: '创建时间',
-          dataIndex: 'createDate',
-          width: '120',
-          align: 'center'
-        },
-        {
-          title: '备注',
-          dataIndex: 'remarks',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '操作',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'action' }
-        }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        return getLookUpItem(Object.assign(parameter, this.queryParam)).then(res => {
-          const no = (res.data.pageNo - 1) * res.data.pageSize
-          for (let i = 0; i < res.data.list.length; i++) {
-            const _item = res.data.list[i]
-            _item.no = no + i + 1
-            _item.isEnable = _item.isEnable + '' === '1'
-          }
-          return res.data
-        })
-      },
-      optionAlertShow: false
-    }
-  },
-  methods: {
-    // 获取字典列表
-    getCodeList () {
-      listLookUp({ code: this.code }).then(res => {
-        if (res.status == 200) {
-          this.codeList = res.data
-          this.noData = false
-          if (!res.data.length) {
-            this.noData = true
-          }
-        }
-      })
-    },
-    // 添加字典
-    addCode () {
-      this.showCodeModal = true
-      this.codeData = {}
-    },
-    // 编辑字典
-    editCode () {
-      if (!this.selectedKey.length) {
-        return this.$message.warning('您还未选择要编辑的字典')
-      }
-      this.showCodeModal = true
-      this.codeData = this.codeList[this.selectedKey]
-    },
-    // 删除字典
-    delectCode () {
-      if (!this.selectedKey.length) {
-        return this.$message.warning('您还未选择要删除的字典')
-      }
-      const _this = this
-      const id = this.codeList[this.selectedKey].id
-      this.$confirm({
-        title: '警告',
-        content: `确定要删除 ${this.codeList[this.selectedKey].name} 吗?`,
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          delLookUp({
-            id: id
-          }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success('删除成功')
-              _this.getCodeList()
-            } else {
-              _this.$message.error(res.message)
-            }
-          }).catch(() => {
-            _this.$message.success('删除失败, 请稍后重试')
-          })
-        }
-      })
-    },
-    // 字典 取消选择
-    cancelSel () {
-      this.selectedKey = []
-      this.selectedMenu = ''
-    },
-    // 新增数据
-    openCodeItemModal () {
-      if (!this.selectedKey.length) {
-        return this.$message.warning('请先选择一个字典类别')
-      }
-      this.showItemCodeModal = true
-      this.itemCodeData = { lookupCode: this.codeList[this.selectedKey].code }
-    },
-    // 批量删除数据
-    delectAll () {
-      if (!this.selectedNum) {
-        return this.$message.warning('您还未选择要删除的数据')
-      }
-      const _this = this
-      this.$confirm({
-        title: '警告',
-        content: `确定要删除您选择的这${this.selectedNum}条数据吗?`,
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          // delectUserPower({
-          //   id: row.id
-          // }).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success('删除成功')
-          //     _this.$refs.table.refresh()
-          //   }
-          // }).catch(() => {
-          //   _this.$message.success('删除失败, 请稍后重试')
-          // })
-        }
-      })
-    },
-    // 删除
-    delect (row) {
-      const _this = this
-      this.$confirm({
-        title: '警告',
-        content: '确定要删除吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          delLookUpItem({
-            id: row.id
-          }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success('删除成功')
-              _this.$refs.table.refresh()
-            } else {
-              _this.$message.error(res.message)
-            }
-          }).catch(() => {
-            _this.$message.success('删除失败, 请稍后重试')
-          })
-        }
-      })
-    },
-    handleEdit (row) {
-      this.showItemCodeModal = true
-      this.itemCodeData = row
-    }
-  },
-  beforeCreate () {
-    this.form = this.$form.createForm(this, { name: 'miniForm' })
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getCodeList()
-    })
-  },
-  watch: {
-    selectedKey (newValue, oldValue) {
-      if (newValue.length) {
-        this.selectedMenu = this.codeList[this.selectedKey].name + ' ' + '(' + this.codeList[this.selectedKey].code + ')'
-        this.queryParam.lookupCode = this.codeList[this.selectedKey].code
-        this.$refs.table.refresh(true)
-      }
-    }
-  }
-}
-</script>
-
-<style scoped>
-  .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;
-  }
-  .action-button{
-    line-height: 40px;
-    white-space: nowrap;
-    padding: 5px 10px;
-    background-color: #1890ff;
-    border-radius: 4px;
-    color: #fff;
-    margin-right: 5px;
-  }
-  .red-text{
-    background-color: red;
-  }
-</style>

+ 0 - 423
src/views/power/job/jobs.vue

@@ -1,423 +0,0 @@
-<template>
-  <a-card class="settlement" :bordered="false">
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline">
-        <a-row :gutter="20">
-          <a-col :md="6" :sm="24">
-            <a-form-item style="margin-bottom: 0;">
-              <a-input v-model.trim="queryParam.name" placeholder="定时器名称" allowClear/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <a-divider />
-    <div class="btns">
-      <a-button @click="addJob()" type="primary" icon="plus-circle">添加JOB</a-button>
-      <a-button @click="startJob()" type="default" icon="play-circle">启动</a-button>
-      <a-button @click="stopJob()" type="default" icon="stop">停止</a-button>
-    </div>
-
-    <s-table
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :bordered="true"
-      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-    >
-      <span slot="action" slot-scope="text, record">
-        <template>
-          <a @click="editJob(record)">编辑</a>
-          <a-divider type="vertical" />
-          <a @click="deleteRow(record)">删除</a>
-          <a-divider type="vertical" />
-          <a @click="syncJob(record)">立即运行一次</a>
-        </template>
-      </span>
-      <span slot="isEnable" slot-scope="text, record">
-        {{ record.isEnable ? '启用' : '禁用' }}
-      </span>
-      <div slot="status" slot-scope="text, record">
-        <span v-if="record.status === 'STAT'" style="color:green">运行中</span>
-        <span v-if="record.status !== 'STAT'" style="color:red">已停止</span>
-      </div>
-    </s-table>
-
-    <a-modal
-      title="添加JOB"
-      v-model="visible"
-      :footer="null"
-      :maskClosable="false"
-      @cancel="handleCancel"
-    >
-      <a-form
-        @submit="handleSubmit"
-        :form="form"
-      >
-        <a-form-item
-          label="JOB名称"
-          :label-col="{ span: 6 }"
-          :wrapper-col="{ span: 17 }"
-        >
-          <a-input v-decorator="['formData.name',{initialValue: formData.name,rules:[{ required: true, message: '请输入JOB名称' }]}]"/>
-        </a-form-item>
-        <a-form-item
-          label="JOB分组"
-          :label-col="{ span: 6 }"
-          :wrapper-col="{ span: 17 }"
-        >
-          <a-input v-decorator="['formData.group',{initialValue: formData.group,rules:[{ required: true, message: '请输入JOB分组称' }]}]"/>
-        </a-form-item>
-        <a-form-item
-          label="JOB业务类名"
-          :label-col="{ span: 6 }"
-          :wrapper-col="{ span: 17 }"
-        >
-          <a-input v-decorator="['formData.className',{initialValue: formData.className,rules:[{ required: true, message: '请输入JOB业务类名' }]}]"/>
-        </a-form-item>
-        <a-form-item
-          label="CRON表达式"
-          :label-col="{ span: 6 }"
-          :wrapper-col="{ span: 17 }"
-        >
-          <a-input @click="openCronModal" v-model="formData.cron" @change="setCorn">
-            <a-icon slot="prefix" type="schedule" title="corn控件"/>
-            <a-icon v-if="formData.cron" slot="suffix" type="close-circle" @click="formData.cron=''" title="清空"/>
-          </a-input>
-          <JCronModal ref="innerVueCron" :data="formData.cron" @ok="setCorn"></JCronModal>
-        </a-form-item>
-        <a-form-item
-          label="是否启用"
-          :label-col="{ span: 6 }"
-          :wrapper-col="{ span: 17 }"
-        >
-          <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-decorator="['formData.isEnable', { initialValue: formData.isEnable, valuePropName: 'checked' }]" />
-          <!-- <a-switch checkedChildren="启用" unCheckedChildren="禁用" :checked="formData.isEnable" @change="changeStatus"/> -->
-        </a-form-item>
-
-        <div class="jobBtns">
-          <a-button key="back" @click="handleCancel">取消</a-button>
-          <a-button htmlType="submit" :loading="loading" type="primary">
-            确定
-          </a-button>
-        </div>
-
-      </a-form>
-    </a-modal>
-
-  </a-card>
-</template>
-
-<script>
-import { STable } from '@/components'
-import { listJob, pauseJob, resumeJob, delJob, callJob, addJob } from '@/api/job.js'
-import JCronModal from '@/components/Cron/JCronModal'
-
-export default {
-  name: 'Jobs',
-  components: {
-    STable,
-    JCronModal
-  },
-  data () {
-    return {
-      showCron: false,
-      // 查询参数
-      queryParam: {
-        name: ''
-      },
-      selectedRowKeys: [],
-      visible: false,
-      loading: false,
-      formLayout: 'horizontal',
-      formData: {},
-      formBackData: {
-        name: '',
-        group: '',
-        className: '',
-        cron: '',
-        isEnable: false
-      },
-      form: this.$form.createForm(this),
-      // 表头
-      columns: [
-        {
-          title: '序号',
-          dataIndex: 'no',
-          width: '70px',
-          align: 'center'
-        },
-        {
-          title: 'JOB名称',
-          dataIndex: 'name',
-          width: '150px',
-          align: 'center'
-        },
-        {
-          title: 'JOB状态',
-          dataIndex: 'status',
-          width: '100px',
-          align: 'center',
-          scopedSlots: { customRender: 'status' }
-        },
-        {
-          title: 'JOB分组',
-          dataIndex: 'group',
-          width: '150px',
-          align: 'center'
-        },
-        {
-          title: 'JOB业务类名',
-          dataIndex: 'className',
-          width: '200px',
-          align: 'center'
-        },
-        {
-          title: 'CRON表达式',
-          dataIndex: 'cron',
-          width: '150px',
-          align: 'center'
-        },
-        {
-          title: '是否启用',
-          dataIndex: 'isEnable',
-          align: 'center',
-          width: '100px',
-          scopedSlots: { customRender: 'isEnable' }
-        },
-        {
-          title: '操作',
-          dataIndex: 'action',
-          width: '250px',
-          align: 'center',
-          scopedSlots: { customRender: 'action' }
-        }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        return listJob(Object.assign(parameter, this.queryParam)).then(res => {
-          const 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
-            data.list[i].isEnable = data.list[i].isEnable + '' === '1'
-          }
-          return data
-        })
-      }
-    }
-  },
-  created () {
-
-  },
-  methods: {
-    // 打开cron 表达式弹框
-    openCronModal () {
-      this.$refs.innerVueCron.show()
-    },
-    setCorn (data) {
-      console.log('cron data', data)
-      // this.formData.cron = data
-      this.$set(this.formData, 'cron', data)
-    },
-    handleSubmit (e) {
-      e.preventDefault()
-      this.form.validateFields((err, values) => {
-        if (!err) {
-          // 保存数据
-          let params = Object.assign(this.formData, values.formData)
-          params = Object.assign({}, params)
-          params.isEnable = params.isEnable ? 1 : 0
-          params.id = this.formData.id
-
-          if (params.cron == '' || params.cron.length == 0) {
-            this.$message.warning('请输入CRON表达式')
-            return
-          }
-
-          this.loading = true
-          addJob(params).then(res => {
-            console.log(res)
-            if (res.status + '' === '200') {
-              this.$message.success(params.id ? '修改成功' : '保存成功')
-              this.visible = false
-              this.$refs.table.refresh(true)
-            } else {
-              // this.$message.warning(res.message)
-            }
-            this.loading = false
-          })
-        }
-      })
-    },
-    // 编辑
-    editJob (record) {
-      this.visible = true
-      this.formData = Object.assign({}, {
-        id: record.id,
-        name: record.name,
-        group: record.group,
-        className: record.className,
-        cron: record.cron,
-        isEnable: record.isEnable
-      })
-    },
-    /**
-     * 删除选中的job
-     * @param params
-     */
-    deleteRow (record) {
-      const that = this
-      const h = this.$createElement
-      this.$confirm({
-        title: '提示',
-        content: h('div', {
-          style: {
-            textAlign: 'center'
-          }
-        }, [
-          h('div', '删除后,数据将无法恢复。'),
-          h('div', '确认删除吗?')
-        ]),
-        onOk () {
-          delJob({ id: record.id }).then(res => {
-            if (res.status === '200') {
-              that.$message.success('删除成功')
-              that.$refs.table.refresh()
-            }
-          })
-        }
-      })
-    },
-    /**
-     * 立即执行一次
-     * @param params
-     */
-    syncJob (record) {
-      const that = this
-      const h = this.$createElement
-      this.$confirm({
-        title: '提示',
-        content: h('div', {
-          style: {
-            textAlign: 'center'
-          }
-        }, [
-          h('div', '是否立即执行一次定时器。')
-        ]),
-        onOk () {
-          callJob({ id: record.id }).then(res => {
-            if (res.status === '200') {
-              that.$message.success('执行成功')
-              that.$refs.table.refresh()
-            }
-          })
-        }
-      })
-    },
-    handleCancel (e) {
-      this.visible = false
-      this.loading = false
-      this.formData = Object.assign({}, this.formBackData)
-      this.form.resetFields()
-    },
-    addJob () {
-      this.formData = Object.assign({}, this.formBackData)
-      this.form.resetFields()
-      this.visible = true
-    },
-    /**
-     * 批量启动
-     */
-    startJob () {
-      const _this = this
-      const checkIds = this.selectedRowKeys
-      if (checkIds.length) {
-        // 调用后台启动方法
-        resumeJob({
-          ids: checkIds
-        }).then(res => {
-          if (res.status === '200') {
-            _this.$message.success('操作成功')
-          } else {
-            _this.$message.info(res.message)
-          }
-          _this.$refs.table.refresh()
-        })
-      } else {
-        this.$message.info('请选择需要启动的服务')
-      }
-    },
-    /**
-     * 批量停止
-     */
-    stopJob () {
-      const _this = this
-      const h = this.$createElement
-      const checkIds = this.selectedRowKeys
-      if (checkIds.length) {
-        this.$confirm({
-          title: '提示',
-          content: h('div', {
-            style: {
-              textAlign: 'center'
-            }
-          }, [
-            h('div', '您确定停止所选的服务吗?')
-          ]),
-          onOk () {
-            pauseJob({
-              'ids': checkIds
-            }).then(res => {
-              if (res.status === '200') {
-                _this.$message.success('操作成功')
-              } else {
-                _this.$message.info(res.message)
-              }
-              _this.$refs.table.refresh()
-            })
-          }
-        })
-      } else {
-        this.$message.info('请选择需要停止的服务')
-      }
-    },
-    /**
-     * 获取选中的列表
-     * @returns {Array}
-     */
-    onSelectChange (selectedRowKeys) {
-      this.selectedRowKeys = selectedRowKeys
-    }
-  }
-}
-</script>
-<style>
-  .jobBtns{
-    text-align: center;
-    padding-top: 20px;
-  }
-  .jobBtns button{
-    margin: 0 10px;
-  }
-  .ant-modal-footer{
-    text-align: center;
-  }
-  .ant-modal-body .ant-form-item{
-    margin-bottom: 10px;
-  }
-  .btns{
-    padding-bottom: 15px;
-  }
-  .btns button{
-    margin-right: 15px;
-  }
-  .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
-    word-break: break-all;
-  }
-</style>

+ 0 - 430
src/views/power/register/register.vue

@@ -1,430 +0,0 @@
-<template>
-  <a-card :bordered="false">
-    <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-row :gutter="24" >
-            <a-input-search placeholder="搜索" style="width: 100%" @change="onChange" />
-          </a-row>
-          <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-tree>
-        </a-row>
-      </a-col>
-      <!-- 右侧 -->
-      <a-col :span="16" >
-
-        <a-form :form="form" @submit="handleSubmit">
-          <a-form-item label=" " :colon="false" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <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="addTop">添加根节点</a-button>
-            <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="remove()">删除</a-button>
-          </a-form-item>
-          <!-- 父路径 -->
-          <a-form-item label="父路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              disabled
-              placeholder=""
-              v-decorator="['formData.parentPath', {
-                initialValue: formData.parentPath,
-                rules: [] }]"
-            />
-          </a-form-item>
-          <!-- 显示名称-->
-          <a-form-item label="显示名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              placeholder="请输入节点显示名称"
-              v-decorator="['formData.dispname', {
-                initialValue: formData.dispname,
-                rules: [{ required: true, message: '请输入节点显示名称!' }] }]"
-            />
-          </a-form-item>
-          <!-- 名称 -->
-          <a-form-item label="编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              placeholder="请输入节点code"
-              v-decorator="['formData.name', {
-                initialValue: formData.name,
-                rules: [{ required: true, message: '请输入节点code!' }] }]"
-            />
-          </a-form-item>
-
-          <!-- 值 -->
-          <a-form-item label="值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              :maxlength="20"
-              placeholder="请输入节点值"
-              v-decorator="['formData.value', {
-                initialValue: formData.value,
-                rules: [{ required: true, message: '请输入节点值!' }] }]"
-            />
-          </a-form-item>
-
-          <!-- 排序值 -->
-          <a-form-item label="排序" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              type="number"
-              :maxlength="20"
-              placeholder="请输入正确的序号"
-              v-decorator="['formData.index', {
-                initialValue: formData.index,
-                rules: [{ required: true, message: '请输入正确的序号!' }] }]"
-            />
-          </a-form-item>
-
-          <!-- 状态 -->
-          <a-form-item label="是否启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-radio-group
-              name="radioGroup"
-              v-decorator="[
-                'formData.isEnable',
-                {
-                  initialValue: formData.isEnable,
-                  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-textarea
-              v-decorator="[
-                'formData.desc',
-                { initialValue: formData.desc,
-                  rules: [] },
-              ]"
-              style="min-height: 60px;"
-              placeholder=""
-              autosize />
-          </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="reset">
-              重置
-            </a-button>
-          </a-form-item>
-        </a-form>
-
-      </a-col>
-    </a-row>
-  </a-card>
-</template>
-
-<script>
-import { STable, VSelect } from '@/components'
-import { listRegister, saveRegister, delRegisterNode } from '@/api/register'
-import _ from 'lodash'
-
-export default {
-  name: 'Menu',
-  components: {
-    STable, VSelect
-  },
-  props: {},
-  data () {
-    return {
-      treeData: [],
-      dataList: [],
-      searchValue: '',
-      actions: 'addTop', // addTop:添加一级分类,addChild:添加子分类,edit
-      expandedKeys: [],
-      autoExpandParent: true,
-      selectedKeys: [],
-      selectedData: {}, // 被选中的节点数据
-      selectedMenu: '', // 选择的树节点名
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this, { name: 'register' }),
-      parentData: {}, // 父级菜单
-      formData: {},
-      formDataBack: {
-        id: '',
-        dispname: '',
-        name: '',
-        value: '',
-        index: '',
-        parentPath: '',
-        isEnable: '',
-        desc: '',
-        parentId: '0'
-      }
-
-    }
-  },
-  computed: {
-    getMenus () {
-      this.generateList(this.treeData)
-      return this.treeData
-    }
-  },
-  methods: {
-    initPage () {
-      this.addTop()
-      this.initTree()
-    },
-    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) {
-        this.selectedData = info
-        const data = info.selectedNodes[0].data.props
-        this.selectedMenu = data.dispname
-        this.formData = {
-          id: data.id,
-          dispname: data.dispname,
-          name: data.name,
-          value: data.value,
-          index: data.index,
-          parentPath: data.parentPath,
-          isEnable: data.isEnable,
-          desc: data.desc,
-          parentId: data.parentId
-        }
-        this.formData.isEnable = Number(this.formData.isEnable)
-        this.actions = 'edit'
-      } else {
-        this.selectedMenu = ''
-        this.clear()
-      }
-    },
-    generateList (data) {
-      for (let i = 0; i < data.length; i++) {
-        const node = data[i]
-        node.key = node.id
-        node.title = node.dispname
-        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
-      })
-    },
-    // 初始化 查询Tree 数据
-    initTree () {
-      const _this = this
-      listRegister().then(res => {
-        if (res.status === '200') {
-          const treeData = res.data
-          if (treeData) {
-            _this.treeData = treeData
-          }
-        } else {
-          this.$Message.warning(res.message)
-        }
-      })
-    },
-    // 添加根节点
-    addTop () {
-      this.clear()
-      this.actions = 'addTop'
-      this.formData = _.cloneDeep(this.formDataBack)
-    },
-    // 添加子节点
-    addChild () {
-      if (!this.selectedKeys.length) {
-        this.$message.warning('请先选择一个根节点')
-      }
-
-      this.actions = 'addChild'
-      const currentNode = this.selectedData.selectedNodes[0].data.props
-      this.formData = _.cloneDeep(this.formDataBack)
-      this.formData.parentId = currentNode.id
-      if (currentNode.parentId === 0) {
-        this.formData.parentPath = currentNode.dispname
-      } else {
-        this.formData.parentPath = currentNode.parentPath + ' > ' + currentNode.dispname
-      }
-    },
-
-    //  取消选择
-    cancelSel () {
-      this.selectedKeys = []
-      this.selectedMenu = ''
-      this.clear()
-    },
-    reset () {
-      if (this.actions != 'addTop') {
-        const data = {
-          id: this.formData.id,
-          parentId: this.formData.parentId,
-          parentPath: this.formData.parentPath
-        }
-        console.log(data, 'data')
-        this.formData = _.cloneDeep(this.formDataBack)
-        this.formData.id = data.id
-        this.formData.parentId = data.parentId
-        this.formData.parentPath = data.parentPath
-      }
-      this.cancelSel()
-    },
-    // 清空列表
-    clear () {
-      this.form.resetFields()
-      this.formData = _.cloneDeep(this.formDataBack)
-    },
-
-    // 删除数据
-    remove () {
-      if (!this.selectedKeys.length) {
-        return this.$message.warning('您还未选择要删除的数据')
-      }
-      if (this.selectedData.node.$children.length) {
-        return this.$message.warning('请先删除子节点')
-      }
-      const _this = this
-      console.log(_this.formData.id, '_this.formData.id')
-      this.$confirm({
-        title: '警告',
-        content: `确定要删除您选择的 ${_this.formData.dispname} 的数据吗?`,
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          delRegisterNode({
-            id: _this.formData.id
-          }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success('删除成功')
-              _this.cancelSel()
-              _this.initTree()
-            }
-          }).catch(() => {
-            _this.$message.success('删除失败, 请稍后重试')
-          })
-        }
-      })
-    },
-
-    // 保存提交
-    handleSubmit () {
-      const _this = this
-      this.form.validateFields((err, values) => {
-        if (!err) {
-          console.log(values.formData, ' formData.type222222222')
-          let params = {}
-          if (this.actions === 'addTop') {
-            params = Object.assign({}, values.formData)
-          } else {
-            params = Object.assign(_this.formData, values.formData)
-          }
-          saveRegister(params).then(res => {
-            if (res.status + '' === '200') {
-              _this.initTree()
-              _this.cancelSel()
-              this.$message.success(res.message ? res.message : '保存成功')
-            } else {
-              // this.$message.error(res.message ? res.message : '保存失败')
-            }
-          })
-        }
-      })
-    }
-
-  },
-  mounted () {
-    // this.initTree()
-  },
-  beforeCreate () {
-    this.form = this.$form.createForm(this, { name: 'register' })
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.initPage()
-    })
-  },
-  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>

+ 5 - 3
src/views/power/role/menuModal.vue

@@ -1,9 +1,10 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="roleName" v-model="isshow" @cancle="cancel">
+    <a-modal class="modalBox" :title="roleName" centered v-model="isshow" @cancle="cancel">
       <a-form class="form-box" style="max-height: 600px;" :form="form" @submit="handleSubmit">
 
         <a-tree
+          id="role-menu-tree"
           checkable
           @check="onCheck"
           @expand="onExpand"
@@ -15,10 +16,10 @@
 
       </a-form>
       <a-form-item :wrapper-col="{ offset: 15 }">
-        <a-button type="primary" @click="handleSubmit()">
+        <a-button id="role-menu-btn-save" type="primary" @click="handleSubmit()">
           保存
         </a-button>
-        <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+        <a-button id="role-menu-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
           取消
         </a-button>
       </a-form-item>
@@ -103,6 +104,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
+        centered: true,
         content: '确定取消吗?',
         okText: '确定',
         cancelText: '取消',

+ 25 - 13
src/views/power/role/roleList.vue

@@ -1,28 +1,34 @@
 <template>
   <a-card :bordered="false">
     <div class="table-page-search-wrapper">
-      <a-form layout="inline">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="48">
           <a-col :md="6" :sm="24">
             <a-form-item label="角色名称">
-              <a-input allowClear v-model.trim="queryParam.name" @pressEnter="$refs.table.refresh(true)" placeholder="请输入角色名称"/>
+              <a-input allowClear v-model.trim="queryParam.name" id="role-name" placeholder="请输入角色名称"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.isEnable" allowClear placeholder="请选择状态" ></v-select>
+              <v-select
+                code="ENABLE_STATE"
+                ref="isEnable"
+                v-model="queryParam.isEnable"
+                id="role-enable"
+                allowClear
+                placeholder="请选择状态" ></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24" class="flex-sp">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-            <a-button @click="reset">重置</a-button>
+            <a-button type="primary" id="role-btn-search" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button id="role-btn-reset" @click="reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
     </div>
     <a-divider/>
     <div class="table-operator">
-      <a-button type="primary" icon="plus" @click="openModal">新建</a-button>
+      <a-button id="role-btn-add" v-hasPermission="'B_power_role_add'" type="primary" icon="plus" @click="openModal">新建</a-button>
     </div>
 
     <s-table
@@ -33,15 +39,20 @@
       :data="loadData"
       bordered
     >
+      <!-- 状态 -->
       <span slot="status" slot-scope="text, record">
-        <a-switch checkedChildren="" unCheckedChildren="" v-model="record.isEnable" @change="changeFlagHandle(text, record)"/>
+        <a-switch v-if="$hasPermissions('B_power_role_enable')" checkedChildren="" unCheckedChildren="" v-model="record.isEnable" @change="changeFlagHandle(text, record)"/>
+        <span v-else>{{ $refs.isEnable.getNameByCode(record.isEnable) }}</span>
       </span>
+      <!-- 角色描述 -->
+      <span slot="remarks" slot-scope="text, record">{{ record.remarks || '--' }}</span>
 
       <span slot="action" slot-scope="text, record">
         <template>
-          <a class="action-button menu-text" @click="openMenuModal(record)">菜单权限</a>
-          <a class="action-button" @click="handleEdit(record)">修改</a>
-          <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
+          <a v-if="$hasPermissions('B_power_role_menu')" class="action-button menu-text" id="role-btn-menu" @click="openMenuModal(record)">菜单权限</a>
+          <a v-if="$hasPermissions('B_power_role_edit')" class="action-button" id="role-btn-edit" @click="handleEdit(record)">修改</a>
+          <a v-if="!record.isEnable && $hasPermissions('B_power_role_del')" class="action-button red-text" id="role-btn-del" @click="delect(record)">删除</a>
+          <span v-if="!$hasPermissions('B_power_role_menu') && !$hasPermissions('B_power_role_edit') && !(!record.isEnable && $hasPermissions('B_power_role_del'))">--</span>
         </template>
       </span>
     </s-table>
@@ -87,9 +98,9 @@ export default {
         },
         {
           title: '角色描述',
-          dataIndex: 'remarks',
           width: '100',
-          align: 'center'
+          align: 'center',
+          scopedSlots: { customRender: 'remarks' }
         },
         {
           title: '状态',
@@ -166,7 +177,8 @@ export default {
     delect (row) {
       const _this = this
       this.$confirm({
-        title: '警告',
+        title: '提示',
+        centered: true,
         content: '删除后无法恢复,确认删除?',
         okText: '确定',
         cancelText: '取消',

+ 7 - 3
src/views/power/role/roleModal.vue

@@ -1,10 +1,11 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+    <a-modal class="modalBox" :title="titleText" centered v-model="isshow" @cancle="cancel">
       <a-form :form="form" @submit="handleSubmit">
         <!-- 用户名称 -->
         <a-form-item label="角色名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
+            id="role-add-name"
             placeholder="请输入角色名称"
             v-decorator="['formData.name', {
               initialValue: formData.name,
@@ -15,6 +16,7 @@
         <!-- 状态 -->
         <a-form-item label="状态" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
+            id="role-add-enable"
             name="radioGroup"
             v-decorator="[
               'formData.isEnable',
@@ -30,6 +32,7 @@
 
         <a-form-item label="角色描述" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-textarea
+            id="role-add-remarks"
             v-decorator="[
               'formData.remarks',
               { initialValue: formData.remarks,
@@ -41,10 +44,10 @@
         </a-form-item>
 
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button id="role-add-btn-save" type="primary" @click="handleSubmit()">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button id="role-add-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
             取消
           </a-button>
         </a-form-item>
@@ -117,6 +120,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
+        centered: true,
         content: '确定取消吗?',
         okText: '确定',
         cancelText: '取消',

+ 22 - 12
src/views/power/user/userList.vue

@@ -1,33 +1,39 @@
 <template>
   <a-card :bordered="false">
     <div class="table-page-search-wrapper">
-      <a-form layout="inline">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="48">
           <a-col :md="6" :sm="24">
             <a-form-item label="用户名称">
-              <a-input allowClear v-model.trim="queryParam.name" @pressEnter="$refs.table.refresh(true)" placeholder="请输入用户名称"/>
+              <a-input allowClear v-model.trim="queryParam.name" id="user-name" placeholder="请输入用户名称"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="手机号码">
-              <a-input allowClear v-model.trim="queryParam.phone" @pressEnter="$refs.table.refresh(true)" placeholder="请输入手机号码"/>
+              <a-input allowClear v-model.trim="queryParam.phone" id="user-phone" placeholder="请输入手机号码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
+              <v-select
+                code="ENABLE_STATE"
+                v-model="queryParam.loginFlag"
+                ref="loginFlag"
+                id="user-loginFlag"
+                allowClear
+                placeholder="请选择状态"></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24" class="flex-sp">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-            <a-button @click="reset">重置</a-button>
+            <a-button type="primary" id="user-btn-search" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button id="user-btn-reset" @click="reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
     </div>
     <a-divider/>
     <div class="table-operator">
-      <a-button type="primary" icon="plus" @click="openModal">新建</a-button>
+      <a-button id="user-btn-add" v-hasPermission="'B_power_user_add'" type="primary" icon="plus" @click="openModal">新建</a-button>
     </div>
 
     <s-table
@@ -39,7 +45,8 @@
       bordered
     >
       <span slot="status" slot-scope="text, record">
-        <a-switch checkedChildren="" unCheckedChildren="" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
+        <a-switch v-if="$hasPermissions('B_power_user_enable')" checkedChildren="" unCheckedChildren="" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
+        <span v-else>{{ $refs.loginFlag.getNameByCode(record.loginFlag) }}</span>
       </span>
       <div slot="roleNames" slot-scope="text, record" :title="record.roleNames">
         <span v-if="record.roleNames">{{ record.roleNames.substr(0,12) + '...' }}</span>
@@ -48,9 +55,10 @@
       <span slot="action" slot-scope="text, record">
         <template>
           <div >
-            <a class="action-button" @click="handleEdit(record)">修改</a>
-            <a v-if="record.loginFlag" class="action-button reset-text" @click="resetPassword(record)">重置密码</a>
-            <a v-if="!record.loginFlag" class="action-button red-text" @click="delect(record)">删除</a>
+            <a class="action-button" v-if="$hasPermissions('B_power_user_edit')" @click="handleEdit(record)">修改</a>
+            <a v-if="record.loginFlag && $hasPermissions('B_power_user_resetPsd')" class="action-button reset-text" id="user-btn-resetPass" @click="resetPassword(record)">重置密码</a>
+            <a v-if="!record.loginFlag && $hasPermissions('B_power_user_del')" class="action-button red-text" id="user-btn-del" @click="delect(record)">删除</a>
+            <span v-if="!$hasPermissions('B_power_user_edit') && !(record.loginFlag && $hasPermissions('B_power_user_resetPsd')) && !(!record.loginFlag && $hasPermissions('B_power_user_del'))">--</span>
           </div>
         </template>
       </span>
@@ -126,6 +134,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return getPowerUserList(Object.assign(parameter, this.queryParam)).then(res => {
+          console.log(res, '-------------------列表')
           const no = (res.data.pageNo - 1) * res.data.pageSize
           for (let i = 0; i < res.data.list.length; i++) {
             const _item = res.data.list[i]
@@ -171,7 +180,8 @@ export default {
     delect (row) {
       const _this = this
       this.$confirm({
-        title: '警告',
+        title: '提示',
+        centered: true,
         content: '删除后无法恢复,确认删除?',
         okText: '确定',
         cancelText: '取消',

+ 11 - 4
src/views/power/user/userModal.vue

@@ -1,12 +1,13 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+    <a-modal class="modalBox" :title="titleText" centered v-model="isshow" @cancle="cancel">
       <a-form :form="form" @submit="handleSubmit">
         <a-row :gutter="24">
           <a-col :span="12">
             <!-- 用户名称 -->
             <a-form-item label="用户名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="user-add-name"
                 placeholder="请输入用户名称"
                 v-decorator="['formData.name', {
                   initialValue: formData.name,
@@ -18,6 +19,7 @@
             <!-- 手机号码 -->
             <a-form-item label="手机号码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="user-add-phone"
                 placeholder="请输入手机号码"
                 v-decorator="['formData.phone', {
                   initialValue: formData.phone,
@@ -31,6 +33,7 @@
           <a-col :span="12">
             <a-form-item label="性别" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <v-select
+                id="user-add-sex"
                 code="SEX"
                 v-decorator="[
                   'formData.sex',
@@ -46,6 +49,7 @@
           <a-col :span="12">
             <a-form-item label="状态" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-radio-group
+                id="user-add-loginFlag"
                 name="radioGroup"
                 v-decorator="[
                   'formData.loginFlag',
@@ -65,6 +69,7 @@
           <a-col :span="24">
             <a-form-item label="角色" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-select
+                id="user-add-role"
                 v-decorator="[
                   'formData.roleNames',
                   {
@@ -89,6 +94,7 @@
           <a-col :span="24">
             <a-form-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-textarea
+                id="user-add-remarks"
                 v-decorator="[
                   'formData.remarks',
                   {
@@ -102,10 +108,10 @@
           </a-col>
         </a-row>
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button id="user-add-btn-save" type="primary" @click="handleSubmit()">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button id="user-add-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
             取消
           </a-button>
         </a-form-item>
@@ -181,6 +187,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
+        centered: true,
         content: '确定取消吗?',
         okText: '确定',
         cancelText: '取消',
@@ -203,7 +210,7 @@ export default {
     // 获取角色列表接口
     getRoleList () {
       getRoleList().then(res => {
-        if (res.status + '' === '200') {
+        if (res.status == 200) {
           this.roleList = res.data
         } else {
           this.$message.warning(res.message)

+ 8 - 143
src/views/user/ChangePwd.vue

@@ -1,156 +1,21 @@
 <template>
-
   <a-card :bordered="false" class="change-pwd-card">
-    <a-row :gutter="24" class="change-pwd">
-      <a-col span="8" offset="8">
-        <a-form @submit="handleSubmit" :form="form">
-          <!-- 原始密码 -->
-          <a-form-item
-            label="原始密码"
-            prop="oldPwd"
-            :label-col="formLayout.labelCol"
-            :wrapper-col="formLayout.wrapperCol">
-            <a-input
-              type="password"
-              v-decorator="[
-                'formCustom.oldPwd',
-                { initialValue: formCustom.oldPwd,
-                  rules: [
-                    { required: true, message: '请输入原始密码' },
-                  ]
-                },
-              ]">
-            </a-input>
-          </a-form-item>
-          <!-- 新密码 -->
-          <a-form-item
-            label="新密码"
-            prop="passwd"
-            :label-col="formLayout.labelCol"
-            :wrapper-col="formLayout.wrapperCol">
-            <a-input
-              type="password"
-              v-decorator="[
-                'formCustom.passwd',
-                { initialValue: formCustom.passwd,
-                  rules: [
-                    { required: true, message: '请输入新密码' }
-                  ]
-                },
-              ]">
-            </a-input>
-          </a-form-item>
-          <!-- 再次确认 -->
-          <a-form-item
-            label="再次确认"
-            prop="passwdCheck"
-            :label-col="formLayout.labelCol"
-            :wrapper-col="formLayout.wrapperCol">
-            <a-input
-              type="password"
-              v-decorator="[
-                'formCustom.passwdCheck',
-                { initialValue: formCustom.passwdCheck,
-                  rules: [
-                    { required: true, message: '请再次输入密码' },
-                    { validator: compareToFirstPassword }
-                  ]
-                },
-              ]">
-            </a-input>
-          </a-form-item>
-          <a-col span="16" offset="8">
-            <a-form-item>
-              <a-button type="primary" htmlType="submit" :loading="loading">保存</a-button>
-              <a-button @click="handleReset('formCustom')" style="margin-left: 8px">重置</a-button>
-            </a-form-item>
-          </a-col>
-        </a-form>
-      </a-col>
-    </a-row>
+    <ResetPwd />
   </a-card>
-
 </template>
 
 <script>
-import { changePwd } from '@/api/login.js'
-import { mapActions, mapGetters } from 'vuex'
-
+import ResetPwd from '@/views/user/ResetPwd.vue'
 export default {
   name: 'ChangePwd',
-  data () {
-    return {
-      formLayout: {
-        labelCol: {
-          xs: { span: 24 },
-          sm: { span: 6 }
-        },
-        wrapperCol: {
-          xs: { span: 24 },
-          sm: { span: 18 }
-        }
-      },
-      form: this.$form.createForm(this),
-      loading: false,
-      formCustom: {
-        passwd: '',
-        passwdCheck: '',
-        oldPwd: ''
-      }
-    }
-  },
-  methods: {
-    ...mapActions(['Logout']),
-    // 密码校验
-    compareToFirstPassword (rule, value, callback) {
-      const form = this.form
-      if (value && value !== form.getFieldValue('formCustom.passwd')) {
-        callback('两次输入的密码不一致, 请重新输入!')
-      } else {
-        callback()
-      }
-    },
-    handleSubmit (e) {
-      e.preventDefault()
-      const _this = this
-      this.form.validateFields((err, values) => {
-        if (!err) {
-          changePwd({
-            oldPassword: values.formCustom.oldPwd,
-            password: values.formCustom.passwd
-          }).then(res => {
-            if (res.status === '200') {
-              _this.$message.success('修改成功, 请重新登录')
-              _this.logout()
-            } else {
-              _this.$message.error(res.message)
-            }
-          })
-        }
-      })
-    },
-    logout () {
-      this.Logout({}).then(() => {
-        setTimeout(() => {
-          this.$router.push({ path: '/user/login' })
-        }, 16)
-      })
-    },
-    handleReset () {
-      this.form.resetFields()
-    }
+  components: {
+    ResetPwd
   }
-
 }
 </script>
 
-<style scoped>
-  .change-pwd {
-    margin-top: 15vh;
-  }
-
-  .change-pwd-card {
-    height: 70vh;
-    /* border-top: 2px solid #FFB01B; */
-  }
+<style lang="less" scoped>
+.change-pwd-card {
+  padding-top: 50px;
+}
 </style>

+ 155 - 0
src/views/user/ResetPwd.vue

@@ -0,0 +1,155 @@
+<template>
+  <a-row :gutter="24" class="change-pwd">
+    <a-col span="8" offset="8">
+      <a-form @submit="handleSubmit" :form="form">
+        <!-- 原始密码 -->
+        <a-form-item
+          label="原始密码"
+          prop="oldPwd"
+          :label-col="formLayout.labelCol"
+          :wrapper-col="formLayout.wrapperCol">
+          <a-input
+            type="password"
+            :maxLength="12"
+            placeholder="请输入原始密码(6~12位)"
+            v-decorator="[
+              'formCustom.oldPwd',
+              { initialValue: formCustom.oldPwd,
+                rules: [
+                  { required: true, message: '请输入原始密码' },
+                ]
+              },
+            ]">
+          </a-input>
+        </a-form-item>
+        <!-- 新密码 -->
+        <a-form-item
+          label="新密码"
+          prop="passwd"
+          :label-col="formLayout.labelCol"
+          :wrapper-col="formLayout.wrapperCol">
+          <a-input
+            type="password"
+            :maxLength="12"
+            placeholder="请输入新密码(6~12位)"
+            v-decorator="[
+              'formCustom.passwd',
+              { initialValue: formCustom.passwd,
+                rules: [
+                  { required: true, message: '请输入新密码' },
+                  { validator: passwordValid }
+                ]
+              },
+            ]">
+          </a-input>
+        </a-form-item>
+        <!-- 再次确认 -->
+        <a-form-item
+          label="再次确认"
+          prop="passwdCheck"
+          :label-col="formLayout.labelCol"
+          :wrapper-col="formLayout.wrapperCol">
+          <a-input
+            type="password"
+            :maxLength="12"
+            placeholder="请再次输入新密码(6~12位)"
+            v-decorator="[
+              'formCustom.passwdCheck',
+              { initialValue: formCustom.passwdCheck,
+                rules: [
+                  { required: true, message: '请再次输入密码' },
+                  { validator: compareToFirstPassword }
+                ]
+              },
+            ]">
+          </a-input>
+        </a-form-item>
+        <a-col span="16" offset="8">
+          <a-form-item>
+            <a-button type="primary" htmlType="submit" :loading="loading">保存</a-button>
+            <a-button @click="handleReset('formCustom')" style="margin-left: 8px">重置</a-button>
+          </a-form-item>
+        </a-col>
+      </a-form>
+    </a-col>
+  </a-row>
+</template>
+
+<script>
+import { changePwd } from '@/api/login.js'
+import { mapActions } from 'vuex'
+export default {
+  name: 'ResetPwd',
+  data () {
+    return {
+      formLayout: {
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 6 }
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 18 }
+        }
+      },
+      form: this.$form.createForm(this),
+      loading: false,
+      formCustom: {
+        passwd: '',
+        passwdCheck: '',
+        oldPwd: ''
+      }
+    }
+  },
+  methods: {
+    ...mapActions(['Logout']),
+    //  密码位数校验
+    passwordValid (rule, value, callback) {
+      if (value.length < 6 || value.length > 12) {
+        callback('请输入6-12位密码!')
+      } else {
+        callback()
+      }
+    },
+    // 密码校验
+    compareToFirstPassword (rule, value, callback) {
+      const form = this.form
+      if (value && value !== form.getFieldValue('formCustom.passwd')) {
+        callback('两次输入的密码不一致, 请重新输入!')
+      } else {
+        callback()
+      }
+    },
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          changePwd({
+            oldPassword: values.formCustom.oldPwd,
+            password: values.formCustom.passwd
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success('修改成功, 请重新登录')
+              _this.logout()
+            }
+          })
+        }
+      })
+    },
+    logout () {
+      this.Logout({}).then(() => {
+        setTimeout(() => {
+          this.$router.push({ path: '/user/login' })
+        }, 16)
+      })
+    },
+    handleReset () {
+      this.form.resetFields()
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 2 - 3
vue.config.js

@@ -108,9 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://carwash.test.zyucgj.com/cw-admin/',
-        target: 'http://192.168.16.102:8101/cw-admin/',
-        // target: 'https://carwash.test.zyucgj.com/cw-admin/',
+        target: 'https://channel.test.zyucgj.com/zyyc-channel/',
+        // target: 'http://192.168.16.104:8081/zyyc-channel/',
         ws: false,
         changeOrigin: true,
         pathRewrite: {