浏览代码

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/admin into dev

keyman1995 6 年前
父节点
当前提交
498b0bc7e2
共有 76 个文件被更改,包括 4770 次插入494 次删除
  1. 1
    1
      dist/index.html
  2. 0
    2
      dist/static/css/app.50bef55cf5218719e68b5e53c341984a.css
  3. 0
    1
      dist/static/css/app.50bef55cf5218719e68b5e53c341984a.css.map
  4. 0
    2
      dist/static/css/app.de5c24aec59d7e1bf34ed6e01ddec500.css
  5. 0
    1
      dist/static/css/app.de5c24aec59d7e1bf34ed6e01ddec500.css.map
  6. 0
    2
      dist/static/js/app.611bcec97c1df93a0e1c.js
  7. 0
    1
      dist/static/js/app.611bcec97c1df93a0e1c.js.map
  8. 0
    2
      dist/static/js/app.ce3b6b4ac1ddaa161d53.js
  9. 0
    1
      dist/static/js/app.ce3b6b4ac1ddaa161d53.js.map
  10. 1
    1
      dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map
  11. 0
    77
      dist/static/js/vendor.2eefbe459a955945ef62.js
  12. 0
    1
      dist/static/js/vendor.2eefbe459a955945ef62.js.map
  13. 0
    70
      dist/static/js/vendor.88cbbf5123a71bf0def0.js
  14. 0
    1
      dist/static/js/vendor.88cbbf5123a71bf0def0.js.map
  15. 33
    0
      package-lock.json
  16. 2
    0
      package.json
  17. 432
    0
      src/pages/system/cardAndCouponManager/bodyBuildingCardManager/edit.vue
  18. 398
    0
      src/pages/system/cardAndCouponManager/bodyBuildingCardManager/index.vue
  19. 27
    0
      src/pages/system/cardAndCouponManager/bodyBuildingCardManager/page.scss
  20. 398
    5
      src/pages/system/cardAndCouponManager/cardManager/edit.vue
  21. 286
    42
      src/pages/system/cardAndCouponManager/cardManager/index.vue
  22. 621
    6
      src/pages/system/cardAndCouponManager/couponManager/edit.vue
  23. 250
    23
      src/pages/system/cardAndCouponManager/couponManager/index.vue
  24. 1
    0
      src/pages/system/cardAndCouponManager/couponManager/page.scss
  25. 143
    0
      src/pages/system/cardAndCouponManager/givingRecords.vue
  26. 5
    0
      src/pages/system/cardAndCouponManager/vipManager/index.vue
  27. 16
    6
      src/pages/system/caseManager/caseAreaManager/index.vue
  28. 18
    4
      src/pages/system/caseManager/caseInfo/addCase/index.vue
  29. 18
    4
      src/pages/system/caseManager/caseInfo/editCase/index.vue
  30. 4
    0
      src/pages/system/caseManager/caseInfo/index.vue
  31. 1
    0
      src/pages/system/caseManager/caseTableManager/add.vue
  32. 1
    0
      src/pages/system/caseManager/caseTableManager/edit.vue
  33. 5
    0
      src/pages/system/caseManager/caseTableManager/index.vue
  34. 5
    0
      src/pages/system/caseManager/keyManager/index.vue
  35. 5
    0
      src/pages/system/caseManager/signinManager/index.vue
  36. 6
    1
      src/pages/system/caseManager/tagManager/index.vue
  37. 5
    0
      src/pages/system/channelManager/channelList/index.vue
  38. 34
    23
      src/pages/system/cmsManager/bannerManager/add.vue
  39. 45
    34
      src/pages/system/cmsManager/bannerManager/edit.vue
  40. 93
    60
      src/pages/system/cmsManager/majorProjects/edit.vue
  41. 3
    2
      src/pages/system/cmsManager/majorProjects/index.vue
  42. 35
    23
      src/pages/system/cmsManager/newsManager/add.vue
  43. 47
    36
      src/pages/system/cmsManager/newsManager/edit.vue
  44. 5
    0
      src/pages/system/cmsManager/newsManager/index.vue
  45. 3
    4
      src/pages/system/courseManager/courseList/index.vue
  46. 2
    3
      src/pages/system/courseManager/fiveA/edit.vue
  47. 148
    0
      src/pages/system/dataStatistics/cardCouponList/index.vue
  48. 36
    0
      src/pages/system/dataStatistics/cardCouponList/page.scss
  49. 203
    0
      src/pages/system/dataStatistics/cardCouponUsedList/index.vue
  50. 36
    0
      src/pages/system/dataStatistics/cardCouponUsedList/page.scss
  51. 176
    0
      src/pages/system/dataStatistics/courseOrderList/index.vue
  52. 36
    0
      src/pages/system/dataStatistics/courseOrderList/page.scss
  53. 148
    0
      src/pages/system/dataStatistics/courseStatisticsList/index.vue
  54. 36
    0
      src/pages/system/dataStatistics/courseStatisticsList/page.scss
  55. 260
    0
      src/pages/system/dataStatistics/goodsOrderList/index.vue
  56. 78
    0
      src/pages/system/dataStatistics/goodsOrderList/page.scss
  57. 144
    0
      src/pages/system/dataStatistics/goodsStatisticsList/index.vue
  58. 36
    0
      src/pages/system/dataStatistics/goodsStatisticsList/page.scss
  59. 37
    21
      src/pages/system/goodsManager/goodManager/edit.vue
  60. 8
    0
      src/pages/system/goodsManager/goodManager/index.vue
  61. 5
    0
      src/pages/system/goodsManager/goodsSpecManager/index.vue
  62. 14
    3
      src/pages/system/goodsManager/goodsTypeManager/index.vue
  63. 5
    0
      src/pages/system/newOrder/caseRecord/index.vue
  64. 54
    0
      src/pages/system/page.js
  65. 27
    0
      src/pages/system/systemSet/userManager/add.vue
  66. 28
    1
      src/pages/system/systemSet/userManager/edit.vue
  67. 8
    3
      src/pages/system/systemSet/userManager/index.vue
  68. 3
    2
      src/store/app.js
  69. 81
    0
      src/store/card/card.js
  70. 29
    0
      src/store/channel/channel.js
  71. 81
    0
      src/store/coupon/coupon.js
  72. 13
    10
      src/store/course/course.js
  73. 20
    0
      src/store/customer/customer.js
  74. 20
    14
      src/store/goods/goods.js
  75. 3
    0
      src/store/index.js
  76. 48
    1
      src/util/api.js

+ 1
- 1
dist/index.html 查看文件

@@ -1 +1 @@
1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_25hulf12ph6.css><title>城的空间后台管理系统</title><link href=./static/css/app.50bef55cf5218719e68b5e53c341984a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.88cbbf5123a71bf0def0.js></script><script type=text/javascript src=./static/js/app.ce3b6b4ac1ddaa161d53.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_25hulf12ph6.css><title>城的空间后台管理系统</title><link href=./static/css/app.8ec8e762898b99ff819f71f94abc0149.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.bcfa818d96471060c4b4.js></script><script type=text/javascript src=./static/js/app.75b251f5c455872d8a25.js></script></body></html>

+ 0
- 2
dist/static/css/app.50bef55cf5218719e68b5e53c341984a.css
文件差异内容过多而无法显示
查看文件


+ 0
- 1
dist/static/css/app.50bef55cf5218719e68b5e53c341984a.css.map
文件差异内容过多而无法显示
查看文件


+ 0
- 2
dist/static/css/app.de5c24aec59d7e1bf34ed6e01ddec500.css
文件差异内容过多而无法显示
查看文件


+ 0
- 1
dist/static/css/app.de5c24aec59d7e1bf34ed6e01ddec500.css.map
文件差异内容过多而无法显示
查看文件


+ 0
- 2
dist/static/js/app.611bcec97c1df93a0e1c.js
文件差异内容过多而无法显示
查看文件


+ 0
- 1
dist/static/js/app.611bcec97c1df93a0e1c.js.map
文件差异内容过多而无法显示
查看文件


+ 0
- 2
dist/static/js/app.ce3b6b4ac1ddaa161d53.js
文件差异内容过多而无法显示
查看文件


+ 0
- 1
dist/static/js/app.ce3b6b4ac1ddaa161d53.js.map
文件差异内容过多而无法显示
查看文件


+ 1
- 1
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map 查看文件

@@ -1 +1 @@
1
-{"version":3,"sources":["webpack:///webpack/bootstrap 2f50910dc153de1c6765"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2f50910dc153de1c6765"],"sourceRoot":""}
1
+{"version":3,"sources":["webpack:///webpack/bootstrap 67d364759e4b09d7e42d"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 67d364759e4b09d7e42d"],"sourceRoot":""}

+ 0
- 77
dist/static/js/vendor.2eefbe459a955945ef62.js
文件差异内容过多而无法显示
查看文件


+ 0
- 1
dist/static/js/vendor.2eefbe459a955945ef62.js.map
文件差异内容过多而无法显示
查看文件


+ 0
- 70
dist/static/js/vendor.88cbbf5123a71bf0def0.js
文件差异内容过多而无法显示
查看文件


+ 0
- 1
dist/static/js/vendor.88cbbf5123a71bf0def0.js.map
文件差异内容过多而无法显示
查看文件


+ 33
- 0
package-lock.json 查看文件

@@ -2487,6 +2487,16 @@
2487 2487
       "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
2488 2488
       "dev": true
2489 2489
     },
2490
+    "clipboard": {
2491
+      "version": "2.0.1",
2492
+      "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.1.tgz",
2493
+      "integrity": "sha512-7yhQBmtN+uYZmfRjjVjKa0dZdWuabzpSKGtyQZN+9C8xlC788SSJjOHWh7tzurfwTqTD5UDYAhIv5fRJg3sHjQ==",
2494
+      "requires": {
2495
+        "good-listener": "1.2.2",
2496
+        "select": "1.1.2",
2497
+        "tiny-emitter": "2.0.2"
2498
+      }
2499
+    },
2490 2500
     "cliui": {
2491 2501
       "version": "2.1.0",
2492 2502
       "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
@@ -3688,6 +3698,11 @@
3688 3698
       "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
3689 3699
       "dev": true
3690 3700
     },
3701
+    "delegate": {
3702
+      "version": "3.2.0",
3703
+      "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
3704
+      "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
3705
+    },
3691 3706
     "delegates": {
3692 3707
       "version": "1.0.0",
3693 3708
       "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
@@ -6234,6 +6249,14 @@
6234 6249
         "minimatch": "3.0.4"
6235 6250
       }
6236 6251
     },
6252
+    "good-listener": {
6253
+      "version": "1.2.2",
6254
+      "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
6255
+      "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
6256
+      "requires": {
6257
+        "delegate": "3.2.0"
6258
+      }
6259
+    },
6237 6260
     "graceful-fs": {
6238 6261
       "version": "4.1.11",
6239 6262
       "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
@@ -13554,6 +13577,11 @@
13554 13577
         }
13555 13578
       }
13556 13579
     },
13580
+    "select": {
13581
+      "version": "1.1.2",
13582
+      "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
13583
+      "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0="
13584
+    },
13557 13585
     "select-hose": {
13558 13586
       "version": "2.0.0",
13559 13587
       "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
@@ -14587,6 +14615,11 @@
14587 14615
       "resolved": "https://registry.npmjs.org/tiny-cookie/-/tiny-cookie-1.0.1.tgz",
14588 14616
       "integrity": "sha1-dTeGB5xkKjw9CyrMrWAPjeEZrCo="
14589 14617
     },
14618
+    "tiny-emitter": {
14619
+      "version": "2.0.2",
14620
+      "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz",
14621
+      "integrity": "sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow=="
14622
+    },
14590 14623
     "tmp": {
14591 14624
       "version": "0.0.33",
14592 14625
       "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",

+ 2
- 0
package.json 查看文件

@@ -17,6 +17,7 @@
17 17
   "dependencies": {
18 18
     "@antv/g2": "^3.2.7",
19 19
     "axios": "^0.18.0",
20
+    "clipboard": "^2.0.1",
20 21
     "element-ui": "^2.4.5",
21 22
     "g2-vue": "^1.0.1",
22 23
     "js-base64": "^2.4.8",
@@ -48,6 +49,7 @@
48 49
     "chalk": "^2.0.1",
49 50
     "chromedriver": "^2.27.2",
50 51
     "copy-webpack-plugin": "^4.0.1",
52
+    "cross-env": "^5.2.0",
51 53
     "cross-spawn": "^5.0.1",
52 54
     "css-loader": "^0.28.11",
53 55
     "eslint": "^4.15.0",

+ 432
- 0
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/edit.vue 查看文件

@@ -0,0 +1,432 @@
1
+<template>
2
+  <div class="subPage">
3
+    <form class="mainForm">
4
+      <ul>
5
+        <li class="flex-h">
6
+          <span>选择案场:</span>
7
+          <div class="flex-item">
8
+            <div style="width:50%">
9
+              <el-select v-model="cardInfo.CaseId" placeholder="请选择" @change="caseChange">
10
+                <el-option
11
+                  v-for="item in cases"
12
+                  :key="item.CaseId"
13
+                  :label="item.CaseName"
14
+                  :value="item.CaseId">
15
+                </el-option>
16
+              </el-select>
17
+            </div>
18
+          </div>
19
+        </li>
20
+        <li class="flex-h">
21
+          <span>卡图片:</span>
22
+          <div class="flex-item">
23
+            <div>
24
+              <el-upload
25
+                class="avatar-uploader"
26
+                :action='$api.file.image.url'
27
+                :show-file-list="false"
28
+                :on-success="handleAvatarSuccess">
29
+                <img v-if="cardInfo.Images" :src="cardInfo.Images[0].CardImageUrl" class="avatar">
30
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
31
+              </el-upload>
32
+            </div>
33
+          </div>
34
+        </li>
35
+        <li class="flex-h">
36
+          <span>卡名称:</span>
37
+          <div class="flex-item">
38
+            <div style="width:200px;">
39
+              <el-input
40
+                placeholder="请输入"
41
+                v-model="cardInfo.CardName"
42
+                clearable>
43
+              </el-input>
44
+            </div>
45
+          </div>
46
+        </li>
47
+        <li class="flex-h">
48
+          <span>卡价格:</span>
49
+          <div class="flex-item">
50
+            <div style="width:200px;">
51
+              <el-input
52
+                placeholder="请输入"
53
+                v-model="cardInfo.Price"
54
+                clearable>
55
+              </el-input>
56
+            </div>
57
+          </div>
58
+        </li>
59
+        <li class="flex-h">
60
+          <span>总张数:</span>
61
+          <div class="flex-item">
62
+            <div style="width:200px;">
63
+              <el-input
64
+                placeholder="请输入"
65
+                v-model="cardInfo.TotalCount"
66
+                clearable>
67
+              </el-input>
68
+            </div>
69
+          </div>
70
+        </li>
71
+        <li class="flex-h">
72
+          <span>发送类型:</span>
73
+          <div class="flex-item">
74
+            <div>
75
+              <el-radio v-model="cardInfo.SendType" label="channel">渠道</el-radio>
76
+              <el-radio v-model="cardInfo.SendType" label="case">案场</el-radio>
77
+              <el-radio v-model="cardInfo.SendType" label="system">系统</el-radio>
78
+            </div>
79
+          </div>
80
+        </li>
81
+        <li class="flex-h" v-if="cardInfo.SendType === 'channel'">
82
+          <span>选择渠道:</span>
83
+          <div class="flex-item">
84
+            <div style="width:50%">
85
+              <el-select v-model="cardInfo.ChannelId" placeholder="请选择">
86
+                <el-option
87
+                  v-for="item in channelList"
88
+                  :key="item.ChannelId"
89
+                  :label="item.ChannelName"
90
+                  :value="item.ChannelId">
91
+                </el-option>
92
+              </el-select>
93
+            </div>
94
+          </div>
95
+        </li>
96
+        <li class="flex-h">
97
+          <span>目标课程:</span>
98
+          <div class="flex-item">
99
+            <div>
100
+              <el-select v-model="cardInfo.Targets[0].TargetId" placeholder="请选择">
101
+                <el-option
102
+                  v-for="item in courseList"
103
+                  :key="item.CourseId"
104
+                  :label="item.CourseName"
105
+                  :value="item.CourseId"
106
+                  :disabled="item.Status !== 1">
107
+                </el-option>
108
+              </el-select>
109
+            </div>
110
+          </div>
111
+        </li>
112
+        <li class="flex-h">
113
+          <span>卡有效时间:</span>
114
+          <div class="flex-item">
115
+            <div>
116
+              <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
117
+                <!-- <el-date-picker
118
+                  v-model="cardInfo.StartDate"
119
+                  type="date"
120
+                  placeholder="选择起始日期">
121
+                </el-date-picker>
122
+                <span style="line-height:40px;">至</span>
123
+                <el-date-picker
124
+                  v-model="cardInfo.EndDate"
125
+                  type="date"
126
+                  placeholder="选择截止日期">
127
+                </el-date-picker> -->
128
+                <el-date-picker
129
+                  v-model="date"
130
+                  type="daterange"
131
+                  range-separator="至"
132
+                  start-placeholder="开始日期"
133
+                  end-placeholder="结束日期"
134
+                  :picker-options="pickerOptions">
135
+                </el-date-picker>
136
+              </div>
137
+            </div>
138
+          </div>
139
+        </li>
140
+        <li class="flex-h">
141
+          <span>视频:</span>
142
+          <div class="flex-item">
143
+            <div style="vertical-align: middle;">
144
+              <a style="line-height: 40px;" v-if="videoOff" :href="cardInfo.VideoUrl" target="blank">{{cardInfo.VideoUrl}}</a>
145
+              <el-upload
146
+                class="avatar-uploader"
147
+                :action='$api.file.image.url'
148
+                :show-file-list="false"
149
+                :on-success="videoSuccess">
150
+                <a style="line-height: 40px;padding: 0 10px;">{{videoOff ? '更换' : '添加'}}视频</a>
151
+              </el-upload>
152
+              <el-button v-if="videoOff" type="danger" @click="deleteVideo">删除视频</el-button>
153
+            </div>
154
+          </div>
155
+        </li>
156
+        <li class="flex-h">
157
+          <span>分享描述:</span>
158
+          <div class="flex-item">
159
+            <div>
160
+              <el-input
161
+                type="textarea"
162
+                :rows="2"
163
+                placeholder="请输入"
164
+                v-model="cardInfo.Share.CardShareInfo">
165
+              </el-input>
166
+            </div>
167
+          </div>
168
+        </li>
169
+        <li class="flex-h">
170
+          <span>规则描述:</span>
171
+          <div class="flex-item">
172
+            <div>
173
+              <el-input
174
+                type="textarea"
175
+                :rows="2"
176
+                placeholder="请输入"
177
+                v-model="cardInfo.Share.CardUseRule">
178
+              </el-input>
179
+            </div>
180
+          </div>
181
+        </li>
182
+        <li class="flex-h">
183
+          <span>使用说明:</span>
184
+          <div class="flex-item">
185
+            <div>
186
+              <el-input
187
+                type="textarea"
188
+                :rows="2"
189
+                placeholder="请输入"
190
+                v-model="cardInfo.Share.CardUseInstruction">
191
+              </el-input>
192
+            </div>
193
+          </div>
194
+        </li>
195
+        <li style="text-align:center">
196
+          <el-button type="primary" size="mini" @click="submit">保存</el-button>
197
+          <el-button type="danger" size="mini" @click="cancel">取消</el-button>
198
+        </li>
199
+      </ul>
200
+    </form>
201
+  </div>
202
+</template>
203
+
204
+<script>
205
+import { mapState, createNamespacedHelpers } from 'vuex'
206
+const { mapActions: mapCardActions } = createNamespacedHelpers('card')
207
+const { mapState: mapChannelState, mapActions: mapChannelActions } = createNamespacedHelpers('channel')
208
+const { mapActions: mapCourseActions } = createNamespacedHelpers('course')
209
+
210
+export default {
211
+  name: '',
212
+  data () {
213
+    return {
214
+      date: '',
215
+      courseList: [],
216
+      videoOff: false,
217
+      total: 0,
218
+      type: this.$route.query.type,
219
+      isEdit: this.$route.query.id === undefined ? 0 : 1,
220
+      ChannelList: [], // 渠道列表
221
+      TypeList: [], // 类型列表
222
+      GoodsList: [], // 商品列表
223
+      currentList: [{
224
+        Name: 'ccc',
225
+        Type: 'xxx'
226
+      }], // 指定商品数据
227
+      cardInfo: {
228
+        CardName: '',
229
+        SendType: '',
230
+        VideoUrl: '',
231
+        Price: ' ',
232
+        StartDate: '',
233
+        EndDate: '',
234
+        TotalCount: '',
235
+        CaseId: '',
236
+        OrgId: '',
237
+        Share: {
238
+          CardShareInfo: '',
239
+          CardUseRule: '',
240
+          CardUseInstruction: ''
241
+        },
242
+        Images: [{
243
+          CardImageUrl: ''
244
+        }],
245
+        Targets: [{
246
+          TargetType: '',
247
+          TargetId: '',
248
+          TargetName: ''
249
+        }],
250
+        ChannelId: ''
251
+      },
252
+      postData: {
253
+        page: 1,
254
+        pagesize: 10,
255
+      },
256
+    }
257
+  },
258
+  mounted () {
259
+    this.$nextTick(function () {
260
+      this.GetChannelListList({
261
+        caseid: this.defaultCaseId,
262
+        page: 1,
263
+        pagesize: 10000
264
+      }).then(() => {
265
+        this.GetCourseList({
266
+          caseid: this.defaultCaseId,
267
+          page: 1,
268
+          pagesize: 10000
269
+        }).then((res) => {
270
+          this.courseList = res.list
271
+          if (this.$route.query.id) {
272
+            this.getCardById({
273
+              id: this.$route.query.id
274
+            }).then((res) => {
275
+              // console.log(JSON.stringify(res.Card))
276
+              this.cardInfo = res.Card
277
+              if (res.Card.VideoUrl) {
278
+                this.videoOff = true
279
+              }
280
+              if (res.Card.Images === null) {
281
+                this.cardInfo.Images = [{
282
+                  CardImageUrl: ''
283
+                }]
284
+              }
285
+              if (res.Card.StartDate) {
286
+                this.date = [res.Card.StartDate, res.Card.EndDate]
287
+              }
288
+            })
289
+          }
290
+        })
291
+      })
292
+    })
293
+  },
294
+  computed: {
295
+    ...mapChannelState({
296
+      channelList: x => x.channelList,
297
+    }),
298
+    ...mapState({
299
+      cases: x => x.app.cases.list,
300
+      defaultCaseId: x => x.app.cases.default,
301
+      OrgId: x => x.app.user.OrgId,
302
+    }),
303
+    pickerOptions () {
304
+      const courseId = this.cardInfo.Targets[0].TargetId
305
+      const couse = (this.courseList || []).filter(x => x.CourseId === courseId)[0] || {}
306
+      const beginDate = new Date(couse.BeginDate).getTime()
307
+      const endDate = new Date(couse.EndDate).getTime()
308
+      return {
309
+        disabledDate (time) {
310
+          return time.getTime() < beginDate || time.getTime() > endDate
311
+        }
312
+      }
313
+    },
314
+    CaseId: {
315
+      get () {
316
+        return this.postData.caseid || this.defaultCaseId
317
+      },
318
+      set (val) {
319
+        this.postData.caseid = val
320
+      }
321
+    }
322
+  },
323
+  methods: {
324
+    ...mapCardActions([
325
+      'addCard',
326
+      'getCardById',
327
+      'editCard',
328
+    ]),
329
+    ...mapCourseActions([
330
+      'GetCourseList',
331
+    ]),
332
+    ...mapChannelActions([
333
+      'GetChannelListList',
334
+    ]),
335
+    caseChange () { // 选择案场
336
+      this.GetChannelListList({
337
+        caseid: this.cardInfo.CaseId,
338
+        page: 1,
339
+        pagesize: 10000
340
+      })
341
+      this.GetCourseList({
342
+        caseid: this.cardInfo.CaseId,
343
+        page: 1,
344
+        pagesize: 10000
345
+      }).then((res) => {
346
+        this.courseList = res.list
347
+      })
348
+      this.cardInfo.Targets = [{
349
+        TargetType: '',
350
+        TargetId: '',
351
+        TargetName: ''
352
+      }]
353
+      this.cardInfo.ChannelId = ''
354
+    },
355
+    deleteVideo () { // 删除视频
356
+      this.cardInfo.VideoUrl = ''
357
+      this.videoOff = false
358
+    },
359
+    videoSuccess (res, file) {
360
+      this.videoOff = true
361
+      this.cardInfo.VideoUrl = res.result.url
362
+    },
363
+    addGoods () { // 添加指定商品
364
+      this.centerDialogVisible = true
365
+    },
366
+    submit () { // 保存
367
+      if (this.$route.query.id) {
368
+        if (this.date !== '') {
369
+          this.cardInfo.StartDate = this.date[0]
370
+          this.cardInfo.EndDate = this.date[1]
371
+        }
372
+        for (var x = 0; x < this.courseList.length; x++) {
373
+          if (this.courseList[x].CourseId === this.cardInfo.Targets[0].TargetId) {
374
+            this.cardInfo.Targets[0].TargetType = this.courseList[x].CourseType
375
+            this.cardInfo.Targets[0].TargetName = this.courseList[x].CourseName
376
+          }
377
+        }
378
+        this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
379
+        console.log(JSON.stringify(this.cardInfo))
380
+        this.editCard(this.cardInfo).then((res) => {
381
+          this.$alert('操作成功', '提示', {
382
+            confirmButtonText: '确定',
383
+            callback: action => {
384
+              this.$router.push({ name: 'cardList' })
385
+            }
386
+          })
387
+        })
388
+      } else {
389
+        this.cardInfo.OrgId = this.OrgId
390
+        if (this.date !== '') {
391
+          this.cardInfo.StartDate = this.date[0]
392
+          this.cardInfo.EndDate = this.date[1]
393
+        }
394
+        for (var n = 0; n < this.courseList.length; n++) {
395
+          if (this.courseList[n].CourseId === this.cardInfo.Targets[0].TargetId) {
396
+            this.cardInfo.Targets[0].TargetType = this.courseList[n].CourseType
397
+            this.cardInfo.Targets[0].TargetName = this.courseList[n].CourseName
398
+          }
399
+        }
400
+        this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
401
+        console.log(JSON.stringify(this.cardInfo))
402
+        this.addCard(this.cardInfo).then((res) => {
403
+          this.$alert('操作成功', '提示', {
404
+            confirmButtonText: '确定',
405
+            callback: action => {
406
+              this.$router.push({ name: 'cardList' })
407
+            }
408
+          })
409
+        })
410
+      }
411
+    },
412
+    cancel () { // 取消
413
+      this.$router.push({ name: 'couponList' })
414
+    },
415
+    handleAvatarSuccess (res, file) {
416
+      this.cardInfo.Images[0].CardImageUrl = res.result.url
417
+    },
418
+  }
419
+}
420
+</script>
421
+
422
+<!-- Add "scoped" attribute to limit CSS to this component only -->
423
+<style lang="scss" scoped>
424
+.addLine {
425
+  > * {
426
+    margin-right: 10px;
427
+  }
428
+}
429
+.mainForm > ul > li > div > div > button {
430
+  margin-top: 0;
431
+}
432
+</style>

+ 398
- 0
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/index.vue 查看文件

@@ -0,0 +1,398 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click="addCard">新增健身卡</el-button>
7
+        </div>
8
+        <ul>
9
+          <li>
10
+            <el-select v-model="CaseId" placeholder="请选择案场">
11
+              <el-option
12
+                v-for="item in cases"
13
+                :key="item.CaseId"
14
+                :label="item.CaseName"
15
+                :value="item.CaseId">
16
+              </el-option>
17
+            </el-select>
18
+          </li>
19
+        </ul>
20
+        <el-button
21
+          size="mini"
22
+          type="primary" @click="search">搜索</el-button>
23
+      </div>
24
+      <div class="moreFilter"></div>
25
+    </div>
26
+    <div class="system-table-box">
27
+      <el-table
28
+        :data="cardList.list"
29
+        stripe
30
+        style="width: 100%">
31
+        <el-table-column
32
+          prop="CardName"
33
+          label="卡名称">
34
+        </el-table-column>
35
+        <!-- <el-table-column
36
+          prop="xxx"
37
+          label="卡类型">
38
+        </el-table-column> -->
39
+        <el-table-column
40
+          prop="Price"
41
+          label="卡价格">
42
+        </el-table-column>
43
+        <el-table-column
44
+          prop="StartDate"
45
+          label="有效期"
46
+          width="150">
47
+          <template slot-scope="scope">
48
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.StartDate)}}</span>
49
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">至</span>
50
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.EndDate)}}</span>
51
+          </template>
52
+        </el-table-column>
53
+        <el-table-column
54
+          prop="SendType"
55
+          label="发放类型">
56
+        </el-table-column>
57
+        <el-table-column
58
+          prop="TotalCount"
59
+          label="总数量">
60
+        </el-table-column>
61
+        <el-table-column
62
+          prop="SentCount"
63
+          label="已发">
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="UsedCount"
67
+          label="实际使用">
68
+        </el-table-column>
69
+        <el-table-column
70
+          prop="Status"
71
+          label="状态">
72
+          <template slot-scope="scope">
73
+            {{scope.row.Status == 1 ? '正常' : '已过期'}}
74
+          </template>
75
+        </el-table-column>
76
+        <el-table-column label="操作" fixed='right' width="350">
77
+          <template slot-scope="scope">
78
+            <el-button
79
+              size="mini"
80
+              type="warning"
81
+              @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
82
+            <el-button
83
+              size="mini"
84
+              type="danger"
85
+              @click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
86
+            <a class="copyBtn" :data-clipboard-text="'www.baidu.com'" :ref="'copy' + scope.$index" @click="toCopy(scope.$index, scope.row)">点击复制链接</a>
87
+          </template>
88
+        </el-table-column>
89
+      </el-table>
90
+    </div>
91
+    <el-pagination
92
+      @current-change="handleCurrentChange"
93
+      :current-page.sync="postData.page"
94
+      :page-size="postData.pagesize"
95
+      layout="prev, pager, next, jumper"
96
+      :total="total">
97
+    </el-pagination>
98
+    <el-dialog
99
+      title="选择赠送客户"
100
+      :visible.sync="centerDialogVisible"
101
+      width="800px"
102
+      center>
103
+      <div>
104
+        <ul class="dialogSearchList flex-h" style="margin-bottom:10px;">
105
+          <li class="flex-item">
106
+            <el-input
107
+              placeholder="请输入用户名"
108
+              v-model="dialogPostData.username"
109
+              clearable>
110
+            </el-input>
111
+          </li>
112
+          <li class="flex-item">
113
+            <el-input
114
+              placeholder="请输入手机号"
115
+              v-model="dialogPostData.phone"
116
+              clearable>
117
+            </el-input>
118
+          </li>
119
+          <li class="flex-item">
120
+            <el-input
121
+              placeholder="请输入推荐人"
122
+              v-model="dialogPostData.recommendname"
123
+              clearable>
124
+            </el-input>
125
+          </li>
126
+          <li>
127
+            <el-button type="primary" @click="dialogSearch">搜索</el-button>
128
+          </li>
129
+        </ul>
130
+        <ul class="dialogSearchList flex-h">
131
+          <li class="flex-item">
132
+            <el-date-picker
133
+              v-model="dialogPostData.begindate"
134
+              type="date"
135
+              placeholder="选择起始日期">
136
+            </el-date-picker>
137
+            <el-date-picker
138
+              v-model="dialogPostData.enddate"
139
+              type="date"
140
+              placeholder="选择截止日期">
141
+            </el-date-picker>
142
+          </li>
143
+        </ul>
144
+      </div>
145
+      <div>
146
+        <el-table
147
+          ref="multipleTable"
148
+          :data="customers.list"
149
+          tooltip-effect="dark"
150
+          style="width: 100%"
151
+          @selection-change="handleSelectionChange">
152
+          <el-table-column
153
+            type="selection">
154
+          </el-table-column>
155
+          <el-table-column
156
+            prop="Name"
157
+            label="姓名">
158
+          </el-table-column>
159
+          <el-table-column
160
+            prop="CustomerName"
161
+            label="微信昵称">
162
+          </el-table-column>
163
+          <el-table-column
164
+            prop="Phone"
165
+            label="手机号">
166
+          </el-table-column>
167
+          <el-table-column
168
+            prop="CreatDate"
169
+            label="创建时间">
170
+            <template slot-scope="scope">
171
+              <span>{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd')}}</span>
172
+            </template>
173
+          </el-table-column>
174
+          <el-table-column
175
+            prop="RecommendName"
176
+            label="推荐人">
177
+          </el-table-column>
178
+        </el-table>
179
+      </div>
180
+      <div>
181
+        <el-pagination
182
+          @current-change="handleCurrentChangeDialog"
183
+          :current-page.sync="dialogPostData.page"
184
+          :page-size="dialogPostData.pagesize"
185
+          layout="prev, pager, next, jumper"
186
+          :total="dialogTotal">
187
+        </el-pagination>
188
+      </div>
189
+      <span slot="footer" class="dialog-footer">
190
+        <el-button @click="closeDialog">取 消</el-button>
191
+        <el-button type="primary" @click="toSendCard">确 定</el-button>
192
+      </span>
193
+    </el-dialog>
194
+    <el-dialog
195
+      title="手动复制"
196
+      :visible.sync="copyDialogVisible"
197
+      width="300px"
198
+      center>
199
+      <div>
200
+        <el-input
201
+          placeholder="请输入内容"
202
+          v-model="currentCopyUrl"
203
+          clearable>
204
+        </el-input>
205
+        <!-- <a :data-clipboard-text="currentCopyUrl" ref="copy" @click="toCopy">复制链接</a> -->
206
+      </div>
207
+      <span slot="footer" class="dialog-footer">
208
+        <el-button type="primary" @click="copyDialogVisible = false">确 定</el-button>
209
+      </span>
210
+    </el-dialog>
211
+  </div>
212
+</template>
213
+
214
+<script>
215
+import Clipboard from 'clipboard'
216
+import { mapState, createNamespacedHelpers } from 'vuex'
217
+const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('card')
218
+const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
219
+
220
+export default {
221
+  name: '',
222
+  data () {
223
+    return {
224
+      currentCopyUrl: '',
225
+      copyDialogVisible: false,
226
+      selectCustomer: [],
227
+      dialogTotal: 0,
228
+      dialogPostData: {
229
+        username: '',
230
+        phone: '',
231
+        recommendname: '',
232
+        begindate: '',
233
+        enddate: '',
234
+        page: 1, // 当前页码
235
+        pagesize: 10, // 请求数据量
236
+      },
237
+      customerList: [],
238
+      centerDialogVisible: false,
239
+      total: 0,
240
+      postData: { // 表格搜索条件
241
+        caseid: '', // 案场id
242
+        page: 1, // 当前页码
243
+        pagesize: 10, // 请求数据量
244
+      },
245
+    }
246
+  },
247
+  mounted () {
248
+    this.$nextTick(function () {
249
+      this.getList()
250
+    })
251
+  },
252
+  computed: {
253
+    ...mapCardState({
254
+      cardList: x => x.cardList,
255
+    }),
256
+    ...mapState({
257
+      cases: x => x.app.cases.list,
258
+      defaultCaseId: x => x.app.cases.default
259
+    }),
260
+    ...mapCustomerState({
261
+      customers: x => x.customers,
262
+    }),
263
+    CaseId: {
264
+      get () {
265
+        return this.postData.caseid || this.defaultCaseId
266
+      },
267
+      set (val) {
268
+        this.postData.caseid = val
269
+      }
270
+    }
271
+  },
272
+  methods: {
273
+    ...mapCardActions([
274
+      'GetCardList',
275
+      'giveCard',
276
+    ]),
277
+    ...mapCustomerActions([
278
+      'GetCustomerList',
279
+      'SetCustomerListNull',
280
+    ]),
281
+    toSendHistory () { // 查看赠送记录
282
+      this.$router.push({ name: 'givingRecords' })
283
+    },
284
+    dialogSearch () { // 赠送客户搜索
285
+      this.GetCustomerList(this.dialogPostData)
286
+    },
287
+    handleCurrentChangeDialog (val) {
288
+      this.dialogPostData.page = val
289
+      this.GetCustomerList(this.dialogPostData)
290
+    },
291
+    handleSelectionChange (val) {
292
+      // console.log(val)
293
+      this.selectCustomer = val
294
+    },
295
+    toSendCard () { // 赠送卡
296
+      if (this.selectCustomer.length) {
297
+        this.selectCustomer = this.selectCustomer.map(x => x.CustomerId).join(',')
298
+        this.giveCard({
299
+          id: this.currentCardId,
300
+          users: this.selectCustomer,
301
+        }).then(res => {
302
+          this.$message({
303
+            type: 'success',
304
+            message: '赠送成功!'
305
+          })
306
+          this.centerDialogVisible = false
307
+          this.selectCustomer = []
308
+          if (this.customers.list.length) {
309
+            this.customers.list = []
310
+          }
311
+          this.getList()
312
+        })
313
+      } else {
314
+        this.$message({
315
+          type: 'error',
316
+          message: '请先选择需要赠送的客户!'
317
+        })
318
+      }
319
+    },
320
+    closeDialog () { // 关闭弹窗
321
+      this.centerDialogVisible = false
322
+      if (this.customers.list.length) {
323
+        this.customers.list = []
324
+      }
325
+    },
326
+    sendCard (index, row) { // 赠送卡弹窗
327
+      this.currentCardId = row.CardId
328
+      this.centerDialogVisible = true
329
+    },
330
+    search () { // 搜索
331
+      this.postData.page = 1
332
+      this.currentList = []
333
+      this.getList()
334
+    },
335
+    getList () { // 获取列表
336
+      this.GetCardList({
337
+        ...this.postData,
338
+        caseid: this.CaseId || this.defaultCaseId
339
+      }).then((res) => {
340
+        this.total = res.pagenum
341
+        // console.log(JSON.stringify(res))
342
+      })
343
+    },
344
+    handleCurrentChange (val) { // 跳转到分页
345
+      this.getList()
346
+    },
347
+    handleEdit (index, row) { // 编辑
348
+      this.$router.push({ name: 'editCard', query: { id: row.CardId } })
349
+    },
350
+    // handleCopy (url) { // 复制弹窗
351
+    //   this.currentCopyUrl = url
352
+    //   this.copyDialogVisible = true
353
+    // },
354
+    toCopy (index, row) { // 复制
355
+      console.log(1)
356
+      var clipboard = new Clipboard(this.$refs['copy' + index])
357
+      clipboard.on('success', e => {
358
+        console.log('复制成功')
359
+        clipboard.destroy()
360
+      })
361
+      clipboard.on('error', e => {
362
+        console.log('该浏览器不支持自动复制')
363
+        clipboard.destroy()
364
+      })
365
+    },
366
+    addCard () {
367
+      this.$router.push({ name: 'editCard', query: {} })
368
+    }
369
+  }
370
+}
371
+</script>
372
+
373
+<!-- Add "scoped" attribute to limit CSS to this component only -->
374
+<style lang="scss" scoped>
375
+@import "page.scss";
376
+.dialogSearchList {
377
+  align-items: center;
378
+  > li {
379
+    font-size: 0;
380
+    margin-left: 10px;
381
+    &:first-child {
382
+      margin-left: 0;
383
+    }
384
+    > *:nth-child(2) {
385
+      margin-left: 10px;
386
+    }
387
+  }
388
+}
389
+.copyBtn{
390
+  line-height: 29px;
391
+  border-radius: 3px;
392
+  color: #fff;
393
+  background: #67c23a;
394
+  display: inline-block;
395
+  padding: 0 15px;
396
+  margin-left: 10px;
397
+}
398
+</style>

+ 27
- 0
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/page.scss 查看文件

@@ -0,0 +1,27 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+

+ 398
- 5
src/pages/system/cardAndCouponManager/cardManager/edit.vue 查看文件

@@ -1,25 +1,316 @@
1 1
 <template>
2 2
   <div class="subPage">
3
-    1
3
+    <form class="mainForm">
4
+      <ul>
5
+        <li class="flex-h">
6
+          <span>选择案场:</span>
7
+          <div class="flex-item">
8
+            <div style="width:50%">
9
+              <el-select v-model="cardInfo.CaseId" placeholder="请选择" @change="caseChange">
10
+                <el-option
11
+                  v-for="item in cases"
12
+                  :key="item.CaseId"
13
+                  :label="item.CaseName"
14
+                  :value="item.CaseId">
15
+                </el-option>
16
+              </el-select>
17
+            </div>
18
+          </div>
19
+        </li>
20
+        <li class="flex-h">
21
+          <span>卡图片:</span>
22
+          <div class="flex-item">
23
+            <div>
24
+              <el-upload
25
+                class="avatar-uploader"
26
+                :action='$api.file.image.url'
27
+                :show-file-list="false"
28
+                :on-success="handleAvatarSuccess">
29
+                <img v-if="cardInfo.Images" :src="cardInfo.Images[0].CardImageUrl" class="avatar">
30
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
31
+              </el-upload>
32
+            </div>
33
+          </div>
34
+        </li>
35
+        <li class="flex-h">
36
+          <span>卡名称:</span>
37
+          <div class="flex-item">
38
+            <div style="width:200px;">
39
+              <el-input
40
+                placeholder="请输入"
41
+                v-model="cardInfo.CardName"
42
+                clearable>
43
+              </el-input>
44
+            </div>
45
+          </div>
46
+        </li>
47
+        <li class="flex-h">
48
+          <span>卡价格:</span>
49
+          <div class="flex-item">
50
+            <div style="width:200px;">
51
+              <el-input
52
+                placeholder="请输入"
53
+                v-model="cardInfo.Price"
54
+                clearable>
55
+              </el-input>
56
+            </div>
57
+          </div>
58
+        </li>
59
+        <li class="flex-h">
60
+          <span>总张数:</span>
61
+          <div class="flex-item">
62
+            <div style="width:200px;">
63
+              <el-input
64
+                placeholder="请输入"
65
+                v-model="cardInfo.TotalCount"
66
+                clearable>
67
+              </el-input>
68
+            </div>
69
+          </div>
70
+        </li>
71
+        <li class="flex-h">
72
+          <span>发送类型:</span>
73
+          <div class="flex-item">
74
+            <div>
75
+              <el-radio v-model="cardInfo.SendType" label="channel">渠道</el-radio>
76
+              <el-radio v-model="cardInfo.SendType" label="case">案场</el-radio>
77
+              <el-radio v-model="cardInfo.SendType" label="system">系统</el-radio>
78
+            </div>
79
+          </div>
80
+        </li>
81
+        <li class="flex-h" v-if="cardInfo.SendType === 'channel'">
82
+          <span>选择渠道:</span>
83
+          <div class="flex-item">
84
+            <div style="width:50%">
85
+              <el-select v-model="cardInfo.ChannelId" placeholder="请选择">
86
+                <el-option
87
+                  v-for="item in channelList"
88
+                  :key="item.ChannelId"
89
+                  :label="item.ChannelName"
90
+                  :value="item.ChannelId">
91
+                </el-option>
92
+              </el-select>
93
+            </div>
94
+          </div>
95
+        </li>
96
+        <li class="flex-h">
97
+          <span>目标课程:</span>
98
+          <div class="flex-item">
99
+            <div>
100
+              <el-select v-model="cardInfo.Targets[0].TargetId" placeholder="请选择">
101
+                <el-option
102
+                  v-for="item in courseList"
103
+                  :key="item.CourseId"
104
+                  :label="item.CourseName"
105
+                  :value="item.CourseId"
106
+                  :disabled="item.Status !== 1">
107
+                </el-option>
108
+              </el-select>
109
+            </div>
110
+          </div>
111
+        </li>
112
+        <li class="flex-h">
113
+          <span>卡有效时间:</span>
114
+          <div class="flex-item">
115
+            <div>
116
+              <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
117
+                <!-- <el-date-picker
118
+                  v-model="cardInfo.StartDate"
119
+                  type="date"
120
+                  placeholder="选择起始日期">
121
+                </el-date-picker>
122
+                <span style="line-height:40px;">至</span>
123
+                <el-date-picker
124
+                  v-model="cardInfo.EndDate"
125
+                  type="date"
126
+                  placeholder="选择截止日期">
127
+                </el-date-picker> -->
128
+                <el-date-picker
129
+                  v-model="date"
130
+                  type="daterange"
131
+                  range-separator="至"
132
+                  start-placeholder="开始日期"
133
+                  end-placeholder="结束日期"
134
+                  :picker-options="pickerOptions">
135
+                </el-date-picker>
136
+              </div>
137
+            </div>
138
+          </div>
139
+        </li>
140
+        <li class="flex-h">
141
+          <span>视频:</span>
142
+          <div class="flex-item">
143
+            <div style="vertical-align: middle;">
144
+              <a style="line-height: 40px;" v-if="videoOff" :href="cardInfo.VideoUrl" target="blank">{{cardInfo.VideoUrl}}</a>
145
+              <el-upload
146
+                class="avatar-uploader"
147
+                :action='$api.file.image.url'
148
+                :show-file-list="false"
149
+                :on-success="videoSuccess">
150
+                <a style="line-height: 40px;padding: 0 10px;">{{videoOff ? '更换' : '添加'}}视频</a>
151
+              </el-upload>
152
+              <el-button v-if="videoOff" type="danger" @click="deleteVideo">删除视频</el-button>
153
+            </div>
154
+          </div>
155
+        </li>
156
+        <li class="flex-h">
157
+          <span>分享描述:</span>
158
+          <div class="flex-item">
159
+            <div>
160
+              <el-input
161
+                type="textarea"
162
+                :rows="2"
163
+                placeholder="请输入"
164
+                v-model="cardInfo.Share.CardShareInfo">
165
+              </el-input>
166
+            </div>
167
+          </div>
168
+        </li>
169
+        <li class="flex-h">
170
+          <span>规则描述:</span>
171
+          <div class="flex-item">
172
+            <div>
173
+              <el-input
174
+                type="textarea"
175
+                :rows="2"
176
+                placeholder="请输入"
177
+                v-model="cardInfo.Share.CardUseRule">
178
+              </el-input>
179
+            </div>
180
+          </div>
181
+        </li>
182
+        <li class="flex-h">
183
+          <span>使用说明:</span>
184
+          <div class="flex-item">
185
+            <div>
186
+              <el-input
187
+                type="textarea"
188
+                :rows="2"
189
+                placeholder="请输入"
190
+                v-model="cardInfo.Share.CardUseInstruction">
191
+              </el-input>
192
+            </div>
193
+          </div>
194
+        </li>
195
+        <li style="text-align:center">
196
+          <el-button type="primary" size="mini" @click="submit">保存</el-button>
197
+          <el-button type="danger" size="mini" @click="cancel">取消</el-button>
198
+        </li>
199
+      </ul>
200
+    </form>
4 201
   </div>
5 202
 </template>
6 203
 
7 204
 <script>
8
-import { mapState } from 'vuex'
205
+import { mapState, createNamespacedHelpers } from 'vuex'
206
+const { mapActions: mapCardActions } = createNamespacedHelpers('card')
207
+const { mapState: mapChannelState, mapActions: mapChannelActions } = createNamespacedHelpers('channel')
208
+const { mapActions: mapCourseActions } = createNamespacedHelpers('course')
9 209
 
10 210
 export default {
11 211
   name: '',
12 212
   data () {
13
-    return {}
213
+    return {
214
+      date: '',
215
+      courseList: [],
216
+      videoOff: false,
217
+      total: 0,
218
+      type: this.$route.query.type,
219
+      isEdit: this.$route.query.id === undefined ? 0 : 1,
220
+      ChannelList: [], // 渠道列表
221
+      TypeList: [], // 类型列表
222
+      GoodsList: [], // 商品列表
223
+      currentList: [{
224
+        Name: 'ccc',
225
+        Type: 'xxx'
226
+      }], // 指定商品数据
227
+      cardInfo: {
228
+        CardName: '',
229
+        SendType: '',
230
+        VideoUrl: '',
231
+        Price: ' ',
232
+        StartDate: '',
233
+        EndDate: '',
234
+        TotalCount: '',
235
+        CaseId: '',
236
+        OrgId: '',
237
+        Share: {
238
+          CardShareInfo: '',
239
+          CardUseRule: '',
240
+          CardUseInstruction: ''
241
+        },
242
+        Images: [{
243
+          CardImageUrl: ''
244
+        }],
245
+        Targets: [{
246
+          TargetType: '',
247
+          TargetId: '',
248
+          TargetName: ''
249
+        }],
250
+        ChannelId: ''
251
+      },
252
+      postData: {
253
+        page: 1,
254
+        pagesize: 10,
255
+      },
256
+    }
14 257
   },
15 258
   mounted () {
16
-    this.$nextTick(function () {})
259
+    this.$nextTick(function () {
260
+      this.GetChannelListList({
261
+        caseid: this.defaultCaseId,
262
+        page: 1,
263
+        pagesize: 10000
264
+      }).then(() => {
265
+        this.GetCourseList({
266
+          caseid: this.defaultCaseId,
267
+          page: 1,
268
+          pagesize: 10000
269
+        }).then((res) => {
270
+          this.courseList = res.list
271
+          if (this.$route.query.id) {
272
+            this.getCardById({
273
+              id: this.$route.query.id
274
+            }).then((res) => {
275
+              // console.log(JSON.stringify(res.Card))
276
+              this.cardInfo = res.Card
277
+              if (res.Card.VideoUrl) {
278
+                this.videoOff = true
279
+              }
280
+              if (res.Card.Images === null) {
281
+                this.cardInfo.Images = [{
282
+                  CardImageUrl: ''
283
+                }]
284
+              }
285
+              if (res.Card.StartDate) {
286
+                this.date = [res.Card.StartDate, res.Card.EndDate]
287
+              }
288
+            })
289
+          }
290
+        })
291
+      })
292
+    })
17 293
   },
18 294
   computed: {
295
+    ...mapChannelState({
296
+      channelList: x => x.channelList,
297
+    }),
19 298
     ...mapState({
20 299
       cases: x => x.app.cases.list,
21
-      defaultCaseId: x => x.app.cases.default
300
+      defaultCaseId: x => x.app.cases.default,
301
+      OrgId: x => x.app.user.OrgId,
22 302
     }),
303
+    pickerOptions () {
304
+      const courseId = this.cardInfo.Targets[0].TargetId
305
+      const couse = (this.courseList || []).filter(x => x.CourseId === courseId)[0] || {}
306
+      const beginDate = new Date(couse.BeginDate).getTime()
307
+      const endDate = new Date(couse.EndDate).getTime()
308
+      return {
309
+        disabledDate (time) {
310
+          return time.getTime() < beginDate || time.getTime() > endDate
311
+        }
312
+      }
313
+    },
23 314
     CaseId: {
24 315
       get () {
25 316
         return this.postData.caseid || this.defaultCaseId
@@ -30,10 +321,112 @@ export default {
30 321
     }
31 322
   },
32 323
   methods: {
324
+    ...mapCardActions([
325
+      'addCard',
326
+      'getCardById',
327
+      'editCard',
328
+    ]),
329
+    ...mapCourseActions([
330
+      'GetCourseList',
331
+    ]),
332
+    ...mapChannelActions([
333
+      'GetChannelListList',
334
+    ]),
335
+    caseChange () { // 选择案场
336
+      this.GetChannelListList({
337
+        caseid: this.cardInfo.CaseId,
338
+        page: 1,
339
+        pagesize: 10000
340
+      })
341
+      this.GetCourseList({
342
+        caseid: this.cardInfo.CaseId,
343
+        page: 1,
344
+        pagesize: 10000
345
+      }).then((res) => {
346
+        this.courseList = res.list
347
+      })
348
+      this.cardInfo.Targets = [{
349
+        TargetType: '',
350
+        TargetId: '',
351
+        TargetName: ''
352
+      }]
353
+      this.cardInfo.ChannelId = ''
354
+    },
355
+    deleteVideo () { // 删除视频
356
+      this.cardInfo.VideoUrl = ''
357
+      this.videoOff = false
358
+    },
359
+    videoSuccess (res, file) {
360
+      this.videoOff = true
361
+      this.cardInfo.VideoUrl = res.result.url
362
+    },
363
+    addGoods () { // 添加指定商品
364
+      this.centerDialogVisible = true
365
+    },
366
+    submit () { // 保存
367
+      if (this.$route.query.id) {
368
+        if (this.date !== '') {
369
+          this.cardInfo.StartDate = this.date[0]
370
+          this.cardInfo.EndDate = this.date[1]
371
+        }
372
+        for (var x = 0; x < this.courseList.length; x++) {
373
+          if (this.courseList[x].CourseId === this.cardInfo.Targets[0].TargetId) {
374
+            this.cardInfo.Targets[0].TargetType = this.courseList[x].CourseType
375
+            this.cardInfo.Targets[0].TargetName = this.courseList[x].CourseName
376
+          }
377
+        }
378
+        this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
379
+        console.log(JSON.stringify(this.cardInfo))
380
+        this.editCard(this.cardInfo).then((res) => {
381
+          this.$alert('操作成功', '提示', {
382
+            confirmButtonText: '确定',
383
+            callback: action => {
384
+              this.$router.push({ name: 'cardList' })
385
+            }
386
+          })
387
+        })
388
+      } else {
389
+        this.cardInfo.OrgId = this.OrgId
390
+        if (this.date !== '') {
391
+          this.cardInfo.StartDate = this.date[0]
392
+          this.cardInfo.EndDate = this.date[1]
393
+        }
394
+        for (var n = 0; n < this.courseList.length; n++) {
395
+          if (this.courseList[n].CourseId === this.cardInfo.Targets[0].TargetId) {
396
+            this.cardInfo.Targets[0].TargetType = this.courseList[n].CourseType
397
+            this.cardInfo.Targets[0].TargetName = this.courseList[n].CourseName
398
+          }
399
+        }
400
+        this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
401
+        console.log(JSON.stringify(this.cardInfo))
402
+        this.addCard(this.cardInfo).then((res) => {
403
+          this.$alert('操作成功', '提示', {
404
+            confirmButtonText: '确定',
405
+            callback: action => {
406
+              this.$router.push({ name: 'cardList' })
407
+            }
408
+          })
409
+        })
410
+      }
411
+    },
412
+    cancel () { // 取消
413
+      this.$router.push({ name: 'couponList' })
414
+    },
415
+    handleAvatarSuccess (res, file) {
416
+      this.cardInfo.Images[0].CardImageUrl = res.result.url
417
+    },
33 418
   }
34 419
 }
35 420
 </script>
36 421
 
37 422
 <!-- Add "scoped" attribute to limit CSS to this component only -->
38 423
 <style lang="scss" scoped>
424
+.addLine {
425
+  > * {
426
+    margin-right: 10px;
427
+  }
428
+}
429
+.mainForm > ul > li > div > div > button {
430
+  margin-top: 0;
431
+}
39 432
 </style>

+ 286
- 42
src/pages/system/cardAndCouponManager/cardManager/index.vue 查看文件

@@ -3,12 +3,12 @@
3 3
     <div class="system-table-search">
4 4
       <div class="flex-h">
5 5
         <div class="flex-item flex-h">
6
-          <el-button size="mini" type="success" @click='addChannel'>新增渠道</el-button>
6
+          <el-button size="mini" type="success" @click="addCard">新增课程体验卡</el-button>
7 7
         </div>
8 8
         <ul>
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11
-            <el-select v-model="CaseId" placeholder="请选择">
11
+            <el-select v-model="CaseId" placeholder="请选择案场">
12 12
               <el-option
13 13
                 v-for="item in cases"
14 14
                 :key="item.CaseId"
@@ -26,18 +26,55 @@
26 26
     </div>
27 27
     <div class="system-table-box">
28 28
       <el-table
29
-        :data="currentList"
29
+        :data="cardList.list"
30 30
         stripe
31 31
         style="width: 100%">
32 32
         <el-table-column
33
-          prop="CaseName"
34
-          label="案场">
33
+          prop="CardName"
34
+          label="卡名称">
35 35
         </el-table-column>
36
+        <!-- <el-table-column
37
+          prop="xxx"
38
+          label="卡类型">
39
+        </el-table-column> -->
36 40
         <el-table-column
37
-          prop="ChannelName"
38
-          label="渠道名称">
41
+          prop="Price"
42
+          label="卡价格">
39 43
         </el-table-column>
40
-        <el-table-column label="操作">
44
+        <el-table-column
45
+          prop="StartDate"
46
+          label="有效期"
47
+          width="150">
48
+          <template slot-scope="scope">
49
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.StartDate)}}</span>
50
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">至</span>
51
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.EndDate)}}</span>
52
+          </template>
53
+        </el-table-column>
54
+        <el-table-column
55
+          prop="SendType"
56
+          label="发放类型">
57
+        </el-table-column>
58
+        <el-table-column
59
+          prop="TotalCount"
60
+          label="总数量">
61
+        </el-table-column>
62
+        <el-table-column
63
+          prop="SentCount"
64
+          label="已发">
65
+        </el-table-column>
66
+        <el-table-column
67
+          prop="UsedCount"
68
+          label="实际使用">
69
+        </el-table-column>
70
+        <el-table-column
71
+          prop="Status"
72
+          label="状态">
73
+          <template slot-scope="scope">
74
+            {{scope.row.Status == 1 ? '正常' : '已过期'}}
75
+          </template>
76
+        </el-table-column>
77
+        <el-table-column label="操作" fixed='right' width="350">
41 78
           <template slot-scope="scope">
42 79
             <el-button
43 80
               size="mini"
@@ -46,7 +83,8 @@
46 83
             <el-button
47 84
               size="mini"
48 85
               type="danger"
49
-              @click="handleDelete(scope.$index, scope.row)">删除</el-button>
86
+              @click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
87
+            <a class="copyBtn" :data-clipboard-text="'www.baidu.com'" :ref="'copy' + scope.$index" @click="toCopy(scope.$index, scope.row)">点击复制链接</a>
50 88
           </template>
51 89
         </el-table-column>
52 90
       </el-table>
@@ -58,23 +96,153 @@
58 96
       layout="prev, pager, next, jumper"
59 97
       :total="total">
60 98
     </el-pagination>
99
+    <el-dialog
100
+      title="选择赠送客户"
101
+      :visible.sync="centerDialogVisible"
102
+      width="800px"
103
+      center>
104
+      <div>
105
+        <ul class="dialogSearchList flex-h" style="margin-bottom:10px;">
106
+          <li class="flex-item">
107
+            <el-input
108
+              placeholder="请输入用户名"
109
+              v-model="dialogPostData.username"
110
+              clearable>
111
+            </el-input>
112
+          </li>
113
+          <li class="flex-item">
114
+            <el-input
115
+              placeholder="请输入手机号"
116
+              v-model="dialogPostData.phone"
117
+              clearable>
118
+            </el-input>
119
+          </li>
120
+          <li class="flex-item">
121
+            <el-input
122
+              placeholder="请输入推荐人"
123
+              v-model="dialogPostData.recommendname"
124
+              clearable>
125
+            </el-input>
126
+          </li>
127
+          <li>
128
+            <el-button type="primary" @click="dialogSearch">搜索</el-button>
129
+          </li>
130
+        </ul>
131
+        <ul class="dialogSearchList flex-h">
132
+          <li class="flex-item">
133
+            <el-date-picker
134
+              v-model="dialogPostData.begindate"
135
+              type="date"
136
+              placeholder="选择起始日期">
137
+            </el-date-picker>
138
+            <el-date-picker
139
+              v-model="dialogPostData.enddate"
140
+              type="date"
141
+              placeholder="选择截止日期">
142
+            </el-date-picker>
143
+          </li>
144
+        </ul>
145
+      </div>
146
+      <div>
147
+        <el-table
148
+          ref="multipleTable"
149
+          :data="customers.list"
150
+          tooltip-effect="dark"
151
+          style="width: 100%"
152
+          @selection-change="handleSelectionChange">
153
+          <el-table-column
154
+            type="selection">
155
+          </el-table-column>
156
+          <el-table-column
157
+            prop="Name"
158
+            label="姓名">
159
+          </el-table-column>
160
+          <el-table-column
161
+            prop="CustomerName"
162
+            label="微信昵称">
163
+          </el-table-column>
164
+          <el-table-column
165
+            prop="Phone"
166
+            label="手机号">
167
+          </el-table-column>
168
+          <el-table-column
169
+            prop="CreatDate"
170
+            label="创建时间">
171
+            <template slot-scope="scope">
172
+              <span>{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd')}}</span>
173
+            </template>
174
+          </el-table-column>
175
+          <el-table-column
176
+            prop="RecommendName"
177
+            label="推荐人">
178
+          </el-table-column>
179
+        </el-table>
180
+      </div>
181
+      <div>
182
+        <el-pagination
183
+          @current-change="handleCurrentChangeDialog"
184
+          :current-page.sync="dialogPostData.page"
185
+          :page-size="dialogPostData.pagesize"
186
+          layout="prev, pager, next, jumper"
187
+          :total="dialogTotal">
188
+        </el-pagination>
189
+      </div>
190
+      <span slot="footer" class="dialog-footer">
191
+        <el-button @click="closeDialog">取 消</el-button>
192
+        <el-button type="primary" @click="toSendCard">确 定</el-button>
193
+      </span>
194
+    </el-dialog>
195
+    <el-dialog
196
+      title="手动复制"
197
+      :visible.sync="copyDialogVisible"
198
+      width="300px"
199
+      center>
200
+      <div>
201
+        <el-input
202
+          placeholder="请输入内容"
203
+          v-model="currentCopyUrl"
204
+          clearable>
205
+        </el-input>
206
+        <!-- <a :data-clipboard-text="currentCopyUrl" ref="copy" @click="toCopy">复制链接</a> -->
207
+      </div>
208
+      <span slot="footer" class="dialog-footer">
209
+        <el-button type="primary" @click="copyDialogVisible = false">确 定</el-button>
210
+      </span>
211
+    </el-dialog>
61 212
   </div>
62 213
 </template>
63 214
 
64 215
 <script>
65
-import { mapState } from 'vuex'
216
+import Clipboard from 'clipboard'
217
+import { mapState, createNamespacedHelpers } from 'vuex'
218
+const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('card')
219
+const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
66 220
 
67 221
 export default {
68 222
   name: '',
69 223
   data () {
70 224
     return {
225
+      currentCopyUrl: '',
226
+      copyDialogVisible: false,
227
+      selectCustomer: [],
228
+      dialogTotal: 0,
229
+      dialogPostData: {
230
+        username: '',
231
+        phone: '',
232
+        recommendname: '',
233
+        begindate: '',
234
+        enddate: '',
235
+        page: 1, // 当前页码
236
+        pagesize: 10, // 请求数据量
237
+      },
238
+      customerList: [],
239
+      centerDialogVisible: false,
71 240
       total: 0,
72 241
       postData: { // 表格搜索条件
73 242
         caseid: '', // 案场id
74 243
         page: 1, // 当前页码
75 244
         pagesize: 10, // 请求数据量
76 245
       },
77
-      currentList: []
78 246
     }
79 247
   },
80 248
   mounted () {
@@ -83,10 +251,16 @@ export default {
83 251
     })
84 252
   },
85 253
   computed: {
254
+    ...mapCardState({
255
+      cardList: x => x.cardList,
256
+    }),
86 257
     ...mapState({
87 258
       cases: x => x.app.cases.list,
88 259
       defaultCaseId: x => x.app.cases.default
89 260
     }),
261
+    ...mapCustomerState({
262
+      customers: x => x.customers,
263
+    }),
90 264
     CaseId: {
91 265
       get () {
92 266
         return this.postData.caseid || this.defaultCaseId
@@ -97,53 +271,101 @@ export default {
97 271
     }
98 272
   },
99 273
   methods: {
274
+    ...mapCardActions([
275
+      'GetCardList',
276
+      'giveCard',
277
+    ]),
278
+    ...mapCustomerActions([
279
+      'GetCustomerList',
280
+      'SetCustomerListNull',
281
+    ]),
282
+    toSendHistory () { // 查看赠送记录
283
+      this.$router.push({ name: 'givingRecords' })
284
+    },
285
+    dialogSearch () { // 赠送客户搜索
286
+      this.GetCustomerList(this.dialogPostData)
287
+    },
288
+    handleCurrentChangeDialog (val) {
289
+      this.dialogPostData.page = val
290
+      this.GetCustomerList(this.dialogPostData)
291
+    },
292
+    handleSelectionChange (val) {
293
+      // console.log(val)
294
+      this.selectCustomer = val
295
+    },
296
+    toSendCard () { // 赠送卡
297
+      if (this.selectCustomer.length) {
298
+        this.selectCustomer = this.selectCustomer.map(x => x.CustomerId).join(',')
299
+        this.giveCard({
300
+          id: this.currentCardId,
301
+          users: this.selectCustomer,
302
+        }).then(res => {
303
+          this.$message({
304
+            type: 'success',
305
+            message: '赠送成功!'
306
+          })
307
+          this.centerDialogVisible = false
308
+          this.selectCustomer = []
309
+          if (this.customers.list.length) {
310
+            this.customers.list = []
311
+          }
312
+          this.getList()
313
+        })
314
+      } else {
315
+        this.$message({
316
+          type: 'error',
317
+          message: '请先选择需要赠送的客户!'
318
+        })
319
+      }
320
+    },
321
+    closeDialog () { // 关闭弹窗
322
+      this.centerDialogVisible = false
323
+      if (this.customers.list.length) {
324
+        this.customers.list = []
325
+      }
326
+    },
327
+    sendCard (index, row) { // 赠送卡弹窗
328
+      this.currentCardId = row.CardId
329
+      this.centerDialogVisible = true
330
+    },
100 331
     search () { // 搜索
101 332
       this.postData.page = 1
102 333
       this.currentList = []
103 334
       this.getList()
104 335
     },
105 336
     getList () { // 获取列表
106
-      this.$ajax(this.$api.channelManager.getChannelList.url, {
107
-        method: this.$api.channelManager.getChannelList.method,
108
-        queryData: { ...this.postData, caseid: this.CaseId }
109
-      }).then(res => {
110
-        this.currentList = res.list
111
-        this.postData.page = res.page
337
+      this.GetCardList({
338
+        ...this.postData,
339
+        caseid: this.CaseId || this.defaultCaseId
340
+      }).then((res) => {
112 341
         this.total = res.pagenum
342
+        // console.log(JSON.stringify(res))
113 343
       })
114 344
     },
115 345
     handleCurrentChange (val) { // 跳转到分页
116 346
       this.getList()
117 347
     },
118 348
     handleEdit (index, row) { // 编辑
119
-      this.$router.push({ name: 'editChannel', query: { id: row.ChannelId } })
349
+      this.$router.push({ name: 'editCard', query: { id: row.CardId } })
120 350
     },
121
-    handleDelete (index, row) { // 删除
122
-      let name = '确认删除渠道“' + row.ChannelName + '”?'
123
-      this.$confirm(name, '提示', {
124
-        confirmButtonText: '确定',
125
-        cancelButtonText: '取消',
126
-        type: 'warning'
127
-      }).then(() => {
128
-        this.$ajax(this.$api.channelManager.deleteChannel.url, {
129
-          method: this.$api.channelManager.deleteChannel.method,
130
-          urlData: { channelId: row.ChannelId }
131
-        }).then(res => {
132
-          this.$message({
133
-            type: 'success',
134
-            message: '删除成功!'
135
-          })
136
-          this.search()
137
-        })
138
-      }).catch(() => {
139
-        this.$message({
140
-          type: 'info',
141
-          message: '已取消删除'
142
-        })
351
+    // handleCopy (url) { // 复制弹窗
352
+    //   this.currentCopyUrl = url
353
+    //   this.copyDialogVisible = true
354
+    // },
355
+    toCopy (index, row) { // 复制
356
+      console.log(1)
357
+      var clipboard = new Clipboard(this.$refs['copy' + index])
358
+      clipboard.on('success', e => {
359
+        console.log('复制成功')
360
+        clipboard.destroy()
361
+      })
362
+      clipboard.on('error', e => {
363
+        console.log('该浏览器不支持自动复制')
364
+        clipboard.destroy()
143 365
       })
144 366
     },
145
-    addChannel () {
146
-      this.$router.push({ name: 'addChannel' })
367
+    addCard () {
368
+      this.$router.push({ name: 'editCard', query: {} })
147 369
     }
148 370
   }
149 371
 }
@@ -152,4 +374,26 @@ export default {
152 374
 <!-- Add "scoped" attribute to limit CSS to this component only -->
153 375
 <style lang="scss" scoped>
154 376
 @import "page.scss";
377
+.dialogSearchList {
378
+  align-items: center;
379
+  > li {
380
+    font-size: 0;
381
+    margin-left: 10px;
382
+    &:first-child {
383
+      margin-left: 0;
384
+    }
385
+    > *:nth-child(2) {
386
+      margin-left: 10px;
387
+    }
388
+  }
389
+}
390
+.copyBtn{
391
+  line-height: 29px;
392
+  border-radius: 3px;
393
+  color: #fff;
394
+  background: #67c23a;
395
+  display: inline-block;
396
+  padding: 0 15px;
397
+  margin-left: 10px;
398
+}
155 399
 </style>

+ 621
- 6
src/pages/system/cardAndCouponManager/couponManager/edit.vue 查看文件

@@ -1,39 +1,654 @@
1 1
 <template>
2 2
   <div class="subPage">
3
-    1
3
+    <form class="mainForm">
4
+      <!-- <h1 style="font-size:22px;">{{isEdit === 0 ? '新建' : '编辑'}}{{couponInfo.CouponType === 'goods' ? '饮品优惠券' : '课程优惠券'}}</h1> -->
5
+      <ul>
6
+        <li class="flex-h">
7
+          <span>选择案场:</span>
8
+          <div class="flex-item">
9
+            <div style="width:50%">
10
+              <el-select v-model="couponInfo.CaseId" placeholder="请选择" @change="caseChange">
11
+                <el-option
12
+                  v-for="item in cases"
13
+                  :key="item.CaseId"
14
+                  :label="item.CaseName"
15
+                  :value="item.CaseId">
16
+                </el-option>
17
+              </el-select>
18
+            </div>
19
+          </div>
20
+        </li>
21
+        <li class="flex-h">
22
+          <span>券图片:</span>
23
+          <div class="flex-item">
24
+            <div>
25
+              <el-upload
26
+                class="avatar-uploader"
27
+                :action='$api.file.image.url'
28
+                :show-file-list="false"
29
+                :on-success="handleAvatarSuccess">
30
+                <img v-if="couponInfo.Images[0].CouponImageUrl" :src="couponInfo.Images[0].CouponImageUrl" class="avatar">
31
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
32
+              </el-upload>
33
+            </div>
34
+          </div>
35
+        </li>
36
+        <li class="flex-h">
37
+          <span>券名称:</span>
38
+          <div class="flex-item">
39
+            <div style="width:200px;">
40
+              <el-input
41
+                placeholder="请输入"
42
+                v-model="couponInfo.CouponName"
43
+                clearable>
44
+              </el-input>
45
+            </div>
46
+          </div>
47
+        </li>
48
+        <li class="flex-h">
49
+          <span>券类型:</span>
50
+          <div class="flex-item">
51
+            <div style="width:50%">
52
+              <el-select v-model="couponInfo.CouponType" placeholder="请选择" @change="couponTypeChange">
53
+                <el-option
54
+                  v-for="item in TypeList"
55
+                  :key="item.id"
56
+                  :label="item.value"
57
+                  :value="item.id">
58
+                </el-option>
59
+              </el-select>
60
+            </div>
61
+          </div>
62
+        </li>
63
+        <li class="flex-h">
64
+          <span>券价格:</span>
65
+          <div class="flex-item">
66
+            <div style="width:200px;">
67
+              <el-input
68
+                placeholder="请输入"
69
+                v-model="couponInfo.Price"
70
+                clearable>
71
+              </el-input>
72
+            </div>
73
+          </div>
74
+        </li>
75
+        <li class="flex-h">
76
+          <span>总张数:</span>
77
+          <div class="flex-item">
78
+            <div style="width:200px;">
79
+              <el-input
80
+                placeholder="请输入"
81
+                v-model="couponInfo.TotalCount"
82
+                clearable>
83
+              </el-input>
84
+            </div>
85
+          </div>
86
+        </li>
87
+        <li class="flex-h">
88
+          <span>发送类型:</span>
89
+          <div class="flex-item">
90
+            <div>
91
+              <el-radio v-model="couponInfo.SendType" label="channel">渠道</el-radio>
92
+              <el-radio v-if="couponInfo.CouponType === 'case'" v-model="couponInfo.SendType" label="case">案场</el-radio>
93
+              <el-radio v-model="couponInfo.SendType" label="system">系统</el-radio>
94
+            </div>
95
+          </div>
96
+        </li>
97
+        <li class="flex-h" v-if="couponInfo.SendType === 'channel'">
98
+          <span>选择渠道:</span>
99
+          <div class="flex-item">
100
+            <div style="width:50%">
101
+              <el-select v-model="couponInfo.ChannelId" placeholder="请选择">
102
+                <el-option
103
+                  v-for="item in channelList"
104
+                  :key="item.ChannelId"
105
+                  :label="item.ChannelName"
106
+                  :value="item.ChannelId">
107
+                </el-option>
108
+              </el-select>
109
+            </div>
110
+          </div>
111
+        </li>
112
+        <li class="flex-h">
113
+          <span>目标商品:</span>
114
+          <div class="flex-item">
115
+            <div>
116
+              <el-radio v-model="couponInfo.IsAll" label="1">全部商品</el-radio>
117
+              <el-radio v-model="couponInfo.IsAll" label="0">指定商品</el-radio>
118
+            </div>
119
+          </div>
120
+        </li>
121
+        <li class="flex-h" v-if="couponInfo.IsAll === '0'">
122
+          <div class="flex-item">
123
+            <div style="border: 1px solid #eee;">
124
+              <el-table
125
+                :data="couponInfo.Targets"
126
+                stripe
127
+                style="width: 100%">
128
+                <el-table-column
129
+                  prop="TargetName"
130
+                  label="商品">
131
+                </el-table-column>
132
+                <el-table-column
133
+                  prop="TargetType"
134
+                  label="分类">
135
+                  <template slot-scope="scope">
136
+                    {{returnGoodsType(scope.row.TargetType)}}
137
+                  </template>
138
+                </el-table-column>
139
+                <el-table-column label="操作">
140
+                  <template slot-scope="scope">
141
+                    <el-button
142
+                      size="mini"
143
+                      type="warning"
144
+                      @click="deleteGoodsItem(scope.$index, scope.row)">删除</el-button>
145
+                  </template>
146
+                </el-table-column>
147
+              </el-table>
148
+              <div style="text-align:center;padding:10px 0;">
149
+                <el-button type="success" size="mini" @click="addGoods">添加商品</el-button>
150
+              </div>
151
+            </div>
152
+          </div>
153
+        </li>
154
+        <li class="flex-h" v-if="couponInfo.CouponType === 'goods'">
155
+          <span>券有效时间:</span>
156
+          <div class="flex-item">
157
+            <div>
158
+              <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
159
+                <el-radio v-model="postData.TimeType" label="1">固定时间</el-radio>
160
+                <el-date-picker
161
+                  v-model="couponInfo.StartDate"
162
+                  type="date"
163
+                  placeholder="选择起始日期">
164
+                </el-date-picker>
165
+                <span style="line-height:40px;">至</span>
166
+                <el-date-picker
167
+                  v-model="couponInfo.EndDate"
168
+                  type="date"
169
+                  placeholder="选择截止日期">
170
+                </el-date-picker>
171
+              </div>
172
+              <div class="addLine flex-h" style="align-item:center;">
173
+                <el-radio v-model="postData.TimeType" label="2">领取后</el-radio>
174
+                <span style="width:100px;">
175
+                  <el-input
176
+                    placeholder="请输入"
177
+                    v-model="couponInfo.ValidDays"
178
+                    clearable>
179
+                  </el-input>
180
+                </span>
181
+                <span style="line-height:40px;">天</span>
182
+              </div>
183
+            </div>
184
+          </div>
185
+        </li>
186
+        <li class="flex-h" v-if="type === 'course'">
187
+          <span>券有效时间:</span>
188
+          <div class="flex-item">
189
+            <div>
190
+              <el-date-picker
191
+                v-model="couponInfo.StartDate"
192
+                type="date"
193
+                placeholder="选择起始日期">
194
+              </el-date-picker>
195
+              <span style="line-height:40px;">至</span>
196
+              <el-date-picker
197
+                v-model="couponInfo.EndDate"
198
+                type="date"
199
+                placeholder="选择截止日期">
200
+              </el-date-picker>
201
+            </div>
202
+          </div>
203
+        </li>
204
+        <li class="flex-h">
205
+          <span>视频:</span>
206
+          <div class="flex-item">
207
+            <div style="vertical-align: middle;">
208
+              <a style="line-height: 40px;" v-if="videoOff" :href="couponInfo.VideoUrl" target="blank">{{couponInfo.VideoUrl}}</a>
209
+              <el-upload
210
+                class="avatar-uploader"
211
+                :action='$api.file.image.url'
212
+                :show-file-list="false"
213
+                :on-success="videoSuccess">
214
+                <a style="line-height: 40px;padding: 0 10px;">{{videoOff ? '更换' : '添加'}}视频</a>
215
+              </el-upload>
216
+              <el-button v-if="videoOff" type="danger" @click="deleteVideo">删除视频</el-button>
217
+            </div>
218
+          </div>
219
+        </li>
220
+        <li class="flex-h">
221
+          <span>分享描述:</span>
222
+          <div class="flex-item">
223
+            <div>
224
+              <el-input
225
+                type="textarea"
226
+                :rows="2"
227
+                placeholder="请输入"
228
+                v-model="couponInfo.Share.CouponShareInfo">
229
+              </el-input>
230
+            </div>
231
+          </div>
232
+        </li>
233
+        <li class="flex-h">
234
+          <span>规则描述:</span>
235
+          <div class="flex-item">
236
+            <div>
237
+              <el-input
238
+                type="textarea"
239
+                :rows="2"
240
+                placeholder="请输入"
241
+                v-model="couponInfo.Share.UseRule">
242
+              </el-input>
243
+            </div>
244
+          </div>
245
+        </li>
246
+        <li class="flex-h">
247
+          <span>使用说明:</span>
248
+          <div class="flex-item">
249
+            <div>
250
+              <el-input
251
+                type="textarea"
252
+                :rows="2"
253
+                placeholder="请输入"
254
+                v-model="couponInfo.Share.UseInstruction">
255
+              </el-input>
256
+            </div>
257
+          </div>
258
+        </li>
259
+        <li style="text-align:center">
260
+          <el-button type="primary" size="mini" @click="submit">保存</el-button>
261
+          <el-button type="danger" size="mini" @click="cancel">取消</el-button>
262
+        </li>
263
+      </ul>
264
+    </form>
265
+    <el-dialog
266
+      title="选择指定商品"
267
+      :visible.sync="centerDialogVisible"
268
+      width="650px"
269
+      center>
270
+      <div>
271
+        <div v-if="couponInfo.CouponType === 'goods'">
272
+          <el-table
273
+            ref="multipleTable"
274
+            :data="goodsList.list"
275
+            tooltip-effect="dark"
276
+            style="width: 100%"
277
+            @selection-change="handleGoodsChange">
278
+            <el-table-column
279
+              type="selection">
280
+            </el-table-column>
281
+            <el-table-column
282
+              prop="GoodsName"
283
+              label="商品名称">
284
+            </el-table-column>
285
+            <el-table-column
286
+              prop="TypeId"
287
+              label="类别">
288
+            </el-table-column>
289
+            <el-table-column
290
+              prop="Price"
291
+              label="价格">
292
+            </el-table-column>
293
+          </el-table>
294
+          <el-pagination
295
+            @current-change="handleCurrentChange"
296
+            :current-page.sync="postData.page"
297
+            :page-size="postData.pagesize"
298
+            layout="prev, pager, next, jumper"
299
+            :total="total">
300
+          </el-pagination>
301
+        </div>
302
+        <div v-if="couponInfo.CouponType === 'course'">
303
+          <el-table
304
+            ref="multipleTable"
305
+            :data="courseList.list"
306
+            tooltip-effect="dark"
307
+            style="width: 100%"
308
+            @selection-change="handleCourseChange">
309
+            <el-table-column
310
+              type="selection">
311
+            </el-table-column>
312
+            <el-table-column
313
+              prop="CourseName"
314
+              label="商品名称">
315
+            </el-table-column>
316
+            <el-table-column
317
+              prop="BeginDate"
318
+              label="开始时间">
319
+            </el-table-column>
320
+            <el-table-column
321
+              prop="EndDate"
322
+              label="结束时间">
323
+            </el-table-column>
324
+            <el-table-column
325
+              prop="CourseType"
326
+              label="类别">
327
+            </el-table-column>
328
+            <el-table-column
329
+              prop="Price"
330
+              label="价格">
331
+            </el-table-column>
332
+          </el-table>
333
+          <el-pagination
334
+            @current-change="handleCurrentChange"
335
+            :current-page.sync="postData.page"
336
+            :page-size="postData.pagesize"
337
+            layout="prev, pager, next, jumper"
338
+            :total="total">
339
+          </el-pagination>
340
+        </div>
341
+      </div>
342
+      <span slot="footer" class="dialog-footer">
343
+        <el-button @click="centerDialogVisible = false">取 消</el-button>
344
+        <el-button type="primary" @click="sureAddItem">确 定</el-button>
345
+      </span>
346
+    </el-dialog>
4 347
   </div>
5 348
 </template>
6 349
 
7 350
 <script>
8
-import { mapState } from 'vuex'
351
+import { mapState, createNamespacedHelpers } from 'vuex'
352
+const { mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
353
+const { mapState: mapChannelState, mapActions: mapChannelActions } = createNamespacedHelpers('channel')
354
+const { mapState: mapGoodsState, mapActions: mapGoodsActions } = createNamespacedHelpers('goods')
355
+const { mapState: mapCourseState, mapActions: mapCourseActions } = createNamespacedHelpers('course')
9 356
 
10 357
 export default {
11 358
   name: '',
12 359
   data () {
13
-    return {}
360
+    return {
361
+      videoOff: false,
362
+      total: 0,
363
+      centerDialogVisible: false,
364
+      type: this.$route.query.type || '', // goods、course
365
+      isEdit: this.$route.query.id === undefined ? 0 : 1,
366
+      ChannelList: [], // 渠道列表
367
+      TypeList: [{ // 类型列表
368
+        value: '商品券',
369
+        id: 'goods'
370
+      }, {
371
+        value: '课程券',
372
+        id: 'course'
373
+      }],
374
+      currentList: [{
375
+        Name: 'ccc',
376
+        Type: 'xxx'
377
+      }], // 指定商品数据
378
+      couponInfo: {
379
+        CaseId: '',
380
+        CouponName: '',
381
+        CouponType: '',
382
+        Price: '',
383
+        TotalCount: '',
384
+        SendType: '',
385
+        IsAll: '',
386
+        StartDate: '',
387
+        EndDate: '',
388
+        ValidDays: '',
389
+        VideoUrl: '',
390
+        ChannelId: '',
391
+        Images: [{
392
+          CouponImageUrl: ''
393
+        }],
394
+        Share: {
395
+          CouponShareInfo: '',
396
+          UseRule: '',
397
+          UseInstruction: ''
398
+        },
399
+        Targets: []
400
+      },
401
+      postData: {
402
+        page: 1,
403
+        pagesize: 6,
404
+      },
405
+      currentSelectArr: [],
406
+    }
14 407
   },
15 408
   mounted () {
16
-    this.$nextTick(function () {})
409
+    this.$nextTick(function () {
410
+      this.GetChannelListList({
411
+        caseid: this.defaultCaseId,
412
+        page: 1,
413
+        pagesize: 10000
414
+      }).then(() => {
415
+        this.GetGoodTypes({ pagesize: 1000, caseid: this.$route.query.caseid }).then(() => {
416
+          if (this.$route.query.id) {
417
+            this.getCouponById({
418
+              id: this.$route.query.id
419
+            }).then((res) => {
420
+              // console.log(JSON.stringify(res))
421
+              res.coupon.IsAll = String(res.coupon.IsAll)
422
+              if (res.coupon.VideoUrl !== '') {
423
+                this.videoOff = true
424
+              }
425
+              this.couponInfo = res.coupon
426
+            })
427
+          }
428
+        })
429
+      })
430
+    })
17 431
   },
18 432
   computed: {
19 433
     ...mapState({
20 434
       cases: x => x.app.cases.list,
21 435
       defaultCaseId: x => x.app.cases.default
22 436
     }),
437
+    ...mapChannelState({
438
+      channelList: x => x.channelList,
439
+    }),
440
+    ...mapGoodsState({
441
+      goodsList: x => x.goodsList,
442
+      goodsTypes: x => x.goodsTypes.list,
443
+    }),
444
+    ...mapCourseState({
445
+      courseList: x => x.courseList,
446
+    }),
23 447
     CaseId: {
24 448
       get () {
25
-        return this.postData.caseid || this.defaultCaseId
449
+        return this.couponInfo.caseid || this.defaultCaseId
26 450
       },
27 451
       set (val) {
28
-        this.postData.caseid = val
452
+        this.couponInfo.caseid = val
29 453
       }
30 454
     }
31 455
   },
32 456
   methods: {
457
+    ...mapGoodsActions([
458
+      'GetGoodsList',
459
+      'GetGoodTypes',
460
+    ]),
461
+    ...mapCouponActions([
462
+      'addCoupon',
463
+      'getCouponById',
464
+      'editCoupon',
465
+    ]),
466
+    ...mapChannelActions([
467
+      'GetChannelListList',
468
+    ]),
469
+    ...mapCourseActions([
470
+      'GetCourseList',
471
+    ]),
472
+    returnGoodsType (val) {
473
+      for (var n = 0; n < this.goodsTypes.length; n++) {
474
+        if (this.goodsTypes[n].TypeId === val) {
475
+          return this.goodsTypes[n].TypeName
476
+        }
477
+      }
478
+    },
479
+    deleteVideo () { // 删除视频
480
+      this.couponInfo.VideoUrl = ''
481
+      this.videoOff = false
482
+    },
483
+    caseChange () { // 选择案场
484
+      this.couponInfo.ChannelId = ''
485
+      this.GetChannelListList({
486
+        caseid: this.couponInfo.CaseId,
487
+        page: 1,
488
+        pagesize: 10000
489
+      })
490
+    },
491
+    sureAddItem () { // 确定添加指定商品
492
+      var bool = true
493
+      if (this.couponInfo.CouponType === 'goods') {
494
+        for (var n = 0; n < this.currentSelectArr.length; n++) {
495
+          if (this.couponInfo.Targets.length) {
496
+            bool = true
497
+            for (var a = 0; a < this.couponInfo.Targets.length; a++) {
498
+              if (this.currentSelectArr[n].GoodsId === this.couponInfo.Targets[a].TargetId) {
499
+                bool = false
500
+              }
501
+            }
502
+            if (bool) {
503
+              this.couponInfo.Targets.push({
504
+                TargetName: this.currentSelectArr[n].GoodsName,
505
+                TargetId: this.currentSelectArr[n].GoodsId,
506
+                TargetType: this.currentSelectArr[n].TypeId
507
+              })
508
+            }
509
+          } else {
510
+            this.couponInfo.Targets.push({
511
+              TargetName: this.currentSelectArr[n].GoodsName,
512
+              TargetId: this.currentSelectArr[n].GoodsId,
513
+              TargetType: this.currentSelectArr[n].TypeId
514
+            })
515
+          }
516
+        }
517
+      } else if (this.couponInfo.CouponType === 'course') {
518
+        for (var x = 0; x < this.currentSelectArr.length; x++) {
519
+          if (this.couponInfo.Targets.length) {
520
+            bool = true
521
+            for (var y = 0; y < this.couponInfo.Targets.length; y++) {
522
+              if (this.currentSelectArr[x].CourseId === this.couponInfo.Targets[y].TargetId) {
523
+                bool = false
524
+              }
525
+            }
526
+            if (bool) {
527
+              this.couponInfo.Targets.push({
528
+                TargetName: this.currentSelectArr[x].CourseName,
529
+                TargetId: this.currentSelectArr[x].CourseId,
530
+                TargetType: this.currentSelectArr[x].CourseType
531
+              })
532
+            }
533
+          } else {
534
+            this.couponInfo.Targets.push({
535
+              TargetName: this.currentSelectArr[x].CourseName,
536
+              TargetId: this.currentSelectArr[x].CourseId,
537
+              TargetType: this.currentSelectArr[x].CourseType
538
+            })
539
+          }
540
+        }
541
+      }
542
+      this.centerDialogVisible = false
543
+    },
544
+    handleGoodsChange (val) {
545
+      this.currentSelectArr = val
546
+    },
547
+    handleCourseChange (val) {
548
+      this.currentSelectArr = val
549
+    },
550
+    couponTypeChange () {
551
+      if (this.goodsList.length) {
552
+        this.goodsList = []
553
+      }
554
+      if (this.courseList.length) {
555
+        this.courseList = []
556
+      }
557
+      this.couponInfo.Targets = []
558
+    },
559
+    addGoods () { // 添加指定商品
560
+      if (this.couponInfo.CouponType === 'goods') {
561
+        this.GetGoodsList({
562
+          ...this.postData,
563
+          caseid: this.couponInfo.CaseId
564
+        }).then((res) => {
565
+          this.total = res.pagenum
566
+          this.centerDialogVisible = true
567
+        })
568
+      } else if (this.couponInfo.CouponType === 'course') {
569
+        this.GetCourseList({
570
+          ...this.postData,
571
+          caseid: this.couponInfo.CaseId
572
+        }).then((res) => {
573
+          this.total = res.pagenum
574
+          this.centerDialogVisible = true
575
+        })
576
+      }
577
+    },
578
+    submit () { // 保存
579
+      if (this.$route.query.id) {
580
+        this.editCoupon({
581
+          ...this.couponInfo,
582
+          IsAll: this.couponInfo.IsAll - 0,
583
+          TotalCount: this.couponInfo.TotalCount - 0,
584
+          ValidDays: this.couponInfo.ValidDays || 0
585
+        }).then((res) => {
586
+          this.$alert('操作成功', '提示', {
587
+            confirmButtonText: '确定',
588
+            callback: action => {
589
+              this.$router.push({ name: 'couponList' })
590
+            }
591
+          })
592
+        })
593
+      } else {
594
+        this.addCoupon({
595
+          ...this.couponInfo,
596
+          IsAll: this.couponInfo.IsAll - 0,
597
+          TotalCount: this.couponInfo.TotalCount - 0,
598
+          ValidDays: this.couponInfo.ValidDays || 0
599
+        }).then((res) => {
600
+          this.$alert('操作成功', '提示', {
601
+            confirmButtonText: '确定',
602
+            callback: action => {
603
+              this.$router.push({ name: 'couponList' })
604
+            }
605
+          })
606
+        })
607
+      }
608
+    },
609
+    cancel () { // 取消
610
+      this.$router.push({ name: 'couponList' })
611
+    },
612
+    deleteGoodsItem (index, row) { // 删除指定商品item
613
+      this.couponInfo.Targets.splice(index, 1)
614
+    },
615
+    handleAvatarSuccess (res, file) {
616
+      this.couponInfo.Images[0].CouponImageUrl = res.result.url
617
+    },
618
+    videoSuccess (res, file) {
619
+      this.videoOff = true
620
+      this.couponInfo.VideoUrl = res.result.url
621
+    },
622
+    handleCurrentChange (val) { // 跳转到分页
623
+      this.postData.page = val
624
+      if (this.couponInfo.CouponType === 'goods') {
625
+        this.GetGoodsList({
626
+          ...this.postData,
627
+          caseid: this.couponInfo.CaseId
628
+        }).then((res) => {
629
+          this.total = res.pagenum
630
+        })
631
+      } else if (this.couponInfo.CouponType === 'course') {
632
+        this.GetCourseList({
633
+          ...this.postData,
634
+          caseid: this.couponInfo.CaseId
635
+        }).then((res) => {
636
+          this.total = res.pagenum
637
+        })
638
+      }
639
+    },
33 640
   }
34 641
 }
35 642
 </script>
36 643
 
37 644
 <!-- Add "scoped" attribute to limit CSS to this component only -->
38 645
 <style lang="scss" scoped>
646
+.addLine {
647
+  > * {
648
+    margin-right: 10px;
649
+  }
650
+}
651
+.mainForm > ul > li > div > div > button {
652
+  margin-top: 0;
653
+}
39 654
 </style>

+ 250
- 23
src/pages/system/cardAndCouponManager/couponManager/index.vue 查看文件

@@ -3,13 +3,14 @@
3 3
     <div class="system-table-search">
4 4
       <div class="flex-h">
5 5
         <div class="flex-item flex-h">
6
-          <el-button size="mini" type="success" @click='addChannel'>新增饮品优惠券</el-button>
7
-          <el-button size="mini" type="success" @click='addChannel'>新增课程优惠券</el-button>
6
+          <el-button size="mini" type="success" @click="addCoupon('')">新增优惠券</el-button>
7
+          <!-- <el-button size="mini" type="success" @click="addCoupon('drink')">新增饮品优惠券</el-button>
8
+          <el-button size="mini" type="success" @click="addCoupon('course')">新增课程优惠券</el-button> -->
8 9
         </div>
9 10
         <ul>
10 11
           <li>
11 12
             <!-- <span>选择案场:</span> -->
12
-            <el-select v-model="CaseId" placeholder="请选择">
13
+            <el-select v-model="CaseId" placeholder="请选择案场">
13 14
               <el-option
14 15
                 v-for="item in cases"
15 16
                 :key="item.CaseId"
@@ -27,18 +28,57 @@
27 28
     </div>
28 29
     <div class="system-table-box">
29 30
       <el-table
30
-        :data="currentList"
31
+        :data="couponList.list"
31 32
         stripe
32 33
         style="width: 100%">
33 34
         <el-table-column
34
-          prop="CaseName"
35
-          label="案场">
35
+          prop="CouponName"
36
+          label="券名称">
36 37
         </el-table-column>
37 38
         <el-table-column
38
-          prop="ChannelName"
39
-          label="渠道名称">
39
+          prop="CouponType"
40
+          label="券类型">
41
+          <template slot-scope="scope">{{scope.row.CouponType === 'goods' ? '商品券' : '课程券'}}</template>
40 42
         </el-table-column>
41
-        <el-table-column label="操作">
43
+        <el-table-column
44
+          prop="Price"
45
+          label="券价格">
46
+        </el-table-column>
47
+        <el-table-column
48
+          prop="StartDate"
49
+          label="有效期"
50
+          width="150">
51
+          <template slot-scope="scope">
52
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.StartDate)}}</span>
53
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">至</span>
54
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.EndDate)}}</span>
55
+          </template>
56
+        </el-table-column>
57
+        <el-table-column
58
+          prop="SendType"
59
+          label="发放类型">
60
+          <template slot-scope="scope">{{scope.row.SendType === 'channel' ? '渠道' : scope.row.SendType === 'case' ? '案场' : '系统'}}</template>
61
+        </el-table-column>
62
+        <el-table-column
63
+          prop="TotalCount"
64
+          label="总数量">
65
+        </el-table-column>
66
+        <el-table-column
67
+          prop="SentCount"
68
+          label="已发">
69
+        </el-table-column>
70
+        <el-table-column
71
+          prop="UsedCount"
72
+          label="实际使用">
73
+        </el-table-column>
74
+        <el-table-column
75
+          prop="Status"
76
+          label="状态">
77
+          <template slot-scope="scope">
78
+            <span>{{scope.row.Status === 1 ? '正常' : '已过期'}}</span>
79
+          </template>
80
+        </el-table-column>
81
+        <el-table-column label="操作" fixed='right' width="350">
42 82
           <template slot-scope="scope">
43 83
             <el-button
44 84
               size="mini"
@@ -47,7 +87,11 @@
47 87
             <el-button
48 88
               size="mini"
49 89
               type="danger"
50
-              @click="handleDelete(scope.$index, scope.row)">删除</el-button>
90
+              @click="sendCoupon(scope.$index, scope.row)">赠送客户</el-button>
91
+            <el-button
92
+              size="mini"
93
+              type="success"
94
+              @click="handleDelete(scope.$index, scope.row)">点击复制链接</el-button>
51 95
           </template>
52 96
         </el-table-column>
53 97
       </el-table>
@@ -59,23 +103,133 @@
59 103
       layout="prev, pager, next, jumper"
60 104
       :total="total">
61 105
     </el-pagination>
106
+    <el-dialog
107
+      title="选择赠送客户"
108
+      :visible.sync="centerDialogVisible"
109
+      width="800px"
110
+      center>
111
+      <div>
112
+        <ul class="dialogSearchList flex-h" style="margin-bottom:10px;">
113
+          <li class="flex-item">
114
+            <el-input
115
+              placeholder="请输入用户名"
116
+              v-model="dialogPostData.username"
117
+              clearable>
118
+            </el-input>
119
+          </li>
120
+          <li class="flex-item">
121
+            <el-input
122
+              placeholder="请输入手机号"
123
+              v-model="dialogPostData.phone"
124
+              clearable>
125
+            </el-input>
126
+          </li>
127
+          <li class="flex-item">
128
+            <el-input
129
+              placeholder="请输入推荐人"
130
+              v-model="dialogPostData.recommendname"
131
+              clearable>
132
+            </el-input>
133
+          </li>
134
+          <li>
135
+            <el-button type="primary" @click="dialogSearch">搜索</el-button>
136
+          </li>
137
+        </ul>
138
+        <ul class="dialogSearchList flex-h">
139
+          <li class="flex-item">
140
+            <el-date-picker
141
+              v-model="dialogPostData.begindate"
142
+              type="date"
143
+              placeholder="选择起始日期">
144
+            </el-date-picker>
145
+            <el-date-picker
146
+              v-model="dialogPostData.enddate"
147
+              type="date"
148
+              placeholder="选择截止日期">
149
+            </el-date-picker>
150
+          </li>
151
+        </ul>
152
+      </div>
153
+      <div>
154
+        <el-table
155
+          ref="multipleTable"
156
+          :data="customers.list"
157
+          tooltip-effect="dark"
158
+          style="width: 100%"
159
+          @selection-change="handleSelectionChange">
160
+          <el-table-column
161
+            type="selection">
162
+          </el-table-column>
163
+          <el-table-column
164
+            prop="Name"
165
+            label="姓名">
166
+          </el-table-column>
167
+          <el-table-column
168
+            prop="CustomerName"
169
+            label="微信昵称">
170
+          </el-table-column>
171
+          <el-table-column
172
+            prop="Phone"
173
+            label="手机号">
174
+          </el-table-column>
175
+          <el-table-column
176
+            prop="CreateDate"
177
+            label="创建时间">
178
+            <template slot-scope="scope">
179
+              <span>{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd')}}</span>
180
+            </template>
181
+          </el-table-column>
182
+          <el-table-column
183
+            prop="RecommendName"
184
+            label="推荐人">
185
+          </el-table-column>
186
+        </el-table>
187
+      </div>
188
+      <div>
189
+        <el-pagination
190
+          @current-change="handleCurrentChangeDialog"
191
+          :current-page.sync="dialogPostData.page"
192
+          :page-size="dialogPostData.pagesize"
193
+          layout="prev, pager, next, jumper"
194
+          :total="customers.pagenum">
195
+        </el-pagination>
196
+      </div>
197
+      <span slot="footer" class="dialog-footer">
198
+        <el-button @click="centerDialogVisible = false">取 消</el-button>
199
+        <el-button type="primary" @click="ForCustomer">确 定</el-button>
200
+      </span>
201
+    </el-dialog>
62 202
   </div>
63 203
 </template>
64 204
 
65 205
 <script>
66
-import { mapState } from 'vuex'
206
+import { mapState, createNamespacedHelpers } from 'vuex'
207
+const { mapState: mapCouponState, mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
208
+const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
67 209
 
68 210
 export default {
69 211
   name: '',
70 212
   data () {
71 213
     return {
214
+      dialogTotal: 0,
215
+      dialogPostData: {
216
+        username: '',
217
+        phone: '',
218
+        recommendname: '',
219
+        begindate: '',
220
+        enddate: '',
221
+        page: 1, // 当前页码
222
+        pagesize: 10, // 请求数据量
223
+      },
224
+      centerDialogVisible: false,
72 225
       total: 0,
73 226
       postData: { // 表格搜索条件
74 227
         caseid: '', // 案场id
75 228
         page: 1, // 当前页码
76 229
         pagesize: 10, // 请求数据量
77 230
       },
78
-      currentList: []
231
+      currentInfo: {},
232
+      selUsers: '',
79 233
     }
80 234
   },
81 235
   mounted () {
@@ -84,6 +238,12 @@ export default {
84 238
     })
85 239
   },
86 240
   computed: {
241
+    ...mapCouponState({
242
+      couponList: x => x.couponList,
243
+    }),
244
+    ...mapCustomerState({
245
+      customers: x => x.customers,
246
+    }),
87 247
     ...mapState({
88 248
       cases: x => x.app.cases.list,
89 249
       defaultCaseId: x => x.app.cases.default
@@ -98,26 +258,53 @@ export default {
98 258
     }
99 259
   },
100 260
   methods: {
261
+    ...mapCouponActions([
262
+      'GetCouponList',
263
+      'GiveCoupon',
264
+    ]),
265
+    ...mapCustomerActions([
266
+      'GetCustomerList',
267
+      'SetCustomerListNull',
268
+    ]),
269
+    dialogSearch () { // 赠送客户搜索
270
+      this.GetCustomerList(this.dialogPostData)
271
+      // 1
272
+    },
273
+    handleCurrentChangeDialog (val) {
274
+      // 1
275
+    },
276
+    handleSelectionChange (val) {
277
+      this.selUsers = val.map(x => x.CustomerId).join(',')
278
+      // 1
279
+    },
280
+    sendCoupon (index, row) { // 赠送优惠券
281
+      this.currentInfo = row
282
+      this.selUsers = ''
283
+      this.SetCustomerListNull()
284
+      this.centerDialogVisible = true
285
+    },
101 286
     search () { // 搜索
102 287
       this.postData.page = 1
103
-      this.currentList = []
288
+      if (this.couponList.length) {
289
+        this.couponList = []
290
+      }
104 291
       this.getList()
105 292
     },
106 293
     getList () { // 获取列表
107
-      this.$ajax(this.$api.channelManager.getChannelList.url, {
108
-        method: this.$api.channelManager.getChannelList.method,
109
-        queryData: { ...this.postData, caseid: this.CaseId }
110
-      }).then(res => {
111
-        this.currentList = res.list
112
-        this.postData.page = res.page
294
+      this.GetCouponList({
295
+        ...this.postData,
296
+        caseid: this.CaseId || this.defaultCaseId
297
+      }).then((res) => {
113 298
         this.total = res.pagenum
299
+        // console.log(JSON.stringify(res))
114 300
       })
115 301
     },
116 302
     handleCurrentChange (val) { // 跳转到分页
303
+      this.postData.page = val
117 304
       this.getList()
118 305
     },
119 306
     handleEdit (index, row) { // 编辑
120
-      this.$router.push({ name: 'editChannel', query: { id: row.ChannelId } })
307
+      this.$router.push({ name: 'editCoupon', query: { type: row.CouponType, id: row.CouponId, caseid: row.CaseId } })
121 308
     },
122 309
     handleDelete (index, row) { // 删除
123 310
       let name = '确认删除渠道“' + row.ChannelName + '”?'
@@ -143,14 +330,54 @@ export default {
143 330
         })
144 331
       })
145 332
     },
146
-    addChannel () {
147
-      this.$router.push({ name: 'addChannel' })
333
+    addCoupon (val) {
334
+      this.$router.push({ name: 'editCoupon', query: { type: val } })
335
+    },
336
+    ForCustomer () {
337
+      if (this.selUsers === '') {
338
+        this.$message({
339
+          type: 'error',
340
+          message: '请先选择客户!'
341
+        })
342
+        return false
343
+      }
344
+      if (!this.currentInfo || this.currentInfo.CouponId === '') {
345
+        this.$message({
346
+          type: 'error',
347
+          message: '请先选择需要赠送的优惠券!'
348
+        })
349
+        return false
350
+      }
351
+      this.GiveCoupon({
352
+        id: this.currentInfo.CouponId,
353
+        users: this.selUsers,
354
+      }).then(res => {
355
+        this.$message({
356
+          type: 'success',
357
+          message: '赠送成功!'
358
+        })
359
+        this.centerDialogVisible = false
360
+        this.getList()
361
+      })
148 362
     }
149 363
   }
150 364
 }
151 365
 </script>
152 366
 
153
-<!-- Add "scoped" attribute to limit CSS to this component only -->
367
+<!-- Add "scoped" attrib0 0ute to limit CSS to this component only -->
154 368
 <style lang="scss" scoped>
155 369
 @import "page.scss";
370
+.dialogSearchList {
371
+  align-items: center;
372
+  > li {
373
+    font-size: 0;
374
+    margin-left: 10px;
375
+    &:first-child {
376
+      margin-left: 0;
377
+    }
378
+    > *:nth-child(2) {
379
+      margin-left: 10px;
380
+    }
381
+  }
382
+}
156 383
 </style>

+ 1
- 0
src/pages/system/cardAndCouponManager/couponManager/page.scss 查看文件

@@ -23,5 +23,6 @@
23 23
 
24 24
 
25 25
 
26
+
26 27
 
27 28
 

+ 143
- 0
src/pages/system/cardAndCouponManager/givingRecords.vue 查看文件

@@ -0,0 +1,143 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h"></div>
6
+        <ul>
7
+          <li>
8
+            <el-input
9
+              placeholder="请输入推荐人"
10
+              v-model="postData.referrer"
11
+              clearable>
12
+            </el-input>
13
+          </li>
14
+          <li>
15
+            <el-date-picker
16
+              v-model="postData.startDate"
17
+              type="date"
18
+              placeholder="选择起始日期">
19
+            </el-date-picker>
20
+            <span>至</span>
21
+            <el-date-picker
22
+              v-model="postData.endDate"
23
+              type="date"
24
+              placeholder="选择截止日期">
25
+            </el-date-picker>
26
+          </li>
27
+        </ul>
28
+        <el-button
29
+          size="mini"
30
+          type="primary" @click="search">搜索</el-button>
31
+      </div>
32
+      <div class="moreFilter"></div>
33
+    </div>
34
+    <div class="system-table-box">
35
+      <el-table
36
+        :data="currentList"
37
+        stripe
38
+        style="width: 100%">
39
+        <el-table-column
40
+          prop="xxx"
41
+          label="卡券名称">
42
+        </el-table-column>
43
+        <el-table-column
44
+          prop="xxx"
45
+          label="姓名">
46
+        </el-table-column>
47
+        <el-table-column
48
+          prop="xxx"
49
+          label="微信昵称">
50
+        </el-table-column>
51
+        <el-table-column
52
+          prop="xxx"
53
+          label="手机号">
54
+        </el-table-column>
55
+        <el-table-column
56
+          prop="xxx"
57
+          label="推荐人">
58
+        </el-table-column>
59
+        <el-table-column
60
+          prop="xxx"
61
+          label="赠送时间">
62
+        </el-table-column>
63
+        <el-table-column
64
+          prop="xxx"
65
+          label="操作人">
66
+        </el-table-column>
67
+      </el-table>
68
+    </div>
69
+    <el-pagination
70
+      @current-change="handleCurrentChange"
71
+      :current-page.sync="postData.page"
72
+      :page-size="postData.pagesize"
73
+      layout="prev, pager, next, jumper"
74
+      :total="total">
75
+    </el-pagination>
76
+  </div>
77
+</template>
78
+
79
+<script>
80
+import { mapState } from 'vuex'
81
+
82
+export default {
83
+  name: '',
84
+  data () {
85
+    return {
86
+      customerList: [],
87
+      centerDialogVisible: false,
88
+      total: 0,
89
+      postData: { // 表格搜索条件
90
+        caseid: '', // 案场id
91
+        page: 1, // 当前页码
92
+        pagesize: 10, // 请求数据量
93
+      },
94
+      currentList: [{
95
+        xxx: 'xxx'
96
+      }]
97
+    }
98
+  },
99
+  mounted () {
100
+    this.$nextTick(function () {
101
+      // this.getList()
102
+    })
103
+  },
104
+  computed: {
105
+    ...mapState({
106
+      cases: x => x.app.cases.list,
107
+      defaultCaseId: x => x.app.cases.default
108
+    }),
109
+    CaseId: {
110
+      get () {
111
+        return this.postData.caseid || this.defaultCaseId
112
+      },
113
+      set (val) {
114
+        this.postData.caseid = val
115
+      }
116
+    }
117
+  },
118
+  methods: {
119
+    search () { // 搜索
120
+      this.postData.page = 1
121
+      this.currentList = []
122
+      this.getList()
123
+    },
124
+    getList () { // 获取列表
125
+      // this.$ajax(this.$api.channelManager.getChannelList.url, {
126
+      //   method: this.$api.channelManager.getChannelList.method,
127
+      //   queryData: { ...this.postData, caseid: this.CaseId }
128
+      // }).then(res => {
129
+      //   this.currentList = res.list
130
+      //   this.postData.page = res.page
131
+      //   this.total = res.pagenum
132
+      // })
133
+    },
134
+    handleCurrentChange (val) { // 跳转到分页
135
+      this.getList()
136
+    },
137
+  }
138
+}
139
+</script>
140
+
141
+<!-- Add "scoped" attribute to limit CSS to this component only -->
142
+<style lang="scss" scoped>
143
+</style>

+ 5
- 0
src/pages/system/cardAndCouponManager/vipManager/index.vue 查看文件

@@ -6,6 +6,11 @@
6 6
         <ul>
7 7
           <li>
8 8
             <el-select v-model="CaseId" placeholder="请选择">
9
+              <el-option
10
+                key=""
11
+                label="所有案场"
12
+                value="">
13
+              </el-option>
9 14
               <el-option
10 15
                 v-for="item in cases"
11 16
                 :key="item.CaseId"

+ 16
- 6
src/pages/system/caseManager/caseAreaManager/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"
@@ -52,8 +57,10 @@
52 57
           </template>
53 58
         </el-table-column>
54 59
         <el-table-column
55
-          prop="CaseName"
56
-          label="案场">
60
+          label="案场" >
61
+          <template slot-scope="scope">
62
+            <span>{{getCaseName(scope.row.CaseId)}}</span>
63
+          </template>
57 64
         </el-table-column>
58 65
         <el-table-column label="操作">
59 66
           <template slot-scope="scope">
@@ -112,7 +119,7 @@ export default {
112 119
       set (val) {
113 120
         this.postData.caseid = val
114 121
       }
115
-    }
122
+    },
116 123
   },
117 124
   methods: {
118 125
     search () { // 搜索
@@ -120,14 +127,17 @@ export default {
120 127
       this.currentList = []
121 128
       this.getList()
122 129
     },
130
+    getCaseName (caseid) {
131
+      return (this.cases.filter(x => x.CaseId === caseid)[0] || {}).CaseName
132
+    },
123 133
     getList () { // 获取列表
124 134
       this.$ajax(this.$api.caseManager.getCaseAreaList.url, {
125 135
         method: this.$api.caseManager.getCaseAreaList.method,
126 136
         queryData: { ...this.postData, caseid: this.CaseId }
127 137
       }).then(res => {
128
-        for (var n = 0; n < res.list.length; n++) {
129
-          res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
130
-        }
138
+        // for (var n = 0; n < res.list.length; n++) {
139
+        //   res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
140
+        // }
131 141
         this.currentList = res.list
132 142
         this.postData.page = res.page
133 143
         this.total = res.pagenum

+ 18
- 4
src/pages/system/caseManager/caseInfo/addCase/index.vue 查看文件

@@ -16,7 +16,7 @@
16 16
           </div>
17 17
         </li>
18 18
         <li class="flex-h">
19
-          <span>案场地址:</span>
19
+          <span>案场地址:<em>*</em></span>
20 20
           <div class="flex-item">
21 21
             <div>
22 22
               <el-input
@@ -57,7 +57,7 @@
57 57
           </div>
58 58
         </li>
59 59
         <li class="flex-h">
60
-          <span>案场头像:</span>
60
+          <span>案场头像:<em>*</em></span>
61 61
           <div class="flex-item">
62 62
             <div>
63 63
               <!-- <a class="formImg">
@@ -176,14 +176,28 @@ export default {
176 176
       if (this.postData.CaseName === '') {
177 177
         this.$message({
178 178
           type: 'error',
179
-          message: '案场名称不能为空'
179
+          message: '请填写案场名称!'
180
+        })
181
+        return false
182
+      }
183
+      if (this.postData.CaseAddress === '') {
184
+        this.$message({
185
+          type: 'error',
186
+          message: '请填写案场地址!'
187
+        })
188
+        return false
189
+      }
190
+      if (this.postData.CaseIcon === '') {
191
+        this.$message({
192
+          type: 'error',
193
+          message: '请上传案场图片!'
180 194
         })
181 195
         return false
182 196
       }
183 197
       if (this.postData.Coordinate === '') {
184 198
         this.$message({
185 199
           type: 'error',
186
-          message: '案场经纬度不能为空'
200
+          message: '案场在地图上的位置不明确,请在地图上抓取地址获取经纬度!'
187 201
         })
188 202
         return false
189 203
       }

+ 18
- 4
src/pages/system/caseManager/caseInfo/editCase/index.vue 查看文件

@@ -15,7 +15,7 @@
15 15
           </div>
16 16
         </li>
17 17
         <li class="flex-h">
18
-          <span>案场地址:</span>
18
+          <span>案场地址:<em>*</em></span>
19 19
           <div class="flex-item">
20 20
             <div>
21 21
               <el-input
@@ -53,7 +53,7 @@
53 53
           </div>
54 54
         </li>
55 55
         <li class="flex-h">
56
-          <span>案场头像:</span>
56
+          <span>案场头像:<em>*</em></span>
57 57
           <div class="flex-item">
58 58
             <div>
59 59
               <!-- <a class="formImg">
@@ -183,14 +183,28 @@ export default {
183 183
       if (this.postData.CaseName === '') {
184 184
         this.$message({
185 185
           type: 'error',
186
-          message: '案场名称不能为空'
186
+          message: '请填写案场名称!'
187
+        })
188
+        return false
189
+      }
190
+      if (this.postData.CaseAddress === '') {
191
+        this.$message({
192
+          type: 'error',
193
+          message: '请填写案场地址!'
194
+        })
195
+        return false
196
+      }
197
+      if (this.postData.CaseIcon === '') {
198
+        this.$message({
199
+          type: 'error',
200
+          message: '请上传案场图片!'
187 201
         })
188 202
         return false
189 203
       }
190 204
       if (this.postData.Coordinate === '') {
191 205
         this.$message({
192 206
           type: 'error',
193
-          message: '案场经纬度不能为空'
207
+          message: '案场在地图上的位置不明确,请在地图上抓取地址获取经纬度!'
194 208
         })
195 209
         return false
196 210
       }

+ 4
- 0
src/pages/system/caseManager/caseInfo/index.vue 查看文件

@@ -48,6 +48,7 @@
48 48
 
49 49
 <script>
50 50
 import tableSearch from '@/components/tableSearch/index'
51
+import { mapActions } from 'vuex'
51 52
 
52 53
 export default {
53 54
   name: '',
@@ -71,6 +72,9 @@ export default {
71 72
     })
72 73
   },
73 74
   methods: {
75
+    ...mapActions([
76
+      'updateSystemInfo',
77
+    ]),
74 78
     pplConcerned (index, row) { // 相关人员
75 79
       this.$router.push({name: 'pplConcerned', query: {id: row.CaseId}})
76 80
     },

+ 1
- 0
src/pages/system/caseManager/caseTableManager/add.vue 查看文件

@@ -9,6 +9,7 @@
9 9
               <el-input
10 10
                 placeholder="请输入名称"
11 11
                 v-model="postData.TableNo"
12
+                maxlength="6"
12 13
                 clearable>
13 14
               </el-input>
14 15
             </div>

+ 1
- 0
src/pages/system/caseManager/caseTableManager/edit.vue 查看文件

@@ -9,6 +9,7 @@
9 9
               <el-input
10 10
                 placeholder="请输入名称"
11 11
                 v-model="postData.TableNo"
12
+                maxlength="6"
12 13
                 clearable>
13 14
               </el-input>
14 15
             </div>

+ 5
- 0
src/pages/system/caseManager/caseTableManager/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"

+ 5
- 0
src/pages/system/caseManager/keyManager/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"

+ 5
- 0
src/pages/system/caseManager/signinManager/index.vue 查看文件

@@ -16,6 +16,11 @@
16 16
         <!-- 案场选择 -->
17 17
       <span class="case-title">案场:</span>
18 18
        <el-select v-model="valueCase" placeholder="请选择" @change="handelSignin">
19
+            <el-option
20
+              key=""
21
+              label="所有案场"
22
+              value="">
23
+            </el-option>
19 24
             <el-option
20 25
               v-for="item in optionsCase"
21 26
               :key="item.valueCase"

+ 6
- 1
src/pages/system/caseManager/tagManager/index.vue 查看文件

@@ -8,7 +8,12 @@
8 8
         <ul>
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11
-            <el-select v-model="CaseId" placeholder="请选择">
11
+            <el-select v-model="CaseId" placeholder="请选择案场">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"

+ 5
- 0
src/pages/system/channelManager/channelList/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"

+ 34
- 23
src/pages/system/cmsManager/bannerManager/add.vue 查看文件

@@ -77,7 +77,7 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:</span>
79 79
           <div class="flex-item">
80
-            <el-upload
80
+            <!-- <el-upload
81 81
               :action="$api.file.image.url"
82 82
               :limit='limit'
83 83
               list-type="picture-card"
@@ -89,7 +89,15 @@
89 89
             </el-upload>
90 90
             <el-dialog :visible.sync="dialogVisible">
91 91
               <img width="100%" :src="imgs" alt="">
92
-            </el-dialog>
92
+            </el-dialog> -->
93
+            <el-upload
94
+              class="avatar-uploader"
95
+              :action='$api.file.image.url'
96
+              :show-file-list="false"
97
+              :on-success="handleAvatarSuccess">
98
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
99
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
100
+            </el-upload>
93 101
           </div>
94 102
         </li>
95 103
         <!-- <li class="flex-h">
@@ -192,13 +200,13 @@ export default {
192 200
       }
193 201
       this.postData.OrgId = this.OrgId
194 202
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
195
-      this.postData.ImageUrl = ''
196
-      for (let i = 0; i < this.imgsArr.length; i++) {
197
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
198
-      }
199
-      if (this.postData.ImageUrl) {
200
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
201
-      }
203
+      // this.postData.ImageUrl = ''
204
+      // for (let i = 0; i < this.imgsArr.length; i++) {
205
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
206
+      // }
207
+      // if (this.postData.ImageUrl) {
208
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
209
+      // }
202 210
       this.$ajax(this.$api.cms.addImage.url, {
203 211
         method: this.$api.cms.addImage.method,
204 212
         data: this.postData
@@ -218,21 +226,24 @@ export default {
218 226
     cancel () {
219 227
       this.$router.go(-1)
220 228
     },
221
-    handlePictureCardPreview (res, file, fileList) {
222
-      this.imgs = res.result.url
223
-      this.dialogVisible = false
224
-      this.imgsArr = fileList
225
-    },
226
-    handleRemove (file, fileList) {
227
-      this.imgsArr = fileList
229
+    // handlePictureCardPreview (res, file, fileList) {
230
+    //   this.imgs = res.result.url
231
+    //   this.dialogVisible = false
232
+    //   this.imgsArr = fileList
233
+    // },
234
+    // handleRemove (file, fileList) {
235
+    //   this.imgsArr = fileList
236
+    // },
237
+    // exceed () {
238
+    //   this.$message({
239
+    //     message: '超过可传的图片上限',
240
+    //     type: 'info',
241
+    //     duration: 1000
242
+    //   })
243
+    // }
244
+    handleAvatarSuccess (res, file) {
245
+      this.postData.ImageUrl = res.result.url
228 246
     },
229
-    exceed () {
230
-      this.$message({
231
-        message: '超过可传的图片上限',
232
-        type: 'info',
233
-        duration: 1000
234
-      })
235
-    }
236 247
   }
237 248
 }
238 249
 </script>

+ 45
- 34
src/pages/system/cmsManager/bannerManager/edit.vue 查看文件

@@ -77,7 +77,7 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:</span>
79 79
           <div class="flex-item">
80
-            <el-upload
80
+            <!-- <el-upload
81 81
               :action="$api.file.image.url"
82 82
               :limit='limit'
83 83
               list-type="picture-card"
@@ -89,7 +89,15 @@
89 89
             </el-upload>
90 90
             <el-dialog :visible.sync="dialogVisible">
91 91
               <img width="100%" :src="imgs" alt="">
92
-            </el-dialog>
92
+            </el-dialog> -->
93
+            <el-upload
94
+              class="avatar-uploader"
95
+              :action='$api.file.image.url'
96
+              :show-file-list="false"
97
+              :on-success="handleAvatarSuccess">
98
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
99
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
100
+            </el-upload>
93 101
           </div>
94 102
         </li>
95 103
         <!-- <li class="flex-h">
@@ -187,13 +195,13 @@ export default {
187 195
       this.postData.OrgId = this.OrgId
188 196
       this.postData.CaseId = this.CaseId
189 197
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
190
-      this.postData.ImageUrl = ''
191
-      for (let i = 0; i < this.imgsArr.length; i++) {
192
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
193
-      }
194
-      if (this.postData.ImageUrl) {
195
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
196
-      }
198
+      // this.postData.ImageUrl = ''
199
+      // for (let i = 0; i < this.imgsArr.length; i++) {
200
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
201
+      // }
202
+      // if (this.postData.ImageUrl) {
203
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
204
+      // }
197 205
       this.$ajax(this.$api.cms.editImage.url, {
198 206
         method: this.$api.cms.editImage.method,
199 207
         data: this.postData,
@@ -226,37 +234,40 @@ export default {
226 234
         console.log(res)
227 235
         res.Status = res.Status + ''
228 236
         res.ForwardType === 'url' ? res.ForwardType = '1' : res.ForwardType = '0'
229
-        let imgsArr = []
230
-        let item = {
231
-          url: res.ImageUrl,
232
-          response: {
233
-            result: {
234
-              url: res.ImageUrl
235
-            }
236
-          }
237
-        }
238
-        imgsArr.push(item)
239
-        this.imgsArr = imgsArr
237
+        // let imgsArr = []
238
+        // let item = {
239
+        //   url: res.ImageUrl,
240
+        //   response: {
241
+        //     result: {
242
+        //       url: res.ImageUrl
243
+        //     }
244
+        //   }
245
+        // }
246
+        // imgsArr.push(item)
247
+        // this.imgsArr = imgsArr
240 248
         this.postData = res
241 249
       }).catch(msg => {
242 250
 
243 251
       })
244 252
     },
245
-    handlePictureCardPreview (res, file, fileList) {
246
-      this.imgs = res.result.url
247
-      this.dialogVisible = false
248
-      this.imgsArr = fileList
249
-    },
250
-    handleRemove (file, fileList) {
251
-      this.imgsArr = fileList
253
+    // handlePictureCardPreview (res, file, fileList) {
254
+    //   this.imgs = res.result.url
255
+    //   this.dialogVisible = false
256
+    //   this.imgsArr = fileList
257
+    // },
258
+    // handleRemove (file, fileList) {
259
+    //   this.imgsArr = fileList
260
+    // },
261
+    // exceed () {
262
+    //   this.$message({
263
+    //     message: '超过可传的图片上限',
264
+    //     type: 'info',
265
+    //     duration: 1000
266
+    //   })
267
+    // }
268
+    handleAvatarSuccess (res, file) {
269
+      this.postData.ImageUrl = res.result.url
252 270
     },
253
-    exceed () {
254
-      this.$message({
255
-        message: '超过可传的图片上限',
256
-        type: 'info',
257
-        duration: 1000
258
-      })
259
-    }
260 271
   }
261 272
 }
262 273
 </script>

+ 93
- 60
src/pages/system/cmsManager/majorProjects/edit.vue 查看文件

@@ -44,7 +44,7 @@
44 44
         <li class="flex-h">
45 45
           <span>图片:</span>
46 46
           <div class="flex-item">
47
-            <el-upload
47
+            <!-- <el-upload
48 48
               :action="$api.file.image.url"
49 49
               list-type="picture-card"
50 50
               :limit='limit'
@@ -53,13 +53,22 @@
53 53
               :on-remove="handleRemove"
54 54
               :on-exceed="exceed">
55 55
               <i class="el-icon-plus"></i>
56
+            </el-upload> -->
57
+            <!-- 单选 -->
58
+            <el-upload
59
+              class="avatar-uploader"
60
+              :action='$api.file.image.url'
61
+              :show-file-list="false"
62
+              :on-success="handleImgSuccess">
63
+              <img v-if="imgShow" :src="imgShow" class="avatar">
64
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
56 65
             </el-upload>
57 66
           </div>
58 67
         </li>
59 68
         <li class="flex-h">
60 69
           <span>详细图片:</span>
61 70
           <div class="flex-item">
62
-            <el-upload
71
+            <!-- <el-upload
63 72
               :action='$api.file.image.url'
64 73
               list-type="picture-card"
65 74
               :limit='limit'
@@ -68,6 +77,15 @@
68 77
               :on-remove="handleRemoveDetail"
69 78
               :on-exceed="exceed">
70 79
               <i class="el-icon-plus"></i>
80
+            </el-upload> -->
81
+            <!-- 单选 -->
82
+            <el-upload
83
+              class="avatar-uploader"
84
+              :action='$api.file.image.url'
85
+              :show-file-list="false"
86
+              :on-success="handleDetailImgSuccess">
87
+              <img v-if="detailImgShow" :src="detailImgShow" class="avatar">
88
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
71 89
             </el-upload>
72 90
           </div>
73 91
         </li>
@@ -200,8 +218,10 @@ export default {
200 218
     return {
201 219
       id: '',
202 220
       limit: 1,
203
-      imgs: null,
204
-      detailimgs: null,
221
+      // imgs: null,
222
+      // detailimgs: null,
223
+      img: '',
224
+      detailimg: '',
205 225
       selCourseVisible: false,
206 226
       selCourseList: [],
207 227
     }
@@ -228,40 +248,46 @@ export default {
228 248
         this.getCourse()
229 249
       }
230 250
     },
231
-    imgsArr: {
232
-      get () {
233
-        return this.imgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover').map(x => {
234
-          return {
235
-            url: x.CaseImageUrl,
236
-            response: {
237
-              result: {
238
-                url: x.CaseImageUrl
239
-              }
240
-            }
241
-          }
242
-        })
243
-      },
244
-      set (val) {
245
-        this.imgs = val
246
-      }
251
+    imgShow () {
252
+      return this.img || ((this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover')[0] || {}).CaseImageUrl
247 253
     },
248
-    detailimgsArr: {
249
-      get () {
250
-        return this.detailimgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail').map(x => {
251
-          return {
252
-            url: x.CaseImageUrl,
253
-            response: {
254
-              result: {
255
-                url: x.CaseImageUrl
256
-              }
257
-            }
258
-          }
259
-        })
260
-      },
261
-      set (val) {
262
-        this.detailimgs = val
263
-      }
254
+    detailImgShow () {
255
+      return this.detailimg || ((this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail')[0] || {}).CaseImageUrl
264 256
     },
257
+    // imgsArr: {
258
+    //   get () {
259
+    //     return this.imgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover').map(x => {
260
+    //       return {
261
+    //         url: x.CaseImageUrl,
262
+    //         response: {
263
+    //           result: {
264
+    //             url: x.CaseImageUrl
265
+    //           }
266
+    //         }
267
+    //       }
268
+    //     })
269
+    //   },
270
+    //   set (val) {
271
+    //     this.imgs = val
272
+    //   }
273
+    // },
274
+    // detailimgsArr: {
275
+    //   get () {
276
+    //     return this.detailimgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail').map(x => {
277
+    //       return {
278
+    //         url: x.CaseImageUrl,
279
+    //         response: {
280
+    //           result: {
281
+    //             url: x.CaseImageUrl
282
+    //           }
283
+    //         }
284
+    //       }
285
+    //     })
286
+    //   },
287
+    //   set (val) {
288
+    //     this.detailimgs = val
289
+    //   }
290
+    // },
265 291
     coursesList () {
266 292
       return (this.courses.list || []).map(x => {
267 293
         return {
@@ -284,16 +310,17 @@ export default {
284 310
       'GetCourseList',
285 311
     ]),
286 312
     submit () {
287
-      const imgs = this.imgsArr.map(x => x.response.result.url).join(',')
288
-      const detailimgs = this.detailimgsArr.map(x => x.response.result.url).join(',')
313
+      // const imgs = this.imgsArr.map(x => x.response.result.url).join(',')
314
+      // const detailimgs = this.detailimgsArr.map(x => x.response.result.url).join(',')
315
+
289 316
       const courseids = (this.detail.Courses || []).map(x => x.CourseId).join(',')
290 317
       if (this.id === '') {
291 318
         this.detail.OrgId = this.OrgId
292
-        this.AddCaseInfo({...this.detail, OrgId: this.OrgId, imgs, detailimgs, courseids}).then(res => {
319
+        this.AddCaseInfo({...this.detail, OrgId: this.OrgId, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
293 320
           this.afterSave()
294 321
         })
295 322
       } else {
296
-        this.AddCaseInfo({...this.detail, imgs, detailimgs, courseids}).then(res => {
323
+        this.AddCaseInfo({...this.detail, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
297 324
           this.afterSave()
298 325
         })
299 326
       }
@@ -311,18 +338,18 @@ export default {
311 338
     cancel () {
312 339
       this.$router.go(-1)
313 340
     },
314
-    handlePictureCardPreview (res, file, fileList) {
315
-      this.imgsArr = fileList
316
-    },
317
-    handleRemove (file, fileList) {
318
-      this.imgsArr = fileList
319
-    },
320
-    handlePictureCardPreviewDetail (res, file, fileList) {
321
-      this.detailimgsArr = fileList
322
-    },
323
-    handleRemoveDetail (file, fileList) {
324
-      this.detailimgsArr = fileList
325
-    },
341
+    // handlePictureCardPreview (res, file, fileList) {
342
+    //   this.imgsArr = fileList
343
+    // },
344
+    // handleRemove (file, fileList) {
345
+    //   this.imgsArr = fileList
346
+    // },
347
+    // handlePictureCardPreviewDetail (res, file, fileList) {
348
+    //   this.detailimgsArr = fileList
349
+    // },
350
+    // handleRemoveDetail (file, fileList) {
351
+    //   this.detailimgsArr = fileList
352
+    // },
326 353
     getDetail () {
327 354
       this.GetCaseInfo({id: this.id})
328 355
     },
@@ -338,13 +365,13 @@ export default {
338 365
         this.$refs.courseTable.clearSelection()
339 366
       }
340 367
     },
341
-    exceed () {
342
-      this.$message({
343
-        message: '超过可传的图片上限',
344
-        type: 'info',
345
-        duration: 1000
346
-      })
347
-    },
368
+    // exceed () {
369
+    //   this.$message({
370
+    //     message: '超过可传的图片上限',
371
+    //     type: 'info',
372
+    //     duration: 1000
373
+    //   })
374
+    // },
348 375
     addCourse () {
349 376
       this.GetCourseList({caseid: this.CaseId, page: 1, pagesize: 100, callback: this.coursesShow})
350 377
     },
@@ -365,7 +392,13 @@ export default {
365 392
     },
366 393
     deleteItem (row) {
367 394
       this.UpdateInfo({...this.detail, Courses: this.detail.Courses.filter(x => x.CourseId !== row.CourseId)})
368
-    }
395
+    },
396
+    handleImgSuccess (res, file) {
397
+      this.img = res.result.url
398
+    },
399
+    handleDetailImgSuccess (res, file) {
400
+      this.detailimg = res.result.url
401
+    },
369 402
   },
370 403
   mounted () {
371 404
     this.getCourse()

+ 3
- 2
src/pages/system/cmsManager/majorProjects/index.vue 查看文件

@@ -10,8 +10,9 @@
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="tableSearch.caseId" placeholder="请选择">
12 12
               <el-option
13
-              value=""
14
-              >
13
+                key=""
14
+                label="所有案场"
15
+                value="">
15 16
               </el-option>
16 17
               <el-option
17 18
                 v-for="item in caseList"

+ 35
- 23
src/pages/system/cmsManager/newsManager/add.vue 查看文件

@@ -62,7 +62,7 @@
62 62
         <li class="flex-h">
63 63
           <span>图片:</span>
64 64
           <div class="flex-item">
65
-            <el-upload
65
+            <!-- <el-upload
66 66
               :action="$api.file.image.url"
67 67
               :limit='limit'
68 68
               list-type="picture-card"
@@ -74,7 +74,16 @@
74 74
             </el-upload>
75 75
             <el-dialog :visible.sync="dialogVisible">
76 76
               <img width="100%" :src="imgs" alt="">
77
-            </el-dialog>
77
+            </el-dialog> -->
78
+            <!-- 单选 -->
79
+            <el-upload
80
+              class="avatar-uploader"
81
+              :action='$api.file.image.url'
82
+              :show-file-list="false"
83
+              :on-success="handleAvatarSuccess">
84
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
85
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
86
+            </el-upload>
78 87
           </div>
79 88
         </li>
80 89
         <li style="text-align:center">
@@ -148,13 +157,13 @@ export default {
148 157
       }
149 158
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
150 159
       this.postData.locationids = this.postData.LocationIds.join(',')
151
-      this.postData.ImageUrl = ''
152
-      for (let i = 0; i < this.imgsArr.length; i++) {
153
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
154
-      }
155
-      if (this.postData.ImageUrl) {
156
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
157
-      }
160
+      // this.postData.ImageUrl = ''
161
+      // for (let i = 0; i < this.imgsArr.length; i++) {
162
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
163
+      // }
164
+      // if (this.postData.ImageUrl) {
165
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
166
+      // }
158 167
       this.$ajax(this.$api.cms.addNews.url, {
159 168
         method: this.$api.cms.addNews.method,
160 169
         data: this.postData
@@ -174,21 +183,24 @@ export default {
174 183
     cancel () {
175 184
       this.$router.go(-1)
176 185
     },
177
-    handlePictureCardPreview (res, file, fileList) {
178
-      this.imgs = res.result.url
179
-      this.dialogVisible = false
180
-      this.imgsArr = fileList
181
-    },
182
-    handleRemove (file, fileList) {
183
-      this.imgsArr = fileList
186
+    // handlePictureCardPreview (res, file, fileList) {
187
+    //   this.imgs = res.result.url
188
+    //   this.dialogVisible = false
189
+    //   this.imgsArr = fileList
190
+    // },
191
+    // handleRemove (file, fileList) {
192
+    //   this.imgsArr = fileList
193
+    // },
194
+    // exceed () {
195
+    //   this.$message({
196
+    //     message: '超过可传的图片上限',
197
+    //     type: 'info',
198
+    //     duration: 1000
199
+    //   })
200
+    // }
201
+    handleAvatarSuccess (res, file) {
202
+      this.postData.ImageUrl = res.result.url
184 203
     },
185
-    exceed () {
186
-      this.$message({
187
-        message: '超过可传的图片上限',
188
-        type: 'info',
189
-        duration: 1000
190
-      })
191
-    }
192 204
   }
193 205
 }
194 206
 </script>

+ 47
- 36
src/pages/system/cmsManager/newsManager/edit.vue 查看文件

@@ -62,7 +62,7 @@
62 62
         <li class="flex-h">
63 63
           <span>图片:</span>
64 64
           <div class="flex-item">
65
-            <el-upload
65
+            <!-- <el-upload
66 66
               :action="$api.file.image.url"
67 67
               :limit='limit'
68 68
               list-type="picture-card"
@@ -74,7 +74,15 @@
74 74
             </el-upload>
75 75
             <el-dialog :visible.sync="dialogVisible">
76 76
               <img width="100%" :src="imgs" alt="">
77
-            </el-dialog>
77
+            </el-dialog> -->
78
+            <el-upload
79
+              class="avatar-uploader"
80
+              :action='$api.file.image.url'
81
+              :show-file-list="false"
82
+              :on-success="handleAvatarSuccess">
83
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
84
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
85
+            </el-upload>
78 86
           </div>
79 87
         </li>
80 88
         <li style="text-align:center">
@@ -144,13 +152,13 @@ export default {
144 152
       }
145 153
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
146 154
       this.postData.locationids = this.postData.LocationIds.join(',')
147
-      this.postData.ImageUrl = ''
148
-      for (let i = 0; i < this.imgsArr.length; i++) {
149
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
150
-      }
151
-      if (this.postData.ImageUrl) {
152
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
153
-      }
155
+      // this.postData.ImageUrl = ''
156
+      // for (let i = 0; i < this.imgsArr.length; i++) {
157
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
158
+      // }
159
+      // if (this.postData.ImageUrl) {
160
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
161
+      // }
154 162
       this.$ajax(this.$api.cms.editNews.url, {
155 163
         method: this.$api.cms.editNews.method,
156 164
         urlData: {
@@ -173,21 +181,21 @@ export default {
173 181
     cancel () {
174 182
       this.$router.go(-1)
175 183
     },
176
-    handlePictureCardPreview (res, file, fileList) {
177
-      this.imgs = res.result.url
178
-      this.dialogVisible = false
179
-      this.imgsArr = fileList
180
-    },
181
-    handleRemove (file, fileList) {
182
-      this.imgsArr = fileList
183
-    },
184
-    exceed () {
185
-      this.$message({
186
-        message: '超过可传的图片上限',
187
-        type: 'info',
188
-        duration: 1000
189
-      })
190
-    },
184
+    // handlePictureCardPreview (res, file, fileList) {
185
+    //   this.imgs = res.result.url
186
+    //   this.dialogVisible = false
187
+    //   this.imgsArr = fileList
188
+    // },
189
+    // handleRemove (file, fileList) {
190
+    //   this.imgsArr = fileList
191
+    // },
192
+    // exceed () {
193
+    //   this.$message({
194
+    //     message: '超过可传的图片上限',
195
+    //     type: 'info',
196
+    //     duration: 1000
197
+    //   })
198
+    // },
191 199
     getDetail () {
192 200
       this.$ajax(this.$api.cms.newsDetail.url, {
193 201
         method: this.$api.cms.newsDetail.method,
@@ -203,22 +211,25 @@ export default {
203 211
           return previousValue
204 212
         }, [])
205 213
         console.log(res.LocationIds)
206
-        let imgsArr = []
207
-        let item = {
208
-          url: res.ImageUrl,
209
-          response: {
210
-            result: {
211
-              url: res.ImageUrl
212
-            }
213
-          }
214
-        }
215
-        imgsArr.push(item)
216
-        this.imgsArr = imgsArr
214
+        // let imgsArr = []
215
+        // let item = {
216
+        //   url: res.ImageUrl,
217
+        //   response: {
218
+        //     result: {
219
+        //       url: res.ImageUrl
220
+        //     }
221
+        //   }
222
+        // }
223
+        // imgsArr.push(item)
224
+        // this.imgsArr = imgsArr
217 225
         this.postData = res
218 226
       }).catch(msg => {
219 227
 
220 228
       })
221
-    }
229
+    },
230
+    handleAvatarSuccess (res, file) {
231
+      this.postData.ImageUrl = res.result.url
232
+    },
222 233
   }
223 234
 }
224 235
 </script>

+ 5
- 0
src/pages/system/cmsManager/newsManager/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <span>选择位置:</span>
11 11
             <el-select v-model="tableSearch.LocationId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="全部"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in positionList"
14 19
                 :key="item.LocationId"

+ 3
- 4
src/pages/system/courseManager/courseList/index.vue 查看文件

@@ -11,9 +11,8 @@
11 11
             <el-select v-model="postData.caseid" placeholder="请选择案场">
12 12
               <el-option
13 13
                 key=""
14
-                label=""
15
-                value=""
16
-              >
14
+                label="所有案场"
15
+                value="">
17 16
               </el-option>
18 17
               <el-option
19 18
                 v-for="item in cases"
@@ -27,7 +26,7 @@
27 26
             <el-select v-model="postData.typeid" placeholder="课程分类">
28 27
               <el-option
29 28
                 key=""
30
-                label=""
29
+                label="全部"
31 30
                 value=""
32 31
               >
33 32
               </el-option>

+ 2
- 3
src/pages/system/courseManager/fiveA/edit.vue 查看文件

@@ -149,13 +149,12 @@ export default {
149 149
           id: this.$route.query.id
150 150
         }
151 151
       }).then(res => {
152
-        console.log(res)
153 152
         let imgsArr = []
154 153
         let item = {
155
-          url: res.ImageUrl,
154
+          url: res.TypeImg,
156 155
           response: {
157 156
             result: {
158
-              url: res.ImageUrl
157
+              url: res.TypeImg
159 158
             }
160 159
           }
161 160
         }

+ 148
- 0
src/pages/system/dataStatistics/cardCouponList/index.vue 查看文件

@@ -0,0 +1,148 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h"></div>
6
+        <ul>
7
+          <li>
8
+            <el-select v-model="CaseId" placeholder="请选择案场">
9
+              <el-option
10
+                v-for="item in cases"
11
+                :key="item.CaseId"
12
+                :label="item.CaseName"
13
+                :value="item.CaseId">
14
+              </el-option>
15
+            </el-select>
16
+          </li>
17
+          <li>
18
+            <el-select v-model="postData.type" placeholder="请选择卡券类型">
19
+              <el-option
20
+                v-for="item in typeList"
21
+                :key="item.CaseId"
22
+                :label="item.CaseName"
23
+                :value="item.CaseId">
24
+              </el-option>
25
+            </el-select>
26
+          </li>
27
+          <li>
28
+            <el-input
29
+              placeholder="请输入卡券名称"
30
+              v-model="postData.name"
31
+              clearable>
32
+            </el-input>
33
+          </li>
34
+        </ul>
35
+        <el-button
36
+          size="mini"
37
+          type="primary" @click="search">搜索</el-button>
38
+        <el-button
39
+          size="mini"
40
+          type="success" @click="search">导出Excel</el-button>
41
+      </div>
42
+      <div class="moreFilter"></div>
43
+    </div>
44
+    <div class="system-table-box">
45
+      <el-table
46
+        :data="currentList"
47
+        stripe
48
+        style="width: 100%">
49
+        <el-table-column
50
+          prop="CaseName"
51
+          label="所属案场">
52
+        </el-table-column>
53
+        <el-table-column
54
+          prop="name"
55
+          label="卡券名称">
56
+        </el-table-column>
57
+        <el-table-column
58
+          prop="type"
59
+          label="卡券类型">
60
+        </el-table-column>
61
+        <el-table-column
62
+          prop="sendType"
63
+          label="发送类型">
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="price"
67
+          label="价格">
68
+        </el-table-column>
69
+        <el-table-column
70
+          prop="getNum"
71
+          label="领取数">
72
+        </el-table-column>
73
+        <el-table-column
74
+          prop="usedNum"
75
+          label="实际使用数">
76
+        </el-table-column>
77
+        <el-table-column
78
+          prop="totalPrice"
79
+          label="总费用">
80
+        </el-table-column>
81
+      </el-table>
82
+    </div>
83
+    <el-pagination
84
+      @current-change="handleCurrentChange"
85
+      :current-page.sync="postData.page"
86
+      :page-size="postData.pagesize"
87
+      layout="prev, pager, next, jumper"
88
+      :total="total">
89
+    </el-pagination>
90
+  </div>
91
+</template>
92
+
93
+<script>
94
+import { mapState } from 'vuex'
95
+import tableSearch from '@/components/tableSearch/index'
96
+
97
+export default {
98
+  name: '',
99
+  data () {
100
+    return {
101
+      total: 0,
102
+      postData: { // 表格搜索条件
103
+        caseid: '', // 案场id
104
+        type: '', // 卡券类型
105
+        name: '', // 卡券名称
106
+        page: 1, // 当前页码
107
+        pagesize: 10, // 请求数据量
108
+      },
109
+      currentList: [],
110
+      typeList: [],
111
+    }
112
+  },
113
+  computed: {
114
+    ...mapState({
115
+      cases: x => x.app.cases.list,
116
+      defaultCaseId: x => x.app.cases.default
117
+    }),
118
+    CaseId: {
119
+      get () {
120
+        return this.postData.caseid || this.defaultCaseId
121
+      },
122
+      set (val) {
123
+        this.postData.caseid = val
124
+      }
125
+    }
126
+  },
127
+  components: {
128
+    tableSearch,
129
+  },
130
+  mounted () {
131
+    this.$nextTick(function () {
132
+    })
133
+  },
134
+  methods: {
135
+    search () { // 搜索
136
+      // 1
137
+    },
138
+    handleCurrentChange (val) { // 跳转到分页
139
+      // this.getList()
140
+    },
141
+  }
142
+}
143
+</script>
144
+
145
+<!-- Add "scoped" attribute to limit CSS to this component only -->
146
+<style lang="scss" scoped>
147
+@import "page.scss";
148
+</style>

+ 36
- 0
src/pages/system/dataStatistics/cardCouponList/page.scss 查看文件

@@ -0,0 +1,36 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+

+ 203
- 0
src/pages/system/dataStatistics/cardCouponUsedList/index.vue 查看文件

@@ -0,0 +1,203 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <ul class="searchFilterLine" style="white-space: normal;">
6
+          <li>
7
+            <el-select v-model="CaseId" placeholder="请选择案场">
8
+              <el-option
9
+                v-for="item in cases"
10
+                :key="item.CaseId"
11
+                :label="item.CaseName"
12
+                :value="item.CaseId">
13
+              </el-option>
14
+            </el-select>
15
+          </li>
16
+          <li>
17
+            <el-select v-model="postData.type" placeholder="请选择获取方式">
18
+              <el-option
19
+                v-for="item in typeList"
20
+                :key="item.CaseId"
21
+                :label="item.CaseName"
22
+                :value="item.CaseId">
23
+              </el-option>
24
+            </el-select>
25
+          </li>
26
+          <li>
27
+            <el-select v-model="postData.status" placeholder="请选择状态">
28
+              <el-option
29
+                v-for="item in statusList"
30
+                :key="item.CaseId"
31
+                :label="item.CaseName"
32
+                :value="item.CaseId">
33
+              </el-option>
34
+            </el-select>
35
+          </li>
36
+          <li>
37
+            <el-input
38
+              placeholder="请输入卡券名称"
39
+              v-model="postData.name"
40
+              clearable>
41
+            </el-input>
42
+          </li>
43
+          <li>
44
+            <el-input
45
+              placeholder="请输入手机号"
46
+              v-model="postData.phone"
47
+              clearable>
48
+            </el-input>
49
+          </li>
50
+          <li style="white-space: nowrap;">
51
+            <span>有效期:</span>
52
+            <el-date-picker
53
+              v-model="postData.startDate"
54
+              type="date"
55
+              placeholder="选择起始日期">
56
+            </el-date-picker>
57
+            <span>至</span>
58
+            <el-date-picker
59
+              v-model="postData.endDate"
60
+              type="date"
61
+              placeholder="选择截止日期">
62
+            </el-date-picker>
63
+          </li>
64
+        </ul>
65
+      </div>
66
+      <div class="flex-h">
67
+        <div class="flex-item flex-h"></div>
68
+        <el-button
69
+          size="mini"
70
+          type="primary" @click="search">搜索</el-button>
71
+        <el-button
72
+          size="mini"
73
+          type="success" @click="search">导出Excel</el-button>
74
+      </div>
75
+      <div class="moreFilter"></div>
76
+    </div>
77
+    <div class="system-table-box">
78
+      <el-table
79
+        :data="currentList"
80
+        stripe
81
+        style="width: 100%">
82
+        <el-table-column
83
+          prop="CaseName"
84
+          label="所属案场">
85
+        </el-table-column>
86
+        <el-table-column
87
+          prop="Name"
88
+          label="卡券名称">
89
+        </el-table-column>
90
+        <el-table-column
91
+          prop="GoodsList"
92
+          label="使用商品">
93
+        </el-table-column>
94
+        <el-table-column
95
+          prop="GetType"
96
+          label="获取方式">
97
+        </el-table-column>
98
+        <el-table-column
99
+          prop="NickName"
100
+          label="微信昵称">
101
+        </el-table-column>
102
+        <el-table-column
103
+          prop="Phone"
104
+          label="手机号">
105
+        </el-table-column>
106
+        <el-table-column
107
+          prop="SalerName"
108
+          label="销售">
109
+        </el-table-column>
110
+        <el-table-column
111
+          prop="EndDate"
112
+          label="有效期">
113
+        </el-table-column>
114
+        <el-table-column
115
+          prop="GetDate"
116
+          label="获取时间">
117
+        </el-table-column>
118
+        <el-table-column
119
+          prop="CheckDate"
120
+          label="核销时间">
121
+        </el-table-column>
122
+        <el-table-column
123
+          prop="Status"
124
+          label="状态">
125
+        </el-table-column>
126
+      </el-table>
127
+    </div>
128
+    <el-pagination
129
+      @current-change="handleCurrentChange"
130
+      :current-page.sync="postData.page"
131
+      :page-size="postData.pagesize"
132
+      layout="prev, pager, next, jumper"
133
+      :total="total">
134
+    </el-pagination>
135
+  </div>
136
+</template>
137
+
138
+<script>
139
+import { mapState } from 'vuex'
140
+import tableSearch from '@/components/tableSearch/index'
141
+
142
+export default {
143
+  name: '',
144
+  data () {
145
+    return {
146
+      total: 0,
147
+      postData: { // 表格搜索条件
148
+        phone: '', // 手机号
149
+        status: '', // 状态
150
+        caseid: '', // 案场id
151
+        type: '', // 获取方式
152
+        startDate: '', // 起始日期
153
+        endDate: '', // 截止日期
154
+        name: '', // 卡券名称
155
+        page: 1, // 当前页码
156
+        pagesize: 10, // 请求数据量
157
+      },
158
+      currentList: [],
159
+      typeList: [],
160
+      statusList: [],
161
+    }
162
+  },
163
+  computed: {
164
+    ...mapState({
165
+      cases: x => x.app.cases.list,
166
+      defaultCaseId: x => x.app.cases.default
167
+    }),
168
+    CaseId: {
169
+      get () {
170
+        return this.postData.caseid || this.defaultCaseId
171
+      },
172
+      set (val) {
173
+        this.postData.caseid = val
174
+      }
175
+    }
176
+  },
177
+  components: {
178
+    tableSearch,
179
+  },
180
+  mounted () {
181
+    this.$nextTick(function () {
182
+    })
183
+  },
184
+  methods: {
185
+    search () { // 搜索
186
+      // 1
187
+    },
188
+    handleCurrentChange (val) { // 跳转到分页
189
+      // this.getList()
190
+    },
191
+  }
192
+}
193
+</script>
194
+
195
+<!-- Add "scoped" attribute to limit CSS to this component only -->
196
+<style lang="scss" scoped>
197
+@import "page.scss";
198
+.searchFilterLine{
199
+  >li{
200
+    margin-bottom: 20px;
201
+  }
202
+}
203
+</style>

+ 36
- 0
src/pages/system/dataStatistics/cardCouponUsedList/page.scss 查看文件

@@ -0,0 +1,36 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+

+ 176
- 0
src/pages/system/dataStatistics/courseOrderList/index.vue 查看文件

@@ -0,0 +1,176 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <ul class="searchFilterLine" style="white-space: normal;">
6
+          <li>
7
+            <el-select v-model="CaseId" placeholder="请选择案场">
8
+              <el-option
9
+                v-for="item in cases"
10
+                :key="item.CaseId"
11
+                :label="item.CaseName"
12
+                :value="item.CaseId">
13
+              </el-option>
14
+            </el-select>
15
+          </li>
16
+          <li>
17
+            <el-select v-model="postData.type" placeholder="请选择课程类别">
18
+              <el-option
19
+                v-for="item in typeList"
20
+                :key="item.CaseId"
21
+                :label="item.CaseName"
22
+                :value="item.CaseId">
23
+              </el-option>
24
+            </el-select>
25
+          </li>
26
+          <li>
27
+            <el-input
28
+              placeholder="请输入课程活动名称"
29
+              v-model="postData.name"
30
+              clearable>
31
+            </el-input>
32
+          </li>
33
+          <li style="white-space: nowrap;">
34
+            <span>下单时间:</span>
35
+            <el-date-picker
36
+              v-model="postData.startDate"
37
+              type="date"
38
+              placeholder="选择起始日期">
39
+            </el-date-picker>
40
+            <span>至</span>
41
+            <el-date-picker
42
+              v-model="postData.endDate"
43
+              type="date"
44
+              placeholder="选择截止日期">
45
+            </el-date-picker>
46
+          </li>
47
+        </ul>
48
+      </div>
49
+      <div class="flex-h">
50
+        <div class="flex-item flex-h"></div>
51
+        <el-button
52
+          size="mini"
53
+          type="primary" @click="search">搜索</el-button>
54
+        <el-button
55
+          size="mini"
56
+          type="success" @click="search">导出Excel</el-button>
57
+      </div>
58
+      <div class="moreFilter"></div>
59
+    </div>
60
+    <div class="system-table-box">
61
+      <el-table
62
+        :data="currentList"
63
+        stripe
64
+        style="width: 100%">
65
+        <el-table-column
66
+          prop="OrderNo"
67
+          label="订单编号">
68
+        </el-table-column>
69
+        <el-table-column
70
+          prop="Name"
71
+          label="课程名称">
72
+        </el-table-column>
73
+        <el-table-column
74
+          prop="CaseName"
75
+          label="所属案场">
76
+        </el-table-column>
77
+        <el-table-column
78
+          prop="Type"
79
+          label="课程类别">
80
+        </el-table-column>
81
+        <el-table-column
82
+          prop="Date"
83
+          label="课程时间">
84
+        </el-table-column>
85
+        <el-table-column
86
+          prop="UserName"
87
+          label="用户姓名">
88
+        </el-table-column>
89
+        <el-table-column
90
+          prop="NickName"
91
+          label="微信昵称">
92
+        </el-table-column>
93
+        <el-table-column
94
+          prop="Phone"
95
+          label="手机号">
96
+        </el-table-column>
97
+        <el-table-column
98
+          prop="CreatDate"
99
+          label="下单时间">
100
+        </el-table-column>
101
+      </el-table>
102
+    </div>
103
+    <el-pagination
104
+      @current-change="handleCurrentChange"
105
+      :current-page.sync="postData.page"
106
+      :page-size="postData.pagesize"
107
+      layout="prev, pager, next, jumper"
108
+      :total="total">
109
+    </el-pagination>
110
+  </div>
111
+</template>
112
+
113
+<script>
114
+import { mapState } from 'vuex'
115
+import tableSearch from '@/components/tableSearch/index'
116
+
117
+export default {
118
+  name: '',
119
+  data () {
120
+    return {
121
+      total: 0,
122
+      postData: { // 表格搜索条件
123
+        caseid: '', // 案场id
124
+        type: '', // 获取方式
125
+        startDate: '', // 起始日期
126
+        endDate: '', // 截止日期
127
+        name: '', // 卡券名称
128
+        page: 1, // 当前页码
129
+        pagesize: 10, // 请求数据量
130
+      },
131
+      currentList: [],
132
+      typeList: [],
133
+      statusList: [],
134
+    }
135
+  },
136
+  computed: {
137
+    ...mapState({
138
+      cases: x => x.app.cases.list,
139
+      defaultCaseId: x => x.app.cases.default
140
+    }),
141
+    CaseId: {
142
+      get () {
143
+        return this.postData.caseid || this.defaultCaseId
144
+      },
145
+      set (val) {
146
+        this.postData.caseid = val
147
+      }
148
+    }
149
+  },
150
+  components: {
151
+    tableSearch,
152
+  },
153
+  mounted () {
154
+    this.$nextTick(function () {
155
+    })
156
+  },
157
+  methods: {
158
+    search () { // 搜索
159
+      // 1
160
+    },
161
+    handleCurrentChange (val) { // 跳转到分页
162
+      // this.getList()
163
+    },
164
+  }
165
+}
166
+</script>
167
+
168
+<!-- Add "scoped" attribute to limit CSS to this component only -->
169
+<style lang="scss" scoped>
170
+@import "page.scss";
171
+.searchFilterLine{
172
+  >li{
173
+    margin-bottom: 20px;
174
+  }
175
+}
176
+</style>

+ 36
- 0
src/pages/system/dataStatistics/courseOrderList/page.scss 查看文件

@@ -0,0 +1,36 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+

+ 148
- 0
src/pages/system/dataStatistics/courseStatisticsList/index.vue 查看文件

@@ -0,0 +1,148 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h"></div>
6
+        <ul>
7
+          <li>
8
+            <el-select v-model="CaseId" placeholder="请选择案场">
9
+              <el-option
10
+                v-for="item in cases"
11
+                :key="item.CaseId"
12
+                :label="item.CaseName"
13
+                :value="item.CaseId">
14
+              </el-option>
15
+            </el-select>
16
+          </li>
17
+          <li>
18
+            <el-select v-model="postData.type" placeholder="请选择课程类别">
19
+              <el-option
20
+                v-for="item in typeList"
21
+                :key="item.CaseId"
22
+                :label="item.CaseName"
23
+                :value="item.CaseId">
24
+              </el-option>
25
+            </el-select>
26
+          </li>
27
+          <li>
28
+            <el-input
29
+              placeholder="请输入课程名称"
30
+              v-model="postData.name"
31
+              clearable>
32
+            </el-input>
33
+          </li>
34
+        </ul>
35
+        <el-button
36
+          size="mini"
37
+          type="primary" @click="search">搜索</el-button>
38
+        <el-button
39
+          size="mini"
40
+          type="success" @click="search">导出Excel</el-button>
41
+      </div>
42
+      <div class="moreFilter"></div>
43
+    </div>
44
+    <div class="system-table-box">
45
+      <el-table
46
+        :data="currentList"
47
+        stripe
48
+        style="width: 100%">
49
+        <el-table-column
50
+          prop="CaseName"
51
+          label="所属案场">
52
+        </el-table-column>
53
+        <el-table-column
54
+          prop="Name"
55
+          label="课程名称">
56
+        </el-table-column>
57
+        <el-table-column
58
+          prop="Type"
59
+          label="课程类别">
60
+        </el-table-column>
61
+        <el-table-column
62
+          prop="Date"
63
+          label="课程时间">
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="Price"
67
+          label="课程价格">
68
+        </el-table-column>
69
+        <el-table-column
70
+          prop="ApplyNum"
71
+          label="报名人数">
72
+        </el-table-column>
73
+        <el-table-column
74
+          prop="CheckedNum"
75
+          label="核销人数">
76
+        </el-table-column>
77
+        <el-table-column
78
+          prop="totalPrice"
79
+          label="总费用">
80
+        </el-table-column>
81
+      </el-table>
82
+    </div>
83
+    <el-pagination
84
+      @current-change="handleCurrentChange"
85
+      :current-page.sync="postData.page"
86
+      :page-size="postData.pagesize"
87
+      layout="prev, pager, next, jumper"
88
+      :total="total">
89
+    </el-pagination>
90
+  </div>
91
+</template>
92
+
93
+<script>
94
+import { mapState } from 'vuex'
95
+import tableSearch from '@/components/tableSearch/index'
96
+
97
+export default {
98
+  name: '',
99
+  data () {
100
+    return {
101
+      total: 0,
102
+      postData: { // 表格搜索条件
103
+        caseid: '', // 案场id
104
+        type: '', // 卡券类型
105
+        name: '', // 卡券名称
106
+        page: 1, // 当前页码
107
+        pagesize: 10, // 请求数据量
108
+      },
109
+      currentList: [],
110
+      typeList: [],
111
+    }
112
+  },
113
+  computed: {
114
+    ...mapState({
115
+      cases: x => x.app.cases.list,
116
+      defaultCaseId: x => x.app.cases.default
117
+    }),
118
+    CaseId: {
119
+      get () {
120
+        return this.postData.caseid || this.defaultCaseId
121
+      },
122
+      set (val) {
123
+        this.postData.caseid = val
124
+      }
125
+    }
126
+  },
127
+  components: {
128
+    tableSearch,
129
+  },
130
+  mounted () {
131
+    this.$nextTick(function () {
132
+    })
133
+  },
134
+  methods: {
135
+    search () { // 搜索
136
+      // 1
137
+    },
138
+    handleCurrentChange (val) { // 跳转到分页
139
+      // this.getList()
140
+    },
141
+  }
142
+}
143
+</script>
144
+
145
+<!-- Add "scoped" attribute to limit CSS to this component only -->
146
+<style lang="scss" scoped>
147
+@import "page.scss";
148
+</style>

+ 36
- 0
src/pages/system/dataStatistics/courseStatisticsList/page.scss 查看文件

@@ -0,0 +1,36 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+

+ 260
- 0
src/pages/system/dataStatistics/goodsOrderList/index.vue 查看文件

@@ -0,0 +1,260 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <ul class="searchFilterLine" style="white-space: normal;">
6
+          <li>
7
+            <el-select v-model="CaseId" placeholder="请选择案场">
8
+              <el-option
9
+                v-for="item in cases"
10
+                :key="item.CaseId"
11
+                :label="item.CaseName"
12
+                :value="item.CaseId">
13
+              </el-option>
14
+            </el-select>
15
+          </li>
16
+          <li>
17
+            <el-select v-model="postData.type" placeholder="请选择下单用户类型">
18
+              <el-option
19
+                v-for="item in typeList"
20
+                :key="item.CaseId"
21
+                :label="item.CaseName"
22
+                :value="item.CaseId">
23
+              </el-option>
24
+            </el-select>
25
+          </li>
26
+          <li>
27
+            <el-select v-model="postData.status" placeholder="请选择订单状态">
28
+              <el-option
29
+                v-for="item in statusList"
30
+                :key="item.CaseId"
31
+                :label="item.CaseName"
32
+                :value="item.CaseId">
33
+              </el-option>
34
+            </el-select>
35
+          </li>
36
+          <li style="white-space: nowrap;">
37
+            <span>有下单时间:</span>
38
+            <el-date-picker
39
+              v-model="postData.startDate"
40
+              type="date"
41
+              placeholder="选择起始日期">
42
+            </el-date-picker>
43
+            <span>至</span>
44
+            <el-date-picker
45
+              v-model="postData.endDate"
46
+              type="date"
47
+              placeholder="选择截止日期">
48
+            </el-date-picker>
49
+          </li>
50
+        </ul>
51
+      </div>
52
+      <div class="flex-h">
53
+        <div class="flex-item flex-h"></div>
54
+        <el-button
55
+          size="mini"
56
+          type="primary" @click="search">搜索</el-button>
57
+        <el-button
58
+          size="mini"
59
+          type="success" @click="search">导出Excel</el-button>
60
+      </div>
61
+      <div class="moreFilter"></div>
62
+    </div>
63
+    <table>
64
+      <tr v-for="(item,index) in currentList.length*2" :key="index">
65
+        <td v-if="index%2 === 0" colspan="16" class="title">
66
+          <div class="flex-h">
67
+            <div class="flex-item" style="text-align:left;">
68
+              <span>订单编号:{{returnListItem(currentList, index).OrderNo}}</span>
69
+              <span>案场:{{returnListItem(currentList, index).CaseName}}</span>
70
+              <span>用户类型:{{returnListItem(currentList, index).UserType}}</span>
71
+              <span>下单时间:{{returnListItem(currentList, index).CreatDate}}</span>
72
+            </div>
73
+            <span>{{returnListItem(currentList, index).Status}}</span>
74
+          </div>
75
+        </td>
76
+        <td v-if="index%2 !== 0" colspan="4" class="noborder">
77
+          <span v-for="(subItem,subIndex) in returnListItem(currentList, index).OrderDetail" :key="subIndex">{{subItem.GoodsName}}({{subItem.SpecName}})</span>
78
+        </td>
79
+        <td v-if="index%2 !== 0" colspan="1" class="noborder">
80
+          <span v-for="(subItem,subIndex) in returnListItem(currentList, index).OrderDetail" :key="subIndex">x{{subItem.Num}}</span>
81
+        </td>
82
+        <td v-if="index%2 !== 0" colspan="1" class="noborder">
83
+          <span v-for="(subItem,subIndex) in returnListItem(currentList, index).OrderDetail" :key="subIndex">¥{{subItem.Price}}</span>
84
+        </td>
85
+        <td v-if="index%2 !== 0" colspan="4">
86
+          <span>{{returnListItem(currentList, index).AreaName}}{{returnListItem(currentList, index).TableNo}}</span>
87
+        </td>
88
+        <td v-if="index%2 !== 0" colspan="4">
89
+          <span>{{returnListItem(currentList, index).OrderPlacer}}/{{returnListItem(currentList, index).OrderPlacerPhone}}</span>
90
+        </td>
91
+        <td v-if="index%2 !== 0" colspan="2">
92
+          <el-button
93
+          size="mini"
94
+          type="success">重打</el-button>
95
+        </td>
96
+      </tr>
97
+    </table>
98
+    <el-pagination
99
+      @current-change="handleCurrentChange"
100
+      :current-page.sync="postData.page"
101
+      :page-size="postData.pagesize"
102
+      layout="prev, pager, next, jumper"
103
+      :total="total">
104
+    </el-pagination>
105
+  </div>
106
+</template>
107
+
108
+<script>
109
+import { mapState } from 'vuex'
110
+import tableSearch from '@/components/tableSearch/index'
111
+
112
+export default {
113
+  name: '',
114
+  data () {
115
+    return {
116
+      total: 0,
117
+      postData: { // 表格搜索条件
118
+        phone: '', // 手机号
119
+        status: '', // 状态
120
+        caseid: '', // 案场id
121
+        type: '', // 获取方式
122
+        startDate: '', // 起始日期
123
+        endDate: '', // 截止日期
124
+        name: '', // 卡券名称
125
+        page: 1, // 当前页码
126
+        pagesize: 10, // 请求数据量
127
+      },
128
+      currentList: [{
129
+        OrderNo: '1234567890000',
130
+        OrderId: '123456',
131
+        CaseName: '案场名称',
132
+        CaseId: '123456',
133
+        UserType: 'manager',
134
+        CreatDate: '12345678900000',
135
+        Status: '已完成',
136
+        AreaName: '区域名称',
137
+        TableNo: '桌号',
138
+        OrderPlacer: '下单人',
139
+        OrderPlacerPhone: '18266666666',
140
+        OrderDetail: [{
141
+          GoodsName: '商品名称',
142
+          SpecName: '商品规格',
143
+          Num: '1',
144
+          Price: '30',
145
+        }, {
146
+          GoodsName: '商品名称',
147
+          SpecName: '商品规格',
148
+          Num: '1',
149
+          Price: '30',
150
+        }, {
151
+          GoodsName: '商品名称',
152
+          SpecName: '商品规格',
153
+          Num: '1',
154
+          Price: '30',
155
+        }]
156
+      }, {
157
+        OrderNo: '1234567890000',
158
+        OrderId: '123456',
159
+        CaseName: '案场名称',
160
+        CaseId: '123456',
161
+        UserType: 'manager',
162
+        CreatDate: '12345678900000',
163
+        Status: '已完成',
164
+        AreaName: '区域名称',
165
+        TableNo: '桌号',
166
+        OrderPlacer: '下单人',
167
+        OrderPlacerPhone: '18266666666',
168
+        OrderDetail: [{
169
+          GoodsName: '商品名称',
170
+          SpecName: '商品规格',
171
+          Num: '1',
172
+          Price: '30',
173
+        }, {
174
+          GoodsName: '商品名称',
175
+          SpecName: '商品规格',
176
+          Num: '1',
177
+          Price: '30',
178
+        }, {
179
+          GoodsName: '商品名称',
180
+          SpecName: '商品规格',
181
+          Num: '1',
182
+          Price: '30',
183
+        }]
184
+      }, {
185
+        OrderNo: '1234567890000',
186
+        OrderId: '123456',
187
+        CaseName: '案场名称',
188
+        CaseId: '123456',
189
+        UserType: 'manager',
190
+        CreatDate: '12345678900000',
191
+        Status: '已完成',
192
+        AreaName: '区域名称',
193
+        TableNo: '桌号',
194
+        OrderPlacer: '下单人',
195
+        OrderPlacerPhone: '18266666666',
196
+        OrderDetail: [{
197
+          GoodsName: '商品名称',
198
+          SpecName: '商品规格',
199
+          Num: '1',
200
+          Price: '30',
201
+        }, {
202
+          GoodsName: '商品名称',
203
+          SpecName: '商品规格',
204
+          Num: '1',
205
+          Price: '30',
206
+        }, {
207
+          GoodsName: '商品名称',
208
+          SpecName: '商品规格',
209
+          Num: '1',
210
+          Price: '30',
211
+        }]
212
+      }],
213
+      typeList: [],
214
+      statusList: [],
215
+    }
216
+  },
217
+  computed: {
218
+    ...mapState({
219
+      cases: x => x.app.cases.list,
220
+      defaultCaseId: x => x.app.cases.default
221
+    }),
222
+    CaseId: {
223
+      get () {
224
+        return this.postData.caseid || this.defaultCaseId
225
+      },
226
+      set (val) {
227
+        this.postData.caseid = val
228
+      }
229
+    }
230
+  },
231
+  components: {
232
+    tableSearch,
233
+  },
234
+  mounted () {
235
+    this.$nextTick(function () {
236
+    })
237
+  },
238
+  methods: {
239
+    returnListItem (target, index) {
240
+      return target[Math.ceil((index + 1) / 2) - 1]
241
+    },
242
+    search () { // 搜索
243
+      // 1
244
+    },
245
+    handleCurrentChange (val) { // 跳转到分页
246
+      // this.getList()
247
+    },
248
+  }
249
+}
250
+</script>
251
+
252
+<!-- Add "scoped" attribute to limit CSS to this component only -->
253
+<style lang="scss" scoped>
254
+@import "page.scss";
255
+.searchFilterLine {
256
+  > li {
257
+    margin-bottom: 20px;
258
+  }
259
+}
260
+</style>

+ 78
- 0
src/pages/system/dataStatistics/goodsOrderList/page.scss 查看文件

@@ -0,0 +1,78 @@
1
+
2
+table{
3
+  width: calc(100% - 40px);
4
+  border: 1px solid #eee;
5
+  margin: 20px auto 0;
6
+  border-collapse: collapse;
7
+  td{
8
+    border: 1px solid #eee;
9
+    text-align: center;
10
+    &.noborder{
11
+      border: none;
12
+    }
13
+    &.title{
14
+      background: #409EFF;
15
+      div{
16
+        font-size: 0;
17
+        white-space: nowrap;
18
+        span{
19
+          color: #fff;
20
+          line-height: 40px;
21
+          margin-left: 20px;
22
+        }
23
+      }
24
+      >div{
25
+        >span{
26
+          font-weight: bolder;
27
+          margin-right: 20px;
28
+        }
29
+      }
30
+    }
31
+    >span{
32
+      width: 100%;
33
+      display: block;
34
+      text-align: center;
35
+      line-height: 40px;
36
+      border-top: 1px solid #eee;
37
+      &:nth-child(1){
38
+        border-top: none;
39
+      }
40
+    }
41
+  }
42
+}
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+

+ 144
- 0
src/pages/system/dataStatistics/goodsStatisticsList/index.vue 查看文件

@@ -0,0 +1,144 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h"></div>
6
+        <ul>
7
+          <li>
8
+            <el-select v-model="CaseId" placeholder="请选择案场">
9
+              <el-option
10
+                v-for="item in cases"
11
+                :key="item.CaseId"
12
+                :label="item.CaseName"
13
+                :value="item.CaseId">
14
+              </el-option>
15
+            </el-select>
16
+          </li>
17
+          <li>
18
+            <el-select v-model="postData.type" placeholder="请选择商品分类">
19
+              <el-option
20
+                v-for="item in typeList"
21
+                :key="item.CaseId"
22
+                :label="item.CaseName"
23
+                :value="item.CaseId">
24
+              </el-option>
25
+            </el-select>
26
+          </li>
27
+          <li>
28
+            <el-input
29
+              placeholder="请输入商品名称"
30
+              v-model="postData.name"
31
+              clearable>
32
+            </el-input>
33
+          </li>
34
+        </ul>
35
+        <el-button
36
+          size="mini"
37
+          type="primary" @click="search">搜索</el-button>
38
+        <el-button
39
+          size="mini"
40
+          type="success" @click="search">导出Excel</el-button>
41
+      </div>
42
+      <div class="moreFilter"></div>
43
+    </div>
44
+    <div class="system-table-box">
45
+      <el-table
46
+        :data="currentList"
47
+        stripe
48
+        style="width: 100%">
49
+        <el-table-column
50
+          prop="CaseName"
51
+          label="所属案场">
52
+        </el-table-column>
53
+        <el-table-column
54
+          prop="Name"
55
+          label="商品名称">
56
+        </el-table-column>
57
+        <el-table-column
58
+          prop="Type"
59
+          label="商品分类">
60
+        </el-table-column>
61
+        <el-table-column
62
+          prop="Price"
63
+          label="价格">
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="OrderNum"
67
+          label="下单数">
68
+        </el-table-column>
69
+        <el-table-column
70
+          prop="OverNum"
71
+          label="完成数">
72
+        </el-table-column>
73
+        <el-table-column
74
+          prop="totalPrice"
75
+          label="总费用">
76
+        </el-table-column>
77
+      </el-table>
78
+    </div>
79
+    <el-pagination
80
+      @current-change="handleCurrentChange"
81
+      :current-page.sync="postData.page"
82
+      :page-size="postData.pagesize"
83
+      layout="prev, pager, next, jumper"
84
+      :total="total">
85
+    </el-pagination>
86
+  </div>
87
+</template>
88
+
89
+<script>
90
+import { mapState } from 'vuex'
91
+import tableSearch from '@/components/tableSearch/index'
92
+
93
+export default {
94
+  name: '',
95
+  data () {
96
+    return {
97
+      total: 0,
98
+      postData: { // 表格搜索条件
99
+        caseid: '', // 案场id
100
+        type: '', // 卡券类型
101
+        name: '', // 卡券名称
102
+        page: 1, // 当前页码
103
+        pagesize: 10, // 请求数据量
104
+      },
105
+      currentList: [],
106
+      typeList: [],
107
+    }
108
+  },
109
+  computed: {
110
+    ...mapState({
111
+      cases: x => x.app.cases.list,
112
+      defaultCaseId: x => x.app.cases.default
113
+    }),
114
+    CaseId: {
115
+      get () {
116
+        return this.postData.caseid || this.defaultCaseId
117
+      },
118
+      set (val) {
119
+        this.postData.caseid = val
120
+      }
121
+    }
122
+  },
123
+  components: {
124
+    tableSearch,
125
+  },
126
+  mounted () {
127
+    this.$nextTick(function () {
128
+    })
129
+  },
130
+  methods: {
131
+    search () { // 搜索
132
+      // 1
133
+    },
134
+    handleCurrentChange (val) { // 跳转到分页
135
+      // this.getList()
136
+    },
137
+  }
138
+}
139
+</script>
140
+
141
+<!-- Add "scoped" attribute to limit CSS to this component only -->
142
+<style lang="scss" scoped>
143
+@import "page.scss";
144
+</style>

+ 36
- 0
src/pages/system/dataStatistics/goodsStatisticsList/page.scss 查看文件

@@ -0,0 +1,36 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+

+ 37
- 21
src/pages/system/goodsManager/goodManager/edit.vue 查看文件

@@ -33,7 +33,8 @@
33 33
           <span>商品图片:</span>
34 34
           <div class="flex-item">
35 35
             <div style="width:50%">
36
-              <el-upload
36
+              <!-- 多选 -->
37
+              <!-- <el-upload
37 38
                 :action="$api.file.image.url"
38 39
                 :limit='limit'
39 40
                 list-type="picture-card"
@@ -42,6 +43,15 @@
42 43
                 :on-remove="handleRemove"
43 44
                 :on-exceed="exceed">
44 45
                 <i class="el-icon-plus"></i>
46
+              </el-upload> -->
47
+              <!-- 单选 -->
48
+              <el-upload
49
+                class="avatar-uploader"
50
+                :action='$api.file.image.url'
51
+                :show-file-list="false"
52
+                :on-success="handleAvatarSuccess">
53
+                <img v-if="Image" :src="Image" class="avatar">
54
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
45 55
               </el-upload>
46 56
             </div>
47 57
           </div>
@@ -105,7 +115,7 @@ export default {
105 115
   name: '',
106 116
   data () {
107 117
     return {
108
-      limit: 2,
118
+      limit: 1,
109 119
       dialogVisible: false,
110 120
       infoSpecs: null,
111 121
     }
@@ -128,23 +138,28 @@ export default {
128 138
       },
129 139
       set (val) {
130 140
         this.UpdateInfo({...this.detail, CaseId: val})
141
+        this.detail.TypeId = ''
131 142
         this.GetGoodTypes({ pagesize: 1000, caseid: this.Case })
132 143
         this.GetGoodSpecs({ pagesize: 1000, caseid: this.Case })
133 144
       }
134 145
     },
135 146
     detailSpecs: {
136 147
       get () {
148
+        console.log(this.infoSpecs || (this.detail.Specs || []).map(x => x.SpecId))
137 149
         return this.infoSpecs || (this.detail.Specs || []).map(x => x.SpecId)
138 150
       },
139 151
       set (val) {
140 152
         this.infoSpecs = val
141 153
       },
142 154
     },
143
-    imgsArr () {
144
-      return (this.detail.Images || []).map(x => {
145
-        return {...x, url: x.url || x.ImgUrl}
146
-      })
147
-    },
155
+    // imgsArr () {
156
+    //   return (this.detail.Images || []).map(x => {
157
+    //     return {...x, url: x.url || x.ImgUrl}
158
+    //   })
159
+    // },
160
+    Image () {
161
+      return ((this.detail.Images || [])[0] || {}).ImgUrl
162
+    }
148 163
   },
149 164
   methods: {
150 165
     ...mapGoodsActions([
@@ -183,19 +198,22 @@ export default {
183 198
     cancel () {
184 199
       this.$router.go(-1)
185 200
     },
186
-    handlePictureCardPreview (res, file, fileList) {
187
-      this.detail.Images = fileList
201
+    // handlePictureCardPreview (res, file, fileList) {
202
+    //   this.detail.Images = fileList
203
+    // },
204
+    // handleRemove (file, fileList) {
205
+    //   this.detail.Images = fileList
206
+    // },
207
+    // exceed () {
208
+    //   this.$message({
209
+    //     message: '超过可传的图片上限',
210
+    //     type: 'info',
211
+    //     duration: 1000
212
+    //   })
213
+    // },
214
+    handleAvatarSuccess (res, file) {
215
+      this.UpdateInfo({...this.detail, Images: [{ImgUrl: res.result.url}]})
188 216
     },
189
-    handleRemove (file, fileList) {
190
-      this.detail.Images = fileList
191
-    },
192
-    exceed () {
193
-      this.$message({
194
-        message: '超过可传的图片上限',
195
-        type: 'info',
196
-        duration: 1000
197
-      })
198
-    }
199 217
   },
200 218
   created () {
201 219
     this.GetGoodTypes({ pagesize: 1000, caseid: this.Case })
@@ -203,8 +221,6 @@ export default {
203 221
     const { id } = this.$route.query
204 222
     if (id && id !== '') {
205 223
       this.GetGoodsByID({ id: id })
206
-    } else {
207
-      this.SetNull()
208 224
     }
209 225
   }
210 226
 }

+ 8
- 0
src/pages/system/goodsManager/goodManager/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"
@@ -135,6 +140,7 @@ export default {
135 140
       'GetGoodsList',
136 141
       'GetGoodTypes',
137 142
       'DelGoods',
143
+      'SetNull',
138 144
     ]),
139 145
     getTypeName (typeid) {
140 146
       return (this.types.list.filter(x => x.TypeId === typeid)[0] || {}).TypeName
@@ -162,6 +168,7 @@ export default {
162 168
     },
163 169
     handleEdit (index, row) {
164 170
       // 编辑
171
+      this.SetNull()
165 172
       this.$router.push({ name: 'editGoods', query: { id: row.GoodsId } })
166 173
     },
167 174
     handleDelete (index, row) {
@@ -189,6 +196,7 @@ export default {
189 196
       this.getList()
190 197
     },
191 198
     addRole () {
199
+      this.SetNull()
192 200
       this.$router.push({ name: 'editGoods' })
193 201
     },
194 202
   },

+ 5
- 0
src/pages/system/goodsManager/goodsSpecManager/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"

+ 14
- 3
src/pages/system/goodsManager/goodsTypeManager/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"
@@ -36,6 +41,9 @@
36 41
         <el-table-column
37 42
           prop="CaseName"
38 43
           label="所属案场">
44
+          <template slot-scope="scope">
45
+            <span>{{getCaseName(scope.row.CaseId)}}</span>
46
+          </template>
39 47
         </el-table-column>
40 48
         <el-table-column label="操作">
41 49
           <template slot-scope="scope">
@@ -102,14 +110,17 @@ export default {
102 110
       this.currentList = []
103 111
       this.getList()
104 112
     },
113
+    getCaseName (caseid) {
114
+      return (this.cases.filter(x => x.CaseId === caseid)[0] || {}).CaseName
115
+    },
105 116
     getList () { // 获取列表
106 117
       this.$ajax(this.$api.goodsManager.getGoodsTypeList.url, {
107 118
         method: this.$api.goodsManager.getGoodsTypeList.method,
108 119
         queryData: { ...this.postData, caseid: this.CaseId }
109 120
       }).then(res => {
110
-        for (var n = 0; n < res.list.length; n++) {
111
-          res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
112
-        }
121
+        // for (var n = 0; n < res.list.length; n++) {
122
+        //   res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
123
+        // }
113 124
         this.currentList = res.list
114 125
         this.postData.page = res.page
115 126
         this.total = res.pagenum

+ 5
- 0
src/pages/system/newOrder/caseRecord/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"

+ 54
- 0
src/pages/system/page.js 查看文件

@@ -77,6 +77,12 @@ import phoneVerificationList from './verificationManager/phoneVerification/verif
77 77
 
78 78
 import dataStatistics from './dataStatistics/index' // 数据统计
79 79
 import frontEndUserList from './dataStatistics/frontEndUserList/index' // 课程管理
80
+import cardCouponList from './dataStatistics/cardCouponList/index' // 卡券统计列表
81
+import cardCouponUsedList from './dataStatistics/cardCouponUsedList/index' // 卡券使用统计
82
+import courseStatisticsList from './dataStatistics/courseStatisticsList/index' // 课程统计列表
83
+import courseOrderList from './dataStatistics/courseOrderList/index' // 课程订单列表
84
+import goodsOrderList from './dataStatistics/goodsOrderList/index' // 商品订单列表
85
+import goodsStatisticsList from './dataStatistics/goodsStatisticsList/index' // 商品统计列表
80 86
 
81 87
 import newOrder from './newOrder/index' // 商品订单系统
82 88
 import newOrderList from './newOrder/newOrderList/index' // 新订单列表
@@ -86,6 +92,9 @@ import cardList from './cardAndCouponManager/cardManager/index' // 卡列表
86 92
 import editCard from './cardAndCouponManager/cardManager/edit' // 编辑卡
87 93
 import couponList from './cardAndCouponManager/couponManager/index' // 券列表
88 94
 import editCoupon from './cardAndCouponManager/couponManager/edit' // 编辑券
95
+import bodyBuildingCardManager from './cardAndCouponManager/bodyBuildingCardManager/index' // 健身卡列表
96
+import editBodyBuildingCard from './cardAndCouponManager/bodyBuildingCardManager/edit' // 健身卡编辑
97
+import givingRecords from './cardAndCouponManager/givingRecords' // 赠送记录
89 98
 import vipList from './cardAndCouponManager/vipManager/index' // vip列表
90 99
 import editVip from './cardAndCouponManager/vipManager/edit' // 编辑vip
91 100
 import activateVip from './cardAndCouponManager/vipManager/activateVip' // 激活vip
@@ -456,6 +465,36 @@ export default {
456 465
           name: 'frontEndUserList',
457 466
           component: frontEndUserList,
458 467
           children: []
468
+        }, { // 卡券统计列表
469
+          path: 'cardCouponList',
470
+          name: 'cardCouponList',
471
+          component: cardCouponList,
472
+          children: []
473
+        }, { // 卡券使用列表
474
+          path: 'cardCouponUsedList',
475
+          name: 'cardCouponUsedList',
476
+          component: cardCouponUsedList,
477
+          children: []
478
+        }, { // 课程统计列表
479
+          path: 'courseStatisticsList',
480
+          name: 'courseStatisticsList',
481
+          component: courseStatisticsList,
482
+          children: []
483
+        }, { // 课程订单列表
484
+          path: 'courseOrderList',
485
+          name: 'courseOrderList',
486
+          component: courseOrderList,
487
+          children: []
488
+        }, { // 商品订单列表
489
+          path: 'goodsOrderList',
490
+          name: 'goodsOrderList',
491
+          component: goodsOrderList,
492
+          children: []
493
+        }, { // 商品统计列表
494
+          path: 'goodsStatisticsList',
495
+          name: 'goodsStatisticsList',
496
+          component: goodsStatisticsList,
497
+          children: []
459 498
         }]
460 499
       }, { // 卡券管理
461 500
         path: 'cardAndCouponManager',
@@ -481,6 +520,21 @@ export default {
481 520
             component: editCoupon,
482 521
             children: []
483 522
           }]
523
+        }, { // 健身卡列表
524
+          path: 'bodyBuildingCardManager',
525
+          name: 'bodyBuildingCardManager',
526
+          component: bodyBuildingCardManager,
527
+          children: [{ // 编辑健身卡
528
+            path: 'editBodyBuildingCard',
529
+            name: 'editBodyBuildingCard',
530
+            component: editBodyBuildingCard,
531
+            children: []
532
+          }]
533
+        }, { // 赠送记录
534
+          path: 'givingRecords',
535
+          name: 'givingRecords',
536
+          component: givingRecords,
537
+          children: []
484 538
         }, { // vip列表
485 539
           path: 'vipList',
486 540
           name: 'vipList',

+ 27
- 0
src/pages/system/systemSet/userManager/add.vue 查看文件

@@ -14,6 +14,14 @@
14 14
             </div>
15 15
           </div>
16 16
         </li>
17
+        <li class="flex-h" style="padding: 0;margin: 0;">
18
+          <span></span>
19
+          <div class="flex-item">
20
+            <div style="min-height: 0;">
21
+              <span style="font-size:10px;color:#bbb;">默认密码:123456</span>
22
+            </div>
23
+          </div>
24
+        </li>
17 25
         <li class="flex-h">
18 26
           <span>用户头像:</span>
19 27
           <div class="flex-item">
@@ -216,6 +224,25 @@ export default {
216 224
           message: '手机号不能为空'
217 225
         })
218 226
         return false
227
+      } else {
228
+        var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
229
+        if (!myreg.test(this.postData.Phone)) {
230
+          this.$message({
231
+            type: 'error',
232
+            message: '请输入正确的手机号!'
233
+          })
234
+          return false
235
+        }
236
+      }
237
+      if (this.postData.Email !== '') {
238
+        var emailreg = new RegExp('^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$')
239
+        if (!emailreg.test(this.postData.Email)) {
240
+          this.$message({
241
+            type: 'error',
242
+            message: '邮箱格式不正确!'
243
+          })
244
+          return false
245
+        }
219 246
       }
220 247
       if (this.postData.BelongCaseId === '') this.postData.BelongCaseId = this.CaseId
221 248
       this.$ajax(this.$api.systemSet.addUser.url, {

+ 28
- 1
src/pages/system/systemSet/userManager/edit.vue 查看文件

@@ -14,6 +14,14 @@
14 14
             </div>
15 15
           </div>
16 16
         </li>
17
+        <li class="flex-h" style="padding: 0;margin: 0;">
18
+          <span></span>
19
+          <div class="flex-item">
20
+            <div style="min-height: 0;">
21
+              <span style="font-size:10px;color:#bbb;">默认密码:123456</span>
22
+            </div>
23
+          </div>
24
+        </li>
17 25
         <li class="flex-h">
18 26
           <span>用户头像:</span>
19 27
           <div class="flex-item">
@@ -161,7 +169,7 @@ export default {
161 169
     }),
162 170
     BelongCaseId: {
163 171
       get () {
164
-        return ((this.postData.UserCase || []).filter(x => x.IsBelong === 1)[0] || {}).CaseId
172
+        return this.postData.BelongCaseId || ((this.postData.UserCase || []).filter(x => x.IsBelong === 1)[0] || {}).CaseId
165 173
       },
166 174
       set (val) {
167 175
         this.postData.BelongCaseId = val
@@ -234,6 +242,25 @@ export default {
234 242
           message: '手机号不能为空'
235 243
         })
236 244
         return false
245
+      } else {
246
+        var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
247
+        if (!myreg.test(this.postData.Phone)) {
248
+          this.$message({
249
+            type: 'error',
250
+            message: '请输入正确的手机号!'
251
+          })
252
+          return false
253
+        }
254
+      }
255
+      if (this.postData.Email !== '') {
256
+        var emailreg = new RegExp('^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$')
257
+        if (!emailreg.test(this.postData.Email)) {
258
+          this.$message({
259
+            type: 'error',
260
+            message: '邮箱格式不正确!'
261
+          })
262
+          return false
263
+        }
237 264
       }
238 265
       if (this.postData.BelongCaseId === '') this.postData.BelongCaseId = this.BelongCaseId
239 266
       if (this.postData.TagIds === '') this.postData.TagIds = this.TagIds.join(',')

+ 8
- 3
src/pages/system/systemSet/userManager/index.vue 查看文件

@@ -9,6 +9,11 @@
9 9
           <li>
10 10
             <!-- <span>选择案场:</span> -->
11 11
             <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                key=""
14
+                label="所有案场"
15
+                value="">
16
+              </el-option>
12 17
               <el-option
13 18
                 v-for="item in cases"
14 19
                 :key="item.CaseId"
@@ -71,12 +76,12 @@
71 76
         <el-table-column
72 77
           prop="WorkNo"
73 78
           label="工号"
74
-          width="200">
79
+          width="150">
75 80
         </el-table-column>
76 81
         <el-table-column
77 82
           prop="Phone"
78 83
           label="手机号"
79
-          width="150">
84
+          width="200">
80 85
         </el-table-column>
81 86
         <el-table-column
82 87
           prop="UserTypeNames"
@@ -226,7 +231,7 @@ export default {
226 231
       })
227 232
     },
228 233
     resetPasswd (index, row) { // 重置密码
229
-      this.$confirm('确认重置此用户密码?', '提示', {
234
+      this.$confirm('确认重置此用户密码为:123456?', '提示', {
230 235
         confirmButtonText: '确定',
231 236
         cancelButtonText: '取消',
232 237
         type: 'warning'

+ 3
- 2
src/store/app.js 查看文件

@@ -56,7 +56,8 @@ export default {
56 56
       default: '',
57 57
     },
58 58
     roles: [],
59
-    user: {}
59
+    user: {},
60
+    clientUrl: '',
60 61
   },
61 62
   mutations: {
62 63
     init (state, data) { // 这里的state对应着上面这个state
@@ -64,7 +65,7 @@ export default {
64 65
       state.roles = data.roles
65 66
       state.user = data.user
66 67
       state.menus = packChildren(data.menus)
67
-
68
+      state.clientUrl = data.clienturl
68 69
       let defaultCase = ''
69 70
       for (let i = 0; i < data.cases.length; i++) {
70 71
         if (data.cases[i].IsBelong === 1) {

+ 81
- 0
src/store/card/card.js 查看文件

@@ -0,0 +1,81 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    cardList: [],
8
+  },
9
+  mutations: {
10
+    updateList (state, payload) {
11
+      state.cardList = payload || []
12
+    },
13
+  },
14
+  actions: {
15
+    GetCardList ({ commit }, payload) { // 获取卡列表
16
+      return new Promise((resolve, reject) => {
17
+        ajax(api.cardManager.cardList.url, {
18
+          method: api.cardManager.cardList.method,
19
+          queryData: {
20
+            ...payload,
21
+          }
22
+        }).then(res => {
23
+          commit('updateList', res)
24
+          resolve(res)
25
+        }).catch(reject)
26
+      })
27
+    },
28
+    addCard ({ commit }, payload) { // 新增卡
29
+      return new Promise((resolve, reject) => {
30
+        ajax(api.cardManager.addCard.url, {
31
+          method: api.cardManager.addCard.method,
32
+          data: {
33
+            info: JSON.stringify(payload)
34
+          }
35
+        }).then(res => {
36
+          resolve(res)
37
+        }).catch(reject)
38
+      })
39
+    },
40
+    getCardById ({ commit }, { id }) { // 获取卡详情
41
+      return new Promise((resolve, reject) => {
42
+        ajax(api.cardManager.getCardById.url, {
43
+          method: api.cardManager.getCardById.method,
44
+          urlData: {
45
+            id,
46
+          }
47
+        }).then(res => {
48
+          resolve(res)
49
+        }).catch(reject)
50
+      })
51
+    },
52
+    editCard ({ commit }, payload) { // 编辑更新卡
53
+      return new Promise((resolve, reject) => {
54
+        ajax(api.cardManager.editCard.url, {
55
+          method: api.cardManager.editCard.method,
56
+          data: {
57
+            info: JSON.stringify(payload)
58
+          },
59
+          urlData: {
60
+            id: payload.CardId
61
+          },
62
+        }).then(res => {
63
+          resolve(res)
64
+        }).catch(reject)
65
+      })
66
+    },
67
+    giveCard ({ commit }, { id, users }) {
68
+      return new Promise((resolve, reject) => {
69
+        ajax(api.cardManager.giveCard.url, {
70
+          method: api.cardManager.giveCard.method,
71
+          urlData: {
72
+            id,
73
+            users
74
+          },
75
+        }).then(res => {
76
+          resolve(res)
77
+        }).catch(reject)
78
+      })
79
+    }
80
+  }
81
+}

+ 29
- 0
src/store/channel/channel.js 查看文件

@@ -0,0 +1,29 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    channelList: [],
8
+  },
9
+  mutations: {
10
+    updateList (state, payload) {
11
+      state.channelList = payload || []
12
+    },
13
+  },
14
+  actions: {
15
+    GetChannelListList ({ commit }, payload) {
16
+      return new Promise((resolve, reject) => {
17
+        ajax(api.channelManager.getChannelList.url, {
18
+          method: api.channelManager.getChannelList.method,
19
+          queryData: {
20
+            ...payload,
21
+          }
22
+        }).then(res => {
23
+          commit('updateList', res.list)
24
+          resolve(res)
25
+        }).catch(reject)
26
+      })
27
+    },
28
+  }
29
+}

+ 81
- 0
src/store/coupon/coupon.js 查看文件

@@ -0,0 +1,81 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    couponList: [],
8
+  },
9
+  mutations: {
10
+    updateList (state, payload) {
11
+      state.couponList = payload || []
12
+    },
13
+  },
14
+  actions: {
15
+    GetCouponList ({ commit }, payload) {
16
+      return new Promise((resolve, reject) => {
17
+        ajax(api.couponManager.couponList.url, {
18
+          method: api.couponManager.couponList.method,
19
+          queryData: {
20
+            ...payload,
21
+          }
22
+        }).then(res => {
23
+          commit('updateList', res)
24
+          resolve(res)
25
+        }).catch(reject)
26
+      })
27
+    },
28
+    addCoupon ({ commit }, payload) {
29
+      return new Promise((resolve, reject) => {
30
+        ajax(api.couponManager.addCoupon.url, {
31
+          method: api.couponManager.addCoupon.method,
32
+          data: {
33
+            info: JSON.stringify(payload)
34
+          }
35
+        }).then(res => {
36
+          resolve(res)
37
+        }).catch(reject)
38
+      })
39
+    },
40
+    getCouponById ({ commit }, { id }) {
41
+      return new Promise((resolve, reject) => {
42
+        ajax(api.couponManager.getCouponById.url, {
43
+          method: api.couponManager.getCouponById.method,
44
+          urlData: {
45
+            id,
46
+          }
47
+        }).then(res => {
48
+          resolve(res)
49
+        }).catch(reject)
50
+      })
51
+    },
52
+    editCoupon ({ commit }, payload) {
53
+      return new Promise((resolve, reject) => {
54
+        ajax(api.couponManager.editCoupon.url, {
55
+          method: api.couponManager.editCoupon.method,
56
+          data: {
57
+            info: JSON.stringify(payload)
58
+          },
59
+          urlData: {
60
+            id: payload.CouponId
61
+          },
62
+        }).then(res => {
63
+          resolve(res)
64
+        }).catch(reject)
65
+      })
66
+    },
67
+    GiveCoupon ({ commit }, { id, users }) {
68
+      return new Promise((resolve, reject) => {
69
+        ajax(api.couponManager.giveCoupon.url, {
70
+          method: api.couponManager.giveCoupon.method,
71
+          urlData: {
72
+            id,
73
+            users
74
+          },
75
+        }).then(res => {
76
+          resolve(res)
77
+        }).catch(reject)
78
+      })
79
+    }
80
+  }
81
+}

+ 13
- 10
src/store/course/course.js 查看文件

@@ -21,16 +21,19 @@ export default {
21 21
   },
22 22
   actions: {
23 23
     GetCourseList ({ commit }, payload) {
24
-      ajax(api.course.list.url, {
25
-        method: api.course.list.method,
26
-        queryData: {
27
-          ...payload,
28
-        }
29
-      }).then(res => {
30
-        commit('updateList', res)
31
-        if (payload.callback) {
32
-          payload.callback()
33
-        }
24
+      return new Promise((resolve, reject) => {
25
+        ajax(api.course.list.url, {
26
+          method: api.course.list.method,
27
+          queryData: {
28
+            ...payload,
29
+          }
30
+        }).then(res => {
31
+          commit('updateList', res)
32
+          resolve(res)
33
+          if (payload.callback) {
34
+            payload.callback()
35
+          }
36
+        }).catch(reject)
34 37
       })
35 38
     },
36 39
     GetCourseByID ({ commit }, { id }) {

+ 20
- 0
src/store/customer/customer.js 查看文件

@@ -5,11 +5,15 @@ export default {
5 5
   namespaced: true,
6 6
   state: {
7 7
     customer: {},
8
+    customers: {},
8 9
   },
9 10
   mutations: {
10 11
     updateInfo (state, payload) {
11 12
       state.customer = payload || {}
12 13
     },
14
+    updateList (state, payload) {
15
+      state.customers = payload || {}
16
+    }
13 17
   },
14 18
   actions: {
15 19
     GetCustomerByTel ({ commit }, { tel }) {
@@ -25,6 +29,22 @@ export default {
25 29
         }).catch(reject)
26 30
       })
27 31
     },
32
+    GetCustomerList ({ commit }, payload) {
33
+      return new Promise((resolve, reject) => {
34
+        ajax(api.customerManager.getCustomerList.url, {
35
+          method: api.customerManager.getCustomerList.method,
36
+          queryData: {
37
+            ...payload
38
+          }
39
+        }).then(res => {
40
+          commit('updateList', res)
41
+          resolve(res)
42
+        }).catch(reject)
43
+      })
44
+    },
45
+    SetCustomerListNull ({ commit }) {
46
+      commit('updateList', {})
47
+    },
28 48
     SetCustomerInfoNull ({ commit }) {
29 49
       commit('updateInfo', {})
30 50
     }

+ 20
- 14
src/store/goods/goods.js 查看文件

@@ -25,23 +25,29 @@ export default {
25 25
   },
26 26
   actions: {
27 27
     GetGoodsList ({ commit }, payload) {
28
-      ajax(api.goodsManager.getGoodsList.url, {
29
-        method: api.goodsManager.getGoodsList.method,
30
-        queryData: {
31
-          ...payload,
32
-        }
33
-      }).then(res => {
34
-        commit('updateList', res)
28
+      return new Promise((resolve, reject) => {
29
+        ajax(api.goodsManager.getGoodsList.url, {
30
+          method: api.goodsManager.getGoodsList.method,
31
+          queryData: {
32
+            ...payload,
33
+          }
34
+        }).then(res => {
35
+          commit('updateList', res)
36
+          resolve(res)
37
+        }).catch(reject)
35 38
       })
36 39
     },
37 40
     GetGoodTypes ({ commit }, payload) {
38
-      ajax(api.goodsManager.getGoodsTypeList.url, {
39
-        method: api.goodsManager.getGoodsTypeList.method,
40
-        queryData: {
41
-          ...payload,
42
-        }
43
-      }).then(res => {
44
-        commit('updateTypes', res)
41
+      return new Promise((resolve, reject) => {
42
+        ajax(api.goodsManager.getGoodsTypeList.url, {
43
+          method: api.goodsManager.getGoodsTypeList.method,
44
+          queryData: {
45
+            ...payload,
46
+          }
47
+        }).then(res => {
48
+          commit('updateTypes', res)
49
+          resolve(res)
50
+        }).catch(reject)
45 51
       })
46 52
     },
47 53
     GetGoodSpecs ({ commit }, payload) {

+ 3
- 0
src/store/index.js 查看文件

@@ -26,6 +26,9 @@ export const modules = {
26 26
   cmscase: () => require('./cms/case').default,
27 27
   caserecord: () => require('./case/record').default,
28 28
   vip: () => require('./card/vip').default,
29
+  card: () => require('./card/card').default,
30
+  coupon: () => require('./coupon/coupon').default,
31
+  channel: () => require('./channel/channel').default,
29 32
   customer: () => require('./customer/customer').default,
30 33
   user: () => require('./system/user').default,
31 34
 }

+ 48
- 1
src/util/api.js 查看文件

@@ -1,3 +1,4 @@
1
+// const baseUrl = '/api-v2'
1 2
 const baseUrl = '/api'
2 3
 const common = '/common/:org'
3 4
 const guest = '/guest/:org'
@@ -587,12 +588,58 @@ const $api = {
587 588
     vipbycode: {
588 589
       method: 'get',
589 590
       url: `${baseUrl}${common}/vipcard/:code`
590
-    }
591
+    },
592
+    cardList: {
593
+      method: 'get',
594
+      url: `${baseUrl}${common}/card`
595
+    },
596
+    addCard: {
597
+      method: 'post',
598
+      url: `${baseUrl}${common}/card`
599
+    },
600
+    editCard: {
601
+      method: 'put',
602
+      url: `${baseUrl}${common}/card/:id`
603
+    },
604
+    getCardById: {
605
+      method: 'get',
606
+      url: `${baseUrl}${common}/card/:id`
607
+    },
608
+    giveCard: {
609
+      method: 'post',
610
+      url: `${baseUrl}${common}/card/:id/to/:users`
611
+    },
612
+  },
613
+  couponManager: {
614
+    couponList: {
615
+      method: 'get',
616
+      url: `${baseUrl}${common}/coupon`
617
+    },
618
+    addCoupon: {
619
+      method: 'post',
620
+      url: `${baseUrl}${common}/coupon`
621
+    },
622
+    editCoupon: {
623
+      method: 'put',
624
+      url: `${baseUrl}${common}/coupon/:id`
625
+    },
626
+    getCouponById: {
627
+      method: 'get',
628
+      url: `${baseUrl}${common}/coupon/:id`
629
+    },
630
+    giveCoupon: {
631
+      method: 'post',
632
+      url: `${baseUrl}${common}/coupon/:id/to/:users`
633
+    },
591 634
   },
592 635
   customerManager: {
593 636
     getByTel: {
594 637
       method: 'get',
595 638
       url: `${baseUrl}${common}/customer/tel/:tel`
639
+    },
640
+    getCustomerList: { // 获取会员列表
641
+      method: 'get',
642
+      url: `${baseUrl}${common}/customer`
596 643
     }
597 644
   },
598 645
   marketingActivities: { // 营销活动