Commit 22d550dc by 前端

Merge branch 'v3.24.0' into 'master'

红包玩法需求合并

See merge request !40
2 parents 534476a6 f07fde0b
Showing 58 changed files with 4158 additions and 282 deletions
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
"env": { "env": {
"node": true "node": true
}, },
"globals": {
"AMap": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"], "extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": { "rules": {
"no-console": "off", "no-console": "off",
......
...@@ -1129,11 +1129,26 @@ ...@@ -1129,11 +1129,26 @@
"version": "7.18.9", "version": "7.18.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz",
"integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==", "integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==",
"dev": true,
"requires": { "requires": {
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
} }
}, },
"@babel/runtime-corejs3": {
"version": "7.23.7",
"resolved": "https://registry.npmmirror.com/@babel/runtime-corejs3/-/runtime-corejs3-7.23.7.tgz",
"integrity": "sha512-ER55qzLREVA5YxeyQ3Qu48tgsF2ZrFjFjUS6V6wF0cikSw+goBJgB9PBRM1T6+Ah4iiM+sxmfS/Sy/jdzFfhiQ==",
"requires": {
"core-js-pure": "^3.30.2",
"regenerator-runtime": "^0.14.0"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
}
}
},
"@babel/template": { "@babel/template": {
"version": "7.18.10", "version": "7.18.10",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz",
...@@ -1844,6 +1859,75 @@ ...@@ -1844,6 +1859,75 @@
"webpack-chain": "^6.4.0", "webpack-chain": "^6.4.0",
"webpack-dev-server": "^3.11.0", "webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2" "webpack-merge": "^4.2.2"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
} }
}, },
"@vue/cli-shared-utils": { "@vue/cli-shared-utils": {
...@@ -2719,6 +2803,11 @@ ...@@ -2719,6 +2803,11 @@
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
}, },
"bignumber.js": {
"version": "9.1.2",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz",
"integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug=="
},
"binary-extensions": { "binary-extensions": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
...@@ -3260,6 +3349,11 @@ ...@@ -3260,6 +3349,11 @@
"integrity": "sha512-YpeKZngUmG65rLudJ4taU7VLkOCTMhNl/u4ctNC56LQS/zJTyNH0Lrtwm1tfTsbLlwvlfsA2d1c8vCf/Kh2KwQ==", "integrity": "sha512-YpeKZngUmG65rLudJ4taU7VLkOCTMhNl/u4ctNC56LQS/zJTyNH0Lrtwm1tfTsbLlwvlfsA2d1c8vCf/Kh2KwQ==",
"dev": true "dev": true
}, },
"china-area-data": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/china-area-data/-/china-area-data-5.0.1.tgz",
"integrity": "sha512-BQDPpiv5Nn+018ekcJK2oSD9PAD+E1bvXB0wgabc//dFVS/KvRqCgg0QOEUt3vBkx9XzB5a9BmkJCEZDBxVjVw=="
},
"chokidar": { "chokidar": {
"version": "3.5.3", "version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
...@@ -4004,6 +4098,11 @@ ...@@ -4004,6 +4098,11 @@
} }
} }
}, },
"core-js-pure": {
"version": "3.35.0",
"resolved": "https://registry.npmmirror.com/core-js-pure/-/core-js-pure-3.35.0.tgz",
"integrity": "sha512-f+eRYmkou59uh7BPcyJ8MC76DiGhspj1KMxVIcF24tzP8NA9HVa1uC7BTW2tgx7E1QVCzDzsgp7kArrzhlz8Ew=="
},
"core-util-is": { "core-util-is": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
...@@ -10092,8 +10191,7 @@ ...@@ -10092,8 +10191,7 @@
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.9", "version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
"dev": true
}, },
"regenerator-transform": { "regenerator-transform": {
"version": "0.15.0", "version": "0.15.0",
...@@ -12674,75 +12772,6 @@ ...@@ -12674,75 +12772,6 @@
} }
} }
}, },
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": { "vue-router": {
"version": "3.5.4", "version": "3.5.4",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.4.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.4.tgz",
...@@ -12815,6 +12844,23 @@ ...@@ -12815,6 +12844,23 @@
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz", "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz",
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==" "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
}, },
"wangeditor": {
"version": "4.7.15",
"resolved": "https://registry.npmmirror.com/wangeditor/-/wangeditor-4.7.15.tgz",
"integrity": "sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==",
"requires": {
"@babel/runtime": "^7.11.2",
"@babel/runtime-corejs3": "^7.11.2",
"tslib": "^2.1.0"
},
"dependencies": {
"tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
}
}
},
"watchpack": { "watchpack": {
"version": "1.7.5", "version": "1.7.5",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz",
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"bignumber.js": "^9.1.1",
"china-area-data": "^5.0.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
...@@ -20,6 +22,7 @@ ...@@ -20,6 +22,7 @@
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
"wangeditor": "^4.7.15",
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
......
import { http } from '@/main' import { http } from '@/main'
const url = '/rop-scrm-marketing/router' const url = '/rop-scrm-marketing/router'
export default { export default {
/**获取红包配置列表 */ /**获取红包配置列表 */
getRedEnvelopeConfigList (params) { getRedEnvelopeConfigList(params) {
params.method = 'marketing.api.activityRedEnvelope.page' params.method = 'marketing.api.activityRedEnvelope.page'
return http({ return http({
url, url,
...@@ -11,7 +10,7 @@ export default { ...@@ -11,7 +10,7 @@ export default {
}) })
}, },
/**获取红包活动列表 */ /**获取红包活动列表 */
getRedEnvelopeActivityList (params) { getRedEnvelopeActivityList(params) {
params.method = 'marketing.api.activityRedEnvelope.merchant.list' params.method = 'marketing.api.activityRedEnvelope.merchant.list'
return http({ return http({
url, url,
...@@ -20,17 +19,34 @@ export default { ...@@ -20,17 +19,34 @@ export default {
}, },
/**获取所属渠道列表 */ /**获取所属渠道列表 */
getRedEnvelopeMerchantList (params) { getRedEnvelopeMerchantList(params) {
params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant' params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant'
params.pageSize = 50 params.pageSize = params.pageSize || 50
return http({ return http({
url: '/rop-scrm-carlife/router', url: '/rop-scrm-carlife/router',
data: params data: params
}) })
}, },
/*获取模板 */
getRedEnvelopeTemplateList(params) {
params.method = 'marketing.api.self.red.envelope.template.page'
params.pageSize = params.pageSize || 10000
return http({
url,
data: params
})
},
//获取优惠券
getCouponList(params) {
params.method = 'scrm.api.coupon.equity.list.merchant'
params.pageSize = params.pageSize || 1000
return http({
url: '/rop-scrm-coupon/router',
data: params
})
},
/**查询红包活动详情 */ /**查询红包活动详情 */
getRedEnvelopeActivityDetail (params) { getRedEnvelopeActivityDetail(params) {
params.method = 'marketing.api.activityRedEnvelope.findOne' params.method = 'marketing.api.activityRedEnvelope.findOne'
return http({ return http({
url, url,
...@@ -39,7 +55,7 @@ export default { ...@@ -39,7 +55,7 @@ export default {
}, },
/** 新建红包活动接口 */ /** 新建红包活动接口 */
createActivityRedEnvelope (params) { createActivityRedEnvelope(params) {
params.method = 'marketing.api.activityRedEnvelope.create' params.method = 'marketing.api.activityRedEnvelope.create'
return http({ return http({
url, url,
...@@ -48,7 +64,7 @@ export default { ...@@ -48,7 +64,7 @@ export default {
}, },
/** 更新红包活动 */ /** 更新红包活动 */
updateActivityRedEnvelope (params) { updateActivityRedEnvelope(params) {
params.method = 'marketing.api.activityRedEnvelope.update' params.method = 'marketing.api.activityRedEnvelope.update'
return http({ return http({
url, url,
...@@ -59,7 +75,7 @@ export default { ...@@ -59,7 +75,7 @@ export default {
* /新建活动文件校验上传文件接口 * /新建活动文件校验上传文件接口
*/ */
createCheckFile (params) { createCheckFile(params) {
params.method = 'marketing.api.activityRedEnvelope.createCheckFile' params.method = 'marketing.api.activityRedEnvelope.createCheckFile'
return http({ return http({
url, url,
...@@ -71,7 +87,7 @@ export default { ...@@ -71,7 +87,7 @@ export default {
* /编辑活动文件校验上传文件接口 * /编辑活动文件校验上传文件接口
*/ */
updateCheckFile (params) { updateCheckFile(params) {
params.method = 'marketing.api.activityRedEnvelope.updateCheckFile' params.method = 'marketing.api.activityRedEnvelope.updateCheckFile'
return http({ return http({
url, url,
...@@ -80,7 +96,7 @@ export default { ...@@ -80,7 +96,7 @@ export default {
}, },
/** 红包配置列表导出 */ /** 红包配置列表导出 */
exportActivityRedEnvelope (params) { exportActivityRedEnvelope(params) {
params.method = 'marketing.api.activityRedEnvelope.export' params.method = 'marketing.api.activityRedEnvelope.export'
return http({ return http({
url, url,
...@@ -89,7 +105,7 @@ export default { ...@@ -89,7 +105,7 @@ export default {
}, },
/** 查询红包链接详情 */ /** 查询红包链接详情 */
getActivityRedEnvelopeLinkDetailPage (params) { getActivityRedEnvelopeLinkDetailPage(params) {
params.method = 'marketing.api.activityRedEnvelope.linkDetailPage' params.method = 'marketing.api.activityRedEnvelope.linkDetailPage'
return http({ return http({
url, url,
...@@ -97,10 +113,9 @@ export default { ...@@ -97,10 +113,9 @@ export default {
}) })
}, },
/**获取红包记录列表 */ /**获取红包记录列表 */
getRedEnvelopeRecordList (params) { getRedEnvelopeRecordList(params) {
params.method = 'marketing.api.activityRedEnvelope.record.page' params.method = 'marketing.api.activityRedEnvelope.record.page'
return http({ return http({
url, url,
...@@ -110,7 +125,7 @@ export default { ...@@ -110,7 +125,7 @@ export default {
/** /**
* /校验中奖记录导入 * /校验中奖记录导入
*/ */
checkImport (params) { checkImport(params) {
params.method = 'marketing.api.activityRedEnvelope.winningRecord.checkImport' params.method = 'marketing.api.activityRedEnvelope.winningRecord.checkImport'
return http({ return http({
url, url,
...@@ -118,7 +133,7 @@ export default { ...@@ -118,7 +133,7 @@ export default {
}) })
}, },
/** 导入中奖记录 */ /** 导入中奖记录 */
importRedEnvelopeRecord (params) { importRedEnvelopeRecord(params) {
params.method = 'marketing.api.activityRedEnvelope.winningRecord.import' params.method = 'marketing.api.activityRedEnvelope.winningRecord.import'
return http({ return http({
url, url,
...@@ -128,7 +143,7 @@ export default { ...@@ -128,7 +143,7 @@ export default {
// 提现记录分页列表 // 提现记录分页列表
getRedEnvelopeWithdraw (params) { getRedEnvelopeWithdraw(params) {
params.method = 'marketing.api.activityRedEnvelope.cash.out.record.page' params.method = 'marketing.api.activityRedEnvelope.cash.out.record.page'
return http({ return http({
url, url,
...@@ -136,14 +151,14 @@ export default { ...@@ -136,14 +151,14 @@ export default {
}) })
}, },
exportRedEnvelopeWithdraw (params) { exportRedEnvelopeWithdraw(params) {
params.method = 'marketing.api.activityRedEnvelope.cash.out.record.export' params.method = 'marketing.api.activityRedEnvelope.cash.out.record.export'
return http({ return http({
url, url,
data: params data: params
}) })
}, },
exportRedEnvelopeRecord (params) { exportRedEnvelopeRecord(params) {
params.method = 'marketing.api.activityRedEnvelope.record.export' params.method = 'marketing.api.activityRedEnvelope.record.export'
return http({ return http({
url, url,
...@@ -152,7 +167,7 @@ export default { ...@@ -152,7 +167,7 @@ export default {
}, },
// 获取白名单列表 // 获取白名单列表
getWhiteListPage(params){ getWhiteListPage(params) {
params.method = 'marketing.api.activityRedEnvelope.whiteList.page' params.method = 'marketing.api.activityRedEnvelope.whiteList.page'
return http({ return http({
url, url,
...@@ -160,7 +175,7 @@ export default { ...@@ -160,7 +175,7 @@ export default {
}) })
}, },
// 校验红包活动白名单导入 // 校验红包活动白名单导入
checkImportWhiteList(params){ checkImportWhiteList(params) {
params.method = 'marketing.api.activityRedEnvelope.whiteList.checkImport' params.method = 'marketing.api.activityRedEnvelope.whiteList.checkImport'
return http({ return http({
url, url,
...@@ -168,7 +183,7 @@ export default { ...@@ -168,7 +183,7 @@ export default {
}) })
}, },
// 红包活动白名单导入 // 红包活动白名单导入
whiteListImport(params){ whiteListImport(params) {
params.method = 'marketing.api.activityRedEnvelope.whiteList.import' params.method = 'marketing.api.activityRedEnvelope.whiteList.import'
return http({ return http({
url, url,
...@@ -176,12 +191,125 @@ export default { ...@@ -176,12 +191,125 @@ export default {
}) })
}, },
whiteListDelete(params){ whiteListDelete(params) {
params.method = 'marketing.api.activityRedEnvelope.whiteList.delete' params.method = 'marketing.api.activityRedEnvelope.whiteList.delete'
return http({ return http({
url, url,
data: params data: params
}) })
},
// 展示记录列表
displayListApi(params) {
params.method = 'marketing.api.activityRedEnvelope.show.record.page'
return http({
url,
data: params
})
},
// 展示记录导出
displayExportApi(params) {
params.method = 'marketing.api.activityRedEnvelope.show.record.export'
return http({
url,
data: params
})
},
// 抽奖记录列表
drawListApi(params) {
params.method = 'marketing.api.activityRedEnvelope.lottery.draw.record.page'
return http({
url,
data: params
})
},
// 导出红包抽奖记录
drawExportApi(params) {
params.method = 'marketing.api.activityRedEnvelope.lottery.draw.record.export'
return http({
url,
data: params
})
},
// 中奖记录列表
winningListApi(params) {
params.method = 'marketing.api.activityRedEnvelope.winning.record.page'
return http({
url,
data: params
})
},
// 导出中奖记录列表
winningExportApi(params) {
params.method = 'marketing.api.activityRedEnvelope.winning.record.export'
return http({
url,
data: params
})
},
// 实物奖品核销列表
winningGoodsApi(params) {
params.method = 'marketing.api.activityRedEnvelope.winning.goods.record.page'
return http({
url,
data: params
})
},
// 实物奖品核销导出
winningGoodsExportApi(params) {
params.method = 'marketing.api.activityRedEnvelope.winning.goods.record.export'
return http({
url,
data: params
})
},
// 快递到家地址信息查询
queryExpressInformation(params){
params.method = 'marketing.api.self.red.envelope.customer.write.detail.query'
return http({
url,
data: params
})
},
// 新建活动模板
newActivityTemplate(params){
params.method = 'marketing.api.self.red.envelope.template.save'
return http({
url,
data: params,
returnAll:true
})
},
// 快递到家地址信息配置列表
expressConfigList(params){
params.method = 'marketing.api.self.red.envelope.customer.write.config.list'
return http({
url,
data: params
})
},
// 活动模板管理列表、
activeTmpManageList(params){
params.method = 'marketing.api.self.red.envelope.template.page'
return http({
url,
data: params
})
},
// 商品核销发货
goodsAreWrittenOffAndShipped(params){
params.method = 'marketing.api.self.red.envelope.send.out.goods'
return http({
url,
data: params,
returnAll:true
})
} }
} }
import { http } from '@/main'
const url = '/rop-scrm-marketing/router'
export default {
/**
* 分页查询接龙列表
*/
getSolitaireList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.page'
return http({
url,
data: params
})
},
/**
* 导出查询接龙活动列表
*/
exportSolitaireList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.list.export'
return http({
url,
data: params
})
},
/**获取接龙抽奖详情 */
getSolitaireDetail (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.detail'
return http({
url,
data: params
})
},
/**
* 新建或更新接龙活动
*/
createOrUpdateSolitaire (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.createOrUpdate'
return http({
url,
data: params
})
},
/**
* 红包活动
*/
getActivityRedEnvelopeList (params) {
params.method = 'marketing.api.activityRedEnvelope.merchant.list'
return http({
url,
data: params
})
},
/**商城券 */
getMerchantCouponList (params) {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: '/rop-scrm-coupon/router',
data: params
})
},
/**权益卡劵 */
getEquityActivityList (params) {
params.method = 'scrm.api.coupon.equity.list.merchant'
return http({
url: '/rop-scrm-coupon/router',
data: params
})
},
/**
* 分页查询群接龙中奖明细列表
*/
getSolitaireAewardList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.record.page'
return http({
url,
data: params
})
},
/**
* 导出群接龙中奖明细列表
*/
exportSolitaireAewardList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.record.export'
return http({
url,
data: params
})
},
/**
* 导出查询接龙明细列表
*/
exportSolitaireUserList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.record.all.export'
return http({
url,
data: params
})
},
/** 查询接龙活动渠道来源 */
getSolitaireMerchantList (params = {}) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.merchants'
params.pageSize = 9999
params.pageNum = 1
return http({
url,
data: params
})
},
/**群聊列表 */
getMerchantWechatGroupList (params) {
params.method = 'entmicro.api.customer.base.list.simple'
return http({
url: '/rop-scrm-entmicro/router',
data: params
})
},
}
\ No newline at end of file \ No newline at end of file
...@@ -136,4 +136,47 @@ img{ ...@@ -136,4 +136,47 @@ img{
color: #666666; color: #666666;
max-width: 80%; max-width: 80%;
} }
}
\ No newline at end of file \ No newline at end of file
}
.el-cascader-menu__list {
&::after{
position: absolute;
left: 0;
top: 0;
background-color: #fff;
width: 20px;
height: 20px;
content: '';
}
.el-cascader-node:not(.is-disabled):focus, .el-cascader-node:not(.is-disabled):hover {
position: relative;
z-index: 2;
}
}
.table_circular_flex{
display: flex;
align-items: center;
.table_circular{
width: 6px;
height: 6px;
border-radius: 4px;
margin-right: 8px;
}
.circular_green{
background: #2CCA74;
}
.circular_gray{
background: #999999;
}
.circular_red{
background: #EB4E4E;
}
.circular_blue{
background: #5850FF;
}
.circular_yellow{
background: #F8B757;
}
}
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则 // 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
function limitPrice (newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) { function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
/* eslint-disable */ /* eslint-disable */
var reg = { var reg = {
priceReg: /^\d[\d\.]*$/, priceReg: /^\d[\d\.]*$/,
...@@ -76,14 +76,15 @@ const statusList = [ ...@@ -76,14 +76,15 @@ const statusList = [
} }
] ]
//会员订单类型字典 //会员订单类型字典
const orderTypesList = [{ const orderTypesList = [
confId: 1, {
confName: '套餐' confId: 1,
}, confName: '套餐'
{ },
confId: 2, {
confName: '会员卡' confId: 2,
} confName: '会员卡'
}
] ]
const orderStatusList = [ const orderStatusList = [
// 2: '待收货', // 2: '待收货',
...@@ -110,45 +111,48 @@ const orderStatusList = [ ...@@ -110,45 +111,48 @@ const orderStatusList = [
{ {
confId: 6, confId: 6,
confName: '已退款' confName: '已退款'
}, }
] ]
const serviceStatusList = [{ const serviceStatusList = [
confId: 1, {
confName: '未生效' confId: 1,
}, confName: '未生效'
{ },
confId: 2, {
confName: '生效中' confId: 2,
}, confName: '生效中'
{ },
confId: 3, {
confName: '已失效' confId: 3,
} confName: '已失效'
}
] ]
const memberTypeList = [{ const memberTypeList = [
confId: 1, {
confName: '正式会员' confId: 1,
}, confName: '正式会员'
{ },
confId: 2, {
confName: '试用会员' confId: 2,
} confName: '试用会员'
}
] ]
const stateList = [{ const stateList = [
confId: 0, {
confName: '待上架' confId: 0,
}, confName: '待上架'
{ },
confId: 1, {
confName: '在售中' confId: 1,
}, confName: '在售中'
{ },
confId: 2, {
confName: '已下架' confId: 2,
}, confName: '已下架'
}
] ]
function getExplorer () { function getExplorer() {
var ua = navigator.userAgent.toLocaleLowerCase() var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) { if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
...@@ -173,7 +177,7 @@ function getExplorer () { ...@@ -173,7 +177,7 @@ function getExplorer () {
return browserType return browserType
} }
function exportFn (url) { function exportFn(url) {
let browserType = getExplorer() let browserType = getExplorer()
if (browserType == 'QQ') { if (browserType == 'QQ') {
window.open(url) window.open(url)
...@@ -200,7 +204,7 @@ const transformData = (data, childrenDepth) => { ...@@ -200,7 +204,7 @@ const transformData = (data, childrenDepth) => {
for (let i = 0; i < childrenDepth; i++) { for (let i = 0; i < childrenDepth; i++) {
const label = levels[i], const label = levels[i],
value = label, value = label,
existingOption = currentLevel && currentLevel.find((option) => option.label === label) existingOption = currentLevel && currentLevel.find(option => option.label === label)
if (existingOption) { if (existingOption) {
if (i === childrenDepth - 1) continue if (i === childrenDepth - 1) continue
if (existingOption.children) currentLevel = existingOption.children if (existingOption.children) currentLevel = existingOption.children
...@@ -217,7 +221,7 @@ const transformData = (data, childrenDepth) => { ...@@ -217,7 +221,7 @@ const transformData = (data, childrenDepth) => {
}) })
return result return result
} }
const checkSpace = (rule, value, callback,target ) => { const checkSpace = (rule, value, callback, target) => {
const { field, message } = rule const { field, message } = rule
if (!value) callback(new Error(message)) if (!value) callback(new Error(message))
else if (!value.trim()) callback(new Error(rule.message)) else if (!value.trim()) callback(new Error(rule.message))
...@@ -226,20 +230,11 @@ const checkSpace = (rule, value, callback,target ) => { ...@@ -226,20 +230,11 @@ const checkSpace = (rule, value, callback,target ) => {
callback() callback()
} }
} }
export {
limitPrice,
orderManageStatusList,
orderSourceList,
deliveryTypeList,
statusList,
serviceStatusList,
memberTypeList,
stateList,
orderTypesList,
orderStatusList,
exportFn,
getExplorer,
activityStatusList,
transformData,
checkSpace
}
\ No newline at end of file \ No newline at end of file
const awardType = [
{ confId: 0, confName: '红包' },
{ confId: 1, confName: '实物' },
{ confId: 2, confName: '优惠券' },
{ confId: 3, confName: '谢谢惠顾' }
]
export { awardType,limitPrice, orderManageStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList, exportFn, getExplorer, activityStatusList, transformData, checkSpace }
<template>
<div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container">
<el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
</el-select>
</div>
<div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 460
},
mapWidth: {
type: Number,
default: 740
}
},
data() {
return {
input: [],
address: '',
adrList: [],
lnglat: [],
geocoderAddress: {}
}
},
mounted() {
this.mapInit()
},
methods: {
// initMap() {
// console.log(document.getElementsByTagName('head'))
// var script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = 'https://webapi.amap.com/loader.js'
// document.getElementsByTagName('head')[0].appendChild(script)
// },
mapInit() {
/* eslint-disable */
AMapLoader.load({
/* eslint-enable */
key: '44cc16e43ad7ed3358df507bd0618181', // 申请好的Web端开发者Key,首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
// 需要使用的的插件列表
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.Geocoder'],
AMapUI: {
// 是否加载 AMapUI,缺省不加载
version: '1.1', // AMapUI 版本
plugins: ['overlay/SimpleMarker'] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca, 缺省不加载
version: '2.0' // Loca 版本
}
})
.then(AMap => {
map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true,
cursor: 'move'
})
if (this.lnglat.length) {
this.addMarker(this.lnglat)
}
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
this.geocoder = new AMap.Geocoder()
map.setDefaultCursor('pointer')
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) //加载错误提示
})
},
remoteMethod(query) {
if (query == '') {
return true
}
let _this = this
placeSearch.search(query, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
_this.adrList = result.poiList.pois
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
this.lnglat = position
marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
// draggable: true,
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.setCenter(position)
map.add(marker)
marker.setMap(map)
// this.map.setFitView()
},
getAddress(e) {
let self = this
let position
if (e.type == 'click') {
position = e.lnglat
} else {
let { lng, lat } = e
position = [lng, lat]
}
if (marker) {
map.remove(marker)
marker.setMap(null)
marker = null
}
self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(position, (status, result) => {
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
self.geocoderAddress = result.geocodes[0]
}
})
})
})
},
handleChangeAdr(val) {
if (val) {
var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
}
}
}
</script>
<style scoped lang="scss">
.map-box {
display: flex;
#container {
position: relative;
width: calc(100% - 284px - 16px);
height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
display: flex;
box-sizing: border-box;
width: 284px;
height: 100%;
background-color: #f9f9f9;
padding: 20px;
margin-left: 16px;
line-height: 20px;
.icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" inline="true" class="province" style="padding-left: 0;">
<el-select size="small" v-model="provinceForm.provinceName" clearable :disabled="isDisabled" placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
</el-select>
<el-select size="small" v-model="provinceForm.cityName" clearable :disabled="isDisabled" placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option>
</el-select>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable :disabled="isDisabled" placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding">
<el-option v-for="item in townList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
</el-select>
</el-form>
</div>
</template>
<script>
export default {
name: 'GLProvince',
props: {
// 省市级别,2--只显示省市,3--显示省市区,默认只显示省市
subdistrict: {
type: Number,
default: 2
},
// 省市下拉组件宽度
defaultWidth: {
type: String,
default: '150px'
},
// 组件是否展示,默认展示
provinceView: {
type: Boolean,
default: true
},
isDisabled: {
type: Boolean,
default: false
}
},
data() {
return {
// 所有数据
AllData: [],
// 城市列表
cityList: [],
// 地区列表
townList: [],
provinceForm: {
// 省份名称
provinceName: '',
// 城市名称
cityName: '',
// 地区名称
townName: '',
// 省份代码
provinceCode: '',
// 城市代码
cityCode: '',
// 地区代码
townCode: ''
}
}
},
mounted() {
this.provinceList()
},
methods: {
/*
* @params:传入的为一个key-value的对象
1、keywords --查询关键字,只支持单个关键词语搜索关键词支持:行政区名称、citycode、adcode
列如:this.provinceList({keywords: '山东省'}),这样就可以筛选出山东省下的市、区信息
2、subdistrict --设置显示下级行政区级数,0:不返回下级行政区;1:返回下一级行政区;2:返回下两级行政区;3:返回下三级行政区;
不传的话默认为2,可以在组件中穿,也可以在调用方法的时候传,如果需要展示省市组件,传值最小为2
3、page --最外层的districts最多会返回20个数据,若超过限制,请用page请求下一页数据。
例如page=2;page=3。默认page=1
4、extensions --控制行政区信息中返回行政区边界坐标点; 可选值:base、all;
base:不返回行政区边界坐标点;(默认)
all:只返回当前查询district的边界值,不返回子节点的边界值;目前不能返回乡镇/街道级别的边界值
5、filter -- 按照指定行政区划进行过滤,填入后则只返回该省/直辖市信息,需填入adcode,为了保证数据的正确,强烈建议填入此参数
6、callback -- callback值是用户定义的函数名称,此参数只在output=JSON时有效
7、output --返回数据格式类型,可选值:JSON,XML(默认JSON)
* @return:返回的是一个promise对象,如果不需要展示组件,只需要获取值,可以直接调用方法,异步获取返回值
列如:
const p = this.$refs.provinceForm.provinceList({xxxx(可传值,传值可参考上文params描述) })
p.then(r => {
// r 为返回结果
console.log(r)
})
**/
// 获取省市信息
provinceList(params = {}) {
params ? (params.subdistrict ? '' : (params.subdistrict = this.subdistrict)) : (params.subdistrict = this.subdistrict)
let data = ''
for (let key in params) {
data += '&' + key + '=' + params[key]
}
let path = `https://restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a`
path = path + data
const pro = fetch(path).then(res => {
return res.json()
})
if (this.provinceView) {
pro.then(r => {
this.AllData = r.districts[0].districts
})
}
return pro
},
// 省市回显
init(province, city, town) {
this.provinceForm = {
provinceName: province,
cityName: city,
townName: town
}
if (province) {
this.AllData.map(item => {
if (item.name.indexOf(province) != -1) {
this.provinceForm.provinceName = item.name
this.cityList = item.districts
this.provinceForm.provinceCode = item.adcode
if (city) {
this.cityList.map(itm => {
if (itm.name.indexOf(city) != -1) {
this.provinceForm.cityCode = itm.adcode
this.provinceForm.cityName = itm.name
this.townList = itm.districts
if (town) {
this.townList.map(itmx => {
if (itmx.name.indexOf(town) != -1) {
this.provinceForm.townCode = itmx.adcode
this.provinceForm.townName = itmx.name
}
})
}
}
})
}
}
})
}
},
// 选择省
selectProvince(val) {
this.provinceForm.cityName = ''
this.provinceForm.townName = ''
this.cityList = val.districts
this.$emit('selectProvince', { provinceName: val.name, provinceCode: val.adcode })
},
// 选择市
selectCity(val) {
this.provinceForm.townName = ''
this.townList = val.districts
this.$emit('selectCity', { cityName: val.name, cityCode: val.adcode })
},
// 选择区
selectTown(val) {
this.$emit('selectTown', { townName: val.name, townCode: val.adcode })
}
}
}
</script>
<style lang="scss">
.province {
display: inline-flex;
.el-select .el-input {
width: auto !important;
}
}
.select-padding {
margin-right: 10px;
}
</style>
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data () {
return {
editor: '',
content: '',
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight: {
type: Number,
default: 240
},
disabled: Boolean
},
mounted () {
this.getEdit()
},
watch: {
'disabled' (n) {
if (n) this.forbidEdit()
}
},
methods: {
getEdit () {
const _this = this
this.editor = new E('#div-demo')
this.editor.config.focus = false
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function (resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit (html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit () {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
<template>
<el-cascader ref="cascader" placeholder="请选择省市区" clearable :props="areaProps" v-model="selectedArea"
@change="handleAreaChange"
:options="areaList"></el-cascader>
</template>
<script>
import areaData from 'china-area-data/v5/data';
export default {
name: 'AreaCascader',
props: {
selectedArea: {
type: Array,
default: () => []
},
key: {
type: String,
default: 'areaCode'
},
checkStrictly: {
type: Boolean,
default: false
}
},
data() {
return {
localSelectedArea: this.selectedArea,
areaProps: {
label: 'label',
value: 'value',
checkStrictly: this.checkStrictly
},
areaList: this.formatAreaData(areaData['86'], 1)
}
},
methods: {
handleAreaChange(value) {
this.$emit('update:selectedArea', value);
},
clearSelectedArea() {
this.$refs.cascader.handleClear();
},
formatAreaData(data, level) {
return Object.keys(data).map(key => {
let item = {
value: key,
label: data[key]
};
if (level < 3 && areaData[key]) {
item.children = this.formatAreaData(areaData[key], level + 1);
}
return item;
});
}
},
watch: {
selectedArea(newVal) {
this.localSelectedArea = newVal;
if (this.localSelectedArea.length === 3){
this.$refs.cascader.toggleDropDownVisible()
}
},
}
}
</script>
<style lang="scss">
.el-cascader-panel {
max-height: 220px;
overflow-y: auto; /* 添加滚动条 */
}
</style>
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
editor: '',
content: '',
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight:{
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
handleEditorClick(e) {
const target = e.target;
console.log(target.nodeName)
if (target.nodeName === 'VIDEO') {
// 视频被点击,移动光标到视频后面
// const range = document.createRange();
// const selection = window.getSelection();
// range.setStartAfter(target); // 设置范围的起点为视频元素之后
// range.collapse(true); // 折叠范围
// selection.removeAllRanges(); // 清除所有范围
// selection.addRange(range); // 添加新范围
}
},
getEdit() {
const _this = this
this.editor = new E('#div-demo')
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.pasteIgnoreImg = true
// this.editor.config.uploadImgHooks = {
// before: (xhr, editer, files) => {
// if(files[0].name === 'image.png') {
// return {
// prevent: true,
// msg: '请您将截图以上传图片的方式显示在文本框中!'
// }
// }
// }
// }
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
// 绑定点击事件处理器
this.editor.$textElem.on('click', this.handleEditorClick)
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
...@@ -8,32 +8,43 @@ ...@@ -8,32 +8,43 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
title: 'scrm-sub-marketing',
response: { response: {
data_key: 'data', data_key: 'data',
message_key: 'message', message_key: 'message',
code_key: 'code', code_key: ['code', 'returnCode'],
code_success_value: '0', code_success_value: '0',
errId_logout_value: '21', errId_logout_value: '21',
code_message_map: {} code_message_map: {}
}, },
request: { request: {
// baseURL: 'http://scrm.test.glsx.com.cn/', baseURL: "https://scrm.dev.glsx.com.cn",
baseURL: 'http://192.168.2.42:8064/', // 设置超时时间
// 设置超时时间 timeout: 180000,
timeout: 180000, // 携带凭证
// 携带凭证 withCredentials: true,
withCredentials: true, // 返回数据类型
// 返回数据类型 responseType: 'json'
responseType: 'json' },
request_common: {
baseURL: "//didicb.glsx.com.cn",
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
}, },
sign: { sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0', v: '1.0.0',
format: 'json', format: 'json',
source: '' source: 'scrm-home'
},
sign_common: {
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: 'glsx'
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
cdn: 'https://www.xxx.cn/static'
} }
...@@ -12,19 +12,19 @@ let cfg = require('./conf.js') ...@@ -12,19 +12,19 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(common) { export const fetchConfig = function (common) {
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
// } // // }
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/62ecda0909756a6f4f85cf9a/outbound/config') // return new Http().get('https://oss-config.dev.glsx.com.cn/mock/62ecda0909756a6f4f85cf9a/outbound/config')
let params = { moduleName: 'outbound', mockUrl: 'https://oss-config.test.glsx.com.cn/mock/62fe2a36abac6ff6ac239d3c/outbound/config',httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } } let params = { moduleName: 'outbound', mockUrl: 'https://oss-config.test.glsx.com.cn/mock/62fe2a36abac6ff6ac239d3c/outbound/config',httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
console.log(common.utils.getConfig(params)) // console.log(common.utils.getConfig(params))
return common.utils.getConfig(params) return common.utils.getConfig(params)
} }
export const config = { export const config = {
install(vue, cfg) { install (vue, cfg) {
vue.prototype.$config = cfg vue.prototype.$config = cfg
} }
} }
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
:tableParams="tableParams" :tableParams="tableParams"
:tableTotal="tableTotal" :tableTotal="tableTotal"
:pageConf="pageConf" :pageConf="pageConf"
@refreshTable="refreshTable"
ref="listRef" ref="listRef"
> >
</GLTable> </GLTable>
......
...@@ -91,6 +91,9 @@ export default { ...@@ -91,6 +91,9 @@ export default {
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
padding-top: 4px; padding-top: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
&:hover { &:hover {
opacity: 0.95; opacity: 0.95;
......
...@@ -74,6 +74,9 @@ export default { ...@@ -74,6 +74,9 @@ export default {
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
padding-top: 4px; padding-top: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
&:hover { &:hover {
opacity: 0.95; opacity: 0.95;
......
...@@ -150,10 +150,8 @@ export default { ...@@ -150,10 +150,8 @@ export default {
limitSize: 10, limitSize: 10,
maxPhotoNum: 1, maxPhotoNum: 1,
suffixSlot: 'cardCover', suffixSlot: 'cardCover',
beforeLoading: true,
handleUpload: async (e, file, targetItem) => { handleUpload: async (e, file, targetItem) => {
let loading = this.$loading({
target: document.querySelector('.activity-img'),
})
try { try {
const imgFile = e.target.result, const imgFile = e.target.result,
arrBase64 = imgFile.split(',')[1], arrBase64 = imgFile.split(',')[1],
...@@ -163,10 +161,10 @@ export default { ...@@ -163,10 +161,10 @@ export default {
if (res) { if (res) {
this.configForm[targetItem.name] = res this.configForm[targetItem.name] = res
this.formRef().validateField(targetItem.name) this.formRef().validateField(targetItem.name)
loading.close() this.$loading().close()
} else throw '上传失败' } else throw '上传失败'
} catch (error) { } catch (error) {
loading.close() this.$loading().close()
this.$message(error) this.$message(error)
} }
} }
...@@ -268,6 +266,7 @@ export default { ...@@ -268,6 +266,7 @@ export default {
} }
try { try {
if (index == 2) params.pageNum = pageNum if (index == 2) params.pageNum = pageNum
if(index == 3) params.pageSize = 9999
this.activityObj.loading = true this.activityObj.loading = true
const res = await this.$apis.questionnaire[targetApi](params) const res = await this.$apis.questionnaire[targetApi](params)
let data = res let data = res
...@@ -275,6 +274,7 @@ export default { ...@@ -275,6 +274,7 @@ export default {
data = [...this.activityObj.data, ...res.list] data = [...this.activityObj.data, ...res.list]
this.activityObj.total = res.total this.activityObj.total = res.total
} }
if(index == 3) data = res.list
this.setActivityData(data) this.setActivityData(data)
} catch (error) { } catch (error) {
this.setActivityData() this.setActivityData()
......
...@@ -379,9 +379,10 @@ export default { ...@@ -379,9 +379,10 @@ export default {
let arr = Array.from(new Set([...value.split('\n').map(e => e)])), let arr = Array.from(new Set([...value.split('\n').map(e => e)])),
str = [] str = []
arr.map(i => { arr.map(i => {
if (i && ((type === 1 || type === 2) && str.length < 10 || (type === 4 || type === 5))) { if (i) str.push(i.trim())
str.push(i.trim()) // if (i && ((type === 1 || type === 2) && str.length < 10 || (type === 4 || type === 5))) {
} // str.push(i.trim())
}) })
this.configForm[inputKeyObject[type]] = str.join('\n') this.configForm[inputKeyObject[type]] = str.join('\n')
}, },
......
// dataImportMixin.js
import * as dayjs from 'dayjs';
import url from '@/assets/empty.png'
export default {
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count'},
searchForm: {
selectedArea:[]
},
searchFormData: [
{
label: '模板名称',
name: 'templateName',
type: 'input',
maxlength: 100
},
{
label: '所属渠道',
name: 'merchantName',
type: 'input',
maxlength: 100
}
],
getListApi: this.$apis.redenvelope.activeTmpManageList,
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '模板名称',
prop: 'templateName',
minWidth: 100
},
{
label: '所属渠道',
prop: 'merchantName',
minWidth: 100
},
{
label: '活动形式',
prop: 'activityType',
formatter: cell => {
return {0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘'}[cell.activityType]
}
},
{
label: '创建时间',
minWidth: 100,
prop:'createdTime'
}
]
},
tableSearchForm: {}
}
},
methods: {
},
};
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
type="default"
plain
@click="AddActivityTpl"
>新建
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">活动模板</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
:beforeSearchFn="beforeSearchFn"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import dataImportMixin from "./dataImportMixin";
import repeatMethods from "../common/repeatMethods";
export default {
name: 'DisplayRecord',
mixins: [dataImportMixin,repeatMethods],
data() {
return {
}
},
mounted() {
},
methods: {
AddActivityTpl(){
this.$router.push({
path: '/redEnvelope/components/ActiveTemplateManagement/add',
})
}
}
}
</script>
<style scoped lang='scss'>
@import "../common/style.scss";
</style>
// dataImportMixin.js
import * as dayjs from 'dayjs';
import url from '@/assets/empty.png'
export default {
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
selectedArea:[]
},
searchFormData: [
{
label: '微信昵称',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '省市区',
addHtml:'regionSlot'
},
{
label: '展示时间',
name: 'showTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
}
],
getListApi: this.$apis.redenvelope.displayListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '手机号',
prop: 'userPhone',
minWidth: 100
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
{
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
minWidth: 100,
prop:'activityName'
},
{
label: '省份',
prop: 'provinces',
minWidth: 100
},
{
label: '城市',
prop: 'city',
minWidth: 150
},
{
label: '区域',
prop: 'districts',
minWidth: 150
},
{
label: '详细地址',
prop: 'address',
minWidth: 100
},
{
label: '展示时间',
prop: 'showTime',
minWidth: 100
},
]
},
tableSearchForm: {}
}
},
methods: {
},
};
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
<div slot="regionSlot">
<regionCascader ref="regionCascader" :selectedArea="searchForm.selectedArea" :checkStrictly="true" @update:selectedArea="val => searchForm.selectedArea = val"></regionCascader>
</div>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
@click="handleExport('displayExportApi')"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">展示记录列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import dataImportMixin from "./dataImportMixin";
import repeatMethods from "../common/repeatMethods";
import regionCascader from "@/components/regionCascader";
import {exportFn} from '@/common/constant'
import {utils} from 'glsx-common'
export default {
name: 'DisplayRecord',
mixins: [dataImportMixin,repeatMethods],
components:{
regionCascader
},
data() {
return {
}
},
mounted() {
},
methods: {
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.handleProvinceParams(params)
this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime');
return params
},
}
}
</script>
<style scoped lang='scss'>
@import "../common/style.scss";
</style>
// dataImportMixin.js
import * as dayjs from 'dayjs';
import url from '@/assets/empty.png'
export default {
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
selectedArea:[]
},
searchFormData: [
{
label: '微信昵称',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '省市区',
addHtml:'regionSlot'
},
{
label: '状态',
name: 'status',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '中奖', id: '0' },
{ text: '未中奖', id: '1' },
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '抽奖时间',
name: 'openTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
}
],
getListApi: this.$apis.redenvelope.drawListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '手机号',
prop: 'userPhone',
minWidth: 100
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
{
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
minWidth: 100,
prop:'activityName'
},
{
label: '省份',
prop: 'provinces',
minWidth: 100,
},
{
label: '城市',
prop: 'city',
minWidth: 150
},
{
label: '区域',
prop: 'districts',
minWidth: 150
},
{
label: '详细地址',
prop: 'address',
minWidth: 100
},
{
label: '状态',
minWidth: 150,
addHtml:'statusStr'
},
{
label: '抽奖时间',
prop: 'openTime',
minWidth: 100
},
]
},
tableSearchForm: {}
}
},
methods: {
},
};
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
<div slot="regionSlot">
<regionCascader ref="regionCascader" :selectedArea="searchForm.selectedArea" :checkStrictly="true" @update:selectedArea="val => searchForm.selectedArea = val"></regionCascader>
</div>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
@click="handleExport('drawExportApi')"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">抽奖列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<template slot="statusStr" slot-scope="scope">
<div class="table_circular_flex">
<div :class="['table_circular',colorFee[scope.scope.statusStr]]">
</div>
<span>{{scope.scope.statusStr}}</span>
</div>
</template>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
:beforeSearchFn="beforeSearchFn"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import regionCascader from "@/components/regionCascader";
import dataImportMixin from "./dataImportMixin";
import repeatMethods from "../common/repeatMethods";
const STAGE_COLOR = Object.freeze({
'中奖':'circular_green',
'未中奖':'circular_gray'
})
export default {
name: 'DisplayRecord',
mixins: [dataImportMixin,repeatMethods],
components:{
regionCascader
},
data() {
return {
colorFee : STAGE_COLOR
}
},
mounted() {
},
methods: {
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.handleProvinceParams(params)
this.updateParams(params, 'openTime', 'openTime', 'startOpenTime', 'endOpenTime');
return params
},
}
}
</script>
<style scoped lang='scss'>
@import "../common/style.scss";
</style>
<template>
<GLDialog
mode="mid"
class="muti"
:title="cancelObj.title"
:before-close="handleClose"
@onOk="handleConfirm"
@onCancel="handleClose"
:visible.sync="cancelObj.show"
append-to-body
>
<el-form :model="form" ref="form" label-width="120px">
<!-- 基本信息 -->
<div v-for="(section, index) in cancelObj.infoSections" :key="index" class="form-section">
<h3 class="section-title">{{ section.title }}</h3>
<el-row :gutter="20">
<el-col v-for="(item, index) in section.items" :key="index" :span="12">
<div class="info-field">
<span class="label">{{ item.label }}:</span>
<span class="value" :title="item.value">{{ item.value }}</span>
</div>
</el-col>
</el-row>
</div>
<!-- 快递信息 -->
<div class="form-section">
<h3 class="section-title">核销信息</h3>
<el-form-item label="核销码" prop="cancelNumber" :rules="[{ required: true, message: '核销码不能为空', trigger: 'blur' }]">
<el-input v-model="form.cancelNumber" maxlength="50" show-word-limit></el-input>
</el-form-item>
</div>
</el-form>
</GLDialog>
</template>
<script>
import {afterRangePickerOptions} from "../../RedEnvelopeConfig/edit";
export default {
name: "CancelAfterVerification",
props: {
cancelObj: {
type: Object,
default: () => { }
},
},
data () {
return {
afterRangePickerOptions,
formItemWidth: 'width: 284px;',
size: 'small',
disabled: false,
form: {
cancelNumber: '',
}
}
},
methods:{
handleConfirm(){
this.validateForm().then(() => {
this.$emit('submit', {
...this.form,id:this.cancelObj.id
});
this.handleClose();
}).catch(error => {
this.$message.error(error.message);
});
},
validateForm() {
return new Promise((resolve, reject) => {
this.$refs.form.validate((valid) => {
if (valid) {
resolve();
} else {
reject(new Error('请填写核销码'));
}
});
});
},
handleClose(){
this.$emit('update:cancelObj', {show:false});
this.form = {
cancelNumber : ''
}
}
}
}
</script>
<style scoped lang="scss">
.info-field {
margin-bottom: 10px;
line-height: 16px;
font-size: 14px;
padding: 10px 40px;
border-radius: 4px;
display: flex;
.label {
color: #666666;
}
.value {
width: 170px;
white-space: nowrap; /* 防止内容换行 */
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>
<template>
<el-drawer
:title="title"
:visible.sync="visible"
:size="drawerSize"
direction="rtl"
class="drawer-form"
@close="closeDrawer"
>
<el-form :model="form" ref="form" label-width="120px">
<!-- 基本信息 -->
<div v-for="(section, index) in infoSections" :key="index" class="form-section">
<h3 class="section-title">{{ section.title }}</h3>
<el-row :gutter="20">
<el-col v-for="(item, index) in section.items" :key="index" :span="12">
<div class="info-field">
<span class="label">{{ item.label }}:</span>
<span class="value" :title="item.value">{{ item.value }}</span>
</div>
</el-col>
</el-row>
</div>
<!-- 快递信息 -->
<div class="form-section">
<h3 class="section-title">快递信息</h3>
<el-form-item label="物流公司" prop="logisticsCompany" :rules="[{ required: true, message: '物流公司不能为空', trigger: 'blur' }]">
<el-input v-model="form.logisticsCompany" maxlength="50" show-word-limit></el-input>
</el-form-item>
<el-form-item label="物流单号" prop="logisticsOrderNo" :rules="[{ required: true, message: '物流单号不能为空', trigger: 'blur' }]">
<el-input v-model="form.logisticsOrderNo" maxlength="50" show-word-limit></el-input>
</el-form-item>
</div>
</el-form>
<!-- 底部按钮 -->
<div class="drawer-footer">
<el-button size="small" @click="closeDrawer">取消</el-button>
<el-button size="small" type="primary" @click="submitForm">发货</el-button>
</div>
</el-drawer>
</template>
<script>
export default {
props: {
title: {
type: String,
default: '详细信息'
},
visible: {
type: Boolean,
required: true
},
drawerSize: {
type: String,
default: '50%'
},
goodsObj:{
type: Object,
default: () => {}
},
infoSections: Array // 传入的数据结构数组
},
data() {
return {
form: {
logisticsCompany: '',
logisticsOrderNo: '',
}
};
},
methods: {
closeDrawer() {
this.$emit('update:visible', false);
this.form = {
logisticsCompany: '',
logisticsOrderNo: ''
}
},
validateForm() {
return new Promise((resolve, reject) => {
this.$refs.form.validate((valid) => {
if (valid) {
resolve();
} else {
reject(new Error('请填写完整的快递信息'));
}
});
});
},
submitForm() {
this.validateForm().then(() => {
this.$emit('submit', {...this.form,...this.goodsObj});
this.closeDrawer();
}).catch(error => {
this.$message.error(error.message);
});
}
}
};
</script>
<style lang="scss" scoped>
.drawer-form {
/deep/.el-drawer__body{
padding: 16px;
}
.form-section {
margin-bottom: 20px;
.section-title {
margin-bottom: 10px;
color: #333;
font-size: 16px;
font-weight: bold;
}
.info-field {
margin-bottom: 10px;
line-height: 16px;
font-size: 14px;
padding: 10px 40px;
border-radius: 4px;
display: flex;
.label {
color: #666666;
}
.value {
width: 170px;
white-space: nowrap; /* 防止内容换行 */
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.drawer-footer {
position: fixed;
bottom: 8px;
right: 8px;
.el-button {
margin-left: 8px;
}
}
}
</style>
// dataImportMixin.js
import * as dayjs from 'dayjs';
import url from '@/assets/empty.png'
export default {
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
},
searchFormData: [
{
label: '微信昵称',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '核销类型',
name: 'exchangeType',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '快递到家', id: '0' },
{ text: '到店核销', id: '1' }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '核销状态',
name: 'exchangeStatus',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '待发货', id: '0' },
{ text: '已发货', id: '1' },
{ text: '待核销', id: '2' },
{ text: '已核销', id: '3' }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '奖品名称',
name: 'prizeName',
type: 'input',
maxlength: 11
},
{
label: '核销时间',
name: 'exchangeTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
}
],
getListApi: this.$apis.redenvelope.winningGoodsApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '手机号',
prop: 'userPhone',
minWidth: 100
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
{
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
minWidth: 100,
prop: 'activityName',
},
{
label: '奖品名称',
minWidth: 100,
prop: 'prizeName',
},
{
label: '核销类型',
minWidth: 150,
formatter: cell => {
return {0: '快递到家', 1: '到店核销'}[cell.exchangeType]
}
},
{
label: '核销状态',
minWidth: 150,
addHtml:'statusStr'
},
{
label: '核销时间',
prop: 'operateTime',
minWidth: 100
},
]
},
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '发货',
attrs: {
type: 'text',
},
condition: row => row.statusStr == '待发货',
listeners: {
click: row => this.handleDeliverGoods(row)
}
},
{
type: 'el-button',
name: '核销',
attrs: {
type: 'text',
},
condition: row => row.statusStr == '待核销',
listeners: {
click: row => this.cancelAfterVerification(row)
}
}
],
tableSearchForm: {}
}
},
methods: {
// 更新发货/核销展示的数据
updateInfoSections(row, title) {
let sectionIndex = this.infoSections.findIndex(item => item.title === title);
if (sectionIndex !== -1) {
this.infoSections[sectionIndex].items = this.infoSections[sectionIndex].items.map(item => ({
...item,
value: item.key && row.hasOwnProperty(item.key) ? row[item.key] : '-'
}));
}
return sectionIndex
},
// 列表发货处理
async handleDeliverGoods(row) {
await this.getExpressInfo(row)
this.goodsObj ={id:row.awardInfoId}
this.updateInfoSections(row, '基本信息');
this.isDrawerVisible = true;
},
// 通过接口获取快递到家信息
async getExpressInfo(row) {
try {
const receiveGoodsIndex = this.infoSections.findIndex(item => item.title === '收货信息');
if (receiveGoodsIndex === -1) {
// 如果找不到收货信息的索引,可能需要处理或提示
return;
}
const params = { awardInfoId: row.awardInfoId };
const res = await this.$apis.redenvelope.queryExpressInformation(params);
res.writeDetailList.forEach(expressItem => {
const infoItem = this.infoSections[receiveGoodsIndex].items.find(info => info.label === expressItem.describeMsg);
if (infoItem) {
infoItem.value = expressItem.detail || '-';
}
});
} catch (error) {
// 异常处理逻辑,例如显示错误消息
this.$message.error('获取快递信息失败');
}
},
// 列表核销处理
cancelAfterVerification(row){
let basicInfoIndex = this.updateInfoSections(row, '基本信息');
this.cancelObj = {
show: true,
title: '核销',
id: row.awardInfoId || '',
infoSections:[this.infoSections[basicInfoIndex]]
}
}
},
};
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
@click="handleExport('winningGoodsExportApi')"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">实物奖品核销列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
<template slot="statusStr" slot-scope="scope">
<div class="table_circular_flex">
<div :class="['table_circular',colorFee[scope.scope.statusStr]]">
</div>
<span>{{scope.scope.statusStr}}</span>
</div>
</template>
</GLTable>
</div>
<DeliverGoods :title="'发货'"
:visible.sync="isDrawerVisible"
:infoSections="infoSections"
:goodsObj = "goodsObj"
@submit="handleShipping"></DeliverGoods>
<CancelAfterVerification ref="afterVerification" :cancelObj.sync="cancelObj" @submit="handleCancel"></CancelAfterVerification>
<GLDialog
title="提示"
:has-footer="false"
:visible.sync="tipsObj.show"
mode="small"
>
<template #default>
<div class="over-box">
<div :class="tipsObj.iconType"></div>
<div class="tips">{{ tipsObj.text }}</div>
</div>
</template>
</GLDialog>
</div>
</template>
<script type='text/ecmascript-6'>
import dataImportMixin from "./dataImportMixin";
import repeatMethods from "../common/repeatMethods";
import DeliverGoods from "./cpns/DeliverGoods";
import CancelAfterVerification from "./cpns/CancelAfterVerification";
const STAGE_COLOR = Object.freeze({
'已发货':'circular_green',
'待发货':'circular_yellow',
'待核销':'circular_yellow',
'已核销':'circular_green',
})
export default {
name: 'DisplayRecord',
mixins: [dataImportMixin,repeatMethods],
components:{
DeliverGoods,
CancelAfterVerification
},
data() {
return {
colorFee : STAGE_COLOR,
tipsObj:{
show:false,
text:'',
iconType:'el-icon-success'
},
goodsObj:{},
isDrawerVisible:false,
infoSections: [
{
title: '基本信息',
items: [
{ label: '活动名称', value: '',key:'activityName' },
{ label: '客户手机号', value: '',key:'userPhone'},
{ label: '微信昵称', value: '',key:'wechatName' },
{ label: '奖品名称', value: '',key:'prizeName' },
]
},
{
title: '收货信息',
items: [
{ label: '收件人', value: '',key:'' },
{ label: '联系电话', value: '',key:'' },
{ label: '身份证', value: '',key:'' },
{ label: '收货地址', value: '',key:'' },
{ label: '小区名称', value: '',key:'' },
{ label: '楼栋', value: '',key:'' },
{ label: '房号', value: '',key:'' }
]
},
],
cancelObj:{}
}
},
mounted() {
},
methods: {
async handleOperation(form, operationType) {
const { id, logisticsOrderNo, logisticsCompany, cancelNumber } = form;
const params = operationType === 'shipping' ? {
awardInfoId: id,
logisticsOrderNo,
logisticsCompany
} : {
awardInfoId: id,
code: cancelNumber
};
try {
const res = await this.$apis.redenvelope.goodsAreWrittenOffAndShipped(params);
if (res.code == 0 && res.data == true) {
this.tipsObj = {
show:true,
iconType:'el-icon-success',
text: operationType === 'shipping' ? '发货成功' : '核销成功'
}
if (operationType === 'shipping') {
this.isDrawerVisible = false;
} else {
this.$refs.afterVerification.handleClose();
}
this.handleSearch();
} else {
this.tipsObj = {
show:true,
iconType:'el-icon-error',
text: res.message
}
}
} catch (error) {
this.$message.error('操作失败');
}
},
handleShipping(form) {
this.handleOperation(form, 'shipping');
},
handleCancel(form) {
this.handleOperation(form, 'cancel');
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'exchangeTime', 'exchangeTime', 'startExchangeTime', 'endExchangeTime');
return params
}
}
}
</script>
<style scoped lang='scss'>
@import "../common/style.scss";
.over-box{
.el-icon-success {
font-size: 48px;
color: #67c23a;
}
.el-icon-error {
font-size: 48px;
color: #EB4E4E;
}
.tips{
color: #333333;
font-size: 16px;
font-weight: 600;
}
}
</style>
<template>
<div class="add-wrap">
<div class="container gl-form-page">
<el-form ref="configRef" label-width="154px" :rules="configRules" :model="configForm">
<el-form-item label="活动名称:" prop="activityName" class="m-t-20">
<el-input :size="size" v-model="configForm.activityName" placeholder="请输入" maxlength="25" :disabled="disabled"></el-input>
</el-form-item>
<el-form-item label="所属渠道:" prop="merchantId" class="m-t-20">
<el-select :size="size" v-model="configForm.merchantId" placeholder="请选择" :disabled="disabled" filterable remote :remote-method="remoteMethod" v-reachbottom="onReachBottom" @focus="selectFocus" :loading="loading">
<el-option v-for="item in merchantObj.data" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
<template v-if="merchantObj.nothing">
<div class="nothing">到底了!</div>
</template>
</el-select>
</el-form-item>
<el-form-item label="活动时间:" prop="activityTime" class="m-t-20">
<el-date-picker :size="size" v-model="configForm.activityTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="afterRangePickerOptions"></el-date-picker>
</el-form-item>
<el-form-item label="活动形式:" prop="activityType" class="m-t-20">
<el-radio-group :size="size" v-model="configForm.activityType" style="width: 400px" :disabled="disabled">
<el-radio :label="0">随机红包</el-radio>
<el-radio :label="1">九宫格</el-radio>
<el-radio :label="2">翻牌</el-radio>
<el-radio :label="3">大转盘</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="导入链接:" prop="exportUrl" class="m-t-20">
<div class="activity-link">
<div class="upload-btn">
<el-button size="small">
<i class="el-icon-plus"></i>
上传文件
</el-button>
<input type="file" style="opacity: 0" ref="file" accept="*" @change="uploadFile" />
</div>
<a href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/红包链接.xlsx" target="_blank">下载导入模板</a>
<template v-if="configForm.exportUrl">
<div class="file-info flex">
{{ fileName }}
<div class="el-icon-success"></div>
</div>
</template>
<template v-if="fileError">
<div class="file-info flex error">
<a :href="fileError" target="_blank">下载失败列表</a>
<div class="el-icon-error"></div>
</div>
</template>
</div>
</el-form-item>
</el-form>
</div>
<GLFooter>
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm">提交</el-button>
</GLFooter>
</div>
</template>
<script type='text/ecmascript-6'>
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
import commonFun from '../common/fun.js'
import * as dayjs from 'dayjs'
import { getMerchantListMixin } from '@/mixins'
export default {
mixins: [getMerchantListMixin],
name: '',
props: {
editObj: {
type: Object,
default: () => {}
}
},
data() {
return {
id: this.$route.query.id,
afterRangePickerOptions,
disabled: false,
configForm: {
activityName: '',
merchantId: '',
activityTime: '',
activityType: 0,
exportUrl: ''
},
configRules: {
activityName: [
{
required: true,
message: '请输入活动名称',
trigger: 'blur'
}
],
merchantId: [
{
required: true,
message: '请选择所属渠道',
trigger: 'blur'
}
],
activityTime: [
{
required: true,
message: '请输入活动时间',
trigger: 'blur'
}
],
activityType: [
{
required: true
}
],
exportUrl: [
{
required: true,
message: '请导入链接'
}
]
},
fileName: '',
fileError: ''
}
},
created() {
if (this.id) this.getRedEnvelopeActivityDetail()
},
methods: {
async getRedEnvelopeActivityDetail() {
let { id } = this
try {
const { configForm } = this,
res = await this.$apis.redenvelope.getRedEnvelopeActivityDetail({ id }),
merchantId = String(res.merchantId)
this.configForm = {
...configForm,
activityName: res.activityName,
activityType: res.activityType,
merchantId,
activityTime: [dayjs(res.activityStartTime).toDate(), dayjs(res.activityEndTime).toDate()],
id
}
this.merchantObj.data = [
{
confId: merchantId,
confName: res.merchantName
}
]
this.disabled = true
this.configRules.exportUrl[0].required = false
} catch (error) {
this.$message.error(error)
}
},
handleClose() {
// this.configForm = this.$options.data.call(this).configForm
// this.disabled = false
// this.fileError = ''
// this.$refs.configRef.resetFields()
// this.merchantObj.data = []
// this.$emit('update:editObj', {})
this.$router.push('/redEnvelope/index')
},
handleConfirm() {
this.$refs.configRef.validate(async valid => {
if (valid) {
try {
const { configForm, merchantObj } = this
let params = this.$common.utils.deepClone(configForm),
targetName = params.id ? 'updateActivityRedEnvelope' : 'createActivityRedEnvelope'
params.sourceType = 1
params.activityStartTime = dayjs(params.activityTime[0]).format('YYYY-MM-DD')
params.activityEndTime = dayjs(params.activityTime[1]).format('YYYY-MM-DD')
params.merchantName = merchantObj.data.find(e => e.confId == params.merchantId).confName
delete params.activityTime
console.log(JSON.parse(JSON.stringify(params)))
const res = await this.$apis.redenvelope[targetName](params)
if (res) {
this.$message({
message: params.id ? '编辑成功' : '创建成功',
type: 'success'
})
this.handleClose()
} else throw params.id ? '编辑失败' : '创建失败'
} catch (error) {
this.$message.error(error)
}
}
})
},
async uploadFile(e) {
const { id } = this.configForm,
target = id ? 'updateCheckFile' : 'createCheckFile'
try {
const { url, name } = await commonFun.uploadFile(e, this),
params = { exportUrl: url }
if (id) params.id = id
this.$refs.file.value = ''
const res = await this.$apis.redenvelope[target](params)
if (res) {
if (res.totalCount == 0 || res.failCount > 0) {
this.fileError = res.errorUrl
this.$message.error('红包链接导入失败')
this.configForm.exportUrl = ''
return
}
this.$message({
message: '导入成功',
type: 'success'
})
this.fileError = ''
this.configForm.exportUrl = url
this.fileName = name
}
} catch (error) {
console.log(error)
if (error) this.$message.error(error)
this.$refs.file.value = ''
}
}
}
}
</script>
<style scoped lang='scss'>
.container {
padding: 32px 20px;
background: #ffffff;
border-radius: 0 4px 4px 4px;
margin: 16px;
}
.activity-link {
display: flex;
width: 500px;
.upload-btn {
position: relative;
width: 110px;
height: 32px;
.el-button--small {
width: 100%;
height: 100%;
}
input {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
}
a,
.error {
margin-left: 8px;
color: #5850ff;
font-size: 14px;
cursor: pointer;
}
.file-info {
margin-left: 8px;
.el-icon-success {
margin-left: 8px;
color: #67c23a;
}
.el-icon-error {
margin-left: 8px;
color: red;
}
}
}
.nothing {
font-size: 14px;
padding: 0 20px;
white-space: nowrap;
color: #606266;
height: 34px;
line-height: 34px;
text-align: center;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="tabs">
<GLTabs v-model="currentComponent" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<component :is="currentComponent" ref="componentRef"></component>
</div>
</div>
</template>
<script>
export default {
components: {
FreeInnovate: () => import('./FreeAdd.vue'),
OffshoreProcurement: () => import('./OffAdd.vue')
},
data() {
return {
currentComponent: '',
sourceType: this.$route.query.sourceType,
tabPaneList: [
{
label: '自研红包',
name: 'FreeInnovate'
},
{
label: '外采红包',
name: 'OffshoreProcurement'
}
]
}
},
created() {
this.currentComponent = this.sourceType == 1 ? 'OffshoreProcurement' : 'FreeInnovate';
this.handleClick()
},
methods: {
handleClick(e) {
if(this.sourceType){
this.tabPaneList[0].disabled=true
this.currentComponent='OffshoreProcurement'
}
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="container"> <div class="container">
<div class="sticky"> <div class="sticky">
<GLCombiForm <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="sticky-btns"> <div class="sticky-btns">
<div class="btns"> <div class="btns">
<el-button <el-button type="default" plain @click="showEditFun">新建</el-button>
type="default" <el-button type="default" @click="handleExport">导出</el-button>
plain
@click="showEditFun"
>新建</el-button>
<el-button
type="default"
@click="handleExport"
>导出</el-button>
</div> </div>
</div> </div>
</div> </div>
<div class="tabelList"> <div class="tabelList">
<div class="table-title">红包配置列表</div> <div class="table-title">红包配置列表</div>
<GLTable <GLTable ref="listRef" :getListApi="getListApi" :searchForm="tableSearchForm" :noDataImg="url" :tableParams="tableParams" :pageConf="pageConf">
ref="listRef" <span slot="auth-button" slot-scope="scope">
:getListApi="getListApi" <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span> </span>
</GLTable> </GLTable>
</div> </div>
...@@ -50,7 +22,6 @@ ...@@ -50,7 +22,6 @@
<transition name="fade"> <transition name="fade">
<whiteList v-if="whiteListObj.show" :whiteListObj.sync="whiteListObj" :key="whiteListKey"></whiteList> <whiteList v-if="whiteListObj.show" :whiteListObj.sync="whiteListObj" :key="whiteListKey"></whiteList>
</transition> </transition>
</div> </div>
</template> </template>
...@@ -60,12 +31,12 @@ import * as dayjs from 'dayjs' ...@@ -60,12 +31,12 @@ import * as dayjs from 'dayjs'
import linkDetail from './linkDetail.vue' import linkDetail from './linkDetail.vue'
import edit from './edit.vue' import edit from './edit.vue'
import whiteList from './whiteList' import whiteList from './whiteList'
import {exportFn, activityStatusList} from '@/common/constant' import { exportFn, activityStatusList } from '@/common/constant'
export default { export default {
components: {linkDetail, edit, whiteList}, components: { linkDetail, edit, whiteList },
name: 'RedEnvelopeConfig', name: 'RedEnvelopeConfig',
data () { data() {
return { return {
url, url,
whiteListKey: 0, whiteListKey: 0,
...@@ -103,6 +74,18 @@ export default { ...@@ -103,6 +74,18 @@ export default {
type: 'datePicker', type: 'datePicker',
isClear: true isClear: true
}, },
{
label: '创建类型',
name: 'createdSource',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '外采', id: '1' },
{ text: '自研', id: '0' }
],
optionId: 'id',
optionLabel: 'text'
}
], ],
getListApi: this.$apis.redenvelope.getRedEnvelopeConfigList, getListApi: this.$apis.redenvelope.getRedEnvelopeConfigList,
tableParams: { tableParams: {
...@@ -124,7 +107,7 @@ export default { ...@@ -124,7 +107,7 @@ export default {
prop: 'questionCount', prop: 'questionCount',
minWidth: 100, minWidth: 100,
formatter: cell => { formatter: cell => {
return cell.activityStartTime ? `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')} `: '' return cell.activityStartTime ? `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')} ` : ''
} }
}, },
{ {
...@@ -133,16 +116,21 @@ export default { ...@@ -133,16 +116,21 @@ export default {
minWidth: 100 minWidth: 100
}, },
{ {
label: '创建类型',
minWidth: 100,
formatter: cell => {
return { 0: '自研', 1: '外采' }[cell.sourceType]
}
},
{
label: '红包链接总数', label: '红包链接总数',
prop: 'amount', prop: 'amount',
minWidth: 150 minWidth: 150
}, },
{ {
label: '已用总数', label: '已用总数',
prop: 'usedAmount', prop: 'usedAmount',
minWidth: 100 minWidth: 100
}, },
{ {
label: '可用总数', label: '可用总数',
...@@ -153,7 +141,7 @@ export default { ...@@ -153,7 +141,7 @@ export default {
label: '状态', label: '状态',
prop: 'activityStatusStr', prop: 'activityStatusStr',
minWidth: 100 minWidth: 100
}, }
] ]
}, },
// 表格按钮 // 表格按钮
...@@ -162,7 +150,10 @@ export default { ...@@ -162,7 +150,10 @@ export default {
type: 'el-button', type: 'el-button',
name: '编辑', name: '编辑',
attrs: { attrs: {
type: 'text', type: 'text'
},
condition: row => {
return row.sourceType == 1
}, },
listeners: { listeners: {
click: row => this.showEditFun(row) click: row => this.showEditFun(row)
...@@ -172,7 +163,7 @@ export default { ...@@ -172,7 +163,7 @@ export default {
type: 'el-button', type: 'el-button',
name: '链接详情', name: '链接详情',
attrs: { attrs: {
type: 'text', type: 'text'
}, },
listeners: { listeners: {
click: row => this.jumpDetail(row) click: row => this.jumpDetail(row)
...@@ -182,7 +173,7 @@ export default { ...@@ -182,7 +173,7 @@ export default {
type: 'el-button', type: 'el-button',
name: '白名单', name: '白名单',
attrs: { attrs: {
type: 'text', type: 'text'
}, },
listeners: { listeners: {
click: row => this.whiteList(row) click: row => this.whiteList(row)
...@@ -195,11 +186,9 @@ export default { ...@@ -195,11 +186,9 @@ export default {
tableSearchForm: {} tableSearchForm: {}
} }
}, },
mounted () { mounted() {},
},
methods: { methods: {
getParams () { getParams() {
const searchForm = JSON.parse(JSON.stringify(this.searchForm)) const searchForm = JSON.parse(JSON.stringify(this.searchForm))
if (searchForm.activityTime) { if (searchForm.activityTime) {
searchForm.activityStartTime = dayjs(this.searchForm.activityTime[0]).format('YYYY-MM-DD') searchForm.activityStartTime = dayjs(this.searchForm.activityTime[0]).format('YYYY-MM-DD')
...@@ -208,50 +197,60 @@ export default { ...@@ -208,50 +197,60 @@ export default {
delete searchForm.activityTime delete searchForm.activityTime
return searchForm return searchForm
}, },
handleSearch () { handleSearch() {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable() this.$refs.listRef.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch() this.handleSearch()
}, },
jumpDetail (e) { jumpDetail(e) {
this.linkDetailObj = { this.linkDetailObj = {
show: true, show: true,
id: e.id id: e.id
} }
}, },
whiteList(e) { whiteList(e) {
this.whiteListKey++; // 更改key值,强制Vue重新渲染whiteList组件 this.whiteListKey++ // 更改key值,强制Vue重新渲染whiteList组件
setTimeout(() => { setTimeout(() => {
this.whiteListObj = { this.whiteListObj = {
show: true, show: true,
id: e.id id: e.id
}; }
}, ); // 延迟100毫秒,您可以根据需要调整这个值 }) // 延迟100毫秒,您可以根据需要调整这个值
},
showEditFun (e) {
this.editObj = {
show: true,
title: e.id ? '编辑' : '新建',
id: e.id || ''
}
}, },
handleExport () { showEditFun(e) {
this.$apis.redenvelope.exportActivityRedEnvelope({ // this.editObj = {
...this.getParams(), // show: true,
...this.$refs.listRef.page // title: e.id ? '编辑' : '新建',
}).then(res => { // id: e.id || ''
exportFn(res) // }
this.$router.push({
path: `/redEnvelope/components/RedEnvelopeConfig/add`,
query:{
id:e.id,
sourceType:e.sourceType
}
}) })
}, },
handleExport() {
this.$apis.redenvelope
.exportActivityRedEnvelope({
...this.getParams(),
...this.$refs.listRef.page
})
.then(res => {
exportFn(res)
})
}
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.fade-enter-active, .fade-leave-active { .fade-enter-active,
.fade-leave-active {
transition: opacity 0.1s; transition: opacity 0.1s;
} }
.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ { .fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
......
...@@ -78,11 +78,11 @@ export default { ...@@ -78,11 +78,11 @@ export default {
listName: 'data', listName: 'data',
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
// { {
// label: '红包链接', label: '红包链接',
// prop: 'link', prop: 'link',
// minWidth: 180 minWidth: 180
// }, },
{ {
label: '导入时间', label: '导入时间',
prop: 'exportTime', prop: 'exportTime',
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
}, },
{ {
label: '来源', label: '用途',
prop: 'bindingSourceStr', prop: 'bindingSourceStr',
minWidth: 100 minWidth: 100
}, },
...@@ -165,4 +165,4 @@ export default { ...@@ -165,4 +165,4 @@ export default {
width: fit-content; width: fit-content;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -185,6 +185,11 @@ export default { ...@@ -185,6 +185,11 @@ export default {
minWidth: 100 minWidth: 100
}, },
{ {
label: '奖品名称',
prop: 'thirdPrizeName',
minWidth: 100
},
{
label: '中奖金额', label: '中奖金额',
prop: 'thirdPrizeMoney', prop: 'thirdPrizeMoney',
minWidth: 100 minWidth: 100
...@@ -212,6 +217,7 @@ export default { ...@@ -212,6 +217,7 @@ export default {
exportFn(res) exportFn(res)
}) })
}, },
getParams() { getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm)) let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime'); this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime');
......
...@@ -40,6 +40,14 @@ ...@@ -40,6 +40,14 @@
:tableParams="tableParams" :tableParams="tableParams"
:pageConf="pageConf" :pageConf="pageConf"
> >
<template slot="thirdCashOutStatus" slot-scope="scope">
<div class="table_circular_flex">
<div :class="['table_circular',colorFee[scope.scope.thirdCashOutStatus]]">
</div>
<span>{{scope.scope.thirdCashOutStatus}}</span>
</div>
</template>
<span <span
slot="auth-button" slot="auth-button"
slot-scope="scope" slot-scope="scope"
...@@ -62,6 +70,13 @@ import * as dayjs from 'dayjs' ...@@ -62,6 +70,13 @@ import * as dayjs from 'dayjs'
import importRecord from './importRecord.vue' import importRecord from './importRecord.vue'
import {exportFn} from '@/common/constant' import {exportFn} from '@/common/constant'
import inputNumRange from '@/components/inputNumRange' import inputNumRange from '@/components/inputNumRange'
const STAGE_COLOR = Object.freeze({
'提现成功':'circular_green',
'补发成功':'circular_green',
'发放中':'circular_blue',
'提现失败':'circular_red',
'补发失败':'circular_gray',
})
export default { export default {
name: 'RedEnvelopeWithdraw', name: 'RedEnvelopeWithdraw',
...@@ -69,6 +84,7 @@ export default { ...@@ -69,6 +84,7 @@ export default {
data() { data() {
return { return {
url, url,
colorFee : STAGE_COLOR,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'}, pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {}, searchForm: {},
searchFormData: [ searchFormData: [
...@@ -118,6 +134,18 @@ export default { ...@@ -118,6 +134,18 @@ export default {
maxlength: 100 maxlength: 100
}, },
{ {
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '提现金额/元', label: '提现金额/元',
addHtml: 'thirdCashOutMoneySlot', addHtml: 'thirdCashOutMoneySlot',
// type: 'input' // type: 'input'
...@@ -137,7 +165,19 @@ export default { ...@@ -137,7 +165,19 @@ export default {
return false return false
} }
} }
} },
{
label: '提现类型',
name: 'cashOutType',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '自研提现', id: '0' },
{ text: '外采提现', id: '1' },
],
optionId: 'id',
optionLabel: 'text'
},
], ],
getListApi: this.$apis.redenvelope.getRedEnvelopeWithdraw, getListApi: this.$apis.redenvelope.getRedEnvelopeWithdraw,
tableParams: { tableParams: {
...@@ -155,11 +195,29 @@ export default { ...@@ -155,11 +195,29 @@ export default {
minWidth: 100 minWidth: 100
}, },
{ {
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
prop: 'activityName',
minWidth: 100
},
{
label: '流水号', label: '流水号',
prop: 'thirdSerialNumber', prop: 'thirdSerialNumber',
minWidth: 100 minWidth: 100
}, },
{ {
label: '提现类型',
minWidth: 100,
formatter:
cell => {
return {0: '自研提现', 1: '外采提现'}[cell.cashOutType]
}
},
{
label: '提现金额/元', label: '提现金额/元',
prop: 'thirdCashOutMoney', prop: 'thirdCashOutMoney',
minWidth: 100, minWidth: 100,
...@@ -167,8 +225,8 @@ export default { ...@@ -167,8 +225,8 @@ export default {
}, },
{ {
label: '提现状态', label: '提现状态',
minWidth: 100, minWidth: 150,
prop: 'thirdCashOutStatus' addHtml: 'thirdCashOutStatus'
}, },
{ {
label: '提现时间', label: '提现时间',
......
// dataImportMixin.js
import * as dayjs from 'dayjs';
import url from '@/assets/empty.png'
export default {
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
selectedArea:[]
},
searchFormData: [
{
label: '微信昵称',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '奖品类型',
name: 'prizeType',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '红包', id: '0' },
{ text: '实物', id: '1' },
{ text: '优惠券', id: '2' },
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '奖品名称',
name: 'prizeName',
type: 'input',
maxlength: 11
},
{
label: '省市区',
addHtml:'regionSlot'
},
{
label: '金额',
addHtml:'priceSlot'
},
{
label: '状态',
name: 'status',
type: 'select',
maxlength: 100,
optionList: [
{ text: '全部', id: '' },
{ text: '已领取', id: '0' },
{ text: '领取失败', id: '1' },
{ text: '发放中', id: '2' },
{ text: '发放成功', id: '3' },
{ text: '发放失败', id: '4' },
{ text: '待核销', id: '5' },
{ text: '已核销', id: '6' },
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '中奖时间',
name: 'winTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
}
],
getListApi: this.$apis.redenvelope.winningListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '手机号',
prop: 'userPhone',
minWidth: 100
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
{
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
minWidth: 100,
prop: 'activityName',
},
{
label: '奖品类型',
minWidth: 150,
formatter: cell => {
return {0: '红包', 1: '实物', 2: '优惠券'}[cell.prizeType]
}
},
{
label: '奖品名称',
minWidth: 150,
prop:'prizeName'
},
{
label: '金额/元',
prop: 'amount',
minWidth: 100
},
{
label: '省份',
prop: 'provinces',
minWidth: 100,
},
{
label: '城市',
prop: 'city',
minWidth: 150
},
{
label: '区域',
prop: 'districts',
minWidth: 150
},
{
label: '详细地址',
prop: 'address',
minWidth: 100
},
{
label: '状态',
minWidth: 150,
addHtml:'statusStr'
},
{
label: '中奖时间',
prop: 'winTime',
minWidth: 100
},
]
},
tableSearchForm: {}
}
},
methods: {
},
};
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
<div slot="priceSlot">
<inputNumRange :formData="searchForm" :keyObj="{from: 'startAmount', to:'endAmount'}"></inputNumRange>
</div>
<div slot="regionSlot">
<regionCascader ref="regionCascader" :selectedArea="searchForm.selectedArea" :checkStrictly="true" @update:selectedArea="val => searchForm.selectedArea = val"></regionCascader>
</div>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
@click="handleExport('winningExportApi')"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">中奖列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<template slot="statusStr" slot-scope="scope">
<div class="table_circular_flex">
<div :class="['table_circular',colorFee[scope.scope.statusStr]]">
</div>
<span>{{scope.scope.statusStr}}</span>
</div>
</template>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import dataImportMixin from "./dataImportMixin";
import repeatMethods from "../common/repeatMethods";
import inputNumRange from "@/components/inputNumRange";
import regionCascader from "@/components/regionCascader";
const STAGE_COLOR = Object.freeze({
'已领取':'circular_green',
'发放中':'circular_blue',
'待核销':'circular_yellow',
'发放成功':'circular_green',
'已核销':'circular_green',
'领取失败':'circular_red',
'发放失败':'circular_red',
})
export default {
name: 'DisplayRecord',
mixins: [dataImportMixin, repeatMethods],
components: {
inputNumRange,
regionCascader
},
data() {
return {
colorFee : STAGE_COLOR
}
},
mounted() {
},
methods: {
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
params.startAmount = params.startAmount ? params.startAmount * 100 : ''
params.endAmount = params.endAmount ? params.endAmount * 100 : ''
this.handleProvinceParams(params)
this.updateParams(params, 'winTime', 'winTime', 'startWinTime', 'endWinTime');
return params
}
}
}
</script>
<style scoped lang='scss'>
@import "../common/style.scss";
</style>
import {exportFn} from "@/common/constant";
export default {
methods: {
handleSearch() {
this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable()
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.searchForm.hasOwnProperty('selectedArea') && this.$set(this.searchForm, 'selectedArea', []);
this.handleSearch()
},
handleExport(apiName) {
const params = this.getParams()
this.$apis.redenvelope[apiName](params).then(res => {
exportFn(res)
})
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
handleProvinceParams(params){
const { selectedArea } = params;
// 只有当 selectedArea 存在时,才更新省市区 ID
if (selectedArea && selectedArea.length > 0) {
params.provincesId = selectedArea[0] || '';
params.cityId = selectedArea[1] || '';
params.districtsId = selectedArea[2] || '';
}
// 删除 selectedArea 属性
delete params.selectedArea;
return params
},
updateParams(params, paramKey, formKey, beginKey, endKey) {
if (params[paramKey]) {
params[beginKey] = this.searchForm[formKey][0];
params[endKey] = this.searchForm[formKey][1];
delete params[paramKey];
} else {
delete params[beginKey];
delete params[endKey];
}
return params
}
},
}
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.table-title {
font-weight: 700;
font-size: 16px;
color: #333333;
padding-bottom: 18px;
}
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: -23px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
}
}
}
}
}
...@@ -18,14 +18,17 @@ ...@@ -18,14 +18,17 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import RedEnvelopeConfig from './components/RedEnvelopeConfig/index.vue'
import RedEnvelopeRecord from './components/RedEnvelopeRecord/index.vue'
import RedEnvelopeWithdraw from "./components/RedEnvelopeWithdraw/index.vue";
export default { export default {
// 按需加载子组件
components: { components: {
RedEnvelopeConfig, RedEnvelopeConfig: () => import('./components/RedEnvelopeConfig/index.vue'),
RedEnvelopeRecord, RedEnvelopeRecord: () => import('./components/RedEnvelopeRecord/index.vue'),
RedEnvelopeWithdraw RedEnvelopeWithdraw: () => import('./components/RedEnvelopeWithdraw/index.vue'),
DisplayRecord: () => import('./components/DisplayRecord/index.vue'),
DrawRecord: () => import('./components/DrawRecord/index.vue'),
WinningRecord: () => import('./components/WinningRecord/index.vue'),
PhysicalPrizeWriteOff: () => import('./components/PhysicalPrizeWriteOff/index.vue'),
ActiveTemplateManagement: () => import('./components/ActiveTemplateManagement/index.vue')
}, },
name: '', name: '',
data () { data () {
...@@ -37,17 +40,44 @@ export default { ...@@ -37,17 +40,44 @@ export default {
name: 'RedEnvelopeConfig' name: 'RedEnvelopeConfig'
}, },
{ {
label: '红包记录', label: '展示记录',
name: 'RedEnvelopeRecord' name:'DisplayRecord'
},
{
label: '抽奖记录',
name:'DrawRecord'
},
{
label: '中奖记录',
name:'WinningRecord'
}, },
{ {
label: '提现记录', label: '提现记录',
name: 'RedEnvelopeWithdraw' name: 'RedEnvelopeWithdraw'
}, },
{
label: '实物奖品核销',
name:'PhysicalPrizeWriteOff'
},
{
label: '红包记录',
name: 'RedEnvelopeRecord'
},
{
label: '活动模板管理',
name:'ActiveTemplateManagement'
}
] ]
} }
}, },
mounted () { mounted () {
// 检查sessionStorage
const returnFromAddPage = sessionStorage.getItem('returnFromAddPage');
if (returnFromAddPage) {
this.currentComponent = returnFromAddPage;
// 可选:清除sessionStorage中的项
sessionStorage.removeItem('returnFromAddPage');
}
}, },
methods: { methods: {
} }
......
import * as dayjs from 'dayjs'
const generateOptionsArray = function (count = 9) {
return Array.from({ length: count }, (_, index) => ({
optionId: Number(index + 1),
optionLabel: Number(index + 1)
}))
},
required = true,
trigger = 'change'
export const formData = that => {
return [
{
label: '所属渠道',
name: 'merchantId',
width: '432px',
addHtml: 'merchantId'
// attrs: {
// 'filter-method': (e) => {
// that.getMerchantList(e)
// },
// remote: true
// },
// noFilter: false,
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confName',
// isDisabled: false
},
{
label: '群接龙种类',
type: 'radio',
name: 'gameplayType',
optionList: [
{
text: '猜数字',
id: 1
},
],
optionId: 'id',
optionLabel: 'text',
isDisabled: false
},
{
label: '群接龙说明',
name: 'description',
type: 'textBox',
excludeMenus: ['video', 'code', 'table', 'splitLine'],
boxHeight: 240,
width: '592px',
isDisabled: false
},
{
label: '卡片标题',
name: 'title',
type: 'input',
maxlength: 20,
isDisabled: false
},
{
label: '卡片封面',
name: 'cover',
type: 'upload',
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
suffixSlot: 'cover',
beforeLoading: true,
isDisabled: false,
handleUpload: async (e, file, targetItem, config) => {
try {
const { result: imgFile } = e.target,
arrBase64 = imgFile.split(',')[1],
str = file.name.split('.'),
base64 = str.at(-1) + '@' + arrBase64,
res = await that.$apis.common.pictureUpload({ file: base64, fileType: 'image' })
that.$loading().close()
if (res) {
config[targetItem.name] = res
that.formRef.validateField(targetItem.name)
} else throw '上传失败'
} catch (error) {
that.$loading().close()
that.$message(error)
}
}
},
{
label: '数字上限',
name: 'numLimit',
type: 'select',
optionList: generateOptionsArray(),
optionId: 'optionId',
optionLabel: 'optionLabel',
isDisabled: false
},
{
label: '中奖数字',
name: 'numWin',
type: 'select',
optionList: [
{
optionId: 0,
optionLabel: '随机'
},
...generateOptionsArray()
],
optionId: 'optionId',
optionLabel: 'optionLabel',
isDisabled: false
},
{
label: '接龙结束时间',
type: 'radio',
name: 'endTimeLimit',
optionList: [
{
text: '无限制',
id: 0
},
{
text: '选择时间',
id: 1
},
],
optionId: 'id',
optionLabel: 'text',
suffixSlot: 'endTimeLimit',
isDisabled: false
},
{
label: '接龙开奖时间',
name: 'lotteryTime',
addHtml: 'lotteryTime',
isDisabled: false
},
{
label: '转发群限制',
type: 'radio',
name: 'groupLimitOpen',
optionList: [
{
text: '无限制',
id: false
},
{
text: '限制群',
id: true
},
],
optionId: 'id',
optionLabel: 'text',
suffixSlot: 'groupLimitOpen',
isDisabled: false
},
{
label: '关联奖品',
name: 'rewardId',
addHtml: 'rewardId',
isDisabled: false
}
]
}
export const rule = that => {
return {
type: [{ required, message: '请选择接龙种类', trigger }],
merchantId: [{ required, message: '请选择所属渠道', trigger }],
description: [{ required, message: '请输入群接龙说明', trigger }],
title: [{ required, message: '请输入卡片标题', trigger }],
cover: [{ required, message: '请上传卡片封面', trigger }],
numLimit: [{ required }],
numWin: [{ required }],
endTimeLimit: [{
required,
validator: (rule, value, callback) => {
if (that.disabled) callback()
try {
if (value == 1) {
if (!that.configForm.endTime) throw '请选择接龙结束时间'
else {
if (dayjs(that.configForm.endTime).valueOf() < dayjs().valueOf()) throw '接龙结束时间需大于当前时间'
}
}
callback()
} catch (error) {
callback(new Error(error))
}
},
}],
lotteryTime: [{
required, trigger,
validator: (rule, value, callback) => {
try {
if (that.disabled) callback()
if (!value) throw '请选择接龙开奖时间'
else {
const valueTimestamp = dayjs(value).valueOf()
if (that.configForm.endTimeLimit != 1) {
if (valueTimestamp < dayjs().valueOf()) throw '接龙开奖时间需大于当前时间'
} else {
if (valueTimestamp < dayjs(that.configForm.endTime).valueOf()) throw '接龙开奖时间需大于或等于接龙结束时间'
}
}
callback()
} catch (error) {
callback(new Error(error))
}
},
}],
groupLimitOpen: [{
required,
validator: (rule, value, callback) => {
if (value == 1 && !that.configForm.groupLimitList.length) {
callback(new Error('请选择群'))
}
callback()
},
}],
rewardId: [{ required, message: '请选择关联奖品', trigger }]
}
}
export const afterRangePickerOptions = {
disabledDate (time) {
let oneDay = 60 * 60 * 24 * 1000;
return time.getTime() < Date.now() - oneDay
},
}
// computed: {
// afterRangePickerOptions () {
// //这里判断是不是今天
// let newVal = new Date(this.configForm.endTime)
// let selectableRange = '00:00:00 - 23:59:59' //默认的时间范围
// if (
// newVal &&
// newVal.getFullYear() == new Date().getFullYear() &&
// newVal.getMonth() == new Date().getMonth() &&
// newVal.getDate() == new Date().getDate()
// ) {
// //如果为今天,则限制当前时间前的时间+1分钟不能选择。
// selectableRange = new Date().getHours() + ':' + (new Date().getMinutes() + 1) + ':00 - 23:59:59'
// }
// return {
// selectableRange,
// disabledDate (time) {
// // 只能选大于当前截止时间的
// return time.getTime() < Date.now() - 8.64e7
// }
// }
// }
// }
\ No newline at end of file \ No newline at end of file
<template>
<div
@click="chooseRed(data.id,data.couponName)"
:class="['item',{'disabled':disabled},{'active':configForm.rewardId == data.id}]"
>
<div class="radio">
<img src="@/assets/red-radio.png" />
</div>
<div class="icon">
<img src="@/assets/activity-2.png" />
</div>
<div class="icon"></div>
<div class="title">{{ data.couponName }}</div>
<template v-if="[2,3,6].includes(data.effectiveType)">
<div class="type">有效期:
<template v-if="data.effectiveType == 2">
{{ data.effectiveStartTime ? data.effectiveStartTime.split(' ')[0] : '' }}~{{ data.effectiveEndTime ? data.effectiveEndTime.split(' ')[0] : '' }}
</template>
<template v-if="data.effectiveType == 3">
无限制
</template>
<template v-if="data.effectiveType == 6">
{{ data.effectiveDays }}天
</template>
</div>
</template>
<div class="time">使用途径: {{ data.useChannel == 1 ? '线上商品' : '到店核销' }}</div>
<div class="status flex">数量:{{ data.residueAmount || 0 }}</div>
</div>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
data: {
type: Object,
default: () => { }
},
configForm: {
type: Object,
default: () => { }
},
disabled: Boolean
},
data () {
return {
dayjs,
}
},
mounted () {
},
methods: {
chooseRed (rewardId, rewardName) {
const { disabled } = this
if (disabled) return
this.$emit('choose', {
rewardId,
rewardName
})
}
}
}
</script>
<style scoped lang='scss'>
.item {
width: 100%;
height: 96px;
background: #fff;
border-radius: 4px;
box-sizing: border-box;
cursor: pointer;
padding: 0 16px;
font-size: 12px;
color: #999999;
line-height: 17px;
position: relative;
user-select: none;
.icon {
position: absolute;
right: 0;
bottom: 0;
width: 28px;
height: 28px;
}
.radio {
display: none;
}
.title {
font-weight: 500;
font-size: 14px;
color: #333333;
padding: 10px 0 7px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&:hover {
opacity: 0.95;
}
}
.active {
border-color: #5850ff;
.radio {
display: block;
position: absolute;
right: 0;
top: 0;
width: 16px;
height: 16px;
background-color: #5850ff;
border-radius: 0 0 0 4px;
overflow: hidden;
}
&::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border: 1px solid #5850ff;
box-sizing: border-box;
}
}
.disabled {
cursor: not-allowed;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div
@click="chooseRed(data.id,data.goodsName)"
:class="['item',{'disabled':disabled},{'active':configForm.rewardId == data.id}]"
>
<div class="radio">
<img src="@/assets/red-radio.png" />
</div>
<div class="icon">
<img src="@/assets/activity-3.png" />
</div>
<div class="title">品牌:{{ data.brandName }}</div>
<div class="time">商品名称:{{data.goodsName}}</div>
<div class="status flex">券面额:{{Number(data.denomination / 100).toFixed(2)}}</div>
</div>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
data: {
type: Object,
default: () => { }
},
configForm: {
type: Object,
default: () => { }
},
disabled: Boolean
},
data () {
return {
dayjs,
}
},
mounted () {
},
methods: {
chooseRed (rewardId, rewardName) {
const { disabled } = this
if (disabled) return
this.$emit('choose', {
rewardId,
rewardName
})
}
}
}
</script>
<style scoped lang='scss'>
.item {
width: 100%;
height: 75px;
background: #fff;
border-radius: 4px;
box-sizing: border-box;
cursor: pointer;
padding: 0 16px;
font-size: 12px;
color: #999999;
line-height: 17px;
position: relative;
user-select: none;
.icon {
position: absolute;
right: 0;
bottom: 0;
width: 28px;
height: 28px;
}
.radio {
display: none;
}
.title {
padding-top: 12px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
&:hover {
opacity: 0.95;
}
}
.active {
.radio {
display: block;
position: absolute;
right: 0;
top: 0;
width: 16px;
height: 16px;
background-color: #5850ff;
border-radius: 0 0 0 4px;
overflow: hidden;
}
&::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border: 1px solid #5850ff;
box-sizing: border-box;
}
}
.disabled {
cursor: not-allowed;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="tab-box">
<el-tabs
ref="tabs"
v-model="rewardType"
@tab-click="handleClick"
:disabled="disabled"
>
<template v-for="(i,index) in rewardList">
<el-tab-pane
:key="index"
:label="i.label"
:name="i.name"
:disabled="disabled"
>
<template v-if="dataList[i.name].list.length">
<div class="content-box">
<template v-for="(item,ind) in dataList[i.name].list">
<template>
<component
:key="ind"
:is="{
3: 'EquityItem',
2: 'CouponItem',
1: 'RedEnvelopeItem'
}[rewardType]"
:configForm="form"
:data="item"
@choose="choose"
:disabled="disabled"
></component>
</template>
</template>
</div>
<el-pagination
background
@current-change="handleCurrentChange"
:page-size="15"
layout="total, prev, pager, next"
:total="dataList[i.name].total"
>
</el-pagination>
</template>
<template v-else>
<div class="nothing">
<img :src="url">
暂无数据
</div>
</template>
</el-tab-pane>
</template>
</el-tabs>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import EquityItem from './EquityItem.vue'
import CouponItem from './CouponItem.vue'
import RedEnvelopeItem from './RedEnvelopeItem.vue'
export default {
name: 'prize-box',
components: { RedEnvelopeItem, EquityItem, CouponItem },
props: {
form: {
type: Object,
default: () => { }
},
disabled: Boolean
},
data () {
return {
url,
rewardType: 1,
rewardList: [
{ label: '红包活动', name: 1 },
{ label: '商城券', name: 2 },
{ label: '权益卡券', name: 3 },
],
dataList: {
1: {
list: [],
total: 0,
pageNum: 1
},
2: {
list: [],
total: 0,
pageNum: 1
},
3: {
list: [],
total: 0,
pageNum: 1
}
}
}
},
mounted () {
this.init()
},
methods: {
reset () {
this.dataList = this.$options.data.call(this).dataList
this.handleClick()
},
init () {
const { rewardType } = this
this.$nextTick(() => {
this.$refs.tabs.$emit('tab-click', { name: rewardType })
})
},
handleClick () {
this.resetActivePosition(this.$refs.tabs.$el)
this.getActivityList()
},
resetActivePosition ($el) { // tabs的样式修改
this.$nextTick(() => {
const activeEl = $el.querySelector('.el-tabs__item.is-active'),
lineEl = $el.querySelector('.el-tabs__active-bar'),
style = getComputedStyle(activeEl),
pl = style.paddingLeft.match(/\d+/)[0] * 1,
pr = style.paddingRight.match(/\d+/)[0] * 1,
w = style.width.match(/\d+/)[0] * 1
lineEl.style.transform = 'translateX(' + (activeEl.offsetLeft + pl) + 'px)'
lineEl.style.width = (w - pl - pr) + 'px'
})
},
handleCurrentChange (e) {
const { rewardType: index } = this
this.dataList[index].pageNum = e
this.getActivityList()
},
async getActivityList () {
const { rewardType: index } = this,
{ merchantId } = this.form,
{ pageNum } = this.dataList[index],
targetApi = {
1: 'getActivityRedEnvelopeList',
2: 'getMerchantCouponList',
3: 'getEquityActivityList',
}[index],
params = {
merchantId,
pageNum,
pageSize: 15
}
if (!merchantId) return
if (index == 2) {
params.status = 2
params.directionalFlag = 1
params.validlype = 'valid'
params.discountTypes = [2, 3, 4, 7]
}
if (index == 3) {
params.status = 2
params.appearance = 1
}
try {
this.$loading()
const data = await this.$apis.solitaire[targetApi](params)
this.dataList[index].list = data.list
this.dataList[index].total = data.total
this.$loading().close()
} catch (error) {
console.log(error)
this.$loading().close()
}
},
choose ({ rewardId, rewardName }) {
this.$emit('choose', {
rewardId,
rewardName,
rewardType: this.rewardType
})
}
}
}
</script>
<style scoped lang='scss'>
.tab-box {
width: 824px;
padding: 0 20px 20px;
background: #f9f9f9;
/deep/.el-tabs--top {
line-height: 56px;
}
/deep/.el-tabs__item.is-active {
font-weight: 700;
}
/deep/.el-tabs__item.is-disabled{
cursor: not-allowed;
}
/deep/.el-pager {
line-height: 28px;
}
.content-box {
display: flex;
flex-wrap: wrap;
gap: 16px;
margin-top: 5px;
.item{
width: calc(33.33% - 16px);
}
}
.nothing {
display: flex;
flex-direction: column;
padding: 4px 0;
justify-content: center;
align-items: center;
color: #909399;
font-size: 14px;
img {
margin-bottom: 12px;
width: 64px;
height: 40px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!