Browse Source

Merge branch 'develop' of chelingzhu-web/zycar-supplier-admin into master

lilei 4 years ago
parent
commit
aec43186fc
54 changed files with 6315 additions and 989 deletions
  1. 2 2
      .env
  2. 1 1
      .env.development
  3. 2 2
      .env.preview
  4. 31 9
      package-lock.json
  5. 1 1
      package.json
  6. 1 1
      public/index.html
  7. 15 0
      src/api/OperateJournal.js
  8. 26 0
      src/api/atorg.js
  9. 24 19
      src/api/power-role.js
  10. 23 18
      src/api/power-user.js
  11. 22 0
      src/api/register.js
  12. 68 0
      src/api/storeManagement.js
  13. 61 0
      src/api/supplierManagement.js
  14. BIN
      src/assets/logo.png
  15. 73 0
      src/components/Table/EditableCell.vue
  16. 1 1
      src/components/Table/index.js
  17. 150 43
      src/config/router.config.js
  18. 22 18
      src/main.js
  19. 10 10
      src/store/modules/permission.js
  20. 1 1
      src/store/modules/user.js
  21. 1 1
      src/utils/domUtil.js
  22. 2 2
      src/utils/request.js
  23. 87 85
      src/views/FinancialManagement/CashOutManagement.vue
  24. 107 0
      src/views/FinancialManagement/CashOutModal.vue
  25. 264 0
      src/views/FinancialManagement/LedgerRecords.vue
  26. 0 108
      src/views/FinancialManagement/PaySettlementRecordsDetailsModal.vue
  27. 0 133
      src/views/FinancialManagement/WriteOffDetailsModal.vue
  28. 0 206
      src/views/RefundRecord/RefundRecord.vue
  29. 135 0
      src/views/power/OperateJournal/OperateJournal.vue
  30. 336 0
      src/views/power/dataDictionary/codeItemModal.vue
  31. 207 0
      src/views/power/dataDictionary/codeModal.vue
  32. 408 0
      src/views/power/dataDictionary/dataDictionary.vue
  33. 423 0
      src/views/power/job/jobs.vue
  34. 302 0
      src/views/power/menu/childModal.vue
  35. 487 0
      src/views/power/menu/menu.vue
  36. 443 0
      src/views/power/register/register.vue
  37. 12 29
      src/views/power/role/menuModal.vue
  38. 135 107
      src/views/power/role/roleList.vue
  39. 32 28
      src/views/power/role/roleModal.vue
  40. 147 122
      src/views/power/user/userList.vue
  41. 60 36
      src/views/power/user/userModal.vue
  42. 190 0
      src/views/storehouseManagement/ReplenishmentListModal.vue
  43. 281 0
      src/views/storehouseManagement/StockSearch.vue
  44. 124 0
      src/views/storehouseManagement/customerInfo/CustomerList.vue
  45. 161 0
      src/views/storehouseManagement/productInfo/ProductList.vue
  46. 181 0
      src/views/storehouseManagement/stockOutInModal.vue
  47. 233 0
      src/views/storehouseManagement/storeBind/StoreBindList.vue
  48. 189 0
      src/views/storehouseManagement/storeBind/StoreBindModal.vue
  49. 221 0
      src/views/supplierManagement/Organization.vue
  50. 156 0
      src/views/supplierManagement/SupplierBankModal.vue
  51. 259 0
      src/views/supplierManagement/SupplierList.vue
  52. 192 0
      src/views/supplierManagement/SupplierModal.vue
  53. 3 3
      src/views/user/ResetPwd.vue
  54. 3 3
      vue.config.js

+ 2 - 2
.env

@@ -1,5 +1,5 @@
 NODE_ENV=production
 VUE_APP_PREVIEW=false
-VUE_APP_API_BASE_URL=https://channel.zyucgj.com/zyyc-channel/
+VUE_APP_API_BASE_URL=http://supplier.zyucgj.com/supp-admin/
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=供应商管理系统
+VUE_APP_PRO_NAME=供应商运营管理平台

+ 1 - 1
.env.development

@@ -2,4 +2,4 @@ NODE_ENV=development
 VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=/api
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=供应商管理系统-dev
+VUE_APP_PRO_NAME=供应商运营管理平台-dev

+ 2 - 2
.env.preview

@@ -1,5 +1,5 @@
 NODE_ENV=production
 VUE_APP_PREVIEW=true
-VUE_APP_API_BASE_URL=https://channel.test.zyucgj.com/zyyc-channel/
+VUE_APP_API_BASE_URL=http://supplier.test.zyucgj.com/supp-admin/
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=供应商管理系统-pro
+VUE_APP_PRO_NAME=供应商运营管理平台-pro

+ 31 - 9
package-lock.json

@@ -1148,6 +1148,22 @@
       "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==",
       "dev": true
     },
+    "@simonwep/pickr": {
+      "version": "1.7.4",
+      "resolved": "https://registry.npmjs.org/@simonwep/pickr/-/pickr-1.7.4.tgz",
+      "integrity": "sha512-fq7jgKJT21uWGC1mARBHvvd1JYlEf93o7SuVOB4Lr0x/2UPuNC9Oe9n/GzVeg4oVtqMDfh1wIEJpsdOJEZb+3g==",
+      "requires": {
+        "core-js": "^3.6.5",
+        "nanopop": "^2.1.0"
+      },
+      "dependencies": {
+        "core-js": {
+          "version": "3.8.1",
+          "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.1.tgz",
+          "integrity": "sha512-9Id2xHY1W7m8hCl8NkhQn5CufmF/WuR30BTRewvCXc1aZd3kMECwNZ69ndLbekKfakw9Rf2Xyc+QR6E7Gg+obg=="
+        }
+      }
+    },
     "@soda/friendly-errors-webpack-plugin": {
       "version": "1.7.1",
       "resolved": "https://registry.npmjs.org/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.1.tgz",
@@ -2313,12 +2329,13 @@
       "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
     },
     "ant-design-vue": {
-      "version": "1.5.2",
-      "resolved": "https://registry.npmjs.org/ant-design-vue/-/ant-design-vue-1.5.2.tgz",
-      "integrity": "sha512-DmlOl+ld4hSQdEG1c2wAV+v9/Bl2aG+wBEnd1GJYV0LeOXaSrBGiIkZrmUrTrUL92yBdFO+OF25aFNb0UFMZOA==",
+      "version": "1.7.2",
+      "resolved": "https://registry.npmjs.org/ant-design-vue/-/ant-design-vue-1.7.2.tgz",
+      "integrity": "sha512-iVskTSG62OSiptyGQkvyhoeLlLMiqKtAOTcWZ7MmsMrj38h0TCpGtqSYS4/fwq4yYgyzloYSteBo8U8TrV99RA==",
       "requires": {
         "@ant-design/icons": "^2.1.1",
         "@ant-design/icons-vue": "^2.0.0",
+        "@simonwep/pickr": "~1.7.0",
         "add-dom-event-listener": "^1.0.2",
         "array-tree-filter": "^2.1.0",
         "async-validator": "^3.0.3",
@@ -2571,9 +2588,9 @@
       "dev": true
     },
     "async-validator": {
-      "version": "3.3.0",
-      "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-3.3.0.tgz",
-      "integrity": "sha512-cAHGD9EL8aCqWXjnb44q94MWiDFzUo1tMhvLb2WzcpWqGiKugsjWG9cvl+jPgkPca7asNbsBU3fa0cwkI/P+Xg=="
+      "version": "3.5.1",
+      "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-3.5.1.tgz",
+      "integrity": "sha512-DDmKA7sdSAJtTVeNZHrnr2yojfFaoeW8MfQN8CeuXg8DDQHTqKk9Fdv38dSvnesHoO8MUwMI2HphOeSyIF+wmQ=="
     },
     "asynckit": {
       "version": "0.4.0",
@@ -8990,9 +9007,9 @@
       "integrity": "sha512-wW/SXnYJkTjs++tVK5b6kVITZpAZPtUrt9SF80vvxGiF/Oywal+COk1jlRkiVq15RFNEQKQY31TkV24/1T5cVg=="
     },
     "is-negative-zero": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz",
-      "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE="
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
+      "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w=="
     },
     "is-number": {
       "version": "3.0.0",
@@ -11886,6 +11903,11 @@
         }
       }
     },
+    "nanopop": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/nanopop/-/nanopop-2.1.0.tgz",
+      "integrity": "sha512-jGTwpFRexSH+fxappnGQtN9dspgE2ipa1aOjtR24igG0pv6JCxImIAmrLRHX+zUF5+1wtsFVbKyfP51kIGAVNw=="
+    },
     "natural-compare": {
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",

+ 1 - 1
package.json

@@ -15,7 +15,7 @@
   },
   "dependencies": {
     "@antv/data-set": "^0.10.2",
-    "ant-design-vue": "^1.5.2",
+    "ant-design-vue": "^1.6.5",
     "axios": "^0.19.0",
     "core-js": "2.6.9",
     "echarts": "^4.9.0",

+ 1 - 1
public/index.html

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

+ 15 - 0
src/api/OperateJournal.js

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

+ 26 - 0
src/api/atorg.js

@@ -0,0 +1,26 @@
+import { axios } from '@/utils/request'
+
+// 组织机构列表
+export const findOrgTree = params => {
+  return axios({
+    url: '/org/findOrgTree',
+    data: {},
+    method: 'get'
+  })
+}
+// 保存
+export const saveAtorg = params => {
+  return axios({
+    url: '/org/save',
+    data: params,
+    method: 'post'
+  })
+}
+// 删除
+export const delAtorg = params => {
+  return axios({
+    url: `/org/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}

+ 24 - 19
src/api/power-role.js

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

+ 23 - 18
src/api/power-user.js

@@ -3,22 +3,15 @@ import { axios } from '@/utils/request'
 // 重置密码
 export const resetPSD = params => {
   return axios({
-    url: 'scuser/resetPwd',
+    url: `/user/resetPwd`,
     data: params,
     method: 'POST'
   })
 }
-// 启用禁用
-export const updateEnableStatus = params => {
-  return axios({
-    url: `scuser/enable/${params.id}/${params.flag}`,
-    data: {},
-    method: 'get'
-  })
-}
-// 分页查询用户
+
+// 获取列表数据
 export const getPowerUserList = params => {
-  const url = `scuser/queryLike/${params.pageNo}/${params.pageSize}`
+  const url = `/user/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -27,26 +20,38 @@ export const getPowerUserList = params => {
     method: 'POST'
   })
 }
+
+// 改变权限状态接口
+export const updateEnableStatus = params => {
+  return axios({
+    url: `/user/enable/${params.id}/${params.flag}`,
+    data: {},
+    method: 'get'
+  })
+}
+
 // 删除用户接口
 export const delectUserPower = params => {
   return axios({
-    url: `scuser/delete/${params.id}`,
+    url: `/user/delete/${params.id}`,
     data: {},
     method: 'get'
   })
 }
-// 查询所有角色
-export const getRoleList = params => {
+
+// 新增/编辑保存接口
+export const saveUserPower = params => {
   return axios({
-    url: 'scrole/findAll',
+    url: '/user/save',
     data: params,
     method: 'POST'
   })
 }
-// 保存用户
-export const saveUserPower = params => {
+
+// 获取角色列表接口
+export const getRoleList = params => {
   return axios({
-    url: 'scuser/save',
+    url: '/role/findAll',
     data: params,
     method: 'POST'
   })

+ 22 - 0
src/api/register.js

@@ -0,0 +1,22 @@
+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'
+  })
+}

+ 68 - 0
src/api/storeManagement.js

@@ -0,0 +1,68 @@
+import { axios } from '@/utils/request'
+
+/**
+ * 卫星仓绑定相关接口
+ */
+// 供应商门店绑定分页查询
+export const supplierStoreList = params => {
+  const url = `/supplierStore/queryLike/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 供应商与门店新增绑定
+export const supplierStoreBind = params => {
+  return axios.request({
+    url: '/supplierStore/bind',
+    data: params,
+    method: 'post'
+  })
+}
+/**
+ * 门店信息相关接口
+ */
+// 门店分页查询
+export const storeListQuery = params => {
+  const url = `/store/queryLike/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 查询所有门店
+export const storeFindAll = params => {
+  return axios.request({
+    url: '/store/findAll',
+    data: params,
+    method: 'post'
+  })
+}
+// 根据名称精确查询所有门店
+export const storeQueryAll = params => {
+  return axios.request({
+    url: '/store/query',
+    data: params,
+    method: 'post'
+  })
+}
+/**
+ * 配件信息
+ */
+// 配件分页查询
+export const partListQuery = params => {
+  const url = `/part/queryLike/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 61 - 0
src/api/supplierManagement.js

@@ -0,0 +1,61 @@
+import { axios } from '@/utils/request'
+
+// 供应商分页查询
+export const supplierListQuery = params => {
+  const url = `/supplier/queryLike/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 查询所有供应商
+export const supplierFindAll = params => {
+  return axios.request({
+    url: '/supplier/findAll',
+    data: params,
+    method: 'post'
+  })
+}
+// 根据供应商名称查询所有供应商
+export const supplierQueryAll = params => {
+  return axios.request({
+    url: '/supplier/query',
+    data: params,
+    method: 'post'
+  })
+}
+// 供应商编辑
+export const supplierEdit = params => {
+  return axios.request({
+    url: '/supplier/edit',
+    data: params,
+    method: 'post'
+  })
+}
+// 供应商详情
+export const supplierView = params => {
+  return axios.request({
+    url: `/supplier/selectBySn/${params.supplierSn}`,
+    data: {},
+    method: 'post'
+  })
+}
+// 根据供应商SN查询可用账户信息
+export const supplierBankQuery = params => {
+  return axios.request({
+    url: `/supplierBankAccount/queryEnableBySupplierSn`,
+    data: params,
+    method: 'post'
+  })
+}
+// 保存结算账户信息
+export const supplierBankSave = params => {
+  return axios.request({
+    url: `/supplierBankAccount/save`,
+    data: params,
+    method: 'post'
+  })
+}

BIN
src/assets/logo.png


+ 73 - 0
src/components/Table/EditableCell.vue

@@ -0,0 +1,73 @@
+<template>
+  <div class="editable-cell">
+    <div class="add-cont" v-if="editable">
+      <a-icon @click="handleMinus" :style="{fontSize:'20px', color: '#1890ff',padding: '10px'}" type="minus-circle" />
+      <a-input-number :max="max" :min="min" :value="value" @change="handleChange"/>
+      <a-icon @click="handleAdd" :style="{fontSize:'20px', color: '#1890ff',padding: '10px'}" type="plus-circle" />
+    </div>
+    <span v-else>{{ value }}</span>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'EditableCell',
+  props: {
+    // 文本框内容
+    text: {
+      type: [String, Number],
+      default: ''
+    },
+    // 是否可编辑
+    editable: {
+      type: Boolean,
+      default: true
+    },
+    // 可输入最大值
+    max: {
+      type: [String, Number],
+      default: ''
+    },
+    // 可输入最小值
+    min: {
+      type: [String, Number],
+      default: 0
+    }
+  },
+  data () {
+    return {
+      value: this.text
+    }
+  },
+  methods: {
+    // 减
+    handleMinus () {
+      this.value--
+      this.$emit('change', this.value)
+    },
+    // 加
+    handleAdd () {
+      this.value++
+      this.$emit('change', this.value)
+    },
+    // 文本框变化
+    handleChange (v) {
+      this.value = v
+      this.$emit('change', this.value)
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .editable-cell{
+    .add-cont{
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      .ant-input-number-input {
+        text-align: center;
+      }
+    }
+  }
+</style>

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

@@ -159,7 +159,7 @@ export default {
           // console.log(r, 'rrrrrrrrrr')
           this.localPagination = this.showPagination && Object.assign({}, this.localPagination, {
             current: r.pageNo, // 返回结果中的当前分页数
-            total: r.count, // 返回结果中的总记录数
+            total: Number(r.count), // 返回结果中的总记录数
             showSizeChanger: this.showSizeChanger,
             pageSize: (pagination && pagination.pageSize) ||
               this.localPagination.pageSize

+ 150 - 43
src/config/router.config.js

@@ -44,52 +44,159 @@ export const asyncRouterMap = [{
     }
     ]
   },
-  {
-	  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',
-  //   redirect: '/auth/userList',
-  //   component: PageView,
-  //   meta: {
-  //     title: '运营平台权限管理',
-  //     icon: 'apartment',
-  //     permission: 'M_power_auth'
-  //   },
-  //   children: [
-  //     {
-  //       path: '/auth/userList',
-  //       name: 'powerUserList',
-  //       component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
-  //       meta: {
-  //         title: '用户管理',
-  //         icon: 'user',
-  //         permission: 'M_power_user_list'
-  //       }
-  //     },
+	 //  path: '/FinancialManagement',
+	 //  name: 'FinancialManagement',
+	 //  component: PageView,
+	 //  meta: { title: '财务管理', icon: 'account-book', permission: 'M_cwgn' },
+	 //  children: [
+	 //    {
+	 //      path: 'LedgerRecords/list',
+	 //      name: 'LedgerRecords',
+	 //      component: () => import(/* webpackChunkName: "FinancialManagement" */ '@/views/FinancialManagement/LedgerRecords.vue'),
+	 //      meta: { title: '分账记录', icon: 'form' }
+	 //    },
   //     {
-  //       path: '/auth/roleList',
-  //       name: 'powerRoleList',
-  //       component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
-  //       meta: {
-  //         title: '角色管理',
-  //         icon: 'solution',
-  //         permission: 'M_power_role_list'
-  //       }
+  //       path: 'CashOutManagement/list',
+  //       name: 'CashOutManagement',
+  //       component: () => import(/* webpackChunkName: "FinancialManagement" */ '@/views/FinancialManagement/CashOutManagement.vue'),
+  //       meta: { title: '提现管理', icon: 'property-safety' }
   //     }
-  //   ]
-  // }
+	 //  ]
+  // },
+  {
+    path: '/storehouseManagement',
+    name: 'storehouseManagement',
+    component: PageView,
+    meta: { title: '卫星仓管理', icon: 'switcher', permission: 'M_storehouseManagement' },
+    children: [
+      /**
+        *  之后迭代版本可能有用
+        */
+      // {
+      //   path: 'StockSearch/list',
+      //   name: 'StockSearch',
+      //   component: () => import(/* webpackChunkName: "storehouseManagement" */ '@/views/storehouseManagement/StockSearch.vue'),
+      //   meta: { title: '库存查询', icon: 'security-scan' }
+      // },
+      {
+        path: 'storeBind/list',
+        name: 'StoreBind',
+        component: () => import(/* webpackChunkName: "storehouseManagement" */ '@/views/storehouseManagement/storeBind/StoreBindList.vue'),
+        meta: { title: '卫星仓绑定', icon: 'block', permission: 'M_storeBind_list' }
+      },
+      {
+        path: 'customerInfo/list',
+        name: 'CustomerList',
+        component: () => import(/* webpackChunkName: "storehouseManagement" */ '@/views/storehouseManagement/customerInfo/CustomerList.vue'),
+        meta: { title: '客户信息', icon: 'idcard', permission: 'M_customerInfo' }
+      },
+      {
+        path: 'productInfo/list',
+        name: 'ProductList',
+        component: () => import(/* webpackChunkName: "storehouseManagement" */ '@/views/storehouseManagement/productInfo/ProductList.vue'),
+        meta: { title: '产品信息', icon: 'profile', permission: 'M_productInfo' }
+      }
+    ]
+  },
+  {
+    path: '/supplierManagement',
+    name: 'supplierManagement',
+    component: PageView,
+    meta: { title: '供应商管理', icon: 'solution', permission: 'M_supplierManagement' },
+    children: [
+      {
+        path: 'supplierList',
+        name: 'SupplierList',
+        component: () => import(/* webpackChunkName: "storehouseManagement" */ '@/views/supplierManagement/SupplierList.vue'),
+        meta: { title: '供应商信息', icon: 'contacts', permission: 'M_supplierList_list' }
+      },
+      {
+        path: 'organization',
+        name: 'Organization',
+        component: () => import(/* webpackChunkName: "storehouseManagement" */ '@/views/supplierManagement/Organization.vue'),
+        meta: { title: '组织机构', icon: 'cluster', permission: 'M_organization_list' }
+      }
+    ]
+  },
+  {
+    path: '/auth',
+    redirect: '/auth/userList',
+    component: PageView,
+    meta: {
+      title: '权限管理',
+      icon: 'lock',
+      permission: 'M_auth_0'
+    },
+    children: [
+      {
+        path: '/auth/userList',
+        name: 'powerUserList',
+        component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
+        meta: {
+          title: '用户管理',
+          icon: 'user',
+          permission: 'M_power_user_list'
+        }
+      },
+      {
+        path: '/auth/roleList',
+        name: 'powerRoleList',
+        component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
+        meta: {
+          title: '角色管理',
+          icon: 'solution',
+          permission: 'M_power_role_list'
+        }
+      },
+      {
+        path: '/menusAuth/menu',
+        name: 'powerMenu',
+        component: () => import(/* webpackChunkName: "auth" */ '@/views/power/menu/menu.vue'),
+        meta: {
+          title: '菜单管理',
+          icon: 'profile',
+          permission: 'M_power_menu_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/OperateJournal',
+      name: 'powerOperateJournal',
+      component: () => import(/* webpackChunkName: "setting" */
+        '@/views/power/OperateJournal/OperateJournal.vue'),
+      meta: {
+        title: '操作日志',
+        icon: 'read',
+        permission: 'M_OperateJournal'
+      }
+    }
+    ]
+  }
   ]
 },
 {

+ 22 - 18
src/main.js

@@ -8,39 +8,43 @@ import store from './store/'
 import { VueAxios } from './utils/request'
 
 // mock
-//import './mock'
+// import './mock'
 
 import bootstrap from './core/bootstrap'
 import './core/use'
 import './permission' // permission control
-import './utils/filter' // global filter
+import './utils/filter'
+
+import VueCookies from 'vue-cookies' // global filter
 
 Vue.config.productionTip = false
 
 // mount axios Vue.$http and this.$http
 Vue.use(VueAxios)
-
-import VueCookies from 'vue-cookies'
 Vue.use(VueCookies)
 Vue.$cookies.config('7d')
 /**
  * 权限检查
  */
 Vue.prototype.$hasPermissions = function (value) {
- let isExist = false;
- const roles = store.getters.roles
- const permissionList = roles.permissionList
- //console.log(permissionsStr,'permissionsStr')
- if (permissionList == undefined || permissionList == null) {
-  return false;
- }
- let has = permissionList.find(item => {
-   return item == value
- })
- if (has) {
-  isExist = true;
- }
- return isExist;
+  let isExist = false
+  const roles = store.getters.roles
+  const permissionList = roles.permissionList
+  // console.log(permissionsStr,'permissionsStr')
+  if (permissionList == undefined || permissionList == null) {
+    return false
+  }
+  const has = permissionList.find(item => {
+    return item == value
+  })
+  if (has) {
+    isExist = true
+  }
+  return isExist
+}
+// 禁止输入框输入空格,换行符,<,>
+Vue.prototype.$filterEmpty = function (e) {
+  return e.target.value.replace(/\s|\r\n|\n|<|>/g, '')
 }
 new Vue({
   router,

+ 10 - 10
src/store/modules/permission.js

@@ -9,16 +9,16 @@ import { asyncRouterMap, constantRouterMap } from '@/config/router.config'
  */
 function hasPermission (permission, route) {
   if (route.meta && route.meta.permission) {
-    // let flag = permission.find(item => {
-    //   return item&&item == route.meta.permission
-    // })
-    let flag = false
-    for (let i = 0, len = permission.length; i < len; i++) {
-      flag = route.meta.permission.includes(permission[i])
-      if (flag) {
-        return true
-      }
-    }
+    const flag = permission.find(item => {
+      return item && item == route.meta.permission
+    })
+    // let flag = false
+    // for (let i = 0, len = permission.length; i < len; i++) {
+    //   flag = route.meta.permission.includes(permission[i])
+    //   if (flag) {
+    //     return true
+    //   }
+    // }
     return flag
   }
   return true

+ 1 - 1
src/store/modules/user.js

@@ -56,7 +56,7 @@ const 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_CHANNELNAME', users.parentOrgName)
               commit('SET_MUSTCHANGEPWD', users.mustChangePwd)
               Vue.ls.set('rolesAccess', { permissionList: users.permCodes }, 7 * 24 * 60 * 60 * 1000)
               commit('SET_AVATAR', res.avatar ? res.avatar : '')

+ 1 - 1
src/utils/domUtil.js

@@ -16,4 +16,4 @@ export const setDocumentTitle = function (title) {
   }
 }
 
-export const domTitle = '合作商运营管理平台'
+export const domTitle = '供应商运营管理平台'

+ 2 - 2
src/utils/request.js

@@ -38,7 +38,7 @@ const err = (error) => {
 // request interceptor
 service.interceptors.request.use(config => {
   const token = store.getters.token
-  config.headers['App-Type'] = 8 // 平台类型
+  config.headers['App-Type'] = 1 // 平台类型
   if (token) {
     config.headers['access-token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
   }
@@ -49,7 +49,7 @@ service.interceptors.request.use(config => {
 service.interceptors.response.use((response) => {
   console.log(response, 'response.data.status')
   if (window.location.pathname != '/user/login') {
-    if (response.data.status == '500') {
+    if (response.data.status == '500' || response.data.status == '900') {
       notification.destroy()
       notification.error({
         message: '提示',

+ 87 - 85
src/views/FinancialManagement/PaySettlementRecords.vue → src/views/FinancialManagement/CashOutManagement.vue

@@ -4,22 +4,18 @@
     <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="结算时间:">
+          <a-col :lg="8" :sm="12">
+            <a-form-item label="提现时间" :label-col="{ span:4 }" :wrapper-col="{ span:16}">
               <a-range-picker
-                style="width:100%"
                 id="PaySettlementRecords-queryOrderDate"
                 :disabledDate="disabledDate"
+                style="width: 100%;"
                 v-model="queryOrderDate"
-                format="YYYY-MM-DD"
+                :show-time="{ format: 'HH:mm' }"
+                format="YYYY-MM-DD HH:mm"
                 :placeholder="['开始时间', '结束时间']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :sm="12">
-            <a-form-item label="结算单号">
-              <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>
@@ -28,9 +24,9 @@
       </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 class="ftext" >
+      <a-button class="btn-cont" type="primary" @click="openModal" id="PaySettlementRecords-refresh">申请提现</a-button>
+      可提现余额:<span>{{ amountTotal }}</span>元</div>
     <!-- 列表 -->
     <div>
       <s-table
@@ -40,16 +36,10 @@
         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 :settleId="settleId" :openWriteOffModal="openWriteOffModal" @close="openWriteOffModal=false"></WriteOffDetailsModal>
+    <!-- 申请提现弹窗 -->
+    <cashOut-modal :openCashOutModal="openCashOutModal" @close="openCashOutModal=false" @refresh="refresh"></cashOut-modal>
   </a-card>
 </template>
 
@@ -59,43 +49,33 @@ import {
   STable,
   VSelect
 } from '@/components'
+import cashOutModal from './CashOutModal.vue'
 import {
   settlementRecordsList,
   settlementRecordsListTotal
 } from '@/api/FinancialManagement'
-import PaySettlementRecordsDetailsModal from './PaySettlementRecordsDetailsModal.vue'
-import WriteOffDetailsModal from './WriteOffDetailsModal.vue'
 export default {
-  name: 'SettlementRecordsList',
+  name: 'CashOutManagement',
   components: {
     VSelect,
     STable,
-    PaySettlementRecordsDetailsModal,
-    WriteOffDetailsModal
+    cashOutModal
   },
   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
-        })
-      },
+      openCashOutModal: false, // 是否打开申请提现弹窗
       queryOrderDate: undefined,
+      storeList: [
+        { id: 11, name: '常青二路店' },
+        { id: 112, name: '西部大道店' },
+        { id: 114, name: '渭滨路店' },
+        { id: 115, name: '未央店' },
+        { id: 116, name: '凤城八路店' }
+      ],
       queryParam: {
+        storeName: '', // 客户名称
+        partName: '', // 配件名称
+        status: '', // 分账状态
         settleNo: '',
         beginDate: '',
         endDate: ''
@@ -104,51 +84,80 @@ export default {
       amountTotal: 0, // 实收总金额
       itemId: '', // 每条数据id
       settleId: '',
-      openModalDetails: false, // 默认关闭详情弹窗
-      openWriteOffModal: false,
       columns: [{
         title: '序号',
         dataIndex: 'no',
-        width: '60px',
+        width: 60,
         align: 'center'
       },
       {
-        title: '结算单号',
-        dataIndex: 'settleNo',
-        width: '150px',
+        title: '提现时间',
+        dataIndex: 'settleDate',
+        width: 200,
         align: 'center'
       },
       {
-        title: '结算时间',
-        dataIndex: 'settleDate',
-        width: '150px',
+        title: '提现单号',
+        dataIndex: 'settleNo',
+        width: 150,
         align: 'center'
       },
       {
-        title: '结算订单数',
+        title: '申请提现金额',
         dataIndex: 'orderNum',
-        width: '150px',
+        width: 150,
         align: 'center',
         scopedSlots: {
           customRender: 'userInfo'
         }
       },
       {
-        title: '结算金额',
+        title: '开户名',
         dataIndex: 'realAmount',
         align: 'center',
-        width: '150px'
+        width: 150
       },
       {
-        title: '操作',
-        dataIndex: 'action',
-        width: '100px',
+        title: '银行卡号',
+        dataIndex: 'code',
         align: 'center',
-        scopedSlots: {
-          customRender: 'action'
+        width: 150
+      },
+      {
+        title: '状态',
+        dataIndex: 'status',
+        align: 'center',
+        width: 150
+      },
+      {
+        title: '备注',
+        dataIndex: 'remarks',
+        width: 100,
+        align: 'center',
+        customRender: (text) => {
+          return text || '--'
         }
       }
-      ]
+      ],
+      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
+        })
+      }
     }
   },
   methods: {
@@ -156,18 +165,6 @@ export default {
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
-    // 查看详情
-    handleDetail (record) {
-      this.itemId = record.settleNo
-      this.settleId = record.settleNo
-      console.log(this.itemId, record.settleType)
-      if (record.settleType === 'BUNDLE_SALE') {
-        this.openModalDetails = true
-        console.log(this.openModalDetails)
-      } else {
-        this.openWriteOffModal = true
-      }
-    },
     // 查询
     refresh () {
       this.$refs.table.refresh(true)
@@ -175,12 +172,7 @@ export default {
     },
     // 重置
     resetSearchForm () {
-      this.queryOrderDate = undefined
-      this.queryParam = {
-        settleNo: '',
-        beginDate: '',
-        endDate: ''
-      }
+      this.queryOrderDate = null
       this.$refs.table.refresh(true)
       this.getListTotal()
     },
@@ -198,8 +190,6 @@ export default {
         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) {
@@ -211,18 +201,30 @@ export default {
           }
         }
       })
+    },
+    // 打开提现弹窗
+    openModal () {
+      this.openCashOutModal = true
     }
+    //
 
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.resetSearchForm()
+      vm.queryOrderDate = null
     })
   }
 }
 </script>
 
-<style scoped>
+<style scoped lang="less">
+  .ftext{
+    margin-bottom: 15px;
+    font-size: 18px;
+    .btn-cont{
+      margin-right: 20px;
+    }
+  }
 	.ftext span {
 		color: #fa8c16;
 		font-weight: bold;

+ 107 - 0
src/views/FinancialManagement/CashOutModal.vue

@@ -0,0 +1,107 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      title="申请提现"
+      v-model="isshow"
+      @cancle="cancel"
+      :footer="null"
+      :width="600"
+      :centered="true">
+      <a-form-model ref="ruleForm" :model="form" :rules="rules" :labelCol="{span:5}" :wrapperCol="{span:15}">
+        <a-form-model-item required label="申请提现金额" prop="money">
+          <a-input-number style="width: 100%;" placeholder="请输入提现金额" :min="1" :max="10000" v-model="form.money" />
+        </a-form-model-item>
+        <a-form-model-item label="实际扣除金额" prop="finalMoney">
+          <span>{{ finalMoney }} &nbsp;&nbsp;元</span>&nbsp;&nbsp;&nbsp;&nbsp;(申请提现金额+提现手续费)
+        </a-form-model-item>
+        <a-form-model-item label="提现账户" >
+          <div >中国农业银行(阳光)</div>
+          <div>12345454679874</div>
+        </a-form-model-item>
+        <a-form-model-item class="submit-cont" :wrapper-col="{ span: 14, offset: 9 }">
+          <a-button type="primary" @click="submitForm('ruleForm')">
+            提交
+          </a-button>
+          <a-button style="margin-left: 10px" @click="cancel">
+            取消
+          </a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  SettlementRecordsDetailsList
+} from '@/api/FinancialManagement'
+export default {
+  props: {
+    openCashOutModal: {
+      type: Boolean,
+      default: false
+    },
+    settleId: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isshow: this.openCashOutModal,
+      form: {
+        money: ''
+      },
+      rules: {
+        money: [{ required: true, message: '请输入提现金额', trigger: ['change', 'blur'] }]
+      }
+    }
+  },
+  computed: {
+    finalMoney () {
+      return this.form.money ? (this.form.money + 0.5).toFixed(2) : 0
+    }
+  },
+  methods: {
+    // 提交
+    submitForm (formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          alert('submit!')
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+	  // 关闭弹窗
+	  cancel () {
+	    this.$refs['ruleForm'].resetFields()
+	    this.$emit('close')
+	  }
+  },
+  watch: {
+	  openCashOutModal (newValue, oldValue) {
+	  		  this.isshow = newValue
+	  },
+	  isshow (val) {
+	    if (!val) {
+        this.$refs['ruleForm'].resetFields()
+	      this.$emit('close')
+	    }
+	  },
+	  settleId (newValue, oldValue) {
+	    if (newValue && this.isshow) {
+	       this.$refs.table.refresh(newValue)
+	    }
+	  }
+  }
+}
+</script>
+
+<style scoped="scoped">
+  .submit-cont{
+    padding-top: 50px;
+  }
+</style>

+ 264 - 0
src/views/FinancialManagement/LedgerRecords.vue

@@ -0,0 +1,264 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model ref="queryForm" :model="queryParam" layout="inline" @keyup.enter.native="refresh">
+        <a-row :gutter="48">
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item label="分账时间" :label-col="{ span:4 }" :wrapper-col="{ span:16}">
+              <a-range-picker
+                id="PaySettlementRecords-queryOrderDate"
+                :disabledDate="disabledDate"
+                style="width: 100%;"
+                v-model="queryOrderDate"
+                :show-time="{ format: 'HH:mm' }"
+                format="YYYY-MM-DD HH:mm"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-model-item>
+            </a-form-model-item></a-col>
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item label="客户名称" prop="storeName" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-select
+                show-search
+                allowClear
+                placeholder="请输入客户名称"
+                option-filter-prop="children"
+                v-model="queryParam.storeName"
+              >
+                <a-select-option v-for="item in storeList" :key="item.id" :value="item.id">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item label="配件名称" prop="partName" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-input class="full-width" v-model="queryParam.partName" placeholder="请输入配件名称" allowClear id="PaySettlementRecords-queryOrderDate"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item label="配件编码" prop="settleNo" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-input class="full-width" v-model="queryParam.settleNo" placeholder="请输入配件编码" allowClear id="PaySettlementRecords-queryOrderDate"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-form-model-item label="分账状态" prop="status" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <v-select
+                v-model="queryParam.status"
+                ref="ledgerStatus"
+                id="purchasedSetmeal-status"
+                code="SETTLE_STATUS_ALL"
+                placeholder="请选择分账状态"
+                allowClear></v-select>
+            </a-form-model-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-model>
+      </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">
+      </s-table>
+    </div>
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  settlementRecordsList,
+  settlementRecordsListTotal
+} from '@/api/FinancialManagement'
+export default {
+  name: 'LedgerRecords',
+  components: {
+    VSelect,
+    STable
+  },
+  data () {
+    return {
+      queryOrderDate: undefined,
+      storeList: [
+        { id: 11, name: '常青二路店' },
+        { id: 112, name: '西部大道店' },
+        { id: 114, name: '渭滨路店' },
+        { id: 115, name: '未央店' },
+        { id: 116, name: '凤城八路店' }
+      ],
+      queryParam: {
+        storeName: undefined, // 客户名称
+        partName: '', // 配件名称
+        status: '', // 分账状态
+        settleNo: '',
+        beginDate: '',
+        endDate: ''
+      },
+      orderTotal: 0, // 订单数量
+      amountTotal: 0, // 实收总金额
+      itemId: '', // 每条数据id
+      settleId: '',
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '分账时间',
+        dataIndex: 'settleDate',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '客户名称',
+        dataIndex: 'settleNo',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '关联工单号',
+        dataIndex: 'orderNum',
+        width: 150,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'userInfo'
+        }
+      },
+      {
+        title: '配件名称',
+        dataIndex: 'realAmount',
+        align: 'center',
+        width: 150
+      },
+      {
+        title: '配件编码',
+        dataIndex: 'code',
+        align: 'center',
+        width: 150
+      },
+      {
+        title: '分账类型',
+        dataIndex: 'type',
+        align: 'center',
+        width: 150
+      },
+      {
+        title: '分账金额(¥)',
+        dataIndex: 'money',
+        align: 'center',
+        width: 150
+      },
+      {
+        title: '分账状态',
+        dataIndex: 'status',
+        align: 'center',
+        width: 150
+      },
+      {
+        title: '备注',
+        dataIndex: 'remarks',
+        width: 100,
+        align: 'center',
+        customRender: (text) => {
+          return text || '--'
+        }
+      }
+      ],
+      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
+        })
+      }
+    }
+  },
+  methods: {
+    // 禁止不可选日期
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
+    // 查询
+    refresh () {
+      this.$refs.table.refresh(true)
+      this.getListTotal()
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryOrderDate = undefined
+      this.$refs.queryForm.resetFields()
+      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 = ''
+      }
+      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.$refs.queryForm.resetFields()
+    })
+  }
+}
+</script>
+
+<style scoped>
+	.ftext span {
+		color: #fa8c16;
+		font-weight: bold;
+	}
+</style>

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

@@ -1,108 +0,0 @@
-<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(newValue)
-				}
-			}
-		}
-	}
-</script>
-
-<style>
-</style>

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

@@ -1,133 +0,0 @@
-<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
-    },
-    settleId: {
-      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')
-	    }
-	  },
-	  settleId (newValue, oldValue) {
-	    if (newValue && this.isshow) {
-	       this.$refs.table.refresh(newValue)
-	    }
-	  }
-  }
-}
-</script>
-
-<style>
-</style>

+ 0 - 206
src/views/RefundRecord/RefundRecord.vue

@@ -1,206 +0,0 @@
-<template>
-  <a-card :bordered="false">
-    <!-- 搜索条件 -->
-    <div class="orderCenter-searchForm">
-      <a-form ref="searchForm">
-        <a-row :gutter="48">
-          <a-col :span="8">
-            <a-form-item label="创建时间" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
-              <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:6 }" :wrapper-col="{ span:12}">
-              <a-input v-model.trim="searchForm.num" placeholder="请输入" allowClear  />
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="网点名称" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-              <v-select v-model="searchForm.name" placeholder="请选择" allowClear ></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :span="4">
-            <a-button style="margin-right: 10px;" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-            <a-button type="" @click="resetForm">重置</a-button>
-          </a-col>
-        </a-row>
-        <a-row :gutter="48">
-          <a-col :span="8">
-            <a-form-item label="服务项目" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
-              <v-select v-model="searchForm.fwname" placeholder="请选择" allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="退款状态" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-              <v-select v-model="searchForm.status" placeholder="请选择" allowClear ></v-select>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 合计 -->
-    <div class="total">
-      <a-icon type="info-circle" class="iconImg"/>
-      <strong>合计:</strong><span v-model="countHJ">{{countHJ}} 单</span><strong style="margin-left: 15px;">实收:</strong><span v-model="incomeHJ">{{incomeHJ}} 元</span>
-    </div>
-    <!-- 列表 -->
-    <s-table ref="table" size="default" :rowKey="(record) => record.id" :columns="columns" :data="loadData" bordered>
-      <!-- 退款状态 -->
-      <span slot="status" slot-scope="text, record">
-        <template></template>
-      </span>
-    </s-table>
-  </a-card>
-</template>
-
-<script>
-  import { STable, VSelect } from '@/components'
-  import getDate from '../../libs/getDate.js'
-  import moment from 'moment'
-  export default {
-    components: {
-      STable,
-      VSelect
-    },
-    data() {
-      return {
-        // 查询参数
-        searchForm: {
-          beginDate: null,  // 创建的开始时间
-          endDate: null,    // 创建的结束时间
-          name: '',         // 网点名称
-          num: '',          // 单号
-          fwname:'',        // 服务项目
-          status:''         // 状态
-        },
-        time: [
-          moment(getDate.getToday().starttime, this.dateFormat),
-          moment(getDate.getToday().endtime, this.dateFormat)
-        ],
-        dateFormat: 'YYYY-MM-DD',
-        countHJ:'40',
-        incomeHJ:'2000',
-        columns: [{
-            title: '创建时间',
-            dataIndex: 'createTime',
-            minWidth: '100',
-            align: 'center'
-
-          },
-          {
-            title: '交易流水号',
-            dataIndex: 'createTime',
-            minWidth: '100',
-            align: 'center'
-
-          },
-          {
-            title: '关联订单号',
-            dataIndex: 'createTime',
-            width: '100',
-            align: 'center'
-
-          },
-          {
-            title: '网点名称',
-            dataIndex: 'createTime',
-            minWidth: '100',
-            align: 'center'
-
-          },
-          {
-            title: '退款项目',
-            dataIndex: 'createTime',
-            minWidth: '100',
-            align: 'center'
-
-          },
-          {
-            title: '退款金额(¥)',
-            dataIndex: 'createTime',
-            minWidth: '40',
-            align: 'center'
-
-          },
-          {
-            title: '退款人',
-            dataIndex: 'createTime',
-            minWidth: '100',
-            align: 'center'
-
-          },
-          {
-            title: '退款状态',
-            dataIndex: 'createTime',
-            minWidth: '100',
-            align: 'center',
-            scopedSlots: {
-              customRender: 'status'
-            }
-          },
-          {
-            title: '备注',
-            dataIndex: 'status',
-            minWidth: '100',
-            align: 'center',
-          },
-        ],
-        // 加载数据方法 必须为 Promise 对象
-        loadData: parameter => {
-          // this.searchData.beginDate == null ? this.searchData.beginDate = getDate.getToday().starttime : null
-          // this.searchData.endDate == null ? this.searchData.endDate = getDate.getToday().endtime : null
-          // return getTenantsList(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
-          //       _item.status = _item.status + '' === '1'
-          //     }
-          //     return res.data
-          //   }
-          // })
-        }
-      }
-    },
-    methods: {
-      // 创建时间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)
-      },
-      // 重置
-      resetForm() {
-        this.$refs.searchForm.resetFields()
-        this.$refs.table.refresh(true)
-      },
-    },
-  }
-</script>
-
-<style lang="less">
-  .orderCenter-searchForm,
-  .addButton {
-    margin-bottom: 0;
-  }
-
-  .orderCenter-searchForm .ant-form-inline .ant-form-item {
-    margin-bottom: 15px;
-  }
-
-  .total {
-    margin-bottom: 24px;
-    width:100%;
-    background-color: #e6f7ff;
-    border: 1px solid #91d5ff;
-    padding: 8px 15px 8px 27px;
-    border-radius: 4px;
-    .iconImg{
-      color: #1890FF;
-      margin-right: 10px;
-    }
-  }
-</style>

+ 135 - 0
src/views/power/OperateJournal/OperateJournal.vue

@@ -0,0 +1,135 @@
+<template>
+  <a-card :bordered="false">
+    <div class="operateJournal">
+      <!-- 搜索框 -->
+      <div class="table-page-search-wrapper" style="margin-bottom: 15px;">
+        <a-form layout="inline">
+          <a-row :gutter="48">
+            <a-col :md="10" :sm="24">
+              <a-form-item label="操作时间">
+                <a-range-picker
+                  :format="dateFormat"
+                  show-time
+                  style="width: 100%;"
+                  :placeholder="['开始时间', '结束时间']"
+                  v-model="time"
+                  @change="onChange"
+                  id="OperateJournal-onChange"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="操作人"><a-input allowClear v-model.trim="queryParam.queryWord" :maxLength="30" placeholder="请输入" id="OperateJournal-queryWord"/></a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button style="margin-right: 10px;" type="primary" @click="$refs.table.refresh(true)" id="OperateJournal-refreshTable">查询</a-button>
+              <a-button type="" @click="resetForm" id="OperateJournal-resetForm">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        bordered>
+        <span slot="actDesc" slot-scope="text, record">{{ record.actDate }}-{{ record.actDesc }}</span>
+        <span slot="actorName" slot-scope="text, record">{{ record.actorName }}-{{ record.actorPhone }}</span>
+      </s-table>
+    </div>
+  </a-card>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { journalList } from '@/api/OperateJournal.js'
+import getDate from '@/libs/getDate'
+import moment from 'moment'
+export default {
+  name: 'OperateJournal',
+  components: { STable },
+  data () {
+    return {
+      // 列表
+      form: this.$form.createForm(this, {
+        name: 'OperateJournal'
+      }),
+      time: [moment(moment().startOf('day').valueOf()).format(this.dateFormat), moment(moment().valueOf()).format(this.dateFormat)],
+      queryParam: {
+        beginDate: null, // 查询的开始时间
+        endDate: null, // 查询的结束时间
+        queryWord: '' // 操作人
+      },
+      dateFormat: 'YYYY-MM-DD HH:mm:ss',
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          width: 60,
+          align: 'center'
+        },
+        {
+          title: '操作人',
+          dataIndex: 'actorName',
+          width: 100,
+          align: 'center',
+          scopedSlots: { customRender: 'actorName' }
+        },
+        {
+          title: 'IP',
+          dataIndex: 'ip',
+          width: 200,
+          align: 'center'
+        },
+        {
+          title: '日志明细',
+          dataIndex: 'actDesc',
+          width: 200,
+          align: 'center',
+          scopedSlots: { customRender: 'actDesc' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+		  const searchData = Object.assign(parameter, this.queryParam)
+		  if (this.time && this.time.length) {
+		    searchData.beginDate = moment(this.time[0]).format('YYYY-MM-DD HH:mm:ss')
+		    searchData.endDate = moment(this.time[1]).format('YYYY-MM-DD HH:mm:ss')
+		  } else {
+		    searchData.beginDate = ''
+		    searchData.endDate = ''
+		  }
+        return journalList(searchData).then(res => {
+          const no = (res.data.data.pageNo - 1) * res.data.data.pageSize
+          for (let i = 0; i < res.data.data.list.length; i++) {
+            const _item = res.data.data.list[i]
+            _item.no = no + i + 1
+          }
+          return res.data.data
+        })
+      }
+    }
+  },
+  methods: {
+    moment,
+    // 操作时间change
+    onChange (dates, dateStrings) {
+      this.queryParam.beginDate = dateStrings[0]
+      this.queryParam.endDate = dateStrings[1]
+    },
+    // 重置
+    resetForm () {
+      this.queryParam.beginDate = getDate.getToday().starttime
+      this.queryParam.endDate = getDate.getToday().endtime
+      this.time = [moment(moment().startOf('day').valueOf()).format(this.dateFormat), moment(moment().valueOf()).format(this.dateFormat)]
+      this.queryParam.queryWord = ''
+      this.$refs.table.refresh(true)
+    }
+  }
+
+}
+</script>
+
+<style></style>

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

@@ -0,0 +1,336 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      :centered="true"
+      width="45%">
+      <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=""
+                allowClear
+                id="codeItemModal-lookupCode"
+                v-decorator="['formData.lookupCode', {
+                  initialValue: formData.lookupCode,getValueFromEvent: $filterEmpty,
+                  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="请输入名称(最多30个字符)"
+                id="codeItemModal-dispName"
+                allowClear
+                :maxLength="30"
+                v-decorator="['formData.dispName', {
+                  initialValue: formData.dispName,getValueFromEvent: $filterEmpty,
+                  rules: [{ required: true, message: '请输入名称(最多30个字符)!' }] }]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <!-- 项编码 -->
+            <a-form-item label="项编码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+              <a-input
+                placeholder="请输入项编码"
+                id="codeItemModal-code"
+                allowClear
+                v-decorator="['formData.code', {
+                  initialValue: formData.code,getValueFromEvent: $filterEmpty,
+                  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"
+                id="codeItemModal-isEnable"
+                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="请输入(0~999999)之间的序号值"
+                oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+                id="codeItemModal-sort"
+                allowClear
+                v-decorator="['formData.sort', {
+                  initialValue: formData.sort,getValueFromEvent: $filterEmpty,
+                  rules: [{ required: true, message: '请输入(0~999999)之间的序号值!' }] }]"
+              />
+            </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=""
+                allowClear
+                id="codeItemModal-attr1"
+                v-decorator="['formData.attr1', {
+                  initialValue: formData.attr1,getValueFromEvent: $filterEmpty,
+                  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=""
+                allowClear
+                id="codeItemModal-attr2"
+                v-decorator="['formData.attr2', {
+                  initialValue: formData.attr2,getValueFromEvent: $filterEmpty,
+                  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=""
+                allowClear
+                id="codeItemModal-attr3"
+                v-decorator="['formData.attr3', {
+                  initialValue: formData.attr3,getValueFromEvent: $filterEmpty,
+                  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=""
+                allowClear
+                id="codeItemModal-attr4"
+                v-decorator="['formData.attr4', {
+                  initialValue: formData.attr4,getValueFromEvent: $filterEmpty,
+                  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=""
+                allowClear
+                id="codeItemModal-attr5"
+                v-decorator="['formData.attr5', {
+                  initialValue: formData.attr5,getValueFromEvent: $filterEmpty,
+                  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=""
+                allowClear
+                id="codeItemModal-attr6"
+                v-decorator="['formData.attr6', {
+                  initialValue: formData.attr6,getValueFromEvent: $filterEmpty,
+                  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,getValueFromEvent: $filterEmpty,
+                    rules: [] },
+                ]"
+                style="min-height: 50px;"
+                placeholder="请输入备注(最多500个字符)"
+                :maxLength="500"
+                id="codeItemModal-remarks"
+                autosize />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
+          <a-button type="primary" @click="handleSubmit()" id="codeItemModal-handleSubmit">
+            保存
+          </a-button>
+          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="codeItemModal-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) {
+          console.log(values.formData, ' formData.type222222222')
+          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 () {
+      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 scoped="scoped">
+  .modalBox{
+    width: 650px !important;
+  }
+  .ant-modal-footer {
+    display: none;
+  }
+</style>

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

@@ -0,0 +1,207 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      :centered="true"
+      width="45%">
+      <a-form :form="form" @submit="handleSubmit">
+        <!-- 类别编码 -->
+        <a-form-item label="类别编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input
+            id="codeModal-code"
+            placeholder="请输入类别编码"
+            :disabled="true"
+            allowClear
+            v-decorator="['formData.code', {
+              initialValue: formData.code,getValueFromEvent: $filterEmpty,
+              rules: [{ required: true, message: '请输入类别编码!' }] }]"
+          />
+        </a-form-item>
+
+        <!-- 名称 -->
+        <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input
+            placeholder="请输入名称30个字以内"
+            id="codeModal-name"
+            allowClear
+            :maxLength="30"
+            v-decorator="['formData.name', {
+              initialValue: formData.name,getValueFromEvent: $filterEmpty,
+              rules: [{ required: true, message: '请输入名称30个字以内!' }] }]"
+          />
+        </a-form-item>
+
+        <!-- 排序值 -->
+        <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-input
+            type="number"
+            placeholder="请输入排序值"
+            id="codeModal-sort"
+            allowClear
+            v-decorator="['formData.sort', {
+              initialValue: formData.sort,getValueFromEvent: $filterEmpty,
+              rules: [{ required: true, message: '请输入排序值!' }] }]"
+          />
+        </a-form-item>
+        <!-- 状态 -->
+        <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-radio-group
+            name="radioGroup"
+            id="codeModal-isEnable"
+            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,getValueFromEvent: $filterEmpty,
+                rules: [] },
+            ]"
+            :maxLength="500"
+            id="codeModal-remarks"
+            style="min-height: 60px;"
+            placeholder=""
+            autosize />
+        </a-form-item>
+
+        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
+          <a-button type="primary" @click="handleSubmit()" id="codeModal-handleSubmit">
+            保存
+          </a-button>
+          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="codeModal-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) {
+          console.log(values.formData, ' formData.type222222222')
+          saveLookUp(Object.assign(this.formData, values.formData)).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              this.$emit('refresh')
+              setTimeout(function () {
+                _this.cancel()
+              }, 300)
+            } else {
+              // this.$message.warning(res.message)
+            }
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      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>

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

@@ -0,0 +1,408 @@
+<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" id="dataDictionary-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="请输入数据名称" id="dataDictionary-dispName"/>
+                  </a-form-item>
+                </a-col>
+
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="状态">
+                    <a-select
+                      allowClear
+                      id="dataDictionary-isEnable"
+                      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)" id="dataDictionary-handSubmit">查询</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" id="dataDictionary-openCodeItemModal">新增数据</a-button>
+            <!-- <a-button type="" icon="delete" @click="delectAll">批量删除</a-button> -->
+            <a-button type="" icon="reload" @click="$refs.table.refresh(true)" id="dataDictionary-refreshTable">刷新数据</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)" id="dataDictionary-handleEdit">编辑</a>
+                <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)" id="dataDictionary-delect">删除</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 => {
+        console.log(parameter, '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 () {
+      console.log({ code: this.code })
+      listLookUp({ code: this.code }).then(res => {
+        console.log(res, 'res1111111')
+        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()
+            }
+          }).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 => {
+            console.log(res, 'res1111')
+            if (res.status == 200) {
+              _this.$message.success('删除成功')
+              _this.$refs.table.refresh()
+            }
+          }).catch(() => {
+            _this.$message.success('删除失败, 请稍后重试')
+          })
+        }
+      })
+    },
+    handleEdit (row) {
+      console.log(row, 'row')
+      this.showItemCodeModal = true
+      this.itemCodeData = row
+    }
+
+  },
+  mounted () {
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, { name: 'miniForm' })
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getCodeList()
+    })
+  },
+  watch: {
+    selectedKey (newValue, oldValue) {
+      console.log(newValue, 'newValue')
+      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>

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

@@ -0,0 +1,423 @@
+<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" id="jobs-name" placeholder="定时器名称" allowClear @pressEnter="$refs.table.refresh(true)"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" id="jobs-handSubmit">查询</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <div class="btns">
+      <a-button @click="addJob()" type="primary" icon="plus-circle" id="jobs-addJob">新增JOB</a-button>
+      <a-button @click="startJob()" type="default" icon="play-circle" id="jobs-startJob">启动</a-button>
+      <a-button @click="stopJob()" type="default" icon="stop" id="jobs-stopJob">停止</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)" id="jobs-editJob">编辑</a>
+          <a-divider type="vertical" />
+          <a @click="deleteRow(record)" id="jobs-deleteRow">删除</a>
+          <a-divider type="vertical" />
+          <a @click="syncJob(record)" id="jobs-syncJob">立即运行一次</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 id="jobs-name" 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 id="jobs-group" 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 id="jobs-className" 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" id="jobs-cron">
+            <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="禁用" id="jobs-isEnable" 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" id="jobs-handleCancel">取消</a-button>
+          <a-button htmlType="submit" :loading="loading" type="primary" id="jobs-submit">
+            确定
+          </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>

+ 302 - 0
src/views/power/menu/childModal.vue

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

+ 487 - 0
src/views/power/menu/menu.vue

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

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

@@ -0,0 +1,443 @@
+<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" id="register-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" id="register-addChild">新增子分类</a-button>
+            <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTop" id="register-addTop">新增根节点</a-button>
+            <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="remove()" id="register-remove">删除</a-button>
+          </a-form-item>
+          <!-- 父路径 -->
+          <a-form-item label="父路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              disabled
+              placeholder=""
+              id="register-parentPath"
+              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="请输入节点显示名称30个字以内"
+              id="register-dispname"
+			  :maxLength="30"
+			  allowClear
+              v-decorator="['formData.dispname', {
+                initialValue: formData.dispname,getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入节点显示名称30个字以内!' }] }]"
+            />
+          </a-form-item>
+          <!-- 名称 -->
+          <a-form-item label="编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入节点code"
+              id="register-name"
+			  allowClear
+              v-decorator="['formData.name', {
+                initialValue: formData.name,getValueFromEvent: $filterEmpty,
+                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="请输入节点值"
+			  allowClear
+              id="register-value"
+              v-decorator="['formData.value', {
+                initialValue: formData.value,getValueFromEvent: $filterEmpty,
+                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"
+			  allowClear
+              id="register-index"
+              placeholder="请输入正确的序号"
+              v-decorator="['formData.index', {
+                initialValue: formData.index,getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入正确的序号!' }] }]"
+            />
+          </a-form-item>
+
+          <!-- 状态 -->
+          <a-form-item label="是否启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-radio-group
+              name="radioGroup"
+              id="register-isEnable"
+              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,getValueFromEvent: $filterEmpty,
+                  rules: [] },
+              ]"
+			  :maxLength="500"
+              style="min-height: 60px;"
+              placeholder="输入内容为500个字以内"
+              id="register-desc"
+              autosize />
+          </a-form-item>
+
+          <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
+            <a-button type="primary" @click="handleSubmit()" id="register-handleSubmit">
+              保存
+            </a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="reset" id="register-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>

+ 12 - 29
src/views/power/role/menuModal.vue

@@ -1,10 +1,8 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="roleName" centered v-model="isshow" @cancle="cancel">
+    <a-modal class="modalBox" :title="roleName" v-model="isshow" @cancle="cancel" :centered="true">
       <a-form class="form-box" style="max-height: 600px;" :form="form" @submit="handleSubmit">
-
         <a-tree
-          id="role-menu-tree"
           checkable
           @check="onCheck"
           @expand="onExpand"
@@ -13,13 +11,12 @@
           v-model="checkedKeys"
           :treeData="treeData"
         />
-
       </a-form>
       <a-form-item :wrapper-col="{ offset: 15 }">
-        <a-button id="role-menu-btn-save" type="primary" @click="handleSubmit()">
+        <a-button type="primary" @click="handleSubmit()" id="menuModal-handleSubmit">
           保存
         </a-button>
-        <a-button id="role-menu-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
+        <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="menuModal-handleCancel">
           取消
         </a-button>
       </a-form-item>
@@ -63,8 +60,6 @@ export default {
   },
   methods: {
     onExpand (expandedKeys) {
-      // if not set autoExpandParent to false, if children expanded, parent can not collapse.
-      // or, you can remove all expanded children keys.
       this.expandedKeys = expandedKeys
       this.autoExpandParent = false
     },
@@ -81,19 +76,20 @@ export default {
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
+          console.log(this.checkedData)
           if (this.checkedData.length == 0) {
             return this.$message.warning('请先选择菜单')
           }
           const arr = this.checkedData.join(',')
           addMenuPower({ id: this.id, menuIds: arr }).then(res => {
-            if (res.status == 200) {
+            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)
+              // this.$message.error(res.message)
             }
           })
         }
@@ -101,25 +97,16 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        centered: true,
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
       this.roleName = ''
       this.id = ''
       this.checkedKeys = []
+      this.expandedKeys = []
     },
+    // 查找叶子节点
     findLeaf (data, arr) {
       for (let i = 0; i < data.length; i++) {
         const node = data[i]
@@ -130,6 +117,7 @@ export default {
             return item == node.id
           })
           if (hasNode) {
+            this.expandedKeys.push(node.id)
             this.checkedKeys.push(node.id)
           }
         }
@@ -151,14 +139,9 @@ export default {
           this.roleName = '分配权限' + '(' + this.data.role.name + ')'
           if (this.data.role.menuIds) {
             const arr = this.data.role.menuIds.split(',')
-            const temp = []
-            arr.map(item => {
-              temp.push(Number(item))
-            })
-            this.checkedData = temp
-            this.expandedKeys = temp
+            this.checkedData = arr
             // 找出叶子节点
-            this.findLeaf(this.treeData, temp)
+            this.findLeaf(this.treeData, arr)
           }
         }
       } else {

+ 135 - 107
src/views/power/role/roleList.vue

@@ -1,34 +1,34 @@
 <template>
   <a-card :bordered="false">
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline">
         <a-row :gutter="48">
           <a-col :md="6" :sm="24">
             <a-form-item label="角色名称">
-              <a-input allowClear v-model.trim="queryParam.name" id="role-name" placeholder="请输入角色名称"/>
+              <a-input
+                allowClear
+                v-model.trim="queryParam.name"
+                placeholder="请输入角色名称"
+                :maxLength="30"
+                id="roleList-name"
+                @pressEnter="$refs.table.refresh(true)" />
             </a-form-item>
           </a-col>
+
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select
-                code="ENABLE_STATE"
-                ref="isEnable"
-                v-model="queryParam.isEnable"
-                id="role-enable"
-                allowClear
-                placeholder="请选择状态" ></v-select>
+              <v-select code="ENABLE_FLAG" v-model="queryParam.isEnable" allowClear placeholder="请选择状态" id="roleList-isEnable"></v-select>
             </a-form-item>
           </a-col>
-          <a-col :md="4" :sm="24" class="flex-sp">
-            <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 :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" id="roleList-handSubmit" style="margin-right: 10px;">查询</a-button>
+            <a-button type="" @click="reset" id="roleList-reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
     </div>
-    <a-divider/>
     <div class="table-operator">
-      <a-button id="role-btn-add" v-hasPermission="'B_power_role_add'" type="primary" icon="plus" @click="openModal">新建</a-button>
+      <a-button type="primary" icon="plus" @click="openModal" id="roleList-openModal" v-hasPermission="'B_power_role_add'" style="margin-top:18px ;">新增</a-button>
     </div>
 
     <s-table
@@ -37,23 +37,34 @@
       rowKey="id"
       :columns="columns"
       :data="loadData"
-      bordered
-    >
-      <!-- 状态 -->
+      bordered>
+      <!-- 启用禁用 -->
       <span slot="status" slot-scope="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>
+        <a-switch
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          id="roleList-isEnable"
+          v-model="record.isEnable"
+          v-hasPermission="'B_power_role_enable'"
+          @change="changeFlagHandle(text, record)" />
+        <span v-if="!$hasPermissions('B_power_role_enable')">--</span>
       </span>
       <!-- 角色描述 -->
-      <span slot="remarks" slot-scope="text, record">{{ record.remarks || '--' }}</span>
-
+      <template slot="remarks" slot-scope="text, record">
+        <span :title="record.remarks" style="display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;max-width: 100%;">{{ record.remarks ?record.remarks : '--' }}</span>
+      </template>
+      <!-- 操作 -->
       <span slot="action" slot-scope="text, record">
-        <template>
-          <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>
+        <a-icon type="setting" title="菜单权限" class="actionBtn icon-orange" @click="openMenuModal(record)" v-hasPermission="'M_power_role_menu'"/>
+        <a-icon type="edit" title="编辑" class="actionBtn icon-blues" @click="handleEdit(record)" v-hasPermission="'B_power_role_edit'" />
+        <a-icon
+          type="delete"
+          title="删除"
+          class="actionBtn icon-red"
+          v-if="$hasPermissions('B_power_role_del') && !record.isEnable"
+          @click="delect(record)" />
+        <span v-if="!$hasPermissions('M_power_role_menu') && !$hasPermissions('B_power_role_edit') && (!$hasPermissions('B_power_role_del') && !record.isEnable)">--</span>
+      </span>
       </span>
     </s-table>
     <roleModal :visible="showModal" :data="itemData" @refresh="refreshTable" @close="showModal = false"></roleModal>
@@ -62,14 +73,25 @@
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
+import {
+  STable,
+  VSelect
+} from '@/components'
 import roleModal from './roleModal.vue'
 import menuModal from './menuModal.vue'
-import { getPowerRoleList, updateEnableStatus, delectRolePower, getMenuList } from '@/api/power-role.js'
+import {
+  getPowerRoleList,
+  updateEnableStatus,
+  delectRolePower,
+  getMenuList
+} from '@/api/power-role.js'
 export default {
   name: 'RoleList',
   components: {
-    STable, VSelect, roleModal, menuModal
+    STable,
+    VSelect,
+    roleModal,
+    menuModal
   },
   data () {
     return {
@@ -83,46 +105,55 @@ export default {
       itemData: {}, // 编辑行数据
       menuData: {},
       // 表头
-      columns: [
-        {
-          title: '序号',
-          dataIndex: 'no',
-          width: '40',
-          align: 'center'
-        },
-        {
-          title: '角色名称',
-          dataIndex: 'name',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '角色描述',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'remarks' }
-        },
-        {
-          title: '状态',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'status' }
-        },
-        {
-          title: '创建时间',
-          dataIndex: 'createDate',
-          width: '120',
-          align: 'center'
-        },
-        {
-          title: '操作',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'action' }
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '角色名称',
+        dataIndex: 'name',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '角色描述',
+        dataIndex: 'remarks',
+        width: 200,
+        ellipsis: true, // 内容超过宽度 自动出现省略号
+        align: 'center',
+        scopedSlots: {
+          customRender: 'remarks'
         }
+      },
+      {
+        title: '状态',
+        width: 150,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'status'
+        }
+      },
+      {
+        title: '操作',
+        width: 150,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
+        console.log(parameter, 'parameter')
+
         return getPowerRoleList(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++) {
@@ -146,6 +177,12 @@ export default {
     refreshTable () {
       this.$refs.table.refresh(true)
     },
+    // 重置
+    reset () {
+      this.queryParam.name = ''
+      this.queryParam.isEnable = ''
+      this.refreshTable()
+    },
     // 新建
     openModal () {
       this.showModal = true
@@ -158,26 +195,22 @@ export default {
     // 获取菜单树列表
     getMenuList (id) {
       const _this = this
-      getMenuList({ id: id }).then(res => {
+      getMenuList({
+        id: id
+      }).then(res => {
         if (res.status == 200) {
           _this.menuData = res.data
           this.showMenuModal = true
+          console.log(res.data, 'this.itemData')
         }
       })
     },
-    //  重置
-    reset () {
-      this.queryParam = {
-        name: '',
-        isEnable: ''
-      }
-      this.$refs.table.refresh(true)
-    },
+
     // 删除
     delect (row) {
       const _this = this
       this.$confirm({
-        title: '提示',
+        title: '警告',
         centered: true,
         content: '删除后无法恢复,确认删除?',
         okText: '确定',
@@ -186,19 +219,17 @@ export default {
           delectRolePower({
             id: row.id
           }).then(res => {
+            console.log(res, 'res1111')
             if (res.status == 200) {
-              _this.$message.success('删除成功')
+              _this.$message.success(res.message)
               _this.$refs.table.refresh()
-            } else {
-              this.$message.error(res.message)
             }
-          }).catch(() => {
-            _this.$message.success('删除失败, 请稍后重试')
           })
         }
       })
     },
     handleEdit (row) {
+      console.log(row, 'row')
       this.showModal = true
       this.itemData = row
     },
@@ -209,10 +240,9 @@ export default {
         flag: record.isEnable ? '1' : '0'
       }
       updateEnableStatus(_data).then(res => {
-        if (res.status == 200) {
-          this.$message.success('修改成功')
+        if (res.status + '' === '200') {
+          this.$message.success(res.message)
         } else {
-          this.$message.error(res.message)
           record.isEnable = !record.isEnable
         }
       })
@@ -221,27 +251,25 @@ export default {
 }
 </script>
 <style scoped>
-  .table-page-search-wrapper .ant-form-inline .ant-form-item{
-    margin-bottom: 0;
-  }
-  .flex-sp{
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-  }
-  .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;
-  }
-  .menu-text {
-    background-color: #f90;
-  }
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 0;
+	}
+
+	.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;
+	}
+
+	.menu-text {
+		background-color: #f90;
+	}
 </style>

+ 32 - 28
src/views/power/role/roleModal.vue

@@ -1,23 +1,31 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" centered v-model="isshow" @cancle="cancel">
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      width="45%"
+      :centered="true">
       <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="请输入角色名称"
+            placeholder="请输入角色名称(最多30个字符)"
+            allowClear
+            :maxLength="30"
+            id="roleModal-name"
             v-decorator="['formData.name', {
-              initialValue: formData.name,
-              rules: [{ required: true, message: '请输入角色名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+              initialValue: formData.name,getValueFromEvent: $filterEmpty,
+              rules: [{ required: true, message: '请输入角色名称(最多30个字符)!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
           />
         </a-form-item>
 
         <!-- 状态 -->
         <a-form-item label="状态" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
-            id="role-add-enable"
             name="radioGroup"
+            id="roleModal-isEnable"
             v-decorator="[
               'formData.isEnable',
               {
@@ -32,22 +40,23 @@
 
         <a-form-item label="角色描述" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-textarea
-            id="role-add-remarks"
+            id="roleModal-remarks"
+            :maxLength="500"
             v-decorator="[
               'formData.remarks',
-              { initialValue: formData.remarks,
+              { initialValue: formData.remarks,getValueFromEvent: $filterEmpty,
                 rules: [] },
             ]"
             style="min-height: 60px;"
-            placeholder=""
+            placeholder="请输入角色描述(最多500个字符)"
             autosize />
         </a-form-item>
 
-        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button id="role-add-btn-save" type="primary" @click="handleSubmit()">
+        <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
+          <a-button type="primary" @click="handleSubmit()" id="roleModal-handleSubmit" :style="{ marginRight: '15px' }">
             保存
           </a-button>
-          <a-button id="role-add-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '15px' }" @click="handleCancel()" id="roleModal-handleCancel">
             取消
           </a-button>
         </a-form-item>
@@ -79,7 +88,7 @@ export default {
   },
   data () {
     return {
-      titleText: '添加角色',
+      titleText: '新增角色',
       isshow: this.visible,
       formLayout: 'horizontal',
       form: this.$form.createForm(this, { name: 'roleModal' }),
@@ -96,20 +105,23 @@ export default {
       this.clear()
       this.$emit('close')
     },
+
     // 保存提交
     handleSubmit () {
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
+          console.log(values.formData, ' formData.type222222222')
           saveRolePower(Object.assign(this.formData, values.formData)).then(res => {
-            if (res.status == 200) {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
               this.$message.success(res.message ? res.message : '保存成功')
               this.$emit('refresh')
               setTimeout(function () {
                 _this.cancel()
               }, 300)
             } else {
-              this.$message.error(res.message)
+              // this.$message.error(res.message)
             }
           })
         }
@@ -117,18 +129,7 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        centered: true,
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
@@ -138,6 +139,8 @@ export default {
       this.formData.remarks = ''
     }
 
+  },
+  mounted () {
   },
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'roleModal' })
@@ -153,8 +156,9 @@ export default {
           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.titleText = '添加角色'
+          this.titleText = '新增角色'
         }
       } else {
         this.cancel()

+ 147 - 122
src/views/power/user/userList.vue

@@ -1,39 +1,52 @@
 <template>
   <a-card :bordered="false">
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline">
         <a-row :gutter="48">
           <a-col :md="6" :sm="24">
             <a-form-item label="用户名称">
-              <a-input allowClear v-model.trim="queryParam.name" id="user-name" placeholder="请输入用户名称"/>
+              <a-input
+                allowClear
+                v-model.trim="queryParam.name"
+                placeholder="请输入用户名称"
+                id="userList-name"
+                :maxLength="30"
+                @pressEnter="$refs.table.refresh(true)" />
             </a-form-item>
           </a-col>
+
           <a-col :md="6" :sm="24">
             <a-form-item label="手机号码">
-              <a-input allowClear v-model.trim="queryParam.phone" id="user-phone" placeholder="请输入手机号码"/>
+              <a-input
+                allowClear
+                v-model.trim="queryParam.phone"
+                placeholder="请输入手机号码"
+                :maxLength="11"
+                id="userList-phone"
+                @pressEnter="$refs.table.refresh(true)" />
             </a-form-item>
           </a-col>
+
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select
-                code="ENABLE_STATE"
-                v-model="queryParam.loginFlag"
-                ref="loginFlag"
-                id="user-loginFlag"
-                allowClear
-                placeholder="请选择状态"></v-select>
+              <v-select code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态" id="userList-check-enable-state"></v-select>
             </a-form-item>
           </a-col>
-          <a-col :md="4" :sm="24" class="flex-sp">
-            <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 :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" id="userList-handSubmit" style="margin-right: 10px;">查询</a-button>
+            <a-button type="" @click="reset" id="userList-reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
     </div>
-    <a-divider/>
     <div class="table-operator">
-      <a-button id="user-btn-add" v-hasPermission="'B_power_user_add'" type="primary" icon="plus" @click="openModal">新建</a-button>
+      <a-button
+        type="primary"
+        icon="plus"
+        @click="openModal"
+        id="userList-openModal"
+        v-hasPermission="'B_power_user_add'"
+        style="margin-top:18px ;">新增</a-button>
     </div>
 
     <s-table
@@ -42,25 +55,37 @@
       rowKey="id"
       :columns="columns"
       :data="loadData"
-      bordered
-    >
+      bordered>
       <span slot="status" slot-scope="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>
+        <a-switch
+          v-hasPermission="'B_power_user_enable'"
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          v-model="record.loginFlag"
+          @change="changeFlagHandle(text, record)"
+          id="userList-changeFlagHandle" />
+        <span v-if="!$hasPermissions('B_power_user_enable')">--</span>
       </span>
-      <div slot="roleNames" slot-scope="text, record" :title="record.roleNames">
-        <span v-if="record.roleNames">{{ record.roleNames.substr(0,12) + '...' }}</span>
-        <span v-else>无</span>
-      </div>
       <span slot="action" slot-scope="text, record">
-        <template>
-          <div >
-            <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>
+        <a-icon
+          type="unlock"
+          title="重置密码"
+          v-if="$hasPermissions('B_power_user_resetPsd') && record.loginFlag==1"
+          class="actionBtn icon-orange"
+          @click="resetPassword(record)" />
+        <a-icon
+          v-hasPermission="'B_power_user_edit'"
+          type="edit"
+          title="编辑"
+          class="actionBtn icon-blues"
+          @click="handleEdit(record)"
+        />
+        <a-icon
+          type="delete"
+          title="删除"
+          class="actionBtn icon-red"
+          v-if="$hasPermissions('B_power_user_del') && record.loginFlag==0"
+          @click="delect(record)"/>
       </span>
     </s-table>
     <userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :data="itemData" @close="showModal = false"></userModal>
@@ -68,13 +93,23 @@
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
+import {
+  STable,
+  VSelect
+} from '@/components'
 import userModal from './userModal.vue'
-import { resetPSD, updateEnableStatus, getPowerUserList, delectUserPower } from '@/api/power-user.js'
+import {
+  resetPSD,
+  updateEnableStatus,
+  getPowerUserList,
+  delectUserPower
+} from '@/api/power-user.js'
 export default {
   name: 'UserList',
   components: {
-    STable, VSelect, userModal
+    STable,
+    VSelect,
+    userModal
   },
   data () {
     return {
@@ -87,54 +122,56 @@ export default {
       showModal: false,
       itemData: {}, // 编辑行数据
       // 表头
-      columns: [
-        {
-          title: '序号',
-          dataIndex: 'no',
-          width: '40',
-          align: 'center'
-        },
-        {
-          title: '用户名称',
-          dataIndex: 'name',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '手机号码',
-          dataIndex: 'phone',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '角色',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'roleNames' }
-        },
-        {
-          title: '状态',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'status' }
-        },
-        {
-          title: '创建时间',
-          dataIndex: 'createDate',
-          width: '120',
-          align: 'center'
-        },
-        {
-          title: '操作',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'action' }
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: 120,
+        align: 'center'
+      },
+      {
+        title: '用户名称',
+        dataIndex: 'name',
+        width: 100,
+        align: 'center'
+      },
+      {
+        title: '手机号码',
+        dataIndex: 'phone',
+        width: 100,
+        align: 'center'
+      },
+      {
+        title: '角色',
+        width: 100,
+        align: 'center',
+        dataIndex: 'roleNames'
+      },
+      {
+        title: '状态',
+        width: 100,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'status'
+        }
+      },
+      {
+        title: '操作',
+        width: 100,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
         }
+      }
       ],
       // 加载数据方法 必须为 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]
@@ -162,25 +199,28 @@ export default {
       this.showModal = true
       this.itemData = {}
     },
+    // 重置
+    reset () {
+      this.queryParam.name = ''
+      this.queryParam.phone = '',
+      this.queryParam.loginFlag = ''
+      this.refreshTable()
+    },
     // 重置密码
     resetPassword (row) {
       resetPSD({
         id: row.id
       }).then(res => {
         if (res.status == 200) {
-          this.$message.success('密码重置成功')
-        } else {
-          this.$message.error(res.message)
+          this.$message.success(res.message)
         }
-      }).catch(() => {
-        this.$message.success('密码重置失败, 请稍后重试')
       })
     },
     // 删除
     delect (row) {
       const _this = this
       this.$confirm({
-        title: '提示',
+        title: '警告',
         centered: true,
         content: '删除后无法恢复,确认删除?',
         okText: '确定',
@@ -190,26 +230,13 @@ export default {
             id: row.id
           }).then(res => {
             if (res.status == 200) {
-              _this.$message.success('删除成功')
+              _this.$message.success(res.message)
               _this.$refs.table.refresh()
-            } else {
-              _this.$message.error(res.message)
             }
-          }).catch(() => {
-            _this.$message.success('删除失败, 请稍后重试')
           })
         }
       })
     },
-    //  重置
-    reset () {
-      this.queryParam = {
-        name: '',
-        phone: '',
-        loginFlag: ''
-      }
-      this.$refs.table.refresh(true)
-    },
     getBizStr (storeBizList) {
       const str = []
       storeBizList.forEach(item => {
@@ -218,6 +245,7 @@ export default {
       return str.join(',')
     },
     handleEdit (row) {
+      console.log(row, 'row')
       this.showModal = true
       this.itemData = row
     },
@@ -229,9 +257,8 @@ export default {
       }
       updateEnableStatus(_data).then(res => {
         if (res.status + '' === '200') {
-          this.$message.success('修改成功')
+          this.$message.success(res.message)
         } else {
-          this.$message.error(res.message)
           record.loginFlag = !record.loginFlag
         }
       })
@@ -240,27 +267,25 @@ export default {
 }
 </script>
 <style scoped>
-  .table-page-search-wrapper .ant-form-inline .ant-form-item{
-    margin-bottom: 0;
-  }
-  .flex-sp{
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-  }
-  .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;
-  }
-  .reset-text {
-    background-color: #31b50b;
-  }
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 0;
+	}
+
+	.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;
+	}
+
+	.reset-text {
+		background-color: #31b50b;
+	}
 </style>

+ 60 - 36
src/views/power/user/userModal.vue

@@ -1,17 +1,25 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" centered v-model="isshow" @cancle="cancel">
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      width="45%"
+      :centered="true">
       <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="请输入用户名称"
+                placeholder="请输入用户名称(最多30个字符)"
+                allowClear
+                id="userModal-name"
+                :maxLength="30"
                 v-decorator="['formData.name', {
-                  initialValue: formData.name,
-                  rules: [{ required: true, message: '请输入用户名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+                  initialValue: formData.name,getValueFromEvent: $filterEmpty,
+                  rules: [{ required: true, message: '请输入用户名称(最多30个字符)!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
               />
             </a-form-item>
           </a-col>
@@ -19,22 +27,25 @@
             <!-- 手机号码 -->
             <a-form-item label="手机号码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
-                id="user-add-phone"
                 placeholder="请输入手机号码"
+                allowClear
+                :maxLength="11"
+                id="userModal-phone"
                 v-decorator="['formData.phone', {
-                  initialValue: formData.phone,
+                  initialValue: formData.phone,getValueFromEvent: $filterEmpty,
                   rules: [{ required: true, message: '请输入手机号码!' },{pattern:/^[1][0-9]{10}$/, message: '请输入正确的手机号码!'}] }]"
               />
             </a-form-item>
           </a-col>
         </a-row>
+
         <a-row :gutter="24">
           <!-- 性别 -->
           <a-col :span="12">
             <a-form-item label="性别" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <v-select
-                id="user-add-sex"
                 code="SEX"
+                id="userModal-sex"
                 v-decorator="[
                   'formData.sex',
                   {
@@ -49,8 +60,8 @@
           <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"
+                id="userModal-loginFlag"
                 v-decorator="[
                   'formData.loginFlag',
                   {
@@ -58,8 +69,8 @@
                     rules: [{ required: true, message: '请选择状态!' }] },
                 ]"
               >
-                <a-radio :value="1"></a-radio>
-                <a-radio :value="0"></a-radio>
+                <a-radio :value="1">启用</a-radio>
+                <a-radio :value="0">禁用</a-radio>
               </a-radio-group>
 
             </a-form-item>
@@ -69,16 +80,17 @@
           <a-col :span="24">
             <a-form-item label="角色" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-select
-                id="user-add-role"
+                id="userModal-roleNames"
                 v-decorator="[
                   'formData.roleNames',
                   {
                     initialValue: formData.roleNames,
-                    rules: [{ required: true, message: '请选择状态!' }] },
+                    rules: [{ required: true, message: '请选择角色!' }] },
                 ]"
                 mode="multiple"
                 style="width: 100%"
                 placeholder="请选择角色"
+                allowClear
               >
                 <a-select-option
                   v-for="item in roleList"
@@ -89,33 +101,36 @@
               </a-select>
             </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
-                id="user-add-remarks"
+                id="userModal-remarks"
+                :maxLength="500"
                 v-decorator="[
                   'formData.remarks',
                   {
-                    initialValue: formData.remarks,
+                    initialValue: formData.remarks,getValueFromEvent: $filterEmpty,
                     rules: [] },
                 ]"
                 style="min-height: 50px;"
-                placeholder=""
+                placeholder="请输入备注(最多500个字符)"
                 autosize />
             </a-form-item>
           </a-col>
         </a-row>
-        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button id="user-add-btn-save" type="primary" @click="handleSubmit()">
+        <a-form-item :wrapper-col="{ span: 24, offset: 10}">
+          <a-button type="primary" @click="handleSubmit()" id="userModal-handleSubmit" :style="{ marginRight: '15px' }">
             保存
           </a-button>
-          <a-button id="user-add-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '15px' }" @click="handleCancel()" id="userModal-handleCancel">
             取消
           </a-button>
         </a-form-item>
       </a-form>
+
     </a-modal>
   </div>
 </template>
@@ -142,7 +157,7 @@ export default {
   },
   data () {
     return {
-      titleText: '添加用户',
+      titleText: '新增用户',
       isshow: this.visible,
       formLayout: 'horizontal',
       form: this.$form.createForm(this, { name: 'miniForm' }),
@@ -155,6 +170,7 @@ export default {
         sex: '',
         remarks: ''
       }
+
     }
   },
   methods: {
@@ -162,21 +178,26 @@ export default {
       this.clear()
       this.$emit('close')
     },
+
     // 保存提交
     handleSubmit () {
       const _this = this
       this.form.validateFields((err, values) => {
+        console.log(values, 'values222')
         if (!err) {
           values.formData.roleNames = values.formData.roleNames.join(',')
+          console.log(values.formData, ' formData.type222222222')
+          console.log(Object.assign({ id: this.data.id ? this.data.id : '' }, values.formData))
           saveUserPower(Object.assign({ id: this.data.id ? this.data.id : '' }, values.formData)).then(res => {
-            if (res.status == 200) {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
               this.$message.success(res.message ? res.message : '保存成功')
               this.$emit('refresh')
               setTimeout(function () {
                 _this.cancel()
               }, 300)
             } else {
-              this.$message.error(res.message)
+              // this.$message.error(res.message)
             }
           })
         }
@@ -184,18 +205,7 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        centered: true,
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
@@ -207,16 +217,19 @@ export default {
       this.formData.sex = ''
       this.formData.remarks = ''
     },
+
     // 获取角色列表接口
     getRoleList () {
       getRoleList().then(res => {
-        if (res.status == 200) {
+        console.log(res, 'res--role')
+        if (res.status + '' === '200') {
           this.roleList = res.data
         } else {
           this.$message.warning(res.message)
         }
       })
     }
+
   },
   mounted () {
     this.getRoleList()
@@ -235,9 +248,13 @@ export default {
           this.formData = Object.assign({}, this.data)
           delete this.formData.no
           let roleNames = this.formData.roleNames
+          console.log(roleNames, 'roleNames')
           if (roleNames) {
             roleNames = roleNames.split(',')
+            console.log(roleNames, 'roleNames22')
             const arr = []
+            console.log(this.roleList, 'this.roleList')
+
             roleNames.map(item => {
               const row = this.roleList.find(a => {
                 return a.name == item
@@ -246,13 +263,18 @@ export default {
                 arr.push(row.id)
               }
             })
+
+            console.log(arr, 'arrs')
             this.formData.roleNames = arr
           } else {
             this.formData.roleNames = []
           }
+
           this.formData.loginFlag = Number(this.formData.loginFlag)
+          // this.formData.sex = Number(this.formData.sex)
+          console.log(this.formData, 'this.formData')
         } else {
-          this.titleText = '添加用户'
+          this.titleText = '新增用户'
         }
       } else {
         this.cancel()
@@ -263,6 +285,8 @@ export default {
 </script>
 
 <style >
+  .modalBox{
+  }
   .ant-modal-footer {
     display: none;
   }

+ 190 - 0
src/views/storehouseManagement/ReplenishmentListModal.vue

@@ -0,0 +1,190 @@
+<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="id"
+        bordered
+        :columns="columns"
+        :data="loadData">
+        <!-- 补货数量 -->
+        <template slot="number" slot-scope="text, record, index">
+          <editable-cell :max="999999" :text="text" @change="onCellChange(index, 'number', $event)" />
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button @click="remove(record)" type="primary">移除</a-button>
+        </template>
+      </s-table>
+      <a-row class="footer" type="flex" align="middle" justify="center">
+        <a-button @click="handleSubmit" type="primary">创建销售单</a-button>
+      </a-row>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  settlementRecordsList
+} from '@/api/FinancialManagement'
+import EditableCell from '@/components/Table/EditableCell.vue'
+import {
+  STable,
+  VSelect
+} from '@/components'
+export default {
+  props: {
+    openReplenishmentModal: {
+      type: Boolean,
+      default: false
+    }
+  },
+  components: {
+    STable,
+    EditableCell
+  },
+  data () {
+    return {
+      isshow: this.openReplenishmentModal,
+      dataSource: [],
+      columns: [
+        {
+          title: '客户名称',
+          dataIndex: 'settleDate',
+          width: 200,
+          align: 'center'
+        },
+        {
+          title: '仓库名称',
+          dataIndex: 'settleNo',
+          width: 150,
+          align: 'center'
+        },
+        {
+          title: '配件名称',
+          dataIndex: 'orderNum',
+          width: 150,
+          align: 'center',
+          scopedSlots: {
+            customRender: 'userInfo'
+          }
+        },
+        {
+          title: '产品编码',
+          dataIndex: 'realAmount',
+          align: 'center',
+          width: 150
+        },
+        {
+          title: '产品原厂编码',
+          dataIndex: 'code',
+          align: 'center',
+          width: 150
+        },
+        {
+          title: '差异库存',
+          dataIndex: 'status',
+          align: 'center',
+          width: 100
+        },
+        {
+          title: '补货数量',
+          width: 200,
+          align: 'center',
+          dataIndex: 'number',
+          scopedSlots: {
+            customRender: 'number'
+          }
+        },
+        {
+          title: '操作',
+          width: 150,
+          align: 'center',
+          scopedSlots: {
+            customRender: 'action'
+          }
+        }
+      ],
+      loadData: parameter => {
+        const params = {
+          beginDate: '',
+          endDate: '',
+          settleNo: '',
+          pageNo: 1,
+          pageSize: 10
+        }
+        return settlementRecordsList(params).then(res => {
+          res.data.list.map(item => item.number = item.number ? item.number : 1)
+          this.dataSource = res.data.list || []
+          return res.data
+        })
+      }
+    }
+  },
+  methods: {
+    // 获取补货清单列表
+    getList () {
+      const params = {
+        beginDate: '',
+        endDate: '',
+        settleNo: '',
+        pageNo: 1,
+        pageSize: 10
+      }
+      settlementRecordsList(params).then(res => {
+        if (res.status == 200) {
+          this.dataSource = res.data.list
+          this.dataSource.map(item => item.number = item.number ? item.number : 1)
+        } else {
+          this.dataSource = []
+        }
+      })
+    },
+    // 补货数量改变 index:下标  dataIndex:字段名  value:值
+    onCellChange (index, dataIndex, value) {
+      const dataSource = [...this.dataSource]
+      dataSource[index][dataIndex] = value
+      this.dataSource = dataSource
+      console.log(this.dataSource, 'ddddd')
+    },
+    // 移除
+    remove () {
+
+    },
+    // 提交
+    handleSubmit () {
+
+    },
+	  // 关闭弹窗
+	  cancel () {
+	    this.$emit('close')
+	  }
+  },
+  watch: {
+	  openReplenishmentModal (newValue, oldValue) {
+      this.isshow = newValue
+	  },
+	  isshow (val) {
+	    if (!val) {
+	      this.$emit('close')
+	    } else {
+        // this.getList()
+      }
+	  }
+  }
+}
+</script>
+
+<style scoped="scoped">
+  .footer{
+    padding-top: 50px;
+  }
+</style>

+ 281 - 0
src/views/storehouseManagement/StockSearch.vue

@@ -0,0 +1,281 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model ref="queryForm" :model="queryParam" :rules="rules" layout="inline" @keyup.enter.native="refresh">
+        <a-row :gutter="48">
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item prop="storeName" required label="客户名称" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-select
+                show-search
+                allowClear
+                placeholder="请输入客户名称"
+                option-filter-prop="children"
+                v-model="queryParam.storeName"
+              >
+                <a-select-option v-for="item in storeList" :key="item.id" :value="item.id">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item prop="partName" label="配件名称" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-input class="full-width" v-model="queryParam.partName" placeholder="请输入配件名称" allowClear id="PaySettlementRecords-queryOrderDate"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item prop="settleNo" label="配件编码" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-input class="full-width" v-model="queryParam.settleNo" placeholder="产品编码/产品原厂编码" allowClear id="PaySettlementRecords-queryOrderDate"/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="48">
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item prop="status" label="是否缺货" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <v-select
+                v-model="queryParam.status"
+                ref="ledgerStatus"
+                id="purchasedSetmeal-status"
+                code="SETTLE_STATUS_ALL"
+                placeholder="请选择"
+                allowClear></v-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-button type="primary" @click="handleSearch" id="PaySettlementRecords-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" id="PaySettlementRecords-resetSearchForm">重置</a-button>
+          </a-col>
+        </a-row>
+        </a-form>
+      </a-form-model></div>
+    <!-- 合计 -->
+    <div class="ftext" >
+      <a-button class="btn-cont" icon="unordered-list" type="primary" @click="openModal" id="PaySettlementRecords-refresh">补货清单</a-button>
+    </div>
+    <!-- 列表 -->
+    <div>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        bordered
+        :columns="columns"
+        :data="loadData">
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a href="#" class="action-btn" id="StockSearch-openAddBtn" @click="addReplenishmentList(record)">加入补货单</a>
+          <a href="#" class="action-btn" id="StockSearch-openOutInBtn" @click="openOutInModal(record)">出入库记录</a>
+        </template>
+      </s-table>
+    </div>
+    <!-- 补货清单弹窗 -->
+    <replenishmentList-modal
+      :openReplenishmentModal="openReplenishmentModal"
+      @close="openReplenishmentModal=false"
+      @refresh="$refs.table.refresh(true)">
+    </replenishmentList-modal>
+    <!-- 出入库记录弹窗 -->
+    <stock-outIn-modal
+      :showOutInModal="showOutInModal"
+      :partId="itemId"
+      :partName="partName"
+      @close="showOutInModal=false">
+    </stock-outIn-modal>
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import {
+  STable,
+  VSelect
+} from '@/components'
+import ReplenishmentListModal from './ReplenishmentListModal.vue'
+import stockOutInModal from './stockOutInModal.vue'
+import {
+  settlementRecordsList,
+  settlementRecordsListTotal
+} from '@/api/FinancialManagement'
+export default {
+  name: 'StockSearch',
+  components: {
+    VSelect,
+    STable,
+    ReplenishmentListModal,
+    stockOutInModal
+  },
+  data () {
+    return {
+      openReplenishmentModal: false, // 是否打开补货清单弹窗
+      showOutInModal: false, // 是否打开出入库记录弹窗
+      partName: '', // 要查询出入库记录的配件名称
+      storeList: [
+        { id: 11, name: '常青二路店' },
+        { id: 112, name: '西部大道店99999999999999999' },
+        { id: 114, name: '渭滨路店' },
+        { id: 115, name: '未央店' },
+        { id: 116, name: '凤城八路店' }
+      ],
+      // 搜索条件
+      queryParam: {
+        // storeName: undefined, // 客户名称
+        // partName: '', // 配件名称
+        // status: '', // 分账状态
+        settleNo: ''
+      },
+      // 校验规则
+      rules: {
+        storeName: [{ required: true, message: '请先选择客户名称', trigger: 'change' }]
+      },
+      itemId: '', // 每条数据id
+      settleId: '',
+      replenishmentList: [], // 补货清单列表
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '客户名称',
+        dataIndex: 'settleDate',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '配件名称',
+        dataIndex: 'settleNo',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '产品编码',
+        dataIndex: 'orderNum',
+        width: 150,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'userInfo'
+        }
+      },
+      {
+        title: '产品原厂编码',
+        dataIndex: 'realAmount',
+        align: 'center',
+        width: 150
+      },
+      {
+        title: '安全库存',
+        dataIndex: 'code',
+        align: 'center',
+        width: 150
+      },
+      {
+        title: '当前库存',
+        dataIndex: 'status',
+        align: 'center',
+        width: 150
+      },
+      {
+        title: '差异库存',
+        dataIndex: 'remarks',
+        width: 100,
+        align: 'center',
+        customRender: (text) => {
+          return text || '--'
+        }
+      },
+      {
+        title: '操作',
+        width: 200,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      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
+        })
+      }
+    }
+  },
+  methods: {
+    // 查询
+    handleSearch () {
+      this.$refs.queryForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    // 重置
+    resetSearchForm () {
+      this.$refs.queryForm.resetFields()
+      this.$refs.table.refresh(true)
+    },
+    // 打开补货清单弹窗
+    openModal () {
+      this.openReplenishmentModal = true
+    },
+    // 加入补货清单
+    addReplenishmentList (row) {
+      const item = row
+      item.number = 1
+      this.replenishmentList.unshift(item)
+    },
+    // 打开出入库记录弹窗
+    openOutInModal (item) {
+      this.partName = item.settleNo
+      this.itemId = item.id
+      this.showOutInModal = true
+    }
+
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.$refs.queryForm.resetFields()
+    })
+  }
+}
+</script>
+
+<style scoped lang="less">
+  .ftext{
+    margin-bottom: 15px;
+    font-size: 18px;
+    .btn-cont{
+      margin-right: 20px;
+    }
+  }
+  .action-btn{
+    display: inline-block;
+    padding: 8px 10px;
+    color: #fff;
+    border-radius: 5px;
+    margin: 3px;
+  }
+	#StockSearch-openAddBtn{
+     background-color: #1890ff;
+  }
+  #StockSearch-openOutInBtn {
+    background-color: #00aa00;
+  }
+</style>

+ 124 - 0
src/views/storehouseManagement/customerInfo/CustomerList.vue

@@ -0,0 +1,124 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model ref="queryForm" :model="queryParam" layout="inline" @keyup.enter.native="handleSearch">
+        <a-row :gutter="48">
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item prop="name" label="客户名称" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-input class="full-width" v-model="queryParam.name" placeholder="请输入客户名称" allowClear id="customerList-name"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-button type="primary" @click="handleSearch" id="customerList-search">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" id="customerList-resetSearchForm">重置</a-button>
+          </a-col>
+        </a-row>
+        </a-form>
+      </a-form-model></div>
+    <!-- 列表 -->
+    <div>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        bordered
+        :columns="columns"
+        :data="loadData">
+      </s-table>
+    </div>
+  </a-card>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import { storeListQuery } from '@/api/storeManagement.js'
+export default {
+  name: 'CustomerList',
+  components: {
+    VSelect,
+    STable
+  },
+  data () {
+    return {
+      // 搜索条件
+      queryParam: {
+        name: '' // 客户名称
+      },
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '客户名称',
+        dataIndex: 'name',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '负责人',
+        dataIndex: 'manager',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '手机号码',
+        dataIndex: 'managerMobile',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '地址',
+        align: 'center',
+        width: 150,
+        customRender: (text, record, index) => {
+          return record.addrProvinceName + record.addrCityName + record.addrDistrictName + record.addrDetail
+        }
+      }
+      ],
+      loadData: parameter => {
+        const searchData = Object.assign(parameter, this.queryParam)
+        return storeListQuery(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
+        })
+      }
+    }
+  },
+  methods: {
+    // 查询
+    handleSearch () {
+      this.$refs.queryForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    // 重置
+    resetSearchForm () {
+      this.$refs.queryForm.resetFields()
+      this.$refs.table.refresh(true)
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.$refs.queryForm.resetFields()
+    })
+  }
+}
+</script>
+
+<style scoped lang="less">
+
+</style>

+ 161 - 0
src/views/storehouseManagement/productInfo/ProductList.vue

@@ -0,0 +1,161 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model ref="queryForm" :model="queryParam" layout="inline" @keyup.enter.native="handleSearch">
+        <a-row :gutter="48">
+          <a-col :lg="6" :sm="12">
+            <a-form-model-item prop="name" label="配件名称" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-input class="full-width" v-model="queryParam.name" placeholder="请输入配件名称" allowClear id="productList-name"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-form-model-item prop="brandName" label="配件品牌" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-input class="full-width" v-model="queryParam.brandName" placeholder="请输入配件名称" allowClear id="productList-brandName"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-form-model-item prop="queryWord" label="配件编码/OE码" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-input class="full-width" v-model="queryParam.queryWord" placeholder="配件编码/OE码" allowClear id="productList-code"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-button type="primary" @click="handleSearch" id="productList-search">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" id="productList-resetSearchForm">重置</a-button>
+          </a-col>
+        </a-row>
+        </a-form>
+      </a-form-model></div>
+    <!-- 列表 -->
+    <div>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        bordered
+        :columns="columns"
+        :data="loadData">
+      </s-table>
+    </div>
+  </a-card>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import { partListQuery, partBrandQuery } from '@/api/storeManagement.js'
+export default {
+  name: 'ProductList',
+  components: {
+    VSelect,
+    STable
+  },
+  data () {
+    return {
+      // 搜索条件
+      queryParam: {
+        brandName: '', // 配件品牌
+        name: '', // 配件名称
+        queryWord: '' // 配件编码/OE码
+      },
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '配件名称',
+        dataIndex: 'name',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '配件品牌',
+        dataIndex: 'brandName',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '配件编码',
+        dataIndex: 'code',
+        align: 'center',
+        width: 150,
+        customRender: (text) => {
+          return text || '--'
+        }
+      },
+      {
+        title: 'OE码',
+        dataIndex: 'oe',
+        align: 'center',
+        width: 150,
+        customRender: (text) => {
+          return text || '--'
+        }
+      },
+      {
+        title: '单位',
+        dataIndex: 'unit',
+        align: 'center',
+        width: 150,
+        customRender: (text) => {
+          return text || '--'
+        }
+      },
+      {
+        title: '终端采购价(¥)',
+        dataIndex: 'purchasePrice',
+        width: 100,
+        align: 'center',
+        customRender: (text) => {
+          return text || '0'
+        }
+      }
+      ],
+      loadData: parameter => {
+        const searchData = Object.assign(parameter, this.queryParam)
+        searchData.brandName = searchData.brandName || null
+        searchData.name = searchData.name || null
+        searchData.queryWord = searchData.queryWord || null
+        return partListQuery(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
+        })
+      }
+    }
+  },
+  methods: {
+    // 查询
+    handleSearch () {
+      this.$refs.queryForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    // 重置
+    resetSearchForm () {
+      this.$refs.queryForm.resetFields()
+      this.$refs.table.refresh(true)
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.$refs.queryForm.resetFields()
+    })
+  }
+}
+</script>
+
+<style scoped lang="less">
+
+</style>

+ 181 - 0
src/views/storehouseManagement/stockOutInModal.vue

@@ -0,0 +1,181 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      title="出入库记录"
+      v-model="isshow"
+      @cancle="cancel"
+      :footer="null"
+      width="60%"
+      :centered="true">
+      <a-row class="name-cont">
+        {{ partName }}
+      </a-row>
+      <div>
+        <a href="#" :class="['tab-btn',currentKey=='1'?'active':'']" @click="tabChange(1)" >出库记录</a>
+        <a href="#" :class="['tab-btn',currentKey=='2'?'active':'']" @click="tabChange(2)" >入库记录</a>
+      </div>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        bordered
+        :columns="currentKey=='1'?columnsOut:columnsIn"
+        :data="loadData">
+      </s-table>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  settlementRecordsList
+} from '@/api/FinancialManagement'
+import EditableCell from '@/components/Table/EditableCell.vue'
+import {
+  STable,
+  VSelect
+} from '@/components'
+export default {
+  props: {
+    showOutInModal: {
+      type: Boolean,
+      default: false
+    },
+    partId: {
+      type: [String, Number],
+      default: ''
+    },
+    // 配件名称
+    partName: {
+      type: String,
+      default: ''
+    }
+  },
+  components: {
+    STable,
+    EditableCell
+  },
+  data () {
+    return {
+      isshow: this.showOutInModal,
+      currentKey: '1', // 当前下标
+      dataSource: [],
+      // 出库记录
+      columnsOut: [
+        {
+          title: '出库时间',
+          dataIndex: 'settleDate',
+          width: 200,
+          align: 'center'
+        },
+        {
+          title: '出库单号',
+          dataIndex: 'settleNo',
+          width: 150,
+          align: 'center'
+        },
+        {
+          title: '出库类型',
+          dataIndex: 'orderNum',
+          width: 150,
+          align: 'center',
+          scopedSlots: {
+            customRender: 'userInfo'
+          }
+        },
+        {
+          title: '出库数量',
+          dataIndex: 'realAmount',
+          align: 'center',
+          width: 150
+        }
+      ],
+      // 入库记录
+      columnsIn: [
+        {
+          title: '入库时间',
+          dataIndex: 'settleDate',
+          width: 200,
+          align: 'center'
+        },
+        {
+          title: '入库单号',
+          dataIndex: 'settleNo',
+          width: 150,
+          align: 'center'
+        },
+        {
+          title: '入库类型',
+          dataIndex: 'orderNum',
+          width: 150,
+          align: 'center',
+          scopedSlots: {
+            customRender: 'userInfo'
+          }
+        },
+        {
+          title: '入库数量',
+          dataIndex: 'realAmount',
+          align: 'center',
+          width: 150
+        }
+      ],
+      loadData: parameter => {
+        const params = {
+          beginDate: '',
+          endDate: '',
+          settleNo: '',
+          pageNo: 1,
+          pageSize: 10
+        }
+        return settlementRecordsList(params).then(res => {
+          return res.data
+        })
+      }
+    }
+  },
+  methods: {
+    tabChange (type) {
+      this.currentKey = type
+      this.$refs.table.refresh(true)
+    },
+	  // 关闭弹窗
+	  cancel () {
+	    this.$emit('close')
+	  }
+  },
+  watch: {
+	  showOutInModal (newValue, oldValue) {
+      this.isshow = newValue
+	  },
+	  isshow (val) {
+	    if (!val) {
+	      this.$emit('close')
+	    } else {
+        // this.getList()
+      }
+	  }
+  }
+}
+</script>
+
+<style scoped="scoped">
+  .name-cont{
+    padding-bottom: 20px;
+    font-size: 16px;
+  }
+  .tab-btn{
+    display: inline-block;
+    padding: 8px 20px;
+    text-align: center;
+    border: 1px solid #e8e8e8;
+    border-bottom: none;
+    color: rgba(0, 0, 0, 0.65);
+  }
+  .active{
+    background-color: #1890ff;
+    color: #fff;
+    border: none;
+  }
+</style>

+ 233 - 0
src/views/storehouseManagement/storeBind/StoreBindList.vue

@@ -0,0 +1,233 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model ref="queryForm" :model="queryParam" layout="inline" @keyup.enter.native="refresh">
+        <a-row :gutter="48">
+          <a-col :lg="8" :sm="12">
+            <a-form-model-item label="绑定时间" :label-col="{ span:4 }" :wrapper-col="{ span:16}">
+              <a-range-picker
+                id="storeBindList-queryOrderDate"
+                :disabledDate="disabledDate"
+                style="width: 100%;"
+                v-model="queryOrderDate"
+                format="YYYY-MM-DD"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-form-model-item prop="supplierSn" label="供应商名称" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-select
+                id="storeBindList-supplierSn"
+                show-search
+                allowClear
+                placeholder="请输入供应商名称"
+                option-filter-prop="children"
+                v-model="queryParam.supplierSn"
+              >
+                <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="6" :sm="12">
+            <a-form-model-item prop="storeSn" label="门店名称" :label-col="{ span:4 }" :wrapper-col="{ span:12}">
+              <a-select
+                id="storeBindList-storeSn"
+                show-search
+                allowClear
+                placeholder="请输入门店名称"
+                option-filter-prop="children"
+                v-model="queryParam.storeSn"
+              >
+                <a-select-option v-for="item in storeList" :key="item.storeSn" :value="item.storeSn">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :lg="4" :sm="12">
+            <a-button style="margin:0 4px 3px 4px" type="primary" @click="$refs.table.refresh(true)" id="storeBindList-search">查询</a-button>
+            <a-button style="margin: 0 4px 3px 4px" @click="resetSearchForm" id="storeBindList-resetSearchForm">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <div class="ftext" >
+      <a-button class="btn-cont" v-hasPermission="'B_addBind'" type="primary" @click="openModal" id="storeBindList-add">新增绑定</a-button>
+    </div>
+    <!-- 列表 -->
+    <div>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        bordered
+        :columns="columns"
+        :data="loadData">
+      </s-table>
+    </div>
+    <!-- 绑定弹窗 -->
+    <store-bind-modal :openStoreBindModal="openStoreBindModal" @close="openStoreBindModal=false" @refresh="refresh"></store-bind-modal>
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import {
+  STable,
+  VSelect
+} from '@/components'
+import storeBindModal from './StoreBindModal.vue'
+import { supplierStoreList, storeFindAll } from '@/api/storeManagement.js'
+import { supplierFindAll } from '@/api/supplierManagement.js'
+export default {
+  name: 'StoreBindList',
+  components: {
+    VSelect,
+    STable,
+    storeBindModal
+  },
+  data () {
+    return {
+      openStoreBindModal: false, // 是否打开绑定弹窗
+      queryOrderDate: undefined,
+      supplierList: [], // 供应商列表
+      storeList: [], // 门店列表
+      queryParam: {
+        storeSn: undefined, // 门店名称
+        supplierSn: undefined, // 供应商名称
+        beginDate: '',
+        endDate: ''
+      },
+      orderTotal: 0, // 订单数量
+      amountTotal: 0, // 实收总金额
+      itemId: '', // 每条数据id
+      settleId: '',
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '绑定时间',
+        dataIndex: 'bindDate',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '供应商',
+        width: 150,
+        align: 'center',
+        customRender: (text, record, index) => { return record.supplierEntity.name || '--' }
+      },
+      {
+        title: '绑定门店',
+        width: 150,
+        align: 'center',
+        customRender: (text, record, index) => { return record.storeEntity.name || '--' }
+      },
+      {
+        title: '门店地址',
+        align: 'center',
+        width: 150,
+        customRender: (text, record, index) => {
+          const data = record.storeEntity
+          return data.addrProvinceName + data.addrCityName + data.addrDistrictName + data.addrDetail
+        }
+      },
+      {
+        title: '门店负责人',
+        align: 'center',
+        width: 150,
+        customRender: (text, record, index) => { return record.storeEntity.manager || '--' }
+      },
+      {
+        title: '电话',
+        align: 'center',
+        width: 150,
+        customRender: (text, record, index) => { return record.storeEntity.managerMobile || '--' }
+      }
+      ],
+      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 supplierStoreList(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
+        })
+      }
+    }
+  },
+  methods: {
+    // 禁止不可选日期
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
+    // 获取供应商列表
+    getSupplierList () {
+      supplierFindAll({}).then(res => {
+        this.supplierList = res.data || []
+      })
+    },
+    // 获取门店列表
+    getStoreList () {
+      storeFindAll({}).then(res => {
+        this.storeList = res.data || []
+      })
+    },
+    // 查询
+    refresh () {
+      this.$refs.table.refresh(true)
+    },
+    // 重置
+    resetSearchForm () {
+      this.$refs.queryForm.resetFields()
+      this.queryOrderDate = null
+      this.$refs.table.refresh(true)
+    },
+    // 打开绑定弹窗
+    openModal () {
+      this.openStoreBindModal = true
+    }
+    //
+
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.queryOrderDate = null
+      vm.$refs.queryForm.resetFields()
+      vm.getSupplierList()
+      vm.getStoreList()
+    })
+  }
+}
+</script>
+
+<style scoped lang="less">
+  .ftext{
+    margin-bottom: 15px;
+    font-size: 18px;
+    .btn-cont{
+      margin-right: 20px;
+    }
+  }
+	.ftext span {
+		color: #fa8c16;
+		font-weight: bold;
+	}
+</style>

+ 189 - 0
src/views/storehouseManagement/storeBind/StoreBindModal.vue

@@ -0,0 +1,189 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      title="新增绑定"
+      v-model="isshow"
+      @cancle="cancel"
+      :footer="null"
+      :width="600"
+      :centered="true">
+      <a-form-model ref="ruleForm" :model="form" :rules="rules" :labelCol="{span:5}" :wrapperCol="{span:15}">
+        <a-form-model-item required label="选择供应商" prop="supplierName">
+          <a-select
+            id="storeBindModal-supplierName"
+            show-search
+            allowClear
+            placeholder="请输入供应商名称精确搜索"
+            :show-arrow="false"
+            :filter-option="false"
+            option-filter-prop="children"
+            @search="handleSupplierSearch"
+            v-model="form.supplierName">
+            <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">
+              {{ item.name }}
+            </a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="选择关联客户" prop="storeName">
+          <a-select
+            id="storeBindModal-storeName"
+            show-search
+            allowClear
+            placeholder="请输入客户名称精确搜索"
+            :show-arrow="false"
+            :filter-option="false"
+            optionLabelProp="value"
+            @search="storeSearchRequest"
+            @change="storeChange"
+            v-model="form.storeName">
+            <a-select-option :disabled="item.bindFlag=='BIND'" v-for="item in storeList" :key="item.name" :value="item.name">
+              {{ item.name }}
+              <span style="float: right;">{{ item.bindFlag=='BIND'?'已绑定':'未绑定' }}</span>
+            </a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="门店地址" prop="storeAddress">
+          <span>{{ form.storeAddress }}</span>
+        </a-form-model-item>
+        <a-form-model-item class="submit-cont" :wrapper-col="{ span: 14, offset: 9 }">
+          <a-button type="primary" id="storeBindModal-submit" @click="submitForm('ruleForm')">
+            提交
+          </a-button>
+          <a-button id="storeBindModal-cancle" style="margin-left: 10px" @click="cancel">
+            取消
+          </a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  supplierStoreBind,
+  storeQueryAll
+} from '@/api/storeManagement.js'
+import { supplierQueryAll } from '@/api/supplierManagement.js'
+export default {
+  props: {
+    openStoreBindModal: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isshow: this.openStoreBindModal,
+      supplierList: [], // 供应商列表
+      storeList: [], // 门店列表
+      form: {
+        supplierName: undefined, // 供应商名称
+        storeName: undefined, // 门店名称
+        storeAddress: '' // 门店地址
+      },
+      rules: {
+        supplierName: [{
+          required: true,
+          message: '请选择供应商',
+          trigger: ['change', 'blur']
+        }],
+        storeName: [{
+          required: true,
+          message: '请选择关联客户',
+          trigger: ['change', 'blur']
+        }]
+      }
+    }
+  },
+  computed: {},
+  methods: {
+    // 门店搜索查询
+    storeSearchRequest (val) {
+      if (val) {
+        storeQueryAll({
+          name: val
+        }).then(res => {
+          this.storeList = res.data || []
+        })
+      } else {
+        this.storeList = []
+      }
+    },
+    // 供应商搜索查询
+    handleSupplierSearch (val) {
+      if (val) {
+        supplierQueryAll({
+          name: val
+        }).then(res => {
+          this.supplierList = res.data || []
+        })
+      } else {
+        this.supplierList = []
+      }
+    },
+    // 关联客户选择修改
+    storeChange (val) {
+      console.log(val, 'vvvvvvv')
+      if (val) {
+        const has = this.storeList.find(item => item.name == val)
+        this.form.storeAddress = has ? has.addrProvinceName + has.addrCityName + has.addrDistrictName + has.addrDetail
+          : ''
+      }
+    },
+    // 提交
+    submitForm (formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          const params = {
+            supplierSn: this.form.supplierName,
+            storeSn: this.storeList.find(item => item.name == this.form.storeName).storeSn
+          }
+          supplierStoreBind(params).then(res => {
+            if (res.status == 200) {
+              this.$message.success(res.message)
+              this.$emit('refresh')
+              setTimeout(() => {
+                this.cancel()
+              }, 300)
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 关闭弹窗
+    cancel () {
+      this.$refs['ruleForm'].resetFields()
+      this.$emit('close')
+    }
+  },
+  watch: {
+    openStoreBindModal (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (val) {
+      if (!val) {
+        this.$emit('close')
+      } else {
+        setTimeout(() => {
+          this.$refs['ruleForm'].resetFields()
+        }, 100)
+      }
+    },
+    settleId (newValue, oldValue) {
+      if (newValue && this.isshow) {
+        this.$refs.table.refresh(newValue)
+      }
+    }
+  }
+}
+</script>
+
+<style scoped="scoped">
+  .submit-cont {
+    padding-top: 50px;
+  }
+</style>

+ 221 - 0
src/views/supplierManagement/Organization.vue

@@ -0,0 +1,221 @@
+<template>
+  <a-card class="organization-wrap" :bordered="false">
+    <!-- 表格列表 -->
+    <s-table
+      class="s-table"
+      ref="table"
+      size="default"
+      rowKey="id"
+      :showPagination="false"
+      :columns="columns"
+      :data="loadData"
+      :defaultExpandedRowKeys="defaultExpandedRowKeys"
+      :bordered="true">
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          v-if="record.parentIdPaths.split(',').length < 5 && $hasPermissions('B_organization_add_child')"
+          type="link"
+          size="small"
+          icon="plus"
+          class="btn-add-s"
+          id="organization-addSubItem"
+          @click="addOrg(text)"
+        >新增子级</a-button>
+        <a-button
+          v-if="record.pid != 0 && $hasPermissions('B_organization_edit')"
+          type="link"
+          size="small"
+          icon="edit"
+          class="btn-edit-s"
+          id="organization-edit"
+          @click="editOrg(text)"
+        >编辑</a-button>
+        <a-button
+          v-if="record.pid != 0 && $hasPermissions('B_organization_del')"
+          type="link"
+          size="small"
+          icon="delete"
+          class="btn-del-s"
+          id="organization-del"
+          @click="delOrg(text)"
+        >删除</a-button>
+        <span v-if="!$hasPermissions('B_organization_add_child') && !$hasPermissions('B_organization_edit') && !$hasPermissions('B_organization_del')">--</span>
+      </template>
+    </s-table>
+    <!-- 新增子级 -->
+    <a-modal
+      class="organization-modal"
+      centered
+      :title="title"
+      :visible="visible"
+      :footer="null"
+      :closable="true"
+      @cancel="onCancel"
+      width="600px">
+      <!-- 表单 -->
+      <a-form-model ref="ruleForm" :model="form" :rules="rules">
+        <a-form-model-item
+          label="组织机构名称"
+          prop="name"
+          :label-col="{ span: 5 }"
+          :wrapper-col="{ span: 17 }">
+          <a-input v-model.trim="form.name" @input="removeSpaces('name')" id="organization-itemName" :maxLength="30" placeholder="请输入组织机构名称(最多30个字符)" />
+        </a-form-model-item>
+        <a-form-model-item class="btn-cont">
+          <a-button type="primary" id="organization-save" @click="onSubmit">保存</a-button>
+          <a-button class="cancel" id="organization-cancel" @click="onCancel">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-modal>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { findOrgTree, saveAtorg, delAtorg } from '@/api/atorg.js'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      title: '新增', //  对话框标题
+      visible: false, //  对话框是否可见
+      form: { //  新增编辑  组织机构
+        name: ''
+      },
+      rules: { //  表单校验规则
+        name: [{ required: true, message: '请输入组织机构名称', trigger: 'blur' }]
+      },
+      nowId: '', //  当前操作的数据id
+      nowPid: '', //  当前操作的数据上级id
+      defaultExpandedRowKeys: [], //  树形数据默认展开项
+      columns: [
+        { title: '组织机构名称', dataIndex: 'name', width: 200, align: 'left' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return findOrgTree().then(res => {
+          //  递归去除空children
+          this.recursionFun(res.data)
+          this.defaultExpandedRowKeys[0] = res.data[0].id
+          return res.data
+        })
+      }
+    }
+  },
+  methods: {
+    //  去除空格
+    removeSpaces (val) {
+      this.form[val] = this.form[val].replace(/\s|\r\n|\n|<|>/g, '')
+    },
+    //  新增子级
+    addOrg (item) {
+      this.nowId = ''
+      this.form.name = ''
+      if (item) { //  子级
+        this.nowPid = item.id
+      } else { //  最高级
+        this.nowPid = ''
+      }
+      this.title = '新增'
+      this.visible = true
+    },
+    //  编辑
+    editOrg (item) {
+      this.nowId = item.id
+      this.nowPid = item.pid
+      this.title = '编辑'
+      this.form.name = item.name
+      this.visible = true
+    },
+    //  保存
+    onSubmit () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const formData = this.form
+          formData.id = this.nowId
+          formData.pid = this.nowPid
+          saveAtorg(formData).then(res => {
+            if (res.status == 200) {
+              this.$message.success(res.message)
+              this.$refs.table.refresh(true)
+              this.visible = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    //  关闭对话框
+    onCancel () {
+      this.$refs.ruleForm.resetFields()
+      this.visible = false
+    },
+    //  删除
+    delOrg (item) {
+      const _this = this
+      _this.nowId = item.id
+      const message = item.children && item.children.length ? '删除后子级将一起被删除,确认删除?' : '删除后原数据不可恢复,是否删除?'
+      _this.$confirm({
+        title: '提示',
+        centered: true,
+        content: message,
+        onOk () {
+          delAtorg({ id: _this.nowId }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    //  递归函数
+    recursionFun (data) {
+      if (data) {
+        data.map((item, index) => {
+          if (item.children && item.children.length == 0) {
+            delete item.children
+          } else {
+            this.recursionFun(item.children)
+          }
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .organization-wrap{
+    // 表格
+    .s-table{
+      .btn-edit-s{
+        color: #1891ff;
+        margin: 0 5px;
+      }
+      .btn-del-s{
+        color: #ff4d4f;
+      }
+      .btn-edit-s.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .btn-edit-s.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger){
+        color: #1891ff;
+        border-color: #1891ff;
+      }
+      .btn-del-s.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .btn-del-s.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger){
+        color: #ff4d4f;
+        border-color: #ff4d4f;
+      }
+    }
+  }
+  // 弹框
+  .organization-modal{
+    .btn-cont{
+      text-align: center;
+      .cancel {
+      	margin-left: 50px;
+      }
+    }
+  }
+</style>

+ 156 - 0
src/views/supplierManagement/SupplierBankModal.vue

@@ -0,0 +1,156 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      title="结算账户信息"
+      v-model="isshow"
+      @cancle="cancel"
+      :footer="null"
+      :width="600"
+      :centered="true">
+      <a-form-model ref="ruleForm" :model="form" :rules="rules" :labelCol="{span:5}" :wrapperCol="{span:15}">
+        <a-form-model-item required label="平台商户号" prop="merchantNo">
+          <a-input v-model="form.merchantNo" :maxLength="30" placeholder="请输入平台商户号" allowClear id="supplierBankModal-merchantNo" />
+        </a-form-model-item>
+        <a-form-model-item required label="结算账户名" prop="bankAccount">
+          <a-input v-model="form.bankAccount" :maxLength="30" placeholder="请输入结算账户名" allowClear id="supplierBankModal-bankAccount" />
+        </a-form-model-item>
+        <a-form-model-item required label="结算账户号" prop="bankCard">
+          <a-input v-model="form.bankCard" :maxLength="30" placeholder="请输入结算银行卡号" allowClear id="supplierBankModal-bankCard" />
+        </a-form-model-item>
+        <a-form-model-item required label="开户银行" prop="bankName">
+          <a-input v-model="form.bankName" :maxLength="30" placeholder="请输入开户银行名称" allowClear id="supplierBankModal-bankName" />
+        </a-form-model-item>
+        <a-form-model-item label="说明">
+          <span>结算账户信息需要同进件时填写的资料保持一致,否则将无法提现成功</span>
+        </a-form-model-item>
+        <a-form-model-item class="submit-cont" :wrapper-col="{ span: 14, offset: 9 }">
+          <a-button type="primary" id="supplierBankModal-submit" @click="submitForm('ruleForm')">
+            确定
+          </a-button>
+          <a-button id="supplierBankModal-cancle" style="margin-left: 20px" @click="cancel">
+            取消
+          </a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { supplierBankQuery, supplierBankSave } from '@/api/supplierManagement.js'
+export default {
+  name: 'SupplierBankModal',
+  props: {
+    openSettingModal: {
+      type: Boolean,
+      default: false
+    },
+    // 供应商编码
+    supplierSn: {
+      type: String,
+      default: ''
+    }
+  },
+  watch: {
+    openSettingModal (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (val) {
+      if (!val) {
+        this.$refs['ruleForm'].resetFields()
+        this.$emit('close')
+      } else {
+        if (this.supplierSn) {
+          this.getSupplierBankAccount()
+        }
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.openSettingModal,
+      form: {
+        merchantNo: '', // 平台商户号
+        bankAccount: '', // 结算账户名
+        bankCard: '', // 结算账户号
+        bankName: '', // 开户银行
+        supplierBankAccountSn: '' // 序列号
+      },
+      rules: {
+        merchantNo: [{
+          required: true,
+          message: '请输入平台商户号',
+          trigger: ['change', 'blur']
+        }],
+        bankAccount: [{
+          required: true,
+          message: '请输入结算账户名',
+          trigger: ['change', 'blur']
+        }],
+        bankCard: [{
+          required: true,
+          message: '请输入结算银行卡号',
+          trigger: ['change', 'blur']
+        }],
+        bankName: [{
+          required: true,
+          message: '请输入开户银行名称',
+          trigger: ['change', 'blur']
+        }]
+      }
+    }
+  },
+  methods: {
+    // 根据供应商SN查询可用账户信息
+    getSupplierBankAccount () {
+      supplierBankQuery({ supplierSn: this.supplierSn }).then(res => {
+        if (res.status == 200) {
+          if (res.data) {
+            this.form = Object.assign(res.data, {})
+          }
+        }
+      })
+    },
+    // 提交
+    submitForm (formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          const params = {
+            supplierBankAccountSn: this.form.supplierBankAccountSn,
+            supplierSn: this.supplierSn,
+            merchantNo: this.form.merchantNo, // 平台商户号
+            bankAccount: this.form.bankAccount, // 结算账户名
+            bankCard: this.form.bankCard, // 结算账户号
+            bankName: this.form.bankName // 开户银行
+          }
+          supplierBankSave(params).then(res => {
+            if (res.status == 200) {
+              this.$message.success(res.message)
+              this.$emit('refresh')
+              setTimeout(() => {
+                this.cancel()
+              }, 300)
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 关闭弹窗
+    cancel () {
+      this.$refs['ruleForm'].resetFields()
+      this.$emit('close')
+    }
+  }
+
+}
+</script>
+
+<style scoped="scoped">
+  .submit-cont {
+    padding-top: 50px;
+  }
+</style>

+ 259 - 0
src/views/supplierManagement/SupplierList.vue

@@ -0,0 +1,259 @@
+<template>
+  <a-card class="StoreManagement" :bordered="false">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model ref="queryForm" :model="queryParam" layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-model-item prop="name" class="search-item" label="供应商名称">
+              <a-input id="supplier-name" v-model.trim="queryParam.name" placeholder="请输入供应商名称" allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-model-item prop="orgCode" class="search-item" label="组织机构">
+              <a-tree-select
+                showSearch
+                id="supplier-orgCode"
+                v-model="queryParam.orgCode"
+                allowClear
+                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+                :replace-fields="{children:'children', title:'name', key:'id', value: 'code' }"
+                :tree-data="treeData"
+                placeholder="请选择组织机构"
+                treeNodeFilterProp="title">
+              </a-tree-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="6" style="padding-bottom: 10px;">
+            <a-button type="primary" id="supplier-search" class="search-btn" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button id="supplier-reset" @click="reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 表格列表 -->
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 组织机构 -->
+      <template slot="orgCode" slot-scope="text, record">
+        <span v-for="(item, index) in record.codeNameArr" :key="index">
+          {{ item }}
+          <strong v-if="index != record.codeNameArr.length-1">></strong>
+        </span>
+        <span v-if="record.codeNameArr.length==0">--</span>
+      </template>
+      <!-- 负责人名称 -->
+      <template slot="managerName" slot-scope="text, record">
+        <div v-if="record.managerName">{{ record.managerName }}</div>
+        <div v-else>--</div>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-icon
+          type="edit"
+          title="编辑"
+          v-if="$hasPermissions('B_supplier_edit')"
+          id="supplier-edit"
+          @click="handleEdit(record)"
+          class="actionBtn icon-blues" />
+        <a-icon
+          type="setting"
+          v-if="$hasPermissions('B_supplier_setting')"
+          title="设置账户信息"
+          id="supplier-setting"
+          @click="handleSet(record)"
+          class="actionBtn icon-orange" />
+        <span v-if="!$hasPermissions('B_supplier_edit') && !$hasPermissions('B_supplier_setting')">--</span>
+      </template>
+    </s-table>
+
+    <!-- 编辑 门店所属组织 -->
+    <supplier-modal :openModal="openModal" :supplierSn="supplierSn" @success="storeSubmit" @close="openModal=false" />
+    <!-- 编辑结算信息 -->
+    <supplierBank-modal :openSettingModal="openSettingModal" :supplierSn="supplierSn" @refresh="handleSetSubmit" @close="openSettingModal=false" />
+  </a-card>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import SupplierModal from './SupplierModal.vue'
+import SupplierBankModal from './SupplierBankModal.vue'
+import {
+  findOrgTree
+} from '@/api/atorg.js'
+import {
+  supplierListQuery
+} from '@/api/supplierManagement.js'
+export default {
+  name: 'StoreManagement',
+  components: {
+    STable,
+    VSelect,
+    SupplierModal,
+    SupplierBankModal
+  },
+  data () {
+    return {
+      queryParam: {
+        name: '', //  供应商名称
+        orgCode: null //  组织机构
+      },
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '组织机构',
+        scopedSlots: {
+          customRender: 'orgCode'
+        },
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '供应商名称',
+        dataIndex: 'name',
+        width: 120,
+        align: 'center'
+      },
+      {
+        title: '联系人',
+        dataIndex: 'manager',
+        width: 100,
+        align: 'center',
+        customRender: (text, record, index) => {
+          return text || '--'
+        }
+      },
+      {
+        title: '手机号码',
+        dataIndex: 'managerMobile',
+        width: 100,
+        align: 'center',
+        customRender: (text, record, index) => {
+          return text || '--'
+        }
+      },
+      {
+        title: '座机号码',
+        dataIndex: 'tel',
+        width: 80,
+        align: 'center',
+        customRender: (text, record, index) => {
+          return text || '--'
+        }
+      },
+      {
+        title: '平台商户号',
+        width: 100,
+        align: 'center',
+        customRender: (text, record, index) => {
+          return record.supplierBankAccountEntity ? record.supplierBankAccountEntity.merchantNo : '--'
+        }
+      },
+      {
+        title: '操作',
+        width: 100,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return supplierListQuery(Object.assign(parameter, this.queryParam)).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
+              // 重组组织机构
+              let codeNameArr = []
+              if (_item.orgParentNamePaths) { //  父级组织机构名称
+                const orgPCodeNameArr = _item.orgParentNamePaths.split(',')
+                codeNameArr = orgPCodeNameArr.splice(0, orgPCodeNameArr.length - 1)
+              }
+              if (_item.orgCodeName) { //  当前组织机构名称
+                codeNameArr.push(_item.orgCodeName)
+              }
+              _item.codeNameArr = codeNameArr
+            }
+            return res.data
+          }
+        })
+      },
+      openModal: false, //  编辑 门店所属组织  弹框展示状态
+      openSettingModal: false, // 编辑结算信息弹窗
+      supplierSn: '', // 供应商信息
+      supplierName: '', // 供应商名称
+      treeData: [] //  组织机构
+    }
+  },
+  methods: {
+    //  获取组织机构  数据
+    getOrgList () {
+      findOrgTree().then(res => {
+        if (res.status == 200) {
+          this.treeData = res.data
+          console.log(this.treeData, 'this.treeData')
+        } else {
+          this.treeData = []
+        }
+      })
+    },
+    // 编辑供应商
+    handleEdit (item) {
+      this.supplierSn = item.supplierSn
+      this.openModal = true
+    },
+    // 编辑供应商  提交成功
+    storeSubmit () {
+      this.$refs.table.refresh()
+      this.openModal = false
+    },
+    // 编辑结算账户信息
+    handleSet (item) {
+      this.supplierSn = item.supplierSn
+      this.openSettingModal = true
+    },
+    // 编辑结算账户信息  提交成功
+    handleSetSubmit () {
+      this.$refs.table.refresh()
+      this.openSettingModal = false
+    },
+    //  重置
+    reset () {
+      this.$refs.queryForm.resetFields()
+      this.$refs.table.refresh(true)
+    }
+
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.$refs.queryForm.resetFields()
+      vm.getOrgList()
+    })
+  }
+}
+</script>
+
+<style lang="less">
+  .StoreManagement {
+    .table-page-search-wrapper {
+      .search-btn {
+        margin-right: 10px;
+      }
+    }
+  }
+</style>

+ 192 - 0
src/views/supplierManagement/SupplierModal.vue

@@ -0,0 +1,192 @@
+<template>
+  <a-modal
+    class="StoreModal"
+    centered
+    title="编辑"
+    :width="600"
+    :footer="null"
+    :destroyOnClose="true"
+    @cancel="isShow = false"
+    v-model="isShow">
+    <!-- 表单 -->
+    <a-form-model
+      class="form"
+      ref="ruleForm"
+      :model="form"
+      :rules="rules"
+      :label-col="{ span: 2 }"
+      :wrapper-col="{ span: 18 }">
+      <a-form-model-item
+        label="供应商名称"
+        :label-col="{ span: 5 }"
+        :wrapper-col="{ span: 17 }">
+        <div>{{ supplierInfo?supplierInfo.name:'' }}</div>
+      </a-form-model-item>
+      <a-form-model-item
+        class="form-label"
+        required
+        label="选择组织机构"
+        prop="orgCode"
+        :label-col="{ span: 5 }"
+        :wrapper-col="{ span: 17 }">
+        <a-tree-select
+          showSearch
+          id="supplierModal-editOrg"
+          v-model="form.orgCode"
+          allowClear
+          style="width: 100%"
+          :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+          :tree-data="treeData"
+          :replace-fields="{children:'children', title:'name', key:'id', value: 'code' }"
+          placeholder="请选择组织机构"
+          @change="treeChange">
+        </a-tree-select>
+      </a-form-model-item>
+      <a-form-model-item class="btn-cont" :label-col="{ span: 0 }" :wrapper-col="{ span: 24 }">
+        <a-button id="supplierModal-saveOrg" type="primary" @click="onSubmit">确定</a-button>
+        <a-button id="supplierModal-cancelOrg" class="cancel" @click="isShow = false">取消</a-button>
+      </a-form-model-item>
+    </a-form-model>
+  </a-modal>
+</template>
+
+<script>
+import { findOrgTree } from '@/api/atorg.js'
+import { supplierEdit, supplierView } from '@/api/supplierManagement.js'
+export default {
+  name: 'SupplierModal',
+  props: {
+    openModal: {
+      //  弹框是否展示
+      type: Boolean,
+      default: false
+    },
+    // 供应商编码
+    supplierSn: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  弹框是否展示
+      form: { //  编辑
+        orgCode: null //  机构编码
+      },
+      rules: { //  表单校验规则
+        orgCode: [{ required: true, message: '请选择所属组织归属', trigger: 'change' }]
+      },
+      treeData: [], //  组织机构
+      parentCodePaths: '', //  机构编码父路径
+      orgPid: '', //  父级id
+      supplierInfo: null //  供应商详情
+    }
+  },
+  methods: {
+    //  供应商详情
+    getSupplierInfo () {
+      supplierView({ supplierSn: this.supplierSn }).then(res => {
+        if (res.status == 200) {
+          this.supplierInfo = res.data
+          console.log(this.supplierInfo, 'this.supplierInfo')
+          this.form.orgCode = res.data.orgCode
+          this.parentCodePaths = res.data.orgCodePaths
+          this.orgPid = res.data.orgPid
+        }
+      })
+    },
+    //  获取组织机构  数据
+    getOrgList () {
+      findOrgTree().then(res => {
+        if (res.status == 200) {
+          this.treeData = res.data
+        } else {
+          this.treeData = []
+        }
+      })
+    },
+    //  组织归属  change
+    treeChange (value, label, extra) {
+      this.parentCodePaths = extra.triggerNode.$options.propsData.dataRef.parentCodePaths
+      this.orgPid = extra.triggerNode.$options.propsData.dataRef.pid
+    },
+    //  保存
+    onSubmit () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(this.form))
+          formData.supplierSn = this.supplierSn
+          formData.orgCodePaths = this.parentCodePaths
+          formData.orgPid = this.orgPid
+          supplierEdit(formData).then(res => {
+            if (res.status == 200) {
+              this.$message.success(res.message)
+              this.$emit('success')
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  mounted () {
+    this.getOrgList()
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      } else {
+        //  重置表单数据
+        this.form.orgCode = null
+        if (this.supplierSn) {
+          this.getSupplierInfo()
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .StoreModal{
+    .form{
+      .item-w{
+        display: flex;
+        line-height: 24px;
+        padding: 8px 0;
+        margin-bottom: 24px;
+        .item-label{
+          flex-shrink: 0;
+          width: 90px;
+          text-align: left;
+          font-weight: bold;
+        }
+        .item-cont{
+          flex-grow: 1;
+        }
+      }
+      .btn-cont {
+        text-align: center;
+        margin-top: 80px;
+        .cancel {
+          margin-left: 40px;
+        }
+      }
+      // .form-label{
+      //   .ant-form-item-label{
+      //     .ant-form-item-required{
+      //       font-weight: bold;
+      //       color: rgba(0, 0, 0, 0.65);
+      //     }
+      //   }
+      // }
+    }
+  }
+</style>

+ 3 - 3
src/views/user/ResetPwd.vue

@@ -1,6 +1,6 @@
 <template>
   <a-row :gutter="24" class="change-pwd">
-    <a-col span="8" offset="8">
+    <a-col span="12" offset="5">
       <a-form @submit="handleSubmit" :form="form">
         <!-- 原始密码 -->
         <a-form-item
@@ -85,11 +85,11 @@ export default {
       formLayout: {
         labelCol: {
           xs: { span: 24 },
-          sm: { span: 6 }
+          sm: { span: 8 }
         },
         wrapperCol: {
           xs: { span: 24 },
-          sm: { span: 18 }
+          sm: { span: 16 }
         }
       },
       form: this.$form.createForm(this),

+ 3 - 3
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'https://channel.test.zyucgj.com/zyyc-channel/',
-        // target: 'http://192.168.16.102:8081/zyyc-channel/',
+        // target: 'http://supplier.test.zyucgj.com/supp-admin/',
+        target: 'http://192.168.16.134:8401/supp-admin/',
         ws: false,
         changeOrigin: true,
         pathRewrite: {
@@ -117,7 +117,7 @@ const vueConfig = {
         },
         // ÖØÐ´cookie·¾¶
         cookiePathRewrite: {
-          '/cw-admin/': '/'
+          '/supp-admin/': '/'
         }
       }
     }