Browse Source

页面增加

sj 2 years ago
parent
commit
7fa49d5336
  1. 2
      .env.demo1024
  2. 6
      .env.dev
  3. 2
      .env.prod
  4. 2
      .env.stage
  5. 2
      package.json
  6. 11
      src/api/YxUserBillByUid.js
  7. 31
      src/api/YxWechatMenu.js
  8. 17
      src/api/data.js
  9. 16
      src/api/generator/genConfig.js
  10. 33
      src/api/generator/generator.js
  11. 34
      src/api/getRaisePaidRecordList.js
  12. 22
      src/api/monitor/log.js
  13. 18
      src/api/monitor/online.js
  14. 27
      src/api/monitor/server.js
  15. 24
      src/api/monitor/visits.js
  16. 11
      src/api/orderByUid.js
  17. 27
      src/api/pvManager.js
  18. 0
      src/api/refund.js
  19. 11
      src/api/spreadCount.js
  20. 34
      src/api/storeProductRule.js
  21. 10
      src/api/toRefundStatus.js
  22. 25
      src/api/tools/alipay.js
  23. 24
      src/api/tools/email.js
  24. 27
      src/api/tools/localStorage.js
  25. 39
      src/api/tools/material.js
  26. 39
      src/api/tools/materialgroup.js
  27. 18
      src/api/tools/picture.js
  28. 40
      src/api/tools/qiniu.js
  29. 43
      src/api/visits.js
  30. 34
      src/api/writeOff.js
  31. 39
      src/api/yxArticle.js
  32. 25
      src/api/yxExpress.js
  33. 27
      src/api/yxLive.js
  34. 34
      src/api/yxRaise.js
  35. 27
      src/api/yxRaiseOrder.js
  36. 12
      src/api/yxRaiseOrderDownload.js
  37. 27
      src/api/yxRaiseProject.js
  38. 34
      src/api/yxShippingTemplates.js
  39. 74
      src/api/yxStoreActivity.js
  40. 39
      src/api/yxStoreBargain.js
  41. 24
      src/api/yxStoreBargainUser.js
  42. 34
      src/api/yxStoreCategory.js
  43. 64
      src/api/yxStoreCategoryShop.js
  44. 31
      src/api/yxStoreCityWide.js
  45. 46
      src/api/yxStoreCombination.js
  46. 39
      src/api/yxStoreCoupon.js
  47. 24
      src/api/yxStoreCouponIssue.js
  48. 24
      src/api/yxStoreCouponIssueUser.js
  49. 24
      src/api/yxStoreCouponUser.js
  50. 17
      src/api/yxStoreElephant.js
  51. 108
      src/api/yxStoreOrder.js
  52. 24
      src/api/yxStoreOrderStatus.js
  53. 24
      src/api/yxStorePink.js
  54. 113
      src/api/yxStoreProduct.js
  55. 24
      src/api/yxStoreProductReply.js
  56. 51
      src/api/yxStoreSeckill.js
  57. 24
      src/api/yxStoreVisit.js
  58. 32
      src/api/yxSystemConfig.js
  59. 31
      src/api/yxSystemGroupData.js
  60. 56
      src/api/yxSystemStore.js
  61. 27
      src/api/yxSystemStoreStaff.js
  62. 24
      src/api/yxSystemUserLevel.js
  63. 24
      src/api/yxSystemUserTask.js
  64. 55
      src/api/yxUser.js
  65. 32
      src/api/yxUserBill.js
  66. 24
      src/api/yxUserExtract.js
  67. 27
      src/api/yxUserRecharge.js
  68. 36
      src/api/yxUserRecommend.js
  69. 11
      src/api/yxUserTeamByUid.js
  70. 32
      src/api/yxWechatReply.js
  71. 32
      src/api/yxWechatTemplate.js
  72. 24
      src/api/yxWechatUser.js
  73. 17
      src/assets/styles/description.scss
  74. 530
      src/components/material/index.vue
  75. 95
      src/components/mul-pic-upload/index.vue
  76. 83
      src/components/pic-upload-two/index.vue
  77. 83
      src/components/pic-upload/index.vue
  78. 499
      src/components/singlematerial/index.vue
  79. 2
      src/layout/components/Sidebar/Logo.vue
  80. 344
      src/mixins/crud.js
  81. 561
      src/views/activity/Activitylist/form.vue
  82. 0
      src/views/activity/Activitylist/forms.vue
  83. 246
      src/views/activity/Activitylist/index.vue
  84. 101
      src/views/activity/activityZone/index.vue
  85. 88
      src/views/activity/bargain/HowToPlay.vue
  86. 283
      src/views/activity/bargain/form.vue
  87. 286
      src/views/activity/bargain/formse.vue
  88. 214
      src/views/activity/bargain/index.vue
  89. 124
      src/views/activity/bargain_user/form.vue
  90. 131
      src/views/activity/bargain_user/index.vue
  91. 87
      src/views/activity/combination/HowToPlay.vue
  92. 258
      src/views/activity/combination/form.vue
  93. 264
      src/views/activity/combination/formt.vue
  94. 244
      src/views/activity/combination/index.vue
  95. 159
      src/views/activity/combinlist/form.vue
  96. 170
      src/views/activity/combinlist/index.vue
  97. 180
      src/views/activity/coupon/form.vue
  98. 105
      src/views/activity/coupon/formte.vue
  99. 220
      src/views/activity/coupon/index.vue
  100. 140
      src/views/activity/couponissue/form.vue
  101. Some files were not shown because too many files have changed in this diff Show More

2
.env.demo1024

@ -4,7 +4,7 @@ NODE_ENV = development
ENV = 'staging'
# 页面标题
VUE_APP_TITLE = 农场管理系统
VUE_APP_TITLE = 眼界甄选
# 农场管理系统/测试环境
VUE_APP_BASE_API = 'http://127.0.0.1:48080'

6
.env.dev

@ -2,11 +2,11 @@
ENV = 'development'
# 页面标题
VUE_APP_TITLE = 农场管理系统
VUE_APP_TITLE = 眼界甄选
# 农场管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.225.2'
#VUE_APP_BASE_API = 'http://192.168.225.2'
VUE_APP_BASE_API = 'http://192.168.10.113:48080'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

2
.env.prod

@ -2,7 +2,7 @@
ENV = 'production'
# 页面标题
VUE_APP_TITLE = 农场管理系统
VUE_APP_TITLE = 眼界甄选
# 农场管理系统/生产环境
VUE_APP_BASE_API = '/prod-api'

2
.env.stage

@ -1,7 +1,7 @@
NODE_ENV = production
# 页面标题
VUE_APP_TITLE = 农场管理系统
VUE_APP_TITLE = 眼界甄选
# 测试环境配置
ENV = 'staging'

2
package.json

@ -1,7 +1,7 @@
{
"name": "yudao-ui-admin",
"version": "1.6.2-snapshot",
"description": "农场管理系统",
"description": "眼界甄选",
"author": "芋道",
"license": "MIT",
"scripts": {

11
src/api/YxUserBillByUid.js

@ -0,0 +1,11 @@
import request from '@/utils/request'
export function getCYj(params) {
return request({
url: 'api/yxUser/YxUserBillByUid',
method: 'get',
params
})
}
export default { getCYj }

31
src/api/YxWechatMenu.js

@ -0,0 +1,31 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/YxWechatMenu',
method: 'post',
data
})
}
export function del(key) {
return request({
url: 'api/YxWechatMenu/' + key,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/YxWechatMenu',
method: 'put',
data
})
}
export function get() {
return request({
url: 'api/YxWechatMenu',
method: 'get'
})
}

17
src/api/data.js

@ -0,0 +1,17 @@
import request from '@/utils/request'
import qs from 'qs'
export function initData(url, params) {
return request({
url: url + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export function download(url, params) {
return request({
url: url + '?' + qs.stringify(params, { indices: false }),
method: 'get',
responseType: 'blob'
})
}

16
src/api/generator/genConfig.js

@ -0,0 +1,16 @@
import request from '@/utils/request'
export function get(tableName) {
return request({
url: 'api/genConfig/' + tableName,
method: 'get'
})
}
export function update(data) {
return request({
url: 'api/genConfig',
data,
method: 'put'
})
}

33
src/api/generator/generator.js

@ -0,0 +1,33 @@
import request from '@/utils/request'
export function getAllTable() {
return request({
url: 'api/generator/tables/all',
method: 'get'
})
}
export function generator(tableName, type) {
return request({
url: 'api/generator/' + tableName + '/' + type,
method: 'post',
responseType: type === 2 ? 'blob' : ''
})
}
export function save(data) {
return request({
url: 'api/generator',
data,
method: 'put'
})
}
export function sync(tables) {
return request({
url: 'api/generator/sync',
method: 'post',
data: tables
})
}

34
src/api/getRaisePaidRecordList.js

@ -0,0 +1,34 @@
import request from '@/utils/request'
export function getCates(params) {
return request({
url: 'api/yxRaiseOrder/getRaisePaidRecordList',
method: 'get',
params
})
}
export function add(data) {
return request({
url: 'api/yxRaiseOrder/getRaisePaidRecordList',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxRaiseOrder/getRaisePaidRecordList' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxRaiseOrder/getRaisePaidRecordList',
method: 'put',
data
})
}
export default { add, edit, del, getCates }

22
src/api/monitor/log.js

@ -0,0 +1,22 @@
import request from '@/utils/request'
export function getErrDetail(id) {
return request({
url: 'api/logs/error/' + id,
method: 'get'
})
}
export function delAllError() {
return request({
url: 'api/logs/del/error',
method: 'delete'
})
}
export function delAllInfo() {
return request({
url: 'api/logs/del/info',
method: 'delete'
})
}

18
src/api/monitor/online.js

@ -0,0 +1,18 @@
import request from '@/utils/request'
export function del(keys) {
return request({
url: 'auth/online',
method: 'delete',
data: keys
})
}
export function delT(keys) {
return request({
url: 'auth/online/delete',
method: 'post',
data: keys
})
}

27
src/api/monitor/server.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/server',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/server',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/server',
method: 'put',
data
})
}
export default { add, edit, del }

24
src/api/monitor/visits.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function count() {
return request({
url: 'api/visits',
method: 'post'
})
}
export function get() {
return request({
url: 'api/visits',
method: 'get'
})
}
export function getChartData() {
return request({
url: 'api/visits/chartData',
method: 'get'
})
}

11
src/api/orderByUid.js

@ -0,0 +1,11 @@
import request from '@/utils/request'
export function getCuid(params) {
return request({
url: 'api/yxUser/orderByUid',
method: 'get',
params
})
}
export default { getCuid }

27
src/api/pvManager.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/pvManager',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/pvManager/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/pvManager',
method: 'put',
data
})
}
export default { add, edit, del }

0
src/api/refund.js

11
src/api/spreadCount.js

@ -0,0 +1,11 @@
import request from '@/utils/request'
export function gets(data) {
return request({
url: 'api/yxUser/spreadCount',
method: 'post',
data
})
}
export default { gets }

34
src/api/storeProductRule.js

@ -0,0 +1,34 @@
import request from '@/utils/request'
export function add(data, id) {
return request({
url: `api/yxStoreProductRule/save/${id}`,
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxStoreProductRule/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxStoreProductRule',
method: 'put',
data
})
}
export function info (id) {
return request({
url: `api/yxStoreProductRule/rule/${id}`,
method: 'get'
});
}
export default { add, edit, del, info }

10
src/api/toRefundStatus.js

@ -0,0 +1,10 @@
import request from '@/utils/request'
export function addss(data) {
return request({
url: 'api/yxStoreOrder/toRefundStatus',
method: 'post',
data
})
}

25
src/api/tools/alipay.js

@ -0,0 +1,25 @@
import request from '@/utils/request'
export function get() {
return request({
url: 'api/aliPay',
method: 'get'
})
}
export function update(data) {
return request({
url: 'api/aliPay',
data,
method: 'put'
})
}
// 支付
export function toAliPay(url, data) {
return request({
url: 'api/' + url,
data,
method: 'post'
})
}

24
src/api/tools/email.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function get() {
return request({
url: 'api/email',
method: 'get'
})
}
export function update(data) {
return request({
url: 'api/email',
data,
method: 'put'
})
}
export function send(data) {
return request({
url: 'api/email',
data,
method: 'post'
})
}

27
src/api/tools/localStorage.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/localStorage',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/localStorage/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/localStorage',
method: 'put',
data
})
}
export default { add, edit, del }

39
src/api/tools/material.js

@ -0,0 +1,39 @@
import request from '@/utils/request'
export function getPage(query) {
return request({
url: 'api/material/page',
method: 'get',
params: query
})
}
export function addObj(obj) {
return request({
url: 'api/material',
method: 'post',
data: obj
})
}
export function getObj(id) {
return request({
url: 'api/material/' + id,
method: 'get'
})
}
export function delObj(id) {
return request({
url: 'api/material/' + id,
method: 'delete'
})
}
export function putObj(obj) {
return request({
url: 'api/material',
method: 'put',
data: obj
})
}

39
src/api/tools/materialgroup.js

@ -0,0 +1,39 @@
import request from '@/utils/request'
export function getPage(query) {
return request({
url: 'api/materialgroup/page',
method: 'get',
params: query
})
}
export function addObj(obj) {
return request({
url: 'api/materialgroup',
method: 'post',
data: obj
})
}
export function getObj(id) {
return request({
url: 'api/materialgroup/' + id,
method: 'get'
})
}
export function delObj(id) {
return request({
url: 'api/materialgroup/' + id,
method: 'delete'
})
}
export function putObj(obj) {
return request({
url: 'api/materialgroup',
method: 'put',
data: obj
})
}

18
src/api/tools/picture.js

@ -0,0 +1,18 @@
import request from '@/utils/request'
export function del(ids) {
return request({
url: 'api/pictures',
method: 'delete',
data: ids
})
}
export function sync() {
return request({
url: 'api/pictures/synchronize',
method: 'post'
})
}
export default { del, sync }

40
src/api/tools/qiniu.js

@ -0,0 +1,40 @@
import request from '@/utils/request'
export function get() {
return request({
url: 'api/qiNiuContent/config',
method: 'get'
})
}
export function update(data) {
return request({
url: 'api/qiNiuContent/config',
data,
method: 'put'
})
}
export function download(id) {
return request({
url: 'api/qiNiuContent/download/' + id,
method: 'get'
})
}
export function sync() {
return request({
url: 'api/qiNiuContent/synchronize',
method: 'post'
})
}
export function del(ids) {
return request({
url: 'api/qiNiuContent',
method: 'delete',
data: ids
})
}
export default { del, download, sync }

43
src/api/visits.js

@ -0,0 +1,43 @@
import request from '@/utils/request'
export function count() {
return request({
url: 'api/visits',
method: 'post'
})
}
export function get() {
return request({
url: 'api/visits',
method: 'get'
})
}
export function getChartData() {
return request({
url: 'api/visits/chartData',
method: 'get'
})
}
export function gett() {
return request({
url: 'api/data/count',
method: 'get'
})
}
export function chart() {
return request({
url: 'api/data/chart',
method: 'get'
})
}
export function getOrderCount() {
return request({
url: 'api/yxStoreOrder/orderCount',
method: 'get'
})
}

34
src/api/writeOff.js

@ -0,0 +1,34 @@
import request from '@/utils/request'
export function getCat(params) {
return request({
url: 'api/yxRaiseOrder/writeOff',
method: 'get',
params
})
}
export function addp(data) {
return request({
url: 'api/yxRaiseOrder/writeOff',
method: 'post',
data
})
}
export function delp(id) {
return request({
url: 'api/yxRaiseOrder/writeOff' + id,
method: 'delete'
})
}
export function editp(data) {
return request({
url: 'api/yxRaiseOrder/writeOff',
method: 'put',
data
})
}
export default { addp, editp, delp, getCat }

39
src/api/yxArticle.js

@ -0,0 +1,39 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxArticle',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxArticle/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxArticle',
method: 'put',
data
})
}
export function publish(id) {
return request({
url: 'api/yxArticle/publish/' + id,
method: 'get'
})
}
export function get(id) {
return request({
url: 'api/yxArticle/info/' + id,
method: 'get'
})
}

25
src/api/yxExpress.js

@ -0,0 +1,25 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxExpress',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxExpress/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxExpress',
method: 'put',
data
})
}

27
src/api/yxLive.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxLive',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxLive/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxLive',
method: 'put',
data
})
}
export default { add, edit, del }

34
src/api/yxRaise.js

@ -0,0 +1,34 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxRaise',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxRaise/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxRaise',
method: 'put',
data
})
}
export function gett(datae) {
return request({
url: 'api/yxRaise',
method: 'get',
data: datae
})
}
export default { add, edit, del, gett }

27
src/api/yxRaiseOrder.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxRaiseOrder',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxRaiseOrder/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxRaiseOrder',
method: 'put',
data
})
}
export default { add, edit, del }

12
src/api/yxRaiseOrderDownload.js

@ -0,0 +1,12 @@
import request from '@/utils/request'
export function down(data) {
return request({
url: '/api/yxRaiseOrder/download',
method: 'post',
data
})
}
export default { down }

27
src/api/yxRaiseProject.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxRaiseProject',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxRaiseProject/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxRaiseProject',
method: 'put',
data
})
}
export default { add, edit, del }

34
src/api/yxShippingTemplates.js

@ -0,0 +1,34 @@
import request from '@/utils/request'
export function add(data,id) {
return request({
url: `api/yxShippingTemplates/save/${id}`,
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxShippingTemplates/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxShippingTemplates',
method: 'put',
data
})
}
export function getCity() {
return request({
url: 'api/yxShippingTemplates/citys',
method: 'get'
});
}
export default { add, edit, del,getCity }

74
src/api/yxStoreActivity.js

@ -0,0 +1,74 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreActivity',
method: 'post',
data
})
}
export function gets(data) {
return request({
url: 'api/yxStoreActivity' + '?' + 'page=' + data.page + '&' + 'limit=' + data.limit,
method: 'get',
data
})
}
export function getses(data) {
return request({
url: 'api/yxStoreCategoryShop',
method: 'get',
data
})
}
export function getList(data) {
return request({
url: 'api/yxStoreActivity/getList?' + 'aid=' + data.aid,
method: 'get',
data
})
}
export function getsesInput(data) {
return request({
url: 'api/yxStoreCategoryShop/SearchProduct?' + 'value=' + data.value,
method: 'get',
data
})
}
export function gePtses(data) {
return request({
url: 'api/yxStoreCategoryShop/ProductList',
method: 'post',
data
})
}
export function gePtsesForm(data) {
return request({
url: 'api/yxStoreCategoryShop/PitchProductList ',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxStoreActivity',
method: 'Delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxStoreActivity',
method: 'put',
data
})
}
export default { add, edit, del, gets, getses, gePtses, gePtsesForm, getsesInput, getList }

39
src/api/yxStoreBargain.js

@ -0,0 +1,39 @@
import request from '@/utils/request'
export function List(data) {
return request({
url: 'api/yxStoreBargainConfigList',
method: 'get',
data
})
}
export function Config(data) {
return request({
url: 'api/yxStoreBargainConfig',
method: 'post',
data
})
}
export function add(data) {
return request({
url: 'api/yxStoreBargain',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreBargain/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreBargain',
method: 'put',
data
})
}

24
src/api/yxStoreBargainUser.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreBargainUser',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreBargainUser/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreBargainUser',
method: 'put',
data
})
}

34
src/api/yxStoreCategory.js

@ -0,0 +1,34 @@
import request from '@/utils/request'
export function getCates(params) {
return request({
url: 'api/yxStoreCategory',
method: 'get',
params
})
}
export function add(data) {
return request({
url: 'api/yxStoreCategory',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreCategory/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreCategory',
method: 'put',
data
})
}
export default { add, edit, del, getCates }

64
src/api/yxStoreCategoryShop.js

@ -0,0 +1,64 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreCategoryShop',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxStoreCategoryShop/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxStoreCategoryShop',
method: 'put',
data
})
}
export function getTempList(data) {
return request({
url: 'api/yxStoreActivity/getTempList',
method: 'get',
data: data
})
}
export function get(data) {
return request({
url: 'api/yxStoreCategoryShop/Product?' + 'shopId=' + data.shopId,
method: 'get',
data: data
})
}
export function dels(data) {
return request({
url: 'api/yxStoreCategoryShop/ProductRelieve?' + 'id=' + data.id,
method: 'get',
data: data
})
}
export function delse(data) {
return request({
url: 'api/yxStoreCategoryShop/ProductDel?' + 'id=' + data.id,
method: 'get',
data: data
})
}
export function putse(data) {
return request({
url: 'api/yxStoreCategoryShop',
method: 'put',
data: data
})
}
export default { add, edit, del, get, dels, delse, putse, getTempList }

31
src/api/yxStoreCityWide.js

@ -0,0 +1,31 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreCityWide' + '?' + 'size=' + data.size + '&' + 'limit=' + data.limit,
method: 'get',
data
})
}
export function get(data) {
return request({
url: 'api/yxStoreCityWide/getCityList',
method: 'get',
data
})
}
export function put(data) {
return request({
url: 'api/yxStoreCityWide',
method: 'post',
data
})
}
export function dele(data) {
return request({
url: 'api/yxStoreCityWide/del' + '?' + 'id=' + data.id,
method: 'get',
data
})
}

46
src/api/yxStoreCombination.js

@ -0,0 +1,46 @@
import request from '@/utils/request'
export function List(data) {
return request({
url: 'api/yxStorePinkConfigList',
method: 'get',
data
})
}
export function Config(data) {
return request({
url: 'api/yxStorePinkConfig',
method: 'post',
data
})
}
export function add(data) {
return request({
url: 'api/yxStoreCombination',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreCombination/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreCombination',
method: 'put',
data
})
}
export function onsale(id, data) {
return request({
url: 'api/yxStoreCombination/onsale/' + id,
method: 'post',
data
})
}

39
src/api/yxStoreCoupon.js

@ -0,0 +1,39 @@
import request from '@/utils/request'
export function show(data) {
return request({
url: 'api/yxStoreCoupon/addCouponSlideshow',
method: 'post',
data
})
}
export function showList(data) {
return request({
url: 'api/CouponSlideshowList',
method: 'get',
data
})
}
export function add(data) {
return request({
url: 'api/yxStoreCoupon',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreCoupon/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreCoupon',
method: 'put',
data
})
}

24
src/api/yxStoreCouponIssue.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreCouponIssue',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreCouponIssue/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreCouponIssue',
method: 'put',
data
})
}

24
src/api/yxStoreCouponIssueUser.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreCouponIssueUser',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreCouponIssueUser/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreCouponIssueUser',
method: 'put',
data
})
}

24
src/api/yxStoreCouponUser.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreCouponUser',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreCouponUser/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreCouponUser',
method: 'put',
data
})
}

17
src/api/yxStoreElephant.js

@ -0,0 +1,17 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreElephant?' + 'page=' + data.page + '&' + 'limit=' + data.limit,
method: 'get',
data
})
}
export function del(data) {
return request({
url: 'api/yxStoreElephant/del?' + 'id=' + data.id,
method: 'get',
data
})
}

108
src/api/yxStoreOrder.js

@ -0,0 +1,108 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreOrder',
method: 'post',
data
})
}
export function CodeList(data) {
return request({
url: 'api/getVerifyCodeList?' + 'val=' + data.val,
method: 'get'
})
}
export function getCount(data) {
return request({
url: 'api/yxStoreOrderCount?' + 'shippingType=' + data.shippingType,
method: 'get'
})
}
export function getss(data) {
return request({
url: 'api/yxStoreOrder' + '?' + 'page=' + data.page + '&' + 'uid=' + data.uid + '&' + 'size=' + data.size + '&' + 'sort=' + data.sort + '&' + 'orderStatus=' + -9 + '&' + 'orderType=' + 0,
method: 'get',
data: data
})
}
export function getes(data) {
return request({
url: 'api/yxStoreOrder' + '?' + 'page=' + data.page + '&' + 'uid=' + data.uid + '&' + 'size=' + data.size + '&' + 'sort=' + data.sort + '&' + 'orderStatus=' + -9 + '&' + 'orderType=' + 5,
method: 'get',
data: data
})
}
export function del(id) {
return request({
url: 'api/yxStoreOrder/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreOrder',
method: 'put',
data
})
}
export function editT(data) {
return request({
url: 'api/yxStoreOrder/check',
method: 'put',
data
})
}
export function refund(data) {
return request({
url: 'api/yxStoreOrder/refund',
method: 'post',
data
})
}
export function refuse(data) {
return request({
url: 'api/yxStoreOrder/refundNo',
method: 'post',
data
})
}
export function editOrder(data) {
return request({
url: 'api/yxStoreOrder/edit',
method: 'post',
data
})
}
export function remark(data) {
return request({
url: 'api/yxStoreOrder/remark',
method: 'post',
data
})
}
export function get() {
return request({
url: 'api/yxExpress',
method: 'get'
})
}
export function express(data) {
return request({
url: 'api/yxStoreOrder/express',
method: 'post',
data
})
}

24
src/api/yxStoreOrderStatus.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreOrderStatus',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreOrderStatus/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreOrderStatus',
method: 'put',
data
})
}

24
src/api/yxStorePink.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStorePink',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStorePink/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStorePink',
method: 'put',
data
})
}

113
src/api/yxStoreProduct.js

@ -0,0 +1,113 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreProduct/addOrSave',
method: 'post',
data
})
}
export function yxClass(data) {
return request({
url: 'api/yxClassifyId ',
method: 'get',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreProduct/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreProduct',
method: 'put',
data
})
}
export function onsale(id, data) {
return request({
url: 'api/yxStoreProduct/onsale/' + id,
method: 'post',
data
})
}
export function recovery(id) {
return request({
url: 'api/yxStoreProduct/recovery/' + id,
method: 'delete'
})
}
export function isFormatAttr(id, data) {
return request({
url: 'api/yxStoreProduct/isFormatAttr/' + id,
method: 'post',
data
})
}
export function setAttr(id, data) {
return request({
url: 'api/yxStoreProduct/setAttr/' + id,
method: 'post',
data
})
}
export function clearAttr(id) {
return request({
url: 'api/yxStoreProduct/clearAttr/' + id,
method: 'post'
})
}
export function getAttr(id) {
return request({
url: 'api/yxStoreProduct/attr/' + id,
method: 'get'
})
}
export function getInfo(id) {
return request({
url: 'api/yxStoreProduct/info/' + id,
method: 'get'
})
}
export function addpa(data) {
return request({
url: 'api/yxStoreSource' + '?' + 'page=' + data.page + '&' + 'size=' + data.size,
method: 'get',
data
})
}
export function gets(data) {
return request({
url: 'api/yxStoreCategoryShop',
method: 'get',
data
})
}
export function pospa(data) {
return request({
url: 'api/yxStoreSource',
method: 'post',
data
})
}
export function Content(data) {
return request({
url: 'api/qiNiuContent',
method: 'post',
data
})
}

24
src/api/yxStoreProductReply.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreProductReply',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreProductReply/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreProductReply',
method: 'put',
data
})
}

51
src/api/yxStoreSeckill.js

@ -0,0 +1,51 @@
import request from '@/utils/request'
export function List(data) {
return request({
url: 'api/yxStoreSeckillConfigList',
method: 'get',
data
})
}
export function Config(data) {
return request({
url: 'api/yxStoreSeckillConfig',
method: 'post',
data
})
}
export function add(data) {
return request({
url: 'api/yxStoreSeckill',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreSeckill/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreSeckill',
method: 'put',
data
})
}
export function isFormatAttr(id, data) {
return request({
url: 'api/yxStoreProduct/isFormatAttr/' + id,
method: 'post',
data
})
}
export function getInfo(id) {
return request({
url: 'api/yxStoreProduct/info/' + id,
method: 'get'
})
}

24
src/api/yxStoreVisit.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxStoreVisit',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxStoreVisit/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxStoreVisit',
method: 'put',
data
})
}

32
src/api/yxSystemConfig.js

@ -0,0 +1,32 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxSystemConfig',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxSystemConfig/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxSystemConfig',
method: 'put',
data
})
}
export function get() {
return request({
url: 'api/yxSystemConfig?size=50',
method: 'get'
})
}

31
src/api/yxSystemGroupData.js

@ -0,0 +1,31 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxSystemGroupData',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxSystemGroupData/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxSystemGroupData',
method: 'put',
data
})
}
export function get() {
return request({
url: 'api/yxSystemGroupData',
method: 'get'
})
}

56
src/api/yxSystemStore.js

@ -0,0 +1,56 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxSystemStore',
method: 'post',
data
})
}
export function get() {
return request({
url: 'api/yxSystemStore',
method: 'get'
})
}
export function getAll() {
return request({
url: 'api/yxSystemStore/all',
method: 'get'
})
}
export function getL(data) {
return request({
url: 'api/yxSystemStore/getL',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxSystemStore/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxSystemStore',
method: 'put',
data
})
}
// export function xaiz(data) {
// return request({
// url: 'api/yxStoreOrder/download' + '?' + 'page=' + 0 + '&' + 'size=' + 10000 + '&' + 'sort=' + data.sort + '&' + 'orderStatus=' + -9 + '&' + 'orderType=' + 5+'&'+'createTime='+'&'+'listContent='+data.listContent,
// method: 'get',
// data
// })
// }
export default { getL, add, edit, del, get, getAll }

27
src/api/yxSystemStoreStaff.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxSystemStoreStaff',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxSystemStoreStaff/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxSystemStoreStaff',
method: 'put',
data
})
}
export default { add, edit, del }

24
src/api/yxSystemUserLevel.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxSystemUserLevel',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxSystemUserLevel/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxSystemUserLevel',
method: 'put',
data
})
}

24
src/api/yxSystemUserTask.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxSystemUserTask',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxSystemUserTask/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxSystemUserTask',
method: 'put',
data
})
}

55
src/api/yxUser.js

@ -0,0 +1,55 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxUser',
method: 'post',
data
})
}
export function del(uid) {
return request({
url: 'api/yxUser/' + uid,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxUser',
method: 'put',
data
})
}
export function onStatus(id, data) {
return request({
url: 'api/yxUser/onStatus/' + id,
method: 'post',
data
})
}
export function editp(data) {
return request({
url: 'api/yxUser/money',
method: 'post',
data
})
}
export function switchs(data) {
return request({
url: 'api/noSpreadUid?' + 'uid=' + data.uid,
method: 'get',
data
})
}
export function getSpread(data) {
return request({
url: 'api/yxUser/spread',
method: 'post',
data
})
}

32
src/api/yxUserBill.js

@ -0,0 +1,32 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxUserBill',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxUserBill/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxUserBill',
method: 'put',
data
})
}
export function gett(datas) {
return request({
url: 'api/yxUserBill' + '?' + 'page=' + datas.page + '&' + 'uid=' + datas.uid + '&' + 'size=' + datas.size + '&' + 'linkId=' + '' + '&' + 'nickname=' + '',
method: 'get',
data: datas
})
}
export default { gett, add, edit, del }

24
src/api/yxUserExtract.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxUserExtract',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxUserExtract/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxUserExtract',
method: 'put',
data
})
}

27
src/api/yxUserRecharge.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxUserRecharge',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxUserRecharge/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxUserRecharge',
method: 'put',
data
})
}
export default { add, edit, del }

36
src/api/yxUserRecommend.js

@ -0,0 +1,36 @@
import request from '@/utils/request'
export function gets(params) {
return request({
url: 'api/yxUserRecommend',
method: 'get',
params
})
}
export function add(data) {
return request({
url: 'api/yxUserRecommend',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/yxUserRecommend',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/yxUserRecommend',
method: 'put',
data
})
}
export default { add, edit, del, gets }

11
src/api/yxUserTeamByUid.js

@ -0,0 +1,11 @@
import request from '@/utils/request'
export function getYB(params) {
return request({
url: 'api/yxUser/yxUserTeamByUid',
method: 'get',
params
})
}
export default { getYB }

32
src/api/yxWechatReply.js

@ -0,0 +1,32 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxWechatReply',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxWechatReply/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxWechatReply',
method: 'put',
data
})
}
export function get() {
return request({
url: 'api/yxWechatReply',
method: 'get'
})
}

32
src/api/yxWechatTemplate.js

@ -0,0 +1,32 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxWechatTemplate',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxWechatTemplate/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxWechatTemplate',
method: 'put',
data
})
}
export function get() {
return request({
url: 'api/yxWechatTemplate',
method: 'get'
})
}

24
src/api/yxWechatUser.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxWechatUser',
method: 'post',
data
})
}
export function del(uid) {
return request({
url: 'api/yxWechatUser/' + uid,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxWechatUser',
method: 'put',
data
})
}

17
src/assets/styles/description.scss

@ -0,0 +1,17 @@
.my-blockquote{
margin: 0px 0px 10px;
padding: 15px;
line-height: 22px;
border-left: 5px solid #00437B;
border-radius: 0 2px 2px 0;
background-color: #f2f2f2;
}
.my-code{
position: relative;
padding: 15px;
line-height: 20px;
border-left: 5px solid #ddd;
color: #333;
font-family: Courier New;
font-size: 12px
}

530
src/components/material/index.vue

@ -0,0 +1,530 @@
<template>
<div v-if="type == 'image'">
<ul
v-for="(item,index) in value"
:key="index"
class="el-upload-list el-upload-list--picture-card"
>
<li
tabindex="0"
class="el-upload-list__item is-ready"
:style="'width: '+width+'px;height: '+height+'px'"
>
<div>
<img :src="item" alt class="el-upload-list__item-thumbnail">
<span class="el-upload-list__item-actions">
<span
v-if="index != 0"
class="el-upload-list__item-preview"
@click="moveMaterial(index,'up')"
>
<i class="el-icon-back" />
</span>
<span class="el-upload-list__item-preview" @click="zoomMaterial(index)">
<i class="el-icon-view" />
</span>
<span class="el-upload-list__item-delete" @click="deleteMaterial(index)">
<i class="el-icon-delete" />
</span>
<span
v-if="index != value.length-1"
class="el-upload-list__item-preview"
@click="moveMaterial(index,'down')"
>
<i class="el-icon-right" />
</span>
</span>
</div>
</li>
</ul>
<!-- v-if="num > value.length"判断它显示的照片数量 -->
<div
v-if="num > value.length"
tabindex="0"
class="el-upload el-upload--picture-card"
:style="'width: '+width+'px;height: '+height+'px;'+'line-height:'+height+'px;'"
@click="toSeleteMaterial"
>
<i class="el-icon-plus" />
</div>
<el-dialog append-to-body :visible.sync="dialogVisible" width="35%">
<img :src="url" alt style="width: 100%">
</el-dialog>
<el-dialog title="图片素材库" append-to-body :visible.sync="listDialogVisible" width="70%">
<el-container>
<el-aside width="unset">
<div style="margin-bottom: 10px">
<el-button class="el-icon-plus" size="small" @click="materialgroupAdd()">添加分组</el-button>
</div>
<el-tabs
v-model="materialgroupObjId"
v-loading="materialgroupLoading"
tab-position="left"
@tab-click="tabClick"
>
<el-tab-pane v-for=" item in materialgroupList" :key="item.id" :name="item.id">
<span slot="label">{{ item.name }}</span>
</el-tab-pane>
</el-tabs>
</el-aside>
<el-main>
<el-card>
<div slot="header">
<el-row>
<el-col :span="12">
<span>{{ materialgroupObj.name }}</span>
<span v-if="materialgroupObj.id != '-1'">
<el-button
size="small"
type="text"
class="el-icon-edit"
style="margin-left: 10px;"
@click="materialgroupEdit(materialgroupObj)"
>重命名</el-button>
<el-button
size="small"
type="text"
class="el-icon-delete"
style="margin-left: 10px;color: red"
@click="materialgroupDelete(materialgroupObj)"
>删除</el-button>
</span>
</el-col>
<el-col :span="12" style="text-align: right;">
<el-upload
:action="uploadApi"
:headers="headers"
:file-list="[]"
:on-progress="handleProgress"
:before-upload="beforeUpload"
:on-success="handleSuccess"
:data="{type: 1}"
multiple
>
<el-button size="small" type="primary">批量上传</el-button>
</el-upload>
</el-col>
</el-row>
</div>
<div v-loading="tableLoading">
<el-alert
v-if="tableData.length <= 0"
title="暂无数据"
type="info"
:closable="false"
center
show-icon
/>
<el-row :gutter="5">
<el-checkbox-group v-model="urls" :max="num - value.length">
<el-col v-for="(item,index) in tableData" :key="index" :span="4">
<el-card :body-style="{ padding: '5px' }">
<el-image
style="width: 100%;height: 100px"
:src="item.url"
fit="contain"
:preview-src-list="[item.url]"
:z-index="999"
/>
<div>
<el-row>
<el-col :span="24" class="col-do">
<div class="pic-name">{{ item.name }}</div>
</el-col>
</el-row>
<el-checkbox class="material-name" :label="item.url">选择</el-checkbox>
<el-row>
<el-col :span="24" class="col-do">
<el-button type="text" size="medium" @click="materialDel(item)">删除</el-button>
</el-col>
</el-row>
</div>
</el-card>
</el-col>
</el-checkbox-group>
</el-row>
<el-pagination
:current-page.sync="page.currentPage"
:page-sizes="[12, 24]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
class="pagination"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</el-main>
</el-container>
<span slot="footer" class="dialog-footer">
<el-button @click="listDialogVisible = false"> </el-button>
<el-button type="primary" @click="sureUrls"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getPage as materialgroupPage,
addObj as materialgroupAdd,
delObj as materialgroupDel,
putObj as materialgroupEdit
} from '@/api/tools/materialgroup'
import { getPage, addObj, delObj, putObj } from '@/api/tools/material'
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
export default {
name: 'MaterialList',
props: {
//
value: {
type: Array,
default() {
return []
}
},
//
type: {
type: String,
default() {
return ''
}
},
// 5
// num: {
// type: Number,
// default() {
// return 5
// }
// },
//
width: {
type: Number,
default() {
return 150
}
},
//
height: {
type: Number,
default() {
return 150
}
}
},
data() {
return {
num: 9,
headers: {
Authorization: getToken()
},
dialogVisible: false,
url: '',
listDialogVisible: false,
materialgroupList: [],
materialgroupObjId: '',
materialgroupObj: {},
materialgroupLoading: false,
tableData: [],
resultNumber: 0,
page: {
total: 0, //
currentPage: 1, //
pageSize: 12, //
ascs: [], //
descs: 'create_time' //
},
tableLoading: false,
groupId: null,
urls: []
}
},
computed: {
...mapGetters(['uploadApi'])
},
methods: {
moveMaterial(index, type) {
if (type === 'up') {
const tempOption = this.value[index - 1]
this.$set(this.value, index - 1, this.value[index])
this.$set(this.value, index, tempOption)
}
if (type === 'down') {
const tempOption = this.value[index + 1]
this.$set(this.value, index + 1, this.value[index])
this.$set(this.value, index, tempOption)
}
},
zoomMaterial(index) {
this.dialogVisible = true
this.url = this.value[index]
},
deleteMaterial(index) {
const that = this
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
that.value.splice(index, 1)
that.urls = []
})
},
toSeleteMaterial() {
this.listDialogVisible = true
if (this.tableData.length <= 0) {
this.materialgroupPage()
}
},
materialgroupPage() {
this.materialgroupLoading = true
materialgroupPage({
total: 0, //
currentPage: 1, //
pageSize: 100, //
ascs: [], //
descs: 'create_time' //
}).then((response) => {
this.materialgroupLoading = false
const materialgroupList = response.content
materialgroupList.unshift({
id: '-1',
name: '全部分组'
})
this.materialgroupList = materialgroupList
this.tabClick({
index: 0
})
})
},
materialgroupDelete(materialgroupObj) {
const that = this
this.$confirm('是否确认删除该分组?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
materialgroupDel(materialgroupObj.id).then(function() {
that.$delete(that.materialgroupList, materialgroupObj.index)
})
})
},
materialgroupEdit(materialgroupObj) {
const that = this
this.$prompt('请输入分组名', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputValue: materialgroupObj.name
})
.then(({ value }) => {
materialgroupEdit({
id: materialgroupObj.id,
name: value
}).then(function() {
materialgroupObj.name = value
that.$set(
that.materialgroupList,
materialgroupObj.index,
materialgroupObj
)
})
})
.catch(() => {})
},
materialgroupAdd() {
const that = this
this.$prompt('请输入分组名', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
})
.then(({ value }) => {
materialgroupAdd({
name: value
}).then(function() {
that.materialgroupPage()
})
})
.catch(() => {})
},
tabClick(tab, event) {
this.urls = []
const index = Number(tab.index)
const materialgroupObj = this.materialgroupList[index]
materialgroupObj.index = index
this.materialgroupObj = materialgroupObj
this.materialgroupObjId = materialgroupObj.id
this.page.currentPage = 1
this.page.total = 0
if (materialgroupObj.id !== '-1') {
this.groupId = materialgroupObj.id
} else {
this.groupId = null
}
this.getPage(this.page)
},
getPage(page, params) {
this.tableLoading = true
getPage(
Object.assign(
{
page: page.currentPage - 1,
size: page.pageSize,
descs: this.page.descs,
ascs: this.page.ascs,
sort: 'create_time,desc'
},
{
groupId: this.groupId
}
)
)
.then((response) => {
const tableData = response.content
this.page.total = response.totalElements
this.page.currentPage = page.currentPage
this.page.pageSize = page.pageSize
this.tableData = tableData
this.tableLoading = false
})
.catch(() => {
this.tableLoading = false
})
},
sizeChange(val) {
console.log(val)
this.page.currentPage = 1
this.page.pageSize = val
this.getPage(this.page)
},
pageChange(val) {
console.log(val)
this.page.currentPage = val
// this.page.pageSize = val
this.getPage(this.page)
},
materialRename(item) {
const that = this
this.$prompt('请输入素材名', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputValue: item.name
})
.then(({ value }) => {
putObj({
id: item.id,
name: value
}).then(function() {
that.getPage(that.page)
})
})
.catch(() => {})
},
materialUrl(item) {
// const that = this
this.$prompt('素材链接', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputValue: item.url
})
.then(({ value }) => {})
.catch(() => {})
},
materialDel(item) {
const that = this
this.$confirm('是否确认删除该素材?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
delObj(item.id).then(function() {
that.getPage(that.page)
})
})
},
handleCommand(command) {
const that = this
const s = command.split('-')
putObj({
id: s[0],
groupId: s[1]
}).then(function() {
that.getPage(that.page)
})
},
handleProgress(event, file, fileList) {
console.log(event)
// let uploadProgress = file.percentage.toFixed(0)
// this.uploadProgress = uploadProgress
},
handleSuccess(response, file, fileList) {
const that = this
this.uploadProgress = 0
addObj({
type: '1',
groupId: this.groupId !== '-1' ? this.groupId : null,
name: file.name,
url: response.link
}).then(() => {
this.resultNumber++
if (fileList.length === this.resultNumber) {
that.getPage(that.page)
this.resultNumber = 0
}
})
},
beforeUpload(file) {
const isPic =
file.type === 'image/jpeg' ||
file.type === 'image/png' ||
file.type === 'image/gif' ||
file.type === 'image/jpg'
const isLt2M = file.size / 1024 / 1024 < 2
if (!isPic) {
this.$message.error('上传图片只能是 JPG、JPEG、PNG、GIF 格式!')
return false
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
}
return isPic && isLt2M
},
sureUrls() {
console.log(this.value)
console.log(this.num)
console.log(this.urls)
this.urls.forEach((item) => {
this.$set(this.value, this.value.length, item)
})
this.listDialogVisible = false
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-icon-circle-close {
color: red;
}
.material-name {
padding: 8px 0px;
}
.col-do {
text-align: center;
.pic-name {
overflow: hidden;
padding-top: 7px;
height: 36px;
font-size: 13px;
}
}
.button-do {
padding: unset !important;
font-size: 12px;
}
</style>

95
src/components/mul-pic-upload/index.vue

@ -0,0 +1,95 @@
<template>
<div>
<el-upload
:action="qiNiuUploadApi"
:headers="headers"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:on-success="handleUploadSuccess"
:file-list="imageList"
:before-upload="beforeAvatarUpload"
>
<i class="el-icon-plus" />
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
export default {
props: {
value: {
default: '',
type: String
}
},
data() {
return {
dialogImageUrl: '',
dialogVisible: false,
resourcesUrl: '',
headers: {
'Authorization': getToken()
}
}
},
computed: {
...mapGetters([
'qiNiuUploadApi'
]),
imageList() {
const res = []
if (this.value) {
const imageArray = this.value.split(',')
for (let i = 0; i < imageArray.length; i++) {
res.push({ url: this.resourcesUrl + imageArray[i], response: imageArray[i] })
}
}
this.$emit('input', this.value)
return res
}
},
methods: {
//
handleUploadSuccess(response, file, fileList) {
console.log(file)
console.log(fileList)
const pics = fileList.map(file => {
if ((typeof file.response) === 'object') {
return file.response.data[0]
} else {
return file.response
}
}).join(',')
console.log(pics)
this.$emit('input', pics)
},
//
beforeAvatarUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
}
return isLt2M
},
handleRemove(file, fileList) {
const pics = fileList.map(file => {
return file.response
}).join(',')
this.$emit('input', pics)
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
}
}
}
</script>
<style lang="scss">
</style>

83
src/components/pic-upload-two/index.vue

@ -0,0 +1,83 @@
<template>
<div>
<el-upload
class="pic-uploader-component"
:action="uploadApi"
:headers="headers"
:show-file-list="false"
:on-success="handleUploadSuccess"
:before-upload="beforeAvatarUpload"
>
<img v-if="value" :src="resourcesUrl + value" class="pic">
<i v-else class="el-icon-plus pic-uploader-icon" />
</el-upload>
</div>
</template>
<script>
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
export default {
props: {
value: {
default: '',
type: String
}
},
data() {
return {
resourcesUrl: '',
headers: {
'Authorization': getToken()
}
}
},
computed: {
...mapGetters([
'uploadApi'
])
},
methods: {
//
handleUploadSuccess(response, file, fileList) {
console.log(file)
this.$emit('input', file.response.link)
},
//
beforeAvatarUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
}
return isLt2M
}
}
}
</script>
<style lang="scss" scoped>
.pic-uploader-component .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
.pic-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 100%;
height: 40px;
//line-height: 178px;
text-align: center;
}
.pic {
width: 100%;
height: 40px;
display: block;
}
}
.pic-uploader-component .el-upload:hover {
border-color: #409EFF;
}
</style>

83
src/components/pic-upload/index.vue

@ -0,0 +1,83 @@
<template>
<div>
<el-upload
class="pic-uploader-component"
:action="qiNiuUploadApi"
:headers="headers"
:show-file-list="false"
:on-success="handleUploadSuccess"
:before-upload="beforeAvatarUpload"
>
<img v-if="value" :src="resourcesUrl + value" class="pic">
<i v-else class="el-icon-plus pic-uploader-icon" />
</el-upload>
</div>
</template>
<script>
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
export default {
props: {
value: {
default: '',
type: String
}
},
data() {
return {
resourcesUrl: '',
headers: {
'Authorization': getToken()
}
}
},
computed: {
...mapGetters([
'qiNiuUploadApi'
])
},
methods: {
//
handleUploadSuccess(response, file, fileList) {
console.log(file)
this.$emit('input', file.response.data[0])
},
//
beforeAvatarUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
}
return isLt2M
}
}
}
</script>
<style lang="scss">
.pic-uploader-component .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
.pic-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.pic {
width: 178px;
height: 178px;
display: block;
}
}
.pic-uploader-component .el-upload:hover {
border-color: #409EFF;
}
</style>

499
src/components/singlematerial/index.vue

@ -0,0 +1,499 @@
<template>
<div v-if="type == 'image'">
<div v-if="myValue != ''">
<ul class="el-upload-list el-upload-list--picture-card">
<li tabindex="0" class="el-upload-list__item is-ready" :style="'width: '+width+'px;height: '+height+'px'">
<div>
<img :src="myValue" alt="" class="el-upload-list__item-thumbnail">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-delete" @click="deleteMaterial">
<i class="el-icon-delete" />
</span>
</span>
</div>
</li>
</ul>
</div>
<div v-else tabindex="0" class="el-upload el-upload--picture-card" :style="'width: '+width+'px;height: '+height+'px;'+'line-height:'+height+'px;'" @click="toSeleteMaterial">
<i class="el-icon-plus" />
</div>
<el-dialog
append-to-body
:visible.sync="dialogVisible"
width="35%"
>
<img :src="url" alt="" style="width: 100%">
</el-dialog>
<el-dialog
title="图片素材库"
append-to-body
:visible.sync="listDialogVisible"
width="70%"
>
<el-container>
<el-aside width="unset">
<div style="margin-bottom: 10px">
<el-button
class="el-icon-plus"
size="small"
@click="materialgroupAdd()"
>
添加分组
</el-button>
</div>
<el-tabs v-model="materialgroupObjId" v-loading="materialgroupLoading" tab-position="left" @tab-click="tabClick">
<el-tab-pane
v-for=" item in materialgroupList"
:key="item.id"
:name="item.id"
>
<span slot="label"> {{ item.name }}</span>
</el-tab-pane>
</el-tabs>
</el-aside>
<el-main>
<el-card>
<div slot="header">
<el-row>
<el-col :span="12">
<span>{{ materialgroupObj.name }}</span>
<span v-if="materialgroupObj.id != '-1'">
<el-button size="small" type="text" class="el-icon-edit" style="margin-left: 10px;" @click="materialgroupEdit(materialgroupObj)">重命名</el-button>
<el-button size="small" type="text" class="el-icon-delete" style="margin-left: 10px;color: red" @click="materialgroupDelete(materialgroupObj)">删除</el-button>
</span>
</el-col>
<el-col :span="12" style="text-align: right;">
<el-upload
:action="uploadApi"
:headers="headers"
:file-list="[]"
:on-progress="handleProgress"
:before-upload="beforeUpload"
:on-success="handleSuccess"
:data="{type: 1}"
multiple
>
<el-button size="small" type="primary">批量上传</el-button>
</el-upload>
</el-col>
</el-row>
</div>
<div v-loading="tableLoading">
<el-alert
v-if="tableData.length <= 0"
title="暂无数据"
type="info"
:closable="false"
center
show-icon
/>
<el-row :gutter="5">
<el-checkbox-group v-model="urls" :max="num - myValue.length">
<el-col v-for="(item,index) in tableData" :key="index" :span="4">
<el-card :body-style="{ padding: '5px' }">
<el-image
style="width: 100%;height: 100px"
:src="item.url"
fit="contain"
:preview-src-list="[item.url]"
:z-index="999"
/>
<div>
<el-row>
<el-col :span="24" class="col-do">
<div class="pic-name">{{ item.name }}</div>
</el-col>
</el-row>
<el-checkbox class="material-name" :label="item.url">
选择
</el-checkbox>
<el-row>
<el-col :span="24" class="col-do">
<el-button type="text" size="medium" @click="materialDel(item)">删除</el-button>
</el-col>
</el-row>
</div>
</el-card>
</el-col>
</el-checkbox-group>
</el-row>
<el-pagination
:current-page.sync="page.currentPage"
:page-sizes="[12, 24]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
class="pagination"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</el-main>
</el-container>
<span slot="footer" class="dialog-footer">
<el-button @click="listDialogVisible = false"> </el-button>
<el-button type="primary" @click="sureUrls"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getPage as materialgroupPage, addObj as materialgroupAdd, delObj as materialgroupDel, putObj as materialgroupEdit } from '@/api/tools/materialgroup'
import { getPage, addObj, delObj, putObj } from '@/api/tools/material'
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
export default {
name: 'MaterialList',
props: {
//
value: {
type: String,
default() {
return ''
}
},
//
type: {
type: String,
default() {
return ''
}
},
// 5
num: {
type: Number,
default() {
return 5
}
},
//
width: {
type: Number,
default() {
return 150
}
},
//
height: {
type: Number,
default() {
return 150
}
}
},
data() {
return {
headers: {
Authorization: getToken()
},
dialogVisible: false,
myValue: this.value,
url: '',
listDialogVisible: false,
materialgroupList: [],
materialgroupObjId: '',
materialgroupObj: {},
materialgroupLoading: false,
tableData: [],
resultNumber: 0,
page: {
total: 0, //
currentPage: 1, //
pageSize: 12, //
ascs: [], //
descs: 'create_time'//
},
tableLoading: false,
groupId: null,
urls: []
}
},
computed: {
...mapGetters([
'uploadApi'
])
},
watch: {
value: function(val) {
this.myValue = val
}
},
methods: {
moveMaterial(index, type) {
if (type === 'up') {
const tempOption = this.value[index - 1]
this.$set(this.value, index - 1, this.value[index])
this.$set(this.value, index, tempOption)
}
if (type === 'down') {
const tempOption = this.value[index + 1]
this.$set(this.value, index + 1, this.value[index])
this.$set(this.value, index, tempOption)
}
},
zoomMaterial(index) {
this.dialogVisible = true
this.url = this.value[index]
},
deleteMaterial() {
const that = this
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
that.myValue = ''
that.urls = []
that.$emit('transferUser', that.myValue)
})
},
toSeleteMaterial() {
this.listDialogVisible = true
if (this.tableData.length <= 0) {
this.materialgroupPage()
}
},
materialgroupPage() {
this.materialgroupLoading = true
materialgroupPage({
total: 0, //
currentPage: 1, //
pageSize: 100, //
ascs: [], //
descs: 'create_time'//
}).then(response => {
this.materialgroupLoading = false
const materialgroupList = response.content
materialgroupList.unshift({
id: '-1',
name: '全部分组'
})
this.materialgroupList = materialgroupList
this.tabClick({
index: 0
})
})
},
materialgroupDelete(materialgroupObj) {
const that = this
this.$confirm('是否确认删除该分组?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
materialgroupDel(materialgroupObj.id)
.then(function() {
that.$delete(that.materialgroupList, materialgroupObj.index)
})
})
},
materialgroupEdit(materialgroupObj) {
const that = this
this.$prompt('请输入分组名', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputValue: materialgroupObj.name
}).then(({ value }) => {
materialgroupEdit({
id: materialgroupObj.id,
name: value
}).then(function() {
materialgroupObj.name = value
that.$set(that.materialgroupList, materialgroupObj.index, materialgroupObj)
})
}).catch(() => {
})
},
materialgroupAdd() {
const that = this
this.$prompt('请输入分组名', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
materialgroupAdd({
name: value
}).then(function() {
that.materialgroupPage()
})
}).catch(() => {
})
},
tabClick(tab, event) {
this.urls = []
const index = Number(tab.index)
const materialgroupObj = this.materialgroupList[index]
materialgroupObj.index = index
this.materialgroupObj = materialgroupObj
this.materialgroupObjId = materialgroupObj.id
this.page.currentPage = 1
this.page.total = 0
if (materialgroupObj.id !== '-1') {
this.groupId = materialgroupObj.id
} else {
this.groupId = null
}
this.getPage(this.page)
},
getPage(page, params) {
this.tableLoading = true
getPage(Object.assign({
page: page.currentPage - 1,
size: page.pageSize,
descs: this.page.descs,
ascs: this.page.ascs,
sort: 'create_time,desc'
}, {
groupId: this.groupId
})).then(response => {
const tableData = response.content
this.page.total = response.totalElements
this.page.currentPage = page.currentPage
this.page.pageSize = page.pageSize
this.tableData = tableData
this.tableLoading = false
}).catch(() => {
this.tableLoading = false
})
},
sizeChange(val) {
console.log(val)
this.page.currentPage = 1
this.page.pageSize = val
this.getPage(this.page)
},
pageChange(val) {
console.log(val)
this.page.currentPage = val
// this.page.pageSize = val
this.getPage(this.page)
},
materialRename(item) {
const that = this
this.$prompt('请输入素材名', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputValue: item.name
}).then(({ value }) => {
putObj({
id: item.id,
name: value
}).then(function() {
that.getPage(that.page)
})
}).catch(() => {
})
},
materialUrl(item) {
// const that = this
this.$prompt('素材链接', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputValue: item.url
}).then(({ value }) => {
}).catch(() => {
})
},
materialDel(item) {
const that = this
this.$confirm('是否确认删除该素材?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
delObj(item.id)
.then(function() {
that.getPage(that.page)
})
})
},
handleCommand(command) {
const that = this
const s = command.split('-')
putObj({
id: s[0],
groupId: s[1]
}).then(function() {
that.getPage(that.page)
})
},
handleProgress(event, file, fileList) {
console.log(event)
// let uploadProgress = file.percentage.toFixed(0)
// this.uploadProgress = uploadProgress
},
handleSuccess(response, file, fileList) {
const that = this
this.uploadProgress = 0
addObj({
type: '1',
groupId: this.groupId !== '-1' ? this.groupId : null,
name: file.name,
url: response.link
}).then(() => {
this.resultNumber++
if (fileList.length === this.resultNumber) {
that.getPage(that.page)
this.resultNumber = 0
}
})
},
beforeUpload(file) {
const isPic =
file.type === 'image/jpeg' ||
file.type === 'image/png' ||
file.type === 'image/gif' ||
file.type === 'image/jpg'
const isLt2M = file.size / 1024 / 1024 < 2
if (!isPic) {
this.$message.error('上传图片只能是 JPG、JPEG、PNG、GIF 格式!')
return false
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
}
return isPic && isLt2M
},
sureUrls() {
console.log('this.urls:' + this.urls)
this.myValue = this.urls[0]
this.$emit('input', this.urls[0])
this.listDialogVisible = false
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-icon-circle-close{
color: red;
}
.material-name{
padding: 8px 0px;
}
.col-do{
text-align: center;
.pic-name {
overflow: hidden;
padding-top: 7px;
height: 36px;
font-size: 13px;
}
}
.button-do{
padding: unset!important;
font-size: 12px;
}
</style>

2
src/layout/components/Sidebar/Logo.vue

@ -35,7 +35,7 @@ export default {
},
data() {
return {
title: '农场管理系统',
title: '眼界甄选',
logo: logoImg
}
}

344
src/mixins/crud.js

@ -0,0 +1,344 @@
import {
initData,
download
} from '@/api/data'
import {
parseTime,
downloadFile
} from '@/utils/index'
import checkPermission from '@/utils/permission'
export default {
data() {
return {
// 表格数据
data: [],
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
sort: ['id,desc'],
// 页码
page: 0,
// 每页数据条数
size: 10,
// 总数据条数
total: 0,
// 请求数据的url
url: '',
// 查询数据的参数
params: {},
// 待查询的对象
query: {},
// 等待时间
time: 50,
// 是否为新增类型的表单
isAdd: false,
// 导出的 Loading
downloadLoading: false,
// 表格 Loading 属性
loading: true,
// 删除 Loading 属性
delLoading: false,
delAllLoading: false,
// 弹窗属性
dialog: false,
// Form 表单
form: {},
// 重置表单
resetForm: {},
// 标题
title: ''
}
},
methods: {
parseTime,
downloadFile,
checkPermission,
async init() {
if (!await this.beforeInit()) {
return
}
return new Promise((resolve, reject) => {
this.loading = true
// 请求数据
initData(this.url, this.getQueryParame()).then(data => {
// console.log(data,'ddeeeeee')
this.total = data.totalElements
if (this.url === 'api/yxStoreProduct') {
data.content.map(val => {
val.qrcode = 'http://myshop.api.gznl.top/product/?productId=' + val.id + '&pageType=good&codeType=routine'
})
}
this.data = data.content
// this.classification = data.cateList
// time 毫秒后显示表格
setTimeout(() => {
this.loading = false
}, this.time)
resolve(data)
}).catch(err => {
this.loading = false
reject(err)
})
})
},
beforeInit() {
return true
},
getQueryParame: function() {
return {
page: this.page,
size: this.size,
sort: this.sort,
...this.query,
...this.params
}
},
// 改变页码
pageChange(e) {
this.page = e - 1
this.init()
},
// 改变每页显示数
sizeChange(e) {
this.page = 0
this.size = e
this.init()
},
// 预防删除第二页最后一条数据时,或者多选删除第二页的数据时,页码错误导致请求无数据
dleChangePage(size) {
if (size === undefined) {
size = 1
}
if (this.data.length === size && this.page !== 0) {
this.page = this.page - 1
}
},
// 查询方法
toQuery() {
this.page = 0
this.init()
},
/**
* 通用的提示封装
*/
submitSuccessNotify() {
this.$notify({
title: '提交成功',
type: 'success',
duration: 2500
})
},
addSuccessNotify() {
this.$notify({
title: '新增成功',
type: 'success',
duration: 2500
})
},
editSuccessNotify() {
this.$notify({
title: '编辑成功',
type: 'success',
duration: 2500
})
},
delSuccessNotify() {
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
},
notify(title, type) {
this.$notify({
title: title,
type: type,
duration: 2500
})
},
/**
* 删除前可以调用 beforeDelMethod 做一些操作
*/
beforeDelMethod() {
return true
},
/**
* 通用的删除
*/
delMethod(id) {
if (!this.beforeDelMethod()) {
return
}
this.delLoading = true
this.crudMethod.del(id).then(() => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.delSuccessNotify()
this.afterDelMethod()
this.init()
}).catch(() => {
this.delLoading = false
this.$refs[id].doClose()
})
},
afterDelMethod() {},
/**
* 多选删除提示
*/
beforeDelAllMethod() {
this.$confirm('你确定删除选中的数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.delAllMethod()
})
},
/**
* 多选删除
*/
delAllMethod() {
this.delAllLoading = true
const data = this.$refs.table.selection
const ids = []
for (let i = 0; i < data.length; i++) {
ids.push(data[i].id)
}
this.crudMethod.delAll(ids).then(() => {
this.delAllLoading = false
this.dleChangePage(ids.length)
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(() => {
this.delAllLoading = false
})
},
/**
* 显示新增弹窗前可以调用该方法
*/
beforeShowAddForm() {},
/**
* 显示新增弹窗
*/
showAddFormDialog() {
this.isAdd = true
this.resetForm = JSON.parse(JSON.stringify(this.form))
this.beforeShowAddForm()
this.dialog = true
},
/**
* 显示编辑弹窗前可以调用该方法
*/
beforeShowEditForm(data) {},
/**
* 显示编辑弹窗
*/
showEditFormDialog(data = '') {
this.isAdd = false
if (data) {
this.resetForm = JSON.parse(JSON.stringify(this.form))
this.form = JSON.parse(JSON.stringify(data))
}
this.beforeShowEditForm(data)
this.dialog = true
},
/**
* 新增方法
*/
addMethod() {
this.crudMethod.add(this.form).then(() => {
this.addSuccessNotify()
this.loading = false
this.afterAddMethod()
this.cancel()
this.init()
}).catch(() => {
this.loading = false
this.afterAddErrorMethod()
})
},
/**
* 新增后可以调用该方法
*/
afterAddMethod() {},
/**
* 新增失败后调用该方法
*/
afterAddErrorMethod() {},
/**
* 通用的编辑方法
*/
editMethod() {
this.crudMethod.edit(this.form).then(() => {
this.editSuccessNotify()
this.loading = false
this.afterEditMethod()
this.cancel()
this.init()
}).catch(() => {
this.loading = false
})
},
/**
* 编辑后可以调用该方法
*/
afterEditMethod() {},
/**
* 提交前可以调用该方法
*/
beforeSubmitMethod() {
return true
},
/**
* 提交
*/
submitMethod() {
if (!this.beforeSubmitMethod()) {
return
}
if (this.$refs['form']) {
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true
if (this.isAdd) {
this.addMethod()
} else this.editMethod()
}
})
}
},
/**
* 隐藏弹窗
*/
cancel() {
this.dialog = false
if (this.$refs['form']) {
this.$refs['form'].clearValidate()
this.form = this.resetForm
}
},
/**
* 获取弹窗的标题
*/
getFormTitle() {
return this.isAdd ? `新增${this.title}` : `编辑${this.title}`
},
/**
* 通用导出
*/
downloadMethod() {
this.beforeInit()
this.downloadLoading = true
download(this.url + '/download', this.params).then(result => {
this.downloadFile(result, this.title + '数据', 'xlsx')
this.downloadLoading = false
}).catch(() => {
this.downloadLoading = false
})
}
}
}

561
src/views/activity/Activitylist/form.vue

@ -0,0 +1,561 @@
<template>
<div class="bodys">
<h4
style="
margin-left: 15px;
font-size: 20px;
color: #323335;
margin-top: 10px;
margin-bottom: 20px;
"
>
新增活动
</h4>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="120px"
class="demo-ruleForm"
>
<el-form-item label="活动ID" prop="indexId">
<el-input v-model="ruleForm.indexId" style="width: 500px" onkeyup="value=value.replace(/[^\d]/g,'')"></el-input>
</el-form-item>
<el-form-item label="活动名称" prop="name">
<el-input v-model="ruleForm.name" style="width: 500px"></el-input>
</el-form-item>
<el-form-item label="活动介绍" prop="intro">
<el-input
type="textarea"
v-model="ruleForm.intro"
style="width: 500px"
></el-input>
</el-form-item>
<el-form-item label="活动时间" required>
<el-col :span="3.5">
<el-form-item prop="activityStartTime">
<el-date-picker
type="date"
placeholder="选择活动开始日期"
v-model="ruleForm.activityStartTime"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
<el-col class="line" :span="1">----------</el-col>
<el-col :span="3.5">
<el-form-item prop="activityEndTime">
<el-date-picker
type="date"
placeholder="选择活动结束日期"
v-model="ruleForm.activityEndTime"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="活动首页图片:" prop="img">
<single-pic
v-model="ruleForm.img"
type="image"
:num="1"
:width="150"
:height="150"
style="float: left"
/>
</el-form-item>
<el-form-item label="活动分享图:" prop="sharingImg">
<single-pic
v-model="ruleForm.sharingImg"
type="image"
:num="1"
:width="150"
:height="150"
style="float: left"
/>
</el-form-item>
<el-form-item label="活动海报图:" prop="activityPoster">
<single-pic
v-model="ruleForm.activityPoster"
type="image"
:num="1"
:width="150"
:height="150"
style="float: left"
/>
</el-form-item>
<el-form-item label="活动颜色选择" prop="color">
<colorPicker
v-model="ruleForm.color"
v-on:change="headleChangeColor"
class="colores"
></colorPicker>
<el-input
v-model="ruleForm.color"
placeholder="请输入活动颜色"
style="width: 100px"
></el-input>
</el-form-item>
<el-form-item label="活动店铺选择" prop="idList">
<el-button type="text" @click="ShopSelection">选择店铺</el-button>
<!-- <el-button v-for="(item,index) in optio" :key="index" type="text" @click="ShopSelection(index)">选择店铺</el-button> -->
<!-- <el-button type="primary" icon="el-icon-circle-plus" size="mini" @click="addTo"></el-button> -->
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('ruleForm')"
>立即创建</el-button
>
<el-button @click="resetForm('ruleForm')">重置</el-button>
</el-form-item>
</el-form>
<h4
style="
margin-left: 15px;
font-size: 20px;
color: #323335;
margin-top: 10px;
margin-bottom: 20px;
"
>
已勾选商品
</h4>
<div style="margin-bottom:20px">
<el-button
type="danger"
size="mini"
icon="el-icon-delete-solid"
:disabled="disabl"
@click="BatchDelete"
style="margin-left:15px"
>
批量删除
</el-button>
<el-table :data="tableDataCheck" style="width: 100%" max-height="500" @selection-change="handleSChange">
<el-table-column
type="selection"
width="55"
></el-table-column>
<el-table-column prop="paiban" label="商品分类" align="center">
</el-table-column>
<el-table-column prop="id" label="商品ID" align="center">
</el-table-column>
<el-table-column label="商品图片" align="center">
<template slot-scope="scope">
<a
:href="scope.row.image"
style="color: #42b983"
target="_blank"
>
<img
:src="scope.row.image"
alt="点击打开"
class="el-avatar"
/>
</a>
</template>
</el-table-column>
<el-table-column
property="store_name"
label="商品名称"
align="center"
></el-table-column>
<el-table-column
property="price"
label="商品价格(元)"
align="center"
></el-table-column>
</el-table>
</div>
<!-- 新增活动 -->
<el-dialog
title="新增活动"
:visible.sync="dialogFormVisible"
:before-close="handleClose"
>
<div style="margin-bottom: 10px">
<el-input
v-model="input"
placeholder="请输入要搜索的商品名称"
style="width: 200px"
></el-input>
<el-button type="primary" icon="el-icon-zoom-in" @click="products">搜索</el-button>
<el-select v-model="paiban" @change="qihuan" placeholder="请选择商品分类" style="margin-left:20px">
<el-option
v-for="(item,index) in options"
:key="index"
:label="item"
:value="index">
</el-option>
</el-select>
</div>
<div class="dial">
<div style="flex: 2">
<el-table
:data="tableD"
style="width: 100%"
max-height="500"
@selection-change="handleSelec"
>
<el-table-column
type="selection"
width="55"
></el-table-column>
<el-table-column prop="shopName" label="店铺名称" align="center">
</el-table-column>
</el-table>
</div>
<div style="flex: 1"></div>
<div style="flex: 5">
<el-table
:data="tableData"
style="width: 100%"
max-height="395"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
>
</el-table-column>
<el-table-column
property="id"
label="商品ID"
align="center"
></el-table-column>
<el-table-column label="商品图片" align="center">
<template slot-scope="scope">
<a
:href="scope.row.image"
style="color: #42b983"
target="_blank"
>
<img
:src="scope.row.image"
alt="点击打开"
class="el-avatar"
/>
</a>
<!-- <img :src="scope.row.img" alt="" style="width:50px;height:50px;border-radius: 50px"> -->
</template>
</el-table-column>
<el-table-column
property="store_name"
label="商品名称"
align="center"
></el-table-column>
<el-table-column
property="price"
label="商品价格(元)"
align="center"
></el-table-column>
</el-table>
<el-footer
style="height: 60px; width: 100%; background-color: #f6f6f6"
>
<div style="float: left"></div>
<el-pagination
:total="total"
:current-page="plamses.page"
style="margin-top: 15px; float: right"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</el-footer>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="dialogForm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getses, gePtses, add, gePtsesForm,getsesInput } from "@/api/yxStoreActivity";
import singlePic from "@/components/singlematerial";
export default {
inject: ["reload"],
components: {
singlePic,
},
data() {
return {
paiban:0,
dialogFormVisible: false,
input: "",
ruleForm: {
indexId:null,
name: "",
intro: "",
color: "#ff0000",
idList: [],
img: "",
sharingImg:'',
activityPoster:'',
activityStartTime: "",
activityEndTime: "",
idInfo:[
{idList:'',ids:''}
]
},
rules: {
indexId: [{ required: true, message: "请输入活动ID", trigger: "blur" }],
name: [{ required: true, message: "请输入活动名称", trigger: "blur" }],
idList: [
{ required: true, message: "请选择活动店铺", trigger: "change" },
],
intro: [{ required: true, message: "请填写活动介绍", trigger: "blur" }],
activityStartTime: [
{ required: true, message: "请填写活动开始时间", trigger: "blur" },
],
activityEndTime: [
{ required: true, message: "请填写活动结束时间", trigger: "blur" },
],
img: [{ required: true, message: "请填写活动图片", trigger: "blur" }],
sharingImg: [{ required: true, message: "请填写活动分享图片", trigger: "blur" }],
activityPoster: [{ required: true, message: "请填写活动海报图片", trigger: "blur" }],
},
tableD: [],
total: 0,
tableData: [],
tableDataCheck: [],
plamses: {
shopId: [],
page: 1,
limit: 10,
},
options:[],
optio:[],
disabl:true,
multipleSelection:[],
};
},
methods: {
BatchDelete(){
console.log(this.multipleSelection)
let val = this.multipleSelection
val.forEach((val,index)=>{
this.tableDataCheck.forEach((v,i)=>{
if(val.id === v.id){
this.tableDataCheck.splice(i,1)
}
})
this.ruleForm.idList.forEach((vs,is)=>{
if(val.id === vs){
this.ruleForm.idList.splice(is,1)
}
})
// this.ruleForm.idInfo.forEach((ve,ise)=>{
// console.log(ve,ise,'741852')
// if(val.id ===ve.idList){
// this.ruleForm.idInfo.splice(ise,1)
// }
// })
})
},
handleSChange(val){
this.multipleSelection = val
console.log(val,'不知道')
if(val.length > 0){
this.disabl = false
}else{
this.disabl = true
}
},
products(){
let plams = {
value:this.input
}
console.log(plams)
getsesInput(plams).then(res=>{
console.log(res)
this.tableData = res
})
},
sizeChange(val) {
this.plamses.limit = val;
this.gerts();
},
pageChange(val) {
this.plamses.page = val;
this.gerts();
},
addTo(){
this.optio.push('admin')
console.log(this.optio)
},
ShopSelection(val) {
this.dialogFormVisible = true;
this.getses();
},
getses() {
console.log(this.plamses.shopId, "店铺的ID");
let plams = {
page: 0,
size: 100,
};
getses(plams).then((res) => {
console.log(res.content, "商铺");
this.tableD = res.content;
this.options = res.paiban
// this.tableD.forEach((item1) => {
// this.plamses.shopId.forEach((item2) => {
// if (item1.id === item2) {
// this.$refs.multipleTable.toggleRowSelection(item2, true);
// }
// });
// });
});
},
handleSelec(val) {
console.log(val);
this.plamses.shopId = [];
val.forEach((item) => {
this.plamses.shopId.push(item.id);
});
this.gerts();
},
gerts() {
console.log(this.ruleForm.idList, "查看数据");
gePtses(this.plamses).then((res) => {
console.log(res);
this.total = Number(res.code);
this.tableData = res.list;
this.tableData.forEach((item1) => {
console.log(item1);
// this.ruleForm.idList.forEach((item2) => {
// console.log(item2, "");
// if (item1.id === item2) {
// this.$refs.multipleTable.toggleRowSelection(item2, true);
// }
// });
});
});
},
qihuan(val){
console.log(val)
this.ruleForm.idList = [];
},
handleSelectionChange(val) {
// this.ruleForm.idList = [];
val.forEach((item) => {
this.ruleForm.idList.push(item.id);
});
},
dialogForm() {
this.dialogFormVisible = false;
let plams = {
productId: this.ruleForm.idList,
};
gePtsesForm(plams).then((res) => {
console.log(res);
res.map(item=>{
item.paiban=this.paiban
})
res.forEach(item=>{
this.tableDataCheck.push(item);
})
console.log(this.tableDataCheck,'数据')
// this.plamses.shopId = [];
// this.ruleForm.idList = [];
console.log(this.ruleForm,'看看是什么玩意')
});
// this.reload();
},
handleClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
done();
this.reload();
})
.catch((_) => {});
},
headleChangeColor() {
console.log(this.form);
},
add() {
this.ruleForm.activityStartTime = String(Date.parse(
this.ruleForm.activityStartTime
));
this.ruleForm.activityEndTime = String(Date.parse(this.ruleForm.activityEndTime));
this.ruleForm.indexId = Number(this.ruleForm.indexId)
this.ruleForm.idInfo.forEach(item=>{
this.tableDataCheck.forEach(item2=>{
let plamt = {
idList : item2.id,
ids : item2.paiban
}
this.ruleForm.idInfo.push(
plamt
)
})
})
this.ruleForm.idInfo.shift()
let pilamse = []
this.tableDataCheck.forEach(iter=>{
console.log(iter)
pilamse.push(iter.id)
})
this.ruleForm.idList = pilamse
console.log(this.ruleForm,'到底哪里出了问题')
add(this.ruleForm).then((res) => {
console.log(res);
if (res == true) {
this.$message({
showClose: true,
message: "新增成功",
type: "success",
});
this.$router.push({
path: "/activity/Activitylist/",
});
}
});
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.ruleForm,777);
this.add();
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.reload()
},
},
};
</script>
<style scoped>
.bodys {
padding: 15px;
}
.colores {
cursor: pointer;
}
.dial {
display: flex;
width: 100%;
}
</style>

0
src/views/activity/Activitylist/forms.vue

246
src/views/activity/Activitylist/index.vue

@ -0,0 +1,246 @@
<template>
<div class="body">
<div class="body-top">
<el-button type="primary" icon="el-icon-check" @click="NewActivities"
>新增</el-button
>
</div>
<div>
<el-table :data="tableData" style="width: 100%" v-loading="loading">
<el-table-column prop="id" label="活动ID" align="center">
</el-table-column>
<el-table-column prop="img" label="活动图片" align="center">
<template slot-scope="scope">
<a :href="scope.row.img" style="color: #42b983" target="_blank">
<img :src="scope.row.img" alt="点击打开" class="el-avatar">
</a>
</template>
</el-table-column>
<el-table-column prop="sharingImg" label="活动分享图片" align="center">
<template slot-scope="scope">
<a :href="scope.row.sharingImg" style="color: #42b983" target="_blank">
<img :src="scope.row.sharingImg" alt="点击打开" class="el-avatar">
</a>
</template>
</el-table-column>
<el-table-column prop="name" label="开始时间" align="center">
<template slot-scope="scope">
<span>{{formatTime(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="结束时间" align="center">
<template slot-scope="scope">
<span>{{formatTime(scope.row.endTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="活动名称" align="center">
</el-table-column>
<el-table-column prop="intro" label="活动介绍" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button slot="reference" type="text" @click="ViewProduct(scope.row)">查看商品</el-button>
<!-- <el-button type="text" @click="handleEdit(scope.row)"
>修改</el-button
> -->
<!-- <el-button
size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button> -->
<el-popover
placement="top"
title="确定删除?"
width="200"
:ref="'popover-' + scope.row.id"
trigger="click"
>
<div style="text-align: right; margin: 0">
<el-button
type="primary"
size="mini"
@click="deleteDeviceRow(scope.row)"
>确定</el-button
>
<el-button size="mini" @click="pCancel(scope.row.id)"
>取消</el-button
>
</div>
<el-button slot="reference" type="text">删除</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<el-footer
style="height: 60px; width: 100%;"
>
<div style="float: left"></div>
<el-pagination
:total="total"
:current-page="plamses.page"
style="margin-top: 15px; float: right"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</el-footer>
</div>
<el-dialog title="查看商品" :visible.sync="dialogTableVisible">
<div v-for="(item,indexs) in gridData" :key="indexs" style="margin-top:50px;margin-bottom:50px">
<h4
style="
margin-left: 15px;
font-size: 20px;
color: #323335;
margin-top: 10px;
margin-bottom: 20px;
"
v-if="indexs ==0"
>
{{'第一栏'}}
</h4>
<h4
style="
margin-left: 15px;
font-size: 20px;
color: #323335;
margin-top: 10px;
margin-bottom: 20px;
"
v-if="indexs ==1"
>
{{'第二栏'}}
</h4>
<h4
style="
margin-left: 15px;
font-size: 20px;
color: #323335;
margin-top: 10px;
margin-bottom: 20px;
"
v-if="indexs ==2"
>
{{'第三栏'}}
</h4>
<el-table :data="item" >
<el-table-column property="id" label="ID" align="center" ></el-table-column>
<el-table-column prop="image" label="商品图片" align="center">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank">
<img :src="scope.row.image" alt="点击打开" class="el-avatar">
</a>
</template>
</el-table-column>
<el-table-column property="store_name" label="商品名称" align="center"></el-table-column>
<el-table-column property="price" label="商品价格" align="center"></el-table-column>
</el-table>
</div>
</el-dialog>
</div>
</template>
<script>
import { gets, del, getList } from '@/api/yxStoreActivity'
import { formatTime } from "@/utils/index";
export default {
inject: ["reload"],
data() {
return {
loading: false,
dialogTableVisible:false,
tableData: [],
gridData: [],
total:0,
plamses: {
page: 1,
limit: 10,
},
};
},
created(){
this.gets()
},
methods: {
formatTime,
NewActivities() {
this.$router.push({
path:'/activity/Form/'
})
},
ViewProduct(row){ //
this.gridData = []
console.log(row)
this.dialogTableVisible = true
let plams = {
aid:row.id
}
getList(plams).then(res=>{
for(let i in res ){
this.gridData.push(res[i])
}
})
},
gets(){
gets(this.plamses).then(res=>{
console.log(res)
this.tableData = res.content
this.total = Number(res.totalElements)
})
},
deleteDeviceRow(row){
console.log(row,'删除')
let plams = {
ids:[]
}
plams.ids.push(Number(row.id))
del(plams).then(res =>{
console.log(res)
})
this.reload()
},
pCancel(row){
console.log(row,'取消删除')
this.reload()
},
handleEdit(row){
console.log(row,'修改')
localStorage.setItem('rows',JSON.stringify(row))
this.$router.push({
path:'/activity/Forms/' + row.id,
})
},
sizeChange(val){
console.log(val,'条')
this.plamses.limit = val
this.gets()
},
pageChange(val){
console.log(val)
this.plamses.page = val
this.gets()
}
},
};
</script>
<style scoped>
.body {
padding: 15px;
}
.body-top {
margin-bottom: 10px;
}
</style>

101
src/views/activity/activityZone/index.vue

@ -0,0 +1,101 @@
<template>
<div class="body">
<el-input
class="input"
v-model="input"
placeholder="请输入要修改的活动商品id"
></el-input>
<el-button type="primary" @click="comma">修改活动商品ID</el-button>
<p class="comma">请输入需要修改的活动商品ID请以","分隔开来</p>
<div>
<el-table
v-loading="loading"
:default-sort="{prop: 'sortNum', order: 'ascending'}"
:data="list"
border
align="left"
>
<el-table-column
show-overflow-tooltip
v-for="(item, index) in col"
:key="`col_${index}`"
:prop="col[index].prop"
:label="item.label"
>
<template slot-scope="scope">
<p>{{scope.row[item.prop]}}</p>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import Sortable from "sortablejs";
export default {
components: {
Sortable
},
data() {
return {
input: "",
col: [
{
label: '位置',
prop: 'location'
},
{
label: '序号',
prop: 'sortNum'
},
{
label: '经办人',
prop: 'operator'
},
{
label: '操作',
prop: 'isClick'
}
]
};
},
mounted(){
this.rowDrop()
},
methods: {
comma() {
console.log(this.input);
},
rowDrop() {
const tbody = document.querySelector('.el-table__body-wrapper tbody')
const _this = this
Sortable.create(tbody, {
onEnd({ newIndex, oldIndex }) {
const currRow = _this.list.splice(oldIndex, 1)[0]
_this.list.splice(newIndex, 0, currRow)
_this.list = _this.list.filter(({ adId }) => adId !== 0)
_this.list.forEach((item, index) => {
_this.sortString += item.adId + ':' + (index + 1) + ','
})
_this.sortString = _this.sortString.substr(0, _this.sortString.length - 1)
}
})
}
},
};
</script>
<style scoped>
.body {
padding: 15px;
}
.input {
width: 70%;
margin-right: 15px;
}
.comma {
font-weight: 700;
font-size: 14px;
color: red;
}
</style>

88
src/views/activity/bargain/HowToPlay.vue

@ -0,0 +1,88 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" title="砍价玩法说明" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-form-item label="说明">
<editor v-model="form.bargainStatement" />
</el-form-item>
<el-form-item label="玩法">
<editor v-model="form.bargainRegulations" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
// import { List,Config } from '@/api/yxStoreCombination'
import { List , Config } from '@/api/yxStoreBargain'
import editor from '../../components/Editor'
import MaterialList from '@/components/material'
import cgood from '@/views/components/goodss'
export default {
components: { editor, MaterialList ,cgood },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
bargainStatement:'',
bargainRegulations:''
},
rules: {
}
}
},
created(){
this.List()
},
methods: {
cancel(){
this.dialog = false
},
List(){
List().then(res=>{
console.log(res,'iopioipo')
this.form = res
})
},
doSubmit() {
// this.loading = true
this.Config()
},
Config() {
console.log(this.form)
Config(this.form).then(res => {
console.log(res)
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.dialog = false
}).catch(err => {
this.dialog = false
console.log(err.response.data.message)
})
},
}
}
</script>
<style scoped>
</style>

283
src/views/activity/bargain/form.vue

@ -0,0 +1,283 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="handleClose" :visible.sync="dialog" title=" 开启砍价" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-form-item label="砍价名称">
<el-input v-model="form.title" style="width: 500px;" />
</el-form-item>
<!-- <el-form-item label="砍价简介">
<el-input v-model="form.info" style="width: 500px;" rows="5" type="textarea" />
</el-form-item> -->
<el-form-item label="单位">
<el-input v-model="form.unitName" style="width: 500px;" />
</el-form-item>
<el-form-item label="活动开始时间">
<template>
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="活动结束时间">
<template>
<el-date-picker
v-model="form.stopTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<!-- <el-form-item label="砍价产品主图片">
<MaterialList v-model="form.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item> -->
<el-form-item label="产品主图片" style="display: block;">
<!-- <el-input v-model="forms.productId" autocomplete="off"></el-input> -->
<cgood @selectGoods="getGoods" v-model="form.imageArr"></cgood>
</el-form-item>
<el-form-item label="砍价产品轮播图">
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
<!-- <el-form-item label="库存">
<el-input-number v-model="form.stock" />
</el-form-item> -->
<el-form-item label="虚假销量">
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.sales" />
</el-form-item>
<el-form-item label="砍价起始额">
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.price" />
</el-form-item>
<el-form-item label="最终付款额">
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.minPrice" />
</el-form-item>
<!-- <el-form-item label="限购">
<el-input-number v-model="form.num" />
</el-form-item> -->
<!-- <el-form-item label="单次砍最高价">
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.bargainMaxPrice" />
</el-form-item>
<el-form-item label="单次砍最低价">
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.bargainMinPrice" />
</el-form-item> -->
<el-form-item label="砍价次数">
<el-input-number v-model="form.needNum" />
</el-form-item>
<!-- <el-form-item label="用户每次砍价的次数">
<el-input-number v-model="form.bargainNum" />
</el-form-item> -->
<!-- <el-form-item label="成本价">
<el-input-number v-model="form.cost" />
</el-form-item> -->
<!-- <el-form-item label="排序">
<el-input-number v-model="form.sort" />
</el-form-item> -->
<el-form-item label="砍价状态">
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0" style="width: 110px;">关闭</el-radio>
</el-form-item>
<!-- <el-form-item label="是否包邮">
<el-radio v-model="form.isPostage" :label="1"></el-radio>
<el-radio v-model="form.isPostage" :label="0" style="width: 110px;"></el-radio>
</el-form-item> -->
<!-- <el-form-item v-if="form.isPostage ===0" label="邮费">
<el-input-number v-model="form.postage" />
</el-form-item> -->
<!-- <el-form-item label="砍价规则">
<editor v-model="form.rule" />
</el-form-item> -->
<!-- <el-form-item label="砍价详情">
<editor v-model="form.description" />
</el-form-item> -->
<el-form-item label="规则">
<editor v-model="form.info" />
</el-form-item>
<!-- <el-form-item label="玩法">
<editor v-model="form.regulations" />
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreBargain'
import editor from '../../components/Editor'
import MaterialList from '@/components/material'
import cgood from '@/views/components/goodss'
export default {
components: { editor, MaterialList,cgood },
inject: ["reload"],
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
productId: '',
title: '',
image: '',
unitName: '',
stock: 1,
sales: '',
images: '',
imageArr: [],
sliderImageArr: [],
startTime: '',
stopTime: '',
storeName: '',
price: '',
minPrice: '',
num: 1,
bargainMaxPrice: 0,
bargainMinPrice: 0,
bargainNum: 1,
status: '',
// description: '<p></p>',
giveIntegral: '',
info: '',
cost: 0,
sort: 0,
isHot: 0,
isDel: 0,
addTime: '',
isPostage: 1,
postage: '',
// rule: '',
look: '',
share: '',
startTimeDate: '',
endTimeDate: '',
info:'',
needNum:''
// regulations:''
},
rules: {
}
}
},
watch: {
// 'form.imageArr': function(val) {
// if (val) {
// this.form.image = val.join(',')
// }
// },
'form.sliderImageArr': function(val) {
if (val) {
this.form.images = val.join(',')
}
}
},
methods: {
getGoods(val){
console.log(val[0].id,'商品id关联')
this.form.productId = val[0].id
this.form.image = val[0].image
this.form.imageArr = val
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
this.reload()
})
.catch(_ => {});
},
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
this.doEdit()
},
// doAdd() {
// add(this.form).then(res => {
// this.resetForm()
// this.$notify({
// title: '',
// type: 'success',
// duration: 2500
// })
// this.loading = false
// this.$parent.init()
// }).catch(err => {
// this.loading = false
// console.log(err.response.data.message)
// })
// },
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
this.reload()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
productId: '',
title: '',
image: '',
unitName: '',
stock: '',
sales: '',
images: '',
imageArr: [],
sliderImageArr: [],
startTime: '',
stopTime: '',
storeName: '',
price: '',
minPrice: '',
num: 1,
bargainMaxPrice: 0,
bargainMinPrice: 0,
bargainNum: 1,
status: '',
// description: '<p></p>',
giveIntegral: '',
info: '',
cost: 0,
sort: '',
isHot: '',
isDel: '',
addTime: '',
isPostage: '',
postage: '',
// rule: '',
look: '',
share: '',
info:'',
needNum:''
// regulations:''
}
}
}
}
</script>
<style scoped>
</style>

286
src/views/activity/bargain/formse.vue

@ -0,0 +1,286 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="handleClose" :visible.sync="dialog" title=" 新增砍价" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-form-item label="砍价名称">
<el-input v-model="form.title" style="width: 500px;" />
</el-form-item>
<!-- <el-form-item label="砍价简介">
<el-input v-model="form.info" style="width: 500px;" rows="5" type="textarea" />
</el-form-item> -->
<el-form-item label="单位">
<el-input v-model="form.unitName" style="width: 500px;" />
</el-form-item>
<el-form-item label="活动开始时间">
<template>
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="活动结束时间">
<template>
<el-date-picker
v-model="form.stopTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<!-- <el-form-item label="砍价产品主图片">
<MaterialList v-model="form.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item> -->
<el-form-item label="产品主图片" style="display: block;">
<!-- <el-input v-model="forms.productId" autocomplete="off"></el-input> -->
<cgood @selectGoods="getGoods" v-model="form.imageArr"></cgood>
</el-form-item>
<el-form-item label="砍价产品轮播图">
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
<!-- <el-form-item label="库存">
<el-input-number v-model="form.stock" />
</el-form-item> -->
<el-form-item label="虚假销量">
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.sales" />
</el-form-item>
<el-form-item label="砍价起始额">
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.price" />
</el-form-item>
<el-form-item label="最终付款额">
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.minPrice" />
</el-form-item>
<!-- <el-form-item label="限购">
<el-input-number v-model="form.num" />
</el-form-item> -->
<!-- <el-form-item label="单次砍最高价">
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.bargainMaxPrice" />
</el-form-item>
<el-form-item label="单次砍最低价" >
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.bargainMinPrice" />
</el-form-item> -->
<el-form-item label="砍价次数">
<el-input-number v-model="form.needNum" />
</el-form-item>
<!-- <el-form-item label="砍价次数" >
<el-input style="width:120px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.needNum" />
</el-form-item> -->
<!-- <el-form-item label="用户每次砍价的次数">
<el-input-number v-model="form.bargainNum" />
</el-form-item> -->
<!-- <el-form-item label="成本价">
<el-input-number v-model="form.cost" />
</el-form-item> -->
<!-- <el-form-item label="排序">
<el-input-number v-model="form.sort" />
</el-form-item> -->
<el-form-item label="砍价状态" >
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0" style="width: 110px;">关闭</el-radio>
</el-form-item>
<!-- <el-form-item label="是否包邮">
<el-radio v-model="form.isPostage" :label="1"></el-radio>
<el-radio v-model="form.isPostage" :label="0" style="width: 110px;"></el-radio>
</el-form-item> -->
<!-- <el-form-item v-if="form.isPostage ===0" label="邮费">
<el-input-number v-model="form.postage" />
</el-form-item> -->
<!-- <el-form-item label="砍价规则">
<editor v-model="form.rule" />
</el-form-item> -->
<!-- <el-form-item label="砍价详情">
<editor v-model="form.description" />
</el-form-item> -->
<el-form-item label="规则">
<editor v-model="form.info" />
</el-form-item>
<!-- <el-form-item label="玩法">
<editor v-model="form.regulations" />
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreBargain'
import editor from '../../components/Editor'
import MaterialList from '@/components/material'
import cgood from '@/views/components/goodss'
export default {
inject: ["reload"],
components: { editor, MaterialList,cgood },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
productId: '',
title: '',
image: '',
unitName: '',
stock: 1,
sales: '',
images: '',
imageArr: [],
sliderImageArr: [],
startTime: '',
stopTime: '',
storeName: '',
price: '',
minPrice: '',
num: 1,
bargainMaxPrice: 0,
bargainMinPrice: 0,
bargainNum: 1,
status: 0,
description: '<p>熊</p>',
giveIntegral: '',
info: '',
cost: 0,
sort: 0,
isHot: 0,
isDel: 0,
addTime: '',
isPostage: 1,
postage: '',
// rule: '',
look: '',
share: '',
startTimeDate: '',
endTimeDate: '',
info:'',
// regulations:'',
needNum:null
},
rules: {
}
}
},
watch: {
// 'form.imageArr': function(val) {
// if (val) {
// this.form.image = val.join(',')
// }
// },
'form.sliderImageArr': function(val) {
if (val) {
this.form.images = val.join(',')
}
}
},
methods: {
getGoods(val){
console.log(val[0].id,'商品id关联')
this.form.productId = val[0].id
this.form.image = val[0].image
this.form.imageArr = val
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
this.reload()
})
.catch(_ => {});
},
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
this.doAdd()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
this.reload()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
// doEdit() {
// edit(this.form).then(res => {
// this.resetForm()
// this.$notify({
// title: '',
// type: 'success',
// duration: 2500
// })
// this.loading = false
// this.$parent.init()
// }).catch(err => {
// this.loading = false
// console.log(err.response.data.message)
// })
// },
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
productId: '',
title: '',
image: '',
unitName: '',
stock: '',
sales: '',
images: '',
imageArr: [],
sliderImageArr: [],
startTime: '',
stopTime: '',
storeName: '',
price: '',
minPrice: '',
num: 1,
bargainMaxPrice: 0,
bargainMinPrice: 0,
bargainNum: 1,
status: '',
description: '<p>熊</p>',
giveIntegral: '',
info: '',
cost: 0,
sort: '',
isHot: '',
isDel: '',
addTime: '',
isPostage: '',
postage: '',
// rule: '',
look: '',
share: '',
info:'',
// regulations:''
}
}
}
}
</script>
<style scoped>
</style>

214
src/views/activity/bargain/index.vue

@ -0,0 +1,214 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container" >
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
<el-button
type="primary"
class="filter-item"
size="mini"
icon="el-icon-check"
@click="add"
>
新增
</el-button>
<!-- <el-button
type="primary"
class="filter-item"
size="mini"
icon="el-icon-info"
@click="addew"
>
玩法说明
</el-button> -->
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<newl ref="form2" :is-add="isAdd" />
<how ref="form3" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;height:calc(100vh - 245px);overflow-y: scroll;">
<el-table-column prop="id" label="砍价产品ID" align="center"/>
<el-table-column prop="title" label="砍价名称" align="center" />
<el-table-column prop="image" label="砍价图片" align="center">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="price" label="砍价价格" align="center" />
<!-- <el-table-column prop="price" label="砍价区间" align="center">
<template slot-scope="scope">
<span>{{ scope.row.bargainMinPrice }}~{{ scope.row.bargainMaxPrice }}</span>
</template>
</el-table-column> -->
<el-table-column prop="needNum" label="砍价次数" align="center" />
<el-table-column prop="minPrice" label="最低价" align="center" />
<el-table-column prop="stock" label="库存" align="center" />
<el-table-column prop="statusStr" label="砍价状态" align="center" />
<el-table-column prop="startTime" label="开始时间" align="center" width="150">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="stopTime" label="结束时间" align="center" width="150">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="sales" label="销量" align="center" />
<el-table-column prop="look" label="浏览量" align="center"/>
<el-table-column prop="share" label="分享量" align="center"/>
<el-table-column v-if="checkPermission(['admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT','YXSTOREBARGAIN_DELETE'])" label="操作" width="150px" align="center" fixed="right">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-footer style="height:60px;width:100%;background-color:#f6f6f6">
<div style="float:left"></div>
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 15px; float:right"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</el-footer>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/yxStoreBargain'
import eForm from './form'
import { formatTimeTwo, parseTime } from '@/utils/index'
import newl from './formse'
import how from './HowToPlay'
export default {
components: { eForm ,newl ,how},
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
parseTime,
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'api/yxStoreBargain'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form2.dialog = true
},
addew(){
this.isAdd = true
this.$refs.form3.dialog = true
},
edit(data) {
console.log(data,'修改的数据')
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
productId: data.productId,
title: data.title,
image: data.image,
unitName: data.unitName,
stock: data.stock,
sales: data.sales,
images: data.images,
imageArr: data.imageArr,
sliderImageArr: data.images.split(','),
startTime: data.startTime,
stopTime: data.stopTime,
storeName: data.storeName,
price: data.price,
minPrice: data.minPrice,
num: 1,
bargainMaxPrice: data.bargainMaxPrice,
bargainMinPrice: data.bargainMinPrice,
bargainNum: data.bargainNum,
status: data.status,
description: data.description,
giveIntegral: data.giveIntegral,
info: data.info,
cost: data.cost,
sort: data.sort,
isHot: data.isHot,
isDel: data.isDel,
addTime: data.addTime,
isPostage: data.isPostage,
postage: data.postage,
rule: data.rule,
look: data.look,
share: data.share,
startTimeDate: new Date(data.startTimeDate),
endTimeDate: new Date(data.endTimeDate),
info:data.info,
needNum:data.needNum
// regulations:data.regulations
}
_this.dialog = true
}
}
}
</script>
<style scoped>
.app-container{
padding-bottom: 0px;
}
</style>

124
src/views/activity/bargain_user/form.vue

@ -0,0 +1,124 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="用户ID">
<el-input v-model="form.uid" style="width: 370px;" />
</el-form-item>
<el-form-item label="砍价产品id">
<el-input v-model="form.bargainId" style="width: 370px;" />
</el-form-item>
<el-form-item label="砍价的最低价">
<el-input v-model="form.bargainPriceMin" style="width: 370px;" />
</el-form-item>
<el-form-item label="砍价金额">
<el-input v-model="form.bargainPrice" style="width: 370px;" />
</el-form-item>
<el-form-item label="砍掉的价格">
<el-input v-model="form.price" style="width: 370px;" />
</el-form-item>
<el-form-item label="状态 1参与中 2 活动结束参与失败 3活动结束参与成功">
<el-input v-model="form.status" style="width: 370px;" />
</el-form-item>
<el-form-item label="参与时间">
<el-input v-model="form.addTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否取消">
<el-input v-model="form.isDel" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreBargainUser'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
bargainId: '',
bargainPriceMin: '',
bargainPrice: '',
price: '',
status: '',
addTime: '',
isDel: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
bargainId: '',
bargainPriceMin: '',
bargainPrice: '',
price: '',
status: '',
addTime: '',
isDel: ''
}
}
}
}
</script>
<style scoped>
</style>

131
src/views/activity/bargain_user/index.vue

@ -0,0 +1,131 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSTOREBARGAINUSER_ALL','YXSTOREBARGAINUSER_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="用户参与砍价表ID" />
<el-table-column prop="uid" label="用户ID" />
<el-table-column prop="bargainId" label="砍价产品id" />
<el-table-column prop="bargainPriceMin" label="砍价的最低价" />
<el-table-column prop="bargainPrice" label="砍价金额" />
<el-table-column prop="price" label="砍掉的价格" />
<el-table-column prop="status" label="状态 1参与中 2 活动结束参与失败 3活动结束参与成功" />
<el-table-column prop="addTime" label="参与时间" />
<el-table-column prop="isDel" label="是否取消" />
<el-table-column v-if="checkPermission(['admin','YXSTOREBARGAINUSER_ALL','YXSTOREBARGAINUSER_EDIT','YXSTOREBARGAINUSER_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSTOREBARGAINUSER_ALL','YXSTOREBARGAINUSER_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTOREBARGAINUSER_ALL','YXSTOREBARGAINUSER_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/yxStoreBargainUser'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'api/yxStoreBargainUser'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
bargainId: data.bargainId,
bargainPriceMin: data.bargainPriceMin,
bargainPrice: data.bargainPrice,
price: data.price,
status: data.status,
addTime: data.addTime,
isDel: data.isDel
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

87
src/views/activity/combination/HowToPlay.vue

@ -0,0 +1,87 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" title="拼团玩法说明" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-form-item label="说明">
<editor v-model="form.pinkStatement" />
</el-form-item>
<el-form-item label="玩法">
<editor v-model="form.pinkRegulations" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { List,Config } from '@/api/yxStoreCombination'
import editor from '../../components/Editor'
import MaterialList from '@/components/material'
import cgood from '@/views/components/goodss'
export default {
components: { editor, MaterialList ,cgood },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
pinkStatement:'',
pinkRegulations:''
},
rules: {
}
}
},
created(){
this.List()
},
methods: {
cancel(){
this.dialog = false
},
List(){
List().then(res=>{
console.log(res,'iopioipo')
this.form = res
})
},
doSubmit() {
// this.loading = true
this.Config()
},
Config() {
console.log(this.form)
Config(this.form).then(res => {
console.log(res)
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.dialog = false
}).catch(err => {
this.dialog = false
console.log(err.response.data.message)
})
},
}
}
</script>
<style scoped>
</style>

258
src/views/activity/combination/form.vue

@ -0,0 +1,258 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="handleClose" :visible.sync="dialog" title=" 开启拼团" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-form-item label="拼团名称">
<el-input v-model="form.title" style="width: 500px;" />
</el-form-item>
<!-- <el-form-item label="拼团简介">
<el-input v-model="form.info" style="width: 500px;" />
</el-form-item> -->
<el-form-item label="单位">
<el-input v-model="form.unitName" style="width: 500px;" />
</el-form-item>
<el-form-item label="拼团开始时间">
<template>
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="拼团结束时间">
<template>
<el-date-picker
v-model="form.stopTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<!-- <el-form-item label="产品主图片">
<MaterialList v-model="form.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item> -->
<el-form-item label="产品主图片" style="display: block;">
<!-- <el-input v-model="forms.productId" autocomplete="off"></el-input> -->
<cgood @selectGoods="getGoods" v-model="form.imageArr"></cgood>
</el-form-item>
<el-form-item label="产品轮播图">
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
<el-form-item label="拼团时效(单位小时)">
<el-input-number v-model="form.effectiveTime" style="width: 500px;" />
</el-form-item>
<!-- <el-form-item label="拼团价">
<el-input-number v-model="form.price" />
</el-form-item> -->
<el-form-item label="拼团人数">
<el-input style="width:100px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.people" />
</el-form-item>
<el-form-item label="虚拟原价">
<el-input style="width:100px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.productPrice" />
</el-form-item>
<!-- <el-form-item label="库存">
<el-input-number v-model="form.stock" />
</el-form-item> -->
<el-form-item label="销量">
<el-input style="width:100px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.sales" />
</el-form-item>
<!-- <el-form-item label="排序">
<el-input-number v-model="form.sort" />
</el-form-item> -->
<!-- <el-form-item label="邮费">
<el-input-number v-model="form.postage" />
</el-form-item> -->
<!-- <el-form-item label="是否包邮">
<el-radio v-model="form.isPostage" :label="1"></el-radio>
<el-radio v-model="form.isPostage" :label="0" style="width: 110px;"></el-radio>
</el-form-item> -->
<el-form-item label="活动状态">
<el-radio v-model="form.isShow" :label="1">开启</el-radio>
<el-radio v-model="form.isShow" :label="0" style="width: 200px;">关闭</el-radio>
</el-form-item>
<!-- <el-form-item label="详情">
<editor v-model="form.description" />
</el-form-item> -->
<!-- <el-form-item label="说明">
<editor v-model="form.pinkStatement" />
</el-form-item>
<el-form-item label="玩法">
<editor v-model="form.pinkRegulations" />
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCombination'
import editor from '../../components/Editor'
import MaterialList from '@/components/material'
import cgood from '@/views/components/goodss'
export default {
components: { editor, MaterialList,cgood },
inject: ["reload"],
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
productId: '',
merId: '',
image: '',
images: '',
imageArr: [],
sliderImageArr: [],
title: '',
attr: null,
people: '',
info: '',
price: 0,
sort: 0,
sales: '',
addTime: '',
isHost: '',
isShow: 1,
isDel: 0,
merUse: '',
isPostage: null,
postage: 0,
description: '<p>123</p>',
startTime: '',
stopTime: '',
effectiveTime: '',
cost: '',
browse: '',
unitName: '',
combination: 1,
browse: 0,
startTimeDate: '',
endTimeDate: '',
productPrice:'',
// pinkStatement:'',
// pinkRegulations:''
},
rules: {
}
}
},
watch: {
// 'form.imageArr': function(val) {
// if (val) {
// this.form.image = val.join(',')
// }
// },
'form.sliderImageArr': function(val) {
if (val) {
this.form.images = val.join(',')
}
}
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
this.reload()
})
.catch(_ => {});
},
getGoods(val){
console.log(val[0].id,'商品id关联')
this.form.productId = val[0].id
this.form.image = val[0].image
this.form.imageArr = val
},
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
this.doEdit()
},
// doAdd() {
// add(this.form).then(res => {
// this.resetForm()
// this.$notify({
// title: '',
// type: 'success',
// duration: 2500
// })
// this.loading = false
// this.$parent.init()
// }).catch(err => {
// this.loading = false
// console.log(err.response.data.message)
// })
// },
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '操作成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
this.reload()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
productId: '',
merId: '',
image: '',
images: '',
imageArr: [],
sliderImageArr: [],
title: '',
attr: null,
people: 0,
info: '',
price: 0,
sort: '',
sales: '',
addTime: '',
isHost: '',
isShow: '',
isDel: '',
combination: '',
merUse: '',
isPostage: '',
postage: '',
description: '<p>123</p>',
startTimeDate: '',
endTimeDate: '',
effectiveTime: 24,
cost: '',
browse: '',
unitName: '',
productPrice:'',
// pinkStatement:'',
// pinkRegulations:''
}
}
}
}
</script>
<style scoped>
</style>

264
src/views/activity/combination/formt.vue

@ -0,0 +1,264 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="handleClose" :visible.sync="dialog" title=" 新增拼团" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-form-item label="拼团名称">
<el-input v-model="form.title" style="width: 500px;" />
</el-form-item>
<!-- <el-form-item label="拼团简介">
<el-input v-model="form.info" style="width: 500px;" />
</el-form-item> -->
<el-form-item label="单位">
<el-input v-model="form.unitName" style="width: 500px;" />
</el-form-item>
<el-form-item label="拼团开始时间">
<template>
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="拼团结束时间">
<template>
<el-date-picker
v-model="form.stopTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<!-- <el-form-item label="产品主图片">
<MaterialList v-model="form.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item> -->
<el-form-item label="产品主图片" style="display: block;">
<!-- <el-input v-model="forms.productId" autocomplete="off"></el-input> -->
<cgood @selectGoods="getGoods" v-model="form.imageArr"></cgood>
</el-form-item>
<el-form-item label="产品轮播图">
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
<el-form-item label="拼团时效(单位小时)">
<el-input-number v-model="form.effectiveTime" style="width: 500px;" />
</el-form-item>
<!-- <el-form-item label="拼团价">
<el-input-number v-model="form.price" />
</el-form-item> -->
<el-form-item label="拼团人数">
<el-input style="width:100px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.people" />
</el-form-item>
<el-form-item label="虚拟原价">
<el-input style="width:100px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.productPrice" />
</el-form-item>
<!-- <el-form-item label="库存">
<el-input-number v-model="form.stock" />
</el-form-item> -->
<el-form-item label="销量">
<el-input style="width:100px" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="form.sales" />
</el-form-item>
<!-- <el-form-item label="排序">
<el-input-number v-model="form.sort" />
</el-form-item> -->
<!-- <el-form-item label="邮费">
<el-input-number v-model="form.postage" />
</el-form-item> -->
<!-- <el-form-item label="是否包邮">
<el-radio v-model="form.isPostage" :label="1"></el-radio>
<el-radio v-model="form.isPostage" :label="0" style="width: 110px;"></el-radio>
</el-form-item> -->
<el-form-item label="活动状态">
<el-radio v-model="form.isShow" :label="1">开启</el-radio>
<el-radio v-model="form.isShow" :label="0" style="width: 200px;">关闭</el-radio>
</el-form-item>
<!-- <el-form-item label="详情">
<editor v-model="form.description" />
</el-form-item> -->
<!-- <el-form-item label="说明">
<editor v-model="form.pinkStatement" />
</el-form-item>
<el-form-item label="玩法">
<editor v-model="form.pinkRegulations" />
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCombination'
import editor from '../../components/Editor'
import MaterialList from '@/components/material'
import cgood from '@/views/components/goodss'
export default {
inject: ["reload"],
components: { editor, MaterialList ,cgood },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
productId: '',
merId: '',
image: '',
images: '',
imageArr: [],
sliderImageArr: [],
title: '',
attr: null,
people: '',
info: '',
price: 0,
sort: 0,
sales: '',
stock: 20,
addTime: '',
isHost: '',
isShow: 1,
isDel: 0,
merUse: '',
isPostage: null,
postage: 0,
description: '<p>123</p>',
startTime: '',
stopTime: '',
effectiveTime: '',
cost: '',
browse: '',
unitName: '',
combination: 1,
browse: 0,
startTimeDate: '',
endTimeDate: '',
productPrice:'',
// pinkStatement:'',
// pinkRegulations:''
},
rules: {
}
}
},
watch: {
// 'form.imageArr': function(val) {
// if (val) {
// this.form.image = val.join(',')
// }
// },
'form.sliderImageArr': function(val) {
if (val) {
this.form.images = val.join(',')
}
}
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
this.reload()
})
.catch(_ => {});
},
getGoods(val){
console.log(val[0].id,'商品id关联')
this.form.productId = val[0].id
this.form.image = val[0].image
this.form.imageArr = val
},
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
this.doAdd()
},
doAdd() { //
console.log(this.form)
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
this.reload()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
// doEdit() {
// edit(this.form).then(res => {
// this.resetForm()
// this.$notify({
// title: '',
// type: 'success',
// duration: 2500
// })
// this.loading = false
// this.$parent.init()
// }).catch(err => {
// this.loading = false
// console.log(err.response.data.message)
// })
// },
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
productId: '',
merId: '',
image: '',
images: '',
imageArr: [],
sliderImageArr: [],
title: '',
attr: null,
people: 0,
info: '',
price: 0,
sort: '',
sales: '',
stock: '',
addTime: '',
isHost: '',
isShow: '',
isDel: '',
combination: '',
merUse: '',
isPostage: '',
postage: '',
description: '<p>123</p>',
startTimeDate: '',
endTimeDate: '',
effectiveTime: 24,
cost: '',
browse: '',
unitName: '',
productPrice:'',
// pinkStatement:'',
// pinkRegulations:''
}
}
}
}
</script>
<style scoped>
</style>

244
src/views/activity/combination/index.vue

@ -0,0 +1,244 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
<el-button
type="primary"
class="filter-item"
size="mini"
icon="el-icon-check"
@click="add"
>
新增
</el-button>
<el-button
type="primary"
class="filter-item"
size="mini"
icon="el-icon-info"
@click="addew"
>
玩法说明
</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<newl ref="form2" :is-add="isAdd" />
<how ref="form3" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;height:calc(100vh - 245px);overflow-y: scroll;">
<el-table-column prop="id" label="id" align="center" />
<el-table-column prop="productId" label="商品id" align="center" />
<el-table-column prop="image" label="产品主图" align="center">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="title" label="拼团名称" align="center" width="150"/>
<el-table-column prop="people" label="参团人数" align="center"/>
<el-table-column prop="price" label="拼团价" align="center" />
<el-table-column prop="productPrice" label="原价" align="center" />
<el-table-column prop="stock" label="库存" align="center"/>
<el-table-column prop="browse" label="浏览量" align="center" />
<el-table-column prop="countPeopleAll" label="参与人数" align="center" />
<el-table-column prop="countPeoplePink" label="成团数量" align="center"/>
<el-table-column prop="countPeopleBrowse" label="访客人数" align="center"/>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div @click="onSale(scope.row.id,scope.row.isShow)">
<el-tag v-if="scope.row.isShow === 1" style="cursor: pointer" :type="''">已开启</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">已关闭</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="stopTime" label="结束时间" align="center" width="200">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT','YXSTORECOMBINATION_DELETE'])" label="操作" width="150px" align="center" fixed="right">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-footer style="height:60px;width:100%;background-color:#f6f6f6">
<div style="float:left"></div>
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 15px; float:right"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</el-footer>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, onsale } from '@/api/yxStoreCombination'
import eForm from './form'
import { formatTimeTwo, parseTime } from '@/utils/index'
import newl from './formt'
import how from './HowToPlay'
export default {
components: { eForm ,newl,how },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'title', display_name: '活动标题' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
parseTime,
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'api/yxStoreCombination'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
onSale(id, status) {
this.$confirm(`确定进行[${status ? '下架' : '上架'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onsale(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
add() {
this.isAdd = true
this.$refs.form2.dialog = true
},
addew(){
this.isAdd = true
this.$refs.form3.dialog = true
},
edit(data) {
console.log(data,'pintuan')
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
productId: data.productId,
merId: data.merId,
image: data.image,
images: data.images,
imageArr: data.imageArr,
sliderImageArr: data.images.split(','),
title: data.title,
attr: data.attr,
people: data.people,
info: data.info,
price: data.price,
sort: data.sort,
sales: data.sales,
addTime: data.addTime,
isHost: data.isHost,
isShow: data.isShow,
isDel: data.isDel,
combination: data.combination,
merUse: data.merUse,
isPostage: data.isPostage,
postage: data.postage,
description: data.description,
startTime: data.startTime,
stopTime: data.stopTime,
startTimeDate: new Date(data.startTimeDate),
endTimeDate: new Date(data.endTimeDate),
effectiveTime: data.effectiveTime,
productPrice: data.productPrice,
browse: data.browse,
unitName: data.unitName
// pinkStatement:data.pinkStatement,
// pinkRegulations:data.pinkRegulations
}
_this.dialog = true
}
}
}
</script>
<style scoped>
.app-container{
padding-bottom: 0px;
}
</style>

159
src/views/activity/combinlist/form.vue

@ -0,0 +1,159 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="用户id">
<el-input v-model="form.uid" style="width: 370px;" />
</el-form-item>
<el-form-item label="订单id 生成">
<el-input v-model="form.orderId" style="width: 370px;" />
</el-form-item>
<el-form-item label="订单id 数据库">
<el-input v-model="form.orderIdKey" style="width: 370px;" />
</el-form-item>
<el-form-item label="购买商品个数">
<el-input v-model="form.totalNum" style="width: 370px;" />
</el-form-item>
<el-form-item label="购买总金额">
<el-input v-model="form.totalPrice" style="width: 370px;" />
</el-form-item>
<el-form-item label="拼团产品id">
<el-input v-model="form.cid" style="width: 370px;" />
</el-form-item>
<el-form-item label="产品id">
<el-input v-model="form.pid" style="width: 370px;" />
</el-form-item>
<el-form-item label="拼图总人数">
<el-input v-model="form.people" style="width: 370px;" />
</el-form-item>
<el-form-item label="拼团产品单价">
<el-input v-model="form.price" style="width: 370px;" />
</el-form-item>
<el-form-item label="开始时间">
<el-input v-model="form.addTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="stopTime">
<el-input v-model="form.stopTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="团长id 0为团长">
<el-input v-model="form.kId" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否发送模板消息0未发送1已发送">
<el-input v-model="form.isTpl" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否退款 0未退款 1已退款">
<el-input v-model="form.isRefund" style="width: 370px;" />
</el-form-item>
<el-form-item label="状态1进行中2已完成3未完成">
<el-input v-model="form.status" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStorePink'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
orderId: '',
orderIdKey: '',
totalNum: '',
totalPrice: '',
cid: '',
pid: '',
people: '',
price: '',
addTime: '',
stopTime: '',
kId: '',
isTpl: '',
isRefund: '',
status: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
orderId: '',
orderIdKey: '',
totalNum: '',
totalPrice: '',
cid: '',
pid: '',
people: '',
price: '',
addTime: '',
stopTime: '',
kId: '',
isTpl: '',
isRefund: '',
status: ''
}
}
}
}
</script>
<style scoped>
</style>

170
src/views/activity/combinlist/index.vue

@ -0,0 +1,170 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;height:calc(100vh - 245px);overflow-y: scroll;">
<el-table-column
label="序号"
type="index"
width="50"
align="center">
</el-table-column>
<el-table-column prop="uid" label="参与人" width="150" align="center" >
<template slot-scope="scope">
头像<a :href="scope.row.userImg" style="color: #42b983" target="_blank"><img :src="scope.row.userImg" alt="点击打开" class="el-avatar"></a><br>
昵称{{ scope.row.nickname }}<br>
用户ID{{ scope.row.uid }}<br>
手机号{{ scope.row.phone }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="开团时间" align="center" />
<el-table-column label="拼团产品" width="200" align="center">
<template slot-scope="scope">
产品主图<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a><br>
拼团名称{{ scope.row.product }}<br>
拼团 ID{{ scope.row.cid }}
</template>
</el-table-column>
<el-table-column prop="orderId" label="订单号" width="150" align="center" />
<el-table-column prop="totalPrice" label="拼团价" align="center" />
<el-table-column prop="people" label="几人团" align="center"/>
<el-table-column prop="countPeople" label="几人参加" align="center" />
<el-table-column label="结束时间" align="center">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span v-if="scope.row.status == 1">进行中</span>
<span v-else-if="scope.row.status == 2">已完成</span>
<span v-else>未完成</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-footer style="height:60px;width:100%;background-color:#f6f6f6">
<div style="float:left"></div>
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 15px; float:right"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</el-footer>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/yxStorePink'
import eForm from './form'
import { formatTimeTwo, parseTime } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'cid', display_name: '拼团id' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
parseTime,
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'api/yxStorePink'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
orderId: data.orderId,
orderIdKey: data.orderIdKey,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
cid: data.cid,
pid: data.pid,
people: data.people,
price: data.price,
addTime: data.addTime,
stopTime: data.stopTime,
kId: data.kId,
isTpl: data.isTpl,
isRefund: data.isRefund,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
.app-container{
padding-bottom: 0px;
}
.el-table::before{
height: 0px;
}
</style>

180
src/views/activity/coupon/form.vue

@ -0,0 +1,180 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="800px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="140px">
<el-form-item label="优惠券类型">
<el-radio-group v-model="form.type" @change="couponsType">
<el-radio :label=0>通用券</el-radio>
<el-radio :label=1>商品券</el-radio>
<el-radio :label=2>商铺券</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="选择商品" v-if="form.type == 1">
<cgood v-model="form.product" @selectGoods="getGoods"></cgood>
</el-form-item>
<el-form-item label="商铺选择" v-if="form.type == 2">
<el-select v-model="form.categoryShopId" style="width: 300px;" >
<el-option
v-for="item in category"
:value="item.id"
:key="item.id"
:label="item.shopName"
>
</el-option>
<!-- <el-option label="-------空-------" value="0"></el-option> -->
</el-select>
</el-form-item>
<el-form-item label="优惠券名称">
<el-input v-model="form.title" style="width: 300px;" />
</el-form-item>
<el-form-item label="优惠券面值">
<el-input v-model="form.couponPrice" style="width: 300px;" onkeyup="value=value.replace(/[^\d]/g,'')" />
</el-form-item>
<el-form-item label="优惠券最低消费">
<el-input v-model="form.useMinPrice" style="width: 300px;" onkeyup="value=value.replace(/[^\d]/g,'')" />
</el-form-item>
<el-form-item label="优惠券有效期限(天)">
<el-input v-model="form.couponTime" style="width: 300px;" onkeyup="value=value.replace(/[^\d]/g,'')" />
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="form.sort" style="width: 300px;" />
</el-form-item>
<el-form-item label="状态">
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0">关闭</el-radio>
</el-form-item>
<el-form-item label="新人卷">
<el-radio v-model="form.rookieRoll" :label="1">开启</el-radio>
<el-radio v-model="form.rookieRoll" :label="0">关闭</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCoupon'
import { gets } from "@/api/yxStoreProduct";
import cgood from '@/views/components/goods'
export default {
components: { cgood },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
category:[],
loading: false, dialog: false,
form: {
id: '',
title: '',
integral: 0,
couponPrice: 0,
useMinPrice: 0,
couponTime: 1,
sort: 0,
status: 1,
rookieRoll:0,
type: 0,
productId: '',
product: [],
categoryShopId:''
},
rules: {
}
}
},
created(){
this.yxStoreCategoryShop()
},
methods: {
yxStoreCategoryShop(){
let plams = {
page:0,
size:10,
sort:'id,desc'
}
gets(plams).then(res=>{
this.category = res.content
console.log(this.category,'商户数据')
})
},
getGoods(p) {
var ids = []
p.forEach((item,index) => {
ids.push(item.id)
})
this.form.productId = ids.join(",")
},
couponsType() {
//alert(this.form.type)
},
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
title: '',
integral: 0,
couponPrice: 0,
useMinPrice: 0,
couponTime: 1,
sort: 0,
status: 1,
rookieRoll:0,
type: 0,
productId: '',
product: []
}
}
}
}
</script>
<style scoped>
</style>

105
src/views/activity/coupon/formte.vue

@ -0,0 +1,105 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" title="添加轮播图" width="800px">
<el-form ref="form" :model="form" size="small" label-width="160px">
<el-form-item label="产品轮播图(266x355)" >
<!-- <MaterialList
v-model="form.slideshow"
style="width: 500px"
type="image"
:num="4"
:width="150"
:height="150"
/> -->
<single-pic
v-model="form.slideshow"
type="image"
:num="1"
:width="150"
:height="150"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit, showList,show } from '@/api/yxStoreCoupon'
import cgood from '@/views/components/goods'
import MaterialList from "@/components/material";
import singlePic from "@/components/singlematerial";
export default {
inject: ["reload"],
components: { cgood ,MaterialList,singlePic },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
slideshow:''
},
}
},
created(){
this.showList()
},
methods: {
cancel(){
this.dialog = false
},
showList(){
showList().then(res=>{
console.log(res,'图片查询')
this.form.slideshow = res
})
},
doSubmit() {
console.log(this.form)
this.loading = true
this.doAdd()
// console.log(this.form.slideshow)
// show(this.form).then(res=>{
// console.log(res)
// this.dialog = false
// })
},
doAdd() {
show(this.form).then(res => {
// this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.dialog = false
this.reload()
// this.$parent.init()
}).catch(err => {
this.dialog = false
console.log(err.response.data.message)
})
},
}
}
</script>
<style scoped>
</style>

220
src/views/activity/coupon/index.vue

@ -0,0 +1,220 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
<el-button
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="addr"
>添加轮播图</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<eIForm ref="form2" :is-add="isAdd" />
<sForm ref="form3" :is-add='isAdd'></sForm>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;height:calc(100vh - 245px);overflow-y: scroll;">
<!--<el-table-column prop="id" label="ID"/>-->
<el-table-column prop="title" label="优惠券名称" align="center" width="250" />
<el-table-column prop="type" label="优惠券类型 " align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.type === 1" style="cursor: pointer" :type="''">商品券</el-tag>
<el-tag v-if="scope.row.type === 2" style="cursor: pointer" :type="''">商铺卷</el-tag>
<el-tag v-if="scope.row.type === 0" :type=" 'info' ">普通券</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="couponPrice" label="优惠券面值" align="center" />
<el-table-column prop="useMinPrice" label="优惠券最低消费" align="center"/>
<el-table-column label="优惠券有效期限" align="center">
<template slot-scope="scope">
<span>{{ scope.row.couponTime }}</span>
</template>
</el-table-column>
<el-table-column prop="sort" label="排序" width="100" align="center" />
<el-table-column label="状态" width="100" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">开启</el-tag>
<el-tag v-else :type=" 'info' ">关闭</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="140">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT','YXSTORECOUPON_DELETE'])" width="200" label="操作" align="center">
<template slot-scope="scope">
<el-button
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT']"
size="mini"
type="primary"
@click="edit2(scope.row)"
>
发布
</el-button>
<el-dropdown size="mini" split-button type="primary" trigger="click">
操作
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT']"
size="mini"
type="primary"
icon="el-icon-edit"
@click="edit(scope.row)"
>编辑</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">删除</el-button>
</el-popover>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-footer style="height:60px;width:100%;background-color:#f6f6f6">
<div style="float:left"></div>
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 15px; float:right"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</el-footer>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/yxStoreCoupon'
import eForm from './form'
import sForm from './formte'
import eIForm from '../couponissue/form'
import { formatTime } from '@/utils/index'
export default {
components: { eForm, eIForm ,sForm},
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTime,
checkPermission,
beforeInit() {
this.url = 'api/yxStoreCoupon'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, isDel: 0 }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
addr(){
this.isAdd = true
this.$refs.form3.dialog = true
},
edit(data) {
console.log(data,'商铺卷')
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
title: data.title,
integral: data.integral,
couponPrice: data.couponPrice,
useMinPrice: data.useMinPrice,
couponTime: data.couponTime,
sort: data.sort,
status: data.status,
type: data.type,
productId: data.productId,
product: data.product,
categoryShopId:data.categoryShopId,
rookieRoll:data.rookieRoll
}
_this.dialog = true
},
edit2(data) {
this.isAdd = true
const _this = this.$refs.form2
_this.form = {
cid: data.id,
cname: data.title,
ctype: data.type,
isPermanent: 0,
status: 1,
totalCount: 0,
remainCount: 0,
isDel: 0
}
_this.dialog = true
}
}
}
</script>
<style scoped>
.app-container{
padding-bottom: 0px;
}
</style>

140
src/views/activity/couponissue/form.vue

@ -0,0 +1,140 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '发布优惠券'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="优惠券ID">
<el-input v-model="form.cid" style="width: 300px;" :disabled="true" />
<el-input v-model="form.ctype" type="hidden" />
</el-form-item>
<el-form-item label="优惠券名称">
<el-input v-model="form.cname" style="width: 300px;" :disabled="true" />
</el-form-item>
<el-form-item label="领取开启时间">
<template>
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="券领结束时间">
<template>
<el-date-picker
v-model="form.endTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="发布数量">
<el-input v-model="form.totalCount" style="width: 300px;" />
</el-form-item>
<el-form-item label="是否不限量">
<el-radio v-model="form.isPermanent" :label="1">不限量</el-radio>
<el-radio v-model="form.isPermanent" :label="0">限量</el-radio>
</el-form-item>
<el-form-item label="状态">
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0">关闭</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCouponIssue'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
cid: '',
cname: '',
ctype: 0,
startTimeDate: '',
endTimeDate: '',
totalCount: 0,
remainCount: 0,
isPermanent: 0,
status: 1,
isDel: 0,
addTime: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
cid: '',
startTime: '',
endTime: '',
totalCount: '',
remainCount: '',
isPermanent: '',
status: '',
isDel: '',
addTime: ''
}
}
}
}
</script>
<style scoped>
</style>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save