Commit dad70b5a by 前端

Merge branch 'feat_v3.2.0' into 'develop'

Feat v3.2.0

See merge request !377
2 parents 5b397f04 c8f6aefa
......@@ -15,6 +15,11 @@
"js-message": "1.0.7"
}
},
"@amap/amap-jsapi-loader": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
},
"@ampproject/remapping": {
"version": "2.2.0",
"resolved": "https://registry.npmmirror.com/@ampproject/remapping/-/remapping-2.2.0.tgz",
......@@ -2078,6 +2083,17 @@
"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"
}
},
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz",
......@@ -2119,6 +2135,13 @@
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": 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
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
......@@ -2160,6 +2183,28 @@
"ansi-regex": "^5.0.1"
}
},
"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"
}
},
"wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
......@@ -3567,6 +3612,11 @@
"upper-case": "^1.1.1"
}
},
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
"integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g=="
},
"camelcase-keys": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
......@@ -6644,14 +6694,16 @@
}
},
"glsx-components": {
"version": "1.5.2",
"resolved": "https://registry.npmmirror.com/glsx-components/-/glsx-components-1.5.2.tgz",
"integrity": "sha512-5/LaPu0B1uT7Kzl6oyIqyFT/NXIz2w7HNstiRtHaUQN1waSrPPPtzRRwywJg6CSSL+p994NaqPRnX696NAYzKg==",
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.5.3.tgz",
"integrity": "sha512-tj/2DSGKpbwrlP7ByBZQrgEgCcmrP2iR8p/BafY6BFr0/q4sJuxQx6of586rJuoVUasRveIIuFmUcLCkBSnQFA==",
"requires": {
"@amap/amap-jsapi-loader": "^1.0.1",
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
"glsx-common": "^1.4.9",
"vue": "^2.6.11",
"vue-amap": "^0.5.10",
"vuedraggable": "^2.24.3"
}
},
......@@ -12465,6 +12517,14 @@
"integrity": "sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==",
"dev": true
},
"uppercamelcase": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/uppercamelcase/-/uppercamelcase-1.1.0.tgz",
"integrity": "sha512-C7YEMvhgrvTEKEEVqA7LXNID/1TvvIwYZqNIKLquS6y/MGSkRQAav9LnTTILlC1RqUM8eTVBOe1U/fnB652PRA==",
"requires": {
"camelcase": "^1.2.1"
}
},
"uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmmirror.com/uri-js/-/uri-js-4.4.1.tgz",
......@@ -12646,6 +12706,14 @@
"resolved": "https://registry.npmmirror.com/vue/-/vue-2.6.14.tgz",
"integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ=="
},
"vue-amap": {
"version": "0.5.10",
"resolved": "https://registry.npmjs.org/vue-amap/-/vue-amap-0.5.10.tgz",
"integrity": "sha512-9ViNCev1vx32+zZ5RvF/TmUZNbwL9QrdA2/OnD2GlXMfQBkJy7D08Vb7379t6guqnopDPtWJ8K6gg72h9+4GUg==",
"requires": {
"uppercamelcase": "^1.1.0"
}
},
"vue-cli-plugin-element": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/vue-cli-plugin-element/-/vue-cli-plugin-element-1.0.1.tgz",
......@@ -12741,75 +12809,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": {
"version": "3.5.4",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.5.4.tgz",
......
......@@ -13,7 +13,7 @@
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.5.2",
"glsx-components": "^1.5.3",
"lodash": "^4.17.21",
"node-sass": "^4.0.0",
"vue": "^2.6.10",
......
......@@ -161,4 +161,15 @@ const getMerchantInfoApi = params => {
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, uploadFundingVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi, getMerchantInfoApi }
// 根据商户号最上级工厂商户号
const getSuperMerchantApi = params => {
params.method = 'merchants.api.open.findSuperlativeMerchant'
return http_merchant({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, uploadFundingVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi, getMerchantInfoApi, getSuperMerchantApi }
......@@ -53,6 +53,18 @@ const getGiftInfoApi = params => {
returnAll: true
})
}
// 获取已领取详情
const getReceivedGiftDetail = params => {
params.method = 'scrm.api.coupon.received.directional.gift.detail'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 根据条件获取已领取定向礼包列表
const getReceivedGiftInfoApi = params => {
params.method = 'scrm.api.coupon.user.saas.directional.gift.list'
......@@ -140,4 +152,13 @@ const getQrcode = params => {
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal, getghDirectionalGiftListApi, toVoidGift, getQrcode }
const getGroupGift = params => {
params.method = 'scrm.api.coupon.group.directional.gift.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftDetail, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal, getghDirectionalGiftListApi, toVoidGift, getQrcode, getGroupGift }
import { http,http_merchant } from '@/main'
const getListApi = params => {
params.method = 'scrm.api.coupon.group.directional.gift.page'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
const giftExportApi = params => {
params.method = 'scrm.api.coupon.group.directional.gift.list.export'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
//删除
const deleteGiftApi = params => {
params.method = 'scrm.api.coupon.group.directional.gift.delete'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const getMerchantListApi = params => {
params.method = 'merchants.api.open.findMerchantBySupMerchantNo'
return http_merchant({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const insertGiftApi = params => {
params.method = 'scrm.api.coupon.group.directional.gift.create'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取详情
const getGiftInfoApi = params => {
params.method = 'scrm.api.coupon.group.directional.gift.detail'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 根据条件获取已领取定向礼包列表
const getReceivedGiftInfoApi = params => {
params.method = 'scrm.api.coupon.group.user.saas.directional.gift.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
// returnAll: true
})
}
// 导出已领取礼包
const exportGiftInfoApi = params => {
params.method = 'scrm.api.coupon.group.user.saas.directional.gift.list.export'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
const toVoidGift = params => {
params.method = 'scrm.api.coupon.user.directional.gift.cancel'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getListApi, giftExportApi, deleteGiftApi, getMerchantListApi, insertGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi,toVoidGift }
\ No newline at end of file
......@@ -126,4 +126,15 @@ const confirmReceiptGoodsApi = params => {
})
}
export default { getListApi, getCountApi, getOrderDetailApi, orderExportApi, writeOffApi, crowdFundWriteOffApi, crowdFundRefundApi, addDeliveryApi, examineDetailApi, examineAllowApi, confirmReceiptGoodsApi }
// 审计-特殊账号
const checkMerchartApi = params => {
params.method = 'scrm.api.shopmall.import.merchant.check'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getListApi, getCountApi, getOrderDetailApi, orderExportApi, writeOffApi, crowdFundWriteOffApi, crowdFundRefundApi, addDeliveryApi, examineDetailApi, examineAllowApi, confirmReceiptGoodsApi, checkMerchartApi }
......@@ -171,6 +171,16 @@ const getLiveListApi = params => {
sign: true
})
}
/**定金收款账户下拉列表 */
const getPayListApi = params => {
params.method = 'scrm.api.shopmall.activity.payment.account.list'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
/**数据看板员工排名 */
const getRankListApi = params => {
......@@ -202,4 +212,59 @@ const getDataBoardApi = params => {
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi }
/**每日订单量统计 */
const getDailyOrderQuantityStatistics = params => {
params.method = 'scrm.api.shopmall.activity.daily.order.quantity'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**导出每日订单量统计 */
const exportDailyOrderQuantityStatistics = params => {
params.method = 'scrm.api.shopmall.activity.daily.order.quantity.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**活动直播间数据统计-详情导出 */
const liveroomDetailexport = params => {
params.method = 'scrm.api.shopmall.activity.liveroom.detailexport'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**活动直播间数据统计-分页详情 */
const liveroomDetailpage = params => {
params.method = 'scrm.api.shopmall.activity.liveroom.detailpage'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**活动直播间数据统计-概览 */
const liveroomOverview = params => {
params.method = 'scrm.api.shopmall.activity.liveroom.overview'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default { exportDailyOrderQuantityStatistics, liveroomDetailexport, liveroomDetailpage, getDailyOrderQuantityStatistics, liveroomOverview, getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getPayListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi }
......@@ -102,13 +102,16 @@ const orderManageStatusList = [
{ confId: '1', confName: '待付款' },
{ confId: '2', confName: '已支付' },
{ confId: '3', confName: '已失效' },
{ confId: '21', confName: '待收货(待核销)' },
{ confId: '22', confName: '已收货(已核销)' },
// { confId: '21', confName: '待收货(待核销)' },
{ confId: '21', confName: '待核销' },
{ confId: '22', confName: '已核销' },
// { confId: '22', confName: '已收货(已核销)' },
{ confId: '6', confName: '待发货' },
// { confId: '7', confName: '待核销' },
// { confId: '8', confName: '已核销' },
{ confId: '9', confName: '售后中' },
{ confId: '10', confName: '售后完成' }
{ confId: '10', confName: '售后完成' },
{ confId: '11', confName: '待审批' }
]
const afterSaleStatusList = [
......@@ -225,7 +228,20 @@ const stateList = [
confName: '已下架'
}
]
const businessType = [
{
optionId: 1,
optionLabel: '1.2'
},
{
optionId: 2,
optionLabel: '1.3'
},
{
optionId: 3,
optionLabel: '2.0'
}
]
function setMinHeight(calssName = '.edit-container') {
let height = document.querySelector('.header-wrap').clientHeight + 110 + 'px'
let minHeight = 'calc(100vh - ' + height + ')'
......@@ -247,4 +263,4 @@ function isShowBtn(value) {
}
return isShowStatus
}
export { isShowBtn, limitPrice, getExplorer, exportFn, aToExport, downloadIamge, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList, setMinHeight }
export { isShowBtn, limitPrice, getExplorer, exportFn, aToExport, downloadIamge, businessType, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList, setMinHeight }
<!-- 搜索 -->
<template>
<div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']">
<el-form
:ref="formRef"
:inline="true"
:model="formObj"
:rules="formRules"
size="small"
class="glsx-combi-form-block"
>
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item
v-if="!item.isHide"
:key="index"
:id="item.name"
:labelWidth="isEdit ? '154px' : labelWidth"
:class="[{ 'no-label': !item.label, isBlock: isBlock },{'textBox':item.type=='textBox'}]"
:style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }"
:label="item.label"
:prop="item.name"
>
<span
v-if="!item.isHide && item.tips"
class="tips-block"
slot="label"
>
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="[{ 'no-label': !item.label, isBlock: isBlock },{'textBox':item.type=='textBox'}]" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-popover
placement="top"
width="200"
trigger="hover"
:content="item.tips"
>
<img
slot="reference"
class="tips-icon"
src="./images/icon-tip.png"
/>
<el-popover placement="top" width="200" trigger="hover" :content="item.tips">
<img slot="reference" class="tips-icon" src="./images/icon-tip.png" />
</el-popover>
:
</span>
<span
v-else-if="!item.isHide && item.label && !item.tips"
slot="label"
>
<span
class="combi-form-label"
:style="{ width: item.labelWidth || labelWidth }"
>{{ item.label }}:</span>
<span v-else-if="!item.isHide && item.label && !item.tips" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth || labelWidth }">{{ item.label }}:</span>
</span>
<slot
v-if="item.addHtml"
:name="item.addHtml"
:scope="item"
></slot>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'">
<el-input
:placeholder="item.placeholder || '请输入' + item.label"
v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}"
:prefix-icon="item.prefixIcon"
v-model.trim="formObj[item.name]"
:disabled="item.isDisabled"
:maxlength="item.maxlength"
:clearable="item.isClear || false"
:type="item.inputType || 'text'"
:rows="item.rows || 2"
:style="{ width: item.width || defaultWidth }"
:show-word-limit="item.showLimit || false"
:show-password="item.showPass || false"
@keydown.native="e => handleInputDown(e, item)"
>
<span
v-if="item.prepend"
slot="prepend"
>{{ item.prepend }}</span>
<span
v-if="item.append"
slot="suffix"
>{{ item.append }}</span>
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="suffix">{{ item.append }}</span>
</el-input>
<slot
:name="item.suffixSlot"
:scope="item"
></slot>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- 选择框 -->
<div v-else-if="item.type === 'select'">
<el-select
:style="{ width: item.width || defaultWidth }"
v-model="formObj[item.name]"
v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}"
:clearable="item.isClear || false"
:placeholder="item.placeholder || '请选择' + item.label"
:filterable="!item.noFilter"
:disabled="item.isDisabled"
:no-data-text="item.noDataText || '无数据'"
:multiple="item.multiple || false"
:collapse-tags="item.collapseTags || true"
@change="selectAddAttr($event, item)"
>
<el-option
v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
:value="subItem[item.optionId]"
:disabled="subItem.isDisabled || false"
></el-option>
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot
:name="item.suffixSlot"
:scope="item"
></slot>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- radio -->
<div v-else-if="item.type === 'radio'">
<el-radio-group
v-model="formObj[item.name]"
v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}"
:disabled="item.isDisabled"
@change="item.handleRadioChange"
>
<el-radio
v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:disabled="subItem.isDisabled"
:label="subItem[item.optionId]"
>
<el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">
{{ subItem[item.optionLabel] }}
<slot
:name="subItem.suffixSonSlot"
:scope="subItem"
></slot>
<slot :name="subItem.suffixSonSlot" :scope="subItem"></slot>
</el-radio>
</el-radio-group>
<slot
:name="item.suffixSlot"
:scope="item"
></slot>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<el-date-picker
v-else-if="item.type === 'datePicker'"
v-model="formObj[item.name]"
v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}"
:type="item.dateType || 'daterange'"
:disabled="item.isDisabled"
:value-format="item.valueFormat"
:style="{ width: item.width || defaultWidth }"
:clearable="item.isClear || false"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"
></el-date-picker>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<slot
:name="item.prefixSlot"
:scope="item"
></slot>
<div
v-if="!item.isDisabled"
:style="{ width: item.width || defaultWidth }"
>
<div
v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]"
class="activity-img img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
>
<div
class="add"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('addStyle') ? item.uploadStyle.addStyle : ''"
>+</div>
<slot :name="item.prefixSlot" :scope="item"></slot>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<div class="add" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('addStyle') ? item.uploadStyle.addStyle : ''">+</div>
<!-- <span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }}/{{ item.maxPhotoNum }}</span> -->
<span
class="number"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''"
>上传{{ item.uploadType == 'video' ? '视频' : '图片' }}</span>
<input
v-if="item.uploadType == 'video'"
type="file"
style="opacity: 0"
:id="item.name + 'file'"
ref="file"
class="activity-img img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
accept="video/mp4"
@change="e => handleUploadChange(e, item)"
/>
<input
v-else
type="file"
style="opacity: 0"
:id="item.name + 'file'"
ref="file"
class="activity-img img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
accept="image/png, image/jpeg, image/gif, image/jpg"
@change="e => handleUploadChange(e, item)"
/>
<span class="number" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''">上传{{ item.uploadType == 'video' ? '视频' : '图片' }}</span>
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</div>
</div>
<template>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]">
<span v-if="Array.isArray(formObj[item.name])">
<span
v-for="(subItem, subIndex) in formObj[item.name]"
:key="subIndex"
class="muti-imgs img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
>
<video
v-if="item.uploadType == 'video'"
class="img-w-h activity-img"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="typeof subItem == 'object' ? subItem.content : subItem"
></video>
<img
v-else
class="img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="typeof subItem == 'object' ? subItem.content : subItem"
/>
<span
class="img-btns"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
>
<span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem"></video>
<img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem" />
<span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span class="btn-item">
<i
v-show="!item.isDisabled"
class="el-icon-delete"
@click="handleImgDelete(item, subIndex)"
></i>
<i
class="el-icon-zoom-in"
@click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"
></i>
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"></i>
</span>
</span>
</span>
</span>
<span
v-else
class="muti-imgs"
>
<video
v-if="item.uploadType == 'video'"
class="img-w-h activity-img"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="formObj[item.name]"
></video>
<img
v-else
class="img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="formObj[item.name]"
/>
<span
class="img-btns"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
>
<span v-else class="muti-imgs">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]"></video>
<img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]" />
<span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span class="btn-item">
<i
v-show="!item.isDisabled"
class="el-icon-delete"
@click="handleImgDelete(item)"
></i>
<i
class="el-icon-zoom-in"
@click="handleImgLook(formObj[item.name], item)"
></i>
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name], item)"></i>
</span>
</span>
</span>
</div>
</template>
<slot
:name="item.suffixSlot"
:scope="item"
></slot>
<slot :name="item.suffixSlot" :scope="item"></slot>
</template>
<!-- 图文编辑器 -->
<textBox
v-else-if="item.type === 'textBox'"
:ref="item.name + 'TextBox'"
:excludeMenus="item.excludeMenus || ['code']"
@change="e => handleTextBoxChange(e, item)"
@focus="handleTextBoxFocus(item)"
:boxHeight="item.boxHeight"
></textBox>
<div v-else-if="item.type === 'textBox'">
<textBox v-if="!item.isDisabled" :ref="item.name + 'TextBox'" :excludeMenus="item.excludeMenus || ['code']" @change="e => handleTextBoxChange(e, item)" @focus="handleTextBoxFocus(item)" :boxHeight="item.boxHeight"></textBox>
<div v-else v-html="formObj[item.name]"></div>
</div>
<!-- 地图 -->
<div
v-else-if="item.type === 'map'"
class="flex"
>
<Province
ref="provinceForm"
:subdistrict="subdistrict"
:isDisabled="item.isDisabled"
@selectProvince="e => handleSelectProvince(e, item)"
@selectCity="e => handleSelectCity(e, item)"
:provinceView="item.provinceView"
></Province>
<el-input
style="flex: 1;"
v-model="formObj[item.name]"
placeholder="请选择商户地址"
:readonly="item.isReadonly"
></el-input>
<el-button
class="m-l-10"
v-show="!item.isDisabled"
@click="handleSelectMap(item)"
type="primary"
>选择地址</el-button>
<div v-else-if="item.type === 'map'" class="flex">
<Province ref="provinceForm" :subdistrict="subdistrict" :isDisabled="item.isDisabled" @selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)" :provinceView="item.provinceView"></Province>
<el-input style="flex: 1;" :disabled="item.isDisabled" v-model="formObj[item.name]" placeholder="请选择商户地址" :readonly="item.isReadonly"></el-input>
<el-button class="m-l-10" v-show="!item.isDisabled" @click="handleSelectMap(item)" type="primary">选择地址</el-button>
</div>
</el-form-item>
</template>
<slot name="footer"></slot>
</el-form>
<GLDialog
v-if="isImgVisible"
bigTitle="查看"
mode="big"
:visible.sync="isImgVisible"
:close-on-click-modal="false"
@onOk="isImgVisible = false"
@onCancel="isImgVisible = false"
>
<GLDialog v-if="isImgVisible" bigTitle="查看" mode="big" :visible.sync="isImgVisible" :close-on-click-modal="false" @onOk="isImgVisible = false" @onCancel="isImgVisible = false">
<div class="dialog-look">
<video
v-if="dialogObj.uploadType == 'video'"
class="dialog-video"
controls
>
<source
:src="dialogObj.url"
type="video/mp4"
/>
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4" />
</video>
<img
v-else
class="dialog-img"
width="100%"
:src="dialogObj.url"
alt=""
/>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div>
</GLDialog>
<GLDialog
bigTitle="选择地址"
mode="big"
:visible.sync="dialogMapVisible"
@onOk="getAddress"
@onCancel="dialogMapVisible = false"
>
<map-view
v-if="dialogMapVisible"
ref="mapForm"
></map-view>
<GLDialog bigTitle="选择地址" mode="big" :visible.sync="dialogMapVisible" @onOk="getAddress" @onCancel="dialogMapVisible = false">
<map-view v-if="dialogMapVisible" ref="mapForm"></map-view>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="">取 消</el-button>
<el-button type="primary" @click="getAddress">确 定</el-button>
......@@ -378,7 +121,7 @@ import mapView from './mapView.vue'
import { beforeRangePickerOptions, afterRangePickerOptions } from './common'
export default {
name: 'glsx-combi-form',
data () {
data() {
return {
pickerOption: {
beforeRangePickerOptions: beforeRangePickerOptions,
......@@ -417,10 +160,6 @@ export default {
// 默认是四个字符长度
default: '154px'
},
// labelPaddingRight: {
// type: Number,
// default: 15
// },
formData: {
type: Array,
default: () => []
......@@ -450,23 +189,23 @@ export default {
mapView
},
mounted () { },
mounted() { },
methods: {
// 选择框-添加其他属性
selectAddAttr (value, targetItem) {
selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
},
handleInputDown (e, item) {
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn()
}
},
handleInputBlur (e, item) {
handleInputBlur(e, item) {
item.inputBlur && item.inputBlur(e, item)
},
// 图片
handleUploadChange (e, targetItem) {
handleUploadChange(e, targetItem) {
var reader = new FileReader()
var file = e.srcElement.files[0]
var uploadType = targetItem.uploadType || 'img',
......@@ -515,13 +254,13 @@ export default {
document.getElementById(targetItem.name + 'file').value = ''
},
// 图片删除
handleImgDelete (targetItem, subIndex = -1) {
handleImgDelete(targetItem, subIndex = -1) {
Array.isArray(this.formObj[targetItem.name]) ? this.formObj[targetItem.name].splice(subIndex, 1) : (this.formObj[targetItem.name] = '')
targetItem.handleDelete && targetItem.handleDelete(subIndex)
// this.$emit('handleImgDelete', targetItem)
},
// 图片查看
handleImgLook (src, targetItem) {
handleImgLook(src, targetItem) {
this.isImgVisible = true
this.dialogObj = {
url: src,
......@@ -529,18 +268,18 @@ export default {
}
},
// 获取富文本框内容
handleTextBoxChange (val, targetItem) {
handleTextBoxChange(val, targetItem) {
this.formObj[targetItem.name] = val
},
handleTextBoxFocus (targetItem) {
handleTextBoxFocus(targetItem) {
this.$refs[targetItem.name + 'TextBox'][0].setEdit(this.formObj[targetItem.name])
},
// 禁用富文本
forbidEdit () {
forbidEdit() {
this.$refs.textBox.forbidEdit()
},
// 地图
handleSelectMap (targetItem) {
handleSelectMap(targetItem) {
this.targetItem = targetItem
this.dialogMapVisible = true
this.$nextTick(() => {
......@@ -551,7 +290,7 @@ export default {
}
})
},
getAddress () {
getAddress() {
let mapInfo = this.$refs.mapForm
if (!mapInfo.address) {
this.$message({
......@@ -605,14 +344,14 @@ export default {
this.$refs.provinceForm[0].init(province, city)
},
// 获取省
handleSelectProvince (val, targetItem) {
handleSelectProvince(val, targetItem) {
this.formObj[targetItem.attrObj.fullAddress] = ''
this.formObj[targetItem.attrObj.cityName] = ''
this.formObj[targetItem.attrObj.provinceName] = val.provinceName
this.formObj[targetItem.attrObj.provinceCode] = val.provinceCode
},
// 获取市
handleSelectCity (val, targetItem) {
handleSelectCity(val, targetItem) {
if (val.cityName) {
this.formObj[targetItem.attrObj.cityName] = val.cityName
this.formObj[targetItem.attrObj.cityCode] = val.cityCode
......@@ -709,6 +448,7 @@ export default {
background-color: #f7f7f7;
border: 1px dotted #d9d9d9;
cursor: pointer;
margin-top: 10px;
}
.glsx-combi-form .activity-Input {
......
......@@ -45,6 +45,10 @@ export default {
selectedProInfo: {
type: Object,
default: () => { }
},
propSearch: {
type: Object,
default: () => { }
}
},
......@@ -62,7 +66,8 @@ export default {
goodsStatus: 1,
goodsSource: 1,
pageNum: 1,
pageSize: 100000
pageSize: 100000,
...this.propSearch
}
var that = this
this.$apis.common.getMerchantGoodsListApi(params).then(res => {
......
......@@ -239,6 +239,30 @@ const staticRoutes = Object.freeze([
meta: {}
},
{
name: 'groupGiftBag',
path: '/groupGiftBag/index',
component: resolve => require([`@/views/groupGiftBag/index.vue`], resolve),
meta: {}
},
{
name: 'groupGiftDetail',
path: '/groupGiftBag/giftDetail',
component: resolve => require([`@/views/groupGiftBag/giftDetail.vue`], resolve),
meta: {}
},
{
name: 'groupEditGift',
path: '/groupGiftBag/editGift',
component: resolve => require([`@/views/groupGiftBag/editGift.vue`], resolve),
meta: {}
},
{
name: 'receivedGiftDetail',
path: '/groupGiftBag/receivedGiftDetail',
component: resolve => require([`@/views/groupGiftBag/receivedGiftDetail.vue`], resolve),
meta: {}
},
{
name: 'sopIndex',
path: '/sop/index',
component: resolve => require([`@/views/sop/index.vue`], resolve),
......
......@@ -104,9 +104,8 @@
</el-form-item>
</template>
<template slot="denominationHtml">
<el-input v-model="editForm.denomination" id="denomination" placeholder="请输入面值" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)">
<!-- <span slot="append">元</span> -->
</el-input>
<el-input v-model="editForm.denomination" id="denomination" placeholder="请输入面值" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)"></el-input>
元
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{
selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券'
}}</span>
......@@ -114,9 +113,10 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<!-- <span slot="suffix">张</span> -->
</el-input>
<div v-else>
<el-input :disabled="apear != 'couponAdd'" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
</div>
</template>
<!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 -->
<template slot="goodsHtml">
......@@ -145,11 +145,11 @@
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template>
</glsx-combi-form>
<div v-if="$isGroupUp">
<!-- <div v-if="$isGroupUp">
<p class="edit-title">适用门店配置</p>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule">
</glsx-combi-form>
</div>
</div> -->
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">{{ apear != 'couponSee' ? '取消' : '返回' }}</el-button>
......@@ -202,8 +202,8 @@ export default {
full: '',
goods: '1',
goodsRefList: [],
directionalFlag: '1',
scopeApplication: ''
directionalFlag: '1'
// scopeApplication: ''
},
//商品列表
tableParams: {
......@@ -297,12 +297,12 @@ export default {
isHide: true
},
{
label: '面值/元',
label: '面值',
name: 'denomination',
addHtml: 'denominationHtml'
},
{
label: '库存/张',
label: '库存',
name: 'stock',
addHtml: 'stock'
// width: '150px',
......@@ -326,29 +326,29 @@ export default {
}
],
// 适用门店
merchantRule: {
scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
},
merchantEditFormData: [
{
label: '适用范围',
name: 'scopeApplication',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
optionList: [
{
confId: '1',
confName: '旗下所有店通用'
},
{
confId: '2',
confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
}
]
}
]
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
// },
// merchantEditFormData: [
// {
// label: '适用范围',
// name: 'scopeApplication',
// type: 'radio',
// optionId: 'confId',
// optionLabel: 'confName',
// isDisabled: false,
// optionList: [
// {
// confId: '1',
// confName: '旗下所有店通用'
// },
// {
// confId: '2',
// confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
// }
// ]
// }
// ]
}
},
......@@ -624,9 +624,9 @@ export default {
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.useBarriers = this.editForm.useBarriers + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
if (this.$isGroupUp) {
this.editForm.scopeApplication = this.editForm.scopeApplication + ''
}
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) {
......@@ -723,9 +723,10 @@ export default {
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.stock = form.stock
} else {
obj.scopeApplication = form.scopeApplication
}
// else {
// obj.scopeApplication = form.scopeApplication
// }
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = 1
//有效期或者间隔天数使用次数
......@@ -758,20 +759,21 @@ export default {
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
// var merchantval = true
// var merchantErrorObj = []
// if (this.$isGroupUp) {
// this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
// merchantval = merchantVaild
// merchantErrorObj = errorObj
// })
// }
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
// else if (!merchantval) {
// this.whereToGo(Object.keys(merchantErrorObj)[0])
// }
if (valid) {
if (this.priceFlag && this.editForm.useChannel == 1) {
//存在零售价低于代金券的商品
this.whereToGo('denomination')
......
......@@ -98,9 +98,8 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<!-- <span slot="suffix">张</span> -->
</el-input>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
......@@ -109,10 +108,10 @@
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template>
</glsx-combi-form>
<div v-if="$isGroupUp">
<!-- <div v-if="$isGroupUp">
<p class="edit-title">适用门店配置</p>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule"></glsx-combi-form>
</div>
</div> -->
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">{{ apear != 'couponSee' ? '取消' : '返回' }}</el-button>
......@@ -174,8 +173,8 @@ export default {
effectiveDays: '',
anticipatedCost: '',
discountIntensity: '',
directionalFlag: '1',
scopeApplication: ''
directionalFlag: '1'
// scopeApplication: ''
},
editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
......@@ -215,7 +214,7 @@ export default {
addHtml: 'useLimitHtml'
},
{
label: '库存/张',
label: '库存',
name: 'stock',
addHtml: 'stock'
// width: '180px',
......@@ -245,29 +244,29 @@ export default {
}
],
// 适用门店
merchantRule: {
scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
},
merchantEditFormData: [
{
label: '适用范围',
name: 'scopeApplication',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
optionList: [
{
confId: '1',
confName: '旗下所有店通用'
},
{
confId: '2',
confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
}
]
}
]
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
// },
// merchantEditFormData: [
// {
// label: '适用范围',
// name: 'scopeApplication',
// type: 'radio',
// optionId: 'confId',
// optionLabel: 'confName',
// isDisabled: false,
// optionList: [
// {
// confId: '1',
// confName: '旗下所有店通用'
// },
// {
// confId: '2',
// confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
// }
// ]
// }
// ]
}
},
......@@ -397,9 +396,9 @@ export default {
this.editForm.useBarriers = this.editForm.useBarriers + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
this.editForm.discountIntensity = (this.editForm.discountIntensity / 100).toFixed(2)
if (this.$isGroupUp) {
this.editForm.scopeApplication = this.editForm.scopeApplication + ''
}
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
//使用限制,满多少元可用
if (this.editForm.useBarriers == 2) {
this.editForm.full = this.editForm.full
......@@ -479,9 +478,10 @@ export default {
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.stock = form.stock
} else {
obj.scopeApplication = form.scopeApplication
}
// else {
// obj.scopeApplication = form.scopeApplication
// }
//折扣
obj.discountIntensity = (form.discountIntensity * 100).toFixed(0)
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
......@@ -506,20 +506,21 @@ export default {
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
// var merchantval = true
// var merchantErrorObj = []
// if (this.$isGroupUp) {
// this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
// merchantval = merchantVaild
// merchantErrorObj = errorObj
// })
// }
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
// else if (!merchantval) {
// this.whereToGo(Object.keys(merchantErrorObj)[0])
// }
if (valid) {
var params = this.getCouponInfoParams()
let method = ''
if (params.couponId) {
......
......@@ -96,10 +96,10 @@
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template>
</glsx-combi-form>
<div v-if="$isGroupUp">
<!-- <div v-if="$isGroupUp">
<p class="edit-title">适用门店配置</p>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule"></glsx-combi-form>
</div>
</div> -->
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">{{ apear != 'couponSee' ? '取消' : '返回' }}</el-button>
......@@ -158,8 +158,8 @@ export default {
effectiveTime: [],
effectiveDays: '',
anticipatedCost: '',
directionalFlag: '1',
scopeApplication: ''
directionalFlag: '1'
// scopeApplication: ''
},
editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
......@@ -215,29 +215,29 @@ export default {
}
],
// 适用门店
merchantRule: {
scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
},
merchantEditFormData: [
{
label: '适用范围',
name: 'scopeApplication',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
optionList: [
{
confId: '1',
confName: '旗下所有店通用'
},
{
confId: '2',
confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
}
]
}
]
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
// },
// merchantEditFormData: [
// {
// label: '适用范围',
// name: 'scopeApplication',
// type: 'radio',
// optionId: 'confId',
// optionLabel: 'confName',
// isDisabled: false,
// optionList: [
// {
// confId: '1',
// confName: '旗下所有店通用'
// },
// {
// confId: '2',
// confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
// }
// ]
// }
// ]
}
},
......@@ -344,9 +344,9 @@ export default {
this.editForm.directionalFlag = this.editForm.directionalFlag + ''
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
if (this.$isGroupUp) {
this.editForm.scopeApplication = this.editForm.scopeApplication + ''
}
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) {
......@@ -409,9 +409,10 @@ export default {
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.stock = form.stock
} else {
obj.scopeApplication = form.scopeApplication
}
// else {
// obj.scopeApplication = form.scopeApplication
// }
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = 1
//有效期或者间隔天数使用次数
......@@ -434,20 +435,21 @@ export default {
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
// var merchantval = true
// var merchantErrorObj = []
// if (this.$isGroupUp) {
// this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
// merchantval = merchantVaild
// merchantErrorObj = errorObj
// })
// }
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
// else if (!merchantval) {
// this.whereToGo(Object.keys(merchantErrorObj)[0])
// }
if (valid) {
var params = this.getCouponInfoParams()
let method = ''
if (params.couponId) {
......@@ -465,9 +467,9 @@ export default {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
.finally(() => {
this.loading = false
})
}
})
},
......
......@@ -60,23 +60,22 @@
</el-radio-group>
</div>
</el-form-item>
<el-form-item v-if="!$isGroupUp" size="small" label="会员价/元:" prop="vipPrice">
<el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.vipPrice" placeholder="请输入会员价" @keyup.native="ruleForm.vipPrice = oninput(ruleForm.vipPrice)">
<!-- <span slot="suffix" class="suffix-label">元</span> -->
</el-input>
<el-form-item v-if="!$isGroupUp" size="small" label="会员价:" prop="vipPrice">
<el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.vipPrice" placeholder="请输入会员价" @keyup.native="ruleForm.vipPrice = oninput(ruleForm.vipPrice)"></el-input>
元
</el-form-item>
<el-form-item v-if="!$isGroupUp" size="small" label="门店价/元:" prop="shopPrice">
<el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.shopPrice" placeholder="请输入门店价" @keyup.native="ruleForm.shopPrice = oninput(ruleForm.shopPrice)">
<!-- <span slot="suffix" class="suffix-label">元</span> -->
</el-input>
<el-form-item v-if="!$isGroupUp" size="small" label="门店价:" prop="shopPrice">
<el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.shopPrice" placeholder="请输入门店价" @keyup.native="ruleForm.shopPrice = oninput(ruleForm.shopPrice)"></el-input>
元
</el-form-item>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<el-form-item size="small" label="库存/张:" prop="stock">
<el-form-item size="small" label="库存:" prop="stock">
<!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> -->
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="title == '查看'" v-else class="w-150" v-model="ruleForm.stock" placeholder="请输入库存">
<!-- <span slot="suffix">张</span> -->
</el-input>
<div v-else>
<el-input :disabled="title == '查看'" class="w-150" v-model="ruleForm.stock" placeholder="请输入库存"></el-input>
张
</div>
</el-form-item>
<el-form-item size="small" label="使用说明:" prop="useDescription">
<el-input size="small" :rows="6" :disabled="disabledDescription" type="textarea" v-model="ruleForm.useDescription" placeholder="请输入" maxlength="200" show-word-limit></el-input>
......@@ -86,10 +85,10 @@
</el-form-item>
</el-form>
<div class="edit-container" v-if="$isGroupUp">
<!-- <div class="edit-container" v-if="$isGroupUp">
<p class="edit-title">适用门店配置</p>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="ruleForm" :formData="merchantEditFormData" :formRules="merchantRule"></glsx-combi-form>
</div>
</div> -->
<!-- <div class="serviceCard">
<div class="cardtop">
<img src="@/assets/serviceMemberCard.png" alt="" />
......@@ -229,8 +228,8 @@ export default {
shopPrice: '',
stock: '',
useDescription: '',
daterange: [],
scopeApplication: ''
daterange: []
// scopeApplication: ''
},
copyRuleForm: {},
rules: {
......@@ -257,29 +256,29 @@ export default {
merchantName: '',
title: this.$route.query.title || '',
// 适用门店
merchantRule: {
scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
},
merchantEditFormData: [
{
label: '适用范围',
name: 'scopeApplication',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
optionList: [
{
confId: '1',
confName: '旗下所有店通用'
},
{
confId: '2',
confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
}
]
}
]
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
// },
// merchantEditFormData: [
// {
// label: '适用范围',
// name: 'scopeApplication',
// type: 'radio',
// optionId: 'confId',
// optionLabel: 'confName',
// isDisabled: false,
// optionList: [
// {
// confId: '1',
// confName: '旗下所有店通用'
// },
// {
// confId: '2',
// confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
// }
// ]
// }
// ]
}
},
computed: {
......@@ -358,9 +357,9 @@ export default {
this.ruleForm = res
this.ruleForm.anticipatedCost = (res.anticipatedCost / 100).toFixed(2)
this.ruleForm.customUseLimit = res.useType
if (this.$isGroupUp) {
this.ruleForm.scopeApplication = res.scopeApplication + ''
}
// if (this.$isGroupUp) {
// this.ruleForm.scopeApplication = res.scopeApplication + ''
// }
if (res.effectiveType == 1) {
this.ruleForm.effectiveDays = res.effectiveDays
}
......@@ -390,20 +389,21 @@ export default {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.$refs[formName].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
// var merchantval = true
// var merchantErrorObj = []
// if (this.$isGroupUp) {
// this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
// merchantval = merchantVaild
// merchantErrorObj = errorObj
// })
// }
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
// else if (!merchantval) {
// this.whereToGo(Object.keys(merchantErrorObj)[0])
// }
if (valid) {
if (this.isEdit == true) {
this.updateService()
} else {
......@@ -470,9 +470,10 @@ export default {
params.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
params.stock = this.ruleForm.stock
} else {
params.scopeApplication = this.ruleForm.scopeApplication
}
// else {
// params.scopeApplication = this.ruleForm.scopeApplication
// }
params.useDescription = this.ruleForm.useDescription
params.discountType = 7
......@@ -620,8 +621,8 @@ export default {
.radioGroupWrap {
width: 550px;
height: 164px;
background-color: #f9f9f9;
padding-top: 10px;
// background-color: #f9f9f9;
// padding-top: 10px;
padding-left: 20px;
}
}
......
......@@ -241,17 +241,17 @@ export default {
width: '100px',
addHtml: 'status'
},
{
label: '适用范围',
name: 'scopeApplication',
width: 160,
formatter: cellValue => {
return {
1: '旗下所有店通用',
2: '旗下品牌店通用'
}[cellValue.scopeApplication]
}
},
// {
// label: '适用范围',
// name: 'scopeApplication',
// width: 160,
// formatter: cellValue => {
// return {
// 1: '旗下所有店通用',
// 2: '旗下品牌店通用'
// }[cellValue.scopeApplication]
// }
// },
{
label: '已领取',
prop: 'getAmount'
......@@ -320,10 +320,10 @@ export default {
created() {
this.userInfo = this.$globalState.session
if (!this.$isGroupUp) {
let idx = this.tableParams.tableColumns.findIndex(item => item.label == '适用范围')
this.tableParams.tableColumns.splice(idx, 1)
}
// if (!this.$isGroupUp) {
// let idx = this.tableParams.tableColumns.findIndex(item => item.label == '适用范围')
// this.tableParams.tableColumns.splice(idx, 1)
// }
},
mounted() {
......
......@@ -39,9 +39,6 @@
<!-- 表格区域 end -->
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" :size="size" @click="goback">返回</el-button>
</div>
<!-- 作废 -->
<GLDialog title="作废确认" mode="small" :visible.sync="isCancelVisible" @onOk="handleCancelConfirm" @onCancel="handleCancelClose">
<div class="small-content">
......@@ -64,8 +61,6 @@ export default {
data() {
return {
size: 'small',
footerLeft: '0',
footerWidth: '0',
url: url,
// 作废
isCancelVisible: false,
......@@ -104,10 +99,10 @@ export default {
label: '有效期',
name: 'effectiveTxt'
},
{
label: '适用范围',
name: 'scopeApplicationTxt'
},
// {
// label: '适用范围',
// name: 'scopeApplicationTxt'
// },
{
label: '发行库存',
name: 'limitStockFlag',
......@@ -268,15 +263,13 @@ export default {
components: {},
created() {
if (!this.$isGroupUp) {
let idx = this.couponFormData.findIndex(item => item.label == '适用范围')
this.couponFormData.splice(idx, 1)
}
// if (!this.$isGroupUp) {
// let idx = this.couponFormData.findIndex(item => item.label == '适用范围')
// this.couponFormData.splice(idx, 1)
// }
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.getOptionsList('searchFormData')
this.getInfo(this.$route.params.id)
},
......@@ -348,13 +341,13 @@ export default {
}
}
// 适用范围
if (this.$isGroupUp) {
this.coupon.scopeApplicationTxt =
{
1: '旗下所有店通用',
2: '旗下品牌店通用'
}[coupon.scopeApplication] || '-'
}
// if (this.$isGroupUp) {
// this.coupon.scopeApplicationTxt =
// {
// 1: '旗下所有店通用',
// 2: '旗下品牌店通用'
// }[coupon.scopeApplication] || '-'
// }
})
},
......
......@@ -17,7 +17,8 @@
<template slot="packageName" slot-scope="scope">
<span v-if="$isGroupUp">{{ scope.scope.packageId ? scope.scope.packageName : scope.scope.directionalGiftId ? scope.scope.directionalGiftName : '-' }}</span>
<div v-else>
<p>{{ packageNameTxtObj[scope.scope.receiveWay] }}</p>
<p v-if="scope.scope.receiveWay != 7">{{ packageNameTxtObj[scope.scope.receiveWay] }}</p>
<p v-else>{{ scope.scope.merchantType == 1 ? '通过自店礼包赠送' : '通过集团礼包赠送' }}</p>
<p v-if="scope.scope.receiveWay == 7 && scope.scope.receiveMethod" class="txt-grey text-10">指定{{ scope.scope.receiveMethod == 1 ? '手机号' : '车架号' }}:{{ scope.scope.receiveNumber }}</p>
</div>
</template>
......@@ -60,6 +61,8 @@ export default {
isReload: true,
size: 'small',
searchForm: {
grantMerchantId: '',
verificationMerchantId: '',
couponName: '',
userReq: '',
verificationOperator: '',
......@@ -75,12 +78,32 @@ export default {
// 搜索
searchFormData: [
{
label: '核销码',
name: 'verificationCode',
type: 'input',
label: '发放门店',
name: 'grantMerchantId',
labelWidth: 56,
maxlength: 50
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'merchantList'
},
{
label: '核销门店',
name: 'verificationMerchantId',
labelWidth: 56,
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'merchantList'
},
// {
// label: '核销门店',
// name: 'verificationMerchantName',
// type: 'input',
// isHide: false,
// maxlength: 50
// },
{
label: '券名称',
name: 'couponName',
......@@ -98,13 +121,6 @@ export default {
optionsName: 'discountTypeList'
},
{
label: '核销门店',
name: 'verificationMerchantName',
type: 'input',
isHide: false,
maxlength: 50
},
{
label: '核销人',
name: 'verificationOperator',
type: 'input',
......@@ -113,12 +129,19 @@ export default {
maxlength: 50
},
{
label: '用户',
label: '用户信息',
name: 'userReq',
type: 'input',
labelWidth: 42,
placeholder: '请输入用户手机号',
maxlength: 11
placeholder: '请输入用户昵称或手机号',
maxlength: 50
},
{
label: '核销码',
name: 'verificationCode',
type: 'input',
labelWidth: 56,
maxlength: 50
},
{
label: '核销日期',
......@@ -147,16 +170,11 @@ export default {
tableOption: false,
tableColumns: [
{
label: '核销码',
prop: 'verificationCode',
width: 200
},
{
label: '用户信息',
label: '领取用户',
prop: 'userName',
width: 220,
formatter: cellValue => {
return cellValue.userName + ' ' + cellValue.phone
return cellValue.userName == cellValue.phone ? cellValue.userName : cellValue.userName + ' ' + cellValue.phone
}
},
{
......@@ -180,11 +198,18 @@ export default {
}
},
{
label: '发放门店',
width: 200,
prop: 'grantMerchantName'
},
{
label: '核销门店',
width: 200,
prop: 'verificationMerchantName'
},
{
label: '核销人',
width: 120,
prop: 'verificationOperator'
},
{
......@@ -194,6 +219,11 @@ export default {
width: 240
},
{
label: '核销码',
prop: 'verificationCode',
width: 200
},
{
label: '核销日期',
prop: 'verificationTime',
width: 200,
......@@ -238,20 +268,21 @@ export default {
confName: '服务券'
}
],
packageList: []
packageList: [],
merchantList: []
}
}
},
created() {
if (this.$isGroupUp) {
this.getPackageList()
} else {
this.showOrHideAttr('searchFormData', '券来源', true)
}
this.showOrHideAttr('searchFormData', this.$isGroupUp ? '核销人' : '核销门店', true)
!this.$isGroupUp && this.showOrHideAttr('searchFormData', '券来源', true)
this.deleteAttr(this.$isGroupUp ? ['核销人'] : ['核销门店'])
},
mounted() {
this.getSuperMerchant()
this.getOptionsList('searchFormData')
},
......@@ -272,6 +303,28 @@ export default {
this.getOptionsList('searchFormData', true, 'packageId')
})
},
getSuperMerchant() {
var isFactory = this.$globalState.session.accountLevel == 1
var { merchantId } = this.$globalState?.session || ''
if (isFactory) {
this.getMerchant(merchantId)
return true
}
this.$apis.common.getSuperMerchantApi({ merchantId: merchantId }).then(res => {
merchantId = res
this.getMerchant(merchantId)
})
},
getMerchant(merchantId) {
const param = {
supMerchantNo: merchantId,
merchantAccountLevel: 4
}
this.$apis.groupGiftBag.getMerchantListApi(param).then(res => {
this.baseData.merchantList = res || []
this.getOptionsList('searchFormData')
})
},
// 跳转到礼包领取详情页
couponNameHandleDetail(row) {
// console.log('row', row)
......@@ -409,6 +462,8 @@ export default {
handleReset() {
this.isReload = false
this.searchForm = {
grantMerchantId: '',
verificationMerchantId: '',
couponName: '',
userReq: '',
verificationOperator: '',
......
<template>
<div>
<el-input @blur.stop="formatPhone" type="textarea" v-model="phones" :placeholder="placeholder"></el-input>
<span v-if="isTip" class="approval-tip" style="margin-left:0;">{{ tip }}</span>
<div style="width: 565px;">
<div :class="['tel-item', !item.valid ? 'valid-tel' : receiveType == 1 ? 'realTel' : 'realNum']" v-for="(item, index) in phoneLists" :key="index">
{{ item.tel }}
<i style="cursor:pointer" class="el-icon-close" @click="delPhone(item.tel)"></i>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'phone-area',
model: {
prop: 'newList',
event: 'changePhoneList'
},
props: {
receiveType: {
type: String,
require: true,
default: '1'
},
placeholder: {
type: String,
default: ''
},
isTip: {
type: String,
default: ''
},
phones: {
type: String,
default: ''
},
phoneLists: {
type: Array
}
},
// data() {
// return {
// phones: '',
// phoneLists: []
// }
// },
methods: {
delPhone(val) {
let phones = '\n' + this.phones + '\n'
phones = phones.replace(/[\n]/g, '\n\n')
phones = phones.replace(new RegExp('[\n]' + val + '[\n]', 'g'), '\n')
phones = phones.replace(/[\n]+/g, '\n')
phones = phones.replace(/^[\n]+/, '')
this.phones = phones
this.formatPhone()
},
formatPhone() {
let phoneLists = this.phones.split('\n')
phoneLists = [...new Set(phoneLists)]
// let phoneLists = this.phones.split(/[\n|\s|,|,]/)
let reg
if (this.receiveType == 1) {
reg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
} else {
reg = /^[0-9a-zA-Z]{6}$/
}
let arr = []
phoneLists.forEach(item => {
arr.push({
tel: item,
valid: reg.test(item)
})
})
this.phoneLists = arr.filter(item => item.tel)
this.$emit('changePhoneList', this.phoneLists, this.phones)
},
}
}
</script>
<style scope lang="scss">
.tel-item {
height: 26px;
display: inline-block;
padding: 0 8px;
line-height: 26px;
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
color: #666666;
text-align: center;
margin-right: 4px;
box-sizing: border-box;
}
.valid-tel {
background: #fff1f0;
border: 1px solid #ffa39e;
color: #ff4d4f;
}
.realTel {
width: 130px;
}
.realNum {
width: 90px;
}
.el-textarea {
width: 632px;
}
</style>
<!-- 编辑礼包 -->
<template>
<div class="edit-gift marketing edit-box">
<!-- <div v-if="routeInfo.addOrEdit != 'add'" class="container approval-container">
<p class="edit-title">审批信息</p>
<div class="approval-info">
<div class="approval_label">审批人:{{ editForm.approveBy }}</div>
<div class="approval_label">
审批状态:
<span :style="{ color: approvalStatusColor[approvalStatus] }">{{ approvalStatusVal[approvalStatus] }}</span>
</div>
<div v-if="approvalStatus == 2" class="approval_label">
驳回说明:
<div class="approval_con">{{ editForm.approveExplain }}</div>
</div>
</div>
</div> -->
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="giftTypeSlot">
<div :style="{cursor : routeInfo.receivedStock ? 'not-allowed':'pointer'}" :class="['gift-type',{'active-gift': merchantType==item.value}]" v-for="item in giftTypeList" :key="item.value" @click="changeMerchantType(item.value)">
{{item.name}}
</div>
</div>
<div slot="remarkName" class="edit-tips m-t-8">可根据备注名称进行查找,仅作内部查看,不展示给客户</div>
<el-button slot="selectGiftBtn" :disabled="routeInfo.receivedStock" class="default-blue-btn" @click="handleGiftAdd">选择礼包内容</el-button>
<div style="width: 878px;" slot="selectGroupGiftSlot">
<el-radio :disabled="routeInfo.receivedStock" v-for="(item,index) in groupList" :key="index" v-model="groupDirectionalGiftId" :label="item.id">{{item.name}}</el-radio>
</div>
<div slot="couponListBlock" class="gift-block" :style="{ 'margin-left': defaultLabelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
......@@ -35,7 +29,7 @@
<span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span>
<p :class="['gift-coupon-name', subItem.status == '3' ? ' txt-grey' : '']">{{ subItem.couponName }} × {{ subItem.couponAmount }}</p>
<p v-show="subItem.status == '3'" class="gift-tips">已失效</p>
<i :style="{ cursor: routeInfo.receivedStock ? 'not-allowed' : 'pointer' }" class="el-icon-delete" style="color: #C6C6C6;" @click="handleGiftDelete(item, subIndex)"></i>
<i v-if="merchantType==1" :style="{ cursor: routeInfo.receivedStock ? 'not-allowed' : 'pointer' }" class="el-icon-delete" style="color: #C6C6C6;" @click="handleGiftDelete(item, subIndex)"></i>
</div>
</div>
</div>
......@@ -155,6 +149,7 @@ export default {
phone: '',
isLoaded: true,
loading: false,
merchantType: 1,
tableSearchForm: { staffName: '' },
phoneList: [],
size: 'small',
......@@ -225,6 +220,16 @@ export default {
list: []
}
},
giftTypeList: [
{
name: '自店礼包',
value: 1
},
{
name: '集团礼包',
value: 2
}
],
editRule: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }],
remarkName: [{ required: true, message: '请输入备注名称', trigger: 'change' }],
......@@ -236,9 +241,9 @@ export default {
required: true,
validator: (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入库存数量'))
return callback(new Error('请输入礼包数量'))
} else if (this.routeInfo.id && +this.curStock > +value && this.curReceiveRule != 4) {
return callback(new Error('二次编辑,库存数量不能减少'))
return callback(new Error('二次编辑,礼包数量不能减少'))
} else {
return callback()
}
......@@ -271,11 +276,18 @@ export default {
isEdit: true,
editFormData: [
{
label: '礼包类型',
name:'',
addHtml:'giftTypeSlot',
isHide: false
},
{
label: '礼包名称',
name: 'name',
isDisabled: false,
type: 'input',
maxlength: 15
maxlength: 15,
isHide: false
},
{
label: '备注名称',
......@@ -289,7 +301,14 @@ export default {
{
label: '礼包设置',
name: 'couponList',
addHtml: 'selectGiftBtn'
addHtml: 'selectGiftBtn',
isHide: false
},
{
label:'选择礼包',
name: 'couponList',
addHtml: 'selectGroupGiftSlot',
isHide: true
},
{
label: '',
......@@ -298,7 +317,7 @@ export default {
addHtml: 'couponListBlock'
},
{
label: '库存数量',
label: '礼包数量',
name: 'stock',
addHtml: 'stockNumInput',
isHide: false
......@@ -405,7 +424,9 @@ export default {
isChangeCoupons: true,
isChangePeople: true,
currentCoupons: [],
currentPeople: []
currentPeople: [],
groupDirectionalGiftId: '',
groupList:[]
}
},
components: {
......@@ -419,6 +440,33 @@ export default {
},
deep: true
},
merchantType: {
handler(val){
let target = this.editFormData.find(item => item.addHtml == 'selectGroupGiftSlot')
let setGiftTarget = this.editFormData.find(item => item.addHtml == 'selectGiftBtn')
let nameTarget = this.editFormData.find(item => item.name == 'name')
target.isHide = val == 1
setGiftTarget.isHide = val != 1
nameTarget.isHide = val != 1
if(val == 2){
this.groupDirectionalGiftId = this.groupList[0]?.id
}else{
this.editForm.name = ''
this.groupDirectionalGiftId = ''
}
},
deep: true
},
groupDirectionalGiftId: {
handler(val){
if(this.merchantType == 2){
let target = this.groupList.find(item=> item.id == this.groupDirectionalGiftId)
this.editForm.name = target.name
this.selectGroupGiftFn(target)
}
},
deep: true
},
'editForm.couponList': {
handler(val) {
this.isChangeCoupons = this.judgeAddOrDel(val, this.currentCoupons, 'id')
......@@ -449,6 +497,7 @@ export default {
},
mounted() {
this.setMinHeight()
this.getGroupGift()
this.routeInfo = this.$route.query
if (this.routeInfo.receivedStock) this.routeInfo.receivedStock = +this.routeInfo.receivedStock
this.title = this.titleObj[this.routeInfo.addOrEdit]
......@@ -465,6 +514,48 @@ export default {
}
},
methods: {
changeMerchantType(val){
if(this.routeInfo.receivedStock) return;
this.merchantType = val
if(val==1){
this.orderShow.forEach(item => {
this.couponObj[item].list = []
})
this.editForm.couponList = []
this.hasCouponBlock(false)
}
},
getGroupGift(){
this.loading = true
this.$apis.giftBag.getGroupGift({}).then(res => {
let giftArr = []
if(res?.length){
let Obj = this.$common.utils.deepClone(this.couponObj)
this.orderShow.forEach(item => {
Obj[item].list = []
})
res.forEach(ele => {
let gift = this.$common.utils.deepClone(Obj)
console.log(JSON.stringify(Obj))
const {id, name, couponDTOList} = ele
couponDTOList.forEach(item=>{
gift[this.numToCoupon[item.discountType]].list.push(item)
})
giftArr.push({id, name, gift})
})
this.groupList = this.$common.utils.deepClone(giftArr)
}else{
let target = this.editFormData.find(item => item.addHtml == 'giftTypeSlot')
target.isHide = true
}
}).finally(end =>{
this.loading = false
})
},
selectGroupGiftFn(item){
let gift = this.$common.utils.deepClone(item.gift)
this.handleGiftConfirm(gift, 'group')
},
//员工查询
handleSearch() {
this.$refs?.staffDialog?.getList({}, true)
......@@ -519,6 +610,10 @@ export default {
this.approvalStatus = res.data.approveStatus - 1
this.editForm = res.data
this.curStock = res.data.stock
this.merchantType = res.data.merchantType
this.$nextTick(()=>{
this.groupDirectionalGiftId = res.data.groupDirectionalGiftId
})
this.curReceiveRule = res.data.receiveRule
this.receiveWay = res.data.receiveWay || 1
if (res.data && res.data.receiveDetails) {
......@@ -600,8 +695,11 @@ export default {
this.selectedGiftList = JSON.parse(JSON.stringify(this.couponObj))
this.handleGiftClose()
},
handleGiftConfirm(selectedData) {
this.handleGiftClose()
handleGiftConfirm(selectedData, type) {
console.log(selectedData,'selectedData')
if(type!='group'){
this.handleGiftClose()
}
this.couponObj = selectedData
this.recoveryTotalPrice()
this.recoveryGiftList()
......@@ -655,7 +753,7 @@ export default {
params.staffCreateRequests = this.$common.utils.deepClone(params.staffList)
params.couponCreateRequests = this.$common.utils.deepClone(params.couponList)
params.couponCreateRequests.forEach(item => {
item.couponId = item.id
item.couponId = this.merchantType==2 ? item.couponId: item.id
})
if (this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4) {
params.receiveDetailList = this.phoneList.map(item => item.tel)
......@@ -676,6 +774,8 @@ export default {
}
}
params.requestSource = 1
params.merchantType = this.merchantType
if(this.merchantType==2) params.groupDirectionalGiftId = this.groupDirectionalGiftId
// 插入判断是否存在审批模板
// const { session } = this.$globalState
if (this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4) {
......@@ -785,6 +885,25 @@ export default {
}
}
}
.gift-type{
display: inline-block;
border: 1px solid #D5D5D5;
box-sizing: border-box;
text-align: center;
width: 70px;
height: 20px;
line-height: 20px;
font-weight: 400;
font-size: 12px;
color: rgba(0,0,0,0.65);
cursor: pointer;
}
.active-gift{
background: #5850FF;
border: 1px solid #5850FF;
color: #fff;
}
.approval-tip {
font-size: 12px;
font-weight: 400;
......
......@@ -18,6 +18,7 @@
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="giftNameSlot" class="gift-name-slot">{{editForm.name}} <div class="group-label" v-if="editForm.merchantType==2">集团</div></div>
<div slot="couponListBlock" class="gift-block" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
......@@ -156,7 +157,7 @@ export default {
{
label: '礼包名称',
name: 'name',
type: 'showTxt'
addHtml: 'giftNameSlot'
},
{
label: '备注名称',
......@@ -241,8 +242,9 @@ export default {
methods: {
getInfo() {
this.$apis.giftBag
.getGiftInfoApi({ id: this.routeInfo.id })
const API = this.routeInfo.type == 'received' ? 'getReceivedGiftDetail' : 'getGiftInfoApi'
const paramsKey = this.routeInfo.type == 'received' ? 'userDirectionalGiftId' : 'id'
this.$apis.giftBag[API]({ [paramsKey]: this.routeInfo.id })
.then(res => {
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
......@@ -337,6 +339,22 @@ export default {
}
.marketing.edit-gift {
// 礼包
.gift-name-slot{
display: flex;
align-items: center;
.group-label{
width: 42px;
height: 20px;
line-height: 20px;
text-align: center;
background: rgba(255,101,61,0.15);
border-radius: 4px;
margin-left: 4px;
font-size: 12px;
display: inline-block;
color: #FF653D;
}
}
.gift-block {
width: 878px;
border-radius: 4px;
......
......@@ -28,7 +28,12 @@
</div>
</div>
<div slot="name" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</p>
<div class="gift-name">
<div class="group-label" v-if="scope.scope.merchantType==2">集团</div>
<el-tooltip effect="dark" :content="scope.scope.name" placement="top-start">
<div class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</div>
</el-tooltip>
</div>
</div>
<!-- <div style="display: flex;align-items: center;" slot="approveStatus" slot-scope="scope">
<div class="approve-status" :style="{ 'background-color': approvalStatusColor[scope.scope.approveStatus - 1] }"></div>
......@@ -187,7 +192,7 @@ export default {
label: '礼包名称',
prop: 'name',
addHtml: 'name',
width: 200
width: 280
},
{
label: '备注名称',
......@@ -298,9 +303,11 @@ export default {
// 正式版为:release,体验版为: trial 开发版为:develop
let merchantId = this.$globalState.session.merchantId
const appId = this.getAppId()
let href = window.location.host
let aPath = href.indexOf('cgacar') != -1 ? 'packageEquity/pages/directional/directional' : 'packageShopmall/packageEquity/pages/directional/directional'
const params = {
appId,
path: 'packageEquity/pages/directional/directional',
path: aPath,
envVersion: this.getEnvVersion(),
scene: `id=${this.curId}&merchantId=${merchantId}&staffUUID=${staffId}`
}
......@@ -544,6 +551,30 @@ export default {
}
}
}
.gift-name{
display: flex;
align-items: center;
.group-label{
width: 42px;
height: 20px;
line-height: 20px;
text-align: center;
background: rgba(255,101,61,0.15);
border-radius: 4px;
margin-right: 4px;
font-size: 12px;
color: #FF653D;
}
.cursor-pointer{
height: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 200px;
line-height: 20px;
}
}
.gift-detail {
padding:0 200px 0 10px;
......
......@@ -22,15 +22,18 @@
<!-- 表格区域 开始 -->
<GLTable ref="receivedGiftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<span slot="directionalGiftName" slot-scope="scope">
<el-tooltip effect="dark" :content="scope.scope.directionalGiftName" placement="top-start">
<p class="gift-name" @click="handleDetail(scope.scope)">
{{ scope.scope.directionalGiftName }}
</p>
</el-tooltip>
<span v-if="scope.scope.receiveStatus == 2" class="void-label">已作废</span>
<el-tooltip effect="dark" :content="scope.scope.cancelReason" placement="top-start">
<p class="void-reason" v-if="scope.scope.receiveStatus == 2">作废原因:{{ scope.scope.cancelReason || '--' }}</p>
</el-tooltip>
<div class="gift-name-slot">
<div class="group-label" v-if="scope.scope.merchantType==2">集团</div>
<el-tooltip effect="dark" :content="scope.scope.directionalGiftName" placement="top-start">
<p class="gift-name" @click="handleDetail(scope.scope)">
{{ scope.scope.directionalGiftName }}
</p>
</el-tooltip>
<span v-if="scope.scope.receiveStatus == 2" class="void-label">已作废</span>
<el-tooltip effect="dark" :content="scope.scope.cancelReason" placement="top-start">
<p class="void-reason" v-if="scope.scope.receiveStatus == 2">作废原因:{{ scope.scope.cancelReason || '--' }}</p>
</el-tooltip>
</div>
</span>
<div slot="giftInfo" slot-scope="scope">
<GLTable class="secondTable" ref="giftListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="giftParams" :tableData="scope.scope | filterTable" @setTableFinishFun="setGiftTableFinishFun"></GLTable>
......@@ -279,7 +282,7 @@ export default {
{
label: '礼包名称',
width: 200,
width: 300,
addHtml: 'directionalGiftName'
},
{
......@@ -372,7 +375,7 @@ export default {
this.$router.push({
path: '/giftBag/giftDetail',
query: {
id: row.directionalGiftId,
id: row.id,
type: 'received'
}
})
......@@ -523,6 +526,22 @@ export default {
.secondTable {
padding-left: 10px;
}
.group-label{
width: 42px;
height: 20px;
line-height: 20px;
text-align: center;
background: rgba(255,101,61,0.15);
border-radius: 4px;
margin-right: 4px;
font-size: 12px;
color: #FF653D;
flex-shrink: 0;
}
.gift-name-slot{
display: flex;
align-items: center;
}
.gift-name {
color: #5850ff;
margin: 0;
......@@ -542,7 +561,7 @@ export default {
text-align: center;
line-height: 18px;
background: #eeeded;
margin-top: 2px;
flex-shrink: 0;
}
.void-reason {
font-size: 10px;
......@@ -551,7 +570,6 @@ export default {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin: 4px 0 0;
}
.void-dialog {
/deep/ .el-dialog__body {
......
<!-- 编辑礼包 -->
<template>
<div class="edit-gift marketing edit-box">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<el-button slot="selectGiftBtn" class="default-blue-btn" @click="handleGiftAdd">选择礼包内容</el-button>
<div slot="couponListBlock" class="gift-block" :style="{ 'margin-left': defaultLabelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
<span class="price">{{ totalEstimatedCost }}</span>
元
</div>
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box" v-show="couponObj[item].list.length">
<img class="server-type" :src="require(`@/assets/coupon/icon-${item}.png`)" />
<div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in couponObj[item].list" :key="subIndex">
<span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span>
<p :class="['gift-coupon-name', subItem.status == '3' ? ' txt-grey' : '']">{{ subItem.couponName }} × {{ subItem.couponAmount }}</p>
<p v-show="subItem.status == '3'" class="gift-tips">已失效</p>
<i class="el-icon-delete" style="color: #C6C6C6;" @click="handleGiftDelete(item, subIndex)"></i>
</div>
</div>
</div>
</div>
</div>
<div class="merchant-radio" slot="merchantSlot">
<el-checkbox-group v-model="editForm.merchantList">
<el-checkbox v-for="item in merchantList" :label="item.merchantNo" :key="item.merchantNo">{{item.merchantName}}</el-checkbox>
</el-checkbox-group>
</div>
</glsx-combi-form>
<!-- <div v-if="routeInfo.addOrEdit != 'add'" class="approval_note_container">
<div class="line"></div>
<div class="note_container">
<div class="left">
<span class="mar40">创建时间:{{ editForm.createdDate }}</span>
<span class="">创建人:{{ editForm.createdBy }}</span>
</div>
<div class="right">
<span class="mar40">最后修改时间:{{ editForm.updatedDate }}</span>
<span class="">修改人:{{ editForm.updatedBy }}</span>
</div>
</div>
</div> -->
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">取消</el-button>
<el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter>
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedGiftList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
</div>
</template>
<script>
import selectGiftDialog from './selectGiftDialog.vue'
import * as dayjs from 'dayjs'
export default {
name: 'editGift',
data() {
return {
loading: false,
size: 'small',
title: '新增礼包',
titleObj: {
add: '新增礼包',
edit: '编辑礼包'
},
// 选择员工弹窗
isMutiSelectVisible: false,
// 选择定向礼包弹窗
isSelectGiftVisible: false,
selectedGiftList: [],
editChildRef: 'editChildRef',
routeInfo: {
// add-新增;edit-编辑;detail-详情
addOrEdit: 'add',
id: ''
},
editStatus: false,
receiveWay: 1,
editForm: {
name: '',
// 优惠券类型(discountType) 1:满减券,2:折扣券,3:代金券,4:兑换券,5:购车代金券,6:商品折扣券,7:会员服务
// 优惠券状态(status):1:未生效,2:生效中,3:已失效
couponList: [],
merchantList:[]
},
totalEstimatedCost: '',
orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: {
2: 'discount',
3: 'cash',
4: 'exchange',
7: 'service'
},
couponObj: {
// 折扣券
discount: {
label: '折扣券',
discountType: 2,
list: []
},
// 代金券
cash: {
label: '代金券',
discountType: 3,
list: []
},
// 兑换券
exchange: {
label: '兑换券',
discountType: 4,
list: []
},
// 会员服务
service: {
label: '会员服务',
discountType: 7,
list: []
}
},
editRule: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }],
couponList: [{ required: true, message: '请选择礼包', trigger: 'change' }],
merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }],
},
isEdit: true,
editFormData: [
{
label: '礼包名称',
name: 'name',
isDisabled: false,
type: 'input',
maxlength: 15
},
{
label: '礼包设置',
name: 'couponList',
addHtml: 'selectGiftBtn'
},
{
label: '',
name: 'couponListBlock',
isHide: true,
addHtml: 'couponListBlock'
},
{
label: '下发门店',
name: 'merchantList',
addHtml: 'merchantSlot'
}
],
isChangeCoupons: true,
isChangePeople: true,
currentCoupons: [],
currentPeople: [],
merchantList:[]
}
},
components: {
selectGiftDialog
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
},
'editForm.couponList': {
handler(val) {
this.isChangeCoupons = this.judgeAddOrDel(val, this.currentCoupons, 'id')
}
}
},
mounted() {
this.getMerchant()
this.routeInfo = this.$route.query
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit == 'add' ? '' : this.getInfo()
},
methods: {
getMerchant(){
const { session } = this.$globalState || {}
const param = {
supMerchantNo: session.merchantId,
merchantAccountLevel: 4
}
this.$apis.groupGiftBag.getMerchantListApi(param).then(res => {
this.merchantList = res || []
if(!this.routeInfo.id){
this.editForm.merchantList = res.map(item => item.merchantNo)
}
})
},
getInfo() {
this.loading = true
this.$apis.groupGiftBag
.getGiftInfoApi({ id: this.routeInfo.id })
.then(res => {
res.data.couponDTOList.forEach(item => {
item.id = item.couponId
item.anticipatedCost = item.couponAnticipatedCost
})
this.editForm.couponList = res?.data?.couponDTOList || []
this.editForm.name = res?.data?.name
this.editForm.merchantList =res?.data?.storeList.map(item => item.merchantId)
this.recoveryCoupon()
this.recoveryTotalPrice()
this.$nextTick(() => {
this.editStatus = false
})
})
.finally(() => {
this.loading = false
})
},
recoveryCoupon() {
this.orderShow.forEach(item => {
this.couponObj[item].list = []
})
this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
})
// console.log(this.couponObj, 'this.couponObj')
this.currentCoupons = this.$common.utils.deepClone(this.editForm.couponList)
this.hasCouponBlock(false)
},
// 用来判断券和发放员工是否有增删 type: id为礼券 staffUUID为发放员工
judgeAddOrDel(newArr, oldArr, type = 'id') {
let id1 = [],
id2 = []
newArr.forEach(item => {
id1.push(item[type])
})
oldArr.forEach(item => {
id2.push(item[type])
})
let flag = id1.length === id2.length && id1.sort().toString() === id2.sort().toString()
return flag
},
// 计算预估成本
recoveryTotalPrice() {
this.totalEstimatedCost = 0
this.orderShow.forEach(item => {
this.couponObj[item].list.forEach(subItem => {
// 失效券不加入预估成本
if (subItem.status != '3') {
this.totalEstimatedCost = this.totalEstimatedCost + parseInt(subItem.couponAnticipatedCost || 0) * parseInt(subItem.couponAmount)
}
})
})
this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2)
},
hasCouponBlock(isValidate = true) {
var idx = this.editFormData.findIndex(item => item.name == 'couponListBlock')
this.editFormData[idx].isHide = !this.editForm.couponList.length
isValidate && this.$refs.editFormRef.$refs[this.editChildRef].validateField('couponList')
},
// 礼包
recoveryGiftList() {
this.editForm.couponList = []
this.orderShow.forEach(item => {
this.couponObj[item].list.forEach(k => {
this.editForm.couponList.push(k)
})
})
this.hasCouponBlock()
},
handleGiftAdd() {
this.selectedGiftList = JSON.parse(JSON.stringify(this.couponObj))
this.handleGiftClose()
},
handleGiftConfirm(selectedData) {
this.handleGiftClose()
this.couponObj = selectedData
this.recoveryTotalPrice()
this.recoveryGiftList()
},
handleGiftClose() {
this.isSelectGiftVisible = !this.isSelectGiftVisible
},
handleGiftDelete(attr, idx) {
this.couponObj[attr].list.splice(idx, 1)
this.recoveryTotalPrice()
this.recoveryGiftList()
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
let couponCreateRequestList = [],storeCreateRequestList = [];
this.editForm.couponList.forEach(item => {
const {id:couponId, couponAmount, couponAnticipatedCost} = item
couponCreateRequestList.push({couponId, couponAmount, couponAnticipatedCost})
})
this.editForm.merchantList.forEach(item=>{
let target = this.merchantList.find(ele => ele.merchantNo == item)
target && storeCreateRequestList.push({merchantId: target.merchantNo, merchantName:target.merchantName})
})
let params = {
couponCreateRequestList,
name: this.editForm.name,
storeCreateRequestList
}
if(this.routeInfo.addOrEdit!='add'){
params.id = this.routeInfo.id
}
this.insertHttp(params)
}
})
},
// 创建-更新接口
insertHttp(params) {
const loadingMoadl = this.$loading({
lock: true,
text: '正在Loading···',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)',
customClass: 'loadingClass'
})
this.$apis.groupGiftBag
.insertGiftApi(params)
.then(res => {
loadingMoadl.close()
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
},
cancelJump() {
this.$router.push({
path: '/groupGiftBag/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
}
}
}
}
</script>
<style lang="scss">
.marketing.edit-gift .select-merchant {
width: 98%;
}
.edit-container{
height: calc(100vh - 156px);
min-height: 700px;
}
.marketing.edit-gift {
// 礼包
.gift-block {
width: 878px;
border-radius: 4px;
border: 1px solid #e5e5e5;
.gift-title {
padding: 10px;
background-color: #f4f6fc;
border-bottom: 1px solid #e5e5e5;
.price {
font-size: 18px;
}
}
.gift-box {
display: flex;
padding: 10px 0 10px 10px;
.server-type {
margin: 4px 12px 0 0;
height: 23px;
width: 58px;
}
.gift-label {
width: 70px;
color: #999999;
text-align: right;
}
.gift-content {
width: calc(100% - 70px);
border-bottom: 1px solid #e5e5e5;
.gift-item {
display: inline-block;
width: 50%;
.gift-coupon-name {
display: inline-block;
margin: 0 5px 0 7px;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
}
.gift-content:last-child {
border-bottom: 0px;
}
}
}
.merchant-radio{
width: 878px;
max-height: 98px;
overflow: auto;
border: 1px solid #E5E5E5;
box-sizing: border-box;
border-radius: 4px;
padding: 10px 20px;
}
// 发放员工
.sale-select {
display: flex;
align-items: center;
}
.input-tag-wrapper {
max-height: 68px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 567px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
}
.el-tag.el-tag--info .el-tag__close {
color: #e8e8ea;
background-color: rgba(0, 0, 0, 0) !important;
}
.el-tag.el-tag--info .el-tag__close:hover {
background-color: #5f5efb !important;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
}
.approval_note_container {
padding-bottom: 25px;
.line {
margin: 0 20px;
border-top: 1px solid #d8d8d8;
}
.note_container {
box-sizing: border-box;
padding: 32px 68px 12px 68px;
display: flex;
justify-content: space-between;
.left,
.right {
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: #666666;
.mar40 {
margin-right: 40px;
}
}
}
}
.search-staff {
.el-form-item {
margin-right: 20px;
}
}
</style>
<!-- 礼包详情 -->
<template>
<div class="edit-gift detail-page marketing edit-box">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="couponListBlock" class="gift-block" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
<span class="price">{{ totalEstimatedCost }}</span>
元
</div>
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box" v-show="couponObj[item].list.length">
<!-- <div class="gift-label">{{ couponObj[item].label }}:</div> -->
<img class="server-type" :src="require(`@/assets/coupon/icon-${item}.png`)" />
<div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in couponObj[item].list" :key="subIndex">
<span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span>
<p :class="['gift-info', subItem.status == '3' ? ' txt-grey' : '']">{{ subItem.couponName }} × {{ subItem.couponAmount }}</p>
<p v-show="subItem.status == '3'" class="gift-tips">已失效</p>
</div>
</div>
</div>
</div>
</div>
<div class="merchant-radio" slot="merchantSlot">
<el-checkbox-group disabled v-model="editForm.merchantList">
<el-checkbox v-for="item in merchantList" :label="item.merchantNo" :key="item.merchantNo">{{item.merchantName}}</el-checkbox>
</el-checkbox-group>
</div>
</glsx-combi-form>
<!-- <div class="approval_note_container">
<div class="line"></div>
<div class="note_container">
<div class="left">
<span class="mar40">创建时间:{{ editForm.createdDate }}</span>
<span class="">创建人:{{ editForm.createdBy }}</span>
</div>
<div class="right">
<span class="mar40">最后修改时间:{{ editForm.updatedDate }}</span>
<span class="">修改人:{{ editForm.updatedBy }}</span>
</div>
</div>
</div> -->
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">取消</el-button>
</GLFooter>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'giftDetail',
data() {
return {
size: 'small',
title: '礼包详情',
loading: false,
editChildRef: 'editChildRef',
receiveDetailList: [],
routeInfo: {
// add-新增;edit-编辑;detail-详情
addOrEdit: 'add',
id: ''
},
labelWidth: '144px',
editForm: {
name: '',
// 优惠券类型(discountType) 1:满减券,2:折扣券,3:代金券,4:兑换券,5:购车代金券,6:商品折扣券,7:会员服务
// 优惠券状态(status):1:未生效,2:生效中,3:已失效
couponList: [],
merchantList:[]
},
merchantList:[],
totalEstimatedCost: '',
orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: {
2: 'discount',
3: 'cash',
4: 'exchange',
7: 'service'
},
couponObj: {
// 折扣券
discount: {
label: '折扣券',
discountType: 2,
list: []
},
// 代金券
cash: {
label: '代金券',
discountType: 3,
list: []
},
// 兑换券
exchange: {
label: '兑换券',
discountType: 4,
list: []
},
// 会员服务
service: {
label: '会员服务',
discountType: 7,
list: []
}
},
editRule: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }],
couponList: [{ required: true, message: '请选择礼包', trigger: 'change' }],
merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }],
},
isEdit: true,
editFormData: [
{
label: '礼包名称',
name: 'name',
type: 'showTxt'
},
{
label: '礼包设置',
name: 'couponList',
addHtml: 'couponListBlock'
},
{
label: '下发门店',
name: 'merchantList',
addHtml: 'merchantSlot'
}
],
}
},
mounted() {
this.routeInfo = this.$route.query
this.loading = true
this.getInfo()
this.getMerchant()
},
methods: {
getMerchant(){
const { session } = this.$globalState || {}
const param = {
supMerchantNo: session.merchantId,
merchantAccountLevel: 4
}
this.$apis.groupGiftBag.getMerchantListApi(param).then(res => {
this.merchantList = res || []
this.editForm.merchantList = res.map(item => item.merchantNo)
})
},
getInfo() {
this.$apis.groupGiftBag
.getGiftInfoApi({ id: this.routeInfo.id })
.then(res => {
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
res.data.couponList = res.data.couponDTOList
res.data.merchantList = res?.data?.storeList.map(item => item.merchantId)
this.editForm = res.data
this.recoveryCoupon()
this.recoveryTotalPrice()
})
.finally(() => {
this.loading = false
})
},
recoveryCoupon() {
this.orderShow.forEach(item => {
this.couponObj[item].list = []
})
this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
})
},
// 计算预估成本
recoveryTotalPrice() {
this.totalEstimatedCost = 0
this.orderShow.forEach(itme => {
this.couponObj[itme].list.forEach(subItem => {
// 失效券不加入预估成本
if (subItem.status != '3') {
this.totalEstimatedCost = this.totalEstimatedCost + subItem.couponAnticipatedCost * subItem.couponAmount
}
})
})
this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2)
},
handleCancel() {
this.$router.push({
path: '/groupGiftBag/index',
query: { type: this.routeInfo.type }
})
}
}
}
</script>
<style lang="scss">
.marketing.edit-gift .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
.marketing.edit-gift .staff-block {
width: 567px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e5e5e5;
}
.detail-page {
#receiveRule{
.el-radio-group{
.is-checked {
.el-radio__input.is-checked .el-radio__inner{
border-color:#5850ff;
&::after{
background-color: #5850ff;
}
}
}
.el-radio__label{
color: #333333!important;
}
}
}
}
.marketing.edit-gift {
// 礼包
.gift-block {
width: 878px;
border-radius: 4px;
border: 1px solid #e5e5e5;
.gift-title {
padding: 10px;
background-color: #f4f6fc;
border-bottom: 1px solid #e5e5e5;
.price {
font-size: 18px;
}
}
.gift-box {
display: flex;
padding: 10px 0 10px 10px;
.server-type {
margin: 4px 12px 0 0;
height: 23px;
width: 58px;
}
.gift-label {
width: 70px;
color: #999999;
text-align: right;
}
.gift-content {
width: calc(100% - 70px);
border-bottom: 1px solid #e5e5e5;
.gift-item {
display: inline-block;
width: 50%;
.gift-info {
display: inline-block;
margin: 0 5px 0 7px;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
}
.gift-content:last-child {
border-bottom: 0px;
}
}
}
.phone-wrap {
width: 878px;
background-color: #f9f9f9;
padding: 5px 10px;
line-height: 14px;
font-size: 14px;
box-sizing: border-box;
margin-top: 5px;
.phone {
display: inline-block;
margin: 5px 16px 5px 0;
}
.realTel {
width: 120px;
}
.realNum {
width: 80px;
}
}
// 发放员工
.sale-select {
display: flex;
align-items: center;
}
.input-tag-wrapper-detail {
max-height: 68px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
// border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 567px;
display: flex;
align-items: center;
// margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
// background: #fff !important;
}
.el-tag.el-tag--info .el-tag__close {
color: #e8e8ea;
background-color: rgba(0, 0, 0, 0) !important;
}
.el-tag.el-tag--info .el-tag__close:hover {
background-color: #5f5efb !important;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
}
// v2.0.0
.approval-info {
display: flex;
box-sizing: border-box;
padding: 32px 0 12px 82px;
.approval_label {
font-size: 14px;
font-weight: 400;
color: #666666;
width: 30%;
// width: 80px;
display: flex;
line-height: 20px;
white-space: nowrap;
.approval_con {
width: 80%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
white-space: pre-wrap;
}
}
}
.approval_note_container {
.line {
margin: 0 20px;
border-top: 1px solid #d8d8d8;
}
.note_container {
box-sizing: border-box;
padding: 32px 68px 12px 68px;
display: flex;
justify-content: space-between;
.left,
.right {
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: #666666;
.mar40 {
margin-right: 40px;
}
}
}
}
.user {
margin-left: 144px;
}
</style>
<!-- 定向礼包-->
<template>
<div class="marketing">
<div class="m-b-10">
<!-- <el-button :size="size" type="primary" fn="新增礼包" class="el-icon-plus" @click="handleEdit('add')">新增礼包</el-button> -->
<GLButton :size="size" type="primary" fn="新增礼包" class="el-icon-plus" @click="handleEdit('add')">新增礼包</GLButton>
</div>
<div class="list-tips m-b-10">
<img class="tips-img" src="@/assets/icon-info.png" />
<span>集团礼包:将多种券组合成礼包,由集团指定的门店进行发放,客户领取后可在指定的门店间进行使用。</span>
</div>
<div class="container">
<div>
<GLCombiForm @handleOk="handleSearch" :rowNumber="1" @handleRest="handleReset" ref="showSearch" :formObj="searchForm" :formData="searchFormData"></GLCombiForm>
<GLButton style="float:right;margin-bottom:10px;" :size="size" class="default-blue-btn" type="default" fn="导出" @click="handleExport">导出</GLButton>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="giftInfo" slot-scope="scope">
<div class="p-b-12">礼包明细</div>
<div class="gift-detail flex-wrap">
<div class="gift-item" v-for="(item, index) in scope.scope.couponDTOList" :key="index">
<img :src="require(`@/assets/coupon/icon-${attrToIcon[item.discountType]}.png`)" />
<p :class="['gift-coupon-name', item.status == '3' ? ' txt-grey' : '']">{{ item.couponName }} × {{ item.couponAmount }}</p>
<p v-show="item.status == '3'" class="gift-tips">已失效</p>
</div>
</div>
</div>
<div slot="name" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</p>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
export default {
name: 'giftList',
data() {
return {
attrToIcon: {
2: 'discount',
3: 'cash',
4: 'exchange',
7: 'service'
},
buttonList: [
{
type: 'GLButton',
name: row => {
return '编辑'
},
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.handleEdit('edit', row.scope)
}
},
{
type: 'GLButton',
name: row => {
return '删除'
},
attrs: {
type: 'text',
fn: '删除'
},
listeners: {
click: row => this.handleDelete(row.scope)
}
}
],
size: 'small',
url: url,
searchForm: {
name: '',
merchantName: ''
},
// 搜索
searchFormData: [
{
label: '礼包名称',
name: 'name',
type: 'input',
maxlength: 30,
placeholder: '请输入礼包/备注名称',
isClear: true
},
{
label: '下发门店',
name: 'merchantName',
type: 'input',
maxlength: 30,
placeholder: '请输入门店名称',
isClear: true
},
],
// 表格
getListApi: this.$apis.groupGiftBag.getListApi,
tableParams: {
listName: 'list',
tableOption: {
width: 200,
align: 'center'
},
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'giftInfo'
},
{
label: '序号',
prop: 'idx',
width: 60
},
{
label: '礼包名称',
prop: 'name',
addHtml: 'name'
},
{
label: '预估成本/元',
prop: 'anticipatedCost',
formatter: cellValue => {
let total = cellValue.couponDTOList.reduce(function(prev, cur) {
return prev + +(cur.couponAnticipatedCost * cur.couponAmount).toFixed(0)
}, 0)
return total / 100
}
},
{
label: '下发门店',
prop: 'staffList',
line: 1,
formatter: cellValue => {
return cellValue.storeList.map(item => item.merchantName).join('、')
}
},
{
label: '已领取',
prop: 'stock',
formatter: cellValue => {
return cellValue.receivedAmount || '0'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
}
},
mounted() {
},
methods: {
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该礼包?', 'groupGiftBag', 'deleteGiftApi', { id: row.id })
},
// 导出
handleExport() {
var params = {...this.searchForm}
this.$apis.groupGiftBag.giftExportApi(params).then(res => {
aToExport(res)
})
},
// 查看
handleDetail(row) {
this.$router.push({
path: '/groupGiftBag/giftDetail',
query: {
id: row.id
}
})
},
// add-新增;edit-编辑
handleEdit(addOrEdit, row) {
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包')
}
addOrEdit != 'add' && (params.id = row.id)
this.$router.push({
path: '/groupGiftBag/editGift',
query: params
})
},
setTableFinishFun() {
var page = this.$refs.giftListRef.page
// 添加序号
this.$refs.giftListRef.data.forEach((item, index) => {
item.idx = index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
})
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
},
handleSearch() {
this.$refs.giftListRef.refreshTable()
},
handleReset() {
this.searchForm = {
name: '',
merchantName: ''
},
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.p-b-12 {
margin-bottom: 14px;
font-weight: 500;
padding-left: 10px;
color: #333333;
}
.approve-status {
width: 6px;
height: 6px;
border-radius: 4px;
margin-right: 8px;
display: inline-block;
}
.qr-dialog {
/deep/.el-dialog__body {
// padding: 20px;
.el-scrollbar__wrap {
overflow: hidden;
}
.qrcode-body {
display: flex;
flex-direction: column;
align-items: center;
p {
line-height: 28px;
margin-bottom: 16px;
}
.el-select {
.el-input__inner {
width: 360px;
height: 36px;
}
.el-input__icon {
line-height: 36px;
}
}
.img {
margin-top: 16px;
background: #eee;
display: flex;
align-items: center;
justify-content: center;
&,
img {
width: 160px;
height: 160px;
}
}
}
}
}
.gift-detail {
padding:0 200px 0 10px;
.gift-item {
margin-right: 80px;
display: flex;
align-items: center;
color: #333333;
width: 400px;
img {
height: 23px;
width: 58px;
margin-right: 10px;
}
.gift-coupon-name {
display: inline-block;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
}
.gift-detail .gift-item:last-child {
margin-right: 0;
}
</style>
<!-- 定向礼包 -->
<template>
<div class="gift-bag">
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="集团礼包" name="giftList">
<gift-list v-if="activeName == 'giftList'"></gift-list>
</el-tab-pane>
<el-tab-pane label="已领取" name="receivedGiftList">
<receivedGiftList v-if="activeName == 'receivedGiftList'"></receivedGiftList>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import giftList from './giftList.vue'
import receivedGiftList from './receivedGiftList'
export default {
name: 'gitfBag',
data() {
return {
activeName: 'giftList'
}
},
components: {
giftList,
receivedGiftList
},
created() {
// this.activeName = sessionStorage.getItem('GIFTNAME') ? sessionStorage.getItem('GIFTNAME') : 'giftList'
if (this.$route.query.type == 'received') {
this.activeName = 'receivedGiftList'
}
},
mounted() {},
methods: {
handleTabClick() {
this.$router.push({ path: this.$route.path, query: { type: this.activeName == 'receivedGiftList' ? 'received' : 'gift' } })
}
}
}
</script>
<style>
.gift-bag .el-tabs__nav-wrap:after {
opacity: 0;
}
.gift-bag .el-tabs__item {
height: 20px !important;
line-height: 10px !important;
font-weight: 400;
font-size: 16px;
color: #717171;
height: 36px;
line-height: 36px;
}
.gift-bag .el-tabs__item:hover,
.gift-bag .el-tabs__item.is-active {
color: #5f5efb;
}
</style>
<!-- 礼包详情 -->
<template>
<div class="edit-gift detail-page marketing edit-box">
<!-- <div class="container approval-container">
<p class="edit-title">审批信息</p>
<div class="approval-info">
<div class="approval_label">审批人:{{ editForm.approveBy }}</div>
<div class="approval_label">
审批状态:
<span :style="{ color: approvalStatusColor[approvalStatus] }">{{ approvalStatusVal[approvalStatus] }}</span>
</div>
<div v-if="approvalStatus == 2" class="approval_label">
驳回说明:
<div class="approval_con">{{ editForm.approveExplain }}</div>
</div>
</div>
</div> -->
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="giftNameSlot" class="gift-name-slot">{{editForm.name}} <div class="group-label" v-if="editForm.merchantType==2">集团</div></div>
<div slot="couponListBlock" class="gift-block" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
<span class="price">{{ totalEstimatedCost }}</span>
元
</div>
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box" v-show="couponObj[item].list.length">
<!-- <div class="gift-label">{{ couponObj[item].label }}:</div> -->
<img class="server-type" :src="require(`@/assets/coupon/icon-${item}.png`)" />
<div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in couponObj[item].list" :key="subIndex">
<span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span>
<p :class="['gift-info', subItem.status == '3' ? ' txt-grey' : '']">{{ subItem.couponName }} × {{ subItem.couponAmount }}</p>
<p v-show="subItem.status == '3'" class="gift-tips">已失效</p>
</div>
</div>
</div>
</div>
</div>
<div slot="approveFlagBlock">
{{ editForm.approveFlag == 1 ? '赠送前需审批' : '无需审批' }}
</div>
<div slot="receiveDetails" :class="editForm.receiveRule == 4 ? 'user' : ''">
<span v-if="editForm.receiveRule == 2 && editForm.receiveWay && editForm.receiveDetails">{{ `${editForm.receiveWay == '1' ? '手机号:' : '车架号后6位:'}${editForm.receiveDetails}` }}</span>
<span v-if="editForm.receiveRule == 1">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:</span>
<span v-if="editForm.receiveRule == 4"><span style="color: #f56c6c;margin-right: 4px;">*</span>用户手机号:</span>
<div v-if="editForm.receiveRule == 1 || editForm.receiveRule == 4" class="phone-wrap">
<span :class="['phone', editForm.receiveWay == 1 ? 'realTel' : 'realNum']" v-for="(item, id) in receiveDetailList" :key="id">{{ item }}</span>
</div>
</div>
<div slot="staffListBlock" class="sale-select" v-show="editForm.staffList && editForm.staffList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper-detail">
<el-tag effect="plain" type="info" v-for="(tag, idx) in editForm.staffList" :key="idx" :disable-transitions="false" @close="handleStaffRemove(tag, idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</glsx-combi-form>
<div class="approval_note_container">
<div class="line"></div>
<div class="note_container">
<div class="left">
<span class="mar40">创建时间:{{ editForm.createdDate }}</span>
<span class="">创建人:{{ editForm.createdBy }}</span>
</div>
<div class="right">
<span class="mar40">最后修改时间:{{ editForm.updatedDate }}</span>
<span class="">修改人:{{ editForm.updatedBy }}</span>
</div>
</div>
</div>
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">取消</el-button>
</GLFooter>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'giftDetail',
data() {
return {
size: 'small',
title: '礼包详情',
loading: false,
editChildRef: 'editChildRef',
receiveDetailList: [],
routeInfo: {
// add-新增;edit-编辑;detail-详情
addOrEdit: 'add',
id: ''
},
labelWidth: '144px',
editForm: {
name: '',
remarkName: '',
receiveWay: '1',
receiveDetails: '',
receivedFlag: 2,
staffList: [],
// 优惠券类型(discountType) 1:满减券,2:折扣券,3:代金券,4:兑换券,5:购车代金券,6:商品折扣券,7:会员服务
// 优惠券状态(status):1:未生效,2:生效中,3:已失效
couponList: [],
receiveRule: 1
},
totalEstimatedCost: '',
orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: {
2: 'discount',
3: 'cash',
4: 'exchange',
7: 'service'
},
couponObj: {
// 折扣券
discount: {
label: '折扣券',
discountType: 2,
list: []
},
// 代金券
cash: {
label: '代金券',
discountType: 3,
list: []
},
// 兑换券
exchange: {
label: '兑换券',
discountType: 4,
list: []
},
// 会员服务
service: {
label: '会员服务',
discountType: 7,
list: []
}
},
editRule: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }],
remarkName: [{ required: true, message: '请输入备注名称', trigger: 'change' }],
couponList: [{ required: true, message: '请选择礼包', trigger: 'change' }],
receiveWay: [{ required: true, message: '请选择领取规则', trigger: 'change' }],
staffList: [{ required: true, message: '请选择发放员工', trigger: 'change' }],
approveFlag: [{ required: true, message: '请选择审批要求', trigger: 'change' }],
stock: [{ required: true, message: '请选择库存数量', trigger: 'change' }],
receiveRule: [{ required: true, message: '请选择领取规则设置', trigger: 'change' }],
},
isEdit: true,
editFormData: [
{
label: '礼包名称',
name: 'name',
addHtml: 'giftNameSlot'
},
{
label: '备注名称',
name: 'remarkName',
type: 'showTxt'
},
{
label: '礼包设置',
name: 'couponList',
addHtml: 'couponListBlock'
},
{
label: '库存数量',
name: 'stock',
type: 'showTxt',
isHide: false
},
{
label: '审批要求',
name: 'approveFlag',
addHtml: 'approveFlagBlock',
isHide: false
},
{
label: '领取规则设置',
name: 'receiveRule',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
isDisabled: true,
optionList: [
{
confId: 1,
confName: '创建时指定',
suffixSonSlot: 'bubble'
},
{
confId: 2,
confName: '员工赠送时指定',
suffixSonSlot: 'giveAway'
},
{
confId: 3,
confName: '直接领取',
suffixSonSlot: 'receives'
},
{
confId: 4,
confName: '直接发送到小程序卡包',
suffixSonSlot: 'cardHolder'
}
]},
{
label: '',
name: 'receiveWay',
addHtml: 'receiveDetails'
},
{
label: '发放员工',
name: 'staffList',
addHtml: 'staffListBlock'
},
{
label: '赠送原因',
name: 'giveReason',
type: 'showTxt'
}
],
// 审批状态 0审批中 1审批通过 2审批驳回
approvalStatus: -1,
approvalStatusVal: ['审批中', '审批通过', '已驳回', '审批撤销', '待审批'],
approvalStatusColor: ['#FF6D00', '#2CCA74', '#EB4E4E', '#999999', '#999999']
}
},
mounted() {
this.setMinHeight()
this.routeInfo = this.$route.query
this.loading = true
this.getInfo()
},
methods: {
getInfo() {
this.$apis.giftBag.getReceivedGiftDetail({userDirectionalGiftId : this.routeInfo.id})
.then(res => {
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
this.editForm = res.data
if(res?.data?.receiveRule == 4){
let target = this.editFormData.find(item => item.name == 'stock')
let targets = this.editFormData.find(item => item.name == 'approveFlag')
target.isHide = true
targets.isHide = true
}
if(res?.data?.receiveRule == 1){
let targetss = this.editFormData.find(item => item.name == 'receiveWay')
targetss.label = '领取条件'
}
let arr = []
res.data.receiveDetails && (arr = res.data.receiveDetails.split(','))
this.receiveDetailList = [...arr]
this.approvalStatus = res.data.approveStatus - 1
this.recoveryCoupon()
this.recoveryTotalPrice()
})
.finally(() => {
this.loading = false
})
},
recoveryCoupon() {
this.orderShow.forEach(item => {
this.couponObj[item].list = []
})
this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
})
},
receiveWayChange(val) {
var receiveDetailsIdx = this.editFormData.findIndex(item => item.name == 'receiveDetails')
this.editFormData[receiveDetailsIdx].placeholder = val == '1' ? '请输入领取手机号' : '请输入领取车架号后6位'
this.editFormData[receiveDetailsIdx].maxlength = val == '1' ? 11 : 6
},
// 计算预估成本
recoveryTotalPrice() {
this.totalEstimatedCost = 0
this.orderShow.forEach(itme => {
this.couponObj[itme].list.forEach(subItem => {
// 失效券不加入预估成本
if (subItem.status != '3') {
this.totalEstimatedCost = this.totalEstimatedCost + subItem.couponAnticipatedCost * subItem.couponAmount
}
})
})
this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2)
},
handleCancel() {
this.$router.push({
path: '/groupGiftBag/index',
query: { type: this.routeInfo.type }
})
}
}
}
</script>
<style lang="scss">
.marketing.edit-gift .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
.marketing.edit-gift .staff-block {
width: 567px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e5e5e5;
}
.detail-page {
#receiveRule{
.el-radio-group{
.is-checked {
.el-radio__input.is-checked .el-radio__inner{
border-color:#5850ff;
&::after{
background-color: #5850ff;
}
}
}
.el-radio__label{
color: #333333!important;
}
}
}
}
.marketing.edit-gift {
// 礼包
.gift-name-slot{
display: flex;
align-items: center;
.group-label{
width: 42px;
height: 20px;
line-height: 20px;
text-align: center;
background: rgba(255,101,61,0.15);
border-radius: 4px;
margin-left: 4px;
font-size: 12px;
display: inline-block;
color: #FF653D;
}
}
.gift-block {
width: 878px;
border-radius: 4px;
border: 1px solid #e5e5e5;
.gift-title {
padding: 10px;
background-color: #f4f6fc;
border-bottom: 1px solid #e5e5e5;
.price {
font-size: 18px;
}
}
.gift-box {
display: flex;
padding: 10px 0 10px 10px;
.server-type {
margin: 4px 12px 0 0;
height: 23px;
width: 58px;
}
.gift-label {
width: 70px;
color: #999999;
text-align: right;
}
.gift-content {
width: calc(100% - 70px);
border-bottom: 1px solid #e5e5e5;
.gift-item {
display: inline-block;
width: 50%;
.gift-info {
display: inline-block;
margin: 0 5px 0 7px;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
}
.gift-content:last-child {
border-bottom: 0px;
}
}
}
.phone-wrap {
width: 878px;
background-color: #f9f9f9;
padding: 5px 10px;
line-height: 14px;
font-size: 14px;
box-sizing: border-box;
margin-top: 5px;
.phone {
display: inline-block;
margin: 5px 16px 5px 0;
}
.realTel {
width: 120px;
}
.realNum {
width: 80px;
}
}
// 发放员工
.sale-select {
display: flex;
align-items: center;
}
.input-tag-wrapper-detail {
max-height: 68px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
// border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 567px;
display: flex;
align-items: center;
// margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
// background: #fff !important;
}
.el-tag.el-tag--info .el-tag__close {
color: #e8e8ea;
background-color: rgba(0, 0, 0, 0) !important;
}
.el-tag.el-tag--info .el-tag__close:hover {
background-color: #5f5efb !important;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
}
// v2.0.0
.approval-info {
display: flex;
box-sizing: border-box;
padding: 32px 0 12px 82px;
.approval_label {
font-size: 14px;
font-weight: 400;
color: #666666;
width: 30%;
// width: 80px;
display: flex;
line-height: 20px;
white-space: nowrap;
.approval_con {
width: 80%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
white-space: pre-wrap;
}
}
}
.approval_note_container {
.line {
margin: 0 20px;
border-top: 1px solid #d8d8d8;
}
.note_container {
box-sizing: border-box;
padding: 32px 68px 12px 68px;
display: flex;
justify-content: space-between;
.left,
.right {
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: #666666;
.mar40 {
margin-right: 40px;
}
}
}
}
.user {
margin-left: 144px;
}
</style>
<!-- 已领取-->
<template>
<div class="marketing">
<div class="container">
<div>
<GLCombiForm ref="showSearch" @handleOk="handleSearch" @handleRest="handleReset" :formObj="searchForm" :formData="searchFormData"></GLCombiForm>
<GLButton style="float:right;margin-bottom:10px;" :size="size" class="default-blue-btn" type="default" fn="已领取导出" @click="handleExport">导出</GLButton>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="receivedGiftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<span slot="directionalGiftName" slot-scope="scope">
<el-tooltip effect="dark" :content="scope.scope.directionalGiftName" placement="top-start">
<p class="gift-name" @click="handleDetail(scope.scope)">
{{ scope.scope.directionalGiftName }}
</p>
</el-tooltip>
<span v-if="scope.scope.receiveStatus == 2" class="void-label">已作废</span>
<el-tooltip effect="dark" :content="scope.scope.cancelReason" placement="top-start">
<p class="void-reason" v-if="scope.scope.receiveStatus == 2">作废原因:{{ scope.scope.cancelReason || '--' }}</p>
</el-tooltip>
</span>
<div slot="giftInfo" slot-scope="scope">
<GLTable class="secondTable" ref="giftListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="giftParams" :tableData="scope.scope | filterTable" @setTableFinishFun="setGiftTableFinishFun"></GLTable>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button :disabled="scope.scope.receiveStatus == 2" type="text" @click="handleCancel(scope.scope)">作废</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<GLDialog title="作废确认" mode="mid" :visible.sync="isCancelVisible" @onOk="handleCancelConfirm" @onCancel="handleCancelClose">
<p class="m-t-20" style="padding-left: 76px;">请先和客户沟通再确认,避免引起客诉,作废后客户将不可使用该礼包下所有优惠卷</p>
<el-form ref="cancelRef" label-width="154px" :rules="cancelRules" :model="cancelForm">
<el-form-item label="作废原因" prop="cancelReason" class="m-t-20">
<el-input style="width: 432px;" :size="size" type="textarea" v-model="cancelForm.cancelReason" placeholder="请输入作废原因" maxlength="50" rows="3" show-word-limit></el-input>
</el-form-item>
</el-form>
</GLDialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
export default {
name: 'giftList',
filters: {
filterTable(list) {
let arr1 = list.couponList
let arr2 = list.verificationCouponList
let reduceArr = arr1.map(item => {
item.delet = 0
arr2.map(ele => {
if (item.couponId == ele.couponId) {
item.delet = ele.couponAmount
}
})
return item
})
return reduceArr
}
},
data() {
return {
size: 'small',
url: url,
curId: '',
reason: '',
cancelForm: {
userDirectionalGiftId: '',
cancelReason: ''
},
cancelRules: {
cancelReason: [
{
required: true,
validator: (rule, value, callback) => {
if (!value || (value && !value.trim())) {
return callback(new Error('请输入作废原因'))
} else {
return callback()
}
},
trigger: 'change'
}
]
},
isCancelVisible: false,
searchForm: {
nickName: '',
wechatUserFlag: '',
giftName: '',
staffName: '',
createDate: [],
receiveStatus: '',
grantMerchantName:''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '领用客户',
name: 'nickName',
type: 'input',
placeholder: '请输入客户名称或手机号'
},
{
label: '礼包名称',
name: 'giftName',
type: 'input',
placeholder: '请输入礼包/备注名称'
},
{
label: '下发门店',
name: 'grantMerchantName',
type: 'input'
},
{
label: '是否为企微客户',
name: 'wechatUserFlag',
type: 'select',
optionList: [],
optionId: 'Id',
optionLabel: 'Name',
optionsName: 'List',
placeholder: '请选择'
},
{
label: '发放员工',
name: 'staffName',
type: 'input',
placeholder: '请输入'
},
{
label: '领取日期',
name: 'createDate',
type: 'datePicker',
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '领取状态',
name: 'receiveStatus',
type: 'select',
optionList: [],
optionId: 'Id',
optionLabel: 'Name',
optionsName: 'statusList',
placeholder: '请选择'
}
],
// searchFormData1: [
// {
// label: '发放员工',
// name: 'staffName',
// type: 'input',
// placeholder: '请输入'
// },
// {
// label: '领取日期',
// name: 'createDate',
// type: 'datePicker',
// pickerOptions: 'beforeRangePickerOptions'
// }
// ],
baseData: {
List: [
{
Id: '1',
Name: '否'
},
{
Id: '2',
Name: '是'
}
],
statusList: [
{
Id: '1',
Name: '正常使用'
},
{
Id: '2',
Name: '已作废'
}
]
},
//礼包详情
giftParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '礼包明细',
prop: 'couponName',
width: 200
},
{
label: '数量',
name: 'couponAmount',
width: 150,
formatter: cellValue => {
return 'X' + cellValue.couponAmount
}
},
{
label: '已核销/次',
prop: 'anticipatedCost ',
width: 150,
formatter: cellValue => {
return 'X' + cellValue.delet
}
},
{
label: '可使用/次',
prop: 'getAmount',
width: 150,
formatter: cellValue => {
if (cellValue.residueCouponAmount == -1) {
return '不限次数'
} else {
return 'X' + cellValue.residueCouponAmount
}
}
}
]
},
// 礼包
getListApi: this.$apis.groupGiftBag.getReceivedGiftInfoApi,
tableParams: {
listName: 'list',
tableOption: {
width: 100,
align: 'center'
},
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'giftInfo'
},
{
label: '序号',
prop: 'idx',
width: '60'
},
{
label: '领取客户',
prop: 'nickName',
width: 200
},
{
label: '客户手机号',
prop: 'phone',
width: 150
},
{
label: '是否为企微客户',
prop: 'wechatUserFlag',
width: 150,
formatter: cellValue => {
if (cellValue.wechatUserFlag == 1) {
return '否'
} else if (cellValue.wechatUserFlag == 2) {
return '是'
}
}
},
{
label: '礼包名称',
width: 200,
addHtml: 'directionalGiftName'
},
{
label: '礼包备注名称',
prop: 'directionalGiftRemarkName',
width: 150
},
{
label: '预估成本/元',
width: 150,
prop: 'anticipatedCost',
formatter: cellValue => {
return cellValue.anticipatedCost / 100
}
},
{
// label: '已核销成本/元',
width: 150,
prop: 'verificationAnticipatedCost',
// sortable: true,
renderHeader: h => {
return h('div', { class: 'table-header specHeader' }, [
h('span', '已核销成本/元'),
h('table-tooltip', {
props: { content: '单张券的已核销成本 = (该券的成本/该券总可核销次数)*已核销次数 例:一张券可核销3次,成本9块,已被核销2次,则已核销成本(9/3)*2=6 注意:若该券可无限次使用,核销一次后该券成本就全部核销了' }
})
])
},
formatter: cellValue => {
return cellValue.verificationAnticipatedCost / 100
}
},
{
label: '下发门店',
width: 150,
formatter: cellValue => {
return cellValue.grantMerchantName
}
},
{
label: '发放员工',
width: 120,
formatter: cellValue => {
return cellValue.staffList[0].staffName
}
},
{
label: '领取时间',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
//客户
// customerDetail(row) {
// this.$router.push({
// path: '/custom/clientManage/clientDetail?id=' + row.accountId
// })
// },
// 查看
handleCancelClose() {
this.cancelVisibleChange()
this.cancelForm = {
userCouponId: '',
cancelReason: ''
}
},
handleCancelConfirm() {
this.$refs.cancelRef.validate(valid => {
if (valid) {
this.$apis.groupGiftBag.toVoidGift(this.cancelForm).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancelClose()
this.handleSearch()
}
})
}
})
},
handleDetail(row) {
this.$router.push({
path: '/groupGiftBag/receivedGiftDetail',
query: {
id: row.id,
type: 'received'
}
})
},
handleCancel(row) {
this.cancelForm.userDirectionalGiftId = row.id
this.cancelVisibleChange()
},
cancelVisibleChange() {
this.$refs.cancelRef && this.$refs.cancelRef.clearValidate()
this.isCancelVisible = !this.isCancelVisible
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
handleExport() {
var params = this.getParams()
this.$apis.groupGiftBag.exportGiftInfoApi(params).then(res => {
aToExport(res)
})
},
handleDelete(row) {
// this.secondConfirm('删除', '是否确认删除该评论?', 'orderComment', 'deleteCommentApi', { id: row.id })
},
// add-新增;edit-编辑
handleEdit(addOrEdit, row) {
// addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包')
}
addOrEdit != 'add' && (params.id = row.id)
this.$router.push({
path: '/groupGiftBag/editGift',
query: params
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
setTableFinishFun() {
var page = this.$refs.receivedGiftListRef.page
// 添加序号
if (this.$refs.receivedGiftListRef.data) {
this.$refs.receivedGiftListRef.data.forEach((item, index) => {
item.idx = index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
})
//接收到的数据为空
this.$refs.receivedGiftListRef.data.length ? (this.$refs.receivedGiftListRef.tableHeightValues = '') : this.$refs.receivedGiftListRef.setTableHeightFun()
}
},
setGiftTableFinishFun() { },
handleSearch() {
this.$refs.receivedGiftListRef.refreshTable()
},
handleReset() {
this.searchForm = {
nickName: '',
wechatUserFlag: '',
giftName: '',
staffName: '',
createDate: [],
receiveStatus: '',
grantMerchantName: ''
}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .table-header {
display: inline-flex !important;
align-items: center;
justify-content: center;
padding: 0 !important;
.el-button {
min-width: 0;
}
}
.marketing /deep/ .el-table th div {
line-height: normal !important;
}
.secondTable {
padding-left: 10px;
}
.gift-name {
color: #5850ff;
margin: 0;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.void-label {
width: 44px;
height: 18px;
display: inline-block;
font-size: 12px;
color: #999999;
border-radius: 2px;
text-align: center;
line-height: 18px;
background: #eeeded;
margin-top: 2px;
}
.void-reason {
font-size: 10px;
color: #999999;
width: 180px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin: 4px 0 0;
}
.void-dialog {
/deep/ .el-dialog__body {
padding: 20px 80px;
.el-textarea__inner {
font-family: auto;
}
.wrap {
padding-bottom: 50px;
.dialog-tip {
margin-bottom: 20px;
}
.label {
white-space: nowrap;
margin-top: 6px;
}
.el-textarea__inner {
height: 72px;
}
}
}
}
</style>
<!-- 选择礼包弹窗 -->
<template>
<GLDialog class="muti-gift" bigTitle="选择礼包内容" mode="big" :visible.sync="isSelectGiftVisible" :before-close="handleGiftClose" @onOk="handleGiftConfirm" @onCancel="handleGiftClose" v-loading="loading">
<!-- <div class="nogiftDiv" v-show="!giftList.length && fnCallBack">
<img src="@/assets/noPro.png" />
<p class="nogiftP">系统暂无已创建的礼包</p>
</div> -->
<div class="flex-default">
<div class="gift-table">
<el-tabs class="gift-tabs" v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="门店服务" name="service"></el-tab-pane>
<el-tab-pane label="代金券" name="cash"></el-tab-pane>
<el-tab-pane label="折扣券" name="discount"></el-tab-pane>
<el-tab-pane label="兑换券" name="exchange"></el-tab-pane>
</el-tabs>
<div>
<glsx-combi-form class="p-16" style="padding-bottom: 0px;" ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<GLTable v-loading="loading" v-show="activeName == 'service'" ref="serviceRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</span>
</GLTable>
<GLTable v-loading="loading" v-show="activeName == 'cash'" ref="cashRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toCashRestrictLabelText(scope.scope) }}</span>
</span>
</GLTable>
<GLTable v-loading="loading" v-show="activeName == 'discount'" ref="discountRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="useType">
<span>-</span>
</span>
</GLTable>
<GLTable v-loading="loading" v-show="activeName == 'exchange'" ref="exchangeRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="useType">
<span>-</span>
</span>
</GLTable>
</div>
</div>
<div class="selected-list">
<p class="list-title p-16">已选({{ selectedSum }})</p>
<div class="list-gifts">
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box" v-show="selectedGiftList[item].list.length">
<div class="gift-label">{{ selectedGiftList[item].label }}</div>
<div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in selectedGiftList[item].list" :key="subIndex">
<!-- <i @click="handleGiftDelete(item, subIndex)"></i> -->
<img class="muti-icon" v-show="subItem.status != '3'" src="@/assets/muti-selected.png" @click="handleGiftDelete(item, subIndex)" />
<img class="muti-icon" v-show="subItem.status == '3'" src="@/assets/muti-no-select.png" @click="handleGiftDelete(item, subIndex)" />
<el-tooltip effect="dark" placement="top" :disabled="subItem.couponName.length <= 8">
<p :class="['gift-coupon-name', 'ellipsis-1', subItem.status == '3' ? ' txt-grey' : '']">{{ subItem.couponName.length > 8 ? subItem.couponName.slice(0, 8) + '...' : subItem.couponName }}</p>
<div slot="content">{{ subItem.couponName }}</div>
</el-tooltip>
<div class="gift-sum">
<el-input-number :disabled="subItem.status == '3'" class="sum-input" v-model="subItem.couponAmount" @change="handleChange" :min="1" :max="999999" size="mini" label="描述文字"></el-input-number>
<!-- <p :class="[subItem.status == '3' ? ' txt-grey' : '']" v-else>×{{ subItem.couponAmount }}</p> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectGiftDialog',
data() {
return {
// 表格组件
activeName: 'service',
userInfo: {},
giftList: [],
fnCallBack: false,
url: url,
loading: true,
selectedSum: 0,
orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: {
2: 'discount',
3: 'cash',
4: 'exchange',
7: 'service'
},
// 搜索
searchForm: {
couponName: ''
},
searchFormData: [
{
label: '礼包名称',
name: 'couponName',
type: 'input',
maxlength: 30,
width: '415px',
placeholder: '请输入券/服务名称进行搜索',
isClear: true
}
],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '名称',
prop: 'couponName',
width: 180
},
{
label: '预估成本/元',
prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
},
{
label: '有效期',
prop: 'effectiveType',
addHtml: 'effectiveType'
},
{
label: '使用限制',
prop: 'useType',
addHtml: 'useType'
},
{
label: '剩余库存',
prop: 'residueAmount'
}
]
}
}
},
props: {
isSelectGiftVisible: {
type: Boolean,
default: false
},
selectedGiftList: {
type: Object,
default: () => {
return {
// 折扣券
discount: {
label: '折扣券',
discountType: 2,
list: []
},
// 代金券
cash: {
label: '代金券',
discountType: 3,
list: []
},
// 兑换券
exchange: {
label: '兑换券',
discountType: 4,
list: []
},
// 会员服务
service: {
label: '会员服务',
discountType: 7,
list: []
}
}
}
}
},
mounted() {
this.userInfo = this.$globalState.session
this.getList({}, true, true)
},
methods: {
getList(page, isResetPage = false, isMount = false) {
var params = {
...this.searchForm,
discountType: this.selectedGiftList[this.activeName].discountType,
pageNum: isResetPage ? 1 : this.$refs[this.activeName + 'Ref'].page.pageNum,
pageSize: isResetPage ? 10 : this.$refs[this.activeName + 'Ref'].page.pageSize
}
this.loading = true
this.$apis.giftBag
.getDirectionalGiftListApi(params)
.then(res => {
// 重置分页组件
if (this.$refs[this.activeName + 'Ref'] && isResetPage) {
this.$refs[this.activeName + 'Ref'].page.pageNum = 1
this.$refs[this.activeName + 'Ref'].page.pageSize = 10
}
this.giftList = res.list
this.giftList.forEach(item => {
item.couponAnticipatedCost = item.anticipatedCost
})
// this.fnCallBack = true
this.$refs[this.activeName + 'Ref'].tableTotal = res.total
this.recoverySelected()
this.recoveryTotal()
this.$refs[this.activeName + 'Ref'].tableHeightValues = '42vh'
})
.finally(() => {
this.loading = false
})
},
handleTabClick() {
this.getList({}, true)
this.recoverySelected()
},
handleSearch() {
this.getList({}, true)
this.recoverySelected()
},
toLabelText(row) {
switch (row.effectiveType) {
case 3:
return '永久有效'
case 2:
return row.effectiveStartTime ? row.effectiveStartTime.split(' ')[0] + '-' + row.effectiveEndTime.split(' ')[0] : ''
case 1:
return row.effectiveDays + '天'
}
},
toRestrictLabelText(row) {
switch (row.useType) {
case 0:
return '无限制'
case 1:
return '有效期内可使用' + row.useAmount + '次'
case 2:
return '每' + row.useLimitDays + '天可以使用' + row.useAmount + '次'
}
},
toCashRestrictLabelText(row) {
switch (row.useChannel) {
case 1:
return '线上商品'
case 2:
return '到店核销'
}
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
var list = JSON.parse(JSON.stringify(this.selectedGiftList[this.activeName].list))
if (list && list.length) {
list.forEach(row => {
var idx = this.giftList.findIndex(k => k.id == row.id)
if (idx != -1 && row.status != '3') {
this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.giftList[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs[this.activeName + 'Ref'].mutiSelectArr.list
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.selectedGiftList[this.activeName].list.findIndex(subItem => subItem.id == item.id) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.giftList.findIndex(k => k.id == row.id)
if (idx != -1 && row.status != '3') {
this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.giftList[idx], false)
}
})
})
},
handleGiftDelete(attr, idx) {
var deleteList = this.selectedGiftList[attr].list.splice(idx, 1)
this.deleteSelected(deleteList)
this.recoveryTotal()
},
// 计算已选张数
recoveryTotal() {
this.selectedSum = 0
this.orderShow.forEach(itme => {
this.selectedGiftList[itme].list.forEach(subItem => {
this.selectedSum = this.selectedSum + 1
})
})
},
// 选择/取消
handleSelectionTable(val) {
var list = JSON.parse(JSON.stringify(this.selectedGiftList[this.activeName].list))
var count = 0
var currentIdList = this.giftList.map(item => item.id)
val
.map(item => item.id)
.forEach(k => {
if (currentIdList.indexOf(k) != -1) {
count = count + 1
}
})
if (count <= this.giftList.length || count == 0 || !val.length) {
this.selectedGiftList[this.activeName].list = []
}
val.forEach(item => {
let isSelected = list.find(k => k.id == item.id)
if (this.selectedGiftList[this.activeName].list.findIndex(k => k.id == item.id) == '-1') {
this.selectedGiftList[this.activeName].list.push({
id: item.id,
discountType: item.discountType,
couponName: item.couponName,
couponAmount: isSelected ? list.find(k => k.id == item.id).couponAmount : '1',
couponAnticipatedCost: item.couponAnticipatedCost,
status: '2'
})
}
})
list.forEach(item => {
if (item.status == '3') {
this.selectedGiftList[this.activeName].list.push(item)
} else if (this.giftList.findIndex(k => k.id == item.id) == '-1' && this.selectedGiftList[this.activeName].list.findIndex(k => k.id == item.id) == '-1') {
// 没有库存的券
this.selectedGiftList[this.activeName].list.push(item)
}
})
this.recoveryTotal()
},
handleGiftConfirm() {
// if (!this.giftList.length) {
// var params = {
// addOrEdit: 1,
// groupOrStore: this.userInfo.accountLevel == 4 ? 2 : 1,
// $title: '新建礼包'
// }
// this.$router.push({
// path: '/productGroup/editProduct',
// query: params
// })
// return true
// }
var selectedData = JSON.parse(JSON.stringify(this.selectedGiftList))
this.$emit('handleGiftConfirm', selectedData)
},
handleGiftClose() {
this.$emit('handleGiftClose')
}
}
}
</script>
<style lang="scss">
.muti-gift .el-tabs__active-bar {
display: block;
}
.muti-gift .el-tabs__nav-scroll {
display: block;
border-bottom: 1px solid #eeeeee;
}
.muti-gift .el-tabs__item {
font-weight: 400;
font-size: 16px;
color: #717171;
height: 36px !important;
line-height: 36px !important;
}
.muti-gift .el-tabs__item:hover,
.muti-gift .el-tabs__item.is-active {
color: #5f5efb;
background: #fff !important;
border-width: 0px !important;
}
.muti-gift .m-t-10 {
margin-top: 10px;
}
.muti-gift .gift-table {
width: calc(100% - 280px);
border: 1px solid #eeeeee;
margin-right: 10px;
}
.muti-gift .p-16 {
padding: 16px;
}
.muti-gift .selected-list {
width: 280px;
border-radius: 2px;
border: 1px solid #eeeeee;
.list-title {
font-size: 16px;
border-bottom: 1px solid #f1f1f1;
}
.list-gifts {
height: 52vh;
overflow-y: scroll;
}
.gift-box {
padding: 16px;
.gift-label {
color: #999999;
margin-bottom: 14px;
}
.gift-content {
border-bottom: 1px solid #e5e5e5;
.gift-item {
margin-bottom: 20px;
display: inline-flex;
align-items: center;
.muti-icon {
cursor: pointer;
}
.gift-coupon-name {
display: inline-block;
width: 109px;
margin: 0 5px 0 7px;
}
.gift-sum {
display: inline-block;
width: 82px;
text-align: right;
.el-input-number--mini .el-input__inner {
padding: 0 10px;
}
.sum-input {
display: inline-block;
width: 82px;
}
.el-input--mini .el-input__inner {
border: 0px;
}
.el-input-number--mini .el-input-number__decrease,
.el-input-number--mini .el-input-number__increase {
width: 20px !important;
border: 0px;
background-color: #fff;
}
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
.gift-item:last-child {
margin-bottom: 0;
}
}
.gift-content:last-child {
border-bottom: 0px;
}
}
}
</style>
......@@ -2,10 +2,8 @@
<template>
<div class="marketing order-manage">
<div class="list-tips m-b-10">
<img
class="tips-img"
src="@/assets/icon-info.png"
/>
<img class="tips-img"
src="@/assets/icon-info.png" />
<span class="table-tips">
已生成有效订单
<span class="txt-blue">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span>
......@@ -18,204 +16,179 @@
</div>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<GLCombiForm ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<div class="flex">
<div class="flex-default tabs">
<el-tabs
v-model="searchForm.requestSource"
@tab-click="handleTabClick"
>
<el-tab-pane
label="全部订单"
name="0"
></el-tab-pane>
<el-tab-pane
label="已付款"
name="1"
></el-tab-pane>
<el-tab-pane
label="未付款"
name="2"
></el-tab-pane>
<el-tab-pane
label="已退款"
name="3"
></el-tab-pane>
<el-tab-pane
label="售后订单"
name="4"
></el-tab-pane>
<el-tabs v-model="searchForm.requestSource"
@tab-click="handleTabClick">
<el-tab-pane label="全部订单"
name="0"></el-tab-pane>
<el-tab-pane v-if="!isSpecialMerchat"
label="已付款"
name="1"></el-tab-pane>
<el-tab-pane v-if="!isSpecialMerchat"
label="未付款"
name="2"></el-tab-pane>
<el-tab-pane v-if="!isSpecialMerchat"
label="已退款"
name="3"></el-tab-pane>
<el-tab-pane v-if="!isSpecialMerchat"
label="售后订单"
name="4"></el-tab-pane>
</el-tabs>
</div>
<el-button
class="default-blue-btn"
:size="size"
type="default"
@click="handleExport"
>导出</el-button>
<el-button class="default-blue-btn"
:size="size"
type="default"
@click="handleExport">导出</el-button>
</div>
</div>
<!-- 表格区域 - 全部订单/售后订单 - 开始 -->
<div class="order-manage-table">
<GLTable
ref="allOrderRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="weChatName"
class="flex-align"
slot-scope="scope"
>
<img
v-if="scope.scope.weChatImageUrl"
class="img-36 pointer img-circle"
:src="scope.scope.weChatImageUrl"
/>
<GLTable ref="allOrderRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div slot="weChatName"
class="flex-align"
slot-scope="scope">
<img v-if="scope.scope.weChatImageUrl"
class="img-36 pointer img-circle"
:src="scope.scope.weChatImageUrl" />
<span class="m-l-10">{{ scope.scope.weChatName }}</span>
<span v-if="!scope.scope.shareAvatar && !scope.scope.weChatName">-</span>
</div>
<template
slot="vinNo"
slot-scope="scope"
>
<template slot="vinNo"
slot-scope="scope">
{{ Array.isArray(scope.scope.vinNo) ? scope.scope.vinNo[0] : scope.scope.vinNo }}
<el-popover
popper-class="order-table-popover"
placement="right-start"
trigger="click"
>
<p
v-for="(item, index) in scope.scope.vinNo"
:key="index"
>{{ item }}</p>
<span
class="car-no"
slot="reference"
v-show="Array.isArray(scope.scope.vinNo)"
>...({{ scope.scope.vinNo.length - 1 }})</span>
<el-popover popper-class="order-table-popover"
placement="right-start"
trigger="click">
<p v-for="(item, index) in scope.scope.vinNo"
:key="index">{{ item }}</p>
<span class="car-no"
slot="reference"
v-show="Array.isArray(scope.scope.vinNo)">...({{ scope.scope.vinNo.length - 1 }})</span>
</el-popover>
</template>
<div
slot="orderStatus"
slot-scope="scope"
>
<span :class="['table-circle', 'm-r-8', [2, 10, 22].includes(scope.scope.orderStatus) ? 'back-green' : [9].includes(scope.scope.orderStatus) ? 'back-blue' : [1, 21, 6].includes(scope.scope.orderStatus) ? 'back-orange' : 'back-grey']"></span>
<div slot="orderStatus"
slot-scope="scope">
<span
:class="['table-circle', 'm-r-8', [2, 10, 22].includes(scope.scope.orderStatus) ? 'back-green' : [9].includes(scope.scope.orderStatus) ? 'back-blue' : [1, 21, 6].includes(scope.scope.orderStatus) ? 'back-orange' : 'back-grey']"></span>
<span>{{ baseData.orderStatusList.map(item => item.confId).includes(scope.scope.orderStatus + '') ? baseData.orderStatusList.find(item => item.confId == scope.scope.orderStatus).confName : '-' }}</span>
</div>
<div
slot="shareStaffName"
class="table-image"
slot-scope="scope"
>
<div slot="shareStaffName"
class="table-image"
slot-scope="scope">
<div>
<img
v-if="scope.scope.shareStaffImageUrl"
class="img-36 pointer img-circle"
style="vertical-align: middle"
slot="reference"
:src="scope.scope.shareStaffImageUrl"
/>
<img v-if="scope.scope.shareStaffImageUrl"
class="img-36 pointer img-circle"
style="vertical-align: middle"
slot="reference"
:src="scope.scope.shareStaffImageUrl" />
<span class="m-l-10">
<span>{{ scope.scope.shareStaffName }}</span>
<span
class="txt-green"
v-if="scope.scope.shareStaffType == 1"
>@微信</span>
<span
class="txt-orange"
v-if="scope.scope.shareStaffType == 2"
>@企微</span>
<span
class="txt-blue"
v-if="scope.scope.shareStaffType == 3"
>@小程序</span>
<span class="txt-green"
v-if="scope.scope.shareStaffSource == 1">@微信</span>
<span class="txt-orange"
v-if="scope.scope.shareStaffSource == 2">@企微</span>
<span class="txt-blue"
v-if="scope.scope.shareStaffSource == 3">@员工</span>
</span>
</div>
<span v-if="!scope.scope.shareStaffImageUrl && !scope.scope.shareStaffName">-</span>
</div>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
<div slot="assignName"
slot-scope="scope">
<div>
<template v-if="scope.scope.assignStaffName">
<img class="img-36 pointer img-circle"
v-if="scope.scope.assignStaffImageUrl"
:src="scope.scope.assignStaffImageUrl" />
<span class="m-l-10">
<span>{{ scope.scope.assignStaffName }}</span>
</span>
</template>
<template v-else-if="scope.scope.shareStaffName">
<img class="img-36 pointer img-circle"
v-if="scope.scope.shareStaffImageUrl"
:src="scope.scope.shareStaffImageUrl" />
<span class="m-l-10">
<span>{{ scope.scope.shareStaffName }}</span>
</span>
</template>
<template v-else>
<span>{{ scope.scope.assignStaffName || scope.scope.shareStaffName || '-' }}</span>
</template>
<!-- <span @click="handlerAssign(scope.scope)"
class="assignLabel">指派</span> -->
</div>
</div>
<div class="table-btns"
slot="auth-button"
slot-scope="scope">
<GLTableButton :buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
<!-- 表格区域 - 全部订单/售后订单 - end -->
</div>
<!-- 快递信息 -->
<GLDialog
v-if="isExpressVisible"
title="输入快递信息"
mode="mid"
okText="确定"
cancelText="取消"
:visible.sync="isExpressVisible"
@onOk="handleExpressConfirm"
@onCancel="handleExpressClose"
>
<glsx-combi-form
class="small-content m-t-20"
ref="expressRef"
:isBlock="true"
defaultWidth="284px"
:isEdit="isEdit"
:formRef="editChildRef"
:formObj="expressForm"
:formData="expressFormData"
:formRules="expressRules"
></glsx-combi-form>
<GLDialog v-if="isExpressVisible"
title="输入快递信息"
mode="mid"
okText="确定"
cancelText="取消"
:visible.sync="isExpressVisible"
@onOk="handleExpressConfirm"
@onCancel="handleExpressClose">
<glsx-combi-form class="small-content m-t-20"
ref="expressRef"
:isBlock="true"
defaultWidth="284px"
:isEdit="isEdit"
:formRef="editChildRef"
:formObj="expressForm"
:formData="expressFormData"
:formRules="expressRules"></glsx-combi-form>
</GLDialog>
<!-- 订单核销 -->
<GLDialog
v-if="isWriteOffVisible"
title="订单核销(请确保用户到店后核销,避免引起不必要问题)"
mode="mid"
okText="确定"
cancelText="取消"
:visible.sync="isWriteOffVisible"
@onOk="handleWriteOffConfirm"
@onCancel="handleWriteOffClose"
>
<glsx-combi-form
class="small-content m-t-20"
ref="writeOffRef"
:isBlock="true"
defaultWidth="284px"
:formRef="editChildRef"
:formObj="writeOffForm"
:formData="writeOffFormData"
:formRules="writeOffRules"
></glsx-combi-form>
<GLDialog v-if="isWriteOffVisible"
title="订单核销(请确保用户到店后核销,避免引起不必要问题)"
mode="mid"
okText="确定"
cancelText="取消"
:visible.sync="isWriteOffVisible"
@onOk="handleWriteOffConfirm"
@onCancel="handleWriteOffClose">
<glsx-combi-form class="small-content m-t-20"
ref="writeOffRef"
:isBlock="true"
defaultWidth="284px"
:formRef="editChildRef"
:formObj="writeOffForm"
:formData="writeOffFormData"
:formRules="writeOffRules"></glsx-combi-form>
</GLDialog>
<!-- 退款审核 -->
<GLDialog
v-if="isExamineVisible"
bigTitle="退款审核"
mode="big"
:visible.sync="isExamineVisible"
@onOk="handleExamineConfirm"
@onCancel="handleExamineClose"
>
<GLDialog v-if="isExamineVisible"
bigTitle="退款审核"
mode="big"
:visible.sync="isExamineVisible"
@onOk="handleExamineConfirm"
@onCancel="handleExamineClose">
<el-form label-width="144px">
<el-form-item label="售后类型">
<span>{{ orderInfo.refundTypeName }}</span>
......@@ -230,15 +203,11 @@
<span>{{ orderInfo.remark || '-' }}</span>
</el-form-item>
<el-form-item v-if="orderInfo.imgUrls">
<span
v-for="(item, index) in orderInfo.imgUrls"
:key="index"
>
<el-image
class="img-60"
:src="item"
:preview-src-list="[item]"
></el-image>
<span v-for="(item, index) in orderInfo.imgUrls"
:key="index">
<el-image class="img-60"
:src="item"
:preview-src-list="[item]"></el-image>
</span>
</el-form-item>
<el-form-item label="审核是否通过">
......@@ -248,28 +217,24 @@
</el-radio-group>
</el-form-item>
<template v-if="orderInfo.refundType == 1 && examineForm.isAllowed == '1'">
<glsx-combi-form
ref="examineRef"
:isEdit="isEdit"
defaultWidth="284px"
:isBlock="true"
:formRef="editChildRef"
:formObj="examineForm"
:formData="examineFormData"
:formRules="examineRules"
></glsx-combi-form>
<glsx-combi-form ref="examineRef"
:isEdit="isEdit"
defaultWidth="284px"
:isBlock="true"
:formRef="editChildRef"
:formObj="examineForm"
:formData="examineFormData"
:formRules="examineRules"></glsx-combi-form>
</template>
</el-form>
</GLDialog>
<!-- 确认收货 -->
<GLDialog
v-if="isReceivingVisible"
bigTitle="确认收货"
mode="big"
:visible.sync="isReceivingVisible"
@onOk="handleReceivingConfirm"
@onCancel="handleReceivingClose"
>
<GLDialog v-if="isReceivingVisible"
bigTitle="确认收货"
mode="big"
:visible.sync="isReceivingVisible"
@onOk="handleReceivingConfirm"
@onCancel="handleReceivingClose">
<el-form label-width="140px">
<el-form-item label="售后类型">
<span>{{ orderInfo.refundTypeName }}</span>
......@@ -297,12 +262,14 @@
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, exportFn } from '@/common/constant'
import { utils } from 'glsx-common'
import { businessType, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, exportFn } from '@/common/constant'
export default {
name: 'orderManage',
data () {
data() {
return {
size: 'small',
isSpecialMerchat: true,
url: url,
isEdit: true,
orderCode: '',
......@@ -321,7 +288,7 @@ export default {
deliveryType: '',
vin: '',
shareStaffName: '',
shareStaffType: '',
shareStaffSource: '',
activityName: '',
goodsName: '',
requestSource: '0'
......@@ -465,12 +432,12 @@ export default {
},
{
label: '推荐人类型',
name: 'shareStaffType',
name: 'shareStaffSource',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'shareStaffTypeList'
optionsName: 'shareStaffSourceList'
},
{
label: '活动名称',
......@@ -499,6 +466,24 @@ export default {
labelWidth: 56,
type: 'input',
maxlength: 11
},
{
label: '测试单',
name: 'orderType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'testSheetTypeList'
},
{
label: '业务场景',
name: 'businessType',
type: 'select',
optionList: [],
optionId: 'optionId',
optionLabel: 'optionLabel',
optionsName: 'businessTypeList'
}
],
// 快递信息
......@@ -608,11 +593,11 @@ export default {
fn: '退款'
},
condition: row => {
return row.orderSource == 4 && [2, 6, 21].includes(+row.orderStatus)
return !this.isSpecialMerchat && row.orderSource == 4 && [2, 6, 21].includes(+row.orderStatus)
},
listeners: {
click: row => {
this.secondConfirm('退款', '请确定是否发起退款?', 'orderManage', 'crowdFundRefundApi', { orderCode: row.orderCode })
this.secondConfirm('退款', '请确定是否发起退款?', 'orderManage', 'crowdFundRefundApi', { orderCode: row.orderCode }, () => { }, this.searchForm.requestSource != 0)
}
}
},
......@@ -639,7 +624,7 @@ export default {
fn: '商品发货'
},
condition: row => {
return row.deliveryType == 2 && row.orderStatus == 6
return !this.isSpecialMerchat && row.deliveryType == 2 && row.orderStatus == 6
},
listeners: {
click: this.handleExpressInfo
......@@ -666,7 +651,7 @@ export default {
type: 'text'
},
condition: row => {
return row.afterSaleStatus == 4
return !this.isSpecialMerchat && row.afterSaleStatus == 4
},
listeners: {
click: this.handleReceiving
......@@ -713,6 +698,12 @@ export default {
addHtml: 'shareStaffName'
},
{
label: '指派人',
prop: 'assignName',
width: 210,
addHtml: 'assignName'
},
{
label: '推荐人手机号',
prop: 'shareStaffPhone',
width: 160,
......@@ -757,6 +748,20 @@ export default {
width: 160
},
{
label: '业务场景',
prop: 'businessType',
width: 120,
formatter: cellValue => {
let type = cellValue.businessType
if (type) {
return businessType.find(item => item.optionId == type).optionLabel
} else {
return '-'
}
}
},
{
label: '商品名称',
prop: '',
width: '120',
......@@ -792,6 +797,15 @@ export default {
}
},
{
label: '测试单',
prop: 'orderType',
width: '100',
// addHtml: 'orderType'
formatter: cellValue => {
return cellValue.orderType == 1 ? '是' : '否'
}
},
{
label: '售后状态',
prop: 'afterSaleStatus',
width: '100',
......@@ -836,21 +850,30 @@ export default {
{ confId: '2', confName: '我要退款(无需退货)' },
{ confId: '3', confName: '众筹订单退款' }
],
shareStaffTypeList: [
shareStaffSourceList: [
{ confId: '1', confName: '个微' },
{ confId: '2', confName: '企微' }
]
{ confId: '2', confName: '企微' },
{ confId: '3', confName: '员工' }
],
testSheetTypeList: [
{ confId: '0', confName: '否' },
{ confId: '1', confName: '是' }
],
businessTypeList: utils.deepClone(businessType)
}
}
},
created() {
this.checkMerchant()
},
mounted () {
mounted() {
// this.getCount()
this.getOptionsList('searchFormData')
},
methods: {
getParams () {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.createdStartDateStr = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
......@@ -861,7 +884,7 @@ export default {
return params
},
beforeSearchFn () {
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
......@@ -869,7 +892,7 @@ export default {
})
},
getOptionsList (formName, hasAll = true, refreshSigle) {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
......@@ -895,7 +918,33 @@ export default {
}
},
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) {
showOrHideAttr(formName, label, isHide) {
let idx = this[formName].findIndex(item => item.label == label)
this[formName][idx].isHide = isHide
},
deleteAttr(labelList) {
labelList.forEach(i => {
console.log(i)
let idx = this.tableParams.tableColumns.findIndex(item => item.label == i)
this.tableParams.tableColumns.splice(idx, 1)
})
},
checkMerchant() {
this.$apis.orderManage.checkMerchartApi({}).then(res => {
this.isSpecialMerchat = res
var hideList = ['售后状态', '订单类型', '结算方式', '商户订单号', '车架号', '推荐人', '推荐人类型', '手机号', '推荐人手机号']
if (this.isSpecialMerchat) {
hideList.forEach(item => {
this.showOrHideAttr('searchFormData', item, true)
})
this.deleteAttr(['手机号', '其他', '微信名称', '推荐人', '推荐人手机号', '车架号', '商户订单号'])
}
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn, isResetPage = true) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -909,7 +958,7 @@ export default {
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
isResetPage ? this.handleSearch() : this.$refs.allOrderRef.refreshTable(false)
}
})
}
......@@ -917,7 +966,7 @@ export default {
})
},
getCount () {
getCount() {
var params = this.getParams()
delete params.createDate
// if(params.orderStatuses.includes('3')) return
......@@ -926,7 +975,7 @@ export default {
})
},
handleDetail (row) {
handleDetail(row) {
this.$router.push({
path: '/orderManage/orderDetail',
query: {
......@@ -936,7 +985,7 @@ export default {
},
// 输入快递信息 - start
handleExpressClose () {
handleExpressClose() {
this.isExpressVisible = !this.isExpressVisible
this.orderCode = ''
this.expressForm = {
......@@ -945,7 +994,7 @@ export default {
}
},
handleExpressConfirm () {
handleExpressConfirm() {
this.$refs.expressRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.expressForm)
......@@ -965,14 +1014,14 @@ export default {
})
},
handleExpressInfo (row) {
handleExpressInfo(row) {
this.isExpressVisible = !this.isExpressVisible
this.orderCode = row.orderCode
},
// 输入快递信息 - end
// 订单核销 - start
handleWriteOffClose () {
handleWriteOffClose() {
this.isWriteOffVisible = !this.isWriteOffVisible
this.orderCode = ''
this.writeOffForm = {
......@@ -980,7 +1029,7 @@ export default {
}
},
handleWriteOffConfirm () {
handleWriteOffConfirm() {
this.$refs.writeOffRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.writeOffForm)
......@@ -993,16 +1042,16 @@ export default {
})
if (res.code == '0') {
this.handleWriteOffClose()
this.handleSearch()
this.searchForm.requestSource == 0 ? this.$refs.allOrderRef.refreshTable(false) : this.handleSearch()
}
})
}
})
},
handleWriteOff (row) {
handleWriteOff(row) {
if (row.orderSource == 4) {
this.secondConfirm('订单核销', '请确定是否核销此订单?', 'orderManage', 'crowdFundWriteOffApi', { orderCode: row.orderCode })
this.secondConfirm('订单核销', '请确定是否核销此订单?', 'orderManage', 'crowdFundWriteOffApi', { orderCode: row.orderCode }, () => { }, this.searchForm.requestSource != 0)
return true
}
this.isWriteOffVisible = !this.isWriteOffVisible
......@@ -1011,7 +1060,7 @@ export default {
// 订单核销 - end
// 退款审核 - start
handleExamineClose () {
handleExamineClose() {
this.isExamineVisible = !this.isExamineVisible
this.orderCode = ''
this.orderInfo = {}
......@@ -1023,7 +1072,7 @@ export default {
}
},
submitExamine (params) {
submitExamine(params) {
this.$apis.orderManage.examineAllowApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
......@@ -1032,12 +1081,12 @@ export default {
})
if (res.code == '0') {
this.handleExamineClose()
this.handleSearch()
this.searchForm.requestSource == 0 ? this.$refs.allOrderRef.refreshTable(false) : this.handleSearch()
}
})
},
handleExamineConfirm () {
handleExamineConfirm() {
var params = {
id: this.orderInfo.id
}
......@@ -1056,7 +1105,7 @@ export default {
}
},
handleExamine (row) {
handleExamine(row) {
this.orderCode = row.orderCode
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
this.orderInfo = res || {}
......@@ -1068,13 +1117,13 @@ export default {
// 退款审核 - end
// 确认收货 - start
handleReceivingClose () {
handleReceivingClose() {
this.isReceivingVisible = !this.isReceivingVisible
this.orderCode = ''
this.orderInfo = {}
},
handleReceivingConfirm () {
handleReceivingConfirm() {
var params = {
id: this.orderInfo.id
}
......@@ -1091,7 +1140,7 @@ export default {
})
},
handleReceiving (row) {
handleReceiving(row) {
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
this.orderInfo = res || {}
this.orderInfo.refundTypeName = [1, 2, 3].includes(this.orderInfo.refundType) ? this.baseData.refundTypeList.find(item => item.confId == this.orderInfo.refundType + '').confName : '-'
......@@ -1101,7 +1150,7 @@ export default {
},
// 确认收货 - end
setTableFinishFun () {
setTableFinishFun() {
this.$refs.allOrderRef.data.forEach(item => {
item.vinNo = item.vin ? (item.vin.split(',').length > 1 ? item.vin.split(',') : item.vin) : '-'
})
......@@ -1110,22 +1159,25 @@ export default {
this.getCount()
},
handleSearch () {
handleSearch() {
this.$refs.allOrderRef.refreshTable()
},
handleTabClick () {
handleTabClick() {
if (this.isSpecialMerchat) {
return true
}
this.handleSearch()
},
handleExport (row) {
handleExport(row) {
var params = this.getParams()
this.$apis.orderManage.orderExportApi(params).then(res => {
exportFn(res)
})
},
handleReset () {
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
}
......
......@@ -4,10 +4,16 @@
<div class="edit-box">
<div class="container m-b-20">
<p class="edit-title">订单信息</p>
<el-form label-width="100px" :inline="true">
<el-row v-for="(item, index) in detailFormDataRow" :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label" class="row-item">
<span class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : '-' }}</span>
<el-form label-width="100px"
:inline="true">
<el-row v-for="(item, index) in detailFormDataRow"
:key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList"
:key="subIndex"
:label="subItem.label"
class="row-item">
<span class="detail-txt ellipsis-1"
:title="detailForm[subItem.name]">{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : '-' }}</span>
</el-form-item>
</el-row>
<el-form-item label="其他信息">{{ detailForm.formDescribe }}</el-form-item>
......@@ -15,43 +21,61 @@
</div>
<div :class="['container', orderRefund ? 'm-b-20' : 'edit-container']">
<p class="edit-title">发货信息</p>
<el-form label-width="100px" :inline="true">
<el-form label-width="100px"
:inline="true">
<el-form-item label="物流信息">
<span>{{ detailForm.deliveryCompany }}&nbsp;&nbsp;&nbsp;{{ detailForm.deliveryNumber }}</span>
</el-form-item>
</el-form>
<div v-if="orderGoods.length" class="p-l-40">
<div v-if="orderGoods.length"
class="p-l-40">
<table class="show-table">
<tbody>
<tr v-for="(item, index) in orderGoods" :key="index" style="height: 70px;">
<td><img :src="item.goodsImage" class="img-60" /></td>
<tr v-for="(item, index) in orderGoods"
:key="index"
style="height: 70px;">
<td><img :src="item.goodsImage"
class="img-60" /></td>
<td>{{ item.goodsName }}</td>
<td>{{ item.specificationData }}</td>
<td>{{ item.activityPrice ? item.activityPrice : item.retailPrice }}元 * {{ item.goodsNumber }}</td>
<td>{{ item.activityPrice ? item.activityPrice : item.retailPrice }}元 *
{{ item.goodsNumber }}</td>
</tr>
<tr v-if="detailForm.subOrderCoupon" style="height: 40px;">
<td style="text-align: left;" colspan="3">优惠券</td>
<tr v-if="detailForm.subOrderCoupon"
style="height: 40px;">
<td style="text-align: left;"
colspan="3">优惠券</td>
<td>{{ detailForm.subOrderCoupon.discountAmount }}元</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container edit-container" v-if="orderRefund">
<div class="container edit-container"
v-if="orderRefund">
<p class="edit-title">售后信息</p>
<el-form label-width="100px" :inline="true">
<el-row v-for="(item, index) in afterInfoDataRow" :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label">
<span class="detail-txt ellipsis-1" :title="orderRefund[subItem.name]">{{ orderRefund[subItem.name] || '-' }}</span>
<el-form label-width="100px"
:inline="true">
<el-row v-for="(item, index) in afterInfoDataRow"
:key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList"
:key="subIndex"
:label="subItem.label">
<span class="detail-txt ellipsis-1"
:title="orderRefund[subItem.name]">{{ orderRefund[subItem.name] || '-' }}</span>
</el-form-item>
</el-row>
</el-form>
<div class="form-img">
<el-form label-width="100px" :inline="true">
<el-form label-width="100px"
:inline="true">
<el-form-item label="售后凭证">
<div class="flex">
<span v-for="(item, index) in orderRefund.imgUrls" :key="index">
<el-image class="img-60 comment-img" :src="item" :preview-src-list="[item]"></el-image>
<span v-for="(item, index) in orderRefund.imgUrls"
:key="index">
<el-image class="img-60 comment-img"
:src="item"
:preview-src-list="[item]"></el-image>
</span>
</div>
</el-form-item>
......@@ -60,7 +84,8 @@
</div>
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">取消</el-button>
<el-button @click="handleCancel"
size="medium">取消</el-button>
</GLFooter>
</div>
</template>
......@@ -134,10 +159,14 @@ export default {
name: 'orderStatusName'
},
{
label: '支付总价',
label: '支付定金',
name: 'payPrice'
},
{
label: '尾款',
name: 'crowdFundingPrice'
},
{
label: '发货地址',
name: 'shipAddress'
},
......@@ -254,6 +283,10 @@ export default {
var takeFeeIdx = this.detailFormData.findIndex(item => item.name == 'takeFee')
this.detailFormData.splice(takeFeeIdx, 1)
}
if (res.orderSource == 4) {
let idx = this.detailFormData.findIndex(item => item.name == 'shipAddress')
this.detailFormData.splice(idx, 1)
}
// 其他信息
var formDescribeObj = {
label: '其他信息',
......
......@@ -2,35 +2,75 @@
<template>
<div class="marketing pro-group">
<div class="m-b-20">
<GLButton :size="size" type="primary" fn="新建商品" class="el-icon-plus" @click="handleEdit(1)">新建商品</GLButton>
<GLButton :size="size"
type="primary"
fn="新建商品"
class="el-icon-plus"
@click="handleEdit(1)">新建商品</GLButton>
</div>
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable ref="proGroupRef" class="table-img" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="goodsImage" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.goodsImage" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.goodsImage" />
<GLTable ref="proGroupRef"
class="table-img"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<template slot="goodsImage"
slot-scope="scope">
<el-popover placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block">
<img class="table-popover-img"
:src="scope.scope.goodsImage" />
<img class="img-60 pointer"
slot="reference"
:src="scope.scope.goodsImage" />
</el-popover>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
<div class="table-btns"
slot="auth-button"
slot-scope="scope">
<GLTableButton :buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 下架 -->
<glsx-dialog title="下架" :isVisible.sync="isDownVisible" @confirmDialog="handleDownConfirm" @closeDialog="handleDownClose">
<el-form ref="downRef" label-width="100px" :rules="downRules" :model="downForm">
<el-form-item label="下架备注" prop="offReason">
<el-input :size="size" v-model="downForm.offReason" placeholder="请输入下架备注" maxlength="30"></el-input>
<glsx-dialog title="下架"
:isVisible.sync="isDownVisible"
@confirmDialog="handleDownConfirm"
@closeDialog="handleDownClose">
<el-form ref="downRef"
label-width="100px"
:rules="downRules"
:model="downForm">
<el-form-item label="下架备注"
prop="offReason">
<el-input :size="size"
v-model="downForm.offReason"
placeholder="请输入下架备注"
maxlength="30"></el-input>
</el-form-item>
</el-form>
</glsx-dialog>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
<share-dialog :isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"></share-dialog>
</div>
</template>
......@@ -332,6 +372,10 @@ export default {
{
confId: '2',
confName: '带货'
},
{
confId: '3',
confName: '总部商品'
}
]
}
......
......@@ -64,7 +64,7 @@
<div class="wechat-block">
<div>
<div class="flex">
<div>玩家心得({{ editForm.activityExperienceDTOs.length }})</div>
<div>服务评价({{ editForm.activityExperienceDTOs.length }})</div>
<div class="sprite-icon icon-arrow"></div>
</div>
<div v-if="editForm.activityExperienceDTOs.length">
......
......@@ -2,14 +2,14 @@
<template>
<div class="marketing">
<div class="m-b-20">
<GLButton
<!-- <GLButton
:size="size"
class="default-blue-btn el-icon-plus"
type="default"
@click="handleEdit('add')"
fn="新增众筹"
mode="el-button"
>新建众筹</GLButton>
>新建众筹</GLButton> -->
<el-button
:size="size"
type="default"
......@@ -145,67 +145,74 @@ export default {
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '开始',
attrs: {
type: 'text'
},
condition: row => {
return row.activityStatus == '1'
},
listeners: {
click: this.start
}
},
{
type: 'el-button',
name: '结束',
attrs: {
type: 'text'
},
condition: row => {
return row.activityStatus == '2'
},
listeners: {
click: this.end
}
},
{
type: 'GLButton',
name: '编辑',
name: '查看',
attrs: {
type: 'text',
fn: '编辑众筹'
},
condition: row => {
return row.activityStatus == '1' || row.activityStatus == '2' || row.activityStatus == '3'
fn: '查看众筹'
},
listeners: {
click: row => {
// var editOrDetail = {
// 1: 'edit',
// 2: 'detail',
// 3: 'detail'
// }[row.activityStatus]
// return this.handleEdit(editOrDetail, row)
this.handleEdit('edit', row)
this.handleEdit('detail', row)
}
}
},
{
type: 'GLButton',
name: '删除',
attrs: {
type: 'text',
fn: '删除众筹'
},
condition: row => {
return row.activityStatus == '3'
},
listeners: {
click: this.del
}
},
// {
// type: 'el-button',
// name: '开始',
// attrs: {
// type: 'text'
// },
// condition: row => {
// return row.activityStatus == '1'
// },
// listeners: {
// click: this.start
// }
// },
// {
// type: 'el-button',
// name: '结束',
// attrs: {
// type: 'text'
// },
// condition: row => {
// return row.activityStatus == '2'
// },
// listeners: {
// click: this.end
// }
// },
// {
// type: 'GLButton',
// name: '编辑',
// attrs: {
// type: 'text',
// fn: '编辑众筹'
// },
// condition: row => {
// return row.activityStatus == '1' || row.activityStatus == '2' || row.activityStatus == '3'
// },
// listeners: {
// click: row => {
// this.handleEdit('edit', row)
// }
// }
// },
// {
// type: 'GLButton',
// name: '删除',
// attrs: {
// type: 'text',
// fn: '删除众筹'
// },
// condition: row => {
// return row.activityStatus == '3'
// },
// listeners: {
// click: this.del
// }
// },
{
type: 'el-button',
name: '置顶',
......@@ -226,18 +233,18 @@ export default {
click: this.handleShare
}
},
{
type: 'el-button',
name: '复制',
attrs: {
type: 'text'
},
listeners: {
click: row => {
this.handleEdit('copy', row)
}
}
},
// {
// type: 'el-button',
// name: '复制',
// attrs: {
// type: 'text'
// },
// listeners: {
// click: row => {
// this.handleEdit('copy', row)
// }
// }
// },
{
type: 'GLButton',
name: '数据看板',
......@@ -473,10 +480,9 @@ export default {
query: params
})
},
test (option) {
console.log(JSON.parse(JSON.stringify(option)))
},
// test (option) {
// console.log(JSON.parse(JSON.stringify(option)))
// },
// 明细
handleDetail ({ prop, scope }) {
let data = {
......
......@@ -3,44 +3,35 @@
<div class="data-board-box">
<p class="edit-title">数据看板</p>
<div class="p-20">
<GLCombiForm
ref="dataRef"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
></GLCombiForm>
<GLCombiForm ref="dataRef"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"></GLCombiForm>
<div class="data-view">
<template v-for="(item,index) in dataList">
<div
:key="index"
class="item"
>
<template v-for="(item, index) in dataList">
<div :key="index"
class="item">
<div class="name">
{{item.name}}
<el-popover
class="tips"
placement="top"
width="260"
trigger="hover"
:content="item.tips"
>
<img
slot="reference"
class="tips-icon"
src="@/components/glsx-combi-form/images/icon-tip.png"
/>
{{ item.name }}
<el-popover class="tips"
placement="top"
width="260"
trigger="hover"
:content="item.tips">
<img slot="reference"
class="tips-icon"
src="@/components/glsx-combi-form/images/icon-tip.png" />
</el-popover>
</div>
<div class="value">{{dataBoard[item.key] || 0}}</div>
<div class="value">{{ dataBoard[item.key] || 0 }}</div>
<template v-if="item.half">
<div class="half">
日环比:
<div :class="['icon',
{'up':dataBoard[item.half]>0},
{'down':dataBoard[item.half]<0}
]"></div>
<span class="num">{{Math.abs(dataBoard[item.half]).toFixed(2) || 0}}%</span>
<div
:class="['icon', { up: dataBoard[item.half] > 0 }, { down: dataBoard[item.half] < 0 }]">
</div>
<span class="num">{{ Math.abs(dataBoard[item.half]).toFixed(2) || 0 }}%</span>
</div>
</template>
</div>
......@@ -51,55 +42,40 @@
<div class="data-board-box">
<p class="edit-title">员工排行榜</p>
<div class="p-20">
<GLCombiForm
ref="rankRef"
:rowNumber="1"
:formObj="searchRankForm"
:formData="searchFormRankData"
@handleOk="handleSearchRank"
></GLCombiForm>
<GLCombiForm ref="rankRef"
:rowNumber="1"
:formObj="searchRankForm"
:formData="searchFormRankData"
@handleOk="handleSearchRank"></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
<el-button :size="size"
class="default-blue-btn"
type="default"
@click="handleExport('rank')">导出</el-button>
</div>
<GLTable
ref="dataTableRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
:hasNum="false"
>
<div
slot="shareName"
class="flex-align"
slot-scope="scope"
>
<GLTable ref="dataTableRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
:hasNum="false">
<div slot="shareName"
class="flex-align"
slot-scope="scope">
<template v-if="scope.scope.shareAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.shareAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar"
/>
<el-popover placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block">
<img class="table-popover-img"
:src="scope.scope.shareAvatar" />
<img class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar" />
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
......@@ -108,12 +84,99 @@
</GLTable>
</div>
</div>
<div class="data-board-box">
<p class="edit-title">每日订单量统计</p>
<div class="p-20">
<div class="flex m-b-10 w-100-percent">
<span class="table-title">数据列表</span>
<el-button :size="size"
class="default-blue-btn"
type="default"
@click="handleExport('dailyOrders')">导出</el-button>
</div>
<el-table v-if="DailyOrderQuantityList.length"
:data="DailyOrderQuantityListFormat"
style="width: 100%">
<el-table-column :formatter="formatterHeader"
label=""></el-table-column>
<!-- width="140px" -->
<el-table-column v-for="(item, index) in DailyOrderQuantityList"
:key="index"
:prop="item"
:label="item.day">
<template slot-scope="scope">
<span>{{ scope.$index ? item.currentOrderQuantity : item.specificDate }}</span>
</template>
</el-table-column>
<el-table-column :formatter="formatterEnd"
fixed="right"
label="总计"></el-table-column>
</el-table>
<div v-else>
<img src="url"
alt="" />
</div>
</div>
</div>
<div class="data-board-box">
<p class="edit-title">直播间数据统计</p>
<div class="p-20">
<!-- <GLCombiForm ref="rankRef" :rowNumber="1" :formObj="searchRankForm" :formData="searchFormRankData" @handleOk="handleSearchRank"></GLCombiForm> -->
<div class="flex m-b-10 w-100-percent">
<span class="table-title">
<span>
当前直播间在线人数:
<span class="txt-red">{{ liveInfo.onlineMemberNum }}</span>
人
</span>
<span>
已下单
<span class="txt-red">{{ liveInfo.dealOrderCount }}</span>
人
</span>
<span>
已成交
<span class="txt-red">{{ liveInfo.dealPeopleCount }}</span>
单
</span>
</span>
<el-button :size="size"
class="default-blue-btn"
type="default"
@click="handleExport('liveData')">导出</el-button>
</div>
<!-- :searchForm="tableSearchForm" -->
<GLTable ref="dataTableRefDetailPage"
:getListApi="getLiveDetailPage"
:noDataImg="url"
:tableParams="liveTableParams"
:searchForm="LiveTableSearchForm"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn">
<div slot="weChatName"
class="flex-align"
slot-scope="scope">
<img v-if="scope.scope.avatar"
class="img-36 pointer img-circle"
:src="scope.scope.avatar" />
<span class="m-l-10">{{ scope.scope.nickname }}</span>
<span v-if="!scope.scope.avatar && !scope.scope.nickname">-</span>
</div>
<!-- <div slot="orderStatus"
slot-scope="scope">
<span
:class="['table-circle', 'm-r-8', [2, 10, 22].includes(scope.scope.orderStatus) ? 'back-green' : [9].includes(scope.scope.orderStatus) ? 'back-blue' : [1, 21, 6].includes(scope.scope.orderStatus) ? 'back-orange' : 'back-grey']"></span>
<span>{{ baseData.orderStatusList.map(item => item.confId).includes(scope.scope.orderStatus + '') ? baseData.orderStatusList.find(item => item.confId == scope.scope.orderStatus).confName : '-' }}</span>
</div> -->
</GLTable>
</div>
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import { exportFn } from '@/common/constant'
import { downLoadFile, orderManageStatusList } from '@/common/constant'
import url from '@/assets/empty.png'
const dataList = [
......@@ -123,23 +186,31 @@ const dataList = [
{ name: '累计浏览量', key: 'totalBrowseCount', tips: '页面被浏览的总次数(一人多次访问计为多次)' },
{ name: '累计访客数', key: 'totalFansCount', tips: '访问页面的总人数(一人多次访问计为一次)' },
{ name: '累计订单数', key: 'totalOrderCount', tips: '累计订单总数(只记录已付款的订单)' }
], optionList = [
{ confId: '1', confName: '转发次数' },
{ confId: '2', confName: '访客总数' },
{ confId: '3', confName: '浏览总数' },
{ confId: '4', confName: '成交单量' },
{ confId: '5', confName: '转化率' }
]
],
optionList = [
{ confId: '1', confName: '转发次数' },
{ confId: '2', confName: '访客总数' },
{ confId: '3', confName: '浏览总数' },
{ confId: '4', confName: '成交单量' },
{ confId: '5', confName: '转化率' }
]
export default {
name: 'ScrmMicroMarketingDataBoard',
data () {
data() {
return {
url,
dataList,
totalCount: 0,
searchForm: {
statDate: dayjs().format('YYYY-MM-DD')
},
// 基本数据
baseData: {
searchOrderStatusList: orderManageStatusList.filter(item => ['1', '3', '21', '22', '6', '9'].includes(item.confId))
},
DailyOrderQuantityList: [],
DailyOrderQuantityListFormat: [{}, {}],
searchFormData: [
{
label: '统计日期',
......@@ -150,7 +221,8 @@ export default {
}
],
searchRankForm: {
statDimension: '1'
statDimension: '1',
shareName: ''
},
searchFormRankData: [
{
......@@ -162,16 +234,23 @@ export default {
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
},
{
label: '员工名称',
name: 'shareName',
type: 'input',
maxlength: 100
}
],
getListApi: this.$apis.seckillActivity.getRankListApi,
getLiveDetailPage: this.$apis.seckillActivity.liveroomDetailpage,
tableSearchForm: {},
tableParams: {
listName: 'list',
tableColumns: [
{
label: '排名',
prop: 'rankNumber',
prop: 'rankNumber'
},
{
label: '员工',
......@@ -181,7 +260,7 @@ export default {
},
{
label: '转发次数',
prop: 'shareCount',
prop: 'shareCount'
},
{
label: '访客总数',
......@@ -190,11 +269,11 @@ export default {
},
{
label: '浏览总数',
prop: 'browseCount',
prop: 'browseCount'
},
{
label: '成交单量',
prop: 'orderCount',
prop: 'orderCount'
},
{
label: '转化率',
......@@ -205,15 +284,80 @@ export default {
}
]
},
liveTableParams: {
listName: 'list',
// tableOption: true,
tableColumns: [
{
label: '微信名称',
prop: 'weChatName',
addHtml: 'weChatName'
// width: 210
},
{
label: '手机号',
prop: 'phone',
// width: 160,
formatter: cellValue => {
return cellValue.phone || '-'
}
},
{
label: '浏览时长',
name: 'visitDuration',
prop: 'visitDuration'
// width: 120
// formatter: cellValue => {
// // return dayjs(cellValue.visitDuration).format('YYYY-MM-DD HH:mm:ss')
// }
},
{
label: '进入直播间时间',
name: 'entryTime',
prop: 'entryTime'
// width: 200
// formatter: cellValue => {
// return dayjs(cellValue.entryTime).format('YYYY-MM-DD HH:mm:ss')
// }
},
{
label: '离开直播间时间',
name: 'leaveTime',
prop: 'leaveTime'
// width: 200
// formatter: cellValue => {
// return dayjs(cellValue.leaveTime).format('YYYY-MM-DD HH:mm:ss')
// }
},
{
label: '订单状态',
prop: 'orderStatus',
// addHtml: 'orderStatus',
width: 160
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
dataBoard: {}
dataBoard: {},
activityId: '',
liveInfo: {}
}
},
created () {
computed: {
LiveTableSearchForm() {
return {
activityId: this.activityId
}
}
},
created() {
this.activityId = this.$route.query.activityId
// 获取每日订单量统计
this.getDailyOrderQuantityStatistics()
this.getDataBoardApi()
this.getLiveData()
},
mounted () {
mounted() {
let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'),
[rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default')
if (dataResetBtn) dataResetBtn.style.display = 'none'
......@@ -221,43 +365,100 @@ export default {
},
methods: {
getDataBoardApi () {
let { activityId } = this.$route.query,
{ statDate } = this.searchForm
this.$apis.seckillActivity.getDataBoardApi({ activityId, statDimension: dayjs(statDate).format('YYYY-MM-DD') }).then(res => {
getLiveData() {
this.$apis.seckillActivity
.liveroomOverview({ activityId: this.activityId })
.then(result => {
console.log(result)
this.liveInfo = {
...result
}
})
.catch(err => { })
},
getDataBoardApi() {
// { activityId } = this.$route.query,
let { statDate } = this.searchForm
this.$apis.seckillActivity.getDataBoardApi({ activityId: this.activityId, statDimension: dayjs(statDate).format('YYYY-MM-DD') }).then(res => {
this.dataBoard = res || {}
})
// 直播间数据统计
// this.getLiveBroadcastRoomDataStatistics()
},
getDailyOrderQuantityStatistics() {
this.$apis.seckillActivity
.getDailyOrderQuantityStatistics({ id: this.activityId })
.then(result => {
console.log(result)
// let totalCount = {
// currentOrderQuantity: 0,
// specificDate: '',
// day: '总计'
// }
if (result.length) {
this.totalCount = result.reduce((total, item, index, arr) => {
return (total += item.currentOrderQuantity)
}, 0)
}
// result.push(totalCount)
this.DailyOrderQuantityList = result || []
})
.catch(err => {
console.log(err)
})
},
getParams () {
getParams() {
let { activityId } = this.$route.query,
params = JSON.parse(JSON.stringify(this.searchRankForm))
console.log(params)
params.activityId = activityId
return params
},
handleSearch () {
handleSearch() {
this.getDataBoardApi()
},
handleSearchRank () {
handleSearchRank() {
this.$refs.dataTableRef.refreshTable()
},
handleExport () {
let params = this.getParams()
this.$apis.seckillActivity.exportRankListApi(params).then(res => {
exportFn(res)
})
handleExport(name) {
if (name == 'rank') {
let params = this.getParams()
this.$apis.seckillActivity.exportRankListApi(params).then(res => {
downLoadFile(res)
})
}
if (name == 'dailyOrders') {
this.$apis.seckillActivity.exportDailyOrderQuantityStatistics({ id: this.activityId }).then(result => {
downLoadFile(result)
})
}
if (name == 'liveData') {
this.$apis.seckillActivity.liveroomDetailexport({ activityId: this.activityId, currentPage: 1, pageSize: 100000 }).then(result => {
console.log(result)
// downLoadFile(result)
})
}
},
beforeSearchFn () {
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
setTableFinishFun () {
setTableFinishFun() {
//接收到的数据为空
this.$refs.dataTableRef.data.length ? (this.$refs.dataTableRef.tableHeightValues = '') : this.$refs.dataTableRef.setTableHeightFun()
},
formatterHeader(row, column, cellValue, index) {
return index == 0 ? '活动日期' : '订单量'
},
formatterEnd(row, column, cellValue, index) {
return index == 1 ? this.totalCount : ''
}
},
};
}
}
</script>
<style lang="scss" scoped>
......@@ -323,4 +524,7 @@ export default {
}
}
}
.data-board-box + .data-board-box {
margin-top: 20px;
}
</style>
<!-- 众筹活动 -->
<template>
<div
v-loading="loading"
class="edit-activity"
>
<div v-loading="loading" class="edit-activity">
<!-- 导航 -->
<el-tabs
:tab-position="tabPosition"
v-model="tabName"
class="nav-tabs"
@tab-click="whereToGo(tabName)"
>
<el-tab-pane
label="基本信息"
name="basic"
></el-tab-pane>
<el-tab-pane
label="活动配置"
name="config"
></el-tab-pane>
<el-tabs :tab-position="tabPosition" v-model="tabName" class="nav-tabs" @tab-click="whereToGo(tabName)">
<el-tab-pane label="基本信息" name="basic"></el-tab-pane>
<el-tab-pane label="活动配置" name="config"></el-tab-pane>
<el-tab-pane name="activityServices">
<span
class="p-l-23"
slot="label"
>服务说明</span>
<span class="p-l-23" slot="label">服务说明</span>
</el-tab-pane>
<el-tab-pane name="activityCommoditys">
<span
class="p-l-23"
slot="label"
>商品答疑</span>
<span class="p-l-23" slot="label">商品答疑</span>
</el-tab-pane>
<el-tab-pane name="activityExperienceDTOs">
<span
class="p-l-23"
slot="label"
>玩家心得</span>
<span class="p-l-23" slot="label">服务评价</span>
</el-tab-pane>
<el-tab-pane name="live">
<span
class="p-l-23"
slot="label"
>直播配置</span>
<span class="p-l-23" slot="label">直播配置</span>
</el-tab-pane>
</el-tabs>
<div class="marketing edit-box">
<!-- 基本信息 -->
<div
class="container edit-container"
style="min-height: 520px !important;"
>
<p
class="edit-title"
id="basic"
>基本信息</p>
<glsx-combi-form
class="edit-form-container"
ref="editFormRef"
:isEdit="true"
:isBlock="true"
:formRef="editChildRef"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule"
>
<div
slot="activityImg"
class="edit-tips m-t-8"
>展示在首页的活动详情页</div>
<template
slot="activityTimeHtml"
slot-scope="scope"
>
<el-date-picker
v-model="editForm.activityTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00', '23:59:59']"
:disabled="isDisabled"
@change="e => handleTimeChange(e, scope.scope)"
></el-date-picker>
<div class="container edit-container" style="min-height: 520px !important;">
<p class="edit-title" id="basic">基本信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="activityImg" class="edit-tips m-t-8">展示在首页的活动详情页</div>
<template slot="activityTimeHtml" slot-scope="scope">
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</template>
<div slot="goodsHtml">
<el-button
type="default"
class="el-icon-plus"
v-if="!isDisabled"
@click="handleRelateProClose"
>选择商品</el-button>
<div
v-if="selectedProInfo.id && !specificationDetailList.length"
style="margin-top: 10px"
>
<el-button type="default" class="el-icon-plus" v-if="!isDisabled" @click="handleRelateProClose">选择商品</el-button>
<div v-if="selectedProInfo.id && !specificationDetailList.length" style="margin-top: 10px">
<p>
<img
class="img-60"
:src="selectedProInfo.goodsImage"
/>
<img class="img-60" :src="selectedProInfo.goodsImage" />
&nbsp;&nbsp;&nbsp; 零售价 {{ (selectedProInfo.retailPrice / 100).toFixed(2) }}元 &nbsp;&nbsp;&nbsp; 商品库存 {{ selectedProInfo.goodsStock }}件
</p>
<el-form-item
label="设置秒杀价:"
prop="activityPrice"
id="activityPrice"
>
<el-input
v-model="editForm.activityPrice"
style="width: 150px"
:disabled="isDisabled"
><span slot="append">元</span></el-input>
<el-form-item label="设置秒杀价:" prop="activityPrice" id="activityPrice">
<el-input v-model="editForm.activityPrice" style="width: 150px" :disabled="isDisabled"><span slot="append">元</span></el-input>
</el-form-item>
<el-form-item
label="活动库存:"
prop="goodsStock"
id="goodsStock"
>
<el-input
v-model="editForm.goodsStock"
style="width: 150px"
:disabled="isDisabled"
><span slot="append">件</span></el-input>
<el-form-item label="活动库存:" prop="goodsStock" id="goodsStock">
<el-input v-model="editForm.goodsStock" style="width: 150px" :disabled="isDisabled"><span slot="append">件</span></el-input>
</el-form-item>
</div>
</div>
<div
slot="specificationsHtml"
v-if="specificationDetailList.length"
class="flex"
style="min-width: 600px"
id="specificationDetailList"
>
<div slot="specificationsHtml" v-if="specificationDetailList.length" class="flex" style="min-width: 600px" id="specificationDetailList">
<div style="width: calc(100%)">
<table
class="table-spesc"
style="width: calc(100%)"
>
<table class="table-spesc" style="width: calc(100%)">
<tbody>
<tr>
<td
:style="{ width: specsWidth }"
v-for="(subItem, subIndex) in specificationDetailList"
:key="subIndex"
>{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }">零售价(元)</td>
<td :style="{ width: specsWidth }">库存</td>
<td :style="{ width: specsWidth }">设置秒杀价</td>
......@@ -152,73 +55,31 @@
</tr>
</tbody>
</table>
<table
class="table-spesc"
style="max-height: 400px"
>
<table class="table-spesc" style="max-height: 400px">
<tbody>
<tr
style="border-bottom: 1px solid rgb(235, 235, 235)"
v-for="(item, index) in nameToValSpecsList"
:key="index"
>
<td
:style="{ width: specsWidth }"
v-for="(n, idx) in item.specsValueList"
:key="idx"
>{{ n }}</td>
<tr style="border-bottom: 1px solid rgb(235, 235, 235)" v-for="(item, index) in nameToValSpecsList" :key="index">
<td :style="{ width: specsWidth }" v-for="(n, idx) in item.specsValueList" :key="idx">{{ n }}</td>
<td :style="{ width: specsWidth }">{{ item.retailPrice }}元</td>
<td :style="{ width: specsWidth }">{{ item.stock }}件</td>
<td :style="{ width: specsWidth }">
<el-input
:disabled="isDisabled"
placeholder="秒杀价"
style="width: 90%"
v-model="item.activityPrice"
@input="item.activityPrice = activityPrice_input($event, item.retailPrice)"
></el-input>
<el-input :disabled="isDisabled" placeholder="秒杀价" style="width: 90%" v-model="item.activityPrice" @input="item.activityPrice = activityPrice_input($event, item.retailPrice)"></el-input>
</td>
<td :style="{ width: specsWidth }">
<el-input
:disabled="isDisabled"
placeholder="活动库存"
style="width: 90%"
v-model="item.goodsStock"
@input="item.goodsStock = goodsStock_input($event, item.stock)"
></el-input>
<el-input :disabled="isDisabled" placeholder="活动库存" style="width: 90%" v-model="item.goodsStock" @input="item.goodsStock = goodsStock_input($event, item.stock)"></el-input>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<template
slot="limitPurchaseFlag"
slot-scope="scope"
>
<el-radio-group
v-model="editForm[scope.scope.name]"
@change="handleIsLimit"
>
<el-radio
v-for="(item, index) in scope.scope.optionList"
:key="index"
:label="item[scope.scope.optionId]"
:disabled="isDisabled"
>{{ item[scope.scope.optionLabel] }}</el-radio>
<template slot="limitPurchaseFlag" slot-scope="scope">
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleIsLimit">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]" :disabled="isDisabled">{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group>
<p
v-if="editForm[scope.scope.name] == 2"
id="limitPurchaseNumber"
style="color: #333333;"
>
<p v-if="editForm[scope.scope.name] == 2" id="limitPurchaseNumber" style="color: #333333;">
每人限购
<el-form-item prop="limitPurchaseNumber">
<el-input
v-model="editForm.limitPurchaseNumber"
placeholder="请输入限购次数"
:disabled="isDisabled"
></el-input>
<el-input v-model="editForm.limitPurchaseNumber" placeholder="请输入限购次数" :disabled="isDisabled"></el-input>
</el-form-item>
件
</p>
......@@ -227,105 +88,35 @@
</div>
<!-- 活动配置 -->
<div class="container edit-container crowd-config">
<p
class="edit-title"
id="config"
>活动配置</p>
<glsx-combi-form
class="edit-form-container"
ref="configEditFormRef"
:isEdit="true"
:isBlock="true"
:formRef="editChildRef"
:formObj="editForm"
:formData="configEditFormData"
:formRules="editRule"
>
<template
slot="customerServiceFlag"
slot-scope="scope"
>
<p class="edit-title" id="config">活动配置</p>
<glsx-combi-form class="edit-form-container" ref="configEditFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="configEditFormData" :formRules="editRule">
<template slot="customerServiceFlag" slot-scope="scope">
<el-radio-group v-model="editForm[scope.scope.name]">
<el-radio
v-for="(item, index) in scope.scope.optionList"
:key="index"
:label="item[scope.scope.optionId]"
>{{ item[scope.scope.optionLabel] }}</el-radio>
<el-radio v-for="(item, index) in scope.scope.optionList" :disabled="isDisabled" :key="index" :label="item[scope.scope.optionId]">{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group>
<div
class="customer-service"
v-if="editForm[scope.scope.name] == 2"
id="customerServiceFlag"
>
<glsx-combi-form
class="edit-form-container"
ref="customerEditFormRef"
:isEdit="true"
:isBlock="false"
:formRef="editChildRef"
:formObj="editForm"
:formData="customerEditFormData"
:formRules="editRule"
></glsx-combi-form>
<div class="customer-service" v-if="editForm[scope.scope.name] == 2" id="customerServiceFlag">
<glsx-combi-form class="edit-form-container" ref="customerEditFormRef" :isEdit="true" :isBlock="false" :formRef="editChildRef" :formObj="editForm" :formData="customerEditFormData" :formRules="editRule"></glsx-combi-form>
</div>
</template>
<template
slot="activityMusic"
slot-scope="scope"
>
<template slot="activityMusic" slot-scope="scope">
<div class="flex">
<div
class="music-box flex-center"
v-for="(item, index) in musicList"
:key="index"
@click="handleMusicChange(index)"
>
<div
class="music-icon"
@click.stop="handleMusic(item, index)"
>
<div class="music-box flex-center" v-for="(item, index) in musicList" :key="index" @click="handleMusicChange(index)">
<div class="music-icon" @click.stop="handleMusic(item, index)">
<div :class="[index != playObj.idx ? 'icon-start' : 'icon-stop']"></div>
<img src="@/assets/seckillActivity/icon-music-default.png" />
</div>
<div class="music-name">
<p
class="ellipsis-1"
style="max-width: 90%;"
>{{ item.name }}</p>
<p class="ellipsis-1" style="max-width: 90%;">{{ item.name }}</p>
.mp3
</div>
<img
v-show="item.isCheck"
:class="{ 'icon-check': item.isCheck }"
src="@/assets/seckillActivity/icon-check.png"
/>
<img v-show="item.isCheck" :class="{ 'icon-check': item.isCheck }" src="@/assets/seckillActivity/icon-check.png" />
</div>
</div>
<el-upload
class="m-t-10"
action=""
accept="audio/mp3, audio/m4a"
:show-file-list="false"
:http-request="handleMusicUpload"
:before-upload="e => handleMusicBeforeUpload(e, scope.scope)"
:file-list="fileList"
>
<el-button
class="el-icon-plus"
size="small"
type="default"
>背景音乐</el-button>
<el-upload v-if="!isDisabled" class="m-t-10" action="" accept="audio/mp3, audio/m4a" :show-file-list="false" :http-request="handleMusicUpload" :before-upload="e => handleMusicBeforeUpload(e, scope.scope)" :file-list="fileList">
<el-button class="el-icon-plus" size="small" type="default">背景音乐</el-button>
</el-upload>
<audio
v-if="playObj.src"
style="display: none;"
id="music-audio"
controls
>
<source
type="audio/mpeg"
:src="playObj.src"
/>
<audio v-if="playObj.src" style="display: none;" id="music-audio" controls>
<source type="audio/mpeg" :src="playObj.src" />
</audio>
<!-- <div v-if="editForm[scope.scope.name]" class="flex">
<audio controls>
......@@ -335,452 +126,227 @@
</div> -->
</template>
<template slot="fictitious">
<div
class="fictitious"
id="fictitious"
>
<el-form-item
label="参团:"
prop="fictitiousGroupQuantity"
labelWidth="60px"
>
<el-input
v-model="editForm.fictitiousGroupQuantity"
style="width: 90px"
maxlength="50"
placeholder="参团人数"
></el-input>
<div class="fictitious" id="fictitious">
<el-form-item label="参团:" prop="fictitiousGroupQuantity" labelWidth="60px">
<el-input :disabled="isDisabled" v-model="editForm.fictitiousGroupQuantity" style="width: 90px" maxlength="50" placeholder="参团人数"></el-input>
</el-form-item>
<el-form-item
id="fictitiousLadderQuantity"
label="阶梯人数:"
prop="fictitiousLadderQuantity"
labelWidth="90px"
>
<el-input
v-model="editForm.fictitiousLadderQuantity"
style="width: 90px"
maxlength="50"
placeholder="阶梯人数"
></el-input>
<el-form-item id="fictitiousLadderQuantity" label="阶梯人数:" prop="fictitiousLadderQuantity" labelWidth="90px">
<el-input :disabled="isDisabled" v-model="editForm.fictitiousLadderQuantity" style="width: 90px" maxlength="50" placeholder="阶梯人数"></el-input>
</el-form-item>
<el-form-item
id="fictitiousViewQuantity"
label="浏览:"
prop="fictitiousViewQuantity"
labelWidth="60px"
>
<el-input
v-model="editForm.fictitiousViewQuantity"
style="width: 90px"
maxlength="50"
placeholder="浏览人数"
></el-input>
<el-form-item id="fictitiousViewQuantity" label="浏览:" prop="fictitiousViewQuantity" labelWidth="60px">
<el-input :disabled="isDisabled" v-model="editForm.fictitiousViewQuantity" style="width: 90px" maxlength="50" placeholder="浏览人数"></el-input>
</el-form-item>
</div>
</template>
<div
slot="activityBigImg"
class="edit-tips m-t-8"
>建议尺寸750*1258</div>
<div
slot="activityVideos"
class="edit-tips m-t-8"
>最多上传6个视频</div>
<div
slot="posterImg"
class="edit-tips m-t-8"
>建议尺寸640*1008</div>
<div
class="form-describe-box"
slot="formDescribe"
>
<div slot="activityBigImg" class="edit-tips m-t-8">建议尺寸750*1258</div>
<div slot="activityVideos" class="edit-tips m-t-8">最多上传6个视频</div>
<div slot="posterImg" class="edit-tips m-t-8">建议尺寸640*1008</div>
<div class="form-describe-box" slot="formDescribe">
<el-checkbox-group v-model="editForm.formDescribeCheck">
<el-checkbox
v-for="(item, index) in formDescribeCheckList"
:label="item.value"
:key="index"
>{{ item.label }}</el-checkbox>
<el-checkbox :disabled="isDisabled" v-for="(item, index) in formDescribeCheckList" :label="item.value" :key="index">{{ item.label }}</el-checkbox>
</el-checkbox-group>
<div
v-for="(item, index) in formDescribeList"
:key="index"
class="form-describe flex-default"
>
<el-input
class="describe-input"
v-model="item.value"
placeholder="请输入"
maxlength="20"
></el-input>
<div v-for="(item, index) in formDescribeList" :key="index" class="form-describe flex-default">
<el-input :disabled="isDisabled" class="describe-input" v-model="item.value" placeholder="请输入" maxlength="20"></el-input>
<p class="describe-delete">
<img
v-show="!(index == 0 && formDescribeList.length == 1)"
@click="handleDescribeDelete(index)"
src="@/assets/icon-delete.png"
/>
<img v-show="!(index == 0 && formDescribeList.length == 1)" @click="handleDescribeDelete(index)" src="@/assets/icon-delete.png" />
</p>
</div>
<el-button
class="btn-basic"
v-show="formDescribeList.length < describeNum"
:size="size"
type="text"
@click="handleDescribeAdd"
>
<img
class="icon-add"
src="@/assets/seckillActivity/icon-add.png"
/>
<el-button v-if="!isDisabled" class="btn-basic" v-show="formDescribeList.length < describeNum" :size="size" type="text" @click="handleDescribeAdd">
<img class="icon-add" src="@/assets/seckillActivity/icon-add.png" />
新增表单
</el-button>
</div>
<div slot="showAvatarNicknameFlag">
<el-radio-group v-model="editForm.showAvatarNicknameFlag">
<el-radio-group :disabled="isDisabled" v-model="editForm.showAvatarNicknameFlag">
<el-radio :label="1">隐藏</el-radio>
<el-radio :label="2">显示</el-radio>
</el-radio-group>
</div>
<!-- 服务说明 -->
<div
slot="activityServices"
id="activityServices"
class="flex-default"
>
<span
class="custom-label arrow"
slot="label"
@click="handleArrow('activityServices')"
:style="{ width: defaultLabelWidth }"
>
<div slot="activityServices" id="activityServices" class="flex-default">
<span class="custom-label arrow" slot="label" @click="handleArrow('activityServices')" :style="{ width: defaultLabelWidth }">
<i :class="[arrowFlagObj.activityServices == 'open' ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></i>
服务说明:
</span>
<div class="form-show-box">
<div :class="['btn-box', arrowFlagObj.activityServices == 'open' && editForm.activityServices.length ? 'line' : '']">
<el-button
:class="[editForm.activityServices.length < 9 ? 'btn-basic' : 'btn-disable']"
:size="size"
type="text"
@click="handleAddItem('services', 'activityServices', 9)"
>
<img
class="icon-add"
src="@/assets/seckillActivity/icon-add.png"
/>
<div v-if="!isDisabled" :class="['btn-box', arrowFlagObj.activityServices == 'open' && editForm.activityServices.length ? 'line' : '']">
<el-button :class="[editForm.activityServices.length < 9 ? 'btn-basic' : 'btn-disable']" :size="size" type="text" @click="handleAddItem('services', 'activityServices', 9)">
<img class="icon-add" src="@/assets/seckillActivity/icon-add.png" />
新增一项
</el-button>
</div>
<div :class="['form-show-block', arrowFlagObj.activityServices == 'close' ? 'form-close' : 'form-open']">
<div
v-for="(item, index) in editForm.activityServices"
:key="index"
:class="['form-show-item', editForm.activityServices.length > index + 1 ? 'line' : '']"
>
<glsx-combi-form
class="p-t-20"
ref="serviceEditFormRef"
:formRef="editChildRef"
:isEdit="true"
:isBlock="true"
:formObj="item"
:formData="serviceEditFormData"
:formRules="serviceEditRule"
></glsx-combi-form>
<el-button
:class="['btn-basic', 'btn-delete', index == editForm.activityServices.length - 1 ? 'last-btn-delete' : '']"
:size="size"
type="text"
@click="handleDeleteItem('services', 'activityServices', index)"
>
<img
class="icon-add"
src="@/assets/icon-delete.png"
/>
</el-button>
<div v-if="editForm.activityServices.length">
<div v-for="(item, index) in editForm.activityServices" :key="index" :class="['form-show-item', editForm.activityServices.length > index + 1 ? 'line' : '']">
<glsx-combi-form class="p-t-20" ref="serviceEditFormRef" :formRef="editChildRef" :isEdit="true" :isBlock="true" :formObj="item" :formData="serviceEditFormData" :formRules="serviceEditRule"></glsx-combi-form>
<el-button v-if="!isDisabled" :class="['btn-basic', 'btn-delete', index == editForm.activityServices.length - 1 ? 'last-btn-delete' : '']" :size="size" type="text" @click="handleDeleteItem('services', 'activityServices', index)">
<img class="icon-add" src="@/assets/icon-delete.png" />
</el-button>
</div>
</div>
<div v-else>无数据</div>
</div>
</div>
</div>
<!-- 商品答疑 -->
<div
slot="activityCommoditys"
id="activityCommoditys"
class="flex-default"
>
<span
class="custom-label arrow"
slot="label"
@click="handleArrow('activityCommoditys')"
:style="{ width: defaultLabelWidth }"
>
<div slot="activityCommoditys" id="activityCommoditys" class="flex-default">
<span class="custom-label arrow" slot="label" @click="handleArrow('activityCommoditys')" :style="{ width: defaultLabelWidth }">
<i :class="[arrowFlagObj.activityCommoditys == 'open' ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></i>
商品答疑:
</span>
<div class="form-show-box">
<div :class="['btn-box', arrowFlagObj.activityCommoditys == 'open' && editForm.activityCommoditys.length ? 'line' : '']">
<el-button
:class="[editForm.activityCommoditys.length < 9 ? 'btn-basic' : 'btn-disable']"
:size="size"
type="text"
@click="handleAddItem('commoditys', 'activityCommoditys', 9)"
>
<img
class="icon-add"
src="@/assets/seckillActivity/icon-add.png"
/>
<div v-if="!isDisabled" :class="['btn-box', arrowFlagObj.activityCommoditys == 'open' && editForm.activityCommoditys.length ? 'line' : '']">
<el-button :class="[editForm.activityCommoditys.length < 9 ? 'btn-basic' : 'btn-disable']" :size="size" type="text" @click="handleAddItem('commoditys', 'activityCommoditys', 9)">
<img class="icon-add" src="@/assets/seckillActivity/icon-add.png" />
新增一项
</el-button>
</div>
<div :class="['form-show-block', arrowFlagObj.activityCommoditys == 'close' ? 'form-close' : 'form-open']">
<div
v-for="(item, index) in editForm.activityCommoditys"
:key="index"
:class="['form-show-item', editForm.activityCommoditys.length > index + 1 ? 'line' : '']"
>
<glsx-combi-form
class="p-t-20"
ref="commoditysEditFormRef"
:formRef="editChildRef"
:isEdit="true"
:isBlock="true"
:formObj="item"
:formData="commoditysEditFormData"
:formRules="commoditysEditRule"
></glsx-combi-form>
<el-button
:class="['btn-basic', 'btn-delete', index == editForm.activityCommoditys.length - 1 ? 'last-btn-delete' : '']"
:size="size"
type="text"
@click="handleDeleteItem('commoditys', 'activityCommoditys', index)"
>
<img
class="icon-add"
src="@/assets/icon-delete.png"
/>
</el-button>
<div v-if="editForm.activityCommoditys.length">
<div v-for="(item, index) in editForm.activityCommoditys" :key="index" :class="['form-show-item', editForm.activityCommoditys.length > index + 1 ? 'line' : '']">
<glsx-combi-form class="p-t-20" ref="commoditysEditFormRef" :formRef="editChildRef" :isEdit="true" :isBlock="true" :formObj="item" :formData="commoditysEditFormData" :formRules="commoditysEditRule"></glsx-combi-form>
<el-button v-if="!isDisabled" :class="['btn-basic', 'btn-delete', index == editForm.activityCommoditys.length - 1 ? 'last-btn-delete' : '']" :size="size" type="text" @click="handleDeleteItem('commoditys', 'activityCommoditys', index)">
<img class="icon-add" src="@/assets/icon-delete.png" />
</el-button>
</div>
</div>
<div v-else>无数据</div>
</div>
</div>
</div>
<!-- 玩家心得 -->
<div
slot="activityExperienceDTOs"
id="activityExperienceDTOs"
class="flex-default"
>
<span
class="custom-label arrow"
slot="label"
@click="handleArrow('activityExperienceDTOs')"
:style="{ width: defaultLabelWidth }"
>
<!-- 服务评价 -->
<div slot="activityExperienceDTOs" id="activityExperienceDTOs" class="flex-default">
<span class="custom-label arrow" slot="label" @click="handleArrow('activityExperienceDTOs')" :style="{ width: defaultLabelWidth }">
<i :class="[arrowFlagObj.activityExperienceDTOs == 'open' ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></i>
玩家心得:
服务评价:
</span>
<div class="form-show-box">
<div :class="['btn-box', arrowFlagObj.activityExperienceDTOs == 'open' && editForm.activityExperienceDTOs.length ? 'line' : '']">
<el-button
:class="[editForm.activityExperienceDTOs.length < 9 ? 'btn-basic' : 'btn-disable']"
:size="size"
type="text"
@click="handleAddItem('experiences', 'activityExperienceDTOs', 9)"
>
<img
class="icon-add"
src="@/assets/seckillActivity/icon-add.png"
/>
<div v-if="!isDisabled" :class="['btn-box', arrowFlagObj.activityExperienceDTOs == 'open' && editForm.activityExperienceDTOs.length ? 'line' : '']">
<el-button :class="[editForm.activityExperienceDTOs.length < 9 ? 'btn-basic' : 'btn-disable']" :size="size" type="text" @click="handleAddItem('experiences', 'activityExperienceDTOs', 9)">
<img class="icon-add" src="@/assets/seckillActivity/icon-add.png" />
新增一项
</el-button>
</div>
<div :class="['form-show-block', arrowFlagObj.activityExperienceDTOs == 'close' ? 'form-close' : 'form-open']">
<div
v-for="(item, index) in editForm.activityExperienceDTOs"
:key="index"
:class="['form-show-item', editForm.activityExperienceDTOs.length > index + 1 ? 'line' : '']"
>
<div class="head-box">
<img
class="icon-head"
src="@/assets/seckillActivity/icon-default-head.png"
/>
<span>虚拟人物{{ index + 1 }}</span>
<div v-if="editForm.activityExperienceDTOs.length">
<div v-for="(item, index) in editForm.activityExperienceDTOs" :key="index" :class="['form-show-item', editForm.activityExperienceDTOs.length > index + 1 ? 'line' : '']">
<div class="head-box">
<img class="icon-head" src="@/assets/seckillActivity/icon-default-head.png" />
<span>虚拟人物{{ index + 1 }}</span>
</div>
<glsx-combi-form class="p-t-20" :formRef="editChildRef" :isEdit="true" :isBlock="true" :formObj="item" :formData="experiencesEditFormData" :formRules="editRule">
<div slot="activityExperienceImgs" class="edit-tips m-t-8">建议尺寸:图片大小不超过5m,最多可添加9张图片</div>
</glsx-combi-form>
<el-button v-if="!isDisabled" :class="['btn-basic', 'btn-delete', index == editForm.activityExperienceDTOs.length - 1 ? 'last-btn-delete' : '']" :size="size" type="text" @click="handleDeleteItem('experiences', 'activityExperienceDTOs', index)">
<img class="icon-add" src="@/assets/icon-delete.png" />
</el-button>
</div>
<glsx-combi-form
class="p-t-20"
:formRef="editChildRef"
:isEdit="true"
:isBlock="true"
:formObj="item"
:formData="experiencesEditFormData"
:formRules="editRule"
>
<div
slot="activityExperienceImgs"
class="edit-tips m-t-8"
>建议尺寸:图片大小不超过5m,最多可添加9张图片</div>
</glsx-combi-form>
<el-button
:class="['btn-basic', 'btn-delete', index == editForm.activityExperienceDTOs.length - 1 ? 'last-btn-delete' : '']"
:size="size"
type="text"
@click="handleDeleteItem('experiences', 'activityExperienceDTOs', index)"
>
<img
class="icon-add"
src="@/assets/icon-delete.png"
/>
</el-button>
</div>
<div>无数据</div>
</div>
</div>
</div>
<!-- 员工注册链接 -->
<div slot="employeeRegistrationLinkFlag" slot-scope="scope">
<el-radio-group v-model="editForm[scope.scope.name]">
<el-radio-group :disabled="isDisabled" v-model="editForm[scope.scope.name]">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]">{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group>
</div>
<template slot="appointmentContacts">
<div class="appointmentContactsClass">
<el-form-item label="姓名:" prop="reservationInstallContactsName" labelWidth="60px">
<el-input v-model="editForm.reservationInstallContactsName" style="width: 432px;display: block;" maxlength="10" placeholder="请输入姓名"></el-input>
<el-input :disabled="isDisabled" v-model="editForm.reservationInstallContactsName" style="width: 432px;display: block;" maxlength="10" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item label="电话:" prop="reservationInstallContactsPhone" labelWidth="60px" class="phoneClass">
<el-input v-model="editForm.reservationInstallContactsPhone" style="width: 432px" maxlength="11" placeholder="请输入电话"></el-input>
<el-input :disabled="isDisabled" v-model="editForm.reservationInstallContactsPhone" style="width: 432px" maxlength="11" placeholder="请输入电话"></el-input>
</el-form-item>
</div>
</template>
<!-- 战报内容配置 -->
<template slot="reportConfigure">
<div class="reportConfigure-bag">
<el-tabs v-model="reportFlag">
<el-tab-pane label="进行中战报" name="1">
<el-form-item label="产值活动报告:" prop="produceReportSummary" labelWidth="100px">
<el-input v-model="editForm.activityActionReport.produceReportSummary" placeholder="根据以往经验,活动前三天转发效果最好,赶紧督促大家转发起来吧" type="textarea" maxlength="200" show-word-limit style="width:580px;height:79px;" rows="3"></el-input>
</el-form-item>
</el-tab-pane>
<el-tab-pane label="已结束战报" name="2">
<el-form-item label="客户资产分析总结:" prop="customerAssetSummary" labelWidth="140px" style="margin-left: 27px;margin-bottom: 0px;">
<el-input v-model="editForm.activityActionReport.customerAssetSummary" placeholder="请输入" type="textarea" maxlength="200" show-word-limit style="width:580px;height:79px;" rows="3"></el-input>
</el-form-item>
<el-form-item label="触达通道分析总结:" prop="touchPassageSummary" labelWidth="140px" style="margin-left: 27px;margin-top: 10px;">
<el-input v-model="editForm.activityActionReport.touchPassageSummary" placeholder="请输入" type="textarea" maxlength="200" show-word-limit style="width:580px;height:79px;" rows="3"></el-input>
</el-form-item>
<div class="reportConfigureList">
<span class="reportConfigureLabel">标杆门店数据:</span>
<el-form-item label="分享数(次)" prop="signMerchantShareCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input v-model="editForm.activityActionReport.signMerchantShareCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="浏览数(次)" prop="signMerchantBrowseCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input v-model="editForm.activityActionReport.signMerchantBrowseCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="访客数(人)" prop="signMerchantVisitorCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input v-model="editForm.activityActionReport.signMerchantVisitorCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="订单数(单)" prop="signMerchantOrderCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input v-model="editForm.activityActionReport.signMerchantOrderCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="总产值(万)" prop="signMerchantProduceCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input v-model="editForm.activityActionReport.signMerchantProduceCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
</div>
<div class="reportConfigureList">
<span class="reportConfigureLabel">短信触达数据:</span>
<el-form-item label="目标客户数(人)" prop="noteTouchCustomerCount" labelWidth="100px" style="margin: 0px 8px 0px 0px;">
<el-input v-model="editForm.activityActionReport.noteTouchCustomerCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="访客数(人)" prop="noteTouchVisitorCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input v-model="editForm.activityActionReport.noteTouchVisitorCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="订单数(单)" prop="noteTouchOrderCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input v-model="editForm.activityActionReport.noteTouchOrderCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="转化率(%)" prop="noteTouchConversionRate" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input v-model="editForm.activityActionReport.noteTouchConversionRate" style="width: 136px;height:32px;" readonly></el-input>
</el-form-item>
</div>
</el-tab-pane>
</el-tabs>
</div>
<div class="reportConfigure-bag">
<el-tabs v-model="reportFlag">
<el-tab-pane label="进行中战报" name="1">
<el-form-item label="产值活动报告:" prop="produceReportSummary" labelWidth="100px">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.produceReportSummary" placeholder="根据以往经验,活动前三天转发效果最好,赶紧督促大家转发起来吧" type="textarea" maxlength="200" show-word-limit style="width:580px;height:79px;" rows="3"></el-input>
</el-form-item>
</el-tab-pane>
<el-tab-pane label="已结束战报" name="2">
<el-form-item label="客户资产分析总结:" prop="customerAssetSummary" labelWidth="140px" style="margin-left: 27px;margin-bottom: 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.customerAssetSummary" placeholder="请输入" type="textarea" maxlength="200" show-word-limit style="width:580px;height:79px;" rows="3"></el-input>
</el-form-item>
<el-form-item label="触达通道分析总结:" prop="touchPassageSummary" labelWidth="140px" style="margin-left: 27px;margin-top: 10px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.touchPassageSummary" placeholder="请输入" type="textarea" maxlength="200" show-word-limit style="width:580px;height:79px;" rows="3"></el-input>
</el-form-item>
<div class="reportConfigureList">
<span class="reportConfigureLabel">标杆门店数据:</span>
<el-form-item label="分享数(次)" prop="signMerchantShareCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.signMerchantShareCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="浏览数(次)" prop="signMerchantBrowseCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.signMerchantBrowseCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="访客数(人)" prop="signMerchantVisitorCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.signMerchantVisitorCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="订单数(单)" prop="signMerchantOrderCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.signMerchantOrderCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="总产值(万)" prop="signMerchantProduceCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.signMerchantProduceCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
</div>
<div class="reportConfigureList">
<span class="reportConfigureLabel">短信触达数据:</span>
<el-form-item label="目标客户数(人)" prop="noteTouchCustomerCount" labelWidth="100px" style="margin: 0px 8px 0px 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.noteTouchCustomerCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="访客数(人)" prop="noteTouchVisitorCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.noteTouchVisitorCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="订单数(单)" prop="noteTouchOrderCount" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.noteTouchOrderCount" style="width: 136px;height:32px;" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="转化率(%)" prop="noteTouchConversionRate" labelWidth="70px" style="margin: 0px 8px 0px 0px;">
<el-input :disabled="isDisabled" v-model="editForm.activityActionReport.noteTouchConversionRate" style="width: 136px;height:32px;" readonly></el-input>
</el-form-item>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<!-- 直播配置 -->
<div slot="live">
<el-switch v-model="editForm.liveFlag"></el-switch>
<div
class="customer-service"
v-if="editForm.liveFlag"
id="liveFlag"
>
<glsx-combi-form
class="edit-form-container"
ref="liveEditFormRef"
:formRef="editChildRef"
:isEdit="true"
:isBlock="false"
:formObj="editForm"
:formData="liveEditFormData"
:formRules="liveEditRule"
>
<div
slot="groupQrCode"
class="edit-tips m-t-8"
>建议尺寸:284*284</div>
<div
v-if="!editForm.floatingMaskDiagram"
slot="defaultImg"
class="default-live-img"
>
<el-switch :disabled="isDisabled" v-model="editForm.liveFlag"></el-switch>
<div class="customer-service" v-if="editForm.liveFlag" id="liveFlag">
<glsx-combi-form class="edit-form-container" ref="liveEditFormRef" :formRef="editChildRef" :isEdit="true" :isBlock="true" :formObj="editForm" :formData="liveEditFormData" :formRules="liveEditRule">
<div slot="groupQrCode" class="edit-tips m-t-8">注:用于直播间内加群展示;请上传2M以内的jpg、jpeg、png图片,建议图片尺寸284*284</div>
<div v-if="!editForm.floatingMaskDiagram" slot="defaultImg" class="default-live-img">
<img :src="defaultFloatingMaskDiagram" />
</div>
<div
slot="floatingMaskDiagram"
class="edit-tips m-t-8"
>建议格式:GIF,尺寸228*346</div>
<div slot="floatingMaskDiagram" class="edit-tips m-t-8">注:用于直播间内浮动元素展示;请上传2M以内的gif、jpg、jpeg、png图片,建议图片尺寸120*176</div>
<div v-if="!editForm.liveBroadcastRoomCover" slot="defaultImgCover" class="default-live-img">
<img :src="defaultImgObj.COVER_LIVE" />
</div>
<div v-if="!editForm.liveBroadcastRoomEndCover" slot="defaultImgEndCover" class="default-live-img">
<img :src="defaultImgObj.COVER_REPLAY" />
</div>
<div slot="liveBroadcastRoomEndCover" class="edit-tips m-t-8">注:用于活动中直播小窗口展示;请上传2M以内的gif、jpg、jpeg、png图片,建议图片尺寸164*252</div>
</glsx-combi-form>
</div>
</div>
</glsx-combi-form>
</div>
<GLFooter>
<el-button
@click="handleCancel"
size="medium"
>{{ routeInfo.addOrEdit != 'detail' ? '取消' : '返回' }}</el-button>
<el-button
@click="handleWechat"
size="medium"
>预览</el-button>
<el-button
v-if="routeInfo.addOrEdit != 'detail'"
type="primary"
@click="handleConfirm"
size="medium"
:loading="loading"
>提交</el-button>
<el-button @click="handleCancel" size="medium">{{ routeInfo.addOrEdit != 'detail' ? '取消' : '返回' }}</el-button>
<el-button @click="handleWechat" size="medium">预览</el-button>
<el-button v-if="routeInfo.addOrEdit != 'detail'" type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter>
<!-- 展示 -->
<GLDialog
bigTitle="预览"
mode="big"
:visible.sync="wechatVisible"
@onOk="handleWechat"
@onCancel="handleWechat"
>
<crowdEditWechat
ref="crowdEditWechat"
:editForm="editForm"
:countDownObj="countDownObj"
></crowdEditWechat>
<GLDialog bigTitle="预览" mode="big" :visible.sync="wechatVisible" @onOk="handleWechat" @onCancel="handleWechat">
<crowdEditWechat ref="crowdEditWechat" :editForm="editForm" :countDownObj="countDownObj"></crowdEditWechat>
</GLDialog>
<select-single-pro-dialog
v-if="isSingleSelectVisible"
:isSingleSelectVisible="isSingleSelectVisible"
:selectedProInfo="selectedProInfo"
@handleSingleSelectConfirm="handleSingleSelectConfirm"
@handleSingleSelectClose="handleSingleSelectClose(true)"
></select-single-pro-dialog>
<select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :propSearch="{ deliveryType: 1 }" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose(true)"></select-single-pro-dialog>
</div>
</div>
</template>
......@@ -793,7 +359,7 @@ export default {
components: {
crowdEditWechat
},
data () {
data() {
var validatorPhone = function (rule, value, callback) {
if (value && !/^(0|86|17951)?(13[0-9]|15[0123456789]|17[678]|18[0-9]|14[57])[0-9]{8}$/.test(value)) {
callback(new Error('手机号格式错误'))
......@@ -896,24 +462,27 @@ export default {
liveBroadcastRoomId: '',
groupQrCode: '',
floatingMaskDiagram: '',
liveBroadcastRoomCover: '',
liveBroadcastRoomEndCover: '',
employeeRegistrationLinkFlag: 2,
reservationInstallContactsName: '',
reservationInstallContactsPhone: '',
targetStock: '',
paymentAccountId: '',
// 战报内容配置
activityActionReport: {
produceReportSummary: '',
customerAssetSummary: '',
touchPassageSummary: '',
signMerchantShareCount: '',
signMerchantBrowseCount: '',
signMerchantVisitorCount: '',
signMerchantOrderCount: '',
signMerchantProduceCount: '',
noteTouchCustomerCount: '',
noteTouchVisitorCount: '',
noteTouchOrderCount: '',
noteTouchConversionRate: ''
produceReportSummary: '',
customerAssetSummary: '',
touchPassageSummary: '',
signMerchantShareCount: '',
signMerchantBrowseCount: '',
signMerchantVisitorCount: '',
signMerchantOrderCount: '',
signMerchantProduceCount: '',
noteTouchCustomerCount: '',
noteTouchVisitorCount: '',
noteTouchOrderCount: '',
noteTouchConversionRate: ''
}
},
reportFlag: '1',
......@@ -988,7 +557,8 @@ export default {
],
activityBigImg: [{ required: true, message: '请选择活动大图', trigger: 'change' }],
activityDetail: [{ required: true, message: '请输入活动详情', trigger: 'change' }],
forwardTitle: [{ required: true, message: '请输入转发标题', trigger: 'change' }]
forwardTitle: [{ required: true, message: '请输入转发标题', trigger: 'change' }],
paymentAccountId: [{ required: true, message: '请选择定金收款账户', trigger: 'change' }]
},
// 表单设置
formDescribeCheckList: [
......@@ -1217,14 +787,14 @@ export default {
maxlength: 80
}
],
// 玩家心得Obj
// 服务评价Obj
experiencesObj: {
name: '',
imageUrl: '',
experience: '',
activityExperienceImgs: []
},
// 玩家心得
// 服务评价
experiencesEditFormData: [
{
label: '心得内容',
......@@ -1528,6 +1098,15 @@ export default {
label: '直播配置',
name: 'live',
addHtml: 'live'
},
{
label: '定金收款账户',
name: 'paymentAccountId',
type: 'select',
tips: '定金收款账户只包含定金需要支付的目标账户',
optionId: 'id',
optionLabel: 'accountName',
optionList: []
}
],
//直播配置
......@@ -1570,52 +1149,106 @@ export default {
name: 'floatingMaskDiagram',
type: 'upload',
width: '320px',
limitSize: 5,
limitSize: 2,
maxPhotoNum: 1,
supportGif: true,
prefixSlot: 'defaultImg',
suffixSlot: 'floatingMaskDiagram',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result,
target = file.type == 'image/gif' ? 'uploadVideoApi' : 'uploadImgApi'
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common[target]({ file: base64 })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
})
this.uploadImgOrGif(e, file, targetItem)
}
},
{
label: '直播缩略图',
name: 'liveBroadcastRoomCover',
type: 'upload',
width: '320px',
limitSize: 2,
maxPhotoNum: 1,
supportGif: true,
prefixSlot: 'defaultImgCover',
handleUpload: (e, file, targetItem) => {
this.uploadImgOrGif(e, file, targetItem)
}
},
{
label: '回放缩略图',
name: 'liveBroadcastRoomEndCover',
type: 'upload',
width: '320px',
limitSize: 2,
maxPhotoNum: 1,
supportGif: true,
prefixSlot: 'defaultImgEndCover',
suffixSlot: 'liveBroadcastRoomEndCover',
handleUpload: (e, file, targetItem) => {
this.uploadImgOrGif(e, file, targetItem)
}
}
],
liveEditRule: {
liveBroadcastRoomId: [{ required: true, message: '请选择直播', trigger: 'change' }],
groupQrCode: [{ required: true, message: '请选择加群二维码', trigger: 'change' }],
floatingMaskDiagram: [{
required: true, validator: (rule, value, callback) => {
callback()
// groupQrCode: [{ required: true, message: '请选择加群二维码', trigger: 'change' }],
floatingMaskDiagram: [
{
required: true,
validator: (rule, value, callback) => {
callback()
}
}
}]
],
liveBroadcastRoomCover: [
{
required: true,
validator: (rule, value, callback) => {
callback()
}
}
],
liveBroadcastRoomEndCover: [
{
required: true,
validator: (rule, value, callback) => {
callback()
}
}
]
},
defaultImgObj: Object.freeze({
COVER_LIVE: 'https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/COVER_LIVE.gif',
COVER_REPLAY: 'https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/COVER_REPLAY.gif'
}),
defaultFloatingMaskDiagram: 'https://wx.glsx.com.cn/upload/biz/ba63349f-8e9e-4e80-be3b-45cc38dcf13f.gif'
}
},
mounted () {
mounted() {
this.getLiveList()
this.setMinHeight('.crowd-config')
this.routeInfo = this.$route.query
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : this.getPayList()
var id = this.routeInfo.id
var detailDisableList = ['editFormData']
// var detailDisableList = ['editFormData']
var disableObj = {
detail: ['editFormData', 'configEditFormData', 'serviceEditFormData', 'commoditysEditFormData', 'experiencesEditFormData', 'liveEditFormData'],
edit: ['editFormData']
}
if (this.routeInfo.addOrEdit == 'detail') {
this.isDisabled = true
disableObj.detail.forEach(attr => {
this.changeFormAttr(
attr,
'isDisabled',
this[attr].map(item => item.label),
true
)
})
}
if (id) {
if (this.routeInfo.addOrEdit == 'edit' && this.routeInfo.activityStatus == 2) {
// this.$refs.configEditFormRef.$refs.activityDetailTextBox[0].forbidEdit()
this.isDisabled = this.routeInfo.addOrEdit != 'add'
detailDisableList.forEach(attr => {
disableObj.edit.forEach(attr => {
this.changeFormAttr(
attr,
'isDisabled',
......@@ -1623,45 +1256,46 @@ export default {
true
)
})
this.changeFormAttr('configEditFormData', 'isDisabled', ['定金收款账户'], true)
}
}
},
watch: {
editForm: {
handler (val) {
handler(val) {
this.editStatus = true
},
deep: true
},
'editForm.activityPrice' (newValue, oldValue) {
'editForm.activityPrice'(newValue, oldValue) {
this.editForm.activityPrice = limitPrice(newValue, oldValue, 5, 2, 0)
},
'editForm.goodsStock' (newValue, oldValue) {
'editForm.goodsStock'(newValue, oldValue) {
this.editForm.goodsStock = limitPrice(newValue, oldValue, 5, 0, 0)
},
'editForm.activityTime' (newValue) {
'editForm.activityTime'(newValue) {
newValue && newValue.length && this.countDown()
},
'editForm.predictVolume' (newValue, oldValue) {
'editForm.predictVolume'(newValue, oldValue) {
this.editForm.predictVolume = limitPrice(newValue, oldValue, 7, 2, 0, 1000000)
},
'editForm.fictitiousGroupQuantity' (newValue, oldValue) {
this.editForm.fictitiousGroupQuantity = limitPrice(newValue, oldValue, 3, 0, 0, 100)
'editForm.fictitiousGroupQuantity'(newValue, oldValue) {
this.editForm.fictitiousGroupQuantity = limitPrice(newValue, oldValue, 3, 0, 0, 501)
},
'editForm.fictitiousLadderQuantity' (newValue, oldValue) {
'editForm.fictitiousLadderQuantity'(newValue, oldValue) {
this.editForm.fictitiousLadderQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
},
'editForm.fictitiousViewQuantity' (newValue, oldValue) {
'editForm.fictitiousViewQuantity'(newValue, oldValue) {
this.editForm.fictitiousViewQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
},
'editForm.liveBroadcastRoomId' (newValue, oldValue) {
'editForm.liveBroadcastRoomId'(newValue, oldValue) {
this.editForm.liveFlag = newValue ? true : false
},
'editForm.goodsId'(newValue, oldValue) {
if (newValue) {
let idx = this.editFormData.findIndex(val => val.name == 'goodsCategory')
this.editFormData[idx].isHide = false
let idx = this.editFormData.findIndex(val => val.name == 'goodsCategory')
this.editFormData[idx].isHide = false
}
},
'editForm.targetStock'(newValue, oldValue) {
......@@ -1694,13 +1328,13 @@ export default {
},
methods: {
changeFormAttr (formName, attrName, labelList, attrValue) {
changeFormAttr(formName, attrName, labelList, attrValue) {
labelList.forEach(item => {
let idx = this[formName].findIndex(k => k.label == item)
this[formName][idx][attrName] = attrValue
})
},
limitPriceForInput (val, intergerDigit, pointDigit, minValue, maxValue, regRule) {
limitPriceForInput(val, intergerDigit, pointDigit, minValue, maxValue, regRule) {
var _regRule = regRule || 'priceReg'
if (val && this.reg[_regRule].test(val + '')) {
maxValue = typeof maxValue == 'string' ? parseFloat(maxValue) : maxValue
......@@ -1724,12 +1358,26 @@ export default {
}
},
addZero (i) {
return i < 10 ? `0${i}` : `${i}`
uploadImgOrGif(e, file, targetItem) {
const imgFile = e.target.result,
target = file.type == 'image/gif' ? 'uploadVideoApi' : 'uploadImgApi'
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common[target]({ file: base64 })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
})
},
addZero(i) {
return i < 10 ? `0${i}` : `${i}`
},
findCountDownTime () {
findCountDownTime() {
let startTime = new Date(this.editForm.activityTime[0])
let endTime = new Date(this.editForm.activityTime[1])
let currentTime = new Date()
......@@ -1742,7 +1390,7 @@ export default {
}
},
countDown () {
countDown() {
if (this.editForm.activityTime && this.editForm.activityTime.length) {
let { activityStatus, startTime, endTime } = this.findCountDownTime()
let lefttime = parseInt((endTime.getTime() - startTime.getTime()) / 1000)
......@@ -1781,25 +1429,25 @@ export default {
}
},
handleTimeChange (value, targetItem) {
handleTimeChange(value, targetItem) {
!value && (this.editForm[targetItem.name] = [])
},
handleIsLimit (val) {
handleIsLimit(val) {
this.editForm.limitPurchaseNumber = val == 1 ? '' : '1'
this.editRule.limitPurchaseNumber[0].required = val != 1
},
handleRelateProChange (val) {
handleRelateProChange(val) {
this.editRule.goodsId[0].required = val == 2
var idx = this.editFormData.findIndex(item => item.name == 'goodsId')
this.editFormData[idx].isHide = val != 2
},
handleRelateProClose (targetItem) {
handleRelateProClose(targetItem) {
this.selectedProInfo = this.editForm.goodsId ? { id: this.editForm.goodsId } : {}
this.handleSingleSelectClose()
},
handleSingleSelectConfirm (selectedProInfo) {
handleSingleSelectConfirm(selectedProInfo) {
this.editForm.activityPrice = ''
this.editForm.goodsStock = ''
this.handleSingleSelectClose()
......@@ -1808,14 +1456,14 @@ export default {
this.getGoodInfo(selectedProInfo.id)
}
},
handleSingleSelectClose (isCancel = false) {
handleSingleSelectClose(isCancel = false) {
if (isCancel) {
this.selectedProInfo.id && this.getGoodInfo(this.selectedProInfo.id)
}
this.isSingleSelectVisible = !this.isSingleSelectVisible
},
getGoodInfo (id) {
getGoodInfo(id) {
if (!id) this.isDisabled = false
else this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
......@@ -1833,7 +1481,7 @@ export default {
},
// 规格值解构
changeSpecs (isRecovery) {
changeSpecs(isRecovery) {
this.specsWidth = 100 / (this.specificationDetailList.length + 4) + '%'
this.nameToValSpecsList = []
var markIdx = 0
......@@ -1902,7 +1550,7 @@ export default {
}
// console.log(this.nameToValSpecsList)
},
setLocaleCompare (params) {
setLocaleCompare(params) {
let keys = []
let obj = []
Object.keys(params).forEach(item => {
......@@ -1915,24 +1563,24 @@ export default {
return obj.join('&').replace(/,/g, '-')
},
// 恢复规格值
recoverySpec () {
recoverySpec() {
this.changeSpecs(true)
},
//规格-秒杀价输入控制
activityPrice_input (val, maxValue) {
activityPrice_input(val, maxValue) {
return this.limitPriceForInput(val, 5, 2, 0, maxValue)
},
//规格-活动库存输入控制
goodsStock_input (val, maxValue) {
goodsStock_input(val, maxValue) {
return this.limitPriceForInput(val, 5, 0, 0, maxValue)
},
// 音乐
handleMusicUpload () { },
handleMusicUpload() { },
musicUpload (e, targetItem) {
musicUpload(e, targetItem) {
var reader = new FileReader()
var file = e
// 默认1MB
......@@ -1971,7 +1619,7 @@ export default {
},
// 音乐
handleMusic (targetItem, idx) {
handleMusic(targetItem, idx) {
// stop-音频结束;play-音频播放
var playFlag = this.playObj.idx != -1 && this.playObj.idx == idx ? 'stop' : 'play'
var audioDom = document.getElementById('music-audio')
......@@ -1991,12 +1639,15 @@ export default {
})
},
stopMusic () {
stopMusic() {
this.playObj.idx = -1
this.playObj.src = ''
},
handleMusicChange (idx) {
handleMusicChange(idx) {
if (this.isDisabled) {
return true
}
this.musicList.forEach((item, index) => {
if (index != idx) {
item.isCheck = false
......@@ -2006,23 +1657,23 @@ export default {
this.editForm.activityMusic = this.musicList[idx].isCheck ? this.musicList[idx].addr : ''
},
handleMusicBeforeUpload (file, targetItem) {
handleMusicBeforeUpload(file, targetItem) {
this.stopMusic()
this.musicUpload(file, targetItem)
},
handleMusicDelete (targetItem) {
handleMusicDelete(targetItem) {
this.$set(this.editForm, targetItem.name, '')
this.fileList = []
},
// 表单设置
handleDescribeAdd () {
handleDescribeAdd() {
this.formDescribeList.push({
value: ''
})
},
handleDescribeDelete (idx) {
handleDescribeDelete(idx) {
this.$messageBox.confirm('是否删除该表单设置?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -2035,13 +1686,13 @@ export default {
})
},
listAddIdx (list) {
listAddIdx(list) {
list.forEach((item, index) => {
item.idx = index
})
},
dealItem (attr, formAttr) {
dealItem(attr, formAttr) {
switch (attr) {
case 'services':
break
......@@ -2053,8 +1704,8 @@ export default {
}
},
// 服务说明,商品答疑,玩家心得
handleAddItem (attr, formAttr, limitNum) {
// 服务说明,商品答疑,服务评价
handleAddItem(attr, formAttr, limitNum) {
if (this.editForm[formAttr].length >= limitNum) {
return true
}
......@@ -2063,7 +1714,7 @@ export default {
this.dealItem(attr, formAttr)
},
handleDeleteItem (attr, formAttr, idx) {
handleDeleteItem(attr, formAttr, idx) {
this.$confirm('是否删除该项?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -2106,7 +1757,7 @@ export default {
// })
// },
getInfo () {
getInfo() {
this.loading = true
this.reportFlag = '1'
this.$apis.seckillActivity
......@@ -2116,7 +1767,7 @@ export default {
this.editForm = this.$common.utils.deepClone(res)
this.activityInfo = info
this.$set(this.editForm, 'activityTime', [info.startTime, info.endTime])
this.routeInfo.addOrEdit == 'edit' && this.getGoodInfo(info.goodsId)
this.routeInfo.addOrEdit != 'add' && this.getGoodInfo(info.goodsId)
if (info.activityPrice != null && info.goodsStock != null) {
this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2)
this.editForm.goodsStock = info.goodsStock + ''
......@@ -2137,7 +1788,9 @@ export default {
// 活动详情
if (info.activityDetail) {
this.editForm.activityDetail = decodeURIComponent(info.activityDetail)
this.$refs.configEditFormRef.$refs.activityDetailTextBox[0].setEdit(this.editForm.activityDetail)
if (!this.isDisabled) {
this.$refs.configEditFormRef.$refs.activityDetailTextBox[0].setEdit(this.editForm.activityDetail)
}
}
// 活动音乐
if (info.activityMusic) {
......@@ -2177,7 +1830,7 @@ export default {
if (!this.formDescribeList.length) {
this.formDescribeList = [{ value: '' }]
}
// 玩家心得
// 服务评价
if (this.editForm.activityExperienceDTOs.length) {
this.editForm.activityExperienceDTOs.forEach((item, index) => {
item.idx = index
......@@ -2186,24 +1839,24 @@ export default {
}
// 复制
if (this.routeInfo.addOrEdit == 'copy') {
let resetArr = [{ name: 'id' }, { name: 'activityTime', type: 'array' }, { name: 'liveBroadcastRoomId' }, { name: 'groupQrCode' }, { name: 'floatingMaskDiagram' }, { name: 'selectedProInfo', type: 'Object' }, { name: 'goodsId' }, { name: 'activityPrice' }, { name: 'goodsStock' }]
let resetArr = [{ name: 'id' }, { name: 'activityTime', type: 'array' }, { name: 'liveBroadcastRoomId' }, { name: 'groupQrCode' }, { name: 'floatingMaskDiagram' }, { name: 'liveBroadcastRoomCover' }, { name: 'liveBroadcastRoomEndCover' }, { name: 'selectedProInfo', type: 'Object' }, { name: 'goodsId' }, { name: 'activityPrice' }, { name: 'goodsStock' }]
this.copyReset(resetArr)
}
// 兼容以前众筹活动没有战报内容配置,展示页面
if (this.editForm.activityActionReport == null) {
this.editForm.activityActionReport = {
produceReportSummary: '',
customerAssetSummary: '',
touchPassageSummary: '',
signMerchantShareCount: '',
signMerchantBrowseCount: '',
signMerchantVisitorCount: '',
signMerchantOrderCount: '',
signMerchantProduceCount: '',
noteTouchCustomerCount: '',
noteTouchVisitorCount: '',
noteTouchOrderCount: '',
noteTouchConversionRate: ''
produceReportSummary: '',
customerAssetSummary: '',
touchPassageSummary: '',
signMerchantShareCount: '',
signMerchantBrowseCount: '',
signMerchantVisitorCount: '',
signMerchantOrderCount: '',
signMerchantProduceCount: '',
noteTouchCustomerCount: '',
noteTouchVisitorCount: '',
noteTouchOrderCount: '',
noteTouchConversionRate: ''
}
}
// 标杆门店总产值/元(已结束战报)
......@@ -2214,6 +1867,7 @@ export default {
if (this.editForm.activityActionReport.noteTouchConversionRate) {
this.editForm.activityActionReport.noteTouchConversionRate = (info.activityActionReport.noteTouchConversionRate / 100).toFixed(2)
}
this.getPayList()
this.$nextTick(() => {
this.editStatus = false
})
......@@ -2223,7 +1877,7 @@ export default {
})
},
copyReset (arr) {
copyReset(arr) {
let val = {
array: [],
Object: {},
......@@ -2234,7 +1888,7 @@ export default {
})
},
validateRules () {
validateRules() {
if (this.specificationDetailList.length) {
this.editRule.activityPrice[0].required = false
this.editRule.goodsStock[0].required = false
......@@ -2244,7 +1898,7 @@ export default {
}
},
getCouponInfoParams () {
getCouponInfoParams() {
var _this = this
var param = this.$common.utils.deepClone(this.editForm)
param.marketingType = 3
......@@ -2297,10 +1951,13 @@ export default {
//直播
if (param.liveFlag) {
if (!param.floatingMaskDiagram) param.floatingMaskDiagram = this.defaultFloatingMaskDiagram
if (!param.liveBroadcastRoomCover) param.liveBroadcastRoomCover = this.defaultImgObj.COVER_LIVE
if (!param.liveBroadcastRoomEndCover) param.liveBroadcastRoomEndCover = this.defaultImgObj.COVER_REPLAY
} else {
param.liveBroadcastRoomId = ''
param.groupQrCode = ''
param.floatingMaskDiagram = ''
let resetAttr = this.liveEditFormData.map(item => item.name)
resetAttr.forEach(item => {
param[item] = ''
})
}
// 标杆门店总产值/元(已结束战报)
if (param.activityActionReport.signMerchantProduceCount) {
......@@ -2308,27 +1965,27 @@ export default {
}
// 判断目标客户数与访客数
if (param.activityActionReport.noteTouchCustomerCount && param.activityActionReport.noteTouchVisitorCount) {
if (Number(param.activityActionReport.noteTouchCustomerCount) < Number(param.activityActionReport.noteTouchVisitorCount)) {
this.loading = false
this.$message({
message: '目标客户数应大于等于访客数',
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
if (Number(param.activityActionReport.noteTouchCustomerCount) < Number(param.activityActionReport.noteTouchVisitorCount)) {
this.loading = false
this.$message({
message: '目标客户数应大于等于访客数',
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
}
// 判断访客数与浏览数
if (param.activityActionReport.signMerchantVisitorCount && param.activityActionReport.signMerchantBrowseCount) {
if (Number(param.activityActionReport.signMerchantBrowseCount) < Number(param.activityActionReport.signMerchantVisitorCount)) {
this.loading = false
this.$message({
message: '浏览数应大于等于访客数',
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
if (Number(param.activityActionReport.signMerchantBrowseCount) < Number(param.activityActionReport.signMerchantVisitorCount)) {
this.loading = false
this.$message({
message: '浏览数应大于等于访客数',
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
}
// 已结束战报转化率计算
param.activityActionReport.noteTouchConversionRate = ""
......@@ -2341,20 +1998,20 @@ export default {
},
// 服务说明
handleArrow (attr) {
handleArrow(attr) {
this.arrowFlagObj[attr] = this.arrowFlagObj[attr] == 'open' ? 'close' : 'open'
},
handleWechat () {
handleWechat() {
this.wechatVisible = !this.wechatVisible
},
// 跳转
whereToGo (id) {
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
checkValid (validList) {
checkValid(validList) {
for (let i = 0; i < validList.length; i++) {
let item = validList[i]
if (item.valid) {
......@@ -2365,7 +2022,7 @@ export default {
return true
},
addOrUpdate () {
addOrUpdate() {
this.loading = true
var params = this.getCouponInfoParams()
this.$apis.seckillActivity
......@@ -2385,7 +2042,7 @@ export default {
},
// 去掉list空值
delListAllEmpty (listName, attrParamsList) {
delListAllEmpty(listName, attrParamsList) {
if (!this.editForm[listName].length) {
return this.editForm[listName]
}
......@@ -2408,7 +2065,7 @@ export default {
return list
},
handleConfirm () {
handleConfirm() {
this.stopMusic()
this.editForm.activityServices = this.delListAllEmpty('activityServices', ['title', 'content'])
this.editForm.activityCommoditys = this.delListAllEmpty('activityCommoditys', ['question', 'answer'])
......@@ -2498,13 +2155,13 @@ export default {
})
})
},
cancelJump () {
cancelJump() {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
handleCancel () {
if (this.editStatus) {
handleCancel() {
if (this.editStatus && this.addOrEdit != 'detail') {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -2519,7 +2176,7 @@ export default {
}
},
//获取跟进员工
getLiveList () {
getLiveList() {
this.$apis.seckillActivity.getLiveListApi({}).then(res => {
if (res.length == 0) return ''
const index = this.liveEditFormData.findIndex(item => {
......@@ -2534,6 +2191,16 @@ export default {
this.liveEditFormData.find(item => item.name == 'liveBroadcastRoomId').optionList = staff
})
},
// 定金收款账户
getPayList() {
this.$apis.seckillActivity.getPayListApi({}).then(res => {
this.configEditFormData.find(item => item.name == 'paymentAccountId').optionList = res
this.editForm.paymentAccountId = this.editForm.paymentAccountId || res.find(item => item.isDefault == 'Y').id
this.$nextTick(() => {
this.editStatus = false
})
})
}
}
}
</script>
......@@ -2589,8 +2256,8 @@ export default {
min-height: 680px;
}
.edit-activity .customer-service {
width: 656px;
padding: 20px 20px 0 20px;
width: 766px;
padding: 20px 20px 2px 20px;
background: #f9f9f9;
}
.edit-activity .music-box {
......@@ -2807,8 +2474,8 @@ export default {
display: inline-block;
border-radius: 4px;
cursor: pointer;
margin-right: 8px;
position: relative;
margin: 10px 8px 0 0;
&::after {
position: absolute;
right: 0;
......@@ -2847,7 +2514,7 @@ export default {
flex-direction: column;
width: 574px;
height: 124px;
background: #F9F9F9;
background: #f9f9f9;
justify-content: center;
.phoneClass {
margin-bottom: 0px !important;
......@@ -2855,20 +2522,20 @@ export default {
}
.reportConfigure-bag {
width: 964px;
background: #F9F9F9;
background: #f9f9f9;
.el-tabs__nav-scroll {
border-bottom: 1px solid #E8E8E8;
border-bottom: 1px solid #e8e8e8;
}
.el-tabs__item.is-active {
border: 0px solid #f9f9f9 !important;
border-bottom: 1px solid #5850ff !important;
background: #F9F9F9 !important;
background: #f9f9f9 !important;
}
.el-form-item--small.el-form-item {
margin: 20px 0 10px 74px;
}
.el-textarea .el-input__count {
background: #F9F9F9;
background: #f9f9f9;
bottom: 2px;
right: -44px;
}
......
......@@ -9,7 +9,7 @@ const cdn = {
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, `${CDN_DOMAIN}ajax/libs/moment/2.24.0/moment.js`, 'https://webapi.amap.com/loader.js']
}
module.exports = {
outputDir: `../dist/${packageName}`,
outputDir: `dist`,
publicPath,
assetsDir: 'static',
productionSourceMap: false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!